forked from Minki/linux
perf tools fixes for v5.9:
- Fix infinite loop in the TUI for grouped events in 'perf top/record', for instance when using "perf top -e '{cycles,instructions,cache-misses}'. - Fix segfault by skipping side-band event setup if HAVE_LIBBPF_SUPPORT is not set. - Fix synthesized branch stacks generated from CoreSight ETM trace and Intel PT hardware traces. - Fix error when synthesizing events from ARM SPE hardware trace. - The SNOOPX and REMOTE offsets in the data_src bitmask in perf records were were both 37, SNOOPX is 38, fix it. - Fix use of CPU list with summary option in 'perf sched timehist'. - Avoid an uninitialized read when using fake PMUs. - Set perf_event_attr.exclude_guest=1 for user-space counting. - Don't order events when doing a 'perf report -D' raw dump of perf.data records. - Set NULL sentinel in pmu_events table in "Parse and process metrics" 'perf test' - Fix basic bpf filtering 'perf test' on s390x. - Fix out of bounds array access in the 'perf stat' print_counters() evlist method. - Add mwait_idle_with_hints.constprop.0 to the list of idle symbols. - Use %zd for size_t printf formats on 32-bit. - Correct the help info of "perf record --no-bpf-event" option. - Add entries for CoreSight and Arm SPE tooling to MAINTAINERS. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # export PERF_TARBALL=http://192.168.122.1/perf/perf-5.9.0-rc1.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.3.0) 9.3.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:3.12 : Ok gcc (Alpine 9.3.0) 9.3.0, Alpine clang version 10.0.0 (https://gitlab.alpinelinux.org/alpine/aports.git 7445adce501f8473efdb93b17b5eaf2f1445ed4c) 10 alpine:edge : Ok gcc (Alpine 10.2.0) 10.2.0, Alpine clang version 10.0.1 11 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 12 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.4.1 20200305 (ALT p9 8.4.1-alt0.p9.1), clang version 10.0.0 13 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.3.1 20200518 (ALT Sisyphus 9.3.1-alt1), clang version 10.0.1 14 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 15 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-9), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 16 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), clang version 9.0.1 (Red Hat 9.0.1-2.module_el8.2.0+309+0c7b6b03) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 10.2.1 20200812 releases/gcc-10.2.0-102-gc99b2c529b, clang version 10.0.1 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : Ok gcc (Debian 10.2.0-5) 10.2.0, Debian clang version 11.0.0-+rc2-4 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 10.2.0-3) 10.2.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.3.0-8) 9.3.0 29 debian:experimental-x-mipsel : FAIL mipsel-linux-gnu-gcc (Debian 9.3.0-8) 9.3.0 util/parse-events.y: In function 'parse_events_parse': util/parse-events.y:514:6: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 514 | (void *) $2, $6, $4); | ^ util/parse-events.y:531:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 531 | (void *) $2, NULL, $4)) { | ^ util/parse-events.y:547:6: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 547 | (void *) $2, $4, 0); | ^ util/parse-events.y:564:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 564 | (void *) $2, NULL, 0)) { | ^ Works with a slightly older compiler: 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2), clang version 9.0.1 (Fedora 9.0.1-2.fc31) 44 fedora:32 : Ok gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1), clang version 10.0.0 (Fedora 10.0.0-2.fc32) 45 fedora:rawhide : FAIL gcc (GCC) 10.2.1 20200804 (Red Hat 10.2.1-2), clang version 11.0.0 (Fedora 11.0.0-0.2.rc1.fc33) util/scripting-engines/trace-event-python.c: In function 'python_start_script': util/scripting-engines/trace-event-python.c:1595:2: error: 'visibility' attribute ignored [-Werror=attributes] 1595 | PyMODINIT_FUNC (*initfunc)(void); | ^~~~~~~~~~~~~~ 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.3.0-r1 p3) 9.3.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.4.0-1.mga7) 8.4.0, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 10.2.0, clang version 10.0.1 51 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 5.0.1 (tags/RELEASE_501/final 312548) 52 opensuse:15.1 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 53 opensuse:15.2 : Ok gcc (SUSE Linux) 7.5.0, clang version 9.0.1 54 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 55 opensuse:tumbleweed : Ok gcc (SUSE Linux) 10.2.1 20200825 [revision c0746a1beb1ba073c7981eb09f55b3d993b32e5c], clang version 10.0.1 56 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 57 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.5) 58 oraclelinux:8 : Ok gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5.0.3), clang version 9.0.1 (Red Hat 9.0.1-2.0.1.module+el8.2.0+5599+9ed9ef6d) 59 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) 60 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 61 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 62 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 Reported the following libtraceevent build warning: event-parse.c: In function 'print_arg_pointer': event-parse.c:5262:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] trace_seq_printf(s, "%p", (void *)val); ^ 65 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:18.04 : Ok gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 69 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 70 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 71 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 72 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 73 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 74 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 75 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 76 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 77 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 78 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 79 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 8.0.1-3build1 (tags/RELEASE_801/final) 80 ubuntu:20.04 : Ok gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0, clang version 10.0.0-4ubuntu1 81 ubuntu:20.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 10-20200411-0ubuntu1) 10.0.1 20200411 (experimental) [master revision bb87d5cc77d:75961caccb7:f883c46b4877f637e0fa5025b4d6b5c9040ec566] # uname -a Linux five 5.9.0-rc3 #1 SMP Mon Aug 31 08:38:27 -03 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1977f739b71
perf report: Disable ordered_events for raw dump # perf version --build-options perf version 5.9.rc1.g977f739b7126 dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT # perf test 1: vmlinux symtab matches kallsyms : Ok 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: 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 : Ok 16: syscalls:sys_enter_openat event fields : Ok 17: Setup struct perf_event_attr : Ok 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 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 : Ok 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 : Ok 40.2: kbuild searching : Ok 40.3: Compile source for BPF prologue generation : Ok 40.4: Compile source for BPF relocation : Ok 41: Session topology : Ok 42: BPF filter : 42.1: Basic BPF filtering : Ok 42.2: BPF pinning : Ok 42.3: BPF prologue generation : Ok 42.4: BPF relocation checker : Ok 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 : Ok 52: Print cpu map : Ok 53: Merge cpu map : Ok 54: Probe SDT events : Ok 55: is_printable_array : Ok 56: Print bitmap : Ok 57: perf hooks : Ok 58: builtin clang support : 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 : Skip (not compiled in) 64: Test api io : Ok 65: maps__merge_in : Ok 66: Demangle Java : Ok 67: Parse and process metrics : Ok 68: x86 rdpmc : Ok 69: Convert perf time to TSC : Ok 70: DWARF unwind : Ok 71: x86 instruction decoder - new instructions : Ok 72: Intel PT packet decoder : Ok 73: x86 bp modify : Ok 74: probe libc's inet_pton & backtrace it with ping : Ok 75: Use vfs_getname probe to get syscall args filenames : Ok 76: Check open filename arg using perf trace + vfs_getname: Ok 77: Zstd perf.data compression/decompression : Ok 78: Add vfs_getname probe to get syscall args filenames : Ok # $ git log --oneline -1977f739b71
(HEAD -> perf/urgent) perf report: Disable ordered_events for raw dump $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_libcrypto_O: make NO_LIBCRYPTO=1 make_install_bin_O: make install-bin make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 NO_SYSCALL_TABLE=1 make_with_libpfm4_O: make LIBPFM4=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_sdt_O: make NO_SDT=1 make_no_libbpf_O: make NO_LIBBPF=1 make_doc_O: make doc make_no_gtk2_O: make NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libbpf_DEBUG_O: make NO_LIBBPF=1 DEBUG=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_install_O: make install make_no_libelf_O: make NO_LIBELF=1 make_no_syscall_tbl_O: make NO_SYSCALL_TABLE=1 make_help_O: make help make_no_libperl_O: make NO_LIBPERL=1 make_debug_O: make DEBUG=1 make_no_newt_O: make NO_NEWT=1 make_with_babeltrace_O: make LIBBABELTRACE=1 - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_tags_O: make tags make_pure_O: make make_no_demangle_O: make NO_DEMANGLE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_clean_all_O: make clean all make_no_slang_O: make NO_SLANG=1 make_util_map_o_O: make util/map.o make_perf_o_O: make perf.o OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQR2GiIUctdOfX2qHhGyPKLppCJ+JwUCX07MbwAKCRCyPKLppCJ+ J7UEAP9skQQxv9BRHJeqwkVwAUo6IvftqGUyk3DZJZlouih4lAD/ZxSuydm8JEsJ rA7y1DXu+feJHdU+8mb0HnSV2DIoLgA= =Oeya -----END PGP SIGNATURE----- Merge tag 'perf-tools-fixes-for-v5.9-2020-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix infinite loop in the TUI for grouped events in 'perf top/record', eg when using "perf top -e '{cycles,instructions,cache-misses}'". - Fix segfault by skipping side-band event setup if HAVE_LIBBPF_SUPPORT is not set. - Fix synthesized branch stacks generated from CoreSight ETM trace and Intel PT hardware traces. - Fix error when synthesizing events from ARM SPE hardware trace. - The SNOOPX and REMOTE offsets in the data_src bitmask in perf records were were both 37, SNOOPX is 38, fix it. - Fix use of CPU list with summary option in 'perf sched timehist'. - Avoid an uninitialized read when using fake PMUs. - Set perf_event_attr.exclude_guest=1 for user-space counting. - Don't order events when doing a 'perf report -D' raw dump of perf.data records. - Set NULL sentinel in pmu_events table in "Parse and process metrics" 'perf test' - Fix basic bpf filtering 'perf test' on s390x. - Fix out of bounds array access in the 'perf stat' print_counters() evlist method. - Add mwait_idle_with_hints.constprop.0 to the list of idle symbols. - Use %zd for size_t printf formats on 32-bit. - Correct the help info of "perf record --no-bpf-event" option. - Add entries for CoreSight and Arm SPE tooling to MAINTAINERS. * tag 'perf-tools-fixes-for-v5.9-2020-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf report: Disable ordered_events for raw dump perf tools: Correct SNOOPX field offset perf intel-pt: Fix corrupt data after perf inject from perf cs-etm: Fix corrupt data after perf inject from perf top/report: Fix infinite loop in the TUI for grouped events perf parse-events: Avoid an uninitialized read when using fake PMUs perf stat: Fix out of bounds array access in the print_counters() evlist method perf test: Set NULL sentinel in pmu_events table in "Parse and process metrics" test perf parse-events: Set exclude_guest=1 for user-space counting perf record: Correct the help info of option "--no-bpf-event" perf tools: Use %zd for size_t printf formats on 32-bit MAINTAINERS: Add entries for CoreSight and Arm SPE tooling perf: arm-spe: Fix check error when synthesizing events perf symbols: Add mwait_idle_with_hints.constprop.0 to the list of idle symbols perf top: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set perf sched timehist: Fix use of CPU list with summary option perf test: Fix basic bpf filtering test
This commit is contained in:
commit
9c7d619be5
@ -13571,12 +13571,18 @@ F: kernel/events/*
|
||||
F: tools/lib/perf/
|
||||
F: tools/perf/
|
||||
|
||||
PERFORMANCE EVENTS SUBSYSTEM ARM64 PMU EVENTS
|
||||
PERFORMANCE EVENTS TOOLING ARM64
|
||||
R: John Garry <john.garry@huawei.com>
|
||||
R: Will Deacon <will@kernel.org>
|
||||
R: Mathieu Poirier <mathieu.poirier@linaro.org>
|
||||
R: Leo Yan <leo.yan@linaro.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Supported
|
||||
F: tools/build/feature/test-libopencsd.c
|
||||
F: tools/perf/arch/arm*/
|
||||
F: tools/perf/pmu-events/arch/arm64/
|
||||
F: tools/perf/util/arm-spe*
|
||||
F: tools/perf/util/cs-etm*
|
||||
|
||||
PERSONALITY HANDLING
|
||||
M: Christoph Hellwig <hch@infradead.org>
|
||||
|
@ -1196,7 +1196,7 @@ union perf_mem_data_src {
|
||||
|
||||
#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
|
||||
/* 1 free */
|
||||
#define PERF_MEM_SNOOPX_SHIFT 37
|
||||
#define PERF_MEM_SNOOPX_SHIFT 38
|
||||
|
||||
/* locked instruction */
|
||||
#define PERF_MEM_LOCK_NA 0x01 /* not available */
|
||||
|
@ -2452,7 +2452,7 @@ static struct option __record_options[] = {
|
||||
OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
|
||||
"synthesize non-sample events at the end of output"),
|
||||
OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
|
||||
OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "record bpf events"),
|
||||
OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
|
||||
OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
|
||||
"Fail if the specified frequency can't be used"),
|
||||
OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",
|
||||
|
@ -1332,6 +1332,9 @@ int cmd_report(int argc, const char **argv)
|
||||
if (report.mmaps_mode)
|
||||
report.tasks_mode = true;
|
||||
|
||||
if (dump_trace)
|
||||
report.tool.ordered_events = false;
|
||||
|
||||
if (quiet)
|
||||
perf_quiet_option();
|
||||
|
||||
|
@ -2584,7 +2584,8 @@ static int timehist_sched_change_event(struct perf_tool *tool,
|
||||
}
|
||||
|
||||
if (!sched->idle_hist || thread->tid == 0) {
|
||||
timehist_update_runtime_stats(tr, t, tprev);
|
||||
if (!cpu_list || test_bit(sample->cpu, cpu_bitmap))
|
||||
timehist_update_runtime_stats(tr, t, tprev);
|
||||
|
||||
if (sched->idle_hist) {
|
||||
struct idle_thread_runtime *itr = (void *)tr;
|
||||
@ -2857,6 +2858,9 @@ static void timehist_print_summary(struct perf_sched *sched,
|
||||
|
||||
printf("\nIdle stats:\n");
|
||||
for (i = 0; i < idle_max_cpu; ++i) {
|
||||
if (cpu_list && !test_bit(i, cpu_bitmap))
|
||||
continue;
|
||||
|
||||
t = idle_threads[i];
|
||||
if (!t)
|
||||
continue;
|
||||
|
@ -1746,6 +1746,7 @@ int cmd_top(int argc, const char **argv)
|
||||
goto out_delete_evlist;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBBPF_SUPPORT
|
||||
if (!top.record_opts.no_bpf_event) {
|
||||
top.sb_evlist = evlist__new();
|
||||
|
||||
@ -1759,6 +1760,7 @@ int cmd_top(int argc, const char **argv)
|
||||
goto out_delete_evlist;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (perf_evlist__start_sb_thread(top.sb_evlist, target)) {
|
||||
pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n");
|
||||
|
@ -197,7 +197,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
|
||||
perf_mmap__read_done(&md->core);
|
||||
}
|
||||
|
||||
if (count != expect) {
|
||||
if (count != expect * evlist->core.nr_entries) {
|
||||
pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
|
||||
goto out_delete_evlist;
|
||||
}
|
||||
|
@ -719,7 +719,7 @@ static int test__group2(struct evlist *evlist)
|
||||
TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
|
||||
TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
|
||||
TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
|
||||
TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
|
||||
TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
|
||||
TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
|
||||
TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
|
||||
TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
|
||||
@ -842,7 +842,7 @@ static int test__group3(struct evlist *evlist __maybe_unused)
|
||||
TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
|
||||
TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
|
||||
TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
|
||||
TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
|
||||
TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
|
||||
TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
|
||||
TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
|
||||
TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
|
||||
|
@ -70,6 +70,9 @@ static struct pmu_event pme_test[] = {
|
||||
{
|
||||
.metric_expr = "1/m3",
|
||||
.metric_name = "M3",
|
||||
},
|
||||
{
|
||||
.name = NULL,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3629,8 +3629,8 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
|
||||
{
|
||||
int nr_entries = evlist->core.nr_entries;
|
||||
|
||||
single_entry:
|
||||
if (perf_evlist__single_entry(evlist)) {
|
||||
single_entry: {
|
||||
struct evsel *first = evlist__first(evlist);
|
||||
|
||||
return perf_evsel__hists_browse(first, nr_entries, help,
|
||||
@ -3638,6 +3638,7 @@ single_entry:
|
||||
env, warn_lost_event,
|
||||
annotation_opts);
|
||||
}
|
||||
}
|
||||
|
||||
if (symbol_conf.event_group) {
|
||||
struct evsel *pos;
|
||||
|
@ -182,15 +182,15 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)
|
||||
if (payload & BIT(EV_TLB_ACCESS))
|
||||
decoder->record.type |= ARM_SPE_TLB_ACCESS;
|
||||
|
||||
if ((idx == 1 || idx == 2 || idx == 3) &&
|
||||
if ((idx == 2 || idx == 4 || idx == 8) &&
|
||||
(payload & BIT(EV_LLC_MISS)))
|
||||
decoder->record.type |= ARM_SPE_LLC_MISS;
|
||||
|
||||
if ((idx == 1 || idx == 2 || idx == 3) &&
|
||||
if ((idx == 2 || idx == 4 || idx == 8) &&
|
||||
(payload & BIT(EV_LLC_ACCESS)))
|
||||
decoder->record.type |= ARM_SPE_LLC_ACCESS;
|
||||
|
||||
if ((idx == 1 || idx == 2 || idx == 3) &&
|
||||
if ((idx == 2 || idx == 4 || idx == 8) &&
|
||||
(payload & BIT(EV_REMOTE_ACCESS)))
|
||||
decoder->record.type |= ARM_SPE_REMOTE_ACCESS;
|
||||
|
||||
|
@ -1344,8 +1344,15 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm,
|
||||
attr.sample_type &= ~(u64)PERF_SAMPLE_ADDR;
|
||||
}
|
||||
|
||||
if (etm->synth_opts.last_branch)
|
||||
if (etm->synth_opts.last_branch) {
|
||||
attr.sample_type |= PERF_SAMPLE_BRANCH_STACK;
|
||||
/*
|
||||
* We don't use the hardware index, but the sample generation
|
||||
* code uses the new format branch_stack with this field,
|
||||
* so the event attributes must indicate that it's present.
|
||||
*/
|
||||
attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
|
||||
}
|
||||
|
||||
if (etm->synth_opts.instructions) {
|
||||
attr.config = PERF_COUNT_HW_INSTRUCTIONS;
|
||||
|
@ -3017,8 +3017,15 @@ static int intel_pt_synth_events(struct intel_pt *pt,
|
||||
|
||||
if (pt->synth_opts.callchain)
|
||||
attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
|
||||
if (pt->synth_opts.last_branch)
|
||||
if (pt->synth_opts.last_branch) {
|
||||
attr.sample_type |= PERF_SAMPLE_BRANCH_STACK;
|
||||
/*
|
||||
* We don't use the hardware index, but the sample generation
|
||||
* code uses the new format branch_stack with this field,
|
||||
* so the event attributes must indicate that it's present.
|
||||
*/
|
||||
attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
|
||||
}
|
||||
|
||||
if (pt->synth_opts.instructions) {
|
||||
attr.config = PERF_COUNT_HW_INSTRUCTIONS;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "util/evsel_config.h"
|
||||
#include "util/event.h"
|
||||
#include "util/pfm.h"
|
||||
#include "perf.h"
|
||||
|
||||
#define MAX_NAME_LEN 100
|
||||
|
||||
@ -1533,19 +1534,23 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
|
||||
evsel = __add_event(list, &parse_state->idx, &attr, true,
|
||||
get_config_name(head_config), pmu,
|
||||
&config_terms, auto_merge_stats, NULL);
|
||||
if (evsel) {
|
||||
evsel->unit = info.unit;
|
||||
evsel->scale = info.scale;
|
||||
evsel->per_pkg = info.per_pkg;
|
||||
evsel->snapshot = info.snapshot;
|
||||
evsel->metric_expr = info.metric_expr;
|
||||
evsel->metric_name = info.metric_name;
|
||||
evsel->pmu_name = name ? strdup(name) : NULL;
|
||||
evsel->use_uncore_alias = use_uncore_alias;
|
||||
evsel->percore = config_term_percore(&evsel->config_terms);
|
||||
}
|
||||
if (!evsel)
|
||||
return -ENOMEM;
|
||||
|
||||
return evsel ? 0 : -ENOMEM;
|
||||
evsel->pmu_name = name ? strdup(name) : NULL;
|
||||
evsel->use_uncore_alias = use_uncore_alias;
|
||||
evsel->percore = config_term_percore(&evsel->config_terms);
|
||||
|
||||
if (parse_state->fake_pmu)
|
||||
return 0;
|
||||
|
||||
evsel->unit = info.unit;
|
||||
evsel->scale = info.scale;
|
||||
evsel->per_pkg = info.per_pkg;
|
||||
evsel->snapshot = info.snapshot;
|
||||
evsel->metric_expr = info.metric_expr;
|
||||
evsel->metric_name = info.metric_name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_events_multi_pmu_add(struct parse_events_state *parse_state,
|
||||
@ -1794,6 +1799,8 @@ static int get_event_modifier(struct event_modifier *mod, char *str,
|
||||
if (*str == 'u') {
|
||||
if (!exclude)
|
||||
exclude = eu = ek = eh = 1;
|
||||
if (!exclude_GH && !perf_guest)
|
||||
eG = 1;
|
||||
eu = 0;
|
||||
} else if (*str == 'k') {
|
||||
if (!exclude)
|
||||
|
@ -87,7 +87,7 @@ static int perf_session__process_compressed_event(struct perf_session *session,
|
||||
session->decomp_last = decomp;
|
||||
}
|
||||
|
||||
pr_debug("decomp (B): %ld to %ld\n", src_size, decomp_size);
|
||||
pr_debug("decomp (B): %zd to %zd\n", src_size, decomp_size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ static void aggr_printout(struct perf_stat_config *config,
|
||||
cpu_map__id_to_die(id),
|
||||
config->csv_output ? 0 : -3,
|
||||
cpu_map__id_to_cpu(id), config->csv_sep);
|
||||
} else {
|
||||
} else if (id > -1) {
|
||||
fprintf(config->output, "CPU%*d%s",
|
||||
config->csv_output ? 0 : -7,
|
||||
evsel__cpus(evsel)->map[id],
|
||||
|
@ -663,6 +663,7 @@ static bool symbol__is_idle(const char *name)
|
||||
"exit_idle",
|
||||
"mwait_idle",
|
||||
"mwait_idle_with_hints",
|
||||
"mwait_idle_with_hints.constprop.0",
|
||||
"poll_idle",
|
||||
"ppc64_runlatch_off",
|
||||
"pseries_dedicated_idle_sleep",
|
||||
|
@ -99,7 +99,7 @@ size_t zstd_decompress_stream(struct zstd_data *data, void *src, size_t src_size
|
||||
while (input.pos < input.size) {
|
||||
ret = ZSTD_decompressStream(data->dstream, &output, &input);
|
||||
if (ZSTD_isError(ret)) {
|
||||
pr_err("failed to decompress (B): %ld -> %ld, dst_size %ld : %s\n",
|
||||
pr_err("failed to decompress (B): %zd -> %zd, dst_size %zd : %s\n",
|
||||
src_size, output.size, dst_size, ZSTD_getErrorName(ret));
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user