Description of problem: an7 ck26_rc1内核 perf-sanity-tests Object_code_reading失败,perf_evlist__open() failed 只在x86内核失败,arm上成功 an8上测试成功 Version-Release number of selected component (if applicable): # uname -a Linux iZ2ze6n8cezigzjqlcfjaeZ 4.19.91-26_rc1.an7.x86_64 #1 SMP Mon Apr 25 17:24:24 CST 2022 x86_64 x86_64 x86_64 GNU/Linux # cat /etc/os-release NAME="Anolis OS" VERSION="7.7" ID="anolis" ID_LIKE="rhel fedora centos" VERSION_ID="7.7" PRETTY_NAME="Anolis OS 7.7" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" BUG_REPORT_URL="https://bugs.openanolis.cn/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" # lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 106 Model name: Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz Stepping: 6 CPU MHz: 2699.998 BogoMIPS: 5399.99 Hypervisor vendor: KVM Virtualization type: full L1d cache: 48K L1i cache: 32K L2 cache: 1280K L3 cache: 49152K NUMA node0 CPU(s): 0-3 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 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 invpcid_single ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm arch_capabilities How reproducible: # perf test list 可以查到Object_code_reading编号为24 perf test -v 24 24: Object code reading : --- start --- test child forked, pid 22096 Looking at the vmlinux_path (8 entries long) Using /usr/lib/debug/lib/modules/4.19.91-26_rc1.an7.x86_64/vmlinux for symbols Parsing event 'cycles' Parsing event 'cycles:u' perf_evlist__open() failed! No such file or directory test child finished with -1 ---- end ---- Object code reading: FAILED! Actual results: Expected results: Additional info: 只在x86内核失败,arm上成功 an8上测试成功 # rpm -qa|grep perf python-perf-4.19.91-26_rc1.an7.x86_64 gperftools-libs-2.6.1-1.an7.x86_64 perf-4.19.91-26_rc1.an7.x86_64 # gcc --version gcc (GCC) 4.8.5 20150623 (Anolis 4.8.5-44.0.1) Copyright (C) 2015 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-static-2.17-323.1.an7.1.x86_64 glibc-common-2.17-323.1.an7.1.x86_64 glibc-headers-2.17-323.1.an7.1.x86_64 glibc-devel-2.17-323.1.an7.1.x86_64 glibc-2.17-323.1.an7.1.x86_64
x86_rdpmc 和Convert_perf_time_to_TSC也是同样的情况 x86_rdpmc # perf test -v 58 58: x86 rdpmc : --- start --- test child forked, pid 23044 Error: sys_perf_event_open() syscall returned with -1 (No such file or directory) test child finished with -1 ---- end ---- x86 rdpmc: FAILED! Convert_perf_time_to_TSC # perf test -v 59 59: Convert perf time to TSC : --- start --- test child forked, pid 23137 perf_evlist__open(evlist) failed! test child finished with -1 ---- end ---- Convert perf time to TSC: FAILED!
看似 upstream 有相同的问题,已经 fix: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20220506&id=1870356f3532c2e9ac00557ff911b94bdbba4602
物理机验证an7所有case可以通过,@kangjiangbo 是否可以试一下物理机,同时请告知一下虚拟机的规格 [root@iZbp1eg2ewvmkjimcd63wmZ ~]# uname -r 4.19.91-26_rc1.an7.x86_64 [root@iZbp1eg2ewvmkjimcd63wmZ ~]# perf test 1: vmlinux symtab matches kallsyms : Skip 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Breakpoint accounting : Ok 22: Number of exit events of a simple workload : Ok 23: Software clock events period values : Ok 24: Object code reading : Ok 25: Sample parsing : Ok 26: Use a dummy software event to keep tracking : Ok 27: Parse with no sample_id_all bit set : Ok 28: Filter hist entries : Ok 29: Lookup mmap thread : Ok 30: Share thread mg : Ok 31: Sort output of hist entries : Ok 32: Cumulate child hist entries : Ok 33: Track with sched_switch : Ok 34: Filter fds with revents mask in a fdarray : Ok 35: Add fd to a fdarray, making it autogrow : Ok 36: kmod_path__parse : Ok 37: Thread map : Ok 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Skip 38.2: kbuild searching : Skip 38.3: Compile source for BPF prologue generation : Skip 38.4: Compile source for BPF relocation : Skip 39: Session topology : Ok 40: BPF filter : 40.1: Basic BPF filtering : Skip 40.2: BPF pinning : Skip 40.3: BPF prologue generation : Skip 40.4: BPF relocation checker : Skip 41: Synthesize thread map : Ok 42: Remove thread map : Ok 43: Synthesize cpu map : Ok 44: Synthesize stat config : Ok 45: Synthesize stat : Ok 46: Synthesize stat round : Ok 47: Synthesize attr update : Ok 48: Event times : Ok 49: Read backward ring buffer : Ok 50: Print cpu map : Ok 51: Probe SDT events : Ok 52: is_printable_array : Ok 53: Print bitmap : Ok 54: perf hooks : Ok 55: builtin clang support : Skip (not compiled in) 56: unit_number__scnprintf : Ok 57: mem2node : Ok 58: x86 rdpmc : Ok 59: Convert perf time to TSC : Ok 60: DWARF unwind : Ok 61: x86 instruction decoder - new instructions : Ok 62: x86 bp modify : Ok 63: Add vfs_getname probe to get syscall args filenames : Skip 64: probe libc's inet_pton & backtrace it with ping : Ok 65: Use vfs_getname probe to get syscall args filenames : Skip 66: Check open filename arg using perf trace + vfs_getname: Skip [root@iZbp1eg2ewvmkjimcd63wmZ ~]# perf --version perf version 4.19.91-26_rc1.an7.x86_64.debug (In reply to Shiloong from comment #2) > 看似 upstream 有相同的问题,已经 fix: > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/ > ?h=next-20220506&id=1870356f3532c2e9ac00557ff911b94bdbba4602
确定是虚拟化问题,相关pmu需要kvm支持。所以物理机case可以通过,但是在vm中出错。都是在pmu_event_init中没有相应的pmu造成的。需要虚拟化后端修复