Bug 22199 - [Anolis23][x86_64][社区nightly & 6.6.88] perf-test测试case:perf stat JSON output linter、 perf all metricgroups test、perf all metrics test报Unable to find PMU的错
Summary: [Anolis23][x86_64][社区nightly & 6.6.88] perf-test测试case:perf stat JSON output ...
Status: NEW
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: shuming
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-26 14:30 UTC by gaohongmei
Modified: 2025-06-26 14:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gaohongmei 2025-06-26 14:30:54 UTC
Description of problem:

6.6.88内核 perf-test perf stat JSON output linter 失败
只在x86内核失败,arm上成功


Version-Release number of selected component (if applicable):

#uname -r
6.6.88-cbp.git.1432012a7.an23.x86_64

# cat /etc/os-release
NAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

# lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          46 bits physical, 57 bits virtual
  Byte Order:             Little Endian
CPU(s):                   4
  On-line CPU(s) list:    0-3
Vendor ID:                GenuineIntel
  BIOS Vendor ID:         Alibaba Cloud
  Model name:             Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
    BIOS Model name:      pc-i440fx-2.1  CPU @ 0.0GHz
    BIOS CPU family:      1
    CPU family:           6
    Model:                106
    Thread(s) per core:   2
    Core(s) per socket:   2
    Socket(s):            1
    Stepping:             6
    BogoMIPS:             5399.99
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp
                          lm constant_tsc rep_good nopl nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2
                          x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault ibrs_enhanced fsgsbase tsc_adjust b
                          mi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsav
                          eopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_v
                          popcntdq rdpid fsrm arch_capabilities
Virtualization features:
  Hypervisor vendor:      KVM
  Virtualization type:    full
Caches (sum of all):
  L1d:                    96 KiB (2 instances)
  L1i:                    64 KiB (2 instances)
  L2:                     2.5 MiB (2 instances)
  L3:                     48 MiB (1 instance)
NUMA:
  NUMA node(s):           1
  NUMA node0 CPU(s):      0-3
Vulnerabilities:
  Gather data sampling:   Unknown: Dependent on hypervisor status
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
  Reg file data sampling: Not affected
  Retbleed:               Not affected
  Spec rstack overflow:   Not affected
  Spec store bypass:      Vulnerable
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
  Srbds:                  Not affected
  Tsx async abort:        Not affected

#free -m
               total        used        free      shared  buff/cache   available
Mem:           15611         701       14272          98         637       14533
Swap:              0           0           0



How reproducible:

# perf test list 可以查到报错用例
 97: perf stat JSON output linter
101: perf all metricgroups test
102: perf all metrics test



# perf test -v 97
 97: perf stat JSON output linter                                    :
--- start ---
test child forked, pid 1790392
Checking json output: no args event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: system wide event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: interval event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: event [Success]
Checking json output: per thread event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: per node event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: system wide no aggregation event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: per core event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/,..'
                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
[Success]
Checking json output: per cache_instance Test failed for input:
event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SL..'

                     \___ Bad event or PMU



Unable to find PMU or event on a PMU of 'topdown-retiring'



Initial error:

event syntax error: 'topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SL..'

                     \___ Cannot find PMU `topdown-retiring'. Missing kernel support?

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 4, "counter-value" : "6.600290", "unit" : "msec", "event" : "cpu-clock", "event-runtime" : 6600258, "pcnt-running" : 100.00, "metric-value" : "6.569388", "metric-unit" : "CPUs utilized"}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 4, "counter-value" : "23.000000", "unit" : "", "event" : "context-switches", "event-runtime" : 6597827, "pcnt-running" : 100.00, "metric-value" : "3.484695", "metric-unit" : "K/sec"}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 4, "counter-value" : "6.000000", "unit" : "", "event" : "cpu-migrations", "event-runtime" : 6597469, "pcnt-running" : 100.00, "metric-value" : "909.050966", "metric-unit" : "/sec"}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 4, "counter-value" : "101.000000", "unit" : "", "event" : "page-faults", "event-runtime" : 6596585, "pcnt-running" : 100.00, "metric-value" : "15.302358", "metric-unit" : "K/sec"}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 0, "counter-value" : "<not supported>", "unit" : "", "event" : "cycles", "event-runtime" : 0, "pcnt-running" : 100.00, "metric-value" : "0.000000", "metric-unit" : ""}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 0, "counter-value" : "<not supported>", "unit" : "", "event" : "instructions", "event-runtime" : 0, "pcnt-running" : 100.00, "metric-value" : "0.000000", "metric-unit" : ""}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 0, "counter-value" : "<not supported>", "unit" : "", "event" : "branches", "event-runtime" : 0, "pcnt-running" : 100.00, "metric-value" : "0.000000", "metric-unit" : ""}

{"cache" : "S0-D0-L3-ID0", "aggregate-number" : 0, "counter-value" : "<not supported>", "unit" : "", "event" : "branch-misses", "event-runtime" : 0, "pcnt-running" : 100.00, "metric-value" : "0.000000", "metric-unit" : ""}

Traceback (most recent call last):
  File "/usr/libexec/perf-core/tests/shell/lib/perf_json_output_lint.py", line 96, in <module>
    check_json_output(expected_items)
  File "/usr/libexec/perf-core/tests/shell/lib/perf_json_output_lint.py", line 66, in check_json_output
    for item in json.loads(input):
                ^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 2)
test child finished with -1
---- end ----
perf stat JSON output linter: FAILED!



# perf test -v 101
101: perf all metricgroups test                                      :
--- start ---
test child forked, pid 1790440
Testing Backend
event syntax error: '{topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/..'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: '{topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.SLOTS/metric-id=TOPDOWN.SLOTS/,topdown-fe-bound/metric-id=topdown!1fe!1bound/..'
                      \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
test child finished with -1
---- end ----
perf all metricgroups test: FAILED!



]# perf test -v 102
102: perf all metrics test                                           :
--- start ---
test child forked, pid 1790448
Testing tma_core_bound
Metric 'tma_core_bound' not printed in:
event syntax error: '{topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.S..'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: '{topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.S..'
                      \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
Testing tma_info_core_ilp
Metric 'tma_info_core_ilp' not printed in:
event syntax error: '{UOPS_EXECUTED.CORE_CYCLES_GE_1/metric-id=UOPS_EXECUTED...'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'UOPS_EXECUTED.CORE_CYCLES_GE_1'

Initial error:
event syntax error: '{UOPS_EXECUTED.CORE_CYCLES_GE_1/metric-id=UOPS_EXECUTED...'
                      \___ Cannot find PMU `UOPS_EXECUTED.CORE_CYCLES_GE_1'. Missing kernel support?
Testing tma_info_memory_l2mpki
Metric 'tma_info_memory_l2mpki' not printed in:
event syntax error: '{INST_RETIRED.ANY/metric-id=INST_RETIRED.ANY/,MEM_LOAD_R..'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'INST_RETIRED.ANY'

Initial error:
event syntax error: '{INST_RETIRED.ANY/metric-id=INST_RETIRED.ANY/,MEM_LOAD_R..'
                      \___ Cannot find PMU `INST_RETIRED.ANY'. Missing kernel support?
Testing tma_memory_bound
Metric 'tma_memory_bound' not printed in:
event syntax error: '{topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.S..'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'topdown-retiring'

Initial error:
event syntax error: '{topdown-retiring/metric-id=topdown!1retiring/,TOPDOWN.S..'
                      \___ Cannot find PMU `topdown-retiring'. Missing kernel support?
Testing tma_info_bad_spec_branch_misprediction_cost
Metric 'tma_info_bad_spec_branch_misprediction_cost' not printed in:
event syntax error: 'ILD_STALL.LCP/metric-id=ILD_STALL.LCP/,topdown-retiring/..'
                     \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'ILD_STALL.LCP'

Initial error:
event syntax error: 'ILD_STALL.LCP/metric-id=ILD_STALL.LCP/,topdown-retiring/..'
                     \___ Cannot find PMU `ILD_STALL.LCP'. Missing kernel support?
Testing tma_info_bad_spec_ipmisp_cond_ntaken
Metric 'tma_info_bad_spec_ipmisp_cond_ntaken' not printed in:
event syntax error: '{BR_MISP_RETIRED.COND_NTAKEN/metric-id=BR_MISP_RETIRED.C..'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'BR_MISP_RETIRED.COND_NTAKEN'

(报错信息过长,省略一部分相似报错)

Unable to find PMU or event on a PMU of 'UOPS_DISPATCHED.PORT_6'

Initial error:
event syntax error: '{UOPS_DISPATCHED.PORT_6/metric-id=UOPS_DISPATCHED.PORT_6..'
                      \___ Cannot find PMU `UOPS_DISPATCHED.PORT_6'. Missing kernel support?
Testing tma_slow_pause
Metric 'tma_slow_pause' not printed in:
event syntax error: '{RESOURCE_STALLS.SCOREBOARD/metric-id=RESOURCE_STALLS.SC..'
                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'RESOURCE_STALLS.SCOREBOARD'

Initial error:
event syntax error: '{RESOURCE_STALLS.SCOREBOARD/metric-id=RESOURCE_STALLS.SC..'
                      \___ Cannot find PMU `RESOURCE_STALLS.SCOREBOARD'. Missing kernel support?
Testing smi_cycles
Testing smi_num
Testing tsx_aborted_cycles
Testing tsx_cycles_per_elision
Testing tsx_cycles_per_transaction
Testing tsx_transactional_cycles
test child finished with -1
---- end ----
perf all metrics test: FAILED!




Actual results:
pass

Expected results:


Additional info:
只在x86内核失败,arm上成功

# rpm -qa|grep perf
python3-perf-6.6.71-3.an23.x86_64
iperf3-3.18-1.an23.x86_64
perf-6.6.71-3.an23.x86_64

# gcc --version
gcc (GCC) 12.3.0 20230508 (Anolis OS 12.3.0-9)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# rpm -qa|grep glibc
glibc-common-2.38-8.an23_2.x86_64
glibc-gconv-extra-2.38-8.an23_2.x86_64
glibc-langpack-en-2.38-8.an23_2.x86_64
glibc-2.38-8.an23_2.x86_64
glibc-devel-2.38-8.an23_2.x86_64
glibc-static-2.38-8.an23_2.x86_64