perf event issue

276 views
Skip to first unread message

Prakash Narayanan

unread,
Aug 17, 2022, 10:06:49 AM8/17/22
to ptools-perfapi
Hi
I have compiled using ICC oneAPI.

./papi_component_avail
Available components and hardware information.
--------------------------------------------------------------------------------
PAPI version             : 6.0.0.1
Operating system         : Linux 5.15.0-43-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (140, 0x8c)
CPU revision             : 1.000000
CPUID                    : Family/Model/Stepping 6/140/1, 0x06/0x8c/0x01
CPU Max MHz              : 4700
CPU Min MHz              : 400
Total cores              : 8
SMT threads per core     : 2
Cores per socket         : 4
Sockets                  : 1
Cores per NUMA region    : 8
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 0
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

Compiled-in components:
Name:   perf_event              Linux perf_event CPU counters
   \-> Disabled: Unknown libpfm4 related error
Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
   \-> Disabled: No uncore PMUs or events found

Active components:
--------------------------------------------------------------------------------
compiled-in components shows disabled for perf_event due to some unknown errors in libpfm4
Can you help debug what is the issue?




Vince Weaver

unread,
Aug 17, 2022, 10:24:34 AM8/17/22
to Prakash Narayanan, ptools-perfapi
On Wed, 17 Aug 2022, Prakash Narayanan wrote:

> Model string and code : 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
> (140, 0x8c)
> CPUID : Family/Model/Stepping 6/140/1, 0x06/0x8c/0x01


> Compiled-in components:
> Name: perf_event Linux perf_event CPU counters
> \-> Disabled: Unknown libpfm4 related error


It looks like you are using a TigerLake processor, which is new enough
that PAPI doesn't support it (it doesn't look like libpfm4 has support
yet).

The error message from libpfm4 is not hepful, this is a problem in PAPI
that was recently and I forgot it wasn't fixed yet, I'll need to
make sure it gets fixed before the next major release.

Vince Weaver
vincent...@maine.edu

Giuseppe Congiu

unread,
Aug 29, 2022, 4:15:57 PM8/29/22
to ptools-perfapi, ptools-perfapi, pran...@gmail.com, Vince Weaver
Hi,

I refactored the perf_event init_component code to make it a bit more robust (available at: https://bitbucket.org/icl/papi/pull-requests/322). I don't know if this solves the problem Vince was referring to. Could you please give it a try?

Best,
Giuseppe

Giuseppe Congiu

unread,
Aug 30, 2022, 5:06:52 AM8/30/22
to Prakash Narayanan, ptools-perfapi, vincent.weaver
Hi Prakash,

Thank you for the feedback. It looks like libpfm4 is detecting an icelake (icl) PMU. Unfortunately, this is not yet supported by PAPI when it comes to preset events (these would appear in the papi_events.csv file). This is why papi_avail is not giving any availability for PAPI_L1_DCM, PAPI_L1_ICM, and so on. However, support for icl preset events should be added soon.

Best,
Giuseppe



On Tue, Aug 30, 2022 at 10:55 AM Prakash Narayanan <pran...@gmail.com> wrote:
Dear Giuseppe,

Thank you for the response.
I have cloned your repository, and with git checkout your changes are reflected.  In the compiled code I have run the ./papi_avail and ./papi_component_avail.
It looks there is something more to be done to make the events to be read PAPI. The improvement with the new additions carried out is PAPI has identified the number of hardware counters, and libperf4 events error disappeared, yet to be enabled!!!
I am posting the output of ./papi_avail and ./papi_component_avail below.  Hope that will help resolve the issue fully.


./papi_avail
Available PAPI preset and user defined events plus hardware information.
--------------------------------------------------------------------------------
PAPI version             : 6.0.0.1
Operating system         : Linux 5.15.0-46-generic

Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (140, 0x8c)
CPU revision             : 1.000000
CPUID                    : Family/Model/Stepping 6/140/1, 0x06/0x8c/0x01
CPU Max MHz              : 4700
CPU Min MHz              : 400
Total cores              : 8
SMT threads per core     : 2
Cores per socket         : 4
Sockets                  : 1
Cores per NUMA region    : 8
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 19

Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

================================================================================
  PAPI Preset Events
================================================================================
    Name        Code    Avail Deriv Description (Note)
PAPI_L1_DCM  0x80000000  No    No   Level 1 data cache misses
PAPI_L1_ICM  0x80000001  No    No   Level 1 instruction cache misses
PAPI_L2_DCM  0x80000002  No    No   Level 2 data cache misses
PAPI_L2_ICM  0x80000003  No    No   Level 2 instruction cache misses
ALL List of events are here but deleted to avoid confusion

--------------------------------------------------------------------------------
Of 108 possible events, 0 are available, of which 0 are derived.

No events detected!  Check papi_component_avail to find out why.


./papi_component_avail
Available components and hardware information.
--------------------------------------------------------------------------------
Information will come here same as ./papi_avail command
then the following message comes
--------------------------------------------------------------------------------


Compiled-in components:
Name:   perf_event              Linux perf_event CPU counters
Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
   \-> Disabled: No uncore PMUs or events found

Active components:

Name:   perf_event              Linux perf_event CPU counters
                                Native: 165, Preset: 0, Counters: 19
                                PMUs supported: ix86arch, perf, perf_raw, icl
-------------------------------------------------------------------------------

Giuseppe Congiu

unread,
Aug 30, 2022, 5:12:35 AM8/30/22
to Prakash Narayanan, ptools-perfapi, vincent.weaver
Almost forgot,

Even though preset events are not yet available for your CPU, you can still use PAPI to monitor native events. You can get a full list of native events using papi_native_avail (papi_avail is for preset events only).

Best,
Giuseppe

Giuseppe Congiu

unread,
Sep 1, 2022, 11:03:41 AM9/1/22
to Prakash Narayanan, vincent.weaver, ptools-perfapi
Thanks a lot! 

On Thu, Sep 1, 2022 at 4:08 PM Prakash Narayanan <pran...@gmail.com> wrote:
Hi Giuseppe,

I have checked the new changes.  The output remains the same.  I guess that is what you expected.
-----------------------------------------------------------------------------

Compiled-in components:
Name:   perf_event              Linux perf_event CPU counters
Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
   \-> Disabled: No uncore PMUs or events found

Active components:
Name:   perf_event              Linux perf_event CPU counters
                                Native: 165, Preset: 0, Counters: 19
                                PMUs supported: ix86arch, perf, perf_raw, icl
-------------------------------------------------------------------------------




Regards

Prakash Narayanan M
Thrikakkara
Kochi
***************************************************************************************************************
The purpose of life is a life of purpose.
***************************************************************************************************************



On Thu, 1 Sept 2022 at 15:43, Giuseppe Congiu <gco...@icl.utk.edu> wrote:
Hi Prakash,

I had to modify the pull request https://bitbucket.org/icl/papi/pull-requests/322 a little bit. Could you give it another spin and check it still works?

Thanks,
Giuseppe

On Tue, Aug 30, 2022 at 3:28 PM Prakash Narayanan <pran...@gmail.com> wrote:
Hi Giuseppe,

Thank you for the brief explanation.  That gives a good insight.  It will help while going through the documentation link you have given 

Regards

Prakash Narayanan M
Thrikakkara
Kochi


On Tue, 30 Aug 2022 at 17:00, Giuseppe Congiu <gco...@icl.utk.edu> wrote:
Hi Prakash,

Preset events are (Papi defined) events common to all cpus, and recognised (by performance engineers) as important indicators of performance (intended as efficient utilisation of the hw by the user application). These are computed starting from the cpu specific native events. The reason is that each cpu might use different names for similar events or might even define events differently when compared with other cpus from the same vendor. You may already see how problematic can be for users to analyse performance on different cpus using native events. Papi preset events are platform independent because we make sure that when users access the L2 data cache misses using PAPI_L2_DCM, for example, these represent the same quantities on AMD, intel, ARM and even across different cpu models from the same vendor. The papi_events.csv file contains the formulas used by Papi to compute these platform independent preset events using reverse Polish notation. You can open that file and see exactly how each preset is computed for different performance monitoring units (PMU).

I hope this is a sufficiently clear explanation to get you started with papi. For more details please consult the documentation on our wiki: https://bitbucket.org/icl/papi/wiki/PAPI-Overview.md

Best,
Giuseppe

On Tue, Aug 30, 2022 at 11:23 AM Prakash Narayanan <pran...@gmail.com> wrote:
Hi Giuseppe

Thanks for the addition.
If I may ask you, what is the difference between preset events and native events?  I am new to using PAPI, that is why this question arises.


Regards

Prakash Narayanan M
Thrikakkara
Kochi
***************************************************************************************************************
The purpose of life is a life of purpose.
***************************************************************************************************************


Reply all
Reply to author
Forward
0 new messages