perf/core improvements and fixes
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 39152ee51b77851689f9b23fde6f610d13566c39:
perf/x86/intel/pt: Get rid of reverse lookup table for ToPA (2019-08-26 12:00:16 +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-20190826
for you to fetch changes up to 74a1e863eb73dcc9f069b671dfb40650f3832116:
perf evsel: Rename perf_missing_features::bpf_event to ::bpf (2019-08-26 19:39:11 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
perf report:
Andi Kleen:
- Make --ns time sort key output column wide enough for nanoseconds.
perf script:
Gustavo A. R. Silva:
- Fix memory leaks in list_scripts()
perf tests:
James Clark:
- Fixes hang in zstd compression test by changing the source of random data.
perf trace:
Arnaldo Carvalho de Melo:
- augmented_raw_syscalls.c BPF helper improvements.
Benjamin Peterson:
- Fix off-by-one error in ioctl cmd->string table.
libperf:
Jiri Olsa:
- Move most PERF_RECORD_ structs to perf/event.h.
headers:
Arnaldo Carvalho de Melo:
- Move cacheline related routines to separate source files.
- Move record_opts and other record declarations to separate files.
- Explicitly add some more needed headers here and there.
Souptick Joarder:
- Remove some duplicate include directives.
----------------------------------------------------------------
Andi Kleen (2):
perf report: Use timestamp__scnprintf_nsec() for time sort key perf report: Fix --ns time sort key output
Arnaldo Carvalho de Melo (15):
perf cpumap: No need to include perf.h, ditch it
perf stat: Remove needless headers from stat.h
perf record: Move record_opts and other record decls out of perf.h perf cacheline: Move cacheline related routines to separate files perf srcline: Add missing srcline.h header to files needing its defs perf sort: Remove needless headers from sort.h, provide fwd struct decls perf augmented_raw_syscalls: Rename augmented_filename to augmented_arg perf augmented_raw_syscalls: Postpone tmp map lookup to after pid_filter perf augmented_raw_syscalls: Introduce helper to get the scratch space perf augmented_raw_syscalls: Reduce perf_event_output() boilerplate
libperf: Rename the PERF_RECORD_ structs to have a "perf" suffix perf tools: Rename perf_event::ksymbol_event to perf_event::ksymbol perf tools: Rename perf_event::bpf_event to perf_event::bpf perf tool: Rename perf_tool::bpf_event to bpf
perf evsel: Rename perf_missing_features::bpf_event to ::bpf
Benjamin Peterson (1):
perf trace beauty ioctl: Fix off-by-one error in cmd->string table
Gustavo A. R. Silva (1):
perf script: Fix memory leaks in list_scripts()
James Clark (1):
perf tests: Fixes hang in zstd compression test by changing the source of random data
Jiri Olsa (12):
libperf: Add PERF_RECORD_MMAP 'struct mmap_event' to perf/event.h
libperf: Add PERF_RECORD_MMAP2 'struct mmap2_event' to perf/event.h
libperf: Add PERF_RECORD_COMM 'struct comm_event' to perf/event.h
libperf: Add PERF_RECORD_NAMESPACES 'struct namespaces_event' to perf/event.h
libperf: Add PERF_RECORD_FORK 'struct fork_event' to perf/event.h
libperf: Add PERF_RECORD_LOST 'struct lost_event' to perf/event.h
libperf: Add PERF_RECORD_LOST_SAMPLES 'struct lost_samples_event' to perf/event.h
libperf: Add PERF_RECORD_READ 'struct read_event' to perf/event.h
libperf: Add PERF_RECORD_THROTTLE 'struct throttle_event' to perf/event.h
libperf: Add PERF_RECORD_KSYMBOL 'struct ksymbol_event' to perf/event.h
libperf: Add PERF_RECORD_BPF_EVENT 'struct bpf_event' to perf/event.h
libperf: Add PERF_RECORD_SAMPLE 'struct sample_event' to perf/event.h
Souptick Joarder (1):
perf tools: Remove duplicate headers
tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 1 + tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 + tools/perf/arch/x86/util/intel-bts.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 3 +- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-diff.c | 2 + tools/perf/builtin-record.c | 4 +- tools/perf/builtin-report.c | 1 + tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-script.c | 7 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/examples/bpf/augmented_raw_syscalls.c | 100 +++++++-------- tools/perf/lib/include/perf/event.h | 112 ++++++++++++++++ tools/perf/perf.h | 62 --------- tools/perf/tests/backward-ring-buffer.c | 2 +- tools/perf/tests/bpf.c | 1 + tools/perf/tests/code-reading.c | 1 + tools/perf/tests/keep-tracking.c | 1 + tools/perf/tests/openat-syscall-tp-fields.c | 3 +- tools/perf/tests/parse-no-sample-id-all.c | 4 +- tools/perf/tests/perf-record.c | 2 +- tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 +- tools/perf/tests/switch-tracking.c | 1 + tools/perf/tests/task-exit.c | 1 + tools/perf/trace/beauty/ioctl.c | 2 +- tools/perf/ui/browsers/res_sample.c | 2 + tools/perf/ui/browsers/scripts.c | 8 +- tools/perf/ui/stdio/hist.c | 1 + tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 2 + tools/perf/util/auxtrace.c | 2 +- tools/perf/util/bpf-event.c | 36 +++--- tools/perf/util/bpf-event.h | 10 +- tools/perf/util/cacheline.c | 26 ++++ tools/perf/util/cacheline.h | 21 +++ tools/perf/util/callchain.c | 1 + tools/perf/util/cpumap.h | 2 - tools/perf/util/data.c | 1 - tools/perf/util/event.c | 35 +++-- tools/perf/util/event.h | 149 +++++----------------- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 22 ++-- tools/perf/util/evsel.h | 4 +- tools/perf/util/get_current_dir_name.c | 1 - tools/perf/util/hist.c | 5 +- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/kvm-stat.h | 2 +- tools/perf/util/machine.c | 25 ++-- tools/perf/util/machine.h | 1 + tools/perf/util/namespaces.c | 2 +- tools/perf/util/namespaces.h | 4 +- tools/perf/util/python.c | 58 ++++----- tools/perf/util/record.c | 1 + tools/perf/util/record.h | 74 +++++++++++ tools/perf/util/session.c | 16 +-- tools/perf/util/sort.c | 12 +- tools/perf/util/sort.h | 27 +--- tools/perf/util/stat-display.c | 1 - tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 7 +- tools/perf/util/thread.c | 4 +- tools/perf/util/thread.h | 4 +- tools/perf/util/tool.h | 2 +- tools/perf/util/top.h | 1 + tools/perf/util/util.c | 20 --- tools/perf/util/util.h | 1 - 69 files changed, 493 insertions(+), 427 deletions(-) create mode 100644 tools/perf/lib/include/perf/event.h create mode 100644 tools/perf/util/cacheline.c create mode 100644 tools/perf/util/cacheline.h create mode 100644 tools/perf/util/record.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 8.3.0-19) 8.3.0, clang version 7.0.1-9 (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 78 ubuntu:19.10 : Ok gcc (Ubuntu 9.1.0-9ubuntu2) 9.1.0, clang version 8.0.1-+rc4-1 (tags/RELEASE_801/rc4) #
# 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
74a1e863eb73 perf evsel: Rename perf_missing_features::bpf_event to ::bpf
# perf version --build-options
perf version 5.3.rc6.g74a1e863eb73
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_perf_o_O: make perf.o
make_no_backtrace_O: make NO_BACKTRACE=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_util_map_o_O: make util/map.o
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_no_gtk2_O: make NO_GTK2=1
make_no_demangle_O: make NO_DEMANGLE=1
make_no_libperl_O: make NO_LIBPERL=1
make_install_bin_O: make install-bin
make_tags_O: make tags
make_install_prefix_O: make install prefix=/tmp/krava
make_with_babeltrace_O: make LIBBABELTRACE=1
make_doc_O: make doc
make_cscope_O: make cscope
make_pure_O: make
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libbpf_O: make NO_LIBBPF=1
make_help_O: make help
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_slang_O: make NO_SLANG=1
make_clean_all_O: make clean all
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_debug_O: make DEBUG=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_no_newt_O: make NO_NEWT=1
make_static_O: make LDFLAGS=-static
make_no_libaudit_O: make NO_LIBAUDIT=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_libelf_O: make NO_LIBELF=1
make_install_O: make install
make_no_libunwind_O: make NO_LIBUNWIND=1
OK
make: Leaving directory '/home/acme/git/perf/tools/perf'
$Arnaldo Carvalho de Melo
maintainerPATCH 1/33 perf cpumap: No need to include perf.h, ditch it
From: Arnaldo Carvalho de Melo <[email protected]>
From a quick look this was never needed and just polluted the build, needlessly making things including cpumap.h to be rebuild if perf.h or anything it includes gets changed.
--- tools/perf/util/cpumap.h | 2 -- 1 file changed, 2 deletions(-)
tools/perf/util/cpumap.h +0 -2
@@ -7,8 +7,6 @@#include <internal/cpumap.h> #include <perf/cpumap.h> -#include "perf.h" -struct cpu_map_data ;struct perf_cpu_map *perf_cpu_map__empty_new (int nr);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 2/33 perf stat: Remove needless headers from stat.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Just a forward declaration for 'struct timespec' is needed, ditch the rest.
--- tools/perf/util/stat.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/util/stat.h +2 -3
@@ -5,13 +5,12 @@#include <linux/types.h> #include <stdio.h> #include <sys/types.h> -#include <sys/time.h> #include <sys/resource.h> -#include <sys/wait.h> #include "rblist.h" -#include "perf.h" #include "event.h" +struct timespec ; +struct stats {double n, mean, M2;u64 max, min;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 3/33 perf record: Move record_opts and other record decls out of perf.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
And into a separate util/record.h, to better isolate things and make sure that those who use record_opts and the other moved declarations are explicitly including the necessary header.
--- tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 1 + tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 + tools/perf/arch/x86/util/intel-bts.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 3 +- tools/perf/builtin-record.c | 4 +- tools/perf/builtin-script.c | 2 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/perf.h | 62 ---------------- tools/perf/tests/backward-ring-buffer.c | 2 +- tools/perf/tests/bpf.c | 1 + tools/perf/tests/code-reading.c | 1 + tools/perf/tests/keep-tracking.c | 1 + tools/perf/tests/openat-syscall-tp-fields.c | 3 +- tools/perf/tests/perf-record.c | 2 +- tools/perf/tests/switch-tracking.c | 1 + tools/perf/tests/task-exit.c | 1 + tools/perf/util/auxtrace.c | 2 +- tools/perf/util/bpf-event.c | 1 + tools/perf/util/evsel.c | 1 + tools/perf/util/kvm-stat.h | 2 +- tools/perf/util/machine.c | 1 + tools/perf/util/machine.h | 1 + tools/perf/util/record.c | 1 + tools/perf/util/record.h | 74 ++++++++++++++++++++ tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 2 + tools/perf/util/top.h | 1 + 30 files changed, 107 insertions(+), 73 deletions(-) create mode 100644 tools/perf/util/record.h
tools/perf/arch/arm/util/cs-etm.c +1 -1
@@ -15,7 +15,7 @@#include <linux/zalloc.h> #include "cs-etm.h" -#include "../../perf.h" +#include "../../util/record.h" #include "../../util/auxtrace.h" #include "../../util/cpumap.h" #include "../../util/evlist.h"
tools/perf/arch/arm64/util/arm-spe.c +1 -0
@@ -19,6 +19,7 @@#include "../../util/pmu.h" #include "../../util/debug.h" #include "../../util/auxtrace.h" +#include "../../util/record.h" #include "../../util/arm-spe.h" #define KiB (x) ((x) * 1024)
tools/perf/arch/s390/util/auxtrace.c +1 -0
@@ -8,6 +8,7 @@#include "../../util/evlist.h" #include "../../util/auxtrace.h" #include "../../util/evsel.h" +#include "../../util/record.h" #define PERF_EVENT_CPUM_SF 0xB0000/* Event: Basic-sampling */ #define PERF_EVENT_CPUM_SF_DIAG 0xBD000/* Event: Combined-sampling */
tools/perf/arch/x86/tests/perf-time-to-tsc.c +2 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <inttypes.h> +#include <stdbool.h> #include <stdio.h> #include <unistd.h> #include <linux/types.h>
@@ -13,6 +14,7 @@#include "evsel.h" #include "thread_map.h" #include "cpumap.h" +#include "record.h" #include "tsc.h" #include "tests/tests.h"
tools/perf/arch/x86/util/intel-bts.c +1 -0
@@ -17,6 +17,7 @@#include "../../util/session.h" #include "../../util/pmu.h" #include "../../util/debug.h" +#include "../../util/record.h" #include "../../util/tsc.h" #include "../../util/auxtrace.h" #include "../../util/intel-bts.h"
tools/perf/arch/x86/util/intel-pt.c +2 -1
@@ -13,7 +13,6 @@#include <linux/zalloc.h> #include <cpuid.h> -#include "../../perf.h" #include "../../util/session.h" #include "../../util/event.h" #include "../../util/evlist.h"
@@ -24,6 +23,8 @@#include "../../util/pmu.h" #include "../../util/debug.h" #include "../../util/auxtrace.h" +#include "../../util/record.h" +#include "../../util/target.h" #include "../../util/tsc.h" #include "../../util/intel-pt.h"
tools/perf/builtin-record.c +2 -2
@@ -8,8 +8,6 @@*/ #include "builtin.h" -#include "perf.h" -#include "util/build-id.h" #include <subcmd/parse-options.h> #include "util/parse-events.h"
@@ -22,9 +20,11 @@#include "util/evlist.h" #include "util/evsel.h" #include "util/debug.h" +#include "util/target.h" #include "util/session.h" #include "util/tool.h" #include "util/symbol.h" +#include "util/record.h" #include "util/cpumap.h" #include "util/thread_map.h" #include "util/data.h"
tools/perf/builtin-script.c +1 -1
@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include "builtin.h" -#include "perf.h" #include "util/cache.h" #include "util/counts.h" #include "util/debug.h"
@@ -51,6 +50,7 @@#include <unistd.h> #include <subcmd/pager.h> #include <perf/evlist.h> +#include "util/record.h" #include <linux/ctype.h>
tools/perf/builtin-stat.c +1 -1
@@ -40,7 +40,6 @@* Jaswinder Singh Rajput <[email protected]> */ -#include "perf.h" #include "builtin.h" #include "util/cgroup.h" #include <subcmd/parse-options.h>
@@ -62,6 +61,7 @@#include "util/tool.h" #include "util/string2.h" #include "util/metricgroup.h" +#include "util/target.h" #include "util/top.h" #include "asm/bug.h"
tools/perf/builtin-trace.c +1 -0
@@ -14,6 +14,7 @@* http://lwn.net/Articles/415728/ ("Announcing a new utility: 'trace'") */ +#include "util/record.h" #include <traceevent/event-parse.h> #include <api/fs/tracing_path.h> #include <bpf/bpf.h>
tools/perf/perf.h +0 -62
73 lines not on this page · raw message
tools/perf/tests/backward-ring-buffer.c +1 -1
@@ -4,9 +4,9 @@* beginning */ -#include <perf.h> #include <evlist.h> #include <sys/prctl.h> +#include "record.h" #include "tests.h" #include "debug.h" #include <errno.h>
tools/perf/tests/bpf.c +1 -0
@@ -5,6 +5,7 @@#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <util/record.h> #include <util/util.h> #include <util/bpf-loader.h> #include <util/evlist.h>
tools/perf/tests/code-reading.c +1 -0
@@ -20,6 +20,7 @@#include "map.h" #include "symbol.h" #include "event.h" +#include "record.h" #include "thread.h" #include "tests.h"
tools/perf/tests/keep-tracking.c +1 -0
@@ -8,6 +8,7 @@#include "parse-events.h" #include "evlist.h" #include "evsel.h" +#include "record.h" #include "thread_map.h" #include "cpumap.h" #include "tests.h"
tools/perf/tests/openat-syscall-tp-fields.c +2 -1
@@ -1,12 +1,13 @@// SPDX-License-Identifier: GPL-2.0 +#include <stdbool.h> #include <linux/err.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include "perf.h" #include "evlist.h" #include "evsel.h" #include "thread_map.h" +#include "record.h" #include "tests.h" #include "debug.h" #include <errno.h>
tools/perf/tests/perf-record.c +1 -1
@@ -7,8 +7,8 @@#include <sched.h> #include "evlist.h" #include "evsel.h" -#include "perf.h" #include "debug.h" +#include "record.h" #include "tests.h" static int sched__get_first_possible_cpu (pid_t pid,cpu_set_t *maskp)
tools/perf/tests/switch-tracking.c +1 -0
@@ -13,6 +13,7 @@#include "evsel.h" #include "thread_map.h" #include "cpumap.h" +#include "record.h" #include "tests.h" static int spin_sleep (void )
tools/perf/tests/task-exit.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include "evlist.h" #include "evsel.h" +#include "target.h" #include "thread_map.h" #include "cpumap.h" #include "tests.h"
tools/perf/util/auxtrace.c +1 -1
@@ -26,7 +26,6 @@#include <linux/list.h> #include <linux/zalloc.h> -#include "../perf.h" #include "evlist.h" #include "dso.h" #include "map.h"
@@ -41,6 +40,7 @@#include <linux/hash.h> #include "event.h" +#include "record.h" #include "session.h" #include "debug.h" #include <subcmd/parse-options.h>
tools/perf/util/bpf-event.c +1 -0
@@ -14,6 +14,7 @@#include "session.h" #include "map.h" #include "evlist.h" +#include "record.h" #define ptr_to_u64 (ptr) ((__u64)(unsigned long)(ptr))
tools/perf/util/evsel.c +1 -0
@@ -34,6 +34,7 @@#include "thread_map.h" #include "target.h" #include "perf_regs.h" +#include "record.h" #include "debug.h" #include "trace-event.h" #include "stat.h"
tools/perf/util/kvm-stat.h +1 -1
@@ -2,9 +2,9 @@#ifndef __PERF_KVM_STAT_H#define __PERF_KVM_STAT_H -#include "../perf.h" #include "tool.h" #include "stat.h" +#include "record.h" struct evsel ;struct evlist ;
tools/perf/util/machine.c +1 -0
@@ -13,6 +13,7 @@#include "symbol.h" #include "sort.h" #include "strlist.h" +#include "target.h" #include "thread.h" #include "vdso.h" #include <stdbool.h>
tools/perf/util/machine.h +1 -0
@@ -14,6 +14,7 @@ struct branch_stack;struct evsel ;struct perf_sample ;struct symbol ; +struct target ;struct thread ;union perf_event ;
tools/perf/util/record.c +1 -0
@@ -9,6 +9,7 @@#include <perf/cpumap.h> #include "util.h" #include "cloexec.h" +#include "record.h" typedef void (*setup_probe_fn_t )(struct evsel *evsel);
tools/perf/util/record.h new file +74 -0
74 lines not on this page · raw message
tools/perf/util/stat.c +1 -0
@@ -4,6 +4,7 @@#include <math.h> #include "counts.h" #include "stat.h" +#include "target.h" #include "evlist.h" #include "evsel.h" #include "thread_map.h"
tools/perf/util/stat.h +2 -0
@@ -198,6 +198,8 @@ int perf_stat_process_counter(struct perf_stat_config *config,struct perf_tool ;union perf_event ;struct perf_session ; +struct target ; +int perf_event__process_stat_event (struct perf_session *session,union perf_event *event);
tools/perf/util/top.h +1 -0
@@ -5,6 +5,7 @@#include "tool.h" #include "evswitch.h" #include "annotate.h" +#include "record.h" #include <linux/types.h> #include <stddef.h> #include <stdbool.h>
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 4/33 perf cacheline: Move cacheline related routines to separate files
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
To disentangle util/sort.h a bit more.
--- tools/perf/builtin-c2c.c | 1 + tools/perf/util/Build | 1 + tools/perf/util/cacheline.c | 26 ++++++++++++++++++++++++++ tools/perf/util/cacheline.h | 21 +++++++++++++++++++++ tools/perf/util/sort.c | 1 + tools/perf/util/sort.h | 12 ------------ tools/perf/util/util.c | 20 -------------------- tools/perf/util/util.h | 1 - 8 files changed, 50 insertions(+), 33 deletions(-) create mode 100644 tools/perf/util/cacheline.c create mode 100644 tools/perf/util/cacheline.h
tools/perf/builtin-c2c.c +1 -0
@@ -26,6 +26,7 @@#include "hist.h" #include "sort.h" #include "tool.h" +#include "cacheline.h" #include "data.h" #include "event.h" #include "evlist.h"
tools/perf/util/Build +1 -0
@@ -1,6 +1,7 @@ perf-y += annotate.o perf-y += block-range.o perf-y += build-id.o +perf-y += cacheline.o perf-y += config.o perf-y += ctype.o perf-y += db-export.o
tools/perf/util/cacheline.c new file +26 -0
@@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "cacheline.h" +#include "../perf.h" +#include <unistd.h> + +#ifdef _SC_LEVEL1_DCACHE_LINESIZE +#define cache_line_size (cacheline_sizep) *cacheline_sizep = sysconf(_SC_LEVEL1_DCACHE_LINESIZE) +#else +#include <api/fs/fs.h> +#include "debug.h" +static void cache_line_size (int *cacheline_sizep) +{ +if (sysfs__read_int ("devices/system/cpu/cpu0/cache/index0/coherency_line_size" , cacheline_sizep)) +pr_debug ("cannot determine cache line size" ); +} +#endif + +int cacheline_size (void ) +{ +static int size; + +if (!size) +cache_line_size (&size); + +return size; +}
tools/perf/util/cacheline.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef PERF_CACHELINE_H +#define PERF_CACHELINE_H + +#include <linux/compiler.h> + +int __pure cacheline_size (void ); + +static inline u64 cl_address (u64 address) +{ +/* return the cacheline of the address */ +return (address & ~(cacheline_size () -1 )); +} + +static inline u64 cl_offset (u64 address) +{ +/* return the cacheline of the address */ +return (address & (cacheline_size () -1 )); +} + +#endif // PERF_CACHELINE_H
tools/perf/util/sort.c +1 -0
@@ -6,6 +6,7 @@#include <linux/time64.h> #include "sort.h" #include "hist.h" +#include "cacheline.h" #include "comm.h" #include "map.h" #include "symbol.h"
tools/perf/util/sort.h +0 -12
@@ -204,18 +204,6 @@ static inline float hist_entry__get_percent_limit(struct hist_entry *he)return period *100.0 / total_period; } -static inline u64 cl_address (u64 address) -{ -/* return the cacheline of the address */ -return (address & ~(cacheline_size () -1 )); -} - -static inline u64 cl_offset (u64 address) -{ -/* return the cacheline of the address */ -return (address & (cacheline_size () -1 )); -} -enum sort_mode {SORT_MODE__NORMAL ,SORT_MODE__BRANCH ,
tools/perf/util/util.c +0 -20
@@ -43,26 +43,6 @@ void perf_set_multithreaded(void)unsigned int page_size; -#ifdef _SC_LEVEL1_DCACHE_LINESIZE -#define cache_line_size (cacheline_sizep) *cacheline_sizep = sysconf(_SC_LEVEL1_DCACHE_LINESIZE) -#else -static void cache_line_size (int *cacheline_sizep) -{ -if (sysfs__read_int ("devices/system/cpu/cpu0/cache/index0/coherency_line_size" , cacheline_sizep)) -pr_debug ("cannot determine cache line size" ); -} -#endif - -int cacheline_size (void ) -{ -static int size; - -if (!size) -cache_line_size (&size); - -return size; -} -int sysctl_perf_event_max_stack =PERF_MAX_STACK_DEPTH ;int sysctl_perf_event_max_contexts_per_stack =PERF_MAX_CONTEXTS_PER_STACK ;
tools/perf/util/util.h +0 -1
@@ -34,7 +34,6 @@ int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size);size_t hex_width (u64 v);extern unsigned int page_size; -int __pure cacheline_size (void );int sysctl__max_stack (void );
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 5/33 perf srcline: Add missing srcline.h header to files needing its defs
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
When srcline was introduced it wrongly added the include to util/sort.h, even with that header not needing the definitions it provides, fix it by adding it to the places that need it as a pre patch to remove srcline.h from sort.h.
--- tools/perf/builtin-diff.c | 2 ++ tools/perf/builtin-report.c | 1 + tools/perf/builtin-script.c | 1 + tools/perf/util/annotate.c | 2 ++ tools/perf/util/machine.c | 2 ++ tools/perf/util/sort.c | 1 + 6 files changed, 9 insertions(+)
tools/perf/builtin-diff.c +2 -0
@@ -15,6 +15,7 @@#include "util/session.h" #include "util/tool.h" #include "util/sort.h" +#include "util/srcline.h" #include "util/symbol.h" #include "util/data.h" #include "util/config.h"
@@ -22,6 +23,7 @@#include "util/annotate.h" #include "util/map.h" #include <linux/zalloc.h> +#include <subcmd/parse-options.h> #include <errno.h> #include <inttypes.h>
tools/perf/builtin-report.c +1 -0
@@ -28,6 +28,7 @@#include "util/evswitch.h" #include "util/header.h" #include "util/session.h" +#include "util/srcline.h" #include "util/tool.h" #include <subcmd/parse-options.h>
tools/perf/builtin-script.c +1 -0
@@ -11,6 +11,7 @@#include "util/session.h" #include "util/tool.h" #include "util/map.h" +#include "util/srcline.h" #include "util/symbol.h" #include "util/thread.h" #include "util/trace-event.h"
tools/perf/util/annotate.c +2 -0
@@ -22,6 +22,7 @@#include "cache.h" #include "map.h" #include "symbol.h" +#include "srcline.h" #include "units.h" #include "debug.h" #include "annotate.h"
@@ -37,6 +38,7 @@#include <linux/kernel.h> #include <linux/string.h> #include <bpf/libbpf.h> +#include <subcmd/parse-options.h> /* FIXME: For the HE_COLORSET */ #include "ui/browser.h"
tools/perf/util/machine.c +2 -0
@@ -10,11 +10,13 @@#include "hist.h" #include "machine.h" #include "map.h" +#include "srcline.h" #include "symbol.h" #include "sort.h" #include "strlist.h" #include "target.h" #include "thread.h" +#include "util.h" #include "vdso.h" #include <stdbool.h> #include <sys/types.h>
tools/perf/util/sort.c +1 -0
@@ -13,6 +13,7 @@#include "thread.h" #include "evsel.h" #include "evlist.h" +#include "srcline.h" #include "strlist.h" #include "strbuf.h" #include <traceevent/event-parse.h>
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 6/33 perf sort: Remove needless headers from sort.h, provide fwd struct decls
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Reducing the includes hell a bit more, speeding up the build and avoiding needless rebuilds when just one of those files gets updated.
--- tools/perf/ui/browsers/res_sample.c | 2 ++ tools/perf/ui/browsers/scripts.c | 2 ++ tools/perf/ui/stdio/hist.c | 1 + tools/perf/util/callchain.c | 1 + tools/perf/util/sort.h | 15 ++------------- 5 files changed, 8 insertions(+), 13 deletions(-)
tools/perf/ui/browsers/res_sample.c +2 -0
@@ -6,6 +6,8 @@#include "sort.h" #include "config.h" #include "time-utils.h" +#include "../util.h" +#include "../../util/util.h" #include <linux/time64.h> #include <linux/zalloc.h>
tools/perf/ui/browsers/scripts.c +2 -0
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#include "../../builtin.h" #include "../../util/sort.h" +#include "../../util/util.h" #include "../../util/hist.h" #include "../../util/debug.h" #include "../../util/symbol.h"
tools/perf/ui/stdio/hist.c +1 -0
@@ -3,6 +3,7 @@#include <linux/string.h> #include "../../util/callchain.h" +#include "../../util/debug.h" #include "../../util/hist.h" #include "../../util/map.h" #include "../../util/map_groups.h"
tools/perf/util/callchain.c +1 -0
@@ -20,6 +20,7 @@#include "asm/bug.h" +#include "debug.h" #include "hist.h" #include "sort.h" #include "machine.h"
tools/perf/util/sort.h +2 -13
@@ -1,29 +1,18 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __PERF_SORT_H#define __PERF_SORT_H -#include "../builtin.h" -#include <regex.h> - -#include "color.h" +#include <stdbool.h> #include <linux/list.h> -#include "cache.h" #include <linux/rbtree.h> #include "map_symbol.h" #include "symbol_conf.h" -#include "string.h" #include "callchain.h" #include "values.h" -#include "../perf.h" -#include "debug.h" -#include "header.h" - -#include <subcmd/parse-options.h> -#include "parse-events.h" #include "hist.h" -#include "srcline.h" +struct option ;struct thread ;extern regex_t parent_regex;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 7/33 perf tests: Fixes hang in zstd compression test by changing the source of random data
In reply to Arnaldo Carvalho de MeloFrom: James Clark <[email protected]>
Running 'perf test' with zstd compression linked will hang at the test 'Zstd perf.data compression/decompression' because /dev/random blocks reads until there is enough entropy. This means that the test will appear to never complete unless the mouse is continually moved while running it.
--- tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record+zstd_comp_decomp.sh +1 -1
@@ -13,7 +13,7 @@ skip_if_no_z_record() { collect_z_record() { echo "Collecting compressed record file:" $perf_tool record -o $trace_file -g -z -F 5000 -- \ - dd count=500 if=/dev/random of=/dev/null + dd count=500 if=/dev/urandom of=/dev/null } check_compressed_stats() {
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 8/33 perf trace beauty ioctl: Fix off-by-one error in cmd->string table
In reply to Arnaldo Carvalho de MeloFrom: Benjamin Peterson <[email protected]>
While tracing a program that calls isatty(3), I noticed that strace reported TCGETS for the request argument of the underlying ioctl(2) syscall while perf trace reported TCSETS. strace is corrrect. The bug in perf was due to the tty ioctl beauty table starting at 0x5400 rather than 0x5401.
Committer testing:
Using augmented_raw_syscalls.o and settings to make 'perf trace' use strace formatting, i.e. with this in ~/.perfconfig
# cat ~/.perfconfig [trace] add_events = /home/acme/git/linux/tools/perf/examples/bpf/augmented_raw_syscalls.c show_zeros = yes show_duration = no no_inherit = yes show_timestamp = no show_arg_names = no args_alignment = 40 show_prefix = yes
# strace -e ioctl stty > /dev/null
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, 0x7fff8a9b0860) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(1, TCGETS, 0x7fff8a9b0540) = -1 ENOTTY (Inappropriate ioctl for device)
+++ exited with 0 +++
#Before:
# perf trace -e ioctl stty > /dev/null ioctl(0, TCSETS, 0x7fff2cf79f20) = 0 ioctl(1, TIOCSWINSZ, 0x7fff2cf79f40) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(1, TCSETS, 0x7fff2cf79c20) = -1 ENOTTY (Inappropriate ioctl for device) #
After:
# perf trace -e ioctl stty > /dev/null ioctl(0, TCGETS, 0x7ffed0763920) = 0 ioctl(1, TIOCGWINSZ, 0x7ffed0763940) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(1, TCGETS, 0x7ffed0763620) = -1 ENOTTY (Inappropriate ioctl for device) #
--- tools/perf/trace/beauty/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/trace/beauty/ioctl.c +1 -1
@@ -21,7 +21,7 @@static size_t ioctl__scnprintf_tty_cmd (int nr,int dir,char *bf,size_t size) {static const char *ioctl_tty_cmd[] = { -"TCGETS" ,"TCSETS" ,"TCSETSW" ,"TCSETSF" ,"TCGETA" ,"TCSETA" ,"TCSETAW" , + [_IOC_NR (TCGETS )] ="TCGETS" ,"TCSETS" ,"TCSETSW" ,"TCSETSF" ,"TCGETA" ,"TCSETA" ,"TCSETAW" ,"TCSETAF" ,"TCSBRK" ,"TCXONC" ,"TCFLSH" ,"TIOCEXCL" ,"TIOCNXCL" ,"TIOCSCTTY" ,"TIOCGPGRP" ,"TIOCSPGRP" ,"TIOCOUTQ" ,"TIOCSTI" ,"TIOCGWINSZ" ,"TIOCSWINSZ" ,"TIOCMGET" ,"TIOCMBIS" ,"TIOCMBIC" ,"TIOCMSET" ,"TIOCGSOFTCAR" ,"TIOCSSOFTCAR" ,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 9/33 perf augmented_raw_syscalls: Rename augmented_filename to augmented_arg
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Because it is not used only for strings, we already use it for sockaddr structs and will use it for all other types.
--- .../examples/bpf/augmented_raw_syscalls.c | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-)
tools/perf/examples/bpf/augmented_raw_syscalls.c +20 -22
@@ -60,7 +60,7 @@ struct syscall_exit_args {long ret; }; -struct augmented_filename { +struct augmented_arg {unsigned int size;int err;char value[PATH_MAX ];
@@ -72,8 +72,7 @@ struct augmented_args_payload {struct syscall_enter_args args;union {struct { -struct augmented_filename filename, - filename2; +struct augmented_arg arg, arg2; };struct sockaddr_storage saddr; };
@@ -82,31 +81,30 @@ struct augmented_args_payload { bpf_map(augmented_args_tmp, PERCPU_ARRAY, int, struct augmented_args_payload, 1);static inline -unsigned int augmented_filename__read (struct augmented_filename *augmented_filename, -const void *filename_arg,unsigned int filename_len) +unsigned int augmented_arg__read_str (struct augmented_arg *augmented_arg,const void *arg,unsigned int arg_len) { -unsigned int len =sizeof (*augmented_filename); -int size =probe_read_str (&augmented_filename->value, filename_len, filename_arg); +unsigned int augmented_len =sizeof (*augmented_arg); +int string_len =probe_read_str (&augmented_arg->value, arg_len, arg); - augmented_filename->size = augmented_filename->err =0 ; + augmented_arg->size = augmented_arg->err =0 ;/* * probe_read_str may return < 0, e.g. -EFAULT -* So we leave that in the augmented_filename->size that userspace will +* So we leave that in the augmented_arg->size that userspace will */ -if (size >0 ) { - len -=sizeof (augmented_filename->value) - size; - len &=sizeof (augmented_filename->value) -1 ; - augmented_filename->size = size; +if (string_len >0 ) { + augmented_len -=sizeof (augmented_arg->value) - string_len; + augmented_len &=sizeof (augmented_arg->value) -1 ; + augmented_arg->size = string_len; }else {/* * So that username notice the error while still being able * to skip this augmented arg record */ - augmented_filename->err = size; - len = offsetof(struct augmented_filename , value); + augmented_arg->err = string_len; + augmented_len = offsetof(struct augmented_arg , value); } -return len; +return augmented_len; }SEC ("!raw_syscalls:unaugmented" )
@@ -174,7 +172,7 @@ int sys_enter_open(struct syscall_enter_args *args)if (augmented_args ==NULL )return 1 ;/* Failure: don't filter */ - len +=augmented_filename__read (&augmented_args->filename, filename_arg,sizeof (augmented_args->filename.value)); + len +=augmented_arg__read_str (&augmented_args->arg, filename_arg,sizeof (augmented_args->arg.value));/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len);
@@ -191,7 +189,7 @@ int sys_enter_openat(struct syscall_enter_args *args)if (augmented_args ==NULL )return 1 ;/* Failure: don't filter */ - len +=augmented_filename__read (&augmented_args->filename, filename_arg,sizeof (augmented_args->filename.value)); + len +=augmented_arg__read_str (&augmented_args->arg, filename_arg,sizeof (augmented_args->arg.value));/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len);
@@ -209,8 +207,8 @@ int sys_enter_rename(struct syscall_enter_args *args)if (augmented_args ==NULL )return 1 ;/* Failure: don't filter */ - oldpath_len =augmented_filename__read (&augmented_args->filename, oldpath_arg,sizeof (augmented_args->filename.value)); - len += oldpath_len +augmented_filename__read ((void *)(&augmented_args->filename) + oldpath_len, newpath_arg,sizeof (augmented_args->filename.value)); + oldpath_len =augmented_arg__read_str (&augmented_args->arg, oldpath_arg,sizeof (augmented_args->arg.value)); + len += oldpath_len +augmented_arg__read_str ((void *)(&augmented_args->arg) + oldpath_len, newpath_arg,sizeof (augmented_args->arg.value));/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len);
@@ -228,8 +226,8 @@ int sys_enter_renameat(struct syscall_enter_args *args)if (augmented_args ==NULL )return 1 ;/* Failure: don't filter */ - oldpath_len =augmented_filename__read (&augmented_args->filename, oldpath_arg,sizeof (augmented_args->filename.value)); - len += oldpath_len +augmented_filename__read ((void *)(&augmented_args->filename) + oldpath_len, newpath_arg,sizeof (augmented_args->filename.value)); + oldpath_len =augmented_arg__read_str (&augmented_args->arg, oldpath_arg,sizeof (augmented_args->arg.value)); + len += oldpath_len +augmented_arg__read_str ((void *)(&augmented_args->arg) + oldpath_len, newpath_arg,sizeof (augmented_args->arg.value));/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 10/33 perf augmented_raw_syscalls: Postpone tmp map lookup to after pid_filter
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
No sense in doing that lookup before figuring out if it will be used, i.e. if the pid is being filtered that tmp space lookup will be useless.
--- tools/perf/examples/bpf/augmented_raw_syscalls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/examples/bpf/augmented_raw_syscalls.c +3 -3
@@ -250,13 +250,13 @@ int sys_enter(struct syscall_enter_args *args)struct syscall *syscall;int key =0 ; +if (pid_filter__has (&pids_filtered,getpid ())) +return 0 ; + augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key);if (augmented_args ==NULL )return 1 ; -if (pid_filter__has (&pids_filtered,getpid ())) -return 0 ; -probe_read (&augmented_args->args,sizeof (augmented_args->args), args);/*
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 11/33 perf augmented_raw_syscalls: Introduce helper to get the scratch space
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
We need more than the BPF stack can give us to format the raw_syscalls:sys_enter augmented tracepoint, so we use a PERCPU_ARRAY map for that, use a helper to shorten the sequence to access that area.
--- .../examples/bpf/augmented_raw_syscalls.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-)
tools/perf/examples/bpf/augmented_raw_syscalls.c +16 -16
@@ -78,8 +78,15 @@ struct augmented_args_payload { }; }; +// We need more tmp space than the BPF stack can give us bpf_map(augmented_args_tmp, PERCPU_ARRAY, int, struct augmented_args_payload, 1); +static inline struct augmented_args_payload *augmented_args_payload (void ) +{ +int key =0 ; +return bpf_map_lookup_elem (&augmented_args_tmp, &key); +} +static inline unsigned int augmented_arg__read_str (struct augmented_arg *augmented_arg,const void *arg,unsigned int arg_len) {
@@ -122,8 +129,7 @@ int syscall_unaugmented(struct syscall_enter_args *args) SEC("!syscalls:sys_enter_connect")int sys_enter_connect (struct syscall_enter_args *args) { -int key =0 ; -struct augmented_args_payload *augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); +struct augmented_args_payload *augmented_args =augmented_args_payload ();const void *sockaddr_arg = (const void *)args->args[1 ];unsigned int socklen = args->args[2 ];unsigned int len =sizeof (augmented_args->args);
@@ -143,8 +149,7 @@ int sys_enter_connect(struct syscall_enter_args *args) SEC("!syscalls:sys_enter_sendto")int sys_enter_sendto (struct syscall_enter_args *args) { -int key =0 ; -struct augmented_args_payload *augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); +struct augmented_args_payload *augmented_args =augmented_args_payload ();const void *sockaddr_arg = (const void *)args->args[4 ];unsigned int socklen = args->args[5 ];unsigned int len =sizeof (augmented_args->args);
@@ -164,8 +169,7 @@ int sys_enter_sendto(struct syscall_enter_args *args) SEC("!syscalls:sys_enter_open")int sys_enter_open (struct syscall_enter_args *args) { -int key =0 ; -struct augmented_args_payload *augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); +struct augmented_args_payload *augmented_args =augmented_args_payload ();const void *filename_arg = (const void *)args->args[0 ];unsigned int len =sizeof (augmented_args->args);
@@ -181,8 +185,7 @@ int sys_enter_open(struct syscall_enter_args *args) SEC("!syscalls:sys_enter_openat")int sys_enter_openat (struct syscall_enter_args *args) { -int key =0 ; -struct augmented_args_payload *augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); +struct augmented_args_payload *augmented_args =augmented_args_payload ();const void *filename_arg = (const void *)args->args[1 ];unsigned int len =sizeof (augmented_args->args);
@@ -198,8 +201,7 @@ int sys_enter_openat(struct syscall_enter_args *args) SEC("!syscalls:sys_enter_rename")int sys_enter_rename (struct syscall_enter_args *args) { -int key =0 ; -struct augmented_args_payload *augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); +struct augmented_args_payload *augmented_args =augmented_args_payload ();const void *oldpath_arg = (const void *)args->args[0 ], *newpath_arg = (const void *)args->args[1 ];unsigned int len =sizeof (augmented_args->args), oldpath_len;
@@ -217,8 +219,7 @@ int sys_enter_rename(struct syscall_enter_args *args) SEC("!syscalls:sys_enter_renameat")int sys_enter_renameat (struct syscall_enter_args *args) { -int key =0 ; -struct augmented_args_payload *augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); +struct augmented_args_payload *augmented_args =augmented_args_payload ();const void *oldpath_arg = (const void *)args->args[1 ], *newpath_arg = (const void *)args->args[3 ];unsigned int len =sizeof (augmented_args->args), oldpath_len;
@@ -248,14 +249,13 @@ int sys_enter(struct syscall_enter_args *args)*/ unsigned int len =sizeof (augmented_args->args);struct syscall *syscall; -int key =0 ;if (pid_filter__has (&pids_filtered,getpid ()))return 0 ; - augmented_args =bpf_map_lookup_elem (&augmented_args_tmp, &key); -if (augmented_args ==NULL ) -return 1 ; + augmented_args =augmented_args_payload (); +if (augmented_args ==NULL ) +return 1 ;probe_read (&augmented_args->args,sizeof (augmented_args->args), args);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 12/33 perf augmented_raw_syscalls: Reduce perf_event_output() boilerplate
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Add a augmented__output() helper to reduce the boilerplate of sending the augmented tracepoint to the PERF_EVENT_ARRAY BPF map associated with the bpf-output event used to communicate with the userspace perf trace tool.
--- .../examples/bpf/augmented_raw_syscalls.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-)
tools/perf/examples/bpf/augmented_raw_syscalls.c +12 -12
@@ -87,6 +87,12 @@ static inline struct augmented_args_payload *augmented_args_payload(void)return bpf_map_lookup_elem (&augmented_args_tmp, &key); } +static inline int augmented__output (void *ctx,struct augmented_args_payload *args,int len) +{ +/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ +return perf_event_output (ctx, &__augmented_syscalls__,BPF_F_CURRENT_CPU , args, len); +} +static inline unsigned int augmented_arg__read_str (struct augmented_arg *augmented_arg,const void *arg,unsigned int arg_len) {
@@ -142,8 +148,7 @@ int sys_enter_connect(struct syscall_enter_args *args)probe_read (&augmented_args->saddr, socklen, sockaddr_arg); -/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ -return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len + socklen); +return augmented__output (args, augmented_args, len + socklen); }SEC ("!syscalls:sys_enter_sendto" )
@@ -162,8 +167,7 @@ int sys_enter_sendto(struct syscall_enter_args *args)probe_read (&augmented_args->saddr, socklen, sockaddr_arg); -/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ -return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len + socklen); +return augmented__output (args, augmented_args, len + socklen); }SEC ("!syscalls:sys_enter_open" )
@@ -178,8 +182,7 @@ int sys_enter_open(struct syscall_enter_args *args) len +=augmented_arg__read_str (&augmented_args->arg, filename_arg,sizeof (augmented_args->arg.value)); -/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ -return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len); +return augmented__output (args, augmented_args, len); }SEC ("!syscalls:sys_enter_openat" )
@@ -194,8 +197,7 @@ int sys_enter_openat(struct syscall_enter_args *args) len +=augmented_arg__read_str (&augmented_args->arg, filename_arg,sizeof (augmented_args->arg.value)); -/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ -return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len); +return augmented__output (args, augmented_args, len); }SEC ("!syscalls:sys_enter_rename" )
@@ -212,8 +214,7 @@ int sys_enter_rename(struct syscall_enter_args *args) oldpath_len =augmented_arg__read_str (&augmented_args->arg, oldpath_arg,sizeof (augmented_args->arg.value)); len += oldpath_len +augmented_arg__read_str ((void *)(&augmented_args->arg) + oldpath_len, newpath_arg,sizeof (augmented_args->arg.value)); -/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ -return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len); +return augmented__output (args, augmented_args, len); }SEC ("!syscalls:sys_enter_renameat" )
@@ -230,8 +231,7 @@ int sys_enter_renameat(struct syscall_enter_args *args) oldpath_len =augmented_arg__read_str (&augmented_args->arg, oldpath_arg,sizeof (augmented_args->arg.value)); len += oldpath_len +augmented_arg__read_str ((void *)(&augmented_args->arg) + oldpath_len, newpath_arg,sizeof (augmented_args->arg.value)); -/* If perf_event_output fails, return non-zero so that it gets recorded unaugmented */ -return perf_event_output (args, &__augmented_syscalls__,BPF_F_CURRENT_CPU , augmented_args, len); +return augmented__output (args, augmented_args, len); }SEC ("raw_syscalls:sys_enter" )
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 13/33 perf tools: Remove duplicate headers
In reply to Arnaldo Carvalho de MeloFrom: Souptick Joarder <[email protected]>
Removed headers which are included twice.
--- tools/perf/util/data.c | 1 - tools/perf/util/get_current_dir_name.c | 1 - tools/perf/util/stat-display.c | 1 - 3 files changed, 3 deletions(-)
tools/perf/util/data.c +0 -1
@@ -9,7 +9,6 @@#include <unistd.h> #include <string.h> #include <asm/bug.h> -#include <sys/types.h> #include <dirent.h> #include "data.h"
tools/perf/util/get_current_dir_name.c +0 -1
@@ -5,7 +5,6 @@#include "get_current_dir_name.h" #include <unistd.h> #include <stdlib.h> -#include <stdlib.h> /* Android's 'bionic' library, for one, doesn't have this */
tools/perf/util/stat-display.c +0 -1
@@ -14,7 +14,6 @@#include "string2.h" #include <linux/ctype.h> #include "cgroup.h" -#include <math.h> #include <api/fs/fs.h> #define CNTR_NOT_SUPPORTED "<not supported>"
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 14/33 perf report: Use timestamp__scnprintf_nsec() for time sort key
In reply to Arnaldo Carvalho de MeloFrom: Andi Kleen <[email protected]>
Use timestamp__scnprintf_nsec() to print nanoseconds for the time sort key, instead of open coding.
--- tools/perf/util/sort.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
tools/perf/util/sort.c +2 -8
@@ -670,17 +670,11 @@ sort__time_cmp(struct hist_entry *left, struct hist_entry *right)static int hist_entry__time_snprintf (struct hist_entry *he,char *bf,size_t size,unsigned int width) { -unsigned long secs; -unsigned long long nsecs;char he_time[32 ]; - nsecs = he->time; - secs = nsecs /NSEC_PER_SEC ; - nsecs -= secs *NSEC_PER_SEC ; -if (symbol_conf.nanosecs) -snprintf (he_time,sizeof he_time,"%5lu.%09llu: " , - secs, nsecs); +timestamp__scnprintf_nsec (he->time, he_time, +sizeof (he_time));else timestamp__scnprintf_usec (he->time, he_time,sizeof (he_time));
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 15/33 perf report: Fix --ns time sort key output
In reply to Arnaldo Carvalho de MeloFrom: Andi Kleen <[email protected]>
If the user specified --ns, the column to print the sort time stamp wasn't wide enough to actually print the full nanoseconds.
Widen the time key column width when --ns is specified.
Before:
% perf record -a sleep 1
% perf report --sort time,overhead,symbol --stdio --ns
...
2.39% 187851.10000 [k] smp_call_function_single - -
1.53% 187851.10000 [k] intel_idle - -
0.59% 187851.10000 [.] __wcscmp_ifunc - -
0.33% 187851.10000 [.] 0000000000000000 - -
0.28% 187851.10000 [k] cpuidle_enter_state - -After:
% perf report --sort time,overhead,symbol --stdio --ns
...
2.39% 187851.100000000 [k] smp_call_function_single - -
1.53% 187851.100000000 [k] intel_idle - -
0.59% 187851.100000000 [.] __wcscmp_ifunc - -
0.33% 187851.100000000 [.] 0000000000000000 - -
0.28% 187851.100000000 [k] cpuidle_enter_state - ---- tools/perf/util/hist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/util/hist.c +4 -1
@@ -193,7 +193,10 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)hists__new_col_len (hists,HISTC_MEM_LVL ,21 +3 );hists__new_col_len (hists,HISTC_LOCAL_WEIGHT ,12 );hists__new_col_len (hists,HISTC_GLOBAL_WEIGHT ,12 ); -hists__new_col_len (hists,HISTC_TIME ,12 ); +if (symbol_conf.nanosecs) +hists__new_col_len (hists,HISTC_TIME ,16 ); +else +hists__new_col_len (hists,HISTC_TIME ,12 );if (h->srcline) { len =MAX (strlen (h->srcline),strlen (sort_srcline.se_header));
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 16/33 perf script: Fix memory leaks in list_scripts()
In reply to Arnaldo Carvalho de MeloFrom: "Gustavo A. R. Silva" <[email protected]>
In case memory resources for *buf* and *paths* were allocated, jump to *out* and release them before return.
Addresses-Coverity-ID: 1444328 ("Resource leak")
--- tools/perf/ui/browsers/scripts.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/ui/browsers/scripts.c +4 -2
@@ -133,8 +133,10 @@ static int list_scripts(char *script_name, bool *custom,int key =ui_browser__input_window ("perf script command" ,"Enter perf script command line (without perf script prefix)" , script_args,"" ,0 ); -if (key !=K_ENTER ) -return -1 ; +if (key !=K_ENTER ) { + ret =-1 ; + goto out; + }sprintf (script_name,"%s script %s" , perf, script_args); }else if (choice < num + max_std) {strcpy (script_name, paths[choice]);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 17/33 libperf: Add PERF_RECORD_MMAP 'struct mmap_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the mmap_event event definition to libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Use extra '_' to ease up reading and differentiate them from standard PRI*64 macros.
Committer notes:
Fixup the PRI_l[ux]64 macros on 32-bit arches, conditionally defining it with that extra 'l' modifier only on arches where __u64 is long long, leaving it aside on 32-bit arches.
--- tools/perf/lib/include/perf/event.h | 18 ++++++++++++++++++ tools/perf/util/event.c | 2 +- tools/perf/util/event.h | 22 ++++++++++++++-------- tools/perf/util/python.c | 4 ++-- 4 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 tools/perf/lib/include/perf/event.h
tools/perf/lib/include/perf/event.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LIBPERF_EVENT_H +#define __LIBPERF_EVENT_H + +#include <linux/perf_event.h> +#include <linux/types.h> +#include <linux/limits.h> + +struct mmap_event { +struct perf_event_header header; +__u32 pid, tid; +__u64 start; +__u64 len; +__u64 pgoff; +char filename[PATH_MAX ]; +}; + +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
@@ -1353,7 +1353,7 @@ int perf_event__process_bpf_event(struct perf_tool *tool __maybe_unused,size_t perf_event__fprintf_mmap (union perf_event *event,FILE *fp) { - return fprintf(fp, " %d/%d: [%#" PRIx64 "(%#" PRIx64 ") @ %#" PRIx64 "]: %c %s\n", + return fprintf(fp, " %d/%d: [%#" PRI_lx64 "(%#" PRI_lx64 ") @ %#" PRI_lx64 "]: %c %s\n", event->mmap.pid, event->mmap.tid, event->mmap.start, event->mmap.len, event->mmap.pgoff, (event->header.misc & PERF_RECORD_MISC_MMAP_DATA) ? 'r' : 'x',
tools/perf/util/event.h +14 -8
@@ -7,19 +7,25 @@#include <linux/kernel.h> #include <linux/bpf.h> #include <linux/perf_event.h> +#include <perf/event.h> #include "../perf.h" #include "build-id.h" #include "perf_regs.h" -struct mmap_event { -struct perf_event_header header; -u32 pid, tid; -u64 start; -u64 len; -u64 pgoff; -char filename[PATH_MAX ]; -}; +#ifdef __LP64__ +/* +* /usr/include/inttypes.h uses just 'lu' for PRIu64, but we end up defining +* __u64 as long long unsigned int, and then -Werror=format= kicks in and +* complains of the mismatched types, so use these two special extra PRI +* macros to overcome that. +*/ +#define PRI_lu64 "l" PRIu64 +#define PRI_lx64 "l" PRIx64 +#else +#define PRI_lu64 PRIu64 +#define PRI_lx64 PRIx64 +#endif struct mmap2_event {struct perf_event_header header;
tools/perf/util/python.c +2 -2
@@ -130,8 +130,8 @@ static PyObject *pyrf_mmap_event__repr(struct pyrf_event *pevent)PyObject *ret;char *s; - if (asprintf(&s, "{ type: mmap, pid: %u, tid: %u, start: %#" PRIx64 ", " - "length: %#" PRIx64 ", offset: %#" PRIx64 ", " + if (asprintf(&s, "{ type: mmap, pid: %u, tid: %u, start: %#" PRI_lx64 ", " + "length: %#" PRI_lx64 ", offset: %#" PRI_lx64 ", " "filename: %s }", pevent->event.mmap.pid, pevent->event.mmap.tid, pevent->event.mmap.start, pevent->event.mmap.len,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 18/33 libperf: Add PERF_RECORD_MMAP2 'struct mmap2_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Moving mmap2_event event definition into libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Adding and using new PRI_lu64 and PRI_lx64 macros to be used for that. Using extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/lib/include/perf/event.h | 15 +++++++++++++++ tools/perf/util/event.c | 6 +++--- tools/perf/util/event.h | 15 --------------- 3 files changed, 18 insertions(+), 18 deletions(-)
tools/perf/lib/include/perf/event.h +15 -0
@@ -15,4 +15,19 @@ struct mmap_event { char filename[PATH_MAX]; }; +struct mmap2_event { +struct perf_event_header header; +__u32 pid, tid; +__u64 start; +__u64 len; +__u64 pgoff; +__u32 maj; +__u32 min; +__u64 ino; +__u64 ino_generation; +__u32 prot; +__u32 flags; +char filename[PATH_MAX ]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +3 -3
@@ -387,7 +387,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,strcpy (execname,"" );/* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ - n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %[^\n]\n", + n = sscanf(bf, "%"PRI_lx64"-%"PRI_lx64" %s %"PRI_lx64" %x:%x %u %[^\n]\n", &event->mmap2.start, &event->mmap2.len, prot, &event->mmap2.pgoff, &event->mmap2.maj, &event->mmap2.min,
@@ -1362,8 +1362,8 @@ size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp)size_t perf_event__fprintf_mmap2 (union perf_event *event,FILE *fp) { - return fprintf(fp, " %d/%d: [%#" PRIx64 "(%#" PRIx64 ") @ %#" PRIx64 - " %02x:%02x %"PRIu64" %"PRIu64"]: %c%c%c%c %s\n", + return fprintf(fp, " %d/%d: [%#" PRI_lx64 "(%#" PRI_lx64 ") @ %#" PRI_lx64 + " %02x:%02x %"PRI_lu64" %"PRI_lu64"]: %c%c%c%c %s\n", event->mmap2.pid, event->mmap2.tid, event->mmap2.start, event->mmap2.len, event->mmap2.pgoff, event->mmap2.maj, event->mmap2.min, event->mmap2.ino,
tools/perf/util/event.h +0 -15
@@ -27,21 +27,6 @@#define PRI_lx64 PRIx64#endif -struct mmap2_event { -struct perf_event_header header; -u32 pid, tid; -u64 start; -u64 len; -u64 pgoff; -u32 maj; -u32 min; -u64 ino; -u64 ino_generation; -u32 prot; -u32 flags; -char filename[PATH_MAX ]; -}; -struct comm_event {struct perf_event_header header;u32 pid, tid;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 19/33 libperf: Add PERF_RECORD_COMM 'struct comm_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Moving comm_event event definition into libperf's event.h header include.
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
@@ -30,4 +30,10 @@ struct mmap2_event { char filename[PATH_MAX]; }; +struct comm_event { +struct perf_event_header header; +__u32 pid, tid; +char comm[16 ]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
@@ -27,12 +27,6 @@#define PRI_lx64 PRIx64#endif -struct comm_event { -struct perf_event_header header; -u32 pid, tid; -char comm[16 ]; -}; -struct namespaces_event {struct perf_event_header header;u32 pid, tid;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 20/33 libperf: Add PERF_RECORD_NAMESPACES 'struct namespaces_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the namespaces_event event definition into libperf's event.h header include.
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
@@ -36,4 +36,11 @@ struct comm_event { char comm[16]; }; +struct namespaces_event { +struct perf_event_header header; +__u32 pid, tid; +__u64 nr_namespaces; +struct perf_ns_link_info link_info[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
@@ -27,13 +27,6 @@#define PRI_lx64 PRIx64#endif -struct namespaces_event { -struct perf_event_header header; -u32 pid, tid; -u64 nr_namespaces; -struct perf_ns_link_info link_info[]; -}; -struct fork_event {struct perf_event_header header;u32 pid, ppid;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 21/33 libperf: Add PERF_RECORD_FORK 'struct fork_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the fork_event event definition into libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Using extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/lib/include/perf/event.h | 7 +++++++ tools/perf/util/event.h | 7 ------- tools/perf/util/python.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
@@ -43,4 +43,11 @@ struct namespaces_event { struct perf_ns_link_info link_info[]; }; +struct fork_event { +struct perf_event_header header; +__u32 pid, ppid; +__u32 tid, ptid; +__u64 time; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
@@ -27,13 +27,6 @@#define PRI_lx64 PRIx64#endif -struct fork_event { -struct perf_event_header header; -u32 pid, ppid; -u32 tid, ptid; -u64 time; -}; -struct lost_event {struct perf_event_header header;u64 id;
tools/perf/util/python.c +1 -1
@@ -170,7 +170,7 @@ static PyMemberDef pyrf_task_event__members[] = {static PyObject *pyrf_task_event__repr (struct pyrf_event *pevent) { return _PyUnicode_FromFormat("{ type: %s, pid: %u, ppid: %u, tid: %u, " - "ptid: %u, time: %" PRIu64 "}", + "ptid: %u, time: %" PRI_lu64 "}", pevent->event.header.type == PERF_RECORD_FORK ? "fork" : "exit", pevent->event.fork.pid, pevent->event.fork.ppid,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 22/33 libperf: Add PERF_RECORD_LOST 'struct lost_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the lost_event event definition to libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Use extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/builtin-sched.c | 2 +- tools/perf/lib/include/perf/event.h | 6 ++++++ tools/perf/util/event.c | 2 +- tools/perf/util/event.h | 6 ------ tools/perf/util/machine.c | 2 +- tools/perf/util/python.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/builtin-sched.c +1 -1
@@ -2643,7 +2643,7 @@ static int process_lost(struct perf_tool *tool __maybe_unused,timestamp__scnprintf_usec (sample->time, tstr,sizeof (tstr));printf ("%15s " , tstr); -printf ("lost %" PRIu64" events on cpu %d\n" , event->lost.lost, sample->cpu); +printf ("lost %" PRI_lu64" events on cpu %d\n" , event->lost.lost, sample->cpu);return 0 ; }
tools/perf/lib/include/perf/event.h +6 -0
@@ -50,4 +50,10 @@ struct fork_event { __u64 time; }; +struct lost_event { +struct perf_event_header header; +__u64 id; +__u64 lost; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
@@ -1480,7 +1480,7 @@ size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp)static size_t perf_event__fprintf_lost (union perf_event *event,FILE *fp) { -return fprintf (fp," lost %" PRIu64"\n" , event->lost.lost); +return fprintf (fp," lost %" PRI_lu64"\n" , event->lost.lost); }size_t perf_event__fprintf_ksymbol (union perf_event *event,FILE *fp)
tools/perf/util/event.h +0 -6
@@ -27,12 +27,6 @@#define PRI_lx64 PRIx64#endif -struct lost_event { -struct perf_event_header header; -u64 id; -u64 lost; -}; -struct lost_samples_event {struct perf_event_header header;u64 lost;
tools/perf/util/machine.c +1 -1
@@ -645,7 +645,7 @@ int machine__process_namespaces_event(struct machine *machine __maybe_unused,int machine__process_lost_event (struct machine *machine__maybe_unused ,union perf_event *event,struct perf_sample *sample__maybe_unused ) { -dump_printf (": id:%" PRIu64": lost:%" PRIu64"\n" , +dump_printf (": id:%" PRI_lu64": lost:%" PRI_lu64"\n" , event->lost.id, event->lost.lost);return 0 ; }
tools/perf/util/python.c +2 -2
@@ -263,8 +263,8 @@ static PyObject *pyrf_lost_event__repr(struct pyrf_event *pevent)PyObject *ret;char *s; -if (asprintf (&s,"{ type: lost, id: %#" PRIx64", " -"lost: %#" PRIx64" }" , +if (asprintf (&s,"{ type: lost, id: %#" PRI_lx64", " +"lost: %#" PRI_lx64" }" , pevent->event.lost.id, pevent->event.lost.lost) <0 ) { ret =PyErr_NoMemory (); }else {
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 23/33 libperf: Add PERF_RECORD_LOST_SAMPLES 'struct lost_samples_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_LOST_SAMPLES event definition into libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Use extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/lib/include/perf/event.h | 5 +++++ tools/perf/util/event.h | 5 ----- tools/perf/util/machine.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
@@ -56,4 +56,9 @@ struct lost_event { __u64 lost; }; +struct lost_samples_event { +struct perf_event_header header; +__u64 lost; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
@@ -27,11 +27,6 @@#define PRI_lx64 PRIx64#endif -struct lost_samples_event { -struct perf_event_header header; -u64 lost; -}; -/* * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID */
tools/perf/util/machine.c +1 -1
@@ -653,7 +653,7 @@ int machine__process_lost_event(struct machine *machine __maybe_unused,int machine__process_lost_samples_event (struct machine *machine__maybe_unused ,union perf_event *event,struct perf_sample *sample) { -dump_printf (": id:%" PRIu64": lost samples :%" PRIu64"\n" , +dump_printf (": id:%" PRIu64": lost samples :%" PRI_lu64"\n" , sample->id, event->lost_samples.lost);return 0 ; }
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 24/33 libperf: Add PERF_RECORD_READ 'struct read_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_READ event definition to libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Use extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/lib/include/perf/event.h | 12 ++++++++++++ tools/perf/util/event.h | 12 ------------ tools/perf/util/session.c | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-)
tools/perf/lib/include/perf/event.h +12 -0
@@ -61,4 +61,16 @@ struct lost_samples_event { __u64 lost; }; +/* +* PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID +*/ +struct read_event { +struct perf_event_header header; +__u32 pid, tid; +__u64 value; +__u64 time_enabled; +__u64 time_running; +__u64 id; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -12
@@ -27,18 +27,6 @@#define PRI_lx64 PRIx64#endif -/* -* PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID -*/ -struct read_event { -struct perf_event_header header; -u32 pid, tid; -u64 value; -u64 time_enabled; -u64 time_running; -u64 id; -}; -struct throttle_event {struct perf_event_header header;u64 time;
tools/perf/util/session.c +4 -4
@@ -1260,7 +1260,7 @@ static void dump_read(struct evsel *evsel, union perf_event *event)if (!dump_trace)return ; -printf (": %d %d %s %" PRIu64"\n" , event->read.pid, event->read.tid, +printf (": %d %d %s %" PRI_lu64"\n" , event->read.pid, event->read.tid,perf_evsel__name (evsel), event->read.value);
@@ -1270,13 +1270,13 @@ static void dump_read(struct evsel *evsel, union perf_event *event) read_format = evsel->core.attr.read_format;if (read_format &PERF_FORMAT_TOTAL_TIME_ENABLED ) -printf ("... time enabled : %" PRIu64"\n" , read_event->time_enabled); +printf ("... time enabled : %" PRI_lu64"\n" , read_event->time_enabled);if (read_format &PERF_FORMAT_TOTAL_TIME_RUNNING ) -printf ("... time running : %" PRIu64"\n" , read_event->time_running); +printf ("... time running : %" PRI_lu64"\n" , read_event->time_running);if (read_format &PERF_FORMAT_ID ) -printf ("... id : %" PRIu64"\n" , read_event->id); +printf ("... id : %" PRI_lu64"\n" , read_event->id); } static struct machine *machines__find_for_cpumode(struct machines *machines,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 25/33 libperf: Add PERF_RECORD_THROTTLE 'struct throttle_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_THROTTLE event definition into libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Use extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/lib/include/perf/event.h | 7 +++++++ tools/perf/util/event.h | 7 ------- tools/perf/util/python.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
@@ -73,4 +73,11 @@ struct read_event { __u64 id; }; +struct throttle_event { +struct perf_event_header header; +__u64 time; +__u64 id; +__u64 stream_id; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
@@ -27,13 +27,6 @@#define PRI_lx64 PRIx64#endif -struct throttle_event { -struct perf_event_header header; -u64 time; -u64 id; -u64 stream_id; -}; -#ifndef KSYM_NAME_LEN #define KSYM_NAME_LEN 256#endif
tools/perf/util/python.c +2 -2
@@ -233,8 +233,8 @@ static PyObject *pyrf_throttle_event__repr(struct pyrf_event *pevent) {struct throttle_event *te = (struct throttle_event *)(&pevent->event.header +1 ); -return _PyUnicode_FromFormat ("{ type: %sthrottle, time: %" PRIu64", id: %" PRIu64 -", stream_id: %" PRIu64" }" , +return _PyUnicode_FromFormat ("{ type: %sthrottle, time: %" PRI_lu64", id: %" PRI_lu64 +", stream_id: %" PRI_lu64" }" , pevent->event.header.type ==PERF_RECORD_THROTTLE ?"" :"un" , te->time, te->id, te->stream_id); }
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 26/33 libperf: Add PERF_RECORD_KSYMBOL 'struct ksymbol_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_KSYMBOL event definition into libperf's event.h header include.
In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions.
Perf added 'u*' types mainly to ease up printing __u64 values as stated in the linux/types.h comment:
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings. *
* typedef __u64 u64;
* typedef __s64 s64;
*/
Add and use new PRI_lu64 and PRI_lx64 macros for that. Use extra '_' to ease up the reading and differentiate them from standard PRI*64 macros.
--- tools/perf/lib/include/perf/event.h | 13 +++++++++++++ tools/perf/util/event.c | 2 +- tools/perf/util/event.h | 13 ------------- 3 files changed, 14 insertions(+), 14 deletions(-)
tools/perf/lib/include/perf/event.h +13 -0
@@ -80,4 +80,17 @@ struct throttle_event { __u64 stream_id; }; +#ifndef KSYM_NAME_LEN +#define KSYM_NAME_LEN 256 +#endif + +struct ksymbol_event { +struct perf_event_header header; +__u64 addr; +__u32 len; +__u16 ksym_type; +__u16 flags; +char name[KSYM_NAME_LEN ]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
@@ -1485,7 +1485,7 @@ static size_t perf_event__fprintf_lost(union perf_event *event, FILE *fp)size_t perf_event__fprintf_ksymbol (union perf_event *event,FILE *fp) { -return fprintf (fp," addr %" PRIx64" len %u type %u flags 0x%x name %s\n" , +return fprintf (fp," addr %" PRI_lx64" len %u type %u flags 0x%x name %s\n" , event->ksymbol_event.addr, event->ksymbol_event.len, event->ksymbol_event.ksym_type, event->ksymbol_event.flags, event->ksymbol_event.name);
tools/perf/util/event.h +0 -13
@@ -27,19 +27,6 @@#define PRI_lx64 PRIx64#endif -#ifndef KSYM_NAME_LEN -#define KSYM_NAME_LEN 256 -#endif - -struct ksymbol_event { -struct perf_event_header header; -u64 addr; -u32 len; -u16 ksym_type; -u16 flags; -char name[KSYM_NAME_LEN ]; -}; -struct bpf_event {struct perf_event_header header;u16 type;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 27/33 libperf: Add PERF_RECORD_BPF_EVENT 'struct bpf_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_BPF_EVENT 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 | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
@@ -5,6 +5,7 @@#include <linux/perf_event.h> #include <linux/types.h> #include <linux/limits.h> +#include <linux/bpf.h> struct mmap_event {struct perf_event_header header;
@@ -93,4 +94,14 @@ struct ksymbol_event { char name[KSYM_NAME_LEN]; }; +struct bpf_event { +struct perf_event_header header; +__u16 type; +__u16 flags; +__u32 id; + +/* for bpf_prog types */ +__u8 tag[BPF_TAG_SIZE ];// prog tag +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -10
@@ -27,16 +27,6 @@#define PRI_lx64 PRIx64#endif -struct bpf_event { -struct perf_event_header header; -u16 type; -u16 flags; -u32 id; - -/* for bpf_prog types */ -u8 tag[BPF_TAG_SIZE ];// prog tag -}; -#define PERF_SAMPLE_MASK \ (PERF_SAMPLE_IP | PERF_SAMPLE_TID | \ PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR | \
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 28/33 libperf: Add PERF_RECORD_SAMPLE 'struct sample_event' to perf/event.h
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Move the PERF_RECORD_SAMPLE event definition to libperf's event.h header include.
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 ----- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
@@ -104,4 +104,9 @@ struct bpf_event { __u8 tag[BPF_TAG_SIZE]; // prog tag }; +struct sample_event { +struct perf_event_header header; +__u64 array[]; +}; +#endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
@@ -37,11 +37,6 @@/* perf sample has 16 bits size limit */ #define PERF_SAMPLE_MAX_SIZE (1 << 16) -struct sample_event { -struct perf_event_header header; -u64 array[]; -}; -struct regs_dump {u64 abi;u64 mask;
tools/perf/util/evlist.c +1 -1
@@ -587,7 +587,7 @@ struct evsel *perf_evlist__id2evsel_strict(struct evlist *evlist,static int perf_evlist__event2id (struct evlist *evlist,union perf_event *event,u64 *id) { -const u64 *array = event->sample.array; +const __u64 *array = event->sample.array;ssize_t n; n = (event->header.size -sizeof (event->header)) >>3 ;
tools/perf/util/evsel.c +4 -4
@@ -2009,7 +2009,7 @@ static int perf_evsel__parse_id_sample(const struct evsel *evsel, struct perf_sample *sample) {u64 type = evsel->core.attr.sample_type; -const u64 *array = event->sample.array; +const __u64 *array = event->sample.array;bool swapped = evsel->needs_swap;union u64_swap u;
@@ -2099,7 +2099,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, {u64 type = evsel->core.attr.sample_type;bool swapped = evsel->needs_swap; -const u64 *array; +const __u64 *array;u16 max_size = event->header.size;const void *endp = (void *)event + max_size;u64 sz;
@@ -2378,7 +2378,7 @@ int perf_evsel__parse_sample_timestamp(struct evsel *evsel, u64 *timestamp) {u64 type = evsel->core.attr.sample_type; -const u64 *array; +const __u64 *array;if (!(type &PERF_SAMPLE_TIME ))return -1 ;
@@ -2529,7 +2529,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,u64 read_format, const struct perf_sample *sample) { - u64 *array; + __u64 *array;size_t sz;/* * used for cross-endian analysis. See git commit 65014ab3
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 29/33 libperf: Rename the PERF_RECORD_ structs to have a "perf" suffix
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Even more, to have a "perf_record_" prefix, so that they match the PERF_RECORD_ enum they map to.
--- tools/perf/lib/include/perf/event.h | 24 ++++++------- tools/perf/tests/parse-no-sample-id-all.c | 4 +-- tools/perf/util/bpf-event.c | 12 +++---- tools/perf/util/event.h | 30 ++++++++-------- tools/perf/util/evsel.c | 4 +-- tools/perf/util/evsel.h | 2 +- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/namespaces.c | 2 +- tools/perf/util/namespaces.h | 4 +-- tools/perf/util/python.c | 44 +++++++++++------------ tools/perf/util/session.c | 2 +- tools/perf/util/thread.c | 4 +-- tools/perf/util/thread.h | 4 +-- 13 files changed, 69 insertions(+), 69 deletions(-)
tools/perf/lib/include/perf/event.h +12 -12
@@ -7,7 +7,7 @@#include <linux/limits.h> #include <linux/bpf.h> -struct mmap_event { +struct perf_record_mmap {struct perf_event_header header;__u32 pid, tid;__u64 start;
@@ -16,7 +16,7 @@ struct mmap_event {char filename[PATH_MAX ]; }; -struct mmap2_event { +struct perf_record_mmap2 {struct perf_event_header header;__u32 pid, tid;__u64 start;
@@ -31,33 +31,33 @@ struct mmap2_event {char filename[PATH_MAX ]; }; -struct comm_event { +struct perf_record_comm {struct perf_event_header header;__u32 pid, tid;char comm[16 ]; }; -struct namespaces_event { +struct perf_record_namespaces {struct perf_event_header header;__u32 pid, tid;__u64 nr_namespaces;struct perf_ns_link_info link_info[]; }; -struct fork_event { +struct perf_record_fork {struct perf_event_header header;__u32 pid, ppid;__u32 tid, ptid;__u64 time; }; -struct lost_event { +struct perf_record_lost {struct perf_event_header header;__u64 id;__u64 lost; }; -struct lost_samples_event { +struct perf_record_lost_samples {struct perf_event_header header;__u64 lost; };
@@ -65,7 +65,7 @@ struct lost_samples_event {/* * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID */ -struct read_event { +struct perf_record_read {struct perf_event_header header;__u32 pid, tid;__u64 value;
@@ -74,7 +74,7 @@ struct read_event {__u64 id; }; -struct throttle_event { +struct perf_record_throttle {struct perf_event_header header;__u64 time;__u64 id;
@@ -85,7 +85,7 @@ struct throttle_event {#define KSYM_NAME_LEN 256#endif -struct ksymbol_event { +struct perf_record_ksymbol {struct perf_event_header header;__u64 addr;__u32 len;
@@ -94,7 +94,7 @@ struct ksymbol_event {char name[KSYM_NAME_LEN ]; }; -struct bpf_event { +struct perf_record_bpf_event {struct perf_event_header header;__u16 type;__u16 flags;
@@ -104,7 +104,7 @@ struct bpf_event {__u8 tag[BPF_TAG_SIZE ];// prog tag }; -struct sample_event { +struct perf_record_sample {struct perf_event_header header;__u64 array[]; };
tools/perf/tests/parse-no-sample-id-all.c +2 -2
@@ -87,10 +87,10 @@ int test__parse_no_sample_id_all(struct test *test __maybe_unused, int subtest _ }, .id = 2, }; -struct mmap_event event3 = { +struct perf_record_mmap event3 = { .header = { .type =PERF_RECORD_MMAP , - .size =sizeof (struct mmap_event ), + .size =sizeof (struct perf_record_mmap ), }, };union perf_event *events[] = {
tools/perf/util/bpf-event.c +6 -6
@@ -161,8 +161,8 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,union perf_event *event, struct record_opts *opts) { - struct ksymbol_event *ksymbol_event = &event->ksymbol_event; -struct bpf_event *bpf_event = &event->bpf_event; + struct perf_record_ksymbol *ksymbol_event = &event->ksymbol_event; +struct perf_record_bpf_event *bpf_event = &event->bpf_event;struct bpf_prog_info_linear *info_linear;struct perf_tool *tool = session->tool;struct bpf_prog_info_node *info_node;
@@ -230,10 +230,10 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,__u64 *prog_addrs = (__u64 *)(uintptr_t )(info->jited_ksyms);int name_len; - *ksymbol_event = (struct ksymbol_event ){ + *ksymbol_event = (struct perf_record_ksymbol ) { .header = { .type =PERF_RECORD_KSYMBOL , - .size = offsetof(struct ksymbol_event , name), + .size = offsetof(struct perf_record_ksymbol , name), }, .addr = prog_addrs[i], .len = prog_lens[i],
@@ -254,10 +254,10 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,if (!opts->no_bpf_event) {/* Synthesize PERF_RECORD_BPF_EVENT */ - *bpf_event = (struct bpf_event ){ + *bpf_event = (struct perf_record_bpf_event ) { .header = { .type =PERF_RECORD_BPF_EVENT , - .size =sizeof (struct bpf_event ), + .size =sizeof (struct perf_record_bpf_event ), }, .type =PERF_BPF_EVENT_PROG_LOAD , .flags =0 ,
tools/perf/util/event.h +15 -15
@@ -305,18 +305,18 @@ static inline void *perf_synth__raw_data(void *p)* when possible sends this number in a PERF_RECORD_LOST event. The number of * such "chunks" of lost events is stored in .nr_events[PERF_EVENT_LOST] while * total_lost tells exactly how many events the kernel in fact lost, i.e. it is -* the sum of all struct lost_event.lost fields reported. +* the sum of all struct perf_record_lost.lost fields reported. * * The kernel discards mixed up samples and sends the number in a * PERF_RECORD_LOST_SAMPLES event. The number of lost-samples events is stored * in .nr_events[PERF_RECORD_LOST_SAMPLES] while total_lost_samples tells * exactly how many samples the kernel in fact dropped, i.e. it is the sum of -* all struct lost_samples_event.lost fields reported. +* all struct perf_record_lost_samples.lost fields reported. * * The total_period is needed because by default auto-freq is used, so * multipling nr_events[PERF_EVENT_SAMPLE] by a frequency isn't possible to get * the total number of low level events, it is necessary to to sum all struct -* sample_event.period and stash the result in total_period. +* perf_record_sample.period and stash the result in total_period. */ struct events_stats {u64 total_period;
@@ -550,16 +550,18 @@ struct compressed_event {union perf_event {struct perf_event_header header; -struct mmap_event mmap; -struct mmap2_event mmap2; -struct comm_event comm; -struct namespaces_event namespaces; -struct fork_event fork; -struct lost_event lost; -struct lost_samples_event lost_samples; -struct read_event read; -struct throttle_event throttle; -struct sample_event sample; +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_event; +struct perf_record_ksymbol ksymbol_event;struct attr_event attr;struct event_update_event event_update;struct event_type_event event_type;
@@ -579,8 +581,6 @@ union perf_event {struct stat_round_event stat_round;struct time_conv_event time_conv;struct feature_event feat; -struct ksymbol_event ksymbol_event; -struct bpf_event bpf_event;struct compressed_event pack; };
tools/perf/util/evsel.c +2 -2
@@ -117,7 +117,7 @@ int __perf_evsel__sample_size(u64 sample_type)* * This function returns the position of the event id (PERF_SAMPLE_ID or * PERF_SAMPLE_IDENTIFIER) in a sample event i.e. in the array of struct -* sample_event. +* perf_record_sample. */ static int __perf_evsel__calc_id_pos (u64 sample_type) {
@@ -2420,7 +2420,7 @@ int perf_evsel__parse_sample_timestamp(struct evsel *evsel,size_t perf_event__sample_event_size (const struct perf_sample *sample,u64 type,u64 read_format) { -size_t sz, result =sizeof (struct sample_event ); +size_t sz, result =sizeof (struct perf_record_sample );if (type &PERF_SAMPLE_IDENTIFIER ) result +=sizeof (u64);
tools/perf/util/evsel.h +1 -1
@@ -107,7 +107,7 @@ struct xyarray;* show the name used, not some alias. * @id_pos: the position of the event id (PERF_SAMPLE_ID or * PERF_SAMPLE_IDENTIFIER) in a sample event i.e. in the array of -* struct sample_event +* struct perf_record_sample * @is_pos: the position (counting backwards) of the event id (PERF_SAMPLE_ID or * PERF_SAMPLE_IDENTIFIER) in a non-sample event i.e. if sample_id_all * is used there is an id sample appended to non-sample events
tools/perf/util/intel-bts.c +1 -1
@@ -818,7 +818,7 @@ static int intel_bts_synth_events(struct intel_bts *bts,* We only use sample types from PERF_SAMPLE_MASK so we can use * __perf_evsel__sample_size() here. */ - bts->branches_event_size =sizeof (struct sample_event ) + + bts->branches_event_size =sizeof (struct perf_record_sample ) +__perf_evsel__sample_size (attr.sample_type); }
tools/perf/util/namespaces.c +1 -1
@@ -19,7 +19,7 @@#include <asm/bug.h> #include <linux/zalloc.h> -struct namespaces *namespaces__new (struct namespaces_event *event) +struct namespaces *namespaces__new (struct perf_record_namespaces *event) {struct namespaces *namespaces; u64 link_info_size = ((event ? event->nr_namespaces : NR_NAMESPACES) *
tools/perf/util/namespaces.h +2 -2
@@ -17,7 +17,7 @@int setns (int fd,int nstype);#endif -struct namespaces_event ; +struct perf_record_namespaces ;struct namespaces {struct list_head list;
@@ -25,7 +25,7 @@ struct namespaces {struct perf_ns_link_info link_info[]; }; -struct namespaces *namespaces__new (struct namespaces_event *event); +struct namespaces *namespaces__new (struct perf_record_namespaces *event);void namespaces__free (struct namespaces *namespaces);struct nsinfo {
tools/perf/util/python.c +22 -22
85 lines not on this page · raw message
tools/perf/util/session.c +1 -1
@@ -1254,7 +1254,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event,static void dump_read (struct evsel *evsel,union perf_event *event) { -struct read_event *read_event = &event->read; +struct perf_record_read *read_event = &event->read;u64 read_format;if (!dump_trace)
tools/perf/util/thread.c +2 -2
@@ -169,7 +169,7 @@ struct namespaces *thread__namespaces(struct thread *thread) }static int __thread__set_namespaces (struct thread *thread,u64 timestamp, -struct namespaces_event *event) +struct perf_record_namespaces *event) {struct namespaces *new, *curr =__thread__namespaces (thread);
@@ -193,7 +193,7 @@ static int __thread__set_namespaces(struct thread *thread, u64 timestamp, }int thread__set_namespaces (struct thread *thread,u64 timestamp, -struct namespaces_event *event) +struct perf_record_namespaces *event) {int ret;
tools/perf/util/thread.h +2 -2
@@ -16,7 +16,7 @@struct addr_location ;struct map ; -struct namespaces_event ; +struct perf_record_namespaces ;struct thread_stack ;struct unwind_libunwind_ops ;
@@ -74,7 +74,7 @@ static inline void thread__exited(struct thread *thread)struct namespaces *thread__namespaces (struct thread *thread);int thread__set_namespaces (struct thread *thread,u64 timestamp, -struct namespaces_event *event); +struct perf_record_namespaces *event);int __thread__set_comm (struct thread *thread,const char *comm,u64 timestamp,bool exec);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 30/33 perf tools: Rename perf_event::ksymbol_event to perf_event::ksymbol
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Just like all the other meta events, that extra _event suffix is just redundant, ditch it.
--- tools/perf/util/bpf-event.c | 2 +- tools/perf/util/event.c | 6 +++--- tools/perf/util/event.h | 2 +- tools/perf/util/machine.c | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-)
tools/perf/util/bpf-event.c +1 -1
@@ -161,7 +161,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,union perf_event *event, struct record_opts *opts) { - struct perf_record_ksymbol *ksymbol_event = &event->ksymbol_event; + struct perf_record_ksymbol *ksymbol_event = &event->ksymbol;struct perf_record_bpf_event *bpf_event = &event->bpf_event;struct bpf_prog_info_linear *info_linear;struct perf_tool *tool = session->tool;
tools/perf/util/event.c +3 -3
@@ -1486,9 +1486,9 @@ static size_t perf_event__fprintf_lost(union perf_event *event, FILE *fp)size_t perf_event__fprintf_ksymbol (union perf_event *event,FILE *fp) {return fprintf (fp," addr %" PRI_lx64" len %u type %u flags 0x%x name %s\n" , - event->ksymbol_event.addr, event->ksymbol_event.len, - event->ksymbol_event.ksym_type, - event->ksymbol_event.flags, event->ksymbol_event.name); + event->ksymbol.addr, event->ksymbol.len, + event->ksymbol.ksym_type, + event->ksymbol.flags, event->ksymbol.name); }size_t perf_event__fprintf_bpf_event (union perf_event *event,FILE *fp)
tools/perf/util/event.h +1 -1
@@ -561,7 +561,7 @@ union perf_event {struct perf_record_throttle throttle;struct perf_record_sample sample;struct perf_record_bpf_event bpf_event; -struct perf_record_ksymbol ksymbol_event; +struct perf_record_ksymbol ksymbol;struct attr_event attr;struct event_update_event event_update;struct event_type_event event_type;
tools/perf/util/machine.c +8 -8
@@ -713,20 +713,20 @@ static int machine__process_ksymbol_register(struct machine *machine,struct symbol *sym;struct map *map; - map =map_groups__find (&machine->kmaps, event->ksymbol_event.addr); + map =map_groups__find (&machine->kmaps, event->ksymbol.addr);if (!map) { - map =dso__new_map (event->ksymbol_event.name); + map =dso__new_map (event->ksymbol.name);if (!map)return -ENOMEM ; - map->start = event->ksymbol_event.addr; - map->end = map->start + event->ksymbol_event.len; + map->start = event->ksymbol.addr; + map->end = map->start + event->ksymbol.len;map_groups__insert (&machine->kmaps, map); } sym =symbol__new (map->map_ip (map, map->start), - event->ksymbol_event.len, -0 ,0 , event->ksymbol_event.name); + event->ksymbol.len, +0 ,0 , event->ksymbol.name);if (!sym)return -ENOMEM ;dso__insert_symbol (map->dso, sym);
@@ -739,7 +739,7 @@ static int machine__process_ksymbol_unregister(struct machine *machine, {struct map *map; - map =map_groups__find (&machine->kmaps, event->ksymbol_event.addr); + map =map_groups__find (&machine->kmaps, event->ksymbol.addr);if (map)map_groups__remove (&machine->kmaps, map);
@@ -753,7 +753,7 @@ int machine__process_ksymbol(struct machine *machine __maybe_unused,if (dump_trace)perf_event__fprintf_ksymbol (event, stdout); -if (event->ksymbol_event.flags &PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER ) +if (event->ksymbol.flags &PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER )return machine__process_ksymbol_unregister (machine, event, sample);return machine__process_ksymbol_register (machine, event, sample);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 31/33 perf tools: Rename perf_event::bpf_event to perf_event::bpf
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Just like all the other meta events, that extra _event suffix is just redundant, ditch it.
--- tools/perf/util/bpf-event.c | 18 ++++++++---------- tools/perf/util/event.c | 3 +-- tools/perf/util/event.h | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-)
tools/perf/util/bpf-event.c +8 -10
@@ -35,7 +35,7 @@ static int machine__process_bpf_event_load(struct machine *machine,struct bpf_prog_info_linear *info_linear;struct bpf_prog_info_node *info_node;struct perf_env *env = machine->env; -int id = event->bpf_event.id; +int id = event->bpf.id;unsigned int i;/* perf-record, no need to handle bpf-event */
@@ -71,7 +71,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused,if (dump_trace)perf_event__fprintf_bpf_event (event, stdout); -switch (event->bpf_event.type) { +switch (event->bpf.type) {case PERF_BPF_EVENT_PROG_LOAD :return machine__process_bpf_event_load (machine, event, sample);
@@ -83,8 +83,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused,*/ break ;default : -pr_debug ("unexpected bpf_event type of %d\n" , - event->bpf_event.type); +pr_debug ("unexpected bpf_event type of %d\n" , event->bpf.type);break ; }return 0 ;
@@ -162,7 +161,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session, struct record_opts *opts) {struct perf_record_ksymbol *ksymbol_event = &event->ksymbol; -struct perf_record_bpf_event *bpf_event = &event->bpf_event; +struct perf_record_bpf_event *bpf_event = &event->bpf;struct bpf_prog_info_linear *info_linear;struct perf_tool *tool = session->tool;struct bpf_prog_info_node *info_node;
@@ -302,7 +301,7 @@ int perf_event__synthesize_bpf_events(struct perf_session *session,int err;int fd; - event =malloc (sizeof (event->bpf_event) +KSYM_NAME_LEN + machine->id_hdr_size); + event =malloc (sizeof (event->bpf) +KSYM_NAME_LEN + machine->id_hdr_size);if (!event)return -1 ;while (true) {
@@ -399,9 +398,9 @@ static int bpf_event__sb_cb(union perf_event *event, void *data)if (event->header.type !=PERF_RECORD_BPF_EVENT )return -1 ; -switch (event->bpf_event.type) { +switch (event->bpf.type) {case PERF_BPF_EVENT_PROG_LOAD : -perf_env__add_bpf_info (env, event->bpf_event.id); +perf_env__add_bpf_info (env, event->bpf.id);case PERF_BPF_EVENT_PROG_UNLOAD :/*
@@ -411,8 +410,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data)*/ break ;default : -pr_debug ("unexpected bpf_event type of %d\n" , - event->bpf_event.type); +pr_debug ("unexpected bpf_event type of %d\n" , event->bpf.type);break ; }
tools/perf/util/event.c +1 -2
@@ -1494,8 +1494,7 @@ size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp)size_t perf_event__fprintf_bpf_event (union perf_event *event,FILE *fp) {return fprintf (fp," type %u, flags %u, id %u\n" , - event->bpf_event.type, event->bpf_event.flags, - event->bpf_event.id); + event->bpf.type, event->bpf.flags, event->bpf.id); }size_t perf_event__fprintf (union perf_event *event,FILE *fp)
tools/perf/util/event.h +1 -1
@@ -560,7 +560,7 @@ union perf_event {struct perf_record_read read;struct perf_record_throttle throttle;struct perf_record_sample sample; -struct perf_record_bpf_event bpf_event; +struct perf_record_bpf_event bpf;struct perf_record_ksymbol ksymbol;struct attr_event attr;struct event_update_event event_update;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 32/33 perf tool: Rename perf_tool::bpf_event to bpf
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
No need for that _event suffix, do just like all the other meta event handlers and suppress that suffix.
--- tools/perf/builtin-script.c | 4 ++-- tools/perf/util/bpf-event.c | 11 +++++------ tools/perf/util/bpf-event.h | 10 +++++----- tools/perf/util/event.c | 14 +++++++------- tools/perf/util/event.h | 10 +++++----- tools/perf/util/machine.c | 2 +- tools/perf/util/session.c | 6 +++--- tools/perf/util/tool.h | 2 +- 8 files changed, 29 insertions(+), 30 deletions(-)
tools/perf/builtin-script.c +2 -2
@@ -2492,8 +2492,8 @@ static int __cmd_script(struct perf_script *script) script->tool.finished_round = process_finished_round_event; }if (script->show_bpf_events) { - script->tool.ksymbol = process_bpf_events; - script->tool.bpf_event = process_bpf_events; + script->tool.ksymbol = process_bpf_events; + script->tool.bpf = process_bpf_events; }if (perf_script__setup_per_event_dump (script)) {
tools/perf/util/bpf-event.c +5 -6
@@ -64,12 +64,11 @@ static int machine__process_bpf_event_load(struct machine *machine,return 0 ; } -int machine__process_bpf_event (struct machine *machine__maybe_unused , -union perf_event *event, -struct perf_sample *sample__maybe_unused ) +int machine__process_bpf (struct machine *machine,union perf_event *event, +struct perf_sample *sample) {if (dump_trace) -perf_event__fprintf_bpf_event (event, stdout); +perf_event__fprintf_bpf (event, stdout);switch (event->bpf.type) {case PERF_BPF_EVENT_PROG_LOAD :
@@ -83,7 +82,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused,*/ break ;default : -pr_debug ("unexpected bpf_event type of %d\n" , event->bpf.type); +pr_debug ("unexpected bpf event type of %d\n" , event->bpf.type);break ; }return 0 ;
@@ -410,7 +409,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data)*/ break ;default : -pr_debug ("unexpected bpf_event type of %d\n" , event->bpf.type); +pr_debug ("unexpected bpf event type of %d\n" , event->bpf.type);break ; }
tools/perf/util/bpf-event.h +5 -5
@@ -30,8 +30,8 @@ struct btf_node { };#ifdef HAVE_LIBBPF_SUPPORT -int machine__process_bpf_event (struct machine *machine,union perf_event *event, -struct perf_sample *sample); +int machine__process_bpf (struct machine *machine,union perf_event *event, +struct perf_sample *sample); int perf_event__synthesize_bpf_events(struct perf_session *session, perf_event__handler_t process,
@@ -43,9 +43,9 @@ void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,struct perf_env *env, FILE *fp);#else -static inline int machine__process_bpf_event (struct machine *machine__maybe_unused , -union perf_event *event__maybe_unused , -struct perf_sample *sample__maybe_unused ) +static inline int machine__process_bpf (struct machine *machine__maybe_unused , +union perf_event *event__maybe_unused , +struct perf_sample *sample__maybe_unused ) {return 0 ; }
tools/perf/util/event.c +7 -7
@@ -1343,12 +1343,12 @@ int perf_event__process_ksymbol(struct perf_tool *tool __maybe_unused,return machine__process_ksymbol (machine, event, sample); } -int perf_event__process_bpf_event (struct perf_tool *tool__maybe_unused , -union perf_event *event, -struct perf_sample *sample__maybe_unused , -struct machine *machine) +int perf_event__process_bpf (struct perf_tool *tool__maybe_unused , +union perf_event *event, +struct perf_sample *sample, +struct machine *machine) { -return machine__process_bpf_event (machine, event, sample); +return machine__process_bpf (machine, event, sample); }size_t perf_event__fprintf_mmap (union perf_event *event,FILE *fp)
@@ -1491,7 +1491,7 @@ size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp) event->ksymbol.flags, event->ksymbol.name); } -size_t perf_event__fprintf_bpf_event (union perf_event *event,FILE *fp) +size_t perf_event__fprintf_bpf (union perf_event *event,FILE *fp) {return fprintf (fp," type %u, flags %u, id %u\n" , event->bpf.type, event->bpf.flags, event->bpf.id);
@@ -1536,7 +1536,7 @@ size_t perf_event__fprintf(union perf_event *event, FILE *fp) ret +=perf_event__fprintf_ksymbol (event, fp);break ;case PERF_RECORD_BPF_EVENT : - ret +=perf_event__fprintf_bpf_event (event, fp); + ret +=perf_event__fprintf_bpf (event, fp);break ;default : ret +=fprintf (fp,"\n" );
tools/perf/util/event.h +5 -5
@@ -683,10 +683,10 @@ int perf_event__process_ksymbol(struct perf_tool *tool,union perf_event *event, struct perf_sample *sample, struct machine *machine); -int perf_event__process_bpf_event (struct perf_tool *tool, -union perf_event *event, -struct perf_sample *sample, -struct machine *machine); +int perf_event__process_bpf (struct perf_tool *tool, +union perf_event *event, +struct perf_sample *sample, +struct machine *machine); int perf_tool__process_synth_event(struct perf_tool *tool, union perf_event *event, struct machine *machine,
@@ -751,7 +751,7 @@ size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp);size_t perf_event__fprintf_cpu_map (union perf_event *event,FILE *fp);size_t perf_event__fprintf_namespaces (union perf_event *event,FILE *fp);size_t perf_event__fprintf_ksymbol (union perf_event *event,FILE *fp); -size_t perf_event__fprintf_bpf_event (union perf_event *event,FILE *fp); +size_t perf_event__fprintf_bpf (union perf_event *event,FILE *fp);size_t perf_event__fprintf (union perf_event *event,FILE *fp); int kallsyms__get_function_start(const char *kallsyms_filename,
tools/perf/util/machine.c +1 -1
@@ -1922,7 +1922,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,case PERF_RECORD_KSYMBOL : ret =machine__process_ksymbol (machine, event, sample);break ;case PERF_RECORD_BPF_EVENT : - ret =machine__process_bpf_event (machine, event, sample);break ; + ret =machine__process_bpf (machine, event, sample);break ;default : ret =-1 ;break ;
tools/perf/util/session.c +3 -3
@@ -473,8 +473,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool) tool->context_switch = perf_event__process_switch;if (tool->ksymbol ==NULL ) tool->ksymbol = perf_event__process_ksymbol; -if (tool->bpf_event ==NULL ) - tool->bpf_event = perf_event__process_bpf_event; +if (tool->bpf ==NULL ) + tool->bpf = perf_event__process_bpf;if (tool->read ==NULL ) tool->read = process_event_sample_stub;if (tool->throttle ==NULL )
@@ -1452,7 +1452,7 @@ static int machines__deliver_event(struct machines *machines,case PERF_RECORD_KSYMBOL :return tool->ksymbol (tool, event, sample, machine);case PERF_RECORD_BPF_EVENT : -return tool->bpf_event (tool, event, sample, machine); +return tool->bpf (tool, event, sample, machine);default : ++evlist->stats.nr_unknown_events;return -1 ;
tools/perf/util/tool.h +1 -1
@@ -56,7 +56,7 @@ struct perf_tool { throttle, unthrottle, ksymbol, - bpf_event; + bpf;event_attr_op attr;event_attr_op event_update;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 33/33 perf evsel: Rename perf_missing_features::bpf_event to ::bpf
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
No need for that _event suffix, do just like all the other meta events and do away with that.
--- tools/perf/util/evsel.c | 9 ++++----- tools/perf/util/evsel.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-)
tools/perf/util/evsel.c +4 -5
@@ -1072,8 +1072,7 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, attr->mmap2 = track && !perf_missing_features.mmap2; attr->comm = track; attr->ksymbol = track && !perf_missing_features.ksymbol; - attr->bpf_event = track && !opts->no_bpf_event && - !perf_missing_features.bpf_event; + attr->bpf_event = track && !opts->no_bpf_event && !perf_missing_features.bpf;if (opts->record_namespaces) attr->namespaces = track;
@@ -1803,7 +1802,7 @@ int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, evsel->core.attr.read_format &= ~(PERF_FORMAT_GROUP |PERF_FORMAT_ID );if (perf_missing_features.ksymbol) evsel->core.attr.ksymbol =0 ; -if (perf_missing_features.bpf_event) +if (perf_missing_features.bpf) evsel->core.attr.bpf_event =0 ; retry_sample_id:if (perf_missing_features.sample_id_all)
@@ -1920,8 +1919,8 @@ int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, perf_missing_features.aux_output = true;pr_debug2 ("Kernel has no attr.aux_output support, bailing out\n" ); goto out_close; - }else if (!perf_missing_features.bpf_event && evsel->core.attr.bpf_event) { - perf_missing_features.bpf_event = true; + }else if (!perf_missing_features.bpf && evsel->core.attr.bpf_event) { + perf_missing_features.bpf = true;pr_debug2 ("switching off bpf_event\n" ); goto fallback_missing_features; }else if (!perf_missing_features.ksymbol && evsel->core.attr.ksymbol) {
tools/perf/util/evsel.h +1 -1
@@ -194,7 +194,7 @@ struct perf_missing_features {bool write_backward;bool group_read;bool ksymbol; -bool bpf_event; +bool bpf;bool aux_output; };
Signature · 1 line
2.21.0
Quoted 189 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
39152ee51b77851689f9b23fde6f610d13566c39:perf/x86/intel/pt: Get rid of reverse lookup table for ToPA (2019-08-26 12:00:16 +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-20190826for you to fetch changes up to
74a1e863eb73dcc9f069b671dfb40650f3832116:perf evsel: Rename
perf_missing_features::bpf_eventto ::bpf (2019-08-26 19:39:11 -0300)----------------------------------------------------------------
perf/core improvements and fixes:perf report:
Andi Kleen:
- Make --ns time sort key output column wide enough for nanoseconds.
perf script:
Gustavo A. R. Silva:
- Fix memory leaks in
list_scripts()perf tests:
James Clark:
- Fixes hang in zstd compression test by changing the source of random data.
perf trace:
Arnaldo Carvalho de Melo:
-
augmented_raw_syscalls.cBPF helper improvements.Benjamin Peterson:
- Fix off-by-one error in ioctl
cmd->stringtable.libperf:
Jiri Olsa:
- Move most
PERF_RECORD_structs toperf/event.h.headers:
Arnaldo Carvalho de Melo:
- Move cacheline related routines to separate source files.
- Move
record_optsand other record declarations to separate files.- Explicitly add some more needed headers here and there.
Souptick Joarder:
- Remove some duplicate include directives.
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>----------------------------------------------------------------
Andi Kleen (2):
perf report: Usetimestamp__scnprintf_nsec()for time sort key perf report: Fix --ns time sort key outputArnaldo Carvalho de Melo (15):
perf cpumap: No need to includeperf.h, ditch it
perf stat: Remove needless headers fromstat.h
perf record: Moverecord_optsand other record decls out ofperf.hperf cacheline: Move cacheline related routines to separate files perf srcline: Add missingsrcline.hheader to files needing its defs perf sort: Remove needless headers fromsort.h, provide fwd struct decls perfaugmented_raw_syscalls: Renameaugmented_filenametoaugmented_argperfaugmented_raw_syscalls: Postpone tmp map lookup to afterpid_filterperfaugmented_raw_syscalls: Introduce helper to get the scratch space perfaugmented_raw_syscalls: Reduceperf_event_output()boilerplate
libperf: Rename thePERF_RECORD_structs to have a "perf" suffix perf tools: Renameperf_event::ksymbol_eventtoperf_event::ksymbolperf tools: Renameperf_event::bpf_eventtoperf_event::bpfperf tool: Renameperf_tool::bpf_eventto bpf
perf evsel: Renameperf_missing_features::bpf_eventto ::bpfBenjamin Peterson (1):
perf trace beauty ioctl: Fix off-by-one error in cmd->string tableGustavo A. R. Silva (1):
perf script: Fix memory leaks inlist_scripts()James Clark (1):
perf tests: Fixes hang in zstd compression test by changing the source of random dataJiri Olsa (12):
libperf: AddPERF_RECORD_MMAP'structmmap_event' toperf/event.h
libperf: AddPERF_RECORD_MMAP2'structmmap2_event' toperf/event.h
libperf: AddPERF_RECORD_COMM'structcomm_event' toperf/event.h
libperf: AddPERF_RECORD_NAMESPACES'structnamespaces_event' toperf/event.h
libperf: AddPERF_RECORD_FORK'structfork_event' toperf/event.h
libperf: AddPERF_RECORD_LOST'structlost_event' toperf/event.h
libperf: AddPERF_RECORD_LOST_SAMPLES'structlost_samples_event' toperf/event.h
libperf: AddPERF_RECORD_READ'structread_event' toperf/event.h
libperf: AddPERF_RECORD_THROTTLE'structthrottle_event' toperf/event.h
libperf: AddPERF_RECORD_KSYMBOL'structksymbol_event' toperf/event.h
libperf: AddPERF_RECORD_BPF_EVENT'structbpf_event' toperf/event.h
libperf: AddPERF_RECORD_SAMPLE'structsample_event' toperf/event.hSouptick Joarder (1):
perf tools: Remove duplicate headerstools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 1 + tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 + tools/perf/arch/x86/util/intel-bts.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 3 +- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-diff.c | 2 + tools/perf/builtin-record.c | 4 +- tools/perf/builtin-report.c | 1 + tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-script.c | 7 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/examples/bpf/augmented_raw_syscalls.c | 100 +++++++-------- tools/perf/lib/include/perf/event.h | 112 ++++++++++++++++ tools/perf/perf.h | 62 --------- tools/perf/tests/backward-ring-buffer.c | 2 +- tools/perf/tests/bpf.c | 1 + tools/perf/tests/code-reading.c | 1 + tools/perf/tests/keep-tracking.c | 1 + tools/perf/tests/openat-syscall-tp-fields.c | 3 +- tools/perf/tests/parse-no-sample-id-all.c | 4 +- tools/perf/tests/perf-record.c | 2 +- tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 +- tools/perf/tests/switch-tracking.c | 1 + tools/perf/tests/task-exit.c | 1 + tools/perf/trace/beauty/ioctl.c | 2 +- tools/perf/ui/browsers/res_sample.c | 2 + tools/perf/ui/browsers/scripts.c | 8 +- tools/perf/ui/stdio/hist.c | 1 + tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 2 + tools/perf/util/auxtrace.c | 2 +- tools/perf/util/bpf-event.c | 36 +++--- tools/perf/util/bpf-event.h | 10 +- tools/perf/util/cacheline.c | 26 ++++ tools/perf/util/cacheline.h | 21 +++ tools/perf/util/callchain.c | 1 + tools/perf/util/cpumap.h | 2 - tools/perf/util/data.c | 1 - tools/perf/util/event.c | 35 +++-- tools/perf/util/event.h | 149 +++++----------------- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 22 ++-- tools/perf/util/evsel.h | 4 +- tools/perf/util/get_current_dir_name.c | 1 - tools/perf/util/hist.c | 5 +- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/kvm-stat.h | 2 +- tools/perf/util/machine.c | 25 ++-- tools/perf/util/machine.h | 1 + tools/perf/util/namespaces.c | 2 +- tools/perf/util/namespaces.h | 4 +- tools/perf/util/python.c | 58 ++++----- tools/perf/util/record.c | 1 + tools/perf/util/record.h | 74 +++++++++++ tools/perf/util/session.c | 16 +-- tools/perf/util/sort.c | 12 +- tools/perf/util/sort.h | 27 +--- tools/perf/util/stat-display.c | 1 - tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 7 +- tools/perf/util/thread.c | 4 +- tools/perf/util/thread.h | 4 +- tools/perf/util/tool.h | 2 +-
Quoted 8 lines
tools/perf/util/top.h | 1 + tools/perf/util/util.c | 20 --- tools/perf/util/util.h | 1 - 69 files changed, 493 insertions(+), 427 deletions(-) create mode 100644 tools/perf/lib/include/perf/event.h create mode 100644 tools/perf/util/cacheline.c create mode 100644 tools/perf/util/cacheline.h create mode 100644 tools/perf/util/record.h
Pulled, thanks a lot Arnaldo!
Ingo