Hi Will, Stefane,

I’ve looked at the code in libpfm.

I believe this is actually an error in the encoding of the PMU tables for Power 
9. These events have different PMU encodings, and the power9 header file 
properly defines them with an _ALT suffix. However, the event table MISSES this 
qualifier. Since the actual event encoding is different (and I’m not sure what 
the bits mean), the names should absolutely be different. If not, then libpfm 
has the .equiv member precisely for this purpose - and even for those the event 
name needs to be different - and none of those entries exist on Power9.

If someone can clarify the differences between the events and their event_ALT 
variant, that would help.

[ POWER9_PME_PM_CO0_BUSY ] = {
        .pme_name = "PM_CO0_BUSY",
        .pme_code = 0x000003608C,
        .pme_short_desc = "CO mach 0 Busy.",
        .pme_long_desc = "CO mach 0 Busy. Used by PMU to sample ave CO lifetime\
 (mach0 used as sample point)",
},
[ POWER9_PME_PM_CO0_BUSY_ALT ] = {
        .pme_name = "PM_CO0_BUSY",
        .pme_code = 0x000004608C,
        .pme_short_desc = "CO mach 0 Busy.",
        .pme_long_desc = "CO mach 0 Busy. Used by PMU to sample ave CO lifetime\
 (mach0 used as sample point)",
},

According to me, the second should be named BUSY_ALT. (Or removed entirely, 
since the description provides zero information as to the difference…)

I’ve checked this and it is the same with all the duplicates. 

NOTE: libpfm actually fails in this case too although much more gracefully. See 
here. This is a BUG!

$ LIBPFM_FORCE_PMU=power9 ./examples/showevtinfo -E -M PM_CO0_BUSY
0x3608c power9::PM_CO0_BUSY
0x3608c power9::PM_CO0_BUSY

BUT

$ LIBPFM_FORCE_PMU=power9 ./examples/showevtinfo PM_CO0_BUSY
.
.
.
#-----------------------------
IDX      : 562036829
PMU name : power9 (POWER9)
Name     : PM_CO0_BUSY
Equiv    : None
Flags    : None
Desc     : CO mach 0 Busy. Used by PMU to sample ave CO lifetime (mach0 used as 
sample point)
Code     : 0x3608c
#-----------------------------
IDX      : 562036830
PMU name : power9 (POWER9)
Name     : PM_CO0_BUSY
Equiv    : None
Flags    : None
Desc     : CO mach 0 Busy. Used by PMU to sample ave CO lifetime (mach0 used as 
sample point)
Code     : 0x4608c

My recommendation is to submit a patch that renames these duplicates as _ALT 
for their name AND to clarify what the differences are. 

Hope this helps.

> On Dec 1, 2017, at 10:25 PM, William Cohen <wco...@redhat.com> wrote:
> 
> Should libpfm be allowing multiple entries with the same pme_name that could 
> be both be available on the same time?  Or should each pme_name be unique?
> 
> Should papi be able to handle the case of non-unique pme_name?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to