RFC: Performance Monitor Counters device
Segher Boessenkool
segher at koffie.nl
Sat Sep 14 21:36:29 EST 2002
Paul Mackerras wrote:
> I'm curious - how are you going to cope with the fact that different
> PPC implementations have different numbers of PMCs and different
> sets of events (and numbering of the events) that the PMCs will count?
The kernel module doesn't care, except for not allowing illegal values;
userland doesn't care all that much either, really, as a number is just
a number :) It's mostly the user that cares.
Ah well, an example might clarify:
ppcprofile --pmc1=6 --pmc2=6 ./hello_world
ppcprofile will look for existence of /proc/sys/debug/pmc/pmc[12], and
do some sysctls on it. i.e., the kernel module will only make entries
for available hardware.
Note that the kernel module doesn't need to check if a certain event
number is defined; it only needs to check if it fits into the number
of bits allocated to it.
Segher
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-dev
mailing list