Kevin, On Fri, Jun 02, 2006 at 09:05:48AM -0500, Kevin Corry wrote: > > > > Another note about the arch-specific module APIs - there seems to be a > > > lot of inconsistency in how parameters and return values are passed. For > > > instance, > > > > You have to be careful here. Some routines are below the generic > > layer, e.g., pfm_ita2_get_event_name(). Others are user interface that > > are arch-specific, e.g., pfm_ita2_get_event_maxincr(). > > I was actually only referring to the routines defined in pfm_pmu_support_t > (the "generic" interface as you refer to it below). > Ok, so show me the routines that are not following the model and I'll fix them.
> > In general you > > can tell by verifying whether the function is declared static or not. > > Not the greatest test, I agree. I wanted to avoid re-using the same name > > in each file to avoid confusion when debugging. But I think it would make > > it easier to distinguish between arch-private interface and implementation > > of the generic interface. We could say pfm_arch_get_event_name() for > > something needed for the generic interface and keep the pfm_ita2_ prefix > > pattern. > > I actually haven't looked through much of the ia64 code yet, so I wasn't > aware > it had its own "external" APIs. So are these exposed to the user of the > library? Are there any restrictions or guidelines on what APIs can/should be > exported? I can definitely think of some possibilities for "private" APIs for > Pentium4 (such as event-tagging and event-filtering). > The guideline is that you implement arch-private user interface to give user access to PMU-model (or PMU architecture) specific information. For instance, on Itanium, you may set a threshold to indicate when to increment a counter. For instance, you can have up to 6 instructions per cycle on Itanium 2. The IA64_INST_RETIRED event counts retired instructions. It supports thresholding. As such you may ask to count the number of times more than 4 instructions are retired per cycle by setting the threshold field (to 4) in the corresponding PMC register. This feature is model specific. Depending on the event the maximum threshold can vary. There is an interface, pfm_ita2_get_event_maxincr(), to retrieve the max value so that tool can warn users when they specify invalid thresholds. Model specific interfaces are declared in the PMU-model specific header file. In the example above, it is declared in pfmlib_itanium2.h. I think the P4 tagging and filtering mechanisms may qualify for this kind of interface. You need to provide one ONLY if this can be useful to tools. -- -Stephane _______________________________________________ perfmon mailing list [email protected] http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/
