perf/core improvements and fixes
Subsystems (4)
Arnaldo Carvalho de Melo
maintainerHi Ingo/Thomas,
Please consider pulling,
Best regards,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit 42880f726c66f13ae1d9ac9ce4c43abe64ecac84:
perf/x86/intel: Support PEBS output to PT (2019-08-28 11:29:39 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-5.4-20190829
for you to fetch changes up to 301011ba622513cb41ced59973972204e0da2f71:
tools lib traceevent: Remove unneeded qsort and uses memmove instead (2019-08-29 08:36:12 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
perf top:
Namhyung Kim:
- Decay all events in the evlist, we were decaying just the first event in a group.
- Fix linking of histograms in different evsels in a event group with more than two events.
With the two fixes above a command line such as:
# perf top -e '{cycles,instructions,cache-misses,cache-references}Should work as expected, with four columns and with all of them being decayed over time, i.e. less weight is given for older samples.
perf record:
Arnaldo Carvalho de Melo:
- Fix collection of build-ids when using setns() to get into namespaces, which had been broken with the introduction of the extra thread to react to PERF_RECORD_BPF_EVENT, i.e. to collect extra info for BPF programs. We need to unshare(CLONE_FS) in that thread so that the main one can do the setns(CLONE_NEWNS) when collectingthe build-ids. Without that symbol resolution gets more difficult and potentially misresolves symbols.
core:
Igor Lubashev:
- Further alignment in permission checking via capabilities to how the kernel checks what tooling tries to do.
PowerPC:
Naveen N. Rao:
- Sync powerpc syscall.tbl, so that 'perf trace' gets the definitions for recent syscalls.
libperf:
Jiri Olsa:
- Move the rest of the PERF_RECORD_ metadata struct definitions so that we can use 'union perf_event'.
libtraceevent:
Steven Rostedt (VMware):
- Do not free tep->cmdlines in add_new_comm() on failure.
- Remove unneeded qsort and uses memmove instead
----------------------------------------------------------------
Arnaldo Carvalho de Melo (4):
perf tools: Remove needless util.h include from builtin.h
perf evlist: Remove needless util.h from evlist.h
perf clang: Delete needless util-cxx.h header
perf evlist: Use unshare(CLONE_FS) in sb threads to let setns(CLONE_NEWNS) work
Igor Lubashev (5):
perf event: Check ref_reloc_sym before using it
perf tools: Use CAP_SYS_ADMIN with perf_event_paranoid checks perf evsel: Kernel profiling is disallowed only when perf_event_paranoid > 1 perf symbols: Use CAP_SYSLOG with kptr_restrict checks
perf tools: Warn that perf_event_paranoid can restrict kernel symbols
Jiri Olsa (23):
libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h
libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h
libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h
libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h
libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h
libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h
libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h
libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h
libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h
libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h
libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h
libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h
libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h
libperf: Add 'union perf_event' to perf/event.h
libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix
libperf: Move 'enum perf_user_event_type' to perf/event.h
Namhyung Kim (2):
perf top: Decay all events in the evlist perf top: Fix event group with more than two events
Naveen N. Rao (1):
perf arch powerpc: Sync powerpc syscall.tbl
Steven Rostedt (VMware) (2):
tools lib traceevent: Do not free tep->cmdlines in add_new_comm() on failure tools lib traceevent: Remove unneeded qsort and uses memmove instead
tools/lib/traceevent/event-parse.c | 58 ++++- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/arch/arm64/util/arm-spe.c | 5 +- tools/perf/arch/powerpc/entry/syscalls/syscall.tbl | 146 +++++++++-- tools/perf/arch/s390/util/auxtrace.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 6 +- tools/perf/arch/x86/util/intel-pt.c | 7 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/builtin-buildid-cache.c | 1 + tools/perf/builtin-record.c | 6 +- tools/perf/builtin-report.c | 3 +- tools/perf/builtin-script.c | 3 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 47 ++-- tools/perf/builtin-trace.c | 3 +- tools/perf/builtin.h | 2 - tools/perf/lib/include/perf/event.h | 273 ++++++++++++++++++++ tools/perf/perf.c | 1 + tools/perf/tests/cpumap.c | 12 +- tools/perf/tests/event_update.c | 16 +- tools/perf/tests/sdt.c | 1 + tools/perf/tests/stat.c | 8 +- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/arm-spe.c | 6 +- tools/perf/util/auxtrace.c | 21 +- tools/perf/util/auxtrace.h | 8 +- tools/perf/util/bpf-loader.c | 1 + tools/perf/util/build-id.c | 2 +- tools/perf/util/c++/clang-c.h | 2 +- tools/perf/util/c++/clang-test.cpp | 4 +- tools/perf/util/cpumap.c | 6 +- tools/perf/util/cpumap.h | 4 +- tools/perf/util/cs-etm.c | 4 +- tools/perf/util/event.c | 45 ++-- tools/perf/util/event.h | 278 +-------------------- tools/perf/util/evlist.c | 10 + tools/perf/util/evlist.h | 1 - tools/perf/util/evsel.c | 3 +- tools/perf/util/header.c | 57 ++--- tools/perf/util/hist.c | 39 +-- tools/perf/util/hist.h | 1 + tools/perf/util/intel-bts.c | 6 +- tools/perf/util/intel-pt.c | 12 +- tools/perf/util/python.c | 4 +- tools/perf/util/s390-cpumsf.c | 4 +- tools/perf/util/session.c | 29 +-- tools/perf/util/session.h | 2 +- tools/perf/util/stat.c | 12 +- tools/perf/util/symbol.c | 15 +- tools/perf/util/thread_map.c | 4 +- tools/perf/util/thread_map.h | 4 +- tools/perf/util/util-cxx.h | 27 -- 52 files changed, 684 insertions(+), 540 deletions(-) delete mode 100644 tools/perf/util/util-cxx.h
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.
Clearlinux is failing when building with libpython, but that is not a perf regression, will try to remove one compiler warning that is causing the problem when building some of the glue code files in the python files, outside perf.
# export PERF_TARBALL=http://192.168.124.1/perf/perf-5.3.0-rc6.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:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190816 gcc-9-branch@274554, clang version 8.0.0 (tags/RELEASE_800/final) 17 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) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 9.2.1-4) 9.2.1 20190821, clang version 7.0.1-9+b1 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 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) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190805 [gcc-9-branch revision 274114], clang version 8.0.1 (tags/RELEASE_801/final 366581) 49 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 50 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 oraclelinux:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3.0.1), clang version 7.0.1 (tags/RELEASE_701/final) 52 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) 53 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) 54 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 55 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 62 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.10 : Ok gcc (Ubuntu 8.3.0-6ubuntu1~18.10.1) 8.3.0, clang version 7.0.0-3 (tags/RELEASE_700/final) 73 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 74 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 # # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 301011ba6225 tools lib traceevent: Remove unneeded qsort and uses memmove instead # perf version --build-options perf version 5.3.rc6.g301011ba6225 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: 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: Watchpoint : 22.1: Read Only Watchpoint : Skip 22.2: Write Only Watchpoint : Ok 22.3: Read / Write Watchpoint : Ok 22.4: Modify Watchpoint : Ok 23: Number of exit events of a simple workload : Ok 24: Software clock events period values : Ok 25: Object code reading : Ok 26: Sample parsing : Ok 27: Use a dummy software event to keep tracking : Ok 28: Parse with no sample_id_all bit set : Ok 29: Filter hist entries : Ok 30: Lookup mmap thread : Ok 31: Share thread mg : Ok 32: Sort output of hist entries : Ok 33: Cumulate child hist entries : Ok 34: Track with sched_switch : Ok 35: Filter fds with revents mask in a fdarray : Ok 36: Add fd to a fdarray, making it autogrow : Ok 37: kmod_path__parse : Ok 38: Thread map : Ok 39: LLVM search and compile : 39.1: Basic BPF llvm compile : Ok 39.2: kbuild searching : Ok 39.3: Compile source for BPF prologue generation : Ok 39.4: Compile source for BPF relocation : Ok 40: Session topology : Ok 41: BPF filter : 41.1: Basic BPF filtering : Ok 41.2: BPF pinning : Ok 41.3: BPF prologue generation : Ok 41.4: BPF relocation checker : Ok 42: Synthesize thread map : Ok 43: Remove thread map : Ok 44: Synthesize cpu map : Ok 45: Synthesize stat config : Ok 46: Synthesize stat : Ok 47: Synthesize stat round : Ok 48: Synthesize attr update : Ok 49: Event times : Ok 50: Read backward ring buffer : Ok 51: Print cpu map : Ok 52: Probe SDT events : Ok 53: is_printable_array : Ok 54: Print bitmap : Ok 55: perf hooks : Ok 56: builtin clang support : Skip (not compiled in) 57: unit_number__scnprintf : Ok 58: mem2node : Ok 59: time utils : Ok 60: map_groups__merge_in : Ok 61: x86 rdpmc : Ok 62: Convert perf time to TSC : Ok 63: DWARF unwind : Ok 64: x86 instruction decoder - new instructions : Ok 65: Intel PT packet decoder : Ok 66: x86 bp modify : Ok 67: probe libc's inet_pton & backtrace it with ping : Ok 68: Use vfs_getname probe to get syscall args filenames : Ok 69: Add vfs_getname probe to get syscall args filenames : Ok 70: Check open filename arg using perf trace + vfs_getname: Ok 71: Zstd perf.data compression/decompression : Ok #
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/perf/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_help_O: make help
make_no_libaudit_O: make NO_LIBAUDIT=1
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_debug_O: make DEBUG=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_gtk2_O: make NO_GTK2=1
make_no_libunwind_O: make NO_LIBUNWIND=1
make_install_prefix_O: make install prefix=/tmp/krava
make_no_libperl_O: make NO_LIBPERL=1
make_clean_all_O: make clean all
make_no_libbpf_O: make NO_LIBBPF=1
make_cscope_O: make cscope
make_tags_O: make tags
make_no_libbionic_O: make NO_LIBBIONIC=1
make_static_O: make LDFLAGS=-static
make_no_libelf_O: make NO_LIBELF=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_no_demangle_O: make NO_DEMANGLE=1
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_doc_O: make doc
make_no_slang_O: make NO_SLANG=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_perf_o_O: make perf.o
make_install_bin_O: make install-bin
make_pure_O: make
make_no_newt_O: make NO_NEWT=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_install_O: make install
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
make_util_map_o_O: make util/map.o
make_no_libnuma_O: make NO_LIBNUMA=1
OK
make: Leaving directory '/home/acme/git/perf/tools/perf'
$Arnaldo Carvalho de Melo
maintainerPATCH 1/37 perf arch powerpc: Sync powerpc syscall.tbl
From: "Naveen N. Rao" <[email protected]>
Copy over powerpc syscall.tbl to grab changes from the below commits:
commit cee3536d24a1 ("powerpc: Wire up clone3 syscall")
commit 1a271a68e030 ("arch: mark syscall number 435 reserved for clone3") commit 7615d9e1780e ("arch: wire-up pidfd_open()")
commit d8076bdb56af ("uapi: Wire up the mount API syscalls on non-x86 arches [ver #2]") commit 39036cd27273 ("arch: add pidfd and io_uring syscalls everywhere") commit 48166e6ea47d ("y2038: add 64-bit time_t syscalls to all 32-bit architectures") commit d33c577cccd0 ("y2038: rename old time and utime syscalls")
commit 00bf25d693e7 ("y2038: use time32 syscall names on 32-bit")
commit 8dabe7245bbc ("y2038: syscalls: rename y2038 compat syscalls") commit 0d6040d46817 ("arch: add split IPC system calls where needed")
--- .../arch/powerpc/entry/syscalls/syscall.tbl | 146 ++++++++++++++---- 1 file changed, 119 insertions(+), 27 deletions(-)
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +119 -27
@@ -20,7 +20,9 @@ 10 common unlink sys_unlink 11 nospu execve sys_execve compat_sys_execve 12 common chdir sys_chdir -13 common time sys_time compat_sys_time +13 32 time sys_time32 +13 64 time sys_time +13 spu time sys_time 14 common mknod sys_mknod 15 common chmod sys_chmod 16 common lchown sys_lchown
@@ -36,14 +38,17 @@ 22 spu umount sys_ni_syscall 23 common setuid sys_setuid 24 common getuid sys_getuid -25 common stime sys_stime compat_sys_stime +25 32 stime sys_stime32 +25 64 stime sys_stime +25 spu stime sys_stime 26 nospu ptrace sys_ptrace compat_sys_ptrace 27 common alarm sys_alarm 28 32 oldfstat sys_fstat sys_ni_syscall 28 64 oldfstat sys_ni_syscall 28 spu oldfstat sys_ni_syscall 29 nospu pause sys_pause -30 nospu utime sys_utime compat_sys_utime +30 32 utime sys_utime32 +30 64 utime sys_utime 31 common stty sys_ni_syscall 32 common gtty sys_ni_syscall 33 common access sys_access
@@ -157,7 +162,9 @@ 121 common setdomainname sys_setdomainname 122 common uname sys_newuname 123 common modify_ldt sys_ni_syscall -124 common adjtimex sys_adjtimex compat_sys_adjtimex +124 32 adjtimex sys_adjtimex_time32 +124 64 adjtimex sys_adjtimex +124 spu adjtimex sys_adjtimex 125 common mprotect sys_mprotect 126 32 sigprocmask sys_sigprocmask compat_sys_sigprocmask 126 64 sigprocmask sys_ni_syscall
@@ -198,8 +205,12 @@ 158 common sched_yield sys_sched_yield 159 common sched_get_priority_max sys_sched_get_priority_max 160 common sched_get_priority_min sys_sched_get_priority_min -161 common sched_rr_get_interval sys_sched_rr_get_interval compat_sys_sched_rr_get_interval -162 common nanosleep sys_nanosleep compat_sys_nanosleep +161 32 sched_rr_get_interval sys_sched_rr_get_interval_time32 +161 64 sched_rr_get_interval sys_sched_rr_get_interval +161 spu sched_rr_get_interval sys_sched_rr_get_interval +162 32 nanosleep sys_nanosleep_time32 +162 64 nanosleep sys_nanosleep +162 spu nanosleep sys_nanosleep 163 common mremap sys_mremap 164 common setresuid sys_setresuid 165 common getresuid sys_getresuid
@@ -213,7 +224,8 @@ 173 nospu rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction 174 nospu rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask 175 nospu rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending -176 nospu rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait +176 32 rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32 +176 64 rt_sigtimedwait sys_rt_sigtimedwait 177 nospu rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo 178 nospu rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend 179 common pread64 sys_pread64 compat_sys_pread64
@@ -260,7 +272,9 @@ 218 common removexattr sys_removexattr 219 common lremovexattr sys_lremovexattr 220 common fremovexattr sys_fremovexattr -221 common futex sys_futex compat_sys_futex +221 32 futex sys_futex_time32 +221 64 futex sys_futex +221 spu futex sys_futex 222 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity 223 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity # 224 unused
@@ -268,7 +282,9 @@ 226 32 sendfile64 sys_sendfile64 compat_sys_sendfile64 227 common io_setup sys_io_setup compat_sys_io_setup 228 common io_destroy sys_io_destroy -229 common io_getevents sys_io_getevents compat_sys_io_getevents +229 32 io_getevents sys_io_getevents_time32 +229 64 io_getevents sys_io_getevents +229 spu io_getevents sys_io_getevents 230 common io_submit sys_io_submit compat_sys_io_submit 231 common io_cancel sys_io_cancel 232 nospu set_tid_address sys_set_tid_address
@@ -280,19 +296,33 @@ 238 common epoll_wait sys_epoll_wait 239 common remap_file_pages sys_remap_file_pages 240 common timer_create sys_timer_create compat_sys_timer_create -241 common timer_settime sys_timer_settime compat_sys_timer_settime -242 common timer_gettime sys_timer_gettime compat_sys_timer_gettime +241 32 timer_settime sys_timer_settime32 +241 64 timer_settime sys_timer_settime +241 spu timer_settime sys_timer_settime +242 32 timer_gettime sys_timer_gettime32 +242 64 timer_gettime sys_timer_gettime +242 spu timer_gettime sys_timer_gettime 243 common timer_getoverrun sys_timer_getoverrun 244 common timer_delete sys_timer_delete -245 common clock_settime sys_clock_settime compat_sys_clock_settime -246 common clock_gettime sys_clock_gettime compat_sys_clock_gettime -247 common clock_getres sys_clock_getres compat_sys_clock_getres -248 common clock_nanosleep sys_clock_nanosleep compat_sys_clock_nanosleep +245 32 clock_settime sys_clock_settime32 +245 64 clock_settime sys_clock_settime +245 spu clock_settime sys_clock_settime +246 32 clock_gettime sys_clock_gettime32 +246 64 clock_gettime sys_clock_gettime +246 spu clock_gettime sys_clock_gettime +247 32 clock_getres sys_clock_getres_time32 +247 64 clock_getres sys_clock_getres +247 spu clock_getres sys_clock_getres +248 32 clock_nanosleep sys_clock_nanosleep_time32 +248 64 clock_nanosleep sys_clock_nanosleep +248 spu clock_nanosleep sys_clock_nanosleep 249 32 swapcontext ppc_swapcontext ppc32_swapcontext 249 64 swapcontext ppc64_swapcontext 249 spu swapcontext sys_ni_syscall 250 common tgkill sys_tgkill -251 common utimes sys_utimes compat_sys_utimes +251 32 utimes sys_utimes_time32 +251 64 utimes sys_utimes +251 spu utimes sys_utimes 252 common statfs64 sys_statfs64 compat_sys_statfs64 253 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 254 32 fadvise64_64 ppc_fadvise64_64
@@ -308,8 +338,10 @@ 261 nospu set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy 262 nospu mq_open sys_mq_open compat_sys_mq_open 263 nospu mq_unlink sys_mq_unlink -264 nospu mq_timedsend sys_mq_timedsend compat_sys_mq_timedsend -265 nospu mq_timedreceive sys_mq_timedreceive compat_sys_mq_timedreceive +264 32 mq_timedsend sys_mq_timedsend_time32 +264 64 mq_timedsend sys_mq_timedsend +265 32 mq_timedreceive sys_mq_timedreceive_time32 +265 64 mq_timedreceive sys_mq_timedreceive 266 nospu mq_notify sys_mq_notify compat_sys_mq_notify 267 nospu mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr 268 nospu kexec_load sys_kexec_load compat_sys_kexec_load
@@ -324,8 +356,10 @@ 277 nospu inotify_rm_watch sys_inotify_rm_watch 278 nospu spu_run sys_spu_run 279 nospu spu_create sys_spu_create -280 nospu pselect6 sys_pselect6 compat_sys_pselect6 -281 nospu ppoll sys_ppoll compat_sys_ppoll +280 32 pselect6 sys_pselect6_time32 compat_sys_pselect6_time32 +280 64 pselect6 sys_pselect6 +281 32 ppoll sys_ppoll_time32 compat_sys_ppoll_time32 +281 64 ppoll sys_ppoll 282 common unshare sys_unshare 283 common splice sys_splice 284 common tee sys_tee
@@ -334,7 +368,9 @@ 287 common mkdirat sys_mkdirat 288 common mknodat sys_mknodat 289 common fchownat sys_fchownat -290 common futimesat sys_futimesat compat_sys_futimesat +290 32 futimesat sys_futimesat_time32 +290 64 futimesat sys_futimesat +290 spu utimesat sys_futimesat 291 32 fstatat64 sys_fstatat64 291 64 newfstatat sys_newfstatat 291 spu newfstatat sys_newfstatat
@@ -350,15 +386,21 @@ 301 common move_pages sys_move_pages compat_sys_move_pages 302 common getcpu sys_getcpu 303 nospu epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait -304 common utimensat sys_utimensat compat_sys_utimensat +304 32 utimensat sys_utimensat_time32 +304 64 utimensat sys_utimensat +304 spu utimensat sys_utimensat 305 common signalfd sys_signalfd compat_sys_signalfd 306 common timerfd_create sys_timerfd_create 307 common eventfd sys_eventfd 308 common sync_file_range2 sys_sync_file_range2 compat_sys_sync_file_range2 309 nospu fallocate sys_fallocate compat_sys_fallocate 310 nospu subpage_prot sys_subpage_prot -311 common timerfd_settime sys_timerfd_settime compat_sys_timerfd_settime -312 common timerfd_gettime sys_timerfd_gettime compat_sys_timerfd_gettime +311 32 timerfd_settime sys_timerfd_settime32 +311 64 timerfd_settime sys_timerfd_settime +311 spu timerfd_settime sys_timerfd_settime +312 32 timerfd_gettime sys_timerfd_gettime32 +312 64 timerfd_gettime sys_timerfd_gettime +312 spu timerfd_gettime sys_timerfd_gettime 313 common signalfd4 sys_signalfd4 compat_sys_signalfd4 314 common eventfd2 sys_eventfd2 315 common epoll_create1 sys_epoll_create1
@@ -389,11 +431,15 @@ 340 common getsockopt sys_getsockopt compat_sys_getsockopt 341 common sendmsg sys_sendmsg compat_sys_sendmsg 342 common recvmsg sys_recvmsg compat_sys_recvmsg -343 common recvmmsg sys_recvmmsg compat_sys_recvmmsg +343 32 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 +343 64 recvmmsg sys_recvmmsg +343 spu recvmmsg sys_recvmmsg 344 common accept4 sys_accept4 345 common name_to_handle_at sys_name_to_handle_at 346 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at -347 common clock_adjtime sys_clock_adjtime compat_sys_clock_adjtime +347 32 clock_adjtime sys_clock_adjtime32 +347 64 clock_adjtime sys_clock_adjtime +347 spu clock_adjtime sys_clock_adjtime 348 common syncfs sys_syncfs 349 common sendmmsg sys_sendmmsg compat_sys_sendmmsg 350 common setns sys_setns
@@ -414,6 +460,7 @@ 363 spu switch_endian sys_ni_syscall 364 common userfaultfd sys_userfaultfd 365 common membarrier sys_membarrier +# 366-377 originally left for IPC, now unused 378 nospu mlock2 sys_mlock2 379 nospu copy_file_range sys_copy_file_range 380 common preadv2 sys_preadv2 compat_sys_preadv2
@@ -424,4 +471,49 @@ 385 nospu pkey_free sys_pkey_free 386 nospu pkey_mprotect sys_pkey_mprotect 387 nospu rseq sys_rseq -388 nospu io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents +388 32 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents +388 64 io_pgetevents sys_io_pgetevents +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop +393 common semget sys_semget +394 common semctl sys_semctl compat_sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl compat_sys_shmctl +397 common shmat sys_shmat compat_sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd compat_sys_msgsnd +401 common msgrcv sys_msgrcv compat_sys_msgrcv +402 common msgctl sys_msgctl compat_sys_msgctl +403 32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 32 clock_settime64 sys_clock_settime sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 32 timer_settime64 sys_timer_settime sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval +424 common pidfd_send_signal sys_pidfd_send_signal +425 common io_uring_setup sys_io_uring_setup +426 common io_uring_enter sys_io_uring_enter +427 common io_uring_register sys_io_uring_register +428 common open_tree sys_open_tree +429 common move_mount sys_move_mount +430 common fsopen sys_fsopen +431 common fsconfig sys_fsconfig +432 common fsmount sys_fsmount +433 common fspick sys_fspick +434 common pidfd_open sys_pidfd_open +435 nospu clone3 ppc_clone3
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 2/37 perf event: Check ref_reloc_sym before using it
In reply to Arnaldo Carvalho de MeloFrom: Igor Lubashev <[email protected]>
Check for ref_reloc_sym before using it instead of checking symbol_conf.kptr_restrict and relying solely on that check.
--- tools/perf/util/event.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tools/perf/util/event.c +4 -3
@@ -913,11 +913,13 @@ static int __perf_event__synthesize_kernel_mmap(struct perf_tool *tool,int err;union perf_event *event; -if (symbol_conf.kptr_restrict) -return -1 ;if (map ==NULL )return -1 ; + kmap =map__kmap (map); +if (!kmap->ref_reloc_sym) +return -1 ; +/* * We should get this from /sys/kernel/sections/.text, but till that is * available use this, and after it is use this as a fallback for older
@@ -940,7 +942,6 @@ static int __perf_event__synthesize_kernel_mmap(struct perf_tool *tool, event->header.misc =PERF_RECORD_MISC_GUEST_KERNEL ; } - kmap =map__kmap (map); size =snprintf (event->mmap.filename,sizeof (event->mmap.filename),"%s%s" , machine->mmap_name, kmap->ref_reloc_sym->name) +1 ; size =PERF_ALIGN (size,sizeof (u64));
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 3/37 perf tools: Use CAP_SYS_ADMIN with perf_event_paranoid checks
In reply to Arnaldo Carvalho de MeloFrom: Igor Lubashev <[email protected]>
The kernel is using CAP_SYS_ADMIN instead of euid==0 to override perf_event_paranoid check. Make perf do the same.
--- tools/perf/arch/arm/util/cs-etm.c | 3 ++- tools/perf/arch/arm64/util/arm-spe.c | 3 ++- tools/perf/arch/x86/util/intel-bts.c | 3 ++- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/util/evsel.c | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +2 -1
@@ -18,6 +18,7 @@#include "../../util/record.h" #include "../../util/auxtrace.h" #include "../../util/cpumap.h" +#include "../../util/event.h" #include "../../util/evlist.h" #include "../../util/evsel.h" #include "../../util/pmu.h"
@@ -254,7 +255,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu;struct evsel *evsel, *cs_etm_evsel =NULL ;struct perf_cpu_map *cpus = evlist->core.cpus; -bool privileged = (geteuid () ==0 ||perf_event_paranoid () <0 ); +bool privileged =perf_event_paranoid_check (-1 );int err =0 ; ptr->evlist = evlist;
tools/perf/arch/arm64/util/arm-spe.c +2 -1
@@ -12,6 +12,7 @@#include <time.h> #include "../../util/cpumap.h" +#include "../../util/event.h" #include "../../util/evsel.h" #include "../../util/evlist.h" #include "../../util/session.h"
@@ -67,7 +68,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, container_of(itr, struct arm_spe_recording, itr);struct perf_pmu *arm_spe_pmu = sper->arm_spe_pmu;struct evsel *evsel, *arm_spe_evsel =NULL ; -bool privileged =geteuid () ==0 ||perf_event_paranoid () <0 ; +bool privileged =perf_event_paranoid_check (-1 );struct evsel *tracking_evsel;int err;
tools/perf/arch/x86/util/intel-bts.c +2 -1
@@ -12,6 +12,7 @@#include <linux/zalloc.h> #include "../../util/cpumap.h" +#include "../../util/event.h" #include "../../util/evsel.h" #include "../../util/evlist.h" #include "../../util/session.h"
@@ -108,7 +109,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr,struct perf_pmu *intel_bts_pmu = btsr->intel_bts_pmu;struct evsel *evsel, *intel_bts_evsel =NULL ;const struct perf_cpu_map *cpus = evlist->core.cpus; -bool privileged =geteuid () ==0 ||perf_event_paranoid () <0 ; +bool privileged =perf_event_paranoid_check (-1 ); btsr->evlist = evlist; btsr->snapshot_mode = opts->auxtrace_snapshot_mode;
tools/perf/arch/x86/util/intel-pt.c +1 -1
@@ -579,7 +579,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,bool have_timing_info, need_immediate = false;struct evsel *evsel, *intel_pt_evsel =NULL ;const struct perf_cpu_map *cpus = evlist->core.cpus; -bool privileged =geteuid () ==0 ||perf_event_paranoid () <0 ; +bool privileged =perf_event_paranoid_check (-1 );u64 tsc_bit;int err;
tools/perf/util/evsel.c +1 -1
@@ -282,7 +282,7 @@ struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx)static bool perf_event_can_profile_kernel (void ) { -return geteuid () ==0 ||perf_event_paranoid () ==-1 ; +return perf_event_paranoid_check (-1 ); }struct evsel *perf_evsel__new_cycles (bool precise)
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 4/37 perf evsel: Kernel profiling is disallowed only when perf_event_paranoid > 1
In reply to Arnaldo Carvalho de MeloFrom: Igor Lubashev <[email protected]>
Perf was too restrictive about sysctl kernel.perf_event_paranoid. The kernel only disallows profiling when perf_event_paranoid > 1. Make perf do the same.
Committer testing:
For a non-root user:
$ id uid=1000(acme) gid=1000(acme) groups=1000(acme),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 $
Before:
We were restricting it to just userspace (:u suffix) even for a workload started by the user:
$ perf record sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.001 MB perf.data (8 samples) ]
$ perf evlist
cycles:u
$ perf evlist -v
cycles:u: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1
$ perf report --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
# Total Lost Samples: 0
#
# Samples: 8 of event 'cycles:u'
# Event count (approx.): 1040396
#
# Overhead Command Shared Object Symbol
# ........ ....... ................ ......................
#
68.36% sleep libc-2.29.so [.] _dl_addr
27.33% sleep ld-2.29.so [.] dl_main
3.80% sleep ld-2.29.so [.] _dl_setup_hash
#
# (Tip: Order by the overhead of source file name and line number: perf report -s srcline)
#
$
$After:
When the kernel allows profiling the kernel in that scenario:
$ perf record sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.023 MB perf.data (11 samples) ]
$ perf evlist
cycles
$ perf evlist -v
cycles: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1
$
$ perf report --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
# Total Lost Samples: 0
#
# Samples: 11 of event 'cycles'
# Event count (approx.): 1601964
#
# Overhead Command Shared Object Symbol
# ........ ....... ................ ..........................
#
28.14% sleep [kernel.vmlinux] [k] __rb_erase_color
27.21% sleep [kernel.vmlinux] [k] unmap_page_range
27.20% sleep ld-2.29.so [.] __tunable_get_val
15.24% sleep [kernel.vmlinux] [k] thp_get_unmapped_area
1.96% perf [kernel.vmlinux] [k] perf_event_exec
0.22% perf [kernel.vmlinux] [k] native_sched_clock
0.02% perf [kernel.vmlinux] [k] intel_bts_enable_local
0.00% perf [kernel.vmlinux] [k] native_write_msr
#
# (Tip: Boolean options have negative forms, e.g.: perf report --no-children)
#
$--- tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
@@ -282,7 +282,7 @@ struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx)static bool perf_event_can_profile_kernel (void ) { -return perf_event_paranoid_check (-1 ); +return perf_event_paranoid_check (1 ); }struct evsel *perf_evsel__new_cycles (bool precise)
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 5/37 perf symbols: Use CAP_SYSLOG with kptr_restrict checks
In reply to Arnaldo Carvalho de MeloFrom: Igor Lubashev <[email protected]>
The kernel is using CAP_SYSLOG capability instead of uid==0 and euid==0 when checking kptr_restrict. Make perf do the same.
Also, the kernel is a more restrictive than "no restrictions" in case of kptr_restrict==0, so add the same logic to perf.
--- tools/perf/util/symbol.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
tools/perf/util/symbol.c +12 -3
@@ -4,6 +4,7 @@#include <stdlib.h> #include <stdio.h> #include <string.h> +#include <linux/capability.h> #include <linux/kernel.h> #include <linux/mman.h> #include <linux/time64.h>
@@ -15,8 +16,10 @@#include <inttypes.h> #include "annotate.h" #include "build-id.h" +#include "cap.h" #include "util.h" #include "debug.h" +#include "event.h" #include "machine.h" #include "map.h" #include "symbol.h"
@@ -2195,13 +2198,19 @@ static bool symbol__read_kptr_restrict(void)char line[8 ];if (fgets (line,sizeof (line), fp) !=NULL ) - value = ((geteuid () !=0 ) || (getuid () !=0 )) ? - (atoi (line) !=0 ) : - (atoi (line) ==2 ); + value =perf_cap__capable (CAP_SYSLOG ) ? + (atoi (line) >=2 ) : + (atoi (line) !=0 );fclose (fp); } +/* Per kernel/kallsyms.c: +* we also restrict when perf_event_paranoid > 1 w/o CAP_SYSLOG +*/ +if (perf_event_paranoid () >1 && !perf_cap__capable (CAP_SYSLOG )) + value = true; +return value; }
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 6/37 perf tools: Warn that perf_event_paranoid can restrict kernel symbols
In reply to Arnaldo Carvalho de MeloFrom: Igor Lubashev <[email protected]>
Warn that /proc/sys/kernel/perf_event_paranoid can also restrict kernel symbols.
--- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/builtin-record.c +1 -1
@@ -2372,7 +2372,7 @@ int cmd_record(int argc, const char **argv)if (symbol_conf.kptr_restrict && !perf_evlist__exclude_kernel (rec->evlist))pr_warning ("WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n" -"check /proc/sys/kernel/kptr_restrict.\n\n" +"check /proc/sys/kernel/kptr_restrict and /proc/sys/kernel/perf_event_paranoid.\n\n" "Samples in kernel functions may not be resolved if a suitable vmlinux\n" "file is not found in the buildid cache or in the vmlinux path.\n\n" "Samples in kernel modules won't be resolved at all.\n\n"
tools/perf/builtin-top.c +1 -1
@@ -770,7 +770,7 @@ static void perf_event__process_sample(struct perf_tool *tool,if (!perf_evlist__exclude_kernel (top->session->evlist)) {ui__warning ("Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n" -"Check /proc/sys/kernel/kptr_restrict.\n\n" +"Check /proc/sys/kernel/kptr_restrict and /proc/sys/kernel/perf_event_paranoid.\n\n" "Kernel%s samples will not be resolved.\n" , al.map &&map__has_symbols (al.map) ?" modules" :"" );
tools/perf/builtin-trace.c +1 -1
@@ -1382,7 +1382,7 @@ static char *trace__machine__resolve_kernel_addr(void *vmachine, unsigned long lif (symbol_conf.kptr_restrict) {pr_warning ("Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n" -"Check /proc/sys/kernel/kptr_restrict.\n\n" +"Check /proc/sys/kernel/kptr_restrict and /proc/sys/kernel/perf_event_paranoid.\n\n" "Kernel samples will not be resolved.\n" ); machine->kptr_restrict_warned = true;return NULL ;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 7/37 perf tools: Remove needless util.h include from builtin.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
And fix up places where util.h is needed but was obtained indirectly via builtin.h.
--- tools/perf/builtin-buildid-cache.c | 1 + tools/perf/builtin.h | 2 -- tools/perf/perf.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-buildid-cache.c +1 -0
@@ -25,6 +25,7 @@#include "util/session.h" #include "util/symbol.h" #include "util/time-utils.h" +#include "util/util.h" #include "util/probe-file.h" static int build_id_cache__kcore_buildid (const char *proc_dir,char *sbuildid)
tools/perf/builtin.h +0 -2
@@ -2,8 +2,6 @@#ifndef BUILTIN_H #define BUILTIN_H -#include "util/util.h" -extern const char perf_usage_string[];extern const char perf_more_info_string[];
tools/perf/perf.c +1 -0
@@ -18,6 +18,7 @@#include "util/bpf-loader.h" #include "util/debug.h" #include "util/event.h" +#include "util/util.h" #include <api/fs/fs.h> #include <api/fs/tracing_path.h> #include <errno.h>
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 8/37 perf evlist: Remove needless util.h from evlist.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
There is no need for that util/util.h include there and, remove it, pruning the include tree, fix the fallout by adding necessary headers to places that were getting needed includes indirectly from evlist.h -> util.h.
--- tools/perf/arch/x86/util/intel-bts.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 1 + tools/perf/builtin-report.c | 1 + tools/perf/builtin-script.c | 1 + tools/perf/builtin-top.c | 1 + tools/perf/builtin-trace.c | 1 + tools/perf/tests/sdt.c | 1 + tools/perf/util/auxtrace.c | 1 + tools/perf/util/evlist.c | 1 + tools/perf/util/evlist.h | 1 - tools/perf/util/evsel.c | 1 + tools/perf/util/header.c | 1 + tools/perf/util/session.c | 1 + 13 files changed, 12 insertions(+), 1 deletion(-)
tools/perf/arch/x86/util/intel-bts.c +1 -0
@@ -22,6 +22,7 @@#include "../../util/tsc.h" #include "../../util/auxtrace.h" #include "../../util/intel-bts.h" +#include "../../util/util.h" #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
tools/perf/arch/x86/util/intel-pt.c +1 -0
@@ -26,6 +26,7 @@#include "../../util/record.h" #include "../../util/target.h" #include "../../util/tsc.h" +#include "../../util/util.h" #include "../../util/intel-pt.h" #define KiB (x) ((x) * 1024)
tools/perf/builtin-report.c +1 -0
@@ -44,6 +44,7 @@#include "util/auxtrace.h" #include "util/units.h" #include "util/branch.h" +#include "util/util.h" #include <dlfcn.h> #include <errno.h>
tools/perf/builtin-script.c +1 -0
@@ -52,6 +52,7 @@#include <subcmd/pager.h> #include <perf/evlist.h> #include "util/record.h" +#include "util/util.h" #include <linux/ctype.h>
tools/perf/builtin-top.c +1 -0
@@ -34,6 +34,7 @@#include "util/thread.h" #include "util/thread_map.h" #include "util/top.h" +#include "util/util.h" #include <linux/rbtree.h> #include <subcmd/parse-options.h> #include "util/parse-events.h"
tools/perf/builtin-trace.c +1 -0
@@ -41,6 +41,7 @@#include "util/intlist.h" #include "util/thread_map.h" #include "util/stat.h" +#include "util/util.h" #include "trace/beauty/beauty.h" #include "trace-event.h" #include "util/parse-events.h"
tools/perf/tests/sdt.c +1 -0
@@ -9,6 +9,7 @@#include "debug.h" #include "probe-file.h" #include "build-id.h" +#include "util.h" /* To test SDT event, we need libelf support to scan elf binary */ #if defined(HAVE_SDT_EVENT ) && defined(HAVE_LIBELF_SUPPORT )
tools/perf/util/auxtrace.c +1 -0
@@ -50,6 +50,7 @@#include "intel-bts.h" #include "arm-spe.h" #include "s390-cpumsf.h" +#include "util.h" #include <linux/ctype.h> #include "symbol/kallsyms.h"
tools/perf/util/evlist.c +1 -0
@@ -16,6 +16,7 @@#include "evsel.h" #include "debug.h" #include "units.h" +#include "util.h" #include "asm/bug.h" #include "bpf-event.h" #include <signal.h>
tools/perf/util/evlist.h +0 -1
@@ -13,7 +13,6 @@#include "event.h" #include "evsel.h" #include "mmap.h" -#include "util.h" #include <signal.h> #include <unistd.h>
tools/perf/util/evsel.c +1 -0
@@ -40,6 +40,7 @@#include "stat.h" #include "string2.h" #include "memswap.h" +#include "util.h" #include "util/parse-branch-options.h" #include <internal/xyarray.h>
tools/perf/util/header.c +1 -0
@@ -42,6 +42,7 @@#include "tool.h" #include "time-utils.h" #include "units.h" +#include "util.h" #include "cputopo.h" #include "bpf-event.h"
tools/perf/util/session.c +1 -0
@@ -29,6 +29,7 @@#include "thread-stack.h" #include "sample-raw.h" #include "stat.h" +#include "util.h" #include "arch/common.h" #ifdef HAVE_ZSTD_SUPPORT
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 9/37 perf clang: Delete needless util-cxx.h header
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
It was put in place just to make sure the 'new' C++ operator wouldn't clash with some argument name in util.h, but there is not anymore any such argument and also the reason stated for util.h to be included there was to get the __maybe_unused definition, that is in linux/compiler.h, so use that instead and nuke util-cxx.h.
--- tools/perf/util/bpf-loader.c | 1 + tools/perf/util/c++/clang-c.h | 2 +- tools/perf/util/c++/clang-test.cpp | 4 +++- tools/perf/util/util-cxx.h | 27 --------------------------- 4 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 tools/perf/util/util-cxx.h
tools/perf/util/bpf-loader.c +1 -0
@@ -23,6 +23,7 @@#include "probe-finder.h" // for MAX_PROBES #include "parse-events.h" #include "strfilter.h" +#include "util.h" #include "llvm-utils.h" #include "c++/clang-c.h"
tools/perf/util/c++/clang-c.h +1 -1
@@ -3,7 +3,6 @@#define PERF_UTIL_CLANG_C_H #include <stddef.h> /* for size_t */ -#include <util-cxx.h> /* for __maybe_unused */ #ifdef __cplusplusextern "C" {
@@ -22,6 +21,7 @@ extern int perf_clang__compile_bpf(const char *filename,#else #include <errno.h> +#include <linux/compiler.h> /* for __maybe_unused */ static inline void perf_clang__init (void ) { }static inline void perf_clang__cleanup (void ) { }
tools/perf/util/c++/clang-test.cpp +3 -1
@@ -1,10 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 #include "clang.h" #include "clang-c.h" +extern "C" { +#include "../util.h" +} #include "llvm/IR/Function.h" #include "llvm/IR/LLVMContext.h" -#include <util-cxx.h> #include <tests/llvm.h> #include <string>
tools/perf/util/util-cxx.h deleted +0 -27
@@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* -* Support C++ source use utilities defined in util.h -*/ - -#ifndef PERF_UTIL_UTIL_CXX_H -#define PERF_UTIL_UTIL_CXX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* -* Now 'new' is the only C++ keyword found in util.h: -* in tools/include/linux/rbtree.h -* -* Other keywords, like class and delete, should be -* redefined if necessary. -*/ -#define new _new -#include "util.h" -#undef new - -#ifdef __cplusplus -} -#endif -#endif
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 10/37 perf top: Decay all events in the evlist
In reply to Arnaldo Carvalho de MeloFrom: Namhyung Kim <[email protected]>
Currently perf top only decays entries in a selected evsel. I don't know whether it's intended (maybe due to performance reason?) but anyway it might show incorrect output when event group is used since users will see leader event is decayed but others are not.
This patch moves the decay code into perf_top__resort_hists() so that stdio and TUI code shared the logic.
--- tools/perf/builtin-top.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-)
tools/perf/builtin-top.c +13 -25
@@ -265,13 +265,23 @@ static void perf_top__show_details(struct perf_top *top)pthread_mutex_unlock (¬es->lock); } -static void evlist__resort_hists (struct evlist *evlist) +static void perf_top__resort_hists (struct perf_top *t) { +struct evlist *evlist = t->evlist;struct evsel *pos;evlist__for_each_entry (evlist, pos) {struct hists *hists =evsel__hists (pos); +if (evlist->enabled) { +if (t->zero) { +hists__delete_entries (hists); + }else { +hists__decay_entries (hists, t->hide_user_symbols, + t->hide_kernel_symbols); + } + } +hists__collapse_resort (hists,NULL );/* Non-group events are considered as leader */
@@ -320,16 +330,7 @@ static void perf_top__print_sym_table(struct perf_top *top)return ; } -if (top->evlist->enabled) { -if (top->zero) { -hists__delete_entries (hists); - }else { -hists__decay_entries (hists, top->hide_user_symbols, - top->hide_kernel_symbols); - } - } - -evlist__resort_hists (top->evlist); +perf_top__resort_hists (top);hists__output_recalc_col_len (hists, top->print_entries - printed);putchar ('\n' );
@@ -577,24 +578,11 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)static void perf_top__sort_new_samples (void *arg) {struct perf_top *t = arg; -struct evsel *evsel = t->sym_evsel; -struct hists *hists;if (t->evlist->selected !=NULL ) t->sym_evsel = t->evlist->selected; - hists =evsel__hists (evsel); - -if (t->evlist->enabled) { -if (t->zero) { -hists__delete_entries (hists); - }else { -hists__decay_entries (hists, t->hide_user_symbols, - t->hide_kernel_symbols); - } - } - -evlist__resort_hists (t->evlist); +perf_top__resort_hists (t);if (t->lost || t->drop)pr_warning ("Too slow to read ring buffer (change period (-c/-F) or limit CPUs (-C)\n" );
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 11/37 perf top: Fix event group with more than two events
In reply to Arnaldo Carvalho de MeloFrom: Namhyung Kim <[email protected]>
The event group feature links relevant hist entries among events so that they can be displayed together. During the link process, each hist entry in non-leader events is connected to a hist entry in the leader event. This is done in order of events specified in the command line so it assumes that events are linked in the order.
But 'perf top' can break the assumption since it does the link process multiple times. For example, a hist entry can be in the third event only at first so it's linked after the leader. Some time later, second event has a hist entry for it and it'll be linked after the entry of the third event.
This makes the code compilicated to deal with such unordered entries. This patch simply unlink all the entries after it's printed so that they can assume the correct order after the repeated link process. Also it'd be easy to deal with decaying old entries IMHO.
--- tools/perf/builtin-top.c | 6 ++++++ tools/perf/util/hist.c | 39 +++++++++++++++++++++------------------ tools/perf/util/hist.h | 1 + 3 files changed, 28 insertions(+), 18 deletions(-)
tools/perf/builtin-top.c +6 -0
@@ -273,6 +273,12 @@ static void perf_top__resort_hists(struct perf_top *t)evlist__for_each_entry (evlist, pos) {struct hists *hists =evsel__hists (pos); +/* +* unlink existing entries so that they can be linked +* in a correct order in hists__match() below. +*/ +hists__unlink (hists); +if (evlist->enabled) {if (t->zero) {hists__delete_entries (hists);
tools/perf/util/hist.c +21 -18
@@ -2439,7 +2439,7 @@ void hists__match(struct hists *leader, struct hists *other) {struct rb_root_cached *root;struct rb_node *nd; -struct hist_entry *pos, *pair, *pos_pair, *tmp_pair; +struct hist_entry *pos, *pair;if (symbol_conf.report_hierarchy) {/* hierarchy report always collapses entries */
@@ -2456,24 +2456,8 @@ void hists__match(struct hists *leader, struct hists *other) pos = rb_entry(nd, struct hist_entry, rb_node_in); pair =hists__find_entry (other, pos); -if (pair &&list_empty (&pair->pairs.node)) { -list_for_each_entry_safe (pos_pair, tmp_pair, &pos->pairs.head, pairs.node) { -if (pos_pair->hists == other) { -/* -* XXX maybe decayed entries can appear -* here? but then we would have use -* after free, as decayed entries are -* freed see hists__delete_entry -*/ -BUG_ON (!pos_pair->dummy); -list_del_init (&pos_pair->pairs.node); -hist_entry__delete (pos_pair); -break ; - } - } - +if (pair)hist_entry__add_pair (pair, pos); - } } }
@@ -2558,6 +2542,25 @@ int hists__link(struct hists *leader, struct hists *other)return 0 ; } +int hists__unlink (struct hists *hists) +{ +struct rb_root_cached *root; +struct rb_node *nd; +struct hist_entry *pos; + +if (hists__has (hists, need_collapse)) + root = &hists->entries_collapsed; +else + root = hists->entries_in; + +for (nd =rb_first_cached (root); nd; nd =rb_next (nd)) { + pos = rb_entry(nd, struct hist_entry, rb_node_in); +list_del_init (&pos->pairs.node); + } + +return 0 ; +} +void hist__account_cycles (struct branch_stack *bs,struct addr_location *al,struct perf_sample *sample,bool nonany_branch_mode) {
tools/perf/util/hist.h +1 -0
@@ -217,6 +217,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *he);void hists__match (struct hists *leader,struct hists *other);int hists__link (struct hists *leader,struct hists *other); +int hists__unlink (struct hists *hists);struct hists_evsel {struct evsel evsel;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 12/37 libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_HEADER_ATTR event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 6 ++++++ tools/perf/util/event.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
@@ -109,4 +109,10 @@ struct perf_record_sample { __u64 array[]; }; +struct attr_event { +struct perf_event_header header; +struct perf_event_attr attr; +__u64 id[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
@@ -363,12 +363,6 @@ struct cpu_map_event {struct cpu_map_data data; }; -struct attr_event { -struct perf_event_header header; -struct perf_event_attr attr; -u64 id[]; -}; -enum {PERF_EVENT_UPDATE__UNIT =0 ,PERF_EVENT_UPDATE__SCALE =1 ,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 13/37 libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_CPU_MAP event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 26 ++++++++++++++++++++++++++ tools/perf/util/event.h | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-)
tools/perf/lib/include/perf/event.h +26 -0
@@ -115,4 +115,30 @@ struct attr_event { __u64 id[]; }; +enum { +PERF_CPU_MAP__CPUS =0 , +PERF_CPU_MAP__MASK =1 , +}; + +struct cpu_map_entries { +__u16 nr; +__u16 cpu[]; +}; + +struct cpu_map_mask { +__u16 nr; +__u16 long_size; +unsigned long mask[]; +}; + +struct cpu_map_data { +__u16 type; +char data[]; +}; + +struct cpu_map_event { +struct perf_event_header header; +struct cpu_map_data data; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -26
@@ -337,32 +337,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -enum { -PERF_CPU_MAP__CPUS =0 , -PERF_CPU_MAP__MASK =1 , -}; - -struct cpu_map_entries { -u16 nr; -u16 cpu[]; -}; - -struct cpu_map_mask { -u16 nr; -u16 long_size; -unsigned long mask[]; -}; - -struct cpu_map_data { -u16 type; -char data[]; -}; - -struct cpu_map_event { -struct perf_event_header header; -struct cpu_map_data data; -}; -enum {PERF_EVENT_UPDATE__UNIT =0 ,PERF_EVENT_UPDATE__SCALE =1 ,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 14/37 libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_EVENT_UPDATE event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 22 ++++++++++++++++++++++ tools/perf/util/event.h | 23 ----------------------- tools/perf/util/header.c | 2 +- 3 files changed, 23 insertions(+), 24 deletions(-)
tools/perf/lib/include/perf/event.h +22 -0
@@ -141,4 +141,26 @@ struct cpu_map_event { struct cpu_map_data data; }; +enum { +PERF_EVENT_UPDATE__UNIT =0 , +PERF_EVENT_UPDATE__SCALE =1 , +PERF_EVENT_UPDATE__NAME =2 , +PERF_EVENT_UPDATE__CPUS =3 , +}; + +struct event_update_event_cpus { +struct cpu_map_data cpus; +}; + +struct event_update_event_scale { +double scale; +}; + +struct event_update_event { +struct perf_event_header header; +__u64 type; +__u64 id; +char data[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -23
@@ -337,29 +337,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -enum { -PERF_EVENT_UPDATE__UNIT =0 , -PERF_EVENT_UPDATE__SCALE =1 , -PERF_EVENT_UPDATE__NAME =2 , -PERF_EVENT_UPDATE__CPUS =3 , -}; - -struct event_update_event_cpus { -struct cpu_map_data cpus; -}; - -struct event_update_event_scale { -double scale; -}; - -struct event_update_event { -struct perf_event_header header; -u64 type; -u64 id; - -char data[]; -}; -#define MAX_EVENT_NAME 64struct perf_trace_event_type {
tools/perf/util/header.c +1 -1
@@ -3893,7 +3893,7 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)struct perf_cpu_map *map;size_t ret; - ret =fprintf (fp,"\n... id: %" PRIu64"\n" , ev->id); + ret =fprintf (fp,"\n... id: %" PRI_lu64"\n" , ev->id);switch (ev->type) {case PERF_EVENT_UPDATE__SCALE :
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 15/37 libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_HEADER_EVENT_TYPE event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 12 ++++++++++++ tools/perf/util/event.h | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/lib/include/perf/event.h +12 -0
@@ -163,4 +163,16 @@ struct event_update_event { char data[]; }; +#define MAX_EVENT_NAME 64 + +struct perf_trace_event_type { +__u64 event_id; +char name[MAX_EVENT_NAME ]; +}; + +struct event_type_event { +struct perf_event_header header; +struct perf_trace_event_type event_type; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -12
@@ -337,18 +337,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -#define MAX_EVENT_NAME 64 - -struct perf_trace_event_type { -u64 event_id; -char name[MAX_EVENT_NAME ]; -}; - -struct event_type_event { -struct perf_event_header header; -struct perf_trace_event_type event_type; -}; -struct tracing_data_event {struct perf_event_header header;u32 size;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 16/37 libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_HEADER_TRACING_DATA event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 5 +++++ tools/perf/util/event.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
@@ -175,4 +175,9 @@ struct event_type_event { struct perf_trace_event_type event_type; }; +struct tracing_data_event { +struct perf_event_header header; +__u32 size; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
@@ -337,11 +337,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct tracing_data_event { -struct perf_event_header header; -u32 size; -}; -struct id_index_entry {u64 id;u64 idx;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 17/37 libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_HEADER_BUILD_ID event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Adding the fix value for build_id variable, because it will never change.
--- tools/perf/lib/include/perf/event.h | 8 ++++++++ tools/perf/util/event.h | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +8 -0
@@ -6,6 +6,7 @@#include <linux/types.h> #include <linux/limits.h> #include <linux/bpf.h> +#include <sys/types.h> /* pid_t */ struct perf_record_mmap {struct perf_event_header header;
@@ -180,4 +181,11 @@ struct tracing_data_event { __u32 size; }; +struct build_id_event { +struct perf_event_header header; +pid_t pid; +__u8 build_id[24 ]; +char filename[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
@@ -144,13 +144,6 @@ struct perf_sample { PERF_MEM_S(LOCK, NA) |\ PERF_MEM_S(TLB, NA)) -struct build_id_event { -struct perf_event_header header; -pid_t pid; -u8 build_id[PERF_ALIGN (BUILD_ID_SIZE ,sizeof (u64))]; -char filename[]; -}; - enum perf_user_event_type { /* above any possible kernel type */ PERF_RECORD_USER_TYPE_START = 64, PERF_RECORD_HEADER_ATTR = 64,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 18/37 libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_ID_INDEX event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Add the PRI_ld64 define, so we can use it in printf output.
--- tools/perf/lib/include/perf/event.h | 13 +++++++++++++ tools/perf/util/event.h | 15 ++------------- tools/perf/util/session.c | 8 ++++---- 3 files changed, 19 insertions(+), 17 deletions(-)
tools/perf/lib/include/perf/event.h +13 -0
@@ -188,4 +188,17 @@ struct build_id_event { char filename[]; }; +struct id_index_entry { +__u64 id; +__u64 idx; +__u64 cpu; +__u64 tid; +}; + +struct id_index_event { +struct perf_event_header header; +__u64 nr; +struct id_index_entry entries[0 ]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +2 -13
@@ -22,9 +22,11 @@*/ #define PRI_lu64 "l" PRIu64#define PRI_lx64 "l" PRIx64 +#define PRI_ld64 "l" PRId64#else #define PRI_lu64 PRIu64#define PRI_lx64 PRIx64 +#define PRI_ld64 PRId64#endif #define PERF_SAMPLE_MASK \
@@ -330,19 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct id_index_entry { -u64 id; -u64 idx; -u64 cpu; -u64 tid; -}; - -struct id_index_event { -struct perf_event_header header; -u64 nr; -struct id_index_entry entries[0 ]; -}; -struct auxtrace_info_event {struct perf_event_header header;u32 type;
tools/perf/util/session.c +4 -4
@@ -2393,10 +2393,10 @@ int perf_event__process_id_index(struct perf_session *session,struct perf_sample_id *sid;if (dump_trace) { -fprintf (stdout," ... id: %" PRIu64, e->id); -fprintf (stdout," idx: %" PRIu64, e->idx); -fprintf (stdout," cpu: %" PRId64, e->cpu); -fprintf (stdout," tid: %" PRId64"\n" , e->tid); +fprintf (stdout," ... id: %" PRI_lu64, e->id); +fprintf (stdout," idx: %" PRI_lu64, e->idx); +fprintf (stdout," cpu: %" PRI_ld64, e->cpu); +fprintf (stdout," tid: %" PRI_ld64"\n" , e->tid); } sid =perf_evlist__id2sid (evlist, e->id);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 19/37 libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_AUXTRACE_INFO event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/lib/include/perf/event.h | 7 +++++++ tools/perf/util/arm-spe.c | 2 +- tools/perf/util/cs-etm.c | 2 +- tools/perf/util/event.h | 7 ------- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/intel-pt.c | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-)
tools/perf/arch/x86/util/intel-pt.c +1 -1
@@ -328,7 +328,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,unsigned long max_non_turbo_ratio;size_t filter_str_len;const char *filter; -u64 *info; +__u64 *info;int err;if (priv_size != ptr->priv_size)
tools/perf/lib/include/perf/event.h +7 -0
@@ -201,4 +201,11 @@ struct id_index_event { struct id_index_entry entries[0]; }; +struct auxtrace_info_event { +struct perf_event_header header; +__u32 type; +__u32 reserved__;/* For alignment */ +__u64 priv[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/arm-spe.c +1 -1
@@ -181,7 +181,7 @@ static const char * const arm_spe_info_fmts[] = { [ARM_SPE_PMU_TYPE] = " PMU Type %"PRId64"\n", }; -static void arm_spe_print_info (u64 *arr) +static void arm_spe_print_info (__u64 *arr) {if (!dump_trace)return ;
tools/perf/util/cs-etm.c +1 -1
@@ -2370,7 +2370,7 @@ static const char * const cs_etmv4_priv_fmts[] = { [CS_ETMV4_TRCAUTHSTATUS] = " TRCAUTHSTATUS %llx\n", }; -static void cs_etm__print_auxtrace_info (u64 *val,int num) +static void cs_etm__print_auxtrace_info (__u64 *val,int num) {int i, j, cpu =0 ;
tools/perf/util/event.h +0 -7
@@ -332,13 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct auxtrace_info_event { -struct perf_event_header header; -u32 type; -u32 reserved__;/* For alignment */ -u64 priv[]; -}; -struct auxtrace_event {struct perf_event_header header;u64 size;
tools/perf/util/intel-bts.c +1 -1
@@ -834,7 +834,7 @@ static const char * const intel_bts_info_fmts[] = { [INTEL_BTS_SNAPSHOT_MODE] = " Snapshot mode %"PRId64"\n", }; -static void intel_bts_print_info (u64 *arr,int start,int finish) +static void intel_bts_print_info (__u64 *arr,int start,int finish) {int i;
tools/perf/util/intel-pt.c +2 -2
@@ -3044,7 +3044,7 @@ static const char * const intel_pt_info_fmts[] = { [INTEL_PT_FILTER_STR_LEN] = " Filter string len. %"PRIu64"\n", }; -static void intel_pt_print_info (u64 *arr,int start,int finish) +static void intel_pt_print_info (__u64 *arr,int start,int finish) {int i;
@@ -3076,7 +3076,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,size_t min_sz =sizeof (u64) *INTEL_PT_PER_CPU_MMAPS ;struct intel_pt *pt;void *info_end; -u64 *info; +__u64 *info;int err; if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 20/37 libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_AUXTRACE event definition to libperf's event.h.
Ipn order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 11 +++++++++++ tools/perf/util/auxtrace.c | 2 +- tools/perf/util/event.h | 11 ----------- 3 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
@@ -208,4 +208,15 @@ struct auxtrace_info_event { __u64 priv[]; }; +struct auxtrace_event { +struct perf_event_header header; +__u64 size; +__u64 offset; +__u64 reference; +__u32 idx; +__u32 tid; +__u32 cpu; +__u32 reserved__;/* For alignment */ +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/auxtrace.c +1 -1
@@ -943,7 +943,7 @@ s64 perf_event__process_auxtrace(struct perf_session *session,s64 err;if (dump_trace) -fprintf (stdout," size: %#" PRIx64" offset: %#" PRIx64" ref: %#" PRIx64" idx: %u tid: %d cpu: %d\n" , +fprintf (stdout," size: %#" PRI_lx64" offset: %#" PRI_lx64" ref: %#" PRI_lx64" idx: %u tid: %d cpu: %d\n" , event->auxtrace.size, event->auxtrace.offset, event->auxtrace.reference, event->auxtrace.idx, event->auxtrace.tid, event->auxtrace.cpu);
tools/perf/util/event.h +0 -11
@@ -332,17 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct auxtrace_event { -struct perf_event_header header; -u64 size; -u64 offset; -u64 reference; -u32 idx; -u32 tid; -u32 cpu; -u32 reserved__;/* For alignment */ -}; -#define MAX_AUXTRACE_ERROR_MSG 64struct auxtrace_error_event {
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 21/37 libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_AUXTRACE_ERROR event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 15 +++++++++++++++ tools/perf/util/auxtrace.c | 2 +- tools/perf/util/event.h | 15 --------------- 3 files changed, 16 insertions(+), 16 deletions(-)
tools/perf/lib/include/perf/event.h +15 -0
@@ -219,4 +219,19 @@ struct auxtrace_event { __u32 reserved__; /* For alignment */ }; +#define MAX_AUXTRACE_ERROR_MSG 64 + +struct auxtrace_error_event { +struct perf_event_header header; +__u32 type; +__u32 code; +__u32 cpu; +__u32 pid; +__u32 tid; +__u32 fmt; +__u64 ip; +__u64 time; +char msg[MAX_AUXTRACE_ERROR_MSG ]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/auxtrace.c +1 -1
@@ -1189,7 +1189,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)if (!e->fmt) msg = (const char *)&e->time; - ret +=fprintf (fp," cpu %d pid %d tid %d ip %#" PRIx64" code %u: %s\n" , + ret +=fprintf (fp," cpu %d pid %d tid %d ip %#" PRI_lx64" code %u: %s\n" , e->cpu, e->pid, e->tid, e->ip, e->code, msg);return ret; }
tools/perf/util/event.h +0 -15
@@ -332,21 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -#define MAX_AUXTRACE_ERROR_MSG 64 - -struct auxtrace_error_event { -struct perf_event_header header; -u32 type; -u32 code; -u32 cpu; -u32 pid; -u32 tid; -u32 fmt; -u64 ip; -u64 time; -char msg[MAX_AUXTRACE_ERROR_MSG ]; -}; -struct aux_event {struct perf_event_header header;u64 aux_offset;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 22/37 libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_AUX event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 7 +++++++ tools/perf/util/event.c | 2 +- tools/perf/util/event.h | 7 ------- 3 files changed, 8 insertions(+), 8 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
@@ -234,4 +234,11 @@ struct auxtrace_error_event { char msg[MAX_AUXTRACE_ERROR_MSG]; }; +struct aux_event { +struct perf_event_header header; +__u64 aux_offset; +__u64 aux_size; +__u64 flags; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
@@ -1449,7 +1449,7 @@ int perf_event__process_exit(struct perf_tool *tool __maybe_unused,size_t perf_event__fprintf_aux (union perf_event *event,FILE *fp) { - return fprintf(fp, " offset: %#"PRIx64" size: %#"PRIx64" flags: %#"PRIx64" [%s%s%s]\n", + return fprintf(fp, " offset: %#"PRI_lx64" size: %#"PRI_lx64" flags: %#"PRI_lx64" [%s%s%s]\n", event->aux.aux_offset, event->aux.aux_size, event->aux.flags, event->aux.flags & PERF_AUX_FLAG_TRUNCATED ? "T" : "",
tools/perf/util/event.h +0 -7
@@ -332,13 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct aux_event { -struct perf_event_header header; -u64 aux_offset; -u64 aux_size; -u64 flags; -}; -struct itrace_start_event {struct perf_event_header header;u32 pid, tid;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 23/37 libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_ITRACE_START event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 6 ++++++ tools/perf/util/event.h | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
@@ -241,4 +241,10 @@ struct aux_event { __u64 flags; }; +struct itrace_start_event { +struct perf_event_header header; +__u32 pid; +__u32 tid; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
@@ -332,11 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct itrace_start_event { -struct perf_event_header header; -u32 pid, tid; -}; -struct context_switch_event {struct perf_event_header header;u32 next_prev_pid;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 24/37 libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_SWITCH event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 6 ++++++ tools/perf/util/event.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
@@ -110,6 +110,12 @@ struct perf_record_sample {__u64 array[]; }; +struct context_switch_event { +struct perf_event_header header; +__u32 next_prev_pid; +__u32 next_prev_tid; +}; +struct attr_event {struct perf_event_header header;struct perf_event_attr attr;
tools/perf/util/event.h +0 -6
@@ -332,12 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct context_switch_event { -struct perf_event_header header; -u32 next_prev_pid; -u32 next_prev_tid; -}; -struct thread_map_event_entry {u64 pid;char comm[16 ];
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 25/37 libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_THREAD_MAP event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 11 +++++++++++ tools/perf/util/event.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
@@ -253,4 +253,15 @@ struct itrace_start_event { __u32 tid; }; +struct thread_map_event_entry { +__u64 pid; +char comm[16 ]; +}; + +struct thread_map_event { +struct perf_event_header header; +__u64 nr; +struct thread_map_event_entry entries[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -11
@@ -332,17 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct thread_map_event_entry { -u64 pid; -char comm[16 ]; -}; - -struct thread_map_event { -struct perf_event_header header; -u64 nr; -struct thread_map_event_entry entries[]; -}; -enum {PERF_STAT_CONFIG_TERM__AGGR_MODE =0 ,PERF_STAT_CONFIG_TERM__INTERVAL =1 ,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 26/37 libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_STAT_CONFIG event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 18 ++++++++++++++++++ tools/perf/util/event.c | 2 +- tools/perf/util/event.h | 18 ------------------ 3 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/lib/include/perf/event.h +18 -0
@@ -264,4 +264,22 @@ struct thread_map_event { struct thread_map_event_entry entries[]; }; +enum { +PERF_STAT_CONFIG_TERM__AGGR_MODE =0 , +PERF_STAT_CONFIG_TERM__INTERVAL =1 , +PERF_STAT_CONFIG_TERM__SCALE =2 , +PERF_STAT_CONFIG_TERM__MAX =3 , +}; + +struct stat_config_event_entry { +__u64 tag; +__u64 val; +}; + +struct stat_config_event { +struct perf_event_header header; +__u64 nr; +struct stat_config_event_entry data[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
@@ -1235,7 +1235,7 @@ void perf_event__read_stat_config(struct perf_stat_config *config, CASE(INTERVAL, interval)#undef CASEdefault : -pr_warning ("unknown stat config term %" PRIu64"\n" , +pr_warning ("unknown stat config term %" PRI_lu64"\n" , event->data[i].tag); } }
tools/perf/util/event.h +0 -18
@@ -332,24 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -enum { -PERF_STAT_CONFIG_TERM__AGGR_MODE =0 , -PERF_STAT_CONFIG_TERM__INTERVAL =1 , -PERF_STAT_CONFIG_TERM__SCALE =2 , -PERF_STAT_CONFIG_TERM__MAX =3 , -}; - -struct stat_config_event_entry { -u64 tag; -u64 val; -}; - -struct stat_config_event { -struct perf_event_header header; -u64 nr; -struct stat_config_event_entry data[]; -}; -struct stat_event {struct perf_event_header header;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 27/37 libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_STAT event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 17 +++++++++++++++++ tools/perf/util/event.h | 17 ----------------- tools/perf/util/stat.c | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/lib/include/perf/event.h +17 -0
@@ -282,4 +282,21 @@ struct stat_config_event { struct stat_config_event_entry data[]; }; +struct stat_event { +struct perf_event_header header; + +__u64 id; +__u32 cpu; +__u32 thread; + +union { +struct { +__u64 val; +__u64 ena; +__u64 run; + }; +__u64 values[3 ]; + }; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -17
@@ -332,23 +332,6 @@ struct events_stats {u32 nr_proc_map_timeout; }; -struct stat_event { -struct perf_event_header header; - -u64 id; -u32 cpu; -u32 thread; - -union { -struct { -u64 val; -u64 ena; -u64 run; - }; -u64 values[3 ]; - }; -}; -enum {PERF_STAT_ROUND_TYPE__INTERVAL =0 ,PERF_STAT_ROUND_TYPE__FINAL =1 ,
tools/perf/util/stat.c +2 -2
@@ -405,9 +405,9 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)struct stat_event *st = (struct stat_event *) event;size_t ret; - ret =fprintf (fp,"\n... id %" PRIu64", cpu %d, thread %d\n" , + ret =fprintf (fp,"\n... id %" PRI_lu64", cpu %d, thread %d\n" , st->id, st->cpu, st->thread); - ret +=fprintf (fp,"... value %" PRIu64", enabled %" PRIu64", running %" PRIu64"\n" , + ret +=fprintf (fp,"... value %" PRI_lu64", enabled %" PRI_lu64", running %" PRI_lu64"\n" , st->val, st->ena, st->run);return ret;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 28/37 libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_STAT_ROUND event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 6 ++++++ tools/perf/util/event.h | 6 ------ tools/perf/util/stat.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
@@ -299,4 +299,10 @@ struct stat_event { }; }; +struct stat_round_event { +struct perf_event_header header; +__u64 type; +__u64 time; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
@@ -337,12 +337,6 @@ enum { PERF_STAT_ROUND_TYPE__FINAL = 1, }; -struct stat_round_event { -struct perf_event_header header; -u64 type; -u64 time; -}; -struct time_conv_event {struct perf_event_header header;u64 time_shift;
tools/perf/util/stat.c +1 -1
@@ -418,7 +418,7 @@ size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp)struct stat_round_event *rd = (struct stat_round_event *)event;size_t ret; - ret =fprintf (fp,"\n... time %" PRIu64", type %s\n" , rd->time, + ret =fprintf (fp,"\n... time %" PRI_lu64", type %s\n" , rd->time, rd->type ==PERF_STAT_ROUND_TYPE__FINAL ?"FINAL" :"INTERVAL" );return ret;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 29/37 libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_TIME_CONV event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 7 +++++++ tools/perf/util/event.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
@@ -305,4 +305,11 @@ struct stat_round_event { __u64 time; }; +struct time_conv_event { +struct perf_event_header header; +__u64 time_shift; +__u64 time_mult; +__u64 time_zero; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
@@ -337,13 +337,6 @@ enum { PERF_STAT_ROUND_TYPE__FINAL = 1, }; -struct time_conv_event { -struct perf_event_header header; -u64 time_shift; -u64 time_mult; -u64 time_zero; -}; -struct feature_event {struct perf_event_header header;u64 feat_id;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 30/37 libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_HEADER_FEATURE event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/builtin-report.c | 2 +- tools/perf/lib/include/perf/event.h | 6 ++++++ tools/perf/util/event.h | 6 ------ 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-report.c +1 -1
@@ -212,7 +212,7 @@ static int process_feature_event(struct perf_session *session,return perf_event__process_feature (session, event);if (event->feat.feat_id !=HEADER_LAST_FEATURE ) { -pr_err ("failed: wrong feature ID: %" PRIu64"\n" , +pr_err ("failed: wrong feature ID: %" PRI_lu64"\n" , event->feat.feat_id);return -1 ; }
tools/perf/lib/include/perf/event.h +6 -0
@@ -312,4 +312,10 @@ struct time_conv_event { __u64 time_zero; }; +struct feature_event { +struct perf_event_header header; +__u64 feat_id; +char data[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
@@ -337,12 +337,6 @@ enum { PERF_STAT_ROUND_TYPE__FINAL = 1, }; -struct feature_event { -struct perf_event_header header; -u64 feat_id; -char data[]; -}; -struct compressed_event {struct perf_event_header header;char data[];
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 31/37 libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_COMPRESSED event definition to libperf's event.h.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
--- tools/perf/lib/include/perf/event.h | 5 +++++ tools/perf/util/event.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
@@ -318,4 +318,9 @@ struct feature_event { char data[]; }; +struct compressed_event { +struct perf_event_header header; +char data[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
@@ -337,11 +337,6 @@ enum { PERF_STAT_ROUND_TYPE__FINAL = 1, }; -struct compressed_event { -struct perf_event_header header; -char data[]; -}; -union perf_event {struct perf_event_header header;struct perf_record_mmap mmap;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 32/37 libperf: Add 'union perf_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
So it's available for libperf's users.
--- tools/perf/lib/include/perf/event.h | 36 +++++++++++++++++++++++++++++ tools/perf/util/event.h | 36 ----------------------------- 2 files changed, 36 insertions(+), 36 deletions(-)
tools/perf/lib/include/perf/event.h +36 -0
@@ -323,4 +323,40 @@ struct compressed_event {char data[]; }; +union perf_event { +struct perf_event_header header; +struct perf_record_mmap mmap; +struct perf_record_mmap2 mmap2; +struct perf_record_comm comm; +struct perf_record_namespaces namespaces; +struct perf_record_fork fork; +struct perf_record_lost lost; +struct perf_record_lost_samples lost_samples; +struct perf_record_read read; +struct perf_record_throttle throttle; +struct perf_record_sample sample; +struct perf_record_bpf_event bpf; +struct perf_record_ksymbol ksymbol; +struct attr_event attr; +struct event_update_event event_update; +struct event_type_event event_type; +struct tracing_data_event tracing_data; +struct build_id_event build_id; +struct id_index_event id_index; +struct auxtrace_info_event auxtrace_info; +struct auxtrace_event auxtrace; +struct auxtrace_error_event auxtrace_error; +struct aux_event aux; +struct itrace_start_event itrace_start; +struct context_switch_event context_switch; +struct thread_map_event thread_map; +struct cpu_map_event cpu_map; +struct stat_config_event stat_config; +struct stat_event stat; +struct stat_round_event stat_round; +struct time_conv_event time_conv; +struct feature_event feat; +struct compressed_event pack; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -36
@@ -337,42 +337,6 @@ enum { PERF_STAT_ROUND_TYPE__FINAL = 1, }; -union perf_event { -struct perf_event_header header; -struct perf_record_mmap mmap; -struct perf_record_mmap2 mmap2; -struct perf_record_comm comm; -struct perf_record_namespaces namespaces; -struct perf_record_fork fork; -struct perf_record_lost lost; -struct perf_record_lost_samples lost_samples; -struct perf_record_read read; -struct perf_record_throttle throttle; -struct perf_record_sample sample; -struct perf_record_bpf_event bpf; -struct perf_record_ksymbol ksymbol; -struct attr_event attr; -struct event_update_event event_update; -struct event_type_event event_type; -struct tracing_data_event tracing_data; -struct build_id_event build_id; -struct id_index_event id_index; -struct auxtrace_info_event auxtrace_info; -struct auxtrace_event auxtrace; -struct auxtrace_error_event auxtrace_error; -struct aux_event aux; -struct itrace_start_event itrace_start; -struct context_switch_event context_switch; -struct thread_map_event thread_map; -struct cpu_map_event cpu_map; -struct stat_config_event stat_config; -struct stat_event stat; -struct stat_round_event stat_round; -struct time_conv_event time_conv; -struct feature_event feat; -struct compressed_event pack; -}; -void perf_event__print_totals (void );struct perf_tool ;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 33/37 libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Even more, to have a "perf_record_" prefix, so that they match the PERF_RECORD_ enum they map to.
--- tools/perf/arch/arm/util/cs-etm.c | 4 +- tools/perf/arch/arm64/util/arm-spe.c | 2 +- tools/perf/arch/s390/util/auxtrace.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/builtin-record.c | 4 +- tools/perf/builtin-script.c | 2 +- tools/perf/builtin-stat.c | 2 +- tools/perf/lib/include/perf/event.h | 136 +++++++++++++-------------- tools/perf/tests/cpumap.c | 12 +-- tools/perf/tests/event_update.c | 16 ++-- tools/perf/tests/stat.c | 8 +- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/arm-spe.c | 4 +- tools/perf/util/auxtrace.c | 16 ++-- tools/perf/util/auxtrace.h | 8 +- tools/perf/util/build-id.c | 2 +- tools/perf/util/cpumap.c | 6 +- tools/perf/util/cpumap.h | 4 +- tools/perf/util/cs-etm.c | 2 +- tools/perf/util/event.c | 34 +++---- tools/perf/util/event.h | 4 +- tools/perf/util/header.c | 54 +++++------ tools/perf/util/intel-bts.c | 4 +- tools/perf/util/intel-pt.c | 8 +- tools/perf/util/python.c | 4 +- tools/perf/util/s390-cpumsf.c | 4 +- tools/perf/util/session.c | 20 ++-- tools/perf/util/session.h | 2 +- tools/perf/util/stat.c | 6 +- tools/perf/util/thread_map.c | 4 +- tools/perf/util/thread_map.h | 4 +- 33 files changed, 193 insertions(+), 193 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +2 -2
@@ -565,7 +565,7 @@ static int cs_etm_get_ro(struct perf_pmu *pmu, int cpu, const char *path)static void cs_etm_get_metadata (int cpu,u32 *offset,struct auxtrace_record *itr, -struct auxtrace_info_event *info) +struct perf_record_auxtrace_info *info) {u32 increment;u64 magic;
@@ -630,7 +630,7 @@ static void cs_etm_get_metadata(int cpu, u32 *offset,static int cs_etm_info_fill (struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *info, +struct perf_record_auxtrace_info *info,size_t priv_size) {int i;
tools/perf/arch/arm64/util/arm-spe.c +1 -1
@@ -41,7 +41,7 @@ arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused,static int arm_spe_info_fill (struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *auxtrace_info, +struct perf_record_auxtrace_info *auxtrace_info,size_t priv_size) { struct arm_spe_recording *sper =
tools/perf/arch/s390/util/auxtrace.c +1 -1
@@ -29,7 +29,7 @@ static size_t cpumsf_info_priv_size(struct auxtrace_record *itr __maybe_unused,static int cpumsf_info_fill (struct auxtrace_record *itr__maybe_unused ,struct perf_session *session__maybe_unused , -struct auxtrace_info_event *auxtrace_info__maybe_unused , +struct perf_record_auxtrace_info *auxtrace_info__maybe_unused ,size_t priv_size__maybe_unused ) { auxtrace_info->type =PERF_AUXTRACE_S390_CPUMSF ;
tools/perf/arch/x86/util/intel-bts.c +1 -1
@@ -60,7 +60,7 @@ intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused,static int intel_bts_info_fill (struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *auxtrace_info, +struct perf_record_auxtrace_info *auxtrace_info,size_t priv_size) { struct intel_bts_recording *btsr =
tools/perf/arch/x86/util/intel-pt.c +1 -1
@@ -314,7 +314,7 @@ static void intel_pt_tsc_ctc_ratio(u32 *n, u32 *d)static int intel_pt_info_fill (struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *auxtrace_info, +struct perf_record_auxtrace_info *auxtrace_info,size_t priv_size) { struct intel_pt_recording *ptr =
tools/perf/arch/x86/util/tsc.c +1 -1
@@ -57,7 +57,7 @@ int perf_event__synth_time_conv(const struct perf_event_mmap_page *pc, .time_conv = { .header = { .type = PERF_RECORD_TIME_CONV, - .size = sizeof(struct time_conv_event), + .size = sizeof(struct perf_record_time_conv), }, }, };
tools/perf/builtin-record.c +2 -2
@@ -898,7 +898,7 @@ static void record__adjust_affinity(struct record *rec, struct perf_mmap *map)static size_t process_comp_header (void *record,size_t increment) { -struct compressed_event *event = record; +struct perf_record_compressed *event = record;size_t size =sizeof (*event);if (increment) {
@@ -916,7 +916,7 @@ static size_t zstd_compress(struct perf_session *session, void *dst, size_t dst_ void *src, size_t src_size) { size_t compressed; -size_t max_record_size =PERF_SAMPLE_MAX_SIZE -sizeof (struct compressed_event ) -1 ; +size_t max_record_size =PERF_SAMPLE_MAX_SIZE -sizeof (struct perf_record_compressed ) -1 ; compressed =zstd_compress_stream_to_records (&session->zstd_data, dst, dst_size, src, src_size, max_record_size, process_comp_header);
tools/perf/builtin-script.c +1 -1
@@ -3244,7 +3244,7 @@ static void script__setup_sample_type(struct perf_script *script)static int process_stat_round_event (struct perf_session *session,union perf_event *event) { -struct stat_round_event *round = &event->stat_round; +struct perf_record_stat_round *round = &event->stat_round;struct evsel *counter;evlist__for_each_entry (session->evlist, counter) {
tools/perf/builtin-stat.c +1 -1
@@ -1462,7 +1462,7 @@ static int __cmd_record(int argc, const char **argv)static int process_stat_round_event (struct perf_session *session,union perf_event *event) { -struct stat_round_event *stat_round = &event->stat_round; +struct perf_record_stat_round *stat_round = &event->stat_round;struct evsel *counter;struct timespec tsh, *ts =NULL ;const char **argv = session->header.env.cmdline_argv;
tools/perf/lib/include/perf/event.h +68 -68
270 lines not on this page · raw message
tools/perf/tests/cpumap.c +6 -6
@@ -15,9 +15,9 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct cpu_map_event *map_event = &event->cpu_map; -struct cpu_map_mask *mask; -struct cpu_map_data *data; + struct perf_record_cpu_map *map_event = &event->cpu_map; +struct perf_record_record_cpu_map *mask; +struct perf_record_cpu_map_data *data;struct perf_cpu_map *map;int i;
@@ -25,7 +25,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,TEST_ASSERT_VAL ("wrong type" , data->type ==PERF_CPU_MAP__MASK ); - mask = (struct cpu_map_mask *)data->data; + mask = (struct perf_record_record_cpu_map *)data->data;TEST_ASSERT_VAL ("wrong nr" , mask->nr ==1 );
@@ -49,9 +49,9 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct cpu_map_event *map_event = &event->cpu_map; + struct perf_record_cpu_map *map_event = &event->cpu_map;struct cpu_map_entries *cpus; -struct cpu_map_data *data; +struct perf_record_cpu_map_data *data;struct perf_cpu_map *map; data = &map_event->data;
tools/perf/tests/event_update.c +8 -8
@@ -12,7 +12,7 @@ static int process_event_unit(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct event_update_event *ev = (struct event_update_event *) event; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event;TEST_ASSERT_VAL ("wrong id" , ev->id ==123 );TEST_ASSERT_VAL ("wrong id" , ev->type ==PERF_EVENT_UPDATE__UNIT );
@@ -25,10 +25,10 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct event_update_event *ev = (struct event_update_event *) event; -struct event_update_event_scale *ev_data; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event; +struct perf_record_event_update_scale *ev_data; - ev_data = (struct event_update_event_scale *) ev->data; + ev_data = (struct perf_record_event_update_scale *)ev->data;TEST_ASSERT_VAL ("wrong id" , ev->id ==123 );TEST_ASSERT_VAL ("wrong id" , ev->type ==PERF_EVENT_UPDATE__SCALE );
@@ -47,7 +47,7 @@ static int process_event_name(struct perf_tool *tool, struct machine *machine __maybe_unused) { struct event_name *tmp = container_of(tool, struct event_name, tool); -struct event_update_event *ev = (struct event_update_event *) event; +struct perf_record_event_update *ev = (struct perf_record_event_update *)event;TEST_ASSERT_VAL ("wrong id" , ev->id ==123 );TEST_ASSERT_VAL ("wrong id" , ev->type ==PERF_EVENT_UPDATE__NAME );
@@ -60,11 +60,11 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct event_update_event *ev = (struct event_update_event*) event; -struct event_update_event_cpus *ev_data; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event; +struct perf_record_event_update_cpus *ev_data;struct perf_cpu_map *map; - ev_data = (struct event_update_event_cpus *) ev->data; + ev_data = (struct perf_record_event_update_cpus *) ev->data; map =cpu_map__new_data (&ev_data->cpus);
tools/perf/tests/stat.c +4 -4
@@ -6,7 +6,7 @@#include "counts.h" #include "debug.h" -static bool has_term (struct stat_config_event *config, +static bool has_term (struct perf_record_stat_config *config,u64 tag,u64 val) {unsigned i;
@@ -25,7 +25,7 @@ static int process_stat_config_event(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct stat_config_event *config = &event->stat_config; + struct perf_record_stat_config *config = &event->stat_config;struct perf_stat_config stat_config;#define HAS (term, val) \
@@ -65,7 +65,7 @@ static int process_stat_event(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct stat_event *st = &event->stat; + struct perf_record_stat *st = &event->stat;TEST_ASSERT_VAL ("wrong cpu" , st->cpu ==1 );TEST_ASSERT_VAL ("wrong thread" , st->thread ==2 );
@@ -95,7 +95,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct stat_round_event *stat_round = &event->stat_round; + struct perf_record_stat_round *stat_round = &event->stat_round;TEST_ASSERT_VAL ("wrong time" , stat_round->time ==0xdeadbeef );TEST_ASSERT_VAL ("wrong type" , stat_round->type ==PERF_STAT_ROUND_TYPE__INTERVAL );
tools/perf/tests/thread-map.c +1 -1
@@ -56,7 +56,7 @@ static int process_event(struct perf_tool *tool __maybe_unused,struct perf_sample *sample__maybe_unused , struct machine *machine __maybe_unused) { - struct thread_map_event *map = &event->thread_map; + struct perf_record_thread_map *map = &event->thread_map;struct perf_thread_map *threads;TEST_ASSERT_VAL ("wrong nr" , map->nr ==1 );
tools/perf/util/arm-spe.c +2 -2
@@ -192,12 +192,12 @@ static void arm_spe_print_info(__u64 *arr)int arm_spe_process_auxtrace_info (union perf_event *event,struct perf_session *session) { -struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info; +struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;size_t min_sz =sizeof (u64) *ARM_SPE_PMU_TYPE ;struct arm_spe *spe;int err; -if (auxtrace_info->header.size <sizeof (struct auxtrace_info_event ) + +if (auxtrace_info->header.size <sizeof (struct perf_record_auxtrace_info ) + min_sz)return -EINVAL ;
tools/perf/util/auxtrace.c +8 -8
@@ -386,7 +386,7 @@ static int auxtrace_queues__add_indexed_event(struct auxtrace_queues *queues,return err;if (event->header.type ==PERF_RECORD_AUXTRACE ) { -if (event->header.size <sizeof (struct auxtrace_event ) || +if (event->header.size <sizeof (struct perf_record_auxtrace ) || event->header.size != sz) { err = -EINVAL ; goto out;
@@ -519,7 +519,7 @@ static int auxtrace_not_supported(void)int auxtrace_record__info_fill (struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *auxtrace_info, +struct perf_record_auxtrace_info *auxtrace_info,size_t priv_size) {if (itr)
@@ -859,13 +859,13 @@ void auxtrace_buffer__free(struct auxtrace_buffer *buffer)free (buffer); } -void auxtrace_synth_error (struct auxtrace_error_event *auxtrace_error,int type, +void auxtrace_synth_error (struct perf_record_auxtrace_error *auxtrace_error,int type,int code,int cpu,pid_t pid,pid_t tid,u64 ip,const char *msg,u64 timestamp) {size_t size; -memset (auxtrace_error,0 ,sizeof (struct auxtrace_error_event )); +memset (auxtrace_error,0 ,sizeof (struct perf_record_auxtrace_error )); auxtrace_error->header.type =PERF_RECORD_AUXTRACE_ERROR ; auxtrace_error->type = type;
@@ -894,12 +894,12 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,pr_debug2 ("Synthesizing auxtrace information\n" ); priv_size =auxtrace_record__info_priv_size (itr, session->evlist); - ev =zalloc (sizeof (struct auxtrace_info_event ) + priv_size); + ev =zalloc (sizeof (struct perf_record_auxtrace_info ) + priv_size);if (!ev)return -ENOMEM ; ev->auxtrace_info.header.type =PERF_RECORD_AUXTRACE_INFO ; - ev->auxtrace_info.header.size =sizeof (struct auxtrace_info_event ) + + ev->auxtrace_info.header.size =sizeof (struct perf_record_auxtrace_info ) + priv_size; err =auxtrace_record__info_fill (itr, session, &ev->auxtrace_info, priv_size);
@@ -1169,7 +1169,7 @@ static const char *auxtrace_error_name(int type)size_t perf_event__fprintf_auxtrace_error (union perf_event *event,FILE *fp) { -struct auxtrace_error_event *e = &event->auxtrace_error; +struct perf_record_auxtrace_error *e = &event->auxtrace_error;unsigned long long nsecs = e->time;const char *msg = e->msg;int ret;
@@ -1197,7 +1197,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)void perf_session__auxtrace_error_inc (struct perf_session *session,union perf_event *event) { -struct auxtrace_error_event *e = &event->auxtrace_error; +struct perf_record_auxtrace_error *e = &event->auxtrace_error;if (e->type <PERF_AUXTRACE_ERROR_MAX ) session->evlist->stats.nr_auxtrace_errors[e->type] +=1 ;
tools/perf/util/auxtrace.h +4 -4
@@ -28,7 +28,7 @@ struct perf_tool;struct perf_mmap ;struct option ;struct record_opts ; -struct auxtrace_info_event ; +struct perf_record_auxtrace_info ;struct events_stats ;/* Auxtrace records must have the same alignment as perf event records */
@@ -318,7 +318,7 @@ struct auxtrace_record { struct evlist *evlist);int (*info_fill)(struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *auxtrace_info, +struct perf_record_auxtrace_info *auxtrace_info,size_t priv_size);void (*free)(struct auxtrace_record *itr);int (*snapshot_start)(struct auxtrace_record *itr);
@@ -498,7 +498,7 @@ size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr, struct evlist *evlist);int auxtrace_record__info_fill (struct auxtrace_record *itr,struct perf_session *session, -struct auxtrace_info_event *auxtrace_info, +struct perf_record_auxtrace_info *auxtrace_info,size_t priv_size);void auxtrace_record__free (struct auxtrace_record *itr);int auxtrace_record__snapshot_start (struct auxtrace_record *itr);
@@ -515,7 +515,7 @@ int auxtrace_index__process(int fd, u64 size, struct perf_session *session, bool needs_swap);void auxtrace_index__free (struct list_head *head); -void auxtrace_synth_error (struct auxtrace_error_event *auxtrace_error,int type, +void auxtrace_synth_error (struct perf_record_auxtrace_error *auxtrace_error,int type,int code,int cpu,pid_t pid,pid_t tid,u64 ip,const char *msg,u64 timestamp);
tools/perf/util/build-id.c +1 -1
@@ -295,7 +295,7 @@ static int write_buildid(const char *name, size_t name_len, u8 *build_id, pid_t pid, u16 misc, struct feat_fd *fd) { int err; -struct build_id_event b; +struct perf_record_header_build_id b;size_t len; len = name_len +1 ;
tools/perf/util/cpumap.c +3 -3
@@ -43,7 +43,7 @@ static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus)return map; } -static struct perf_cpu_map *cpu_map__from_mask (struct cpu_map_mask *mask) +static struct perf_cpu_map *cpu_map__from_mask (struct perf_record_record_cpu_map *mask) {struct perf_cpu_map *map;int nr, nbits = mask->nr * mask->long_size *BITS_PER_BYTE ;
@@ -61,12 +61,12 @@ static struct perf_cpu_map *cpu_map__from_mask(struct cpu_map_mask *mask) } -struct perf_cpu_map *cpu_map__new_data (struct cpu_map_data *data) +struct perf_cpu_map *cpu_map__new_data (struct perf_record_cpu_map_data *data) {if (data->type ==PERF_CPU_MAP__CPUS )return cpu_map__from_entries ((struct cpu_map_entries *)data->data);else -return cpu_map__from_mask ((struct cpu_map_mask *)data->data); +return cpu_map__from_mask ((struct perf_record_record_cpu_map *)data->data); }size_t cpu_map__fprintf (struct perf_cpu_map *map,FILE *fp)
tools/perf/util/cpumap.h +2 -2
@@ -7,10 +7,10 @@#include <internal/cpumap.h> #include <perf/cpumap.h> -struct cpu_map_data ; +struct perf_record_cpu_map_data ;struct perf_cpu_map *perf_cpu_map__empty_new (int nr); -struct perf_cpu_map *cpu_map__new_data (struct cpu_map_data *data); +struct perf_cpu_map *cpu_map__new_data (struct perf_record_cpu_map_data *data);size_t cpu_map__snprint (struct perf_cpu_map *map,char *buf,size_t size);size_t cpu_map__snprint_mask (struct perf_cpu_map *map,char *buf,size_t size);size_t cpu_map__fprintf (struct perf_cpu_map *map,FILE *fp);
tools/perf/util/cs-etm.c +1 -1
@@ -2393,7 +2393,7 @@ static void cs_etm__print_auxtrace_info(__u64 *val, int num)int cs_etm__process_auxtrace_info (union perf_event *event,struct perf_session *session) { -struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info; +struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;struct cs_etm_auxtrace *etm =NULL ;struct int_node *inode;unsigned int pmu_type;
tools/perf/util/event.c +17 -17
@@ -992,7 +992,7 @@ int perf_event__synthesize_thread_map2(struct perf_tool *tool, event->thread_map.nr = threads->nr;for (i =0 ; i < threads->nr; i++) { -struct thread_map_event_entry *entry = &event->thread_map.entries[i]; +struct perf_record_thread_map_entry *entry = &event->thread_map.entries[i];char *comm =perf_thread_map__comm (threads, i);if (!comm)
@@ -1019,7 +1019,7 @@ static void synthesize_cpus(struct cpu_map_entries *cpus, cpus->cpu[i] = map->map[i]; } -static void synthesize_mask (struct cpu_map_mask *mask, +static void synthesize_mask (struct perf_record_record_cpu_map *mask,struct perf_cpu_map *map,int max) {int i;
@@ -1050,7 +1050,7 @@ static size_t mask_size(struct perf_cpu_map *map, int *max) *max = bit; } -return sizeof (struct cpu_map_mask ) +BITS_TO_LONGS (*max) *sizeof (long ); +return sizeof (struct perf_record_record_cpu_map ) +BITS_TO_LONGS (*max) *sizeof (long ); }void *cpu_map_data__alloc (struct perf_cpu_map *map,size_t *size,u16 *type,int *max)
@@ -1061,15 +1061,15 @@ void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int/* * Both array and mask data have variable size based * on the number of cpus and their actual values. -* The size of the 'struct cpu_map_data' is: +* The size of the 'struct perf_record_cpu_map_data' is: * * array = size of 'struct cpu_map_entries' + * number of cpus * sizeof(u64) * -* mask = size of 'struct cpu_map_mask' + +* mask = size of 'struct perf_record_record_cpu_map' + * maximum cpu bit converted to size of longs * -* and finaly + the size of 'struct cpu_map_data'. +* and finaly + the size of 'struct perf_record_cpu_map_data'. */ size_cpus =cpus_size (map); size_mask =mask_size (map, max);
@@ -1082,12 +1082,12 @@ void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int *type =PERF_CPU_MAP__MASK ; } - *size +=sizeof (struct cpu_map_data ); + *size +=sizeof (struct perf_record_cpu_map_data ); *size =PERF_ALIGN (*size,sizeof (u64));return zalloc (*size); } -void cpu_map_data__synthesize (struct cpu_map_data *data,struct perf_cpu_map *map, +void cpu_map_data__synthesize (struct perf_record_cpu_map_data *data,struct perf_cpu_map *map,u16 type,int max) { data->type = type;
@@ -1097,16 +1097,16 @@ void cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *masynthesize_cpus ((struct cpu_map_entries *) data->data, map);break ;case PERF_CPU_MAP__MASK : -synthesize_mask ((struct cpu_map_mask *) data->data, map, max); +synthesize_mask ((struct perf_record_record_cpu_map *)data->data, map, max);default :break ; }; } -static struct cpu_map_event *cpu_map_event__new (struct perf_cpu_map *map) +static struct perf_record_cpu_map *cpu_map_event__new (struct perf_cpu_map *map) { -size_t size =sizeof (struct cpu_map_event ); -struct cpu_map_event *event; +size_t size =sizeof (struct perf_record_cpu_map ); +struct perf_record_cpu_map *event;int max;u16 type;
@@ -1127,7 +1127,7 @@ int perf_event__synthesize_cpu_map(struct perf_tool *tool,perf_event__handler_t process, struct machine *machine) { - struct cpu_map_event *event; + struct perf_record_cpu_map *event;int err; event =cpu_map_event__new (map);
@@ -1145,7 +1145,7 @@ int perf_event__synthesize_stat_config(struct perf_tool *tool,perf_event__handler_t process, struct machine *machine) { - struct stat_config_event *event; + struct perf_record_stat_config *event;int size, i =0 , err; size =sizeof (*event);
@@ -1184,7 +1184,7 @@ int perf_event__synthesize_stat(struct perf_tool *tool,perf_event__handler_t process, struct machine *machine) { - struct stat_event event; + struct perf_record_stat event; event.header.type =PERF_RECORD_STAT ; event.header.size =sizeof (event);
@@ -1205,7 +1205,7 @@ int perf_event__synthesize_stat_round(struct perf_tool *tool,perf_event__handler_t process, struct machine *machine) { - struct stat_round_event event; + struct perf_record_stat_round event; event.header.type =PERF_RECORD_STAT_ROUND ; event.header.size =sizeof (event);
@@ -1218,7 +1218,7 @@ int perf_event__synthesize_stat_round(struct perf_tool *tool, }void perf_event__read_stat_config (struct perf_stat_config *config, -struct stat_config_event *event) +struct perf_record_stat_config *event) {unsigned i;
tools/perf/util/event.h +2 -2
@@ -374,7 +374,7 @@ int perf_event__synthesize_stat_config(struct perf_tool *tool,perf_event__handler_t process, struct machine *machine);void perf_event__read_stat_config (struct perf_stat_config *config, -struct stat_config_event *event); +struct perf_record_stat_config *event); int perf_event__synthesize_stat(struct perf_tool *tool, u32 cpu, u32 thread, u64 id, struct perf_counts_values *count,
@@ -511,7 +511,7 @@ int kallsyms__get_function_start(const char *kallsyms_filename, const char *symbol_name, u64 *addr);void *cpu_map_data__alloc (struct perf_cpu_map *map,size_t *size,u16 *type,int *max); -void cpu_map_data__synthesize (struct cpu_map_data *data,struct perf_cpu_map *map, +void cpu_map_data__synthesize (struct perf_record_cpu_map_data *data,struct perf_cpu_map *map,u16 type,int max);void event_attr_init (struct perf_event_attr *attr);
tools/perf/util/header.c +27 -27
173 lines not on this page · raw message
tools/perf/util/intel-bts.c +2 -2
@@ -848,12 +848,12 @@ static void intel_bts_print_info(__u64 *arr, int start, int finish)int intel_bts_process_auxtrace_info (union perf_event *event,struct perf_session *session) { -struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info; +struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;size_t min_sz =sizeof (u64) *INTEL_BTS_SNAPSHOT_MODE ;struct intel_bts *bts;int err; -if (auxtrace_info->header.size <sizeof (struct auxtrace_info_event ) + +if (auxtrace_info->header.size <sizeof (struct perf_record_auxtrace_info ) + min_sz)return -EINVAL ;
tools/perf/util/intel-pt.c +4 -4
@@ -3063,23 +3063,23 @@ static void intel_pt_print_info_str(const char *name, const char *str)fprintf (stdout," %-20s%s\n" , name, str ? str :"" ); } -static bool intel_pt_has (struct auxtrace_info_event *auxtrace_info,int pos) +static bool intel_pt_has (struct perf_record_auxtrace_info *auxtrace_info,int pos) {return auxtrace_info->header.size >= -sizeof (struct auxtrace_info_event ) + (sizeof (u64) * (pos +1 )); +sizeof (struct perf_record_auxtrace_info ) + (sizeof (u64) * (pos +1 )); }int intel_pt_process_auxtrace_info (union perf_event *event,struct perf_session *session) { -struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info; +struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;size_t min_sz =sizeof (u64) *INTEL_PT_PER_CPU_MMAPS ;struct intel_pt *pt;void *info_end;__u64 *info;int err; -if (auxtrace_info->header.size <sizeof (struct auxtrace_info_event ) + +if (auxtrace_info->header.size <sizeof (struct perf_record_auxtrace_info ) + min_sz)return -EINVAL ;
tools/perf/util/python.c +2 -2
@@ -431,8 +431,8 @@ static char pyrf_context_switch_event__doc[] = PyDoc_STR("perf context_switch evstatic PyMemberDef pyrf_context_switch_event__members[] = { sample_membersmember_def (perf_event_header, type,T_UINT ,"event type" ), -member_def (context_switch_event, next_prev_pid,T_UINT ,"next/prev pid" ), -member_def (context_switch_event, next_prev_tid,T_UINT ,"next/prev tid" ), +member_def (perf_record_switch, next_prev_pid,T_UINT ,"next/prev pid" ), +member_def (perf_record_switch, next_prev_tid,T_UINT ,"next/prev tid" ), { .name =NULL , }, };
tools/perf/util/s390-cpumsf.c +2 -2
@@ -1109,11 +1109,11 @@ static int s390_cpumsf__config(const char *var, const char *value, void *cb)int s390_cpumsf_process_auxtrace_info (union perf_event *event,struct perf_session *session) { -struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info; +struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;struct s390_cpumsf *sf;int err; -if (auxtrace_info->header.size <sizeof (struct auxtrace_info_event )) +if (auxtrace_info->header.size <sizeof (struct perf_record_auxtrace_info ))return -EINVAL ; sf =zalloc (sizeof (struct s390_cpumsf ));
tools/perf/util/session.c +10 -10
@@ -64,8 +64,8 @@ static int perf_session__process_compressed_event(struct perf_session *session, decomp->size = decomp_last_rem; } - src = (void *)event +sizeof (struct compressed_event ); - src_size = event->pack.header.size -sizeof (struct compressed_event ); + src = (void *)event +sizeof (struct perf_record_compressed ); + src_size = event->pack.header.size -sizeof (struct perf_record_compressed ); decomp_size =zstd_decompress_stream (&(session->zstd_data), src, src_size, &(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem);
@@ -836,9 +836,9 @@ static void perf_event__thread_map_swap(union perf_event *event,static void perf_event__cpu_map_swap (union perf_event *event,bool sample_id_all__maybe_unused ) { -struct cpu_map_data *data = &event->cpu_map.data; +struct perf_record_cpu_map_data *data = &event->cpu_map.data;struct cpu_map_entries *cpus; -struct cpu_map_mask *mask; +struct perf_record_record_cpu_map *mask;unsigned i; data->type =bswap_64 (data->type);
@@ -853,7 +853,7 @@ static void perf_event__cpu_map_swap(union perf_event *event, cpus->cpu[i] =bswap_16 (cpus->cpu[i]);break ;case PERF_CPU_MAP__MASK : - mask = (struct cpu_map_mask *) data->data; + mask = (struct perf_record_record_cpu_map *)data->data; mask->nr =bswap_16 (mask->nr); mask->long_size =bswap_16 (mask->long_size);
@@ -2376,10 +2376,10 @@ int perf_event__process_id_index(struct perf_session *session, union perf_event *event) {struct evlist *evlist = session->evlist; -struct id_index_event *ie = &event->id_index; +struct perf_record_id_index *ie = &event->id_index;size_t i, nr, max_nr; - max_nr = (ie->header.size -sizeof (struct id_index_event )) / + max_nr = (ie->header.size -sizeof (struct perf_record_id_index )) /sizeof (struct id_index_entry ); nr = ie->nr;if (nr > max_nr)
@@ -2421,14 +2421,14 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,pr_debug2 ("Synthesizing id index\n" ); - max_nr = (UINT16_MAX -sizeof (struct id_index_event )) / + max_nr = (UINT16_MAX -sizeof (struct perf_record_id_index )) /sizeof (struct id_index_entry );evlist__for_each_entry (evlist, evsel) nr += evsel->ids; n = nr > max_nr ? max_nr : nr; - sz =sizeof (struct id_index_event ) + n *sizeof (struct id_index_entry ); + sz =sizeof (struct perf_record_id_index ) + n *sizeof (struct id_index_entry ); ev =zalloc (sz);if (!ev)return -ENOMEM ;
@@ -2468,7 +2468,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool, } } - sz =sizeof (struct id_index_event ) + nr *sizeof (struct id_index_entry ); + sz =sizeof (struct perf_record_id_index ) + nr *sizeof (struct id_index_entry ); ev->id_index.header.size = sz; ev->id_index.nr = nr;
tools/perf/util/session.h +1 -1
@@ -28,7 +28,7 @@ struct perf_session {struct itrace_synth_opts *itrace_synth_opts;struct list_head auxtrace_index;struct trace_event tevent; -struct time_conv_event time_conv; +struct perf_record_time_conv time_conv;bool repipe;bool one_mmap;void *one_mmap_addr;
tools/perf/util/stat.c +3 -3
@@ -382,7 +382,7 @@ int perf_event__process_stat_event(struct perf_session *session, union perf_event *event) {struct perf_counts_values count; -struct stat_event *st = &event->stat; +struct perf_record_stat *st = &event->stat;struct evsel *counter; count.val = st->val;
@@ -402,7 +402,7 @@ int perf_event__process_stat_event(struct perf_session *session,size_t perf_event__fprintf_stat (union perf_event *event,FILE *fp) { -struct stat_event *st = (struct stat_event *) event; +struct perf_record_stat *st = (struct perf_record_stat *)event;size_t ret; ret = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n",
@@ -415,7 +415,7 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)size_t perf_event__fprintf_stat_round (union perf_event *event,FILE *fp) { -struct stat_round_event *rd = (struct stat_round_event *)event; +struct perf_record_stat_round *rd = (struct perf_record_stat_round *)event;size_t ret; ret = fprintf(fp, "\n... time %" PRI_lu64 ", type %s\n", rd->time,
tools/perf/util/thread_map.c +2 -2
@@ -369,7 +369,7 @@ void thread_map__read_comms(struct perf_thread_map *threads) }static void thread_map__copy_event (struct perf_thread_map *threads, -struct thread_map_event *event) +struct perf_record_thread_map *event) {unsigned i;
@@ -383,7 +383,7 @@ static void thread_map__copy_event(struct perf_thread_map *threads,refcount_set (&threads->refcnt,1 ); } -struct perf_thread_map *thread_map__new_event (struct thread_map_event *event) +struct perf_thread_map *thread_map__new_event (struct perf_record_thread_map *event) {struct perf_thread_map *threads;
tools/perf/util/thread_map.h +2 -2
@@ -8,7 +8,7 @@#include <internal/threadmap.h> #include <perf/threadmap.h> -struct thread_map_event ; +struct perf_record_thread_map ;struct perf_thread_map *thread_map__new_dummy (void );struct perf_thread_map *thread_map__new_by_pid (pid_t pid);
@@ -16,7 +16,7 @@ struct perf_thread_map *thread_map__new_by_tid(pid_t tid);struct perf_thread_map *thread_map__new_by_uid (uid_t uid);struct perf_thread_map *thread_map__new_all_cpus (void );struct perf_thread_map *thread_map__new (pid_t pid,pid_t tid,uid_t uid); -struct perf_thread_map *thread_map__new_event (struct thread_map_event *event); +struct perf_thread_map *thread_map__new_event (struct perf_record_thread_map *event);struct perf_thread_map *thread_map__new_str (const char *pid,const char *tid,uid_t uid,bool all_threads);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 34/37 libperf: Move 'enum perf_user_event_type' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
So it's available for libperf's users.
--- tools/perf/lib/include/perf/event.h | 23 +++++++++++++++++++++++ tools/perf/util/event.h | 23 ----------------------- 2 files changed, 23 insertions(+), 23 deletions(-)
tools/perf/lib/include/perf/event.h +23 -0
@@ -323,6 +323,29 @@ struct perf_record_compressed {char data[]; }; +enum perf_user_event_type {/* above any possible kernel type */ +PERF_RECORD_USER_TYPE_START =64 , +PERF_RECORD_HEADER_ATTR =64 , +PERF_RECORD_HEADER_EVENT_TYPE =65 ,/* deprecated */ +PERF_RECORD_HEADER_TRACING_DATA =66 , +PERF_RECORD_HEADER_BUILD_ID =67 , +PERF_RECORD_FINISHED_ROUND =68 , +PERF_RECORD_ID_INDEX =69 , +PERF_RECORD_AUXTRACE_INFO =70 , +PERF_RECORD_AUXTRACE =71 , +PERF_RECORD_AUXTRACE_ERROR =72 , +PERF_RECORD_THREAD_MAP =73 , +PERF_RECORD_CPU_MAP =74 , +PERF_RECORD_STAT_CONFIG =75 , +PERF_RECORD_STAT =76 , +PERF_RECORD_STAT_ROUND =77 , +PERF_RECORD_EVENT_UPDATE =78 , +PERF_RECORD_TIME_CONV =79 , +PERF_RECORD_HEADER_FEATURE =80 , +PERF_RECORD_COMPRESSED =81 , +PERF_RECORD_HEADER_MAX +}; +union perf_event {struct perf_event_header header;struct perf_record_mmap mmap;
tools/perf/util/event.h +0 -23
@@ -146,29 +146,6 @@ struct perf_sample { PERF_MEM_S(LOCK, NA) |\ PERF_MEM_S(TLB, NA)) -enum perf_user_event_type {/* above any possible kernel type */ -PERF_RECORD_USER_TYPE_START =64 , -PERF_RECORD_HEADER_ATTR =64 , -PERF_RECORD_HEADER_EVENT_TYPE =65 ,/* deprecated */ -PERF_RECORD_HEADER_TRACING_DATA =66 , -PERF_RECORD_HEADER_BUILD_ID =67 , -PERF_RECORD_FINISHED_ROUND =68 , -PERF_RECORD_ID_INDEX =69 , -PERF_RECORD_AUXTRACE_INFO =70 , -PERF_RECORD_AUXTRACE =71 , -PERF_RECORD_AUXTRACE_ERROR =72 , -PERF_RECORD_THREAD_MAP =73 , -PERF_RECORD_CPU_MAP =74 , -PERF_RECORD_STAT_CONFIG =75 , -PERF_RECORD_STAT =76 , -PERF_RECORD_STAT_ROUND =77 , -PERF_RECORD_EVENT_UPDATE =78 , -PERF_RECORD_TIME_CONV =79 , -PERF_RECORD_HEADER_FEATURE =80 , -PERF_RECORD_COMPRESSED =81 , -PERF_RECORD_HEADER_MAX -}; - enum auxtrace_error_type { PERF_AUXTRACE_ERROR_ITRACE = 1, PERF_AUXTRACE_ERROR_MAX
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 35/37 perf evlist: Use unshare(CLONE_FS) in sb threads to let setns(CLONE_NEWNS) work
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
When we started using a thread to catch the PERF_RECORD_BPF_EVENT meta data events to then ask the kernel for further info (BTF, etc) for BPF programs shortly after they get loaded, we forgot to use unshare(CLONE_FS) as was done in:
868a832918f6 ("perf top: Support lookup of symbols in other mount namespaces.")
Do it so that we can enter the namespaces to read the build-ids at the end of a 'perf record' session for the DSOs that had hits.
Before:
Starting a 'stress-ng --cpus 8' inside a container and then, outside the container running:
# perf record -a --namespaces sleep 5 # perf buildid-list | grep stress-ng #
We would end up with a 'perf.data' file that had no entry in its build-id table for the /usr/bin/stress-ng binary inside the container that got tons of PERF_RECORD_SAMPLEs.
After:
# perf buildid-list | grep stress-ng f2ed02c68341183a124b9b0f6e2e6c493c465b29 /usr/bin/stress-ng #
Then its just a matter of making sure that that binary debuginfo package gets available in a place that 'perf report' will look at build-id keyed ELF files, which, in my case, on a f30 notebook, was a matter of installing the debuginfo file for the distro used in the container, fedora 31:
# rpm -ivh http://fedora.c3sl.ufpr.br/linux/development/31/Everything/x86_64/debug/tree/Packages/s/stress-ng-debuginfo-0.07.29-10.fc31.x86_64.rpm
Then, because perf currently looks for those debuginfo files (richer ELF symtab) inside that namespace (look at the setns calls):
openat(AT_FDCWD, "/proc/self/ns/mnt", O_RDONLY) = 137
openat(AT_FDCWD, "/proc/13169/ns/mnt", O_RDONLY) = 139
setns(139, CLONE_NEWNS) = 0
stat("/usr/bin/stress-ng", {st_mode=S_IFREG|0755, st_size=3065416, ...}) = 0
openat(AT_FDCWD, "/usr/bin/stress-ng", O_RDONLY) = 140
fcntl(140, F_GETFD) = 0
fstat(140, {st_mode=S_IFREG|0755, st_size=3065416, ...}) = 0
mmap(NULL, 3065416, PROT_READ, MAP_PRIVATE, 140, 0) = 0x7ff2fdc5b000
munmap(0x7ff2fdc5b000, 3065416) = 0
close(140) = 0
stat("stress-ng-0.07.29-10.fc31.x86_64.debug", 0x7fff45d71260) = -1 ENOENT (No such file or directory) stat("/usr/bin/stress-ng-0.07.29-10.fc31.x86_64.debug", 0x7fff45d71260) = -1 ENOENT (No such file or directory) stat("/usr/bin/.debug/stress-ng-0.07.29-10.fc31.x86_64.debug", 0x7fff45d71260) = -1 ENOENT (No such file or directory) stat("/usr/lib/debug/usr/bin/stress-ng-0.07.29-10.fc31.x86_64.debug", 0x7fff45d71260) = -1 ENOENT (No such file or directory) stat("/root/.debug/.build-id/f2/ed02c68341183a124b9b0f6e2e6c493c465b29", 0x7fff45d711e0) = -1 ENOENT (No such file or directory)
To only then go back to the "host" namespace to look just in the users's ~/.debug cache:
setns(137, CLONE_NEWNS) = 0
chdir("/root") = 0
close(137) = 0
close(139) = 0 stat("/root/.debug/.build-id/f2/ed02c68341183a124b9b0f6e2e6c493c465b29/elf", 0x7fff45d732e0) = -1 ENOENT (No such file or directory)
It continues to fail to resolve symbols:
# perf report | grep stress-ng | head -5
9.50% stress-ng-cpu stress-ng [.] 0x0000000000021ac1
8.58% stress-ng-cpu stress-ng [.] 0x0000000000021ab4
8.51% stress-ng-cpu stress-ng [.] 0x0000000000021489
7.17% stress-ng-cpu stress-ng [.] 0x00000000000219b6
3.93% stress-ng-cpu stress-ng [.] 0x0000000000021478
#To overcome that we use:
# perf buildid-cache -v --add /usr/lib/debug/usr/bin/stress-ng-0.07.29-10.fc31.x86_64.debug Adding f2ed02c68341183a124b9b0f6e2e6c493c465b29 /usr/lib/debug/usr/bin/stress-ng-0.07.29-10.fc31.x86_64.debug: Ok # # ls -la /root/.debug/.build-id/f2/ed02c68341183a124b9b0f6e2e6c493c465b29/elf -rw-r--r--. 3 root root 2401184 Jul 27 07:03 /root/.debug/.build-id/f2/ed02c68341183a124b9b0f6e2e6c493c465b29/elf # file /root/.debug/.build-id/f2/ed02c68341183a124b9b0f6e2e6c493c465b29/elf /root/.debug/.build-id/f2/ed02c68341183a124b9b0f6e2e6c493c465b29/elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter \004, BuildID[sha1]=f2ed02c68341183a124b9b0f6e2e6c493c465b29, for GNU/Linux 3.2.0, with debug_info, not stripped, too many notes (256) #
Now it finally works:
# perf report | grep stress-ng | head -5
23.59% stress-ng-cpu stress-ng [.] ackermann
23.33% stress-ng-cpu stress-ng [.] is_prime
17.36% stress-ng-cpu stress-ng [.] stress_cpu_sieve
6.08% stress-ng-cpu stress-ng [.] stress_cpu_correlate
3.55% stress-ng-cpu stress-ng [.] queens_try
#I'll make sure that it looks for the build-id keyed files in both the "host" namespace (the namespace the user running 'perf record' was a the time of the recording) and in the container namespace, as it shouldn't matter where a content based key lookup finds the ELF file to use in resolving symbols, etc.
--- tools/perf/util/evlist.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/perf/util/evlist.c +9 -0
@@ -21,6 +21,7 @@#include "bpf-event.h" #include <signal.h> #include <unistd.h> +#include <sched.h> #include "parse-events.h" #include <subcmd/parse-options.h>
@@ -1824,6 +1825,14 @@ static void *perf_evlist__poll_thread(void *arg)struct evlist *evlist = arg;bool draining = false;int i, done =0 ; +/* +* In order to read symbols from other namespaces perf to needs to call +* setns(2). This isn't permitted if the struct_fs has multiple users. +* unshare(2) the fs so that we may continue to setns into namespaces +* that we're observing when, for instance, reading the build-ids at +* the end of a 'perf record' session. +*/ +unshare (CLONE_FS );while (!done) {bool got_data = false;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 36/37 tools lib traceevent: Do not free tep->cmdlines in add_new_comm() on failure
In reply to Arnaldo Carvalho de MeloFrom: "Steven Rostedt (VMware)" <[email protected]>
If the re-allocation of tep->cmdlines succeeds, then the previous allocation of tep->cmdlines will be freed. If we later fail in add_new_comm(), we must not free cmdlines, and also should assign tep->cmdlines to the new allocation. Otherwise when freeing tep, the tep->cmdlines will be pointing to garbage.
--- tools/lib/traceevent/event-parse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/lib/traceevent/event-parse.c +1 -2
@@ -269,10 +269,10 @@ static int add_new_comm(struct tep_handle *tep, errno =ENOMEM ;return -1 ; } + tep->cmdlines = cmdlines; cmdlines[tep->cmdline_count].comm =strdup (comm);if (!cmdlines[tep->cmdline_count].comm) { -free (cmdlines); errno =ENOMEM ;return -1 ; }
@@ -283,7 +283,6 @@ static int add_new_comm(struct tep_handle *tep, tep->cmdline_count++;qsort (cmdlines, tep->cmdline_count,sizeof (*cmdlines), cmdline_cmp); - tep->cmdlines = cmdlines;return 0 ; }
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 37/37 tools lib traceevent: Remove unneeded qsort and uses memmove instead
In reply to Arnaldo Carvalho de MeloFrom: "Steven Rostedt (VMware)" <[email protected]>
While reading a trace data file that had 100,000s of tasks, the process took an extremely long time. I profiled it down to add_new_comm(), which was doing a qsort() call on an array that was pretty much already sorted (all but the last element. qsort() isn't very efficient when dealing with mostly sorted arrays, and this definitely showed its issues.
When adding a new task to the task list, instead of using qsort(), do another bsearch() with a function that will find the element before where the new task will be inserted in. Then simply shift the rest of the array, and insert the task where it belongs.
--- tools/lib/traceevent/event-parse.c | 55 ++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 6 deletions(-)
tools/lib/traceevent/event-parse.c +49 -6
@@ -142,6 +142,25 @@ static int cmdline_cmp(const void *a, const void *b)return 0 ; } +/* Looking for where to place the key */ +static int cmdline_slot_cmp (const void *a,const void *b) +{ +const struct tep_cmdline *ca = a; +const struct tep_cmdline *cb = b; +const struct tep_cmdline *cb1 = cb +1 ; + +if (ca->pid < cb->pid) +return -1 ; + +if (ca->pid > cb->pid) { +if (ca->pid <= cb1->pid) +return 0 ; +return 1 ; + } + +return 0 ; +} +struct cmdline_list {struct cmdline_list *next;char *comm;
@@ -239,6 +258,7 @@ static int add_new_comm(struct tep_handle *tep,struct tep_cmdline *cmdline;struct tep_cmdline key;char *new_comm; +int cnt;if (!pid)return 0 ;
@@ -271,18 +291,41 @@ static int add_new_comm(struct tep_handle *tep, } tep->cmdlines = cmdlines; - cmdlines[tep->cmdline_count].comm =strdup (comm); -if (!cmdlines[tep->cmdline_count].comm) { + key.comm =strdup (comm); +if (!key.comm) { errno =ENOMEM ;return -1 ; } - cmdlines[tep->cmdline_count].pid = pid; - -if (cmdlines[tep->cmdline_count].comm) +if (!tep->cmdline_count) { +/* no entries yet */ + tep->cmdlines[0 ] = key; tep->cmdline_count++; +return 0 ; + } -qsort (cmdlines, tep->cmdline_count,sizeof (*cmdlines), cmdline_cmp); +/* Now find where we want to store the new cmdline */ + cmdline =bsearch (&key, tep->cmdlines, tep->cmdline_count -1 , +sizeof (*tep->cmdlines), cmdline_slot_cmp); + + cnt = tep->cmdline_count; +if (cmdline) { +/* cmdline points to the one before the spot we want */ + cmdline++; + cnt -= cmdline - tep->cmdlines; + + }else { +/* The new entry is either before or after the list */ +if (key.pid > tep->cmdlines[tep->cmdline_count -1 ].pid) { + tep->cmdlines[tep->cmdline_count++] = key; +return 0 ; + } + cmdline = &tep->cmdlines[0 ]; + } +memmove (cmdline +1 , cmdline, (cnt *sizeof (*cmdline))); + *cmdline = key; + + tep->cmdline_count++;return 0 ; }
Signature · 1 line
2.21.0
Quoted 181 lines · Arnaldo Carvalho de Melo
Hi Ingo/Thomas,
Please consider pulling,
Best regards,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit
42880f726c66f13ae1d9ac9ce4c43abe64ecac84:perf/x86/intel: Support PEBS output to PT (2019-08-28 11:29:39 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.gittags/perf-core-for-mingo-5.4-20190829for you to fetch changes up to
301011ba622513cb41ced59973972204e0da2f71:tools lib traceevent: Remove unneeded qsort and uses memmove instead (2019-08-29 08:36:12 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:perf top:
Namhyung Kim:
- Decay all events in the evlist, we were decaying just the first event in a group.
- Fix linking of histograms in different evsels in a event group with more than two events.
With the two fixes above a command line such as:
# perf top -e '{cycles,instructions,cache-misses,cache-references}Should work as expected, with four columns and with all of them being decayed over time, i.e. less weight is given for older samples.
perf record:
Arnaldo Carvalho de Melo:
- Fix collection of build-ids when using
setns()to get into namespaces, which had been broken with the introduction of the extra thread to react toPERF_RECORD_BPF_EVENT, i.e. to collect extra info for BPF programs. We need tounshare(CLONE_FS)in that thread so that the main one can do thesetns(CLONE_NEWNS)when collectingthe build-ids. Without that symbol resolution gets more difficult and potentially misresolves symbols.core:
Igor Lubashev:
- Further alignment in permission checking via capabilities to how the kernel checks what tooling tries to do.
PowerPC:
Naveen N. Rao:
- Sync powerpc syscall.tbl, so that 'perf trace' gets the definitions for recent syscalls.
libperf:
Jiri Olsa:
- Move the rest of the
PERF_RECORD_metadata struct definitions so that we can use 'unionperf_event'.libtraceevent:
Steven Rostedt (VMware):
- Do not free
tep->cmdlinesinadd_new_comm()on failure.- Remove unneeded qsort and uses memmove instead
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>----------------------------------------------------------------
Arnaldo Carvalho de Melo (4):
perf tools: Remove needlessutil.hinclude frombuiltin.h
perf evlist: Remove needlessutil.hfromevlist.h
perf clang: Delete needlessutil-cxx.hheader
perf evlist: Useunshare(CLONE_FS)in sb threads to letsetns(CLONE_NEWNS)workIgor Lubashev (5):
perf event: Checkref_reloc_symbefore using it
perf tools: UseCAP_SYS_ADMINwithperf_event_paranoidchecks perf evsel: Kernel profiling is disallowed only whenperf_event_paranoid> 1 perf symbols: UseCAP_SYSLOGwithkptr_restrictchecks
perf tools: Warn thatperf_event_paranoidcan restrict kernel symbolsJiri Olsa (23):
libperf: AddPERF_RECORD_HEADER_ATTR'structattr_event' toperf/event.h
libperf: AddPERF_RECORD_CPU_MAP'structcpu_map_event' toperf/event.h
libperf: AddPERF_RECORD_EVENT_UPDATE'structevent_update_event' toperf/event.h
libperf: AddPERF_RECORD_HEADER_EVENT_TYPE'structevent_type_event' toperf/event.h
libperf: AddPERF_RECORD_HEADER_TRACING_DATA'structtracing_data_event' toperf/event.h
libperf: AddPERF_RECORD_HEADER_BUILD_ID'structbuild_id_event' toperf/event.h
libperf: AddPERF_RECORD_ID_INDEX'structid_index_event' toperf/event.h
libperf: AddPERF_RECORD_AUXTRACE_INFO'structauxtrace_info_event' toperf/event.h
libperf: AddPERF_RECORD_AUXTRACE'structauxtrace_event' toperf/event.h
libperf: AddPERF_RECORD_AUXTRACE_ERROR'structauxtrace_error_event' toperf/event.h
libperf: AddPERF_RECORD_AUX'structaux_event' toperf/event.h
libperf: AddPERF_RECORD_ITRACE_START'structitrace_start_event' toperf/event.h
libperf: AddPERF_RECORD_SWITCH'structcontext_switch_event' toperf/event.h
libperf: AddPERF_RECORD_THREAD_MAP'structthread_map_event' toperf/event.h
libperf: AddPERF_RECORD_STAT_CONFIG'structstat_config_event' toperf/event.h
libperf: AddPERF_RECORD_STAT'structstat_event' toperf/event.h
libperf: AddPERF_RECORD_STAT_ROUND'structstat_round_event' toperf/event.h
libperf: AddPERF_RECORD_TIME_CONV'structtime_conv_event' toperf/event.h
libperf: AddPERF_RECORD_HEADER_FEATURE'structfeature_event' toperf/event.h
libperf: AddPERF_RECORD_COMPRESSED'structcompressed_event' toperf/event.h
libperf: Add 'unionperf_event' toperf/event.h
libperf: Rename thePERF_RECORD_structs to have a "perf" prefix
libperf: Move 'enumperf_user_event_type' toperf/event.hNamhyung Kim (2):
perf top: Decay all events in the evlist perf top: Fix event group with more than two eventsNaveen N. Rao (1):
perf arch powerpc: Sync powerpc syscall.tblSteven Rostedt (VMware) (2):
tools lib traceevent: Do not freetep->cmdlinesinadd_new_comm()on failure tools lib traceevent: Remove unneeded qsort and uses memmove insteadtools/lib/traceevent/event-parse.c | 58 ++++- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/arch/arm64/util/arm-spe.c | 5 +- tools/perf/arch/powerpc/entry/syscalls/syscall.tbl | 146 +++++++++-- tools/perf/arch/s390/util/auxtrace.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 6 +- tools/perf/arch/x86/util/intel-pt.c | 7 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/builtin-buildid-cache.c | 1 + tools/perf/builtin-record.c | 6 +- tools/perf/builtin-report.c | 3 +- tools/perf/builtin-script.c | 3 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 47 ++-- tools/perf/builtin-trace.c | 3 +- tools/perf/builtin.h | 2 - tools/perf/lib/include/perf/event.h | 273 ++++++++++++++++++++ tools/perf/perf.c | 1 + tools/perf/tests/cpumap.c | 12 +- tools/perf/tests/event_update.c | 16 +- tools/perf/tests/sdt.c | 1 + tools/perf/tests/stat.c | 8 +- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/arm-spe.c | 6 +- tools/perf/util/auxtrace.c | 21 +- tools/perf/util/auxtrace.h | 8 +- tools/perf/util/bpf-loader.c | 1 + tools/perf/util/build-id.c | 2 +- tools/perf/util/c++/clang-c.h | 2 +- tools/perf/util/c++/clang-test.cpp | 4 +- tools/perf/util/cpumap.c | 6 +- tools/perf/util/cpumap.h | 4 +- tools/perf/util/cs-etm.c | 4 +- tools/perf/util/event.c | 45 ++-- tools/perf/util/event.h | 278 +-------------------- tools/perf/util/evlist.c | 10 + tools/perf/util/evlist.h | 1 - tools/perf/util/evsel.c | 3 +- tools/perf/util/header.c | 57 ++--- tools/perf/util/hist.c | 39 +-- tools/perf/util/hist.h | 1 + tools/perf/util/intel-bts.c | 6 +- tools/perf/util/intel-pt.c | 12 +- tools/perf/util/python.c | 4 +- tools/perf/util/s390-cpumsf.c | 4 +- tools/perf/util/session.c | 29 +--
Quoted 8 lines
tools/perf/util/session.h | 2 +- tools/perf/util/stat.c | 12 +- tools/perf/util/symbol.c | 15 +- tools/perf/util/thread_map.c | 4 +- tools/perf/util/thread_map.h | 4 +- tools/perf/util/util-cxx.h | 27 -- 52 files changed, 684 insertions(+), 540 deletions(-) delete mode 100644 tools/perf/util/util-cxx.h
Pulled, thanks a lot Arnaldo!
Ingo