Kevin,

On Mon, May 08, 2006 at 10:11:29AM -0500, Kevin Corry wrote:
> 
> Right now libpfm has the pfm_find_event_* and pfm_get_event_* APIs. My 
> initial 
> impression is that we could add APIs along the lines of pfm_find_event_mask_* 
> and pfm_get_event_mask_*, which would search within one specified "parent" 
> event for the specified mask information. And pfm_dispatch_events() and its 
> input parameters would have to be updated to account for these event-masks. 
> And obviously if a PMU doesn't have the notion of event-masks (like 
> POWER4/5), then it simply doesn't need to provide any information for these 
> new APIs. Any thoughts?
> 

I have been thinking about that new API too. We need to ensure that the unit
mask combinations are supported. Take Opteron, for instance. the 
SEGMENT_REGISTER_LOADS
event has one unit mask bit per segment register (ES, CS, SS, DS, ....). You 
can choose from
any unit mask or combination thereof. You can say "DS OR SS", "DS OR SS OR ES",
and so on.

With libpfm, the actual unit mask value is never exposed to user. I am wondering
how we can express the "OR" condition in the interface of libpfm.

At the pfmon level, I can see a syntax as follows:
                pfmon -eSEGMENT_REGISTER_LOADS:ES:DS,CPU_CLK_UNHALTED ......

At the libpfm level, we could pass a list of unit mask names and let the library
figure out the bit value. Keep in mind that the application does not know and
does not want to know the bit layout of the PMC register to know where to stick
the unit mask bits. As such, you cannot have an interface where you'd query the
unit mask value for ES, and DS and then let the tool merge the two and store
the value in the unit mask bit position. There are issues with this as not all
unit masks can be combined. This job has to be done by the library.

The other issue is that the interface is based on this idea that when you find 
the event,
you get an opaque descriptor for it. That descriptor is then passed to the core 
dispatch()
routine. If you do the find_event(), separately from find_umask() then what 
descriptor
do you pass to dispatch(). It seems that the unmask portion would have to be 
passed
only at the level of dispatch().

Any thoughts on this?

-- 
-Stephane
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to