Re: [perfmon2] [PATCH] 1/1 - add kernel support for POWER4 and POWER6 to perfmon2
Status: Beta
Brought to you by:
seranian
From: Corey A. <cja...@us...> - 2007-11-29 01:48:18
|
Stephane Eranian wrote: > Corey, > ... >> I haven't looked at the sampling code in perfmon carefully. Does it >> know when the counter that has been assigned to count the event it wants >> to sample on does not support overflow interrupting? Is this something >> libpfm needs to be aware of? >> > > The kernel does not know which counter can/cannot overflow. Typically > you have to set a bit in the config register for the counter so that it > triggers an interrupt on overflow. The bit is forced in the default value > of each register. This is needed for 64-bit wide emulation. No matter what > libpfm does the bit is overriden by the kernel. But there is no explicit flag > that says: "register can overflow". In fact non counter registers can also > trigger interrupts, e.g., AMD Barcelona IBS registers. > ... Here's what I don't understand... I have looked at the perfmon interface doc and it seems to assume (or I am reading into it) that all counters can interrupt on overflow somehow, by turning on a bit somewhere: 3.4.3 Counter Overflow notifications When a counter overflows, it is possible to receive a notification. The notification is never automatic and must be requested by specifying the PFM REGFL OVFL NOTIFY flag on the controlling PMC register. When the flag is not set, the counter simply wraps around on overflow. My concern is that someone using an interface such as PAPI will try to set up sampling based on an instructions event counter, and let's say they just want to sample IP addresses. For POWER6, if they specify sampling in user + kernel + supervisor (aka hypervisor) mode, they will likely be assigned an event group that uses PMC5, which cannot interrupt. The sampling will not work, correct? It seems like there might be a disconnect here between libpfm knowing that the register the user wants to sample on cannot interrupt, and the user who assumes it can. Thanks, - Corey Corey Ashford Software Engineer IBM Linux Technology Center, Linux Toolchain Beaverton, OR 503-578-3507 cja...@us... |