パフォーマンスはうまく機能しているようですが、PAPIにはUbuntuで利用可能なイベントはありません。

パフォーマンスはうまく機能しているようですが、PAPIにはUbuntuで利用可能なイベントはありません。

私のコンピュータにPAPIをインストールしようとしています。

$ uname -a
Linux XXXXXX 5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

そして、どんなイベントも検出できません。

$ papi_avail

...

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.
--------------------------------------------------------------------------------
PAPI version             : 7.0.1.0
Operating system         : Linux 5.19.0-35-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (140, 0x8c)
CPU revision             : 1.000000
CPUID                    : Family/Model/Stepping 6/140/1, 0x06/0x8c/0x01
CPU Max MHz              : 4800
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
--------------------------------------------------------------------------------

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
Name:   sysdetect               System info detection component

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

Name:   sysdetect               System info detection component
                                Native: 0, Preset: 0, Counters: 0


--------------------------------------------------------------------------------

UbuntuシステムのINSTALL.txtファイルの指示に従って、それを追加して実行してKERNEL=="perfctr", MODE="0666"設定しました。/etc/udev/rules.d/40-permissions.rules/proc/sys/kernel/perf_event_paranoid-1$ sudo sh -c "echo -1 > /proc/sys/kernel/perf_event_paranoid"$ sudo sh -c 'echo kernel.perf_event_paranoid=-1 > /etc/sysctl.d/local.conf'

papiがperfを介してこれらのイベントにアクセスすることを私が理解している限り、ほとんどのテストはうまくいくようです。

$ perf test                
  1: vmlinux symtab matches kallsyms            : Skip
  2: Detect openat syscall event                : Skip (permissions)
  3: Detect openat syscall event on all cpus    : Skip (permissions)
  4: Read samples using the mmap interface      : Skip (permissions)
  5: Test data source output                    : Ok
  6: Parse event definition strings             :
  6.1: Test event parsing                       : Skip (permissions)
  6.2: Test parsing of "hybrid" CPU events      : Skip (not hybrid)
  6.3: Parsing of all PMU events from sysfs     : Ok
  6.4: Parsing of given PMU events from sysfs   : Ok
  6.5: Parsing of aliased events from sysfs     : Skip (no aliases in sysfs)
  6.6: Parsing of aliased events                : Ok
  6.7: Parsing of terms (event modifiers)       : Ok
  7: Simple expression parser                   : Ok
  8: PERF_RECORD_* events & perf_sample fields  : Ok
  9: Parse perf pmu format                      : Ok
 10: PMU events                                 :
 10.1: PMU event table sanity                           : Ok
 10.2: PMU event map aliases                            : Ok
 10.3: Parsing of PMU event table metrics               : Ok
 10.4: Parsing of PMU event table metrics with fake PMUs: Ok
 11: DSO data read                              : Ok
 12: DSO data cache                             : Ok
 13: DSO data reopen                            : Ok
 14: Roundtrip evsel->name                      : Ok
 15: Parse sched tracepoints fields             : FAILED!
 16: syscalls:sys_enter_openat event fields     : FAILED!
 17: Setup struct perf_event_attr               : Skip
 18: Match and link multiple hists              : Ok
 19: 'import perf' in python                    : Ok
 20: Breakpoint overflow signal handler         : Ok
 21: Breakpoint overflow sampling               : Ok
 22: Breakpoint accounting                      : Ok
 23: Watchpoint                                 :
 23.1: Read Only Watchpoint                     : Skip (missing hardware support)
 23.2: Write Only Watchpoint                    : Ok
 23.3: Read / Write Watchpoint                  : Ok
 23.4: Modify Watchpoint                        : Ok
 24: Number of exit events of a simple workload : Ok
 25: Software clock events period values        : Ok
 26: Object code reading                        : FAILED!
 27: Sample parsing                             : Ok
 28: Use a dummy software event to keep tracking: Ok
 29: Parse with no sample_id_all bit set        : Ok
 30: Filter hist entries                        : Ok
 31: Lookup mmap thread                         : Ok
 32: Share thread maps                          : Ok
 33: Sort output of hist entries                : Ok
 34: Cumulate child hist entries                : Ok
 35: Track with sched_switch                    : Ok
 36: Filter fds with revents mask in a fdarray  : Ok
 37: Add fd to a fdarray, making it autogrow    : Ok
 38: kmod_path__parse                           : Ok
 39: Thread map                                 : Ok
 40: LLVM search and compile                    :
 40.1: Basic BPF llvm compile                    : Skip
 40.2: kbuild searching                          : Skip
 40.3: Compile source for BPF prologue generation: Skip
 40.4: Compile source for BPF relocation         : Skip
 41: Session topology                           : Ok
 42: BPF filter                                 :
 42.1: Basic BPF filtering                      : Skip
 42.2: BPF pinning                              : Skip (clang isn't installed or environment missing BPF support)
 42.3: BPF prologue generation                  : Skip (clang isn't installed or environment missing BPF support)
 43: Synthesize thread map                      : Ok
 44: Remove thread map                          : Ok
 45: Synthesize cpu map                         : Ok
 46: Synthesize stat config                     : Ok
 47: Synthesize stat                            : Ok
 48: Synthesize stat round                      : Ok
 49: Synthesize attr update                     : Ok
 50: Event times                                : Ok
 51: Read backward ring buffer                  : Skip
 52: Print cpu map                              : Ok
 53: Merge cpu map                              : Ok
 54: Probe SDT events                           : Skip
 55: is_printable_array                         : Ok
 56: Print bitmap                               : Ok
 57: perf hooks                                 : Ok
 58: builtin clang support                      :
 58.1: builtin clang compile C source to IR        : Skip (not compiled in)
 58.2: builtin clang compile C source to ELF object: Skip (not compiled in)
 59: unit_number__scnprintf                     : Ok
 60: mem2node                                   : Ok
 61: time utils                                 : Ok
 62: Test jit_write_elf                         : Ok
 63: Test libpfm4 support                       :
 63.1: test of individual --pfm-events          : Skip (not compiled in)
 63.2: test groups of --pfm-events              : Skip (not compiled in)
 64: Test api io                                : Ok
 65: maps__merge_in                             : Ok
 66: Demangle Java                              : Ok
 67: Demangle OCaml                             : Ok
 68: Parse and process metrics                  : Ok
 69: PE file support                            : Skip
 70: Event expansion for cgroups                : Ok
 71: Convert perf time to TSC                   :
 71.1: TSC support                              : Ok
 71.2: Perf time to TSC                         : Ok
 72: dlfilter C API                             : Skip
 73: Sigtrap                                    : Ok
 74: x86 rdpmc                                  : Ok
 75: Test dwarf unwind                          : FAILED!
 76: x86 instruction decoder - new instructions : Ok
 77: Intel PT packet decoder                    : Ok
 78: x86 bp modify                              : Ok
 79: x86 Sample parsing                         : Ok
failed to open shell test directory: /usr/libexec/perf-core/tests/shell

パフォーマンスバージョンを確認しようとしましたが、次のような結果のみを取得します。

$ perf --version
perf version 

また、APTとgit repoを介してPAPIをインストールしようとしましたが、まったく同じように動作するようです。

試してみるアイデアが足りないので、私の構成に問題がある可能性があるというフィードバックをいただきありがとうございます。

関連情報