perf/core improvements and fixes
Subsystems (7)
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 e336b4027775cb458dc713745e526fa1a1996b2a:
kprobes: Prohibit probing on BUG() and WARN() address (2019-09-05 10:15: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-20190920-2
for you to fetch changes up to 2bff2b828502b5e5d5ea5a52643d3542053df03f:
perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpc (2019-09-20 10:28:26 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
perf stat:
Srikar Dronamraju:
- Fix a segmentation fault when using repeat forever.
- Reset previous counts on repeat with interval.
aarch64:
James Clark:
- Add PMU event JSON files for Cortex-A76 and Neoverse N1.
PowerPC:
Anju T Sudhakar:
- Make 'trace_cycles' the default event for 'perf kvm record' in PowerPC.
S/390:
- Link libjvmti to tools/lib/string.o to have a weak strlcpy() implementation, providing previously unresolved symbol on s/390.
perf test:
Jiri Olsa:
- Add libperf automated tests to 'make -C tools/perf build-test'.
Colin Ian King:
- Fix spelling mistake.
Tree wide:
Arnaldo Carvalho de Melo:
- Some more header file sanitization.
libperf:
Jiri Olsa:
- Add dependency on libperf for python.so binding.
libtraceevent:
Sakari Ailus:
- Convert remaining %p[fF] users to %p[sS].
----------------------------------------------------------------
Anju T Sudhakar (3):
perf kvm: Move kvm-stat header file from conditional inclusion to common include section perf kvm: Add arch neutral function to choose event for perf kvm record perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpc
Arnaldo Carvalho de Melo (19):
perf jvmti: Link against tools/lib/string.o to have weak strlcpy() perf tools: Remove needless builtin.h include directives perf debug: No need to include ui/util.h
perf tools: Remove debug.h from places where it is not needed perf tools: Remove util.h from where it is not needed perf probe: Add missing build-id.h header.
perf symbols: Add missing dso.h header
perf env: Remove needless cpumap.h header
perf event: Move perf_event__synthesize* to event.h perf stat: Move perf_stat_synthesize_config() to event.h perf callchain: Remove needless event.h include
perf python: Remove debug.h
perf hist: Add missing 'struct branch_stack' forward declaration perf annotate: Add missing machine.h include directive perf sched: Add missing event.h include directive
perf auxtrace: Add missing 'struct perf_sample' forward declaration perf tools: Move event synthesizing routines to separate header perf memswap: Adopt 'struct u64_swap' from evsel.h
perf tools: Move event synthesizing routines to separate .c file
Colin Ian King (1):
perf test: Fix spelling mistake "allos" -> "allocate"
James Clark (1):
perf tools: Add PMU event JSON files for ARM Cortex-A76 and, Neoverse N1.
Jiri Olsa (4):
perf python: Add missing python/perf.so dependency for libperf perf tests: Add libperf automated test for 'make -C tools/perf build-test'
libperf: Add missing event.h file to install rule
libperf: Adopt perf_cpu_map__max() function
Sakari Ailus (1):
tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
Srikar Dronamraju (2):
perf stat: Reset previous counts on repeat with interval perf stat: Fix a segmentation fault when using repeat forever
.../Documentation/libtraceevent-func_apis.txt | 10 +- tools/lib/traceevent/event-parse.c | 18 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 2 +- tools/perf/arch/arm64/util/dwarf-regs.c | 1 - tools/perf/arch/arm64/util/header.c | 4 +- tools/perf/arch/arm64/util/unwind-libunwind.c | 2 +- tools/perf/arch/powerpc/util/dwarf-regs.c | 1 - tools/perf/arch/powerpc/util/header.c | 1 - tools/perf/arch/powerpc/util/kvm-stat.c | 45 + tools/perf/arch/powerpc/util/skip-callchain-idx.c | 1 + tools/perf/arch/powerpc/util/sym-handling.c | 1 - tools/perf/arch/s390/util/machine.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 1 - tools/perf/arch/x86/tests/perf-time-to-tsc.c | 1 - tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/arch/x86/util/archinsn.c | 1 + tools/perf/arch/x86/util/event.c | 2 + tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/arch/x86/util/machine.c | 3 +- tools/perf/arch/x86/util/tsc.c | 2 + tools/perf/bench/epoll-ctl.c | 2 +- tools/perf/bench/epoll-wait.c | 2 +- tools/perf/bench/futex-hash.c | 2 +- tools/perf/bench/futex-lock-pi.c | 2 +- tools/perf/bench/futex-requeue.c | 2 +- tools/perf/bench/futex-wake-parallel.c | 3 +- tools/perf/bench/futex-wake.c | 2 +- tools/perf/bench/numa.c | 1 - tools/perf/bench/sched-messaging.c | 2 - tools/perf/bench/sched-pipe.c | 2 - tools/perf/builtin-annotate.c | 1 + tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-config.c | 1 - tools/perf/builtin-evlist.c | 2 - tools/perf/builtin-inject.c | 1 + tools/perf/builtin-kvm.c | 15 +- tools/perf/builtin-record.c | 10 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-sched.c | 3 + tools/perf/builtin-stat.c | 24 +- tools/perf/builtin-top.c | 1 + tools/perf/builtin-trace.c | 1 + tools/perf/jvmti/Build | 9 + tools/perf/lib/Makefile | 1 + tools/perf/lib/cpumap.c | 12 + tools/perf/lib/include/perf/cpumap.h | 1 + tools/perf/lib/libperf.map | 1 + tools/perf/perf.c | 2 +- .../arch/arm64/arm/cortex-a76-n1/branch.json | 14 + .../arch/arm64/arm/cortex-a76-n1/bus.json | 24 + .../arch/arm64/arm/cortex-a76-n1/cache.json | 207 +++ .../arch/arm64/arm/cortex-a76-n1/exception.json | 52 + .../arch/arm64/arm/cortex-a76-n1/instruction.json | 108 ++ .../arch/arm64/arm/cortex-a76-n1/memory.json | 23 + .../arch/arm64/arm/cortex-a76-n1/other.json | 7 + .../arch/arm64/arm/cortex-a76-n1/pipeline.json | 14 + tools/perf/pmu-events/arch/arm64/mapfile.csv | 2 + tools/perf/tests/bitmap.c | 2 +- tools/perf/tests/clang.c | 2 - tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/cpumap.c | 1 + tools/perf/tests/dso-data.c | 1 - tools/perf/tests/dwarf-unwind.c | 1 + tools/perf/tests/event-times.c | 1 - tools/perf/tests/event_update.c | 4 +- tools/perf/tests/hists_common.c | 2 + tools/perf/tests/keep-tracking.c | 3 +- tools/perf/tests/llvm.c | 1 - tools/perf/tests/make | 6 +- tools/perf/tests/mem2node.c | 2 +- tools/perf/tests/mmap-basic.c | 3 +- tools/perf/tests/mmap-thread-lookup.c | 4 +- tools/perf/tests/openat-syscall-all-cpus.c | 5 +- tools/perf/tests/parse-events.c | 1 - tools/perf/tests/parse-no-sample-id-all.c | 2 - tools/perf/tests/perf-hooks.c | 1 - tools/perf/tests/pmu.c | 1 - tools/perf/tests/sample-parsing.c | 2 +- tools/perf/tests/stat.c | 1 + tools/perf/tests/switch-tracking.c | 1 - tools/perf/tests/task-exit.c | 2 +- tools/perf/tests/thread-map.c | 1 + tools/perf/tests/topology.c | 2 +- tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/ui/browser.c | 1 - tools/perf/ui/browsers/annotate.c | 1 - tools/perf/ui/browsers/header.c | 1 - tools/perf/ui/browsers/map.c | 1 - tools/perf/ui/browsers/res_sample.c | 2 +- tools/perf/ui/browsers/scripts.c | 3 +- tools/perf/ui/gtk/helpline.c | 1 - tools/perf/ui/gtk/progress.c | 1 - tools/perf/ui/gtk/setup.c | 3 +- tools/perf/ui/gtk/util.c | 1 - tools/perf/ui/helpline.c | 2 - tools/perf/ui/hist.c | 1 - tools/perf/ui/setup.c | 2 +- tools/perf/ui/stdio/hist.c | 1 + tools/perf/ui/tui/helpline.c | 1 - tools/perf/ui/tui/setup.c | 2 +- tools/perf/ui/tui/util.c | 1 - tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 2 +- tools/perf/util/arm-spe.c | 1 - tools/perf/util/auxtrace.c | 6 +- tools/perf/util/auxtrace.h | 18 +- tools/perf/util/bpf-event.c | 1 + tools/perf/util/bpf-event.h | 15 +- tools/perf/util/branch.c | 2 - tools/perf/util/branch.h | 9 +- tools/perf/util/build-id.c | 2 +- tools/perf/util/callchain.c | 1 + tools/perf/util/callchain.h | 5 +- tools/perf/util/cloexec.c | 2 +- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 - tools/perf/util/cs-etm.c | 2 +- tools/perf/util/data.c | 3 +- tools/perf/util/debug.c | 1 - tools/perf/util/debug.h | 2 +- tools/perf/util/demangle-java.c | 1 - tools/perf/util/demangle-rust.c | 1 - tools/perf/util/dwarf-regs.c | 1 - tools/perf/util/env.h | 3 +- tools/perf/util/event.c | 1109 +----------- tools/perf/util/event.h | 77 +- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 280 +-- tools/perf/util/evsel.h | 5 - tools/perf/util/evsel_fprintf.c | 1 + tools/perf/util/header.c | 395 +--- tools/perf/util/header.h | 60 +- tools/perf/util/hist.h | 1 + tools/perf/util/intel-bts.c | 2 +- tools/perf/util/intel-pt.c | 1 + tools/perf/util/jitdump.c | 2 - tools/perf/util/kvm-stat.h | 4 + tools/perf/util/libunwind/arm64.c | 1 - tools/perf/util/libunwind/x86_32.c | 1 - tools/perf/util/llvm-utils.c | 1 + tools/perf/util/lzma.c | 2 +- tools/perf/util/machine.c | 15 - tools/perf/util/machine.h | 15 - tools/perf/util/memswap.h | 7 + tools/perf/util/namespaces.c | 18 + tools/perf/util/namespaces.h | 2 + tools/perf/util/parse-events.c | 1 - tools/perf/util/perf-hooks.c | 1 - tools/perf/util/pmu.c | 1 - tools/perf/util/probe-file.c | 1 + tools/perf/util/python.c | 4 +- tools/perf/util/record.c | 2 - tools/perf/util/rwsem.c | 1 + tools/perf/util/s390-cpumsf.c | 1 - tools/perf/util/s390-sample-raw.c | 1 - .../util/scripting-engines/trace-event-python.c | 2 - tools/perf/util/session.c | 72 +- tools/perf/util/session.h | 5 - tools/perf/util/srccode.c | 2 +- tools/perf/util/stat.c | 60 +- tools/perf/util/stat.h | 9 +- tools/perf/util/svghelper.c | 2 +- tools/perf/util/symbol-elf.c | 3 + tools/perf/util/symbol-minimal.c | 3 +- tools/perf/util/symbol.c | 2 +- tools/perf/util/synthetic-events.c | 1884 ++++++++++++++++++++ tools/perf/util/synthetic-events.h | 103 ++ tools/perf/util/target.c | 2 - tools/perf/util/top.c | 1 - tools/perf/util/trace-event-info.c | 2 +- tools/perf/util/trace-event-read.c | 1 - tools/perf/util/trace-event.c | 1 - tools/perf/util/tsc.h | 14 +- tools/perf/util/unwind-libdw.c | 1 - tools/perf/util/unwind-libunwind-local.c | 1 - tools/perf/util/usage.c | 1 - tools/perf/util/vdso.c | 2 +- tools/perf/util/zlib.c | 4 +- 180 files changed, 2763 insertions(+), 2256 deletions(-) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/exception.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/instruction.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/memory.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/other.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/pipeline.json create mode 100644 tools/perf/util/synthetic-events.c create mode 100644 tools/perf/util/synthetic-events.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-39), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190908 gcc-9-branch@275492, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 9.2.1-8) 9.2.1 20190909, clang version 8.0.1-3+b1 (tags/RELEASE_801/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.1 20190424 [gcc-7-branch revision 270538], 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.2.1 20190820 [gcc-9-branch revision 274748], 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 77 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-8ubuntu1) 9.2.1 20190909, clang version 9.0.0-+rc5-1~exp1 (tags/RELEASE_900/rc5) #
# uname -a
Linux quaco 5.3.0+ #2 SMP Thu Sep 19 16:13:22 -03 2019 x86_64 x86_64 x86_64 GNU/Linux
# git log --oneline -1
2bff2b828502 perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpc
# perf version --build-options
perf version 5.3.rc6.g2bff2b828502
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_install_O: make install
make_util_map_o_O: make util/map.o
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_no_libelf_O: make NO_LIBELF=1
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_libunwind_O: make NO_LIBUNWIND=1
make_perf_o_O: make perf.o
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_clean_all_O: make clean all
make_doc_O: make doc
make_no_gtk2_O: make NO_GTK2=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_static_O: make LDFLAGS=-static
make_help_O: make help
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_pure_O: make
make_tags_O: make tags
make_no_newt_O: make NO_NEWT=1
make_cscope_O: make cscope
make_install_bin_O: make install-bin
make_no_libbpf_O: make NO_LIBBPF=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_with_babeltrace_O: make LIBBABELTRACE=1
make_install_prefix_O: make install prefix=/tmp/krava
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_demangle_O: make NO_DEMANGLE=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_debug_O: make DEBUG=1
make_no_slang_O: make NO_SLANG=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_libperl_O: make NO_LIBPERL=1
OK
make: Leaving directory '/home/acme/git/perf/tools/perf'
$Arnaldo Carvalho de Melo
maintainerPATCH 1/31 perf python: Add missing python/perf.so dependency for libperf
From: Jiri Olsa <[email protected]>
The python/perf.so compilation needs libperf ready, otherwise it fails:
$ make python/perf.so JOBS=1
BUILD: Doing 'make -j1' parallel build
GEN python/perf.so
gcc: error: /home/jolsa/kernel/linux-perf/tools/perf/lib/libperf.a: No such file or directoryFixing this with by adding libperf dependency.
--- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.perf +1 -1
@@ -567,7 +567,7 @@ all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) # Create python binding output directory if not already present _dummy := $(shell [ -d '$(OUTPUT)python' ] || mkdir -p '$(OUTPUT)python') -$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) +$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) $(LIBPERF) $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \ CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \ $(PYTHON_WORD) util/setup.py \
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 2/31 perf tests: Add libperf automated test for 'make -C tools/perf build-test'
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Add a libperf build test, that is triggered when one does:
$ make -C tools/perf build-test
--- tools/perf/tests/make | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/tests/make +5 -1
@@ -327,6 +327,10 @@ make_kernelsrc_tools: (make -C ../../tools $(PARALLEL_OPT) $(K_O_OPT) perf) > $@ 2>&1 && \ test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false) +make_libperf: + @echo "- make -C lib"; + make -C lib clean >$@ 2>&1; make -C lib >>$@ 2>&1 && rm $@ + FEATURES_DUMP_FILE := $(FULL_O)/BUILD_TEST_FEATURE_DUMP FEATURES_DUMP_FILE_STATIC := $(FULL_O)/BUILD_TEST_FEATURE_DUMP_STATIC
@@ -365,5 +369,5 @@ $(foreach t,$(run),$(if $(findstring make_static,$(t)),\ $(eval $(t) := $($(t)) FEATURES_DUMP=$(FEATURES_DUMP_FILE)))) endif -.PHONY: all $(run) $(run_O) tarpkg clean make_kernelsrc make_kernelsrc_tools +.PHONY: all $(run) $(run_O) tarpkg clean make_kernelsrc make_kernelsrc_tools make_libperf endif # ifndef MK
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 3/31 libperf: Add missing event.h file to install rule
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
So that this development header is properly installed and can be found by tools linking with libperf.
--- tools/perf/lib/Makefile | 1 + 1 file changed, 1 insertion(+)
tools/perf/lib/Makefile +1 -0
@@ -146,6 +146,7 @@ install_headers: $(call do_install,include/perf/threadmap.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/evlist.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/evsel.h,$(prefix)/include/perf,644); + $(call do_install,include/perf/event.h,$(prefix)/include/perf,644); install_pkgconfig: $(LIBPERF_PC) $(call QUIET_INSTALL, $(LIBPERF_PC)) \
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 4/31 libperf: Adopt perf_cpu_map__max() function
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
From 'perf stat', so that it can be used from multiple places.
--- tools/perf/builtin-stat.c | 14 +------------- tools/perf/lib/cpumap.c | 12 ++++++++++++ tools/perf/lib/include/perf/cpumap.h | 1 + tools/perf/lib/libperf.map | 1 + 4 files changed, 15 insertions(+), 13 deletions(-)
tools/perf/builtin-stat.c +1 -13
@@ -822,18 +822,6 @@ static int perf_stat__get_core(struct perf_stat_config *config __maybe_unused,return cpu_map__get_core (map, cpu,NULL ); } -static int cpu_map__get_max (struct perf_cpu_map *map) -{ -int i, max =-1 ; - -for (i =0 ; i < map->nr; i++) { -if (map->map[i] > max) - max = map->map[i]; - } - -return max; -} -static int perf_stat__get_aggr (struct perf_stat_config *config,aggr_get_id_t get_id,struct perf_cpu_map *map,int idx) {
@@ -928,7 +916,7 @@ static int perf_stat_init_aggr_mode(void)* taking the highest cpu number to be the size of * the aggregation translate cpumap. */ - nr =cpu_map__get_max (evsel_list->core.cpus); + nr =perf_cpu_map__max (evsel_list->core.cpus); stat_config.cpus_aggr_map =perf_cpu_map__empty_new (nr +1 );return stat_config.cpus_aggr_map ?0 : -ENOMEM ; }
tools/perf/lib/cpumap.c +12 -0
@@ -260,3 +260,15 @@ int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu)return -1 ; } + +int perf_cpu_map__max (struct perf_cpu_map *map) +{ +int i, max =-1 ; + +for (i =0 ; i < map->nr; i++) { +if (map->map[i] > max) + max = map->map[i]; + } + +return max; +}
tools/perf/lib/include/perf/cpumap.h +1 -0
@@ -16,6 +16,7 @@ LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map); LIBPERF_API int perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx); LIBPERF_API int perf_cpu_map__nr(const struct perf_cpu_map *cpus); LIBPERF_API bool perf_cpu_map__empty(const struct perf_cpu_map *map); +LIBPERF_API int perf_cpu_map__max(struct perf_cpu_map *map);#define perf_cpu_map__for_each_cpu (cpu, idx, cpus) \ for ((idx) = 0, (cpu) = perf_cpu_map__cpu(cpus, idx); \
tools/perf/lib/libperf.map +1 -0
@@ -9,6 +9,7 @@ LIBPERF_0.0.1 { perf_cpu_map__nr; perf_cpu_map__cpu; perf_cpu_map__empty; + perf_cpu_map__max; perf_thread_map__new_dummy; perf_thread_map__set_pid; perf_thread_map__comm;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 5/31 perf jvmti: Link against tools/lib/string.o to have weak strlcpy()
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
That is needed in systems such some S/390 distros.
$ readelf -s /tmp/build/perf/jvmti/jvmti-in.o | grep strlcpy 452: 0000000000002990 125 FUNC WEAK DEFAULT 119 strlcpy $
Thanks to Jiri Olsa for fixing up my initial stab at this, I forgot how Makefiles are picky about spaces versus tabs.
--- tools/perf/jvmti/Build | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/perf/jvmti/Build +9 -0
@@ -1,8 +1,17 @@ jvmti-y += libjvmti.o jvmti-y += jvmti_agent.o +# For strlcpy +jvmti-y += libstring.o + CFLAGS_jvmti = -fPIC -DPIC -I$(JDIR)/include -I$(JDIR)/include/linux CFLAGS_REMOVE_jvmti = -Wmissing-declarations CFLAGS_REMOVE_jvmti += -Wstrict-prototypes CFLAGS_REMOVE_jvmti += -Wextra CFLAGS_REMOVE_jvmti += -Wwrite-strings + +CFLAGS_libstring.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" + +$(OUTPUT)jvmti/libstring.o: ../lib/string.c FORCE + $(call rule_mkdir) + $(call if_changed_dep,cc_o_c)
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 6/31 perf tools: Add PMU event JSON files for ARM Cortex-A76 and, Neoverse N1.
In reply to Arnaldo Carvalho de MeloFrom: James Clark <[email protected]>
The source of the event codes and description text was the Neoverse N1 technical reference manual at:
The Cortex-A76 shares the same event IDs as the Neoverse N1 and they can be viewed at:
https://static.docs.arm.com/100798/0400/cortex_a76_trm_100798_0400_00_en.pdf
--- .../arch/arm64/arm/cortex-a76-n1/branch.json | 14 ++ .../arch/arm64/arm/cortex-a76-n1/bus.json | 24 ++ .../arch/arm64/arm/cortex-a76-n1/cache.json | 207 ++++++++++++++++++ .../arm64/arm/cortex-a76-n1/exception.json | 52 +++++ .../arm64/arm/cortex-a76-n1/instruction.json | 108 +++++++++ .../arch/arm64/arm/cortex-a76-n1/memory.json | 23 ++ .../arch/arm64/arm/cortex-a76-n1/other.json | 7 + .../arm64/arm/cortex-a76-n1/pipeline.json | 14 ++ tools/perf/pmu-events/arch/arm64/mapfile.csv | 2 + 9 files changed, 451 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/exception.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/instruction.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/memory.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/other.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/pipeline.json
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json new file +14 -0
@@ -0,0 +1,14 @@ +[ + { + "PublicDescription": "Mispredicted or not predicted branch speculatively executed. This event counts any predictable branch instruction which is mispredicted either due to dynamic misprediction or because the MMU is off and the branches are statically predicted not taken.", + "EventCode": "0x10", + "EventName": "BR_MIS_PRED", + "BriefDescription": "Mispredicted or not predicted branch speculatively executed." + }, + { + "PublicDescription": "Predictable branch speculatively executed. This event counts all predictable branches.", + "EventCode": "0x12", + "EventName": "BR_PRED", + "BriefDescription": "Predictable branch speculatively executed." + } +]
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json new file +24 -0
@@ -0,0 +1,24 @@ +[ + { + "EventCode": "0x11", + "EventName": "CPU_CYCLES", + "BriefDescription": "The number of core clock cycles." + }, + { + "PublicDescription": "Bus access. This event counts for every beat of data transferred over the data channels between the core and the SCU. If both read and write data beats are transferred on a given cycle, this event is counted twice on that cycle. This event counts the sum of BUS_ACCESS_RD and BUS_ACCESS_WR.", + "EventCode": "0x19", + "EventName": "BUS_ACCESS", + "BriefDescription": "Bus access." + }, + { + "EventCode": "0x1D", + "EventName": "BUS_CYCLES", + "BriefDescription": "Bus cycles. This event duplicates CPU_CYCLES." + }, + { + "ArchStdEvent": "BUS_ACCESS_RD" + }, + { + "ArchStdEvent": "BUS_ACCESS_WR" + } +]
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json new file +207 -0
207 lines not on this page · raw message
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/exception.json new file +52 -0
52 lines not on this page · raw message
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/instruction.json new file +108 -0
108 lines not on this page · raw message
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/memory.json new file +23 -0
@@ -0,0 +1,23 @@ +[ + { + "PublicDescription": "Data memory access. This event counts memory accesses due to load or store instructions. This event counts the sum of MEM_ACCESS_RD and MEM_ACCESS_WR.", + "EventCode": "0x13", + "EventName": "MEM_ACCESS", + "BriefDescription": "Data memory access" + }, + { + "ArchStdEvent": "MEM_ACCESS_RD" + }, + { + "ArchStdEvent": "MEM_ACCESS_WR" + }, + { + "ArchStdEvent": "UNALIGNED_LD_SPEC" + }, + { + "ArchStdEvent": "UNALIGNED_ST_SPEC" + }, + { + "ArchStdEvent": "UNALIGNED_LDST_SPEC" + } +]
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/other.json new file +7 -0
@@ -0,0 +1,7 @@ +[ + { + "EventCode": "0x31", + "EventName": "REMOTE_ACCESS", + "BriefDescription": "Access to another socket in a multi-socket system" + } +]
tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/pipeline.json new file +14 -0
@@ -0,0 +1,14 @@ +[ + { + "PublicDescription": "No operation issued because of the frontend. The counter counts on any cycle when there are no fetched instructions available to dispatch.", + "EventCode": "0x23", + "EventName": "STALL_FRONTEND", + "BriefDescription": "No operation issued because of the frontend." + }, + { + "PublicDescription": "No operation issued because of the backend. The counter counts on any cycle fetched instructions are not dispatched due to resource constraints.", + "EventCode": "0x24", + "EventName": "STALL_BACKEND", + "BriefDescription": "No operation issued because of the backend." + } +]
tools/perf/pmu-events/arch/arm64/mapfile.csv +2 -0
@@ -16,6 +16,8 @@ 0x00000000420f1000,v1,arm/cortex-a53,core 0x00000000410fd070,v1,arm/cortex-a57-a72,core 0x00000000410fd080,v1,arm/cortex-a57-a72,core +0x00000000410fd0b0,v1,arm/cortex-a76-n1,core +0x00000000410fd0c0,v1,arm/cortex-a76-n1,core 0x00000000420f5160,v1,cavium/thunderx2,core 0x00000000430f0af0,v1,cavium/thunderx2,core 0x00000000480fd010,v1,hisilicon/hip08,core
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 7/31 perf tools: Remove needless builtin.h include directives
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Now that builtin.h isn't included by any other header, we can check where it is really needed, i.e. we can remove it and be sure that it isn't being obtained indirectly.
--- tools/perf/bench/numa.c | 1 - tools/perf/bench/sched-messaging.c | 1 - tools/perf/bench/sched-pipe.c | 1 - tools/perf/util/jitdump.c | 1 - 4 files changed, 4 deletions(-)
tools/perf/bench/numa.c +0 -1
@@ -9,7 +9,6 @@/* For the CLR_() macros */ #include <pthread.h> -#include "../builtin.h" #include <subcmd/parse-options.h> #include "../util/cloexec.h"
tools/perf/bench/sched-messaging.c +0 -1
@@ -12,7 +12,6 @@#include "../util/util.h" #include <subcmd/parse-options.h> -#include "../builtin.h" #include "bench.h" /* Test groups of 20 processes spraying to 20 receivers */
tools/perf/bench/sched-pipe.c +0 -1
@@ -11,7 +11,6 @@*/ #include "../util/util.h" #include <subcmd/parse-options.h> -#include "../builtin.h" #include "bench.h" #include <unistd.h>
tools/perf/util/jitdump.c +0 -1
@@ -27,7 +27,6 @@#include "jit.h" #include "jitdump.h" #include "genelf.h" -#include "../builtin.h" #include <linux/ctype.h> #include <linux/zalloc.h>
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 8/31 perf debug: No need to include ui/util.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Nothing from that file is used in util/debug.h, it is only needed in some places that get it indirectly via including util/debug.h, remove that entanglement.
--- tools/perf/ui/browsers/scripts.c | 1 + tools/perf/ui/gtk/setup.c | 3 ++- tools/perf/util/debug.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/ui/browsers/scripts.c +1 -0
@@ -2,6 +2,7 @@#include "../../builtin.h" #include "../../perf.h" #include "../../util/util.h" +#include "../util.h" #include "../../util/hist.h" #include "../../util/debug.h" #include "../../util/symbol.h"
tools/perf/ui/gtk/setup.c +2 -1
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include "gtk.h" -#include "../../util/debug.h" +#include <linux/compiler.h> +#include "../util.h" extern struct perf_error_ops perf_gtk_eops;
tools/perf/util/debug.h +1 -1
@@ -3,9 +3,9 @@#ifndef __PERF_DEBUG_H#define __PERF_DEBUG_H +#include <stdarg.h> #include <stdbool.h> #include <linux/compiler.h> -#include "../ui/util.h" extern int verbose;extern bool quiet, dump_trace;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 9/31 perf tools: Remove debug.h from places where it is not needed
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Pruning a bit more the includes dependency tree. Building this thing on lots of containers takes time, we better reduce the time per build, each container is doing 6 builds when clang and clang-devel are available, and the plan is to do a 'make -C tools/perf build-test' that have many more.
Also helps when doing normal development, as touching some random file will have a much reduced chance of triggering lots of rebuilds.
--- tools/perf/arch/arm64/util/unwind-libunwind.c | 2 +- tools/perf/arch/powerpc/util/sym-handling.c | 1 - tools/perf/tests/clang.c | 1 - tools/perf/ui/browsers/header.c | 1 - tools/perf/ui/gtk/helpline.c | 1 - tools/perf/ui/gtk/util.c | 1 - tools/perf/ui/helpline.c | 1 - tools/perf/ui/tui/helpline.c | 1 - tools/perf/ui/tui/util.c | 1 - tools/perf/util/branch.c | 1 - tools/perf/util/demangle-java.c | 1 - tools/perf/util/libunwind/arm64.c | 1 - tools/perf/util/libunwind/x86_32.c | 1 - tools/perf/util/target.c | 1 - tools/perf/util/usage.c | 1 - tools/perf/util/zlib.c | 2 -- 16 files changed, 1 insertion(+), 17 deletions(-)
tools/perf/arch/arm64/util/unwind-libunwind.c +1 -1
@@ -5,8 +5,8 @@#include <libunwind.h> #include "perf_regs.h" #include "../../util/unwind.h" -#include "../../util/debug.h" #endif +#include "../../util/debug.h" int LIBUNWIND__ARCH_REG_ID (int regnum) {
tools/perf/arch/powerpc/util/sym-handling.c +0 -1
@@ -4,7 +4,6 @@* Copyright (C) 2015 Naveen N. Rao, IBM Corporation */ -#include "debug.h" #include "dso.h" #include "symbol.h" #include "map.h"
tools/perf/tests/clang.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 #include "tests.h" -#include "debug.h" #include "util.h" #include "c++/clang-c.h" #include <linux/kernel.h>
tools/perf/ui/browsers/header.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#include "util/debug.h" #include "ui/browser.h" #include "ui/keysyms.h" #include "ui/ui.h"
tools/perf/ui/gtk/helpline.c +0 -1
@@ -6,7 +6,6 @@#include "gtk.h" #include "../ui.h" #include "../helpline.h" -#include "../../util/debug.h" static void gtk_helpline_pop (void ) {
tools/perf/ui/gtk/util.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 #include "../util.h" -#include "../../util/debug.h" #include "gtk.h" #include <stdlib.h>
tools/perf/ui/helpline.c +0 -1
@@ -3,7 +3,6 @@#include <stdlib.h> #include <string.h> -#include "../util/debug.h" #include "helpline.h" #include "ui.h" #include "../util/util.h"
tools/perf/ui/tui/helpline.c +0 -1
@@ -6,7 +6,6 @@#include <linux/kernel.h> #include <linux/string.h> -#include "../../util/debug.h" #include "../helpline.h" #include "../ui.h" #include "../libslang.h"
tools/perf/ui/tui/util.c +0 -1
@@ -5,7 +5,6 @@#include <stdlib.h> #include <sys/ttydefaults.h> -#include "../../util/debug.h" #include "../browser.h" #include "../keysyms.h" #include "../helpline.h"
tools/perf/util/branch.c +0 -1
@@ -1,5 +1,4 @@#include "util/util.h" -#include "util/debug.h" #include "util/map_symbol.h" #include "util/branch.h" #include <linux/kernel.h>
tools/perf/util/demangle-java.c +0 -1
@@ -3,7 +3,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include "debug.h" #include "symbol.h" #include "demangle-java.h"
tools/perf/util/libunwind/arm64.c +0 -1
@@ -22,7 +22,6 @@#define LIBUNWIND__ARCH_REG_SP PERF_REG_ARM64_SP#include "unwind.h" -#include "debug.h" #include "libunwind-aarch64.h" #include <../../../../arch/arm64/include/uapi/asm/perf_regs.h> #include "../../arch/arm64/util/unwind-libunwind.c"
tools/perf/util/libunwind/x86_32.c +0 -1
@@ -22,7 +22,6 @@#define LIBUNWIND__ARCH_REG_SP PERF_REG_X86_SP#include "unwind.h" -#include "debug.h" #include "libunwind-x86.h" #include <../../../../arch/x86/include/uapi/asm/perf_regs.h>
tools/perf/util/target.c +0 -1
@@ -7,7 +7,6 @@#include "target.h" #include "util.h" -#include "debug.h" #include <pwd.h> #include <stdio.h>
tools/perf/util/usage.c +0 -1
@@ -8,7 +8,6 @@* Copyright (C) Linus Torvalds, 2005 */ #include "util.h" -#include "debug.h" #include <stdio.h> #include <stdlib.h> #include <linux/compiler.h>
tools/perf/util/zlib.c +0 -2
@@ -10,8 +10,6 @@#include "util/compress.h" #include "util/util.h" -#include "util/debug.h" -#define CHUNK_SIZE 16384
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 10/31 perf tools: Remove util.h from where it is not needed
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Check that it is not needed and remove, fixing up some fallout for places where it was only serving to get something else.
--- tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 2 +- tools/perf/arch/arm64/util/dwarf-regs.c | 1 - tools/perf/arch/powerpc/util/dwarf-regs.c | 1 - tools/perf/arch/powerpc/util/header.c | 1 - tools/perf/arch/s390/util/machine.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 1 - tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/arch/x86/util/machine.c | 2 +- tools/perf/bench/sched-messaging.c | 1 - tools/perf/bench/sched-pipe.c | 1 - tools/perf/builtin-config.c | 1 - tools/perf/builtin-evlist.c | 2 -- tools/perf/builtin-report.c | 2 +- tools/perf/perf.c | 2 +- tools/perf/tests/clang.c | 1 - tools/perf/tests/dso-data.c | 1 - tools/perf/tests/event-times.c | 1 - tools/perf/tests/llvm.c | 1 - tools/perf/tests/mmap-thread-lookup.c | 2 +- tools/perf/tests/parse-events.c | 1 - tools/perf/tests/parse-no-sample-id-all.c | 2 -- tools/perf/tests/perf-hooks.c | 1 - tools/perf/tests/pmu.c | 1 - tools/perf/tests/sample-parsing.c | 1 - tools/perf/tests/topology.c | 1 - tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/ui/browser.c | 1 - tools/perf/ui/browsers/annotate.c | 1 - tools/perf/ui/browsers/map.c | 1 - tools/perf/ui/browsers/res_sample.c | 2 +- tools/perf/ui/browsers/scripts.c | 2 +- tools/perf/ui/gtk/progress.c | 1 - tools/perf/ui/helpline.c | 1 - tools/perf/ui/hist.c | 1 - tools/perf/ui/setup.c | 2 +- tools/perf/ui/tui/setup.c | 2 +- tools/perf/util/annotate.c | 2 +- tools/perf/util/auxtrace.c | 4 +++- tools/perf/util/branch.c | 1 - tools/perf/util/branch.h | 9 ++++++++- tools/perf/util/build-id.c | 2 +- tools/perf/util/cloexec.c | 2 +- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 - tools/perf/util/cs-etm.c | 1 - tools/perf/util/data.c | 3 ++- tools/perf/util/debug.c | 1 - tools/perf/util/demangle-rust.c | 1 - tools/perf/util/dwarf-regs.c | 1 - tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 1 + tools/perf/util/header.c | 3 ++- tools/perf/util/jitdump.c | 1 - tools/perf/util/llvm-utils.c | 1 + tools/perf/util/lzma.c | 2 +- tools/perf/util/perf-hooks.c | 1 - tools/perf/util/record.c | 1 - tools/perf/util/rwsem.c | 1 + tools/perf/util/s390-sample-raw.c | 1 - tools/perf/util/scripting-engines/trace-event-python.c | 1 - tools/perf/util/session.c | 1 + tools/perf/util/srccode.c | 2 +- tools/perf/util/symbol-elf.c | 2 ++ tools/perf/util/symbol-minimal.c | 3 +-- tools/perf/util/symbol.c | 2 +- tools/perf/util/target.c | 1 - tools/perf/util/trace-event-info.c | 2 +- tools/perf/util/trace-event-read.c | 1 - tools/perf/util/trace-event.c | 1 - tools/perf/util/unwind-libdw.c | 1 - tools/perf/util/unwind-libunwind-local.c | 1 - tools/perf/util/vdso.c | 2 +- tools/perf/util/zlib.c | 2 +- 75 files changed, 47 insertions(+), 73 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +1 -1
@@ -25,7 +25,7 @@#include "../../util/evsel.h" #include "../../util/pmu.h" #include "../../util/cs-etm.h" -#include "../../util/util.h" +#include "../../util/util.h" // page_size #include "../../util/session.h" #include <errno.h>
tools/perf/arch/arm64/util/arm-spe.c +1 -1
@@ -16,7 +16,7 @@#include "../../util/evsel.h" #include "../../util/evlist.h" #include "../../util/session.h" -#include "../../util/util.h" +#include "../../util/util.h" // page_size #include "../../util/pmu.h" #include "../../util/debug.h" #include "../../util/auxtrace.h"
tools/perf/arch/arm64/util/dwarf-regs.c +0 -1
@@ -11,7 +11,6 @@#include <dwarf-regs.h> #include <linux/ptrace.h> /* for struct user_pt_regs */ #include <linux/stringify.h> -#include "util.h" struct pt_regs_dwarfnum {const char *name;
tools/perf/arch/powerpc/util/dwarf-regs.c +0 -1
@@ -12,7 +12,6 @@#include <linux/ptrace.h> #include <linux/kernel.h> #include <linux/stringify.h> -#include "util.h" struct pt_regs_dwarfnum {const char *name;
tools/perf/arch/powerpc/util/header.c +0 -1
@@ -6,7 +6,6 @@#include <string.h> #include <linux/stringify.h> #include "header.h" -#include "util.h" #define mfspr (rn) ({unsigned long rval; \ asm volatile("mfspr %0," __stringify(rn) \
tools/perf/arch/s390/util/machine.c +1 -1
@@ -2,7 +2,7 @@#include <unistd.h> #include <stdio.h> #include <string.h> -#include "util.h" +#include "util.h" // page_size #include "machine.h" #include "api/fs/fs.h" #include "debug.h"
tools/perf/arch/x86/tests/intel-cqm.c +0 -1
@@ -5,7 +5,6 @@#include "evlist.h" #include "evsel.h" #include "arch-tests.h" -#include "util.h" #include <signal.h> #include <sys/mman.h>
tools/perf/arch/x86/tests/rdpmc.c +1 -1
@@ -13,7 +13,7 @@#include "tests/tests.h" #include "cloexec.h" #include "event.h" -#include "util.h" +#include "util.h" // page_size #include "arch-tests.h" static u64 rdpmc (unsigned int counter)
tools/perf/arch/x86/util/intel-bts.c +1 -1
@@ -22,7 +22,7 @@#include "../../util/tsc.h" #include "../../util/auxtrace.h" #include "../../util/intel-bts.h" -#include "../../util/util.h" +#include "../../util/util.h" // page_size #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
tools/perf/arch/x86/util/intel-pt.c +1 -1
@@ -26,7 +26,7 @@#include "../../util/record.h" #include "../../util/target.h" #include "../../util/tsc.h" -#include "../../util/util.h" +#include "../../util/util.h" // page_size #include "../../util/intel-pt.h" #define KiB (x) ((x) * 1024)
tools/perf/arch/x86/util/machine.c +1 -1
@@ -3,7 +3,7 @@#include <linux/string.h> #include <stdlib.h> -#include "../../util/util.h" +#include "../../util/util.h" // page_size #include "../../util/machine.h" #include "../../util/map.h" #include "../../util/symbol.h"
tools/perf/bench/sched-messaging.c +0 -1
@@ -10,7 +10,6 @@* */ -#include "../util/util.h" #include <subcmd/parse-options.h> #include "bench.h"
tools/perf/bench/sched-pipe.c +0 -1
@@ -9,7 +9,6 @@* http://people.redhat.com/mingo/cfs-scheduler/tools/pipe-test-1m.c * Ported to perf by Hitoshi Mitake <[email protected]> */ -#include "../util/util.h" #include <subcmd/parse-options.h> #include "bench.h"
tools/perf/builtin-config.c +0 -1
@@ -9,7 +9,6 @@#include "util/cache.h" #include <subcmd/parse-options.h> -#include "util/util.h" #include "util/debug.h" #include "util/config.h" #include <linux/string.h>
tools/perf/builtin-evlist.c +0 -2
@@ -5,8 +5,6 @@*/ #include "builtin.h" -#include "util/util.h" -#include <linux/list.h> #include "perf.h"
tools/perf/builtin-report.c +1 -1
@@ -48,7 +48,7 @@#include "util/auxtrace.h" #include "util/units.h" #include "util/branch.h" -#include "util/util.h" +#include "util/util.h" // perf_tip() #include "ui/ui.h" #include "ui/progress.h"
tools/perf/perf.c +1 -1
@@ -20,7 +20,7 @@#include "util/bpf-loader.h" #include "util/debug.h" #include "util/event.h" -#include "util/util.h" +#include "util/util.h" // page_size, usage() #include "ui/ui.h" #include "perf-sys.h" #include <api/fs/fs.h>
tools/perf/tests/clang.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 #include "tests.h" -#include "util.h" #include "c++/clang-c.h" #include <linux/kernel.h>
tools/perf/tests/dso-data.c +0 -1
@@ -10,7 +10,6 @@#include <sys/resource.h> #include <api/fs/fs.h> #include "dso.h" -#include "util.h" #include "machine.h" #include "symbol.h" #include "tests.h"
tools/perf/tests/event-times.c +0 -1
@@ -9,7 +9,6 @@#include "tests.h" #include "evlist.h" #include "evsel.h" -#include "util.h" #include "debug.h" #include "parse-events.h" #include "thread_map.h"
tools/perf/tests/llvm.c +0 -1
@@ -7,7 +7,6 @@#include "llvm.h" #include "tests.h" #include "debug.h" -#include "util.h" #ifdef HAVE_LIBBPF_SUPPORT static int test__bpf_parsing (void *obj_buf,size_t obj_buf_sz)
tools/perf/tests/mmap-thread-lookup.c +1 -1
@@ -14,7 +14,7 @@#include "map.h" #include "symbol.h" #include "thread.h" -#include "util.h" +#include "util.h" // page_size #define THREADS 4
tools/perf/tests/parse-events.c +0 -1
@@ -6,7 +6,6 @@#include "tests.h" #include "debug.h" #include "pmu.h" -#include "util.h" #include <dirent.h> #include <errno.h> #include <sys/types.h>
tools/perf/tests/parse-no-sample-id-all.c +0 -2
@@ -1,4 +1,3 @@ -// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> #include <linux/types.h> #include <stddef.h>
@@ -8,7 +7,6 @@#include "event.h" #include "evlist.h" #include "header.h" -#include "util.h" #include "debug.h" static int process_event (struct evlist **pevlist,union perf_event *event)
tools/perf/tests/perf-hooks.c +0 -1
@@ -4,7 +4,6 @@#include "tests.h" #include "debug.h" -#include "util.h" #include "perf-hooks.h" static void sigsegv_handler (int sig__maybe_unused )
tools/perf/tests/pmu.c +0 -1
@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include "parse-events.h" #include "pmu.h" -#include "util.h" #include "tests.h" #include <errno.h> #include <stdio.h>
tools/perf/tests/sample-parsing.c +0 -1
@@ -9,7 +9,6 @@#include "map_symbol.h" #include "branch.h" -#include "util.h" #include "event.h" #include "evsel.h" #include "debug.h"
tools/perf/tests/topology.c +0 -1
@@ -4,7 +4,6 @@#include <stdio.h> #include <perf/cpumap.h> #include "tests.h" -#include "util.h" #include "session.h" #include "evlist.h" #include "debug.h"
tools/perf/tests/vmlinux-kallsyms.c +1 -1
@@ -7,7 +7,7 @@#include "dso.h" #include "map.h" #include "symbol.h" -#include "util.h" +#include "util.h" // page_size #include "tests.h" #include "debug.h" #include "machine.h"
tools/perf/ui/browser.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#include "../util/util.h" #include "../util/string2.h" #include "../util/config.h" #include "libslang.h"
tools/perf/ui/browsers/annotate.c +0 -1
@@ -2,7 +2,6 @@#include "../browser.h" #include "../helpline.h" #include "../ui.h" -#include "../util.h" #include "../../util/annotate.h" #include "../../util/debug.h" #include "../../util/dso.h"
tools/perf/ui/browsers/map.c +0 -1
@@ -5,7 +5,6 @@#include <stdlib.h> #include <string.h> #include <linux/bitops.h> -#include "../../util/util.h" #include "../../util/debug.h" #include "../../util/map.h" #include "../../util/dso.h"
tools/perf/ui/browsers/res_sample.c +1 -1
@@ -7,7 +7,7 @@#include "config.h" #include "time-utils.h" #include "../util.h" -#include "../../util/util.h" +#include "../../util/util.h" // perf_exe() #include "../../perf.h" #include <stdlib.h> #include <string.h>
tools/perf/ui/browsers/scripts.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include "../../builtin.h" #include "../../perf.h" -#include "../../util/util.h" +#include "../../util/util.h" // perf_exe() #include "../util.h" #include "../../util/hist.h" #include "../../util/debug.h"
tools/perf/ui/gtk/progress.c +0 -1
@@ -3,7 +3,6 @@#include "gtk.h" #include "../progress.h" -#include "util.h" static GtkWidget *dialog;static GtkWidget *progress;
tools/perf/ui/helpline.c +0 -1
@@ -5,7 +5,6 @@#include "helpline.h" #include "ui.h" -#include "../util/util.h" char ui_helpline__current[512 ];
tools/perf/ui/hist.c +0 -1
@@ -8,7 +8,6 @@#include "../util/callchain.h" #include "../util/debug.h" #include "../util/hist.h" -#include "../util/util.h" #include "../util/sort.h" #include "../util/evsel.h" #include "../util/evlist.h"
tools/perf/ui/setup.c +1 -1
@@ -1,11 +1,11 @@// SPDX-License-Identifier: GPL-2.0 #include <pthread.h> #include <dlfcn.h> +#include <unistd.h> #include <subcmd/pager.h> #include "../util/debug.h" #include "../util/hist.h" -#include "../util/util.h" #include "ui.h" pthread_mutex_t ui__lock =PTHREAD_MUTEX_INITIALIZER ;
tools/perf/ui/tui/setup.c +1 -1
@@ -2,13 +2,13 @@#include <signal.h> #include <stdbool.h> #include <stdlib.h> +#include <unistd.h> #include <linux/kernel.h> #ifdef HAVE_BACKTRACE_SUPPORT #include <execinfo.h> #endif #include "../../util/debug.h" -#include "../../util/util.h" #include "../../perf.h" #include "../browser.h" #include "../helpline.h"
tools/perf/util/annotate.c +1 -1
@@ -14,7 +14,7 @@#include <bpf/btf.h> #include <bpf/libbpf.h> #include <linux/btf.h> -#include "util.h" +#include "util.h" // hex_width() #include "ui/ui.h" #include "sort.h" #include "build-id.h"
tools/perf/util/auxtrace.c +3 -1
@@ -50,10 +50,12 @@#include "intel-bts.h" #include "arm-spe.h" #include "s390-cpumsf.h" -#include "util.h" +#include "util.h" // page_size #include <linux/ctype.h> +#include <linux/kernel.h> #include "symbol/kallsyms.h" +#include <internal/lib.h> static bool auxtrace__dont_decode (struct perf_session *session) {
tools/perf/util/branch.c +0 -1
@@ -1,4 +1,3 @@ -#include "util/util.h" #include "util/map_symbol.h" #include "util/branch.h" #include <linux/kernel.h>
tools/perf/util/branch.h +8 -1
@@ -1,8 +1,15 @@#ifndef _PERF_BRANCH_H#define _PERF_BRANCH_H 1 - +/* +* The linux/stddef.h isn't need here, but is needed for __always_inline used +* in files included from uapi/linux/perf_event.h such as +* /usr/include/linux/swab.h and /usr/include/linux/byteorder/little_endian.h, +* detected in at least musl libc, used in Alpine Linux. -acme +*/ #include <stdio.h> #include <stdint.h> +#include <linux/compiler.h> +#include <linux/stddef.h> #include <linux/perf_event.h> #include <linux/types.h>
tools/perf/util/build-id.c +1 -1
@@ -7,7 +7,7 @@* Copyright (C) 2009, 2010 Red Hat Inc. * Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <[email protected]> */ -#include "util.h" +#include "util.h" // copyfile_ns(), lsdir(), mkdir_p(), rm_rf() #include <dirent.h> #include <errno.h> #include <stdio.h>
tools/perf/util/cloexec.c +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <sched.h> -#include "util.h" +#include "util.h" // for sched_getcpu() #include "../perf-sys.h" #include "cloexec.h" #include "event.h"
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +0 -1
@@ -17,7 +17,6 @@#include "cs-etm.h" #include "cs-etm-decoder.h" #include "intlist.h" -#include "util.h" /* use raw logging */ #ifdef CS_DEBUG_RAW
tools/perf/util/cs-etm.c +0 -1
@@ -35,7 +35,6 @@#include "thread.h" #include "thread-stack.h" #include <tools/libc_compat.h> -#include "util.h" #define MAX_TIMESTAMP (~0ULL)
tools/perf/util/data.c +2 -1
@@ -13,9 +13,10 @@#include <dirent.h> #include "data.h" -#include "util.h" +#include "util.h" // rm_rf_perf_data() #include "debug.h" #include "header.h" +#include <internal/lib.h> static void close_dir (struct perf_data_file *files,int nr) {
tools/perf/util/debug.c +0 -1
@@ -17,7 +17,6 @@#include "event.h" #include "debug.h" #include "print_binary.h" -#include "util.h" #include "target.h" #include "ui/helpline.h" #include "ui/ui.h"
tools/perf/util/demangle-rust.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 #include <string.h> -#include "util.h" #include "debug.h" #include "demangle-rust.h"
tools/perf/util/dwarf-regs.c +0 -1
@@ -5,7 +5,6 @@* Written by: Masami Hiramatsu <[email protected]> */ -#include <util.h> #include <debug.h> #include <dwarf-regs.h> #include <elf.h>
tools/perf/util/evlist.c +1 -1
@@ -16,7 +16,7 @@#include "evsel.h" #include "debug.h" #include "units.h" -#include "util.h" +#include "util.h" // page_size #include "../perf.h" #include "asm/bug.h" #include "bpf-event.h"
tools/perf/util/evsel.c +1 -0
@@ -45,6 +45,7 @@#include "../perf-sys.h" #include "util/parse-branch-options.h" #include <internal/xyarray.h> +#include <internal/lib.h> #include <linux/ctype.h>
tools/perf/util/header.c +2 -1
@@ -42,11 +42,12 @@#include "tool.h" #include "time-utils.h" #include "units.h" -#include "util.h" +#include "util.h" // page_size, perf_exe() #include "cputopo.h" #include "bpf-event.h" #include <linux/ctype.h> +#include <internal/lib.h> /* * magic2 = "PERFILE2"
tools/perf/util/jitdump.c +0 -1
@@ -15,7 +15,6 @@#include <linux/stringify.h> #include "build-id.h" -#include "util.h" #include "event.h" #include "debug.h" #include "evlist.h"
tools/perf/util/llvm-utils.c +1 -0
@@ -8,6 +8,7 @@#include <limits.h> #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <linux/err.h> #include <linux/string.h> #include <linux/zalloc.h>
tools/perf/util/lzma.c +1 -1
@@ -7,10 +7,10 @@#include <sys/stat.h> #include <fcntl.h> #include "compress.h" -#include "util.h" #include "debug.h" #include <string.h> #include <unistd.h> +#include <internal/lib.h> #define BUFSIZE 8192
tools/perf/util/perf-hooks.c +0 -1
@@ -12,7 +12,6 @@#include <setjmp.h> #include <linux/err.h> #include <linux/kernel.h> -#include "util/util.h" #include "util/debug.h" #include "util/perf-hooks.h"
tools/perf/util/record.c +0 -1
@@ -10,7 +10,6 @@#include <api/fs/fs.h> #include <subcmd/parse-options.h> #include <perf/cpumap.h> -#include "util.h" #include "cloexec.h" #include "record.h" #include "../perf-sys.h"
tools/perf/util/rwsem.c +1 -0
@@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "util.h" #include "rwsem.h"
tools/perf/util/s390-sample-raw.c +0 -1
@@ -22,7 +22,6 @@#include <asm/byteorder.h> #include "debug.h" -#include "util.h" #include "session.h" #include "evlist.h" #include "color.h"
tools/perf/util/scripting-engines/trace-event-python.c +0 -1
@@ -37,7 +37,6 @@#include "../dso.h" #include "../callchain.h" #include "../evsel.h" -#include "../util.h" #include "../event.h" #include "../thread.h" #include "../comm.h"
tools/perf/util/session.c +1 -0
@@ -34,6 +34,7 @@#include "ui/progress.h" #include "../perf.h" #include "arch/common.h" +#include <internal/lib.h> #ifdef HAVE_ZSTD_SUPPORT static int perf_session__process_compressed_event(struct perf_session *session,
tools/perf/util/srccode.c +1 -1
@@ -15,7 +15,7 @@#include <string.h> #include "srccode.h" #include "debug.h" -#include "util.h" +#include "util.h" // page_size #define MAXSRCCACHE (32*1024*1024)#define MAXSRCFILES 64
tools/perf/util/symbol-elf.c +2 -0
@@ -18,8 +18,10 @@#include "debug.h" #include "util.h" #include <linux/ctype.h> +#include <linux/kernel.h> #include <linux/zalloc.h> #include <symbol/kallsyms.h> +#include <internal/lib.h> #ifndef EM_AARCH64 #define EM_AARCH64 183/* ARM 64 bit */
tools/perf/util/symbol-minimal.c +1 -2
@@ -1,8 +1,6 @@ -// SPDX-License-Identifier: GPL-2.0 #include "dso.h" #include "symbol.h" #include "symsrc.h" -#include "util.h" #include <errno.h> #include <unistd.h>
@@ -13,6 +11,7 @@#include <byteswap.h> #include <sys/stat.h> #include <linux/zalloc.h> +#include <internal/lib.h> static bool check_need_swap (int file_endian) {
tools/perf/util/symbol.c +1 -1
@@ -19,7 +19,7 @@#include "build-id.h" #include "cap.h" #include "dso.h" -#include "util.h" +#include "util.h" // lsdir() #include "debug.h" #include "event.h" #include "machine.h"
tools/perf/util/target.c +0 -1
@@ -6,7 +6,6 @@*/ #include "target.h" -#include "util.h" #include <pwd.h> #include <stdio.h>
tools/perf/util/trace-event-info.c +1 -1
@@ -2,7 +2,7 @@/* * Copyright (C) 2008,2009, Steven Rostedt <[email protected]> */ -#include "util.h" +#include "util.h" // page_size #include <dirent.h> #include <mntent.h> #include <stdio.h>
tools/perf/util/trace-event-read.c +0 -1
@@ -15,7 +15,6 @@#include <unistd.h> #include <errno.h> -#include "util.h" #include "trace-event.h" #include "debug.h"
tools/perf/util/trace-event.c +0 -1
@@ -14,7 +14,6 @@#include <api/fs/fs.h> #include "trace-event.h" #include "machine.h" -#include "util.h" /* * global trace_event object used by trace_event__tp_format
tools/perf/util/unwind-libdw.c +0 -1
@@ -17,7 +17,6 @@#include "event.h" #include "perf_regs.h" #include "callchain.h" -#include "util.h" static char *debuginfo_path;
tools/perf/util/unwind-libunwind-local.c +0 -1
@@ -37,7 +37,6 @@#include "unwind.h" #include "map.h" #include "symbol.h" -#include "util.h" #include "debug.h" #include "asm/bug.h" #include "dso.h"
tools/perf/util/vdso.c +1 -1
@@ -11,7 +11,7 @@#include "vdso.h" #include "dso.h" -#include "util.h" +#include <internal/lib.h> #include "map.h" #include "symbol.h" #include "machine.h"
tools/perf/util/zlib.c +1 -1
@@ -7,9 +7,9 @@#include <sys/mman.h> #include <zlib.h> #include <linux/compiler.h> +#include <internal/lib.h> #include "util/compress.h" -#include "util/util.h" #define CHUNK_SIZE 16384
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 11/31 perf probe: Add missing build-id.h header.
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
It uses things defined in that header and was getting it only indirectly, thru dso.h, fix it.
--- tools/perf/util/probe-file.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/probe-file.c +1 -0
@@ -16,6 +16,7 @@#include "strlist.h" #include "strfilter.h" #include "debug.h" +#include "build-id.h" #include "dso.h" #include "color.h" #include "symbol.h"
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 12/31 perf symbols: Add missing dso.h header
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
This was being obtained only indirectly, by luck.
--- tools/perf/util/symbol-elf.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/symbol-elf.c +1 -0
@@ -7,6 +7,7 @@#include <unistd.h> #include <inttypes.h> +#include "dso.h" #include "map.h" #include "map_groups.h" #include "symbol.h"
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 13/31 perf env: Remove needless cpumap.h header
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Only a 'struct perf_cmp_map' forward allocation is necessary, fix the places that need the header but were getting it indirectly, by luck, from env.h.
--- tools/perf/arch/arm64/util/header.c | 4 +++- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 1 - tools/perf/bench/epoll-ctl.c | 2 +- tools/perf/bench/epoll-wait.c | 2 +- tools/perf/bench/futex-hash.c | 2 +- tools/perf/bench/futex-lock-pi.c | 2 +- tools/perf/bench/futex-requeue.c | 2 +- tools/perf/bench/futex-wake-parallel.c | 3 ++- tools/perf/bench/futex-wake.c | 2 +- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-sched.c | 2 ++ tools/perf/tests/bitmap.c | 2 +- tools/perf/tests/code-reading.c | 1 - tools/perf/tests/event_update.c | 1 + tools/perf/tests/keep-tracking.c | 3 +-- tools/perf/tests/mem2node.c | 2 +- tools/perf/tests/mmap-basic.c | 3 +-- tools/perf/tests/openat-syscall-all-cpus.c | 5 +++-- tools/perf/tests/switch-tracking.c | 1 - tools/perf/tests/task-exit.c | 2 +- tools/perf/tests/topology.c | 1 + tools/perf/util/arm-spe.c | 1 - tools/perf/util/auxtrace.c | 1 - tools/perf/util/env.h | 3 ++- tools/perf/util/event.c | 2 ++ tools/perf/util/evsel.c | 2 +- tools/perf/util/intel-bts.c | 1 - tools/perf/util/parse-events.c | 1 - tools/perf/util/pmu.c | 1 - tools/perf/util/python.c | 1 - tools/perf/util/record.c | 1 - tools/perf/util/s390-cpumsf.c | 1 - tools/perf/util/scripting-engines/trace-event-python.c | 1 - tools/perf/util/session.c | 1 - tools/perf/util/stat.c | 1 + tools/perf/util/svghelper.c | 2 +- tools/perf/util/top.c | 1 - 37 files changed, 31 insertions(+), 34 deletions(-)
tools/perf/arch/arm64/util/header.c +3 -1
@@ -1,5 +1,7 @@#include <stdio.h> #include <stdlib.h> +#include <perf/cpumap.h> +#include <internal/cpumap.h> #include <api/fs/fs.h> #include "debug.h" #include "header.h"
@@ -29,7 +31,7 @@ char *get_cpuid_str(struct perf_pmu *pmu)/* read midr from list of cpus mapped to this pmu */ cpus =perf_cpu_map__get (pmu->cpus); -for (cpu =0 ; cpu < cpus->nr; cpu++) { +for (cpu =0 ; cpu <perf_cpu_map__nr (cpus); cpu++) {scnprintf (path,PATH_MAX ,"%s/devices/system/cpu/cpu%d" MIDR , sysfs, cpus->map[cpu]);
tools/perf/arch/x86/tests/perf-time-to-tsc.c +0 -1
@@ -15,7 +15,6 @@#include "evlist.h" #include "evsel.h" #include "thread_map.h" -#include "cpumap.h" #include "record.h" #include "tsc.h" #include "tests/tests.h"
tools/perf/bench/epoll-ctl.c +1 -1
@@ -21,12 +21,12 @@#include <sys/resource.h> #include <sys/epoll.h> #include <sys/eventfd.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "../util/stat.h" #include <subcmd/parse-options.h> #include "bench.h" -#include "cpumap.h" #include <err.h>
tools/perf/bench/epoll-wait.c +1 -1
@@ -76,12 +76,12 @@#include <sys/epoll.h> #include <sys/eventfd.h> #include <sys/types.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "../util/stat.h" #include <subcmd/parse-options.h> #include "bench.h" -#include "cpumap.h" #include <err.h>
tools/perf/bench/futex-hash.c +1 -1
@@ -20,13 +20,13 @@#include <linux/kernel.h> #include <linux/zalloc.h> #include <sys/time.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "../util/stat.h" #include <subcmd/parse-options.h> #include "bench.h" #include "futex.h" -#include "cpumap.h" #include <err.h>
tools/perf/bench/futex-lock-pi.c +1 -1
@@ -14,10 +14,10 @@#include <linux/kernel.h> #include <linux/zalloc.h> #include <errno.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "bench.h" #include "futex.h" -#include "cpumap.h" #include <err.h> #include <stdlib.h>
tools/perf/bench/futex-requeue.c +1 -1
@@ -20,10 +20,10 @@#include <linux/kernel.h> #include <linux/time64.h> #include <errno.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "bench.h" #include "futex.h" -#include "cpumap.h" #include <err.h> #include <stdlib.h>
tools/perf/bench/futex-wake-parallel.c +2 -1
@@ -29,7 +29,8 @@ int bench_futex_wake_parallel(int argc __maybe_unused, const char **argv __maybe#include <linux/time64.h> #include <errno.h> #include "futex.h" -#include "cpumap.h" +#include <internal/cpumap.h> +#include <perf/cpumap.h> #include <err.h> #include <stdlib.h>
tools/perf/bench/futex-wake.c +1 -1
@@ -20,10 +20,10 @@#include <linux/kernel.h> #include <linux/time64.h> #include <errno.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "bench.h" #include "futex.h" -#include "cpumap.h" #include <err.h> #include <stdlib.h>
tools/perf/builtin-c2c.c +1 -0
@@ -20,6 +20,7 @@#include <sys/param.h> #include "debug.h" #include "builtin.h" +#include <perf/cpumap.h> #include <subcmd/pager.h> #include <subcmd/parse-options.h> #include "map_symbol.h"
tools/perf/builtin-sched.c +2 -0
@@ -3,6 +3,7 @@#include "perf.h" #include "perf-sys.h" +#include "util/cpumap.h" #include "util/evlist.h" #include "util/evsel.h" #include "util/symbol.h"
@@ -36,6 +37,7 @@#include <pthread.h> #include <math.h> #include <api/fs/fs.h> +#include <perf/cpumap.h> #include <linux/time64.h> #include <linux/ctype.h>
tools/perf/tests/bitmap.c +1 -1
@@ -2,8 +2,8 @@#include <linux/compiler.h> #include <linux/bitmap.h> #include <perf/cpumap.h> +#include <internal/cpumap.h> #include "tests.h" -#include "cpumap.h" #include "debug.h" #define NBITS 100
tools/perf/tests/code-reading.c +0 -1
@@ -19,7 +19,6 @@#include "evlist.h" #include "evsel.h" #include "thread_map.h" -#include "cpumap.h" #include "machine.h" #include "map.h" #include "symbol.h"
tools/perf/tests/event_update.c +1 -0
@@ -2,6 +2,7 @@#include <linux/compiler.h> #include <perf/cpumap.h> #include <string.h> +#include "cpumap.h" #include "evlist.h" #include "evsel.h" #include "header.h"
tools/perf/tests/keep-tracking.c +1 -2
@@ -12,7 +12,6 @@#include "evsel.h" #include "record.h" #include "thread_map.h" -#include "cpumap.h" #include "tests.h" #define CHECK__ (x) { \
@@ -143,7 +142,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un found =find_comm (evlist, comm);if (found !=1 ) { -pr_debug ("Seconf time, failed to find tracking event.\n" ); +pr_debug ("Second time, failed to find tracking event.\n" ); goto out_err; }
tools/perf/tests/mem2node.c +1 -1
@@ -4,7 +4,7 @@#include <linux/kernel.h> #include <linux/zalloc.h> #include <perf/cpumap.h> -#include "cpumap.h" +#include <internal/cpumap.h> #include "debug.h" #include "env.h" #include "mem2node.h"
tools/perf/tests/mmap-basic.c +1 -2
@@ -10,7 +10,6 @@#include "evlist.h" #include "evsel.h" #include "thread_map.h" -#include "cpumap.h" #include "tests.h" #include <linux/err.h> #include <linux/kernel.h>
@@ -53,7 +52,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse cpus =perf_cpu_map__new (NULL );if (cpus ==NULL ) { -pr_debug ("cpu_map__new\n" ); +pr_debug ("perf_cpu_map__new\n" ); goto out_free_threads; }
tools/perf/tests/openat-syscall-all-cpus.c +3 -2
@@ -14,7 +14,8 @@#include "evsel.h" #include "tests.h" #include "thread_map.h" -#include "cpumap.h" +#include <perf/cpumap.h> +#include <internal/cpumap.h> #include "debug.h" #include "stat.h" #include "util/counts.h"
@@ -37,7 +38,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int cpus =perf_cpu_map__new (NULL );if (cpus ==NULL ) { -pr_debug ("cpu_map__new\n" ); +pr_debug ("perf_cpu_map__new\n" ); goto out_thread_map_delete; }
tools/perf/tests/switch-tracking.c +0 -1
@@ -14,7 +14,6 @@#include "evlist.h" #include "evsel.h" #include "thread_map.h" -#include "cpumap.h" #include "record.h" #include "tests.h"
tools/perf/tests/task-exit.c +1 -1
@@ -4,12 +4,12 @@#include "evsel.h" #include "target.h" #include "thread_map.h" -#include "cpumap.h" #include "tests.h" #include <errno.h> #include <signal.h> #include <linux/string.h> +#include <perf/cpumap.h> #include <perf/evlist.h> static int exited;
tools/perf/tests/topology.c +1 -0
@@ -3,6 +3,7 @@#include <stdlib.h> #include <stdio.h> #include <perf/cpumap.h> +#include "cpumap.h" #include "tests.h" #include "session.h" #include "evlist.h"
tools/perf/util/arm-spe.c +0 -1
@@ -16,7 +16,6 @@#include <linux/log2.h> #include <linux/zalloc.h> -#include "cpumap.h" #include "color.h" #include "evsel.h" #include "machine.h"
tools/perf/util/auxtrace.c +0 -1
@@ -31,7 +31,6 @@#include "map.h" #include "pmu.h" #include "evsel.h" -#include "cpumap.h" #include "symbol.h" #include "thread_map.h" #include "asm/bug.h"
tools/perf/util/env.h +2 -1
@@ -4,9 +4,10 @@#include <linux/types.h> #include <linux/rbtree.h> -#include "cpumap.h" #include "rwsem.h" +struct perf_cpu_map ; +struct cpu_topology_map {int socket_id;int die_id;
tools/perf/util/event.c +2 -0
@@ -4,6 +4,7 @@#include <inttypes.h> #include <linux/kernel.h> #include <linux/types.h> +#include <perf/cpumap.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h>
@@ -11,6 +12,7 @@#include <api/fs/fs.h> #include <linux/perf_event.h> #include <linux/zalloc.h> +#include "cpumap.h" #include "dso.h" #include "event.h" #include "debug.h"
tools/perf/util/evsel.c +1 -1
@@ -31,7 +31,7 @@#include "event.h" #include "evsel.h" #include "evlist.h" -#include "cpumap.h" +#include <perf/cpumap.h> #include "thread_map.h" #include "target.h" #include "perf_regs.h"
tools/perf/util/intel-bts.c +0 -1
@@ -14,7 +14,6 @@#include <linux/log2.h> #include <linux/zalloc.h> -#include "cpumap.h" #include "color.h" #include "evsel.h" #include "evlist.h"
tools/perf/util/parse-events.c +0 -1
@@ -30,7 +30,6 @@#include "parse-events-flex.h" #include "pmu.h" #include "thread_map.h" -#include "cpumap.h" #include "probe-file.h" #include "asm/bug.h" #include "util/parse-branch-options.h"
tools/perf/util/pmu.c +0 -1
@@ -20,7 +20,6 @@#include "debug.h" #include "pmu.h" #include "parse-events.h" -#include "cpumap.h" #include "header.h" #include "pmu-events/pmu-events.h" #include "string2.h"
tools/perf/util/python.c +0 -1
@@ -11,7 +11,6 @@#include "callchain.h" #include "evsel.h" #include "event.h" -#include "cpumap.h" #include "print_binary.h" #include "thread_map.h" #include "trace-event.h"
tools/perf/util/record.c +0 -1
@@ -2,7 +2,6 @@#include "debug.h" #include "evlist.h" #include "evsel.h" -#include "cpumap.h" #include "parse-events.h" #include <errno.h> #include <limits.h>
tools/perf/util/s390-cpumsf.c +0 -1
@@ -151,7 +151,6 @@#include <sys/stat.h> #include <sys/types.h> -#include "cpumap.h" #include "color.h" #include "evsel.h" #include "evlist.h"
tools/perf/util/scripting-engines/trace-event-python.c +0 -1
@@ -48,7 +48,6 @@#include "map.h" #include "symbol.h" #include "thread_map.h" -#include "cpumap.h" #include "print_binary.h" #include "stat.h" #include "mem-events.h"
tools/perf/util/session.c +0 -1
@@ -22,7 +22,6 @@#include "symbol.h" #include "session.h" #include "tool.h" -#include "cpumap.h" #include "perf_regs.h" #include "asm/bug.h" #include "auxtrace.h"
tools/perf/util/stat.c +1 -0
@@ -4,6 +4,7 @@#include <math.h> #include <string.h> #include "counts.h" +#include "cpumap.h" #include "debug.h" #include "header.h" #include "stat.h"
tools/perf/util/svghelper.c +1 -1
@@ -17,11 +17,11 @@#include <linux/string.h> #include <linux/time64.h> #include <linux/zalloc.h> +#include <internal/cpumap.h> #include <perf/cpumap.h> #include "env.h" #include "svghelper.h" -#include "cpumap.h" static u64 first_time, last_time;static u64 turbo_frequency, max_freq;
tools/perf/util/top.c +0 -1
@@ -5,7 +5,6 @@* Refactored from builtin-top.c, see that files for further copyright notes. */ -#include "cpumap.h" #include "event.h" #include "evlist.h" #include "evsel.h"
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 14/31 perf event: Move perf_event__synthesize* to event.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Where is the perf_event__handler_t typedef they need, which was the only reason for header.h to be including event.h, untangle that.
--- tools/perf/util/event.h | 36 ++++++++++++++++++++++++++++++++++ tools/perf/util/header.h | 42 +++------------------------------------- 2 files changed, 39 insertions(+), 39 deletions(-)
tools/perf/util/event.h +36 -0
@@ -279,6 +279,9 @@ enum {void perf_event__print_totals (void ); +struct evlist ; +struct evsel ; +struct perf_session ;struct perf_tool ;struct perf_thread_map ;struct perf_cpu_map ;
@@ -290,6 +293,39 @@ typedef int (*perf_event__handler_t)(struct perf_tool *tool,struct perf_sample *sample, struct machine *machine); +int perf_event__synthesize_attr (struct perf_tool *tool, +struct perf_event_attr *attr,u32 ids,u64 *id, +perf_event__handler_t process); +int perf_event__synthesize_attrs (struct perf_tool *tool, +struct evlist *evlist, +perf_event__handler_t process); +int perf_event__synthesize_build_id (struct perf_tool *tool, +struct dso *pos,u16 misc, +perf_event__handler_t process, +struct machine *machine); +int perf_event__synthesize_extra_attr (struct perf_tool *tool, +struct evlist *evsel_list, +perf_event__handler_t process, +bool is_pipe); +int perf_event__synthesize_event_update_cpus (struct perf_tool *tool, +struct evsel *evsel, +perf_event__handler_t process); +int perf_event__synthesize_event_update_name (struct perf_tool *tool, +struct evsel *evsel, +perf_event__handler_t process); +int perf_event__synthesize_event_update_scale (struct perf_tool *tool, +struct evsel *evsel, +perf_event__handler_t process); +int perf_event__synthesize_event_update_unit (struct perf_tool *tool, +struct evsel *evsel, +perf_event__handler_t process); +int perf_event__synthesize_features (struct perf_tool *tool, +struct perf_session *session, +struct evlist *evlist, +perf_event__handler_t process); +int perf_event__synthesize_tracing_data (struct perf_tool *tool, +int fd,struct evlist *evlist, +perf_event__handler_t process); int perf_event__synthesize_thread_map(struct perf_tool *tool, struct perf_thread_map *threads, perf_event__handler_t process,
tools/perf/util/header.h +3 -39
73 lines not on this page · raw message
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 15/31 perf stat: Move perf_stat_synthesize_config() to event.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Together with the other synthsizers, and rename it to perf_event__synthesize_stat_events().
This allows us to stop including event.h in util/stat.h.
--- tools/perf/builtin-stat.c | 4 ++-- tools/perf/util/event.h | 5 +++++ tools/perf/util/stat.c | 10 +++++----- tools/perf/util/stat.h | 8 ++------ 4 files changed, 14 insertions(+), 13 deletions(-)
tools/perf/builtin-stat.c +2 -2
@@ -540,8 +540,8 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)if (err <0 )return err; - err =perf_stat_synthesize_config (&stat_config,NULL , evsel_list, - process_synthesized_event, is_pipe); + err =perf_event__synthesize_stat_events (&stat_config,NULL , evsel_list, + process_synthesized_event, is_pipe);if (err <0 )return err; }
tools/perf/util/event.h +5 -0
@@ -293,6 +293,11 @@ typedef int (*perf_event__handler_t)(struct perf_tool *tool,struct perf_sample *sample, struct machine *machine); +int perf_event__synthesize_stat_events (struct perf_stat_config *config, +struct perf_tool *tool, +struct evlist *evlist, +perf_event__handler_t process, +bool attrs);int perf_event__synthesize_attr (struct perf_tool *tool,struct perf_event_attr *attr,u32 ids,u64 *id,perf_event__handler_t process);
tools/perf/util/stat.c +5 -5
@@ -495,11 +495,11 @@ int create_perf_stat_counter(struct evsel *evsel,return perf_evsel__open_per_thread (evsel, evsel->core.threads); } -int perf_stat_synthesize_config (struct perf_stat_config *config, -struct perf_tool *tool, -struct evlist *evlist, -perf_event__handler_t process, -bool attrs) +int perf_event__synthesize_stat_events (struct perf_stat_config *config, +struct perf_tool *tool, +struct evlist *evlist, +perf_event__handler_t process, +bool attrs) {int err;
tools/perf/util/stat.h +2 -6
@@ -7,8 +7,9 @@#include <sys/types.h> #include <sys/resource.h> #include "rblist.h" -#include "event.h" +struct perf_cpu_map ; +struct perf_stat_config ;struct timespec ;struct stats {
@@ -210,11 +211,6 @@ size_t perf_event__fprintf_stat_config(union perf_event *event, FILE *fp);int create_perf_stat_counter (struct evsel *evsel,struct perf_stat_config *config,struct target *target); -int perf_stat_synthesize_config (struct perf_stat_config *config, -struct perf_tool *tool, -struct evlist *evlist, -perf_event__handler_t process, -bool attrs); void perf_evlist__print_counters(struct evlist *evlist, struct perf_stat_config *config,
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 16/31 perf callchain: Remove needless event.h include
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
All we need is a bunch of struct forward declarations and then add event.h to the only place that was getting it indirectly via callchain.h.
--- tools/perf/arch/powerpc/util/skip-callchain-idx.c | 1 + tools/perf/util/callchain.h | 5 ++++- tools/perf/util/evsel_fprintf.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
tools/perf/arch/powerpc/util/skip-callchain-idx.c +1 -0
@@ -13,6 +13,7 @@#include "util/callchain.h" #include "util/debug.h" #include "util/dso.h" +#include "util/event.h" // struct ip_callchain #include "util/map.h" #include "util/symbol.h"
tools/perf/util/callchain.h +4 -1
@@ -4,12 +4,15 @@#include <linux/list.h> #include <linux/rbtree.h> -#include "event.h" #include "map_symbol.h" #include "branch.h" +struct addr_location ;struct evsel ; +struct ip_callchain ;struct map ; +struct perf_sample ; +struct thread ;#define HELP_PAD "\t\t\t\t"
tools/perf/util/evsel_fprintf.c +1 -0
@@ -4,6 +4,7 @@#include <stdbool.h> #include <traceevent/event-parse.h> #include "evsel.h" +#include "util/event.h" #include "callchain.h" #include "map.h" #include "strlist.h"
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 17/31 perf python: Remove debug.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
We only need to have the prototype for the eprintf() replacement we use in the python binding, provide it and avoid dragging debug.h as a dependency.
--- tools/perf/util/python.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/python.c +2 -1
@@ -6,7 +6,6 @@#include <linux/err.h> #include <perf/cpumap.h> #include <traceevent/event-parse.h> -#include "debug.h" #include "evlist.h" #include "callchain.h" #include "evsel.h"
@@ -60,6 +59,8 @@ int parse_callchain_record(const char *arg __maybe_unused,*/ int verbose; +int eprintf (int level,int var,const char *fmt, ...); +int eprintf (int level,int var,const char *fmt, ...) {va_list args;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 18/31 perf hist: Add missing 'struct branch_stack' forward declaration
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Its needed, was being obtained indirectly, fix it.
--- tools/perf/util/hist.h | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/hist.h +1 -0
@@ -15,6 +15,7 @@ struct addr_location;struct map_symbol ;struct mem_info ;struct branch_info ; +struct branch_stack ;struct block_info ;struct symbol ;struct ui_progress ;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 19/31 perf annotate: Add missing machine.h include directive
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
We use what is defined there, were getting it by luck, indirectly, fix it.
--- tools/perf/builtin-annotate.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/builtin-annotate.c +1 -0
@@ -27,6 +27,7 @@#include "util/sort.h" #include "util/hist.h" #include "util/dso.h" +#include "util/machine.h" #include "util/map.h" #include "util/session.h" #include "util/tool.h"
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 20/31 perf sched: Add missing event.h include directive
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
We use what is defined there, were getting it by luck, indirectly, fix it.
--- tools/perf/builtin-sched.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/builtin-sched.c +1 -0
@@ -24,6 +24,7 @@#include "util/trace-event.h" #include "util/debug.h" +#include "util/event.h" #include <linux/kernel.h> #include <linux/log2.h>
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 21/31 perf auxtrace: Add missing 'struct perf_sample' forward declaration
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Its needed, was being obtained indirectly, fix it.
--- tools/perf/util/auxtrace.h | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/auxtrace.h +1 -0
@@ -24,6 +24,7 @@ struct perf_session;struct evlist ;struct perf_tool ;struct perf_mmap ; +struct perf_sample ;struct option ;struct record_opts ;struct perf_record_auxtrace_info ;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 22/31 perf tools: Move event synthesizing routines to separate header
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Those are the only routines using the perf_event__handler_t typedef and are all related, so move to a separate header to reduce the header dependency tree, lots of places were getting event.h and even stdio.h, limits.h indirectly, so fix those as well.
--- tools/perf/arch/x86/util/archinsn.c | 1 + tools/perf/arch/x86/util/event.c | 2 + tools/perf/arch/x86/util/machine.c | 1 + tools/perf/arch/x86/util/tsc.c | 2 + tools/perf/builtin-inject.c | 1 + tools/perf/builtin-kvm.c | 1 + tools/perf/builtin-record.c | 1 + tools/perf/builtin-stat.c | 1 + tools/perf/builtin-top.c | 1 + tools/perf/builtin-trace.c | 1 + tools/perf/tests/code-reading.c | 1 + tools/perf/tests/cpumap.c | 1 + tools/perf/tests/dwarf-unwind.c | 1 + tools/perf/tests/event_update.c | 1 + tools/perf/tests/hists_common.c | 2 + tools/perf/tests/mmap-thread-lookup.c | 2 + tools/perf/tests/sample-parsing.c | 1 + tools/perf/tests/stat.c | 1 + tools/perf/tests/thread-map.c | 1 + tools/perf/ui/stdio/hist.c | 1 + tools/perf/util/auxtrace.c | 1 + tools/perf/util/auxtrace.h | 17 +--- tools/perf/util/bpf-event.c | 1 + tools/perf/util/bpf-event.h | 15 +--- tools/perf/util/callchain.c | 1 + tools/perf/util/event.c | 1 + tools/perf/util/event.h | 118 +------------------------- tools/perf/util/evsel.c | 1 + tools/perf/util/header.c | 1 + tools/perf/util/intel-bts.c | 1 + tools/perf/util/intel-pt.c | 1 + tools/perf/util/machine.c | 10 +++ tools/perf/util/machine.h | 15 ---- tools/perf/util/session.c | 1 + tools/perf/util/session.h | 5 -- tools/perf/util/stat.c | 1 + tools/perf/util/synthetic-events.h | 103 ++++++++++++++++++++++ tools/perf/util/tsc.h | 14 +-- 38 files changed, 154 insertions(+), 177 deletions(-) create mode 100644 tools/perf/util/synthetic-events.h
tools/perf/arch/x86/util/archinsn.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include "../../../../arch/x86/include/asm/insn.h" #include "archinsn.h" +#include "event.h" #include "machine.h" #include "thread.h" #include "symbol.h"
tools/perf/arch/x86/util/event.c +2 -0
@@ -3,6 +3,8 @@#include <linux/string.h> #include <linux/zalloc.h> +#include "../../util/event.h" +#include "../../util/synthetic-events.h" #include "../../util/machine.h" #include "../../util/tool.h" #include "../../util/map.h"
tools/perf/arch/x86/util/machine.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/types.h> #include <linux/string.h> +#include <limits.h> #include <stdlib.h> #include "../../util/util.h" // page_size
tools/perf/arch/x86/util/tsc.c +2 -0
@@ -8,6 +8,8 @@#include <linux/types.h> #include <asm/barrier.h> #include "../../../util/debug.h" +#include "../../../util/event.h" +#include "../../../util/synthetic-events.h" #include "../../../util/tsc.h" int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,
tools/perf/builtin-inject.c +1 -0
@@ -21,6 +21,7 @@#include "util/auxtrace.h" #include "util/jit.h" #include "util/symbol.h" +#include "util/synthetic-events.h" #include "util/thread.h" #include <subcmd/parse-options.h>
tools/perf/builtin-kvm.c +1 -0
@@ -17,6 +17,7 @@#include "util/debug.h" #include "util/tool.h" #include "util/stat.h" +#include "util/synthetic-events.h" #include "util/top.h" #include "util/data.h" #include "util/ordered-events.h"
tools/perf/builtin-record.c +1 -0
@@ -38,6 +38,7 @@#include "util/trigger.h" #include "util/perf-hooks.h" #include "util/cpu-set-sched.h" +#include "util/synthetic-events.h" #include "util/time-utils.h" #include "util/units.h" #include "util/bpf-event.h"
tools/perf/builtin-stat.c +1 -0
@@ -61,6 +61,7 @@#include "util/tool.h" #include "util/string2.h" #include "util/metricgroup.h" +#include "util/synthetic-events.h" #include "util/target.h" #include "util/time-utils.h" #include "util/top.h"
tools/perf/builtin-top.c +1 -0
@@ -32,6 +32,7 @@#include "util/map.h" #include "util/session.h" #include "util/symbol.h" +#include "util/synthetic-events.h" #include "util/top.h" #include "util/util.h" #include <linux/rbtree.h>
tools/perf/builtin-trace.c +1 -0
@@ -28,6 +28,7 @@#include "util/dso.h" #include "util/env.h" #include "util/event.h" +#include "util/synthetic-events.h" #include "util/evlist.h" #include "util/evswitch.h" #include <subcmd/pager.h>
tools/perf/tests/code-reading.c +1 -0
@@ -24,6 +24,7 @@#include "symbol.h" #include "event.h" #include "record.h" +#include "util/synthetic-events.h" #include "thread.h" #include "tests.h"
tools/perf/tests/cpumap.c +1 -0
@@ -3,6 +3,7 @@#include <stdio.h> #include "cpumap.h" #include "event.h" +#include "util/synthetic-events.h" #include <string.h> #include <linux/bitops.h> #include <perf/cpumap.h>
tools/perf/tests/dwarf-unwind.c +1 -0
@@ -15,6 +15,7 @@#include "symbol.h" #include "thread.h" #include "callchain.h" +#include "util/synthetic-events.h" #if defined (__x86_64__) || defined (__i386__) || defined (__powerpc__)#include "arch-tests.h"
tools/perf/tests/event_update.c +1 -0
@@ -7,6 +7,7 @@#include "evsel.h" #include "header.h" #include "machine.h" +#include "util/synthetic-events.h" #include "tool.h" #include "tests.h" #include "debug.h"
tools/perf/tests/hists_common.c +2 -0
@@ -2,6 +2,7 @@#include <inttypes.h> #include "util/debug.h" #include "util/dso.h" +#include "util/event.h" // struct perf_sample #include "util/map.h" #include "util/symbol.h" #include "util/sort.h"
@@ -10,6 +11,7 @@#include "util/thread.h" #include "tests/hists_common.h" #include <linux/kernel.h> +#include <linux/perf_event.h> static struct { u32 pid;
tools/perf/tests/mmap-thread-lookup.c +2 -0
@@ -8,11 +8,13 @@#include <stdlib.h> #include <stdio.h> #include "debug.h" +#include "event.h" #include "tests.h" #include "machine.h" #include "thread_map.h" #include "map.h" #include "symbol.h" +#include "util/synthetic-events.h" #include "thread.h" #include "util.h" // page_size
tools/perf/tests/sample-parsing.c +1 -0
@@ -12,6 +12,7 @@#include "event.h" #include "evsel.h" #include "debug.h" +#include "util/synthetic-events.h" #include "tests.h"
tools/perf/tests/stat.c +1 -0
@@ -5,6 +5,7 @@#include "stat.h" #include "counts.h" #include "debug.h" +#include "util/synthetic-events.h" static bool has_term (struct perf_record_stat_config *config,u64 tag,u64 val)
tools/perf/tests/thread-map.c +1 -0
@@ -8,6 +8,7 @@#include "thread_map.h" #include "debug.h" #include "event.h" +#include "util/synthetic-events.h" #include <linux/zalloc.h> #include <perf/event.h>
tools/perf/ui/stdio/hist.c +1 -0
@@ -5,6 +5,7 @@#include "../../util/callchain.h" #include "../../util/debug.h" +#include "../../util/event.h" #include "../../util/hist.h" #include "../../util/map.h" #include "../../util/map_groups.h"
tools/perf/util/auxtrace.c +1 -0
@@ -32,6 +32,7 @@#include "pmu.h" #include "evsel.h" #include "symbol.h" +#include "util/synthetic-events.h" #include "thread_map.h" #include "asm/bug.h" #include "auxtrace.h"
tools/perf/util/auxtrace.h +2 -15
@@ -11,14 +11,13 @@#include <errno.h> #include <stdbool.h> #include <stddef.h> +#include <stdio.h> // FILE #include <linux/list.h> #include <linux/perf_event.h> #include <linux/types.h> #include <asm/bitsperlong.h> #include <asm/barrier.h> -#include "event.h" -union perf_event ;struct perf_session ;struct evlist ;
@@ -27,6 +26,7 @@ struct perf_mmap;struct perf_sample ;struct option ;struct record_opts ; +struct perf_record_auxtrace_error ;struct perf_record_auxtrace_info ;struct events_stats ;
@@ -525,10 +525,6 @@ void auxtrace_synth_error(struct perf_record_auxtrace_error *auxtrace_error, int int code, int cpu, pid_t pid, pid_t tid, u64 ip, const char *msg, u64 timestamp); -int perf_event__synthesize_auxtrace_info (struct auxtrace_record *itr, -struct perf_tool *tool, -struct perf_session *session, -perf_event__handler_t process);int perf_event__process_auxtrace_info (struct perf_session *session,union perf_event *event); s64 perf_event__process_auxtrace(struct perf_session *session,
@@ -605,15 +601,6 @@ void auxtrace_record__free(struct auxtrace_record *itr __maybe_unused) { } -static inline int -perf_event__synthesize_auxtrace_info (struct auxtrace_record *itr__maybe_unused , -struct perf_tool *tool__maybe_unused , -struct perf_session *session__maybe_unused , -perf_event__handler_t process__maybe_unused ) -{ -return -EINVAL ; -} - static inline int auxtrace_record__options(struct auxtrace_record *itr __maybe_unused, struct evlist *evlist __maybe_unused,
tools/perf/util/bpf-event.c +1 -0
@@ -16,6 +16,7 @@#include "map.h" #include "evlist.h" #include "record.h" +#include "util/synthetic-events.h" #define ptr_to_u64 (ptr) ((__u64)(unsigned long)(ptr))
tools/perf/util/bpf-event.h +1 -14
@@ -6,9 +6,9 @@#include <linux/rbtree.h> #include <pthread.h> #include <api/fd/array.h> -#include "event.h" #include <stdio.h> +struct bpf_prog_info ;struct machine ;union perf_event ;struct perf_env ;
@@ -33,11 +33,6 @@ struct btf_node {#ifdef HAVE_LIBBPF_SUPPORT 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, -struct machine *machine, -struct record_opts *opts);int bpf_event__add_sb_event (struct evlist **evlist,struct perf_env *env); void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
@@ -51,14 +46,6 @@ static inline int machine__process_bpf(struct machine *machine __maybe_unused,return 0 ; } -static inline int perf_event__synthesize_bpf_events (struct perf_session *session__maybe_unused , -perf_event__handler_t process__maybe_unused , -struct machine *machine__maybe_unused , -struct record_opts *opts__maybe_unused ) -{ -return 0 ; -} -static inline int bpf_event__add_sb_event (struct evlist **evlist__maybe_unused ,struct perf_env *env__maybe_unused ) {
tools/perf/util/callchain.c +1 -0
@@ -23,6 +23,7 @@#include "debug.h" #include "dso.h" +#include "event.h" #include "hist.h" #include "sort.h" #include "machine.h"
tools/perf/util/event.c +1 -0
@@ -32,6 +32,7 @@#include "stat.h" #include "session.h" #include "bpf-event.h" +#include "synthetic-events.h" #include "tool.h" #include "../perf.h"
tools/perf/util/event.h +2 -116
141 lines not on this page · raw message
tools/perf/util/evsel.c +1 -0
@@ -40,6 +40,7 @@#include "trace-event.h" #include "stat.h" #include "string2.h" +#include "util/synthetic-events.h" #include "memswap.h" #include "util.h" #include "../perf-sys.h"
tools/perf/util/header.c +1 -0
@@ -45,6 +45,7 @@#include "util.h" // page_size, perf_exe() #include "cputopo.h" #include "bpf-event.h" +#include "util/synthetic-events.h" #include <linux/ctype.h> #include <internal/lib.h>
tools/perf/util/intel-bts.c +1 -0
@@ -28,6 +28,7 @@#include "auxtrace.h" #include "intel-pt-decoder/intel-pt-insn-decoder.h" #include "intel-bts.h" +#include "util/synthetic-events.h" #define MAX_TIMESTAMP (~0ULL)
tools/perf/util/intel-pt.c +1 -0
@@ -33,6 +33,7 @@#include "tsc.h" #include "intel-pt.h" #include "config.h" +#include "util/synthetic-events.h" #include "time-utils.h" #include "../arch/x86/include/uapi/asm/perf_regs.h"
tools/perf/util/machine.c +10 -0
@@ -20,6 +20,7 @@#include "symbol.h" #include "sort.h" #include "strlist.h" +#include "util/synthetic-events.h" #include "target.h" #include "thread.h" #include "util.h"
@@ -2624,6 +2625,15 @@ int __machine__synthesize_threads(struct machine *machine, struct perf_tool *tooreturn 0 ; } +int machine__synthesize_threads (struct machine *machine,struct target *target, +struct perf_thread_map *threads,bool data_mmap, +unsigned int nr_threads_synthesize) +{ +return __machine__synthesize_threads (machine,NULL , target, threads, + perf_event__process, data_mmap, + nr_threads_synthesize); +} +pid_t machine__get_current_tid (struct machine *machine,int cpu) {int nr_cpus =min (machine->env->nr_cpus_online,MAX_NR_CPUS );
tools/perf/util/machine.h +0 -15
@@ -6,7 +6,6 @@#include <linux/rbtree.h> #include "map_groups.h" #include "dsos.h" -#include "event.h" #include "rwsem.h" struct addr_location ;
@@ -252,20 +251,6 @@ int machines__for_each_thread(struct machines *machines,int (*fn)(struct thread *thread,void *p), void *priv); -int __machine__synthesize_threads (struct machine *machine,struct perf_tool *tool, -struct target *target,struct perf_thread_map *threads, -perf_event__handler_t process,bool data_mmap, -unsigned int nr_threads_synthesize); -static inline -int machine__synthesize_threads (struct machine *machine,struct target *target, -struct perf_thread_map *threads,bool data_mmap, -unsigned int nr_threads_synthesize) -{ -return __machine__synthesize_threads (machine,NULL , target, threads, - perf_event__process, data_mmap, - nr_threads_synthesize); -} -pid_t machine__get_current_tid (struct machine *machine,int cpu);int machine__set_current_tid (struct machine *machine,int cpu,pid_t pid,pid_t tid);
tools/perf/util/session.c +1 -0
@@ -29,6 +29,7 @@#include "thread-stack.h" #include "sample-raw.h" #include "stat.h" +#include "util/synthetic-events.h" #include "util.h" #include "ui/progress.h" #include "../perf.h"
tools/perf/util/session.h +0 -5
@@ -138,9 +138,4 @@ int perf_session__deliver_synth_event(struct perf_session *session,int perf_event__process_id_index (struct perf_session *session,union perf_event *event); -int perf_event__synthesize_id_index (struct perf_tool *tool, -perf_event__handler_t process, -struct evlist *evlist, -struct machine *machine); -#endif /* __PERF_SESSION_H */
tools/perf/util/stat.c +1 -0
@@ -12,6 +12,7 @@#include "target.h" #include "evlist.h" #include "evsel.h" +#include "util/synthetic-events.h" #include "thread_map.h" #include <linux/zalloc.h>
tools/perf/util/synthetic-events.h new file +103 -0
103 lines not on this page · raw message
tools/perf/util/tsc.h +2 -12
@@ -4,13 +4,12 @@#include <linux/types.h> -#include "event.h" -struct perf_tsc_conversion {u16 time_shift;u32 time_mult;u64 time_zero; }; +struct perf_event_mmap_page ; int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,
@@ -20,13 +19,4 @@ u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc);u64 tsc_to_perf_time (u64 cyc,struct perf_tsc_conversion *tc);u64 rdtsc (void ); -struct perf_event_mmap_page ; -struct perf_tool ; -struct machine ; - -int perf_event__synth_time_conv (const struct perf_event_mmap_page *pc, -struct perf_tool *tool, -perf_event__handler_t process, -struct machine *machine); - -#endif +#endif // __PERF_TSC_H
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 23/31 perf memswap: Adopt 'struct u64_swap' from evsel.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
As it is not used in evsel.h and is a memory swap struct, so fits better in memswap.h.
--- tools/perf/util/evsel.h | 5 ----- tools/perf/util/memswap.h | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-)
tools/perf/util/evsel.h +0 -5
@@ -179,11 +179,6 @@ struct evsel { } side_band; }; -union u64_swap { -u64 val64; -u32 val32[2 ]; -}; -struct perf_missing_features {bool sample_id_all;bool exclude_guest;
tools/perf/util/memswap.h +7 -0
@@ -2,6 +2,13 @@#ifndef PERF_MEMSWAP_H_ #define PERF_MEMSWAP_H_ +#include <linux/types.h> + +union u64_swap { +u64 val64; +u32 val32[2 ]; +}; +void mem_bswap_64 (void *src,int byte_size);void mem_bswap_32 (void *src,int byte_size);
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 24/31 perf tools: Move event synthesizing routines to separate .c file
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
For better grouping, in time we may end up making most of these static, i.e. generalizing the 'perf record' synthesizing code so that based on the target it can do the right thing and call the needed synthesizers.
--- tools/perf/builtin-record.c | 9 - tools/perf/util/Build | 1 + tools/perf/util/cs-etm.c | 1 + tools/perf/util/event.c | 1108 +--------------- tools/perf/util/evsel.c | 278 ---- tools/perf/util/header.c | 393 +----- tools/perf/util/header.h | 18 + tools/perf/util/machine.c | 25 - tools/perf/util/namespaces.c | 18 + tools/perf/util/namespaces.h | 2 + tools/perf/util/session.c | 71 -- tools/perf/util/stat.c | 43 - tools/perf/util/synthetic-events.c | 1884 ++++++++++++++++++++++++++++ 13 files changed, 1928 insertions(+), 1923 deletions(-) create mode 100644 tools/perf/util/synthetic-events.c
tools/perf/builtin-record.c +0 -9
@@ -1181,15 +1181,6 @@ static void workload_exec_failed_signal(int signo __maybe_unused,static void snapshot_sig_handler (int sig);static void alarm_sig_handler (int sig); -int __weak -perf_event__synth_time_conv (const struct perf_event_mmap_page *pc__maybe_unused , -struct perf_tool *tool__maybe_unused , -perf_event__handler_t process__maybe_unused , -struct machine *machine__maybe_unused ) -{ -return 0 ; -} -static const struct perf_event_mmap_page *perf_evlist__pick_pc (struct evlist *evlist) {
tools/perf/util/Build +1 -0
@@ -86,6 +86,7 @@ perf-y += stat-display.o perf-y += record.o perf-y += srcline.o perf-y += srccode.o +perf-y += synthetic-events.o perf-y += data.o perf-y += tsc.o perf-y += cloexec.o
tools/perf/util/cs-etm.c +1 -0
@@ -35,6 +35,7 @@#include "thread.h" #include "thread-stack.h" #include <tools/libc_compat.h> +#include "util/synthetic-events.h" #define MAX_TIMESTAMP (~0ULL)
tools/perf/util/event.c +1 -1107
1,150 lines not on this page · raw message
tools/perf/util/evsel.c +0 -278
290 lines not on this page · raw message
tools/perf/util/header.c +3 -390
448 lines not on this page · raw message
tools/perf/util/header.h +18 -0
@@ -92,6 +92,24 @@ struct perf_header {struct perf_env env; }; +struct feat_fd { +struct perf_header *ph; +int fd; +void *buf;/* Either buf != NULL or fd >= 0 */ +ssize_t offset; +size_t size; +struct evsel *events; +}; + +struct perf_header_feature_ops { +int (*write)(struct feat_fd *ff,struct evlist *evlist); +void (*print)(struct feat_fd *ff,FILE *fp); +int (*process)(struct feat_fd *ff,void *data); +const char *name; +bool full_only; +bool synthesize; +}; +struct evlist ;struct perf_session ;struct perf_tool ;
tools/perf/util/machine.c +0 -25
@@ -20,7 +20,6 @@#include "symbol.h" #include "sort.h" #include "strlist.h" -#include "util/synthetic-events.h" #include "target.h" #include "thread.h" #include "util.h"
@@ -2610,30 +2609,6 @@ int machines__for_each_thread(struct machines *machines,return rc; } -int __machine__synthesize_threads (struct machine *machine,struct perf_tool *tool, -struct target *target,struct perf_thread_map *threads, -perf_event__handler_t process,bool data_mmap, -unsigned int nr_threads_synthesize) -{ -if (target__has_task (target)) -return perf_event__synthesize_thread_map (tool, threads, process, machine, data_mmap); -else if (target__has_cpu (target)) -return perf_event__synthesize_threads (tool, process, - machine, data_mmap, - nr_threads_synthesize); -/* command specified */ -return 0 ; -} - -int machine__synthesize_threads (struct machine *machine,struct target *target, -struct perf_thread_map *threads,bool data_mmap, -unsigned int nr_threads_synthesize) -{ -return __machine__synthesize_threads (machine,NULL , target, threads, - perf_event__process, data_mmap, - nr_threads_synthesize); -} -pid_t machine__get_current_tid (struct machine *machine,int cpu) {int nr_cpus =min (machine->env->nr_cpus_online,MAX_NR_CPUS );
tools/perf/util/namespaces.c +18 -0
@@ -17,8 +17,26 @@#include <string.h> #include <unistd.h> #include <asm/bug.h> +#include <linux/kernel.h> #include <linux/zalloc.h> +static const char *perf_ns__names[] = { + [NET_NS_INDEX ] ="net" , + [UTS_NS_INDEX ] ="uts" , + [IPC_NS_INDEX ] ="ipc" , + [PID_NS_INDEX ] ="pid" , + [USER_NS_INDEX ] ="user" , + [MNT_NS_INDEX ] ="mnt" , + [CGROUP_NS_INDEX ] ="cgroup" , +}; + +const char *perf_ns__name (unsigned int id) +{ +if (id >=ARRAY_SIZE (perf_ns__names)) +return "UNKNOWN" ; +return perf_ns__names[id]; +} +struct namespaces *namespaces__new (struct perf_record_namespaces *event) {struct namespaces *namespaces;
tools/perf/util/namespaces.h +2 -0
@@ -66,4 +66,6 @@ static inline void __nsinfo__zput(struct nsinfo **nsip)#define nsinfo__zput (nsi) __nsinfo__zput(&nsi) +const char *perf_ns__name (unsigned int id); +#endif /* __PERF_NAMESPACES_H */
tools/perf/util/session.c +0 -71
80 lines not on this page · raw message
tools/perf/util/stat.c +0 -43
52 lines not on this page · raw message
tools/perf/util/synthetic-events.c new file +1884 -0
858 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.0
Part of the diff is not shown here. View the raw message.
Arnaldo Carvalho de Melo
maintainerPATCH 25/31 tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
In reply to Arnaldo Carvalho de MeloFrom: Sakari Ailus <[email protected]>
There are no in-kernel %p[fF] users left. Convert the traceevent tool, too, to align with the kernel.
--- .../Documentation/libtraceevent-func_apis.txt | 10 +++++----- tools/lib/traceevent/event-parse.c | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 9 deletions(-)
tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt +5 -5
@@ -59,12 +59,12 @@ parser context. The _tep_register_function()_ function registers a function name mapped to an address and (optional) module. This mapping is used in case the function tracer -or events have "%pF" or "%pS" parameter in its format string. It is common to -pass in the kallsyms function names with their corresponding addresses with this +or events have "%pS" parameter in its format string. It is common to pass in +the kallsyms function names with their corresponding addresses with this function. The _tep_ argument is the trace event parser context. The _name_ is -the name of the function, the string is copied internally. The _addr_ is -the start address of the function. The _mod_ is the kernel module -the function may be in (NULL for none). +the name of the function, the string is copied internally. The _addr_ is the +start address of the function. The _mod_ is the kernel module the function may +be in (NULL for none). The _tep_register_print_string()_ function registers a string by the address it was stored in the kernel. Some strings internal to the kernel with static
tools/lib/traceevent/event-parse.c +14 -4
@@ -4367,10 +4367,20 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, sswitch (*ptr) {case 's' :case 'S' : -case 'f' : -case 'F' :case 'x' :break ; +case 'f' : +case 'F' : +/* +* Pre-5.5 kernels use %pf and +* %pF for printing symbols +* while kernels since 5.5 use +* %pfw for fwnodes. So check +* %p[fF] isn't followed by 'w'. +*/ +if (ptr[1 ] !='w' ) +break ; +/* fall through */ default :/* * Older kernels do not process
@@ -4487,12 +4497,12 @@ get_bprint_format(void *data, int size __maybe_unused, printk =find_printk (tep, addr);if (!printk) { -if (asprintf (&format,"%%pf: (NO FORMAT FOUND at %llx)\n" , addr) <0 ) +if (asprintf (&format,"%%ps: (NO FORMAT FOUND at %llx)\n" , addr) <0 )return NULL ;return format; } -if (asprintf (&format,"%s: %s" ,"%pf" , printk->printk) <0 ) +if (asprintf (&format,"%s: %s" ,"%ps" , printk->printk) <0 )return NULL ;return format;
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 26/31 perf stat: Reset previous counts on repeat with interval
In reply to Arnaldo Carvalho de MeloFrom: Srikar Dronamraju <[email protected]>
When using 'perf stat' with repeat and interval option, it shows wrong values for events.
The wrong values will be shown for the first interval on the second and subsequent repetitions.
Without the fix:
# perf stat -r 3 -I 2000 -e faults -e sched:sched_switch -a sleep 5
2.000282489 53 faults
2.000282489 513 sched:sched_switch
4.005478208 3,721 faults
4.005478208 2,666 sched:sched_switch
5.025470933 395 faults
5.025470933 1,307 sched:sched_switch
2.009602825 1,84,46,74,40,73,70,95,47,520 faults <------
2.009602825 1,84,46,74,40,73,70,95,49,568 sched:sched_switch <------
4.019612206 4,730 faults
4.019612206 2,746 sched:sched_switch
5.039615484 3,953 faults
5.039615484 1,496 sched:sched_switch
2.000274620 1,84,46,74,40,73,70,95,47,520 faults <------
2.000274620 1,84,46,74,40,73,70,95,47,520 sched:sched_switch <------
4.000480342 4,282 faults
4.000480342 2,303 sched:sched_switch
5.000916811 1,322 faults
5.000916811 1,064 sched:sched_switch#
prev_raw_counts is allocated when using intervals. This is used when calculating the difference in the counts of events when using interval.
The current counts are stored in prev_raw_counts to calculate the differences in the next iteration.
On the first interval of the second and subsequent repetitions, prev_raw_counts would be the values stored in the last interval of the previous repetitions, while the current counts will only be for the first interval of the current repetition.
Hence there is a possibility of events showing up as big number.
Fix this by resetting prev_raw_counts whenever perf stat repeats the command.
With the fix:
# perf stat -r 3 -I 2000 -e faults -e sched:sched_switch -a sleep 5
2.019349347 2,597 faults
2.019349347 2,753 sched:sched_switch
4.019577372 3,098 faults
4.019577372 2,532 sched:sched_switch
5.019415481 1,879 faults
5.019415481 1,356 sched:sched_switch
2.000178813 8,468 faults
2.000178813 2,254 sched:sched_switch
4.000404621 7,440 faults
4.000404621 1,266 sched:sched_switch
5.040196079 2,458 faults
5.040196079 556 sched:sched_switch
2.000191939 6,870 faults
2.000191939 1,170 sched:sched_switch
4.000414103 541 faults
4.000414103 902 sched:sched_switch
5.000809863 450 faults
5.000809863 364 sched:sched_switch#
Committer notes:
This was broken since the cset introducing the --interval feature, i.e. --repeat + --interval wasn't tested at that point, add the Fixes tag so that automatic scripts can pick this up.
--- tools/perf/builtin-stat.c | 3 +++ tools/perf/util/stat.c | 17 +++++++++++++++++ tools/perf/util/stat.h | 1 + 3 files changed, 21 insertions(+)
tools/perf/builtin-stat.c +3 -0
@@ -1952,6 +1952,9 @@ int cmd_stat(int argc, const char **argv)fprintf (output,"[ perf stat: executing run #%d ... ]\n" , run_idx +1 ); +if (run_idx !=0 ) +perf_evlist__reset_prev_raw_counts (evsel_list); + status =run_perf_stat (argc, argv, run_idx);if (forever && status !=-1 ) {print_counters (NULL , argc, argv);
tools/perf/util/stat.c +17 -0
@@ -162,6 +162,15 @@ static void perf_evsel__free_prev_raw_counts(struct evsel *evsel) evsel->prev_raw_counts =NULL ; } +static void perf_evsel__reset_prev_raw_counts (struct evsel *evsel) +{ +if (evsel->prev_raw_counts) { + evsel->prev_raw_counts->aggr.val =0 ; + evsel->prev_raw_counts->aggr.ena =0 ; + evsel->prev_raw_counts->aggr.run =0 ; + } +} +static int perf_evsel__alloc_stats (struct evsel *evsel,bool alloc_raw) {int ncpus =perf_evsel__nr_cpus (evsel);
@@ -212,6 +221,14 @@ void perf_evlist__reset_stats(struct evlist *evlist) } } +void perf_evlist__reset_prev_raw_counts (struct evlist *evlist) +{ +struct evsel *evsel; + +evlist__for_each_entry (evlist, evsel) +perf_evsel__reset_prev_raw_counts (evsel); +} +static void zero_per_pkg (struct evsel *counter) {if (counter->per_pkg_mask)
tools/perf/util/stat.h +1 -0
@@ -193,6 +193,7 @@ void perf_stat__collect_metric_expr(struct evlist *);int perf_evlist__alloc_stats (struct evlist *evlist,bool alloc_raw);void perf_evlist__free_stats (struct evlist *evlist);void perf_evlist__reset_stats (struct evlist *evlist); +void perf_evlist__reset_prev_raw_counts (struct evlist *evlist);int perf_stat_process_counter (struct perf_stat_config *config,struct evsel *counter);
Signature · 1 line
2.21.0
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 26/31] perf stat: Reset previous counts on repeat with interval
Hi Sasha, Arnaldo.
Between v5.2.16 and acme HEAD, struct perf_evlist to struct evlist and struct perf_evsel to struct evsel.
However the patches that I had posted
http://lkml.kernel.org/r/[email protected]
would apply cleanly to v5.2.16.
I would like to check if the backports to v5.2.16 should be the same patch (i.e include dependencies including struct renames) or is it okay to apply without the dependencies. Please advise.
Because the renames affected a lot of files, it throws up a lot of commits as dependencies. So I would wait for your inputs before I start with the work.
--
Thanks and Regards
Srikar
Quoted 12 lines
The bot has tested the following trees: v5.2.16, v4.19.74, v4.14.145, v4.9.193, v4.4.193.
v5.2.16: Failed to apply! Possible dependencies:
1c839a5a4061("perf cs-etm: Configure timestamp generation in CPU-wide mode")32dcd021d004("perf evsel: Rename structperf_evselto struct evsel")3399ad9ac234("perf cs-etm: Configure contextID tracing in CPU-wide mode")acae8b36cded("perf header: Add die information in CPU topology")b74d8686a18b("perf cpumap: Retrieve die id information")db5742b6849e("perf stat: Support per-die aggregation")f854839ba2a5("perfcpu_map: Rename structcpu_mapto structperf_cpu_map")
Signature · 2 lines
Thanks and Regards Srikar Dronamraju
Re: [PATCH 26/31] perf stat: Reset previous counts on repeat with interval
Em Mon, Sep 23, 2019 at 09:58:54PM +0530, Srikar Dronamraju escreveu:
Quoted 9 lines
Hi Sasha, Arnaldo.
Between v5.2.16 and acme HEAD, struct
perf_evlistto struct evlist and structperf_evselto struct evsel.However the patches that I had posted
http://lkml.kernel.org/r/[email protected]
would apply cleanly to v5.2.16.
Quoted 7 lines
I would like to check if the backports to v5.2.16 should be the same patch (i.e include dependencies including struct renames) or is it okay to apply without the dependencies. Please advise.
Because the renames affected a lot of files, it throws up a lot of commits as dependencies. So I would wait for your inputs before I start with the work.
Better to not drag the renames, just use the original patch, I think its the best path forward (well, backward :)).
- Arnaldo
Quoted 21 lines
--
Thanks and Regards
SrikarQuoted 12 lines
The bot has tested the following trees: v5.2.16, v4.19.74, v4.14.145, v4.9.193, v4.4.193.
v5.2.16: Failed to apply! Possible dependencies:
1c839a5a4061("perf cs-etm: Configure timestamp generation in CPU-wide mode")32dcd021d004("perf evsel: Rename structperf_evselto struct evsel")3399ad9ac234("perf cs-etm: Configure contextID tracing in CPU-wide mode")acae8b36cded("perf header: Add die information in CPU topology")b74d8686a18b("perf cpumap: Retrieve die id information")db5742b6849e("perf stat: Support per-die aggregation")f854839ba2a5("perfcpu_map: Rename structcpu_mapto structperf_cpu_map")Signature · 2 lines
Thanks and Regards Srikar Dronamraju
Signature · 1 line
- Arnaldo
Re: [PATCH 26/31] perf stat: Reset previous counts on repeat with interval
In reply to a message not in the archiveHi Sasha,
Quoted 24 lines
This commit has been processed because it contains a "Fixes:" tag, fixing commit:
13370a9b5bb8perf stat: Add interval printing.The bot has tested the following trees: v5.2.16, v4.19.74, v4.14.145, v4.9.193, v4.4.193.
v5.2.16: Failed to apply! Possible dependencies:
1c839a5a4061("perf cs-etm: Configure timestamp generation in CPU-wide mode")32dcd021d004("perf evsel: Rename structperf_evselto struct evsel")3399ad9ac234("perf cs-etm: Configure contextID tracing in CPU-wide mode")acae8b36cded("perf header: Add die information in CPU topology")b74d8686a18b("perf cpumap: Retrieve die id information")db5742b6849e("perf stat: Support per-die aggregation")f854839ba2a5("perfcpu_map: Rename structcpu_mapto structperf_cpu_map")v4.19.74: Failed to apply! Possible dependencies:
121dd9ea0116("perf bench: Add epoll parallelepoll_waitbenchmark")1c839a5a4061("perf cs-etm: Configure timestamp generation in CPU-wide mode")231457ec7074("perf bench: Addepoll_ctl(2)benchmark")
32dcd021d004("perf evsel: Rename structperf_evselto struct evsel")3399ad9ac234("perf cs-etm: Configure contextID tracing in CPU-wide mode")6ca9a082b190("perf stat: Pass a 'structperf_stat_config' argument to global print functions")6f6b6594b5f3("perf stat: Move *_aggr_* data to 'structperf_stat_config'")77e0faf8552c("perf stat: Pass 'evlist' toaggr_update_shadow()")
Quoted 9 lines
8897a8916efb("perf stat: Move ru_* data to 'structperf_stat_config'")ae2d7da554f0("perf stat: Pass 'structperf_stat_config' tofirst_shadow_cpu()")d97ae04b3d52("perf stat: Move 'run_count' to 'structperf_stat_config'")df4f7b4d4b1e("perf stat: Move 'unit_width' to 'structperf_stat_config'")f3ca50e61ff4("perf stat: Pass 'structperf_stat_config' argument to local print functions")f854839ba2a5("perfcpu_map: Rename structcpu_mapto structperf_cpu_map")fa4e819bbca9("perf arm cs-etm: Use event attributes to send sink information to kernel")fa7070a38676("perf stat: Move csv_* to 'structperf_stat_config'")
As suggested by Arnaldo, I am adding my patch which applies and builds well on v5.2.16 and v4.14.145. This one differs from the one committed by Arnaldo with respect to structure name change.
Meanwhile I will investigate on v4.14.145 v4.9.193 v4.4.193 and get back to to you.
Signature · 101 lines
Thanks and Regards Srikar Dronamraju ---->8------------8<----------------- From b63fd11cced17fcb8e133def29001b0f6aaa5e06 Mon Sep 17 00:00:00 2001 From: Srikar Dronamraju <[email protected]> Date: Wed, 4 Sep 2019 15:17:37 +0530 Subject: [PATCH 1/2] perf stat: Reset previous counts on repeat with interval When using 'perf stat' with repeat and interval option, it shows wrong values for events. The wrong values will be shown for the first interval on the second and subsequent repetitions. Without the fix: # perf stat -r 3 -I 2000 -e faults -e sched:sched_switch -a sleep 5 2.000282489 53 faults 2.000282489 513 sched:sched_switch 4.005478208 3,721 faults 4.005478208 2,666 sched:sched_switch 5.025470933 395 faults 5.025470933 1,307 sched:sched_switch 2.009602825 1,84,46,74,40,73,70,95,47,520 faults <------ 2.009602825 1,84,46,74,40,73,70,95,49,568 sched:sched_switch <------ 4.019612206 4,730 faults 4.019612206 2,746 sched:sched_switch 5.039615484 3,953 faults 5.039615484 1,496 sched:sched_switch 2.000274620 1,84,46,74,40,73,70,95,47,520 faults <------ 2.000274620 1,84,46,74,40,73,70,95,47,520 sched:sched_switch <------ 4.000480342 4,282 faults 4.000480342 2,303 sched:sched_switch 5.000916811 1,322 faults 5.000916811 1,064 sched:sched_switch # prev_raw_counts is allocated when using intervals. This is used when calculating the difference in the counts of events when using interval. The current counts are stored in prev_raw_counts to calculate the differences in the next iteration. On the first interval of the second and subsequent repetitions, prev_raw_counts would be the values stored in the last interval of the previous repetitions, while the current counts will only be for the first interval of the current repetition. Hence there is a possibility of events showing up as big number. Fix this by resetting prev_raw_counts whenever perf stat repeats the command. With the fix: # perf stat -r 3 -I 2000 -e faults -e sched:sched_switch -a sleep 5 2.019349347 2,597 faults 2.019349347 2,753 sched:sched_switch 4.019577372 3,098 faults 4.019577372 2,532 sched:sched_switch 5.019415481 1,879 faults 5.019415481 1,356 sched:sched_switch 2.000178813 8,468 faults 2.000178813 2,254 sched:sched_switch 4.000404621 7,440 faults 4.000404621 1,266 sched:sched_switch 5.040196079 2,458 faults 5.040196079 556 sched:sched_switch 2.000191939 6,870 faults 2.000191939 1,170 sched:sched_switch 4.000414103 541 faults 4.000414103 902 sched:sched_switch 5.000809863 450 faults 5.000809863 364 sched:sched_switch # Committer notes: This was broken since the cset introducing the --interval feature, i.e. --repeat + --interval wasn't tested at that point, add the Fixes tag so that automatic scripts can pick this up. Fixes: 13370a9b5bb8 ("perf stat: Add interval printing") Signed-off-by: Srikar Dronamraju <[email protected]> Acked-by: Jiri Olsa <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Tested-by: Ravi Bangoria <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Naveen N. Rao <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: [email protected] # v3.9+ Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> --- tools/perf/builtin-stat.c | 3 +++ tools/perf/util/stat.c | 17 +++++++++++++++++ tools/perf/util/stat.h | 1 + 3 files changed, 21 insertions(+)
tools/perf/builtin-stat.c +3 -0
@@ -1961,6 +1961,9 @@ int cmd_stat(int argc, const char **argv)fprintf (output,"[ perf stat: executing run #%d ... ]\n" , run_idx +1 ); +if (run_idx !=0 ) +perf_evlist__reset_prev_raw_counts (evsel_list); + status =run_perf_stat (argc, argv, run_idx);if (forever && status !=-1 ) {print_counters (NULL , argc, argv);
tools/perf/util/stat.c +17 -0
@@ -155,6 +155,15 @@ static void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel) evsel->prev_raw_counts =NULL ; } +static void perf_evsel__reset_prev_raw_counts (struct perf_evsel *evsel) +{ +if (evsel->prev_raw_counts) { + evsel->prev_raw_counts->aggr.val =0 ; + evsel->prev_raw_counts->aggr.ena =0 ; + evsel->prev_raw_counts->aggr.run =0 ; + } +} +static int perf_evsel__alloc_stats (struct perf_evsel *evsel,bool alloc_raw) {int ncpus =perf_evsel__nr_cpus (evsel);
@@ -205,6 +214,14 @@ void perf_evlist__reset_stats(struct perf_evlist *evlist) } } +void perf_evlist__reset_prev_raw_counts (struct perf_evlist *evlist) +{ +struct perf_evsel *evsel; + +evlist__for_each_entry (evlist, evsel) +perf_evsel__reset_prev_raw_counts (evsel); +} +static void zero_per_pkg (struct perf_evsel *counter) {if (counter->per_pkg_mask)
tools/perf/util/stat.h +1 -0
@@ -194,6 +194,7 @@ void perf_stat__collect_metric_expr(struct perf_evlist *);int perf_evlist__alloc_stats (struct perf_evlist *evlist,bool alloc_raw);void perf_evlist__free_stats (struct perf_evlist *evlist);void perf_evlist__reset_stats (struct perf_evlist *evlist); +void perf_evlist__reset_prev_raw_counts (struct perf_evlist *evlist);int perf_stat_process_counter (struct perf_stat_config *config,struct perf_evsel *counter);
Signature · 1 line
2.18.1
Arnaldo Carvalho de Melo
maintainerPATCH 27/31 perf stat: Fix a segmentation fault when using repeat forever
In reply to Arnaldo Carvalho de MeloFrom: Srikar Dronamraju <[email protected]>
Observe a segmentation fault when 'perf stat' is asked to repeat forever with the interval option.
Without fix:
# perf stat -r 0 -I 5000 -e cycles -a sleep 10
# time counts unit events
5.000211692 3,13,89,82,34,157 cycles
10.000380119 1,53,98,52,22,294 cycles
10.040467280 17,16,79,265 cycles
Segmentation faultThis problem was only observed when we use forever option aka -r 0 and works with limited repeats. Calling print_counter with ts being set to NULL, is not a correct option when interval is set. Hence avoid print_counter(NULL,..) if interval is set.
With fix:
# perf stat -r 0 -I 5000 -e cycles -a sleep 10
# time counts unit events
5.019866622 3,15,14,43,08,697 cycles
10.039865756 3,15,16,31,95,261 cycles
10.059950628 1,26,05,47,158 cycles
5.009902655 3,14,52,62,33,932 cycles
10.019880228 3,14,52,22,89,154 cycles
10.030543876 66,90,18,333 cycles
5.009848281 3,14,51,98,25,437 cycles
10.029854402 3,15,14,93,04,918 cycles
5.009834177 3,14,51,95,92,316 cyclesCommitter notes:
Did the 'git bisect' to find the cset introducing the problem to add the Fixes tag below, and at that time the problem reproduced as:
(gdb) run stat -r0 -I500 sleep 1
<SNIP>
Program received signal SIGSEGV, Segmentation fault.
print_interval (prefix=prefix@entry=0x7fffffffc8d0 "", ts=ts@entry=0x0) at builtin-stat.c:866
866 sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, csv_sep);
(gdb) bt
#0 print_interval (prefix=prefix@entry=0x7fffffffc8d0 "", ts=ts@entry=0x0) at builtin-stat.c:866 #1 0x000000000041860a in print_counters (ts=ts@entry=0x0, argc=argc@entry=2, argv=argv@entry=0x7fffffffd640) at builtin-stat.c:938 #2 0x0000000000419a7f in cmd_stat (argc=2, argv=0x7fffffffd640, prefix=<optimized out>) at builtin-stat.c:1411 #3 0x000000000045c65a in run_builtin (p=p@entry=0x6291b8 <commands+216>, argc=argc@entry=5, argv=argv@entry=0x7fffffffd640) at perf.c:370 #4 0x000000000045c893 in handle_internal_command (argc=5, argv=0x7fffffffd640) at perf.c:429 #5 0x000000000045c8f1 in run_argv (argcp=argcp@entry=0x7fffffffd4ac, argv=argv@entry=0x7fffffffd4a0) at perf.c:473 #6 0x000000000045cac9 in main (argc=<optimized out>, argv=<optimized out>) at perf.c:588
(gdb)
Mostly the same as just before this patch:
Program received signal SIGSEGV, Segmentation fault.
0x00000000005874a7 in print_interval (config=0xa1f2a0 <stat_config>, evlist=0xbc9b90, prefix=0x7fffffffd1c0 "`", ts=0x0) at util/stat-display.c:964
964 sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, config->csv_sep);
(gdb) bt
#0 0x00000000005874a7 in print_interval (config=0xa1f2a0 <stat_config>, evlist=0xbc9b90, prefix=0x7fffffffd1c0 "`", ts=0x0) at util/stat-display.c:964 #1 0x0000000000588047 in perf_evlist__print_counters (evlist=0xbc9b90, config=0xa1f2a0 <stat_config>, _target=0xa1f0c0 <target>, ts=0x0, argc=2, argv=0x7fffffffd670)
at util/stat-display.c:1172 #2 0x000000000045390f in print_counters (ts=0x0, argc=2, argv=0x7fffffffd670) at builtin-stat.c:656 #3 0x0000000000456bb5 in cmd_stat (argc=2, argv=0x7fffffffd670) at builtin-stat.c:1960 #4 0x00000000004dd2e0 in run_builtin (p=0xa30e00 <commands+288>, argc=5, argv=0x7fffffffd670) at perf.c:310 #5 0x00000000004dd54d in handle_internal_command (argc=5, argv=0x7fffffffd670) at perf.c:362 #6 0x00000000004dd694 in run_argv (argcp=0x7fffffffd4cc, argv=0x7fffffffd4c0) at perf.c:406 #7 0x00000000004dda11 in main (argc=5, argv=0x7fffffffd670) at perf.c:531 (gdb)
--- tools/perf/builtin-stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-stat.c +1 -1
@@ -1956,7 +1956,7 @@ int cmd_stat(int argc, const char **argv)perf_evlist__reset_prev_raw_counts (evsel_list); status =run_perf_stat (argc, argv, run_idx); -if (forever && status !=-1 ) { +if (forever && status !=-1 && !interval) {print_counters (NULL , argc, argv);perf_stat__reset_stats (); }
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 28/31 perf test: Fix spelling mistake "allos" -> "allocate"
In reply to Arnaldo Carvalho de MeloFrom: Colin Ian King <[email protected]>
There is a spelling mistake in a TEST_ASSERT_VAL message. Fix it.
--- tools/perf/tests/event_update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/event_update.c +1 -1
@@ -94,7 +94,7 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu evsel =perf_evlist__first (evlist); -TEST_ASSERT_VAL ("failed to allos ids" , +TEST_ASSERT_VAL ("failed to allocate ids" , !perf_evsel__alloc_id (evsel,1 ,1 ));perf_evlist__id_add (evlist, evsel,0 ,0 ,123 );
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 29/31 perf kvm: Move kvm-stat header file from conditional inclusion to common include section
In reply to Arnaldo Carvalho de MeloFrom: Anju T Sudhakar <[email protected]>
Move kvm-stat header file to the common include section, and make the definitions in the header file under the conditional inclusion #ifdef HAVE_KVM_STAT_SUPPORT.
This helps to define other 'perf kvm' related function prototypes in kvm-stat header file, which may not need kvm-stat support.
--- tools/perf/builtin-kvm.c | 2 +- tools/perf/util/kvm-stat.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
tools/perf/builtin-kvm.c +1 -1
@@ -21,6 +21,7 @@#include "util/top.h" #include "util/data.h" #include "util/ordered-events.h" +#include "util/kvm-stat.h" #include "ui/ui.h" #include <sys/prctl.h>
@@ -59,7 +60,6 @@ static const char *get_filename_for_perf_kvm(void) }#ifdef HAVE_KVM_STAT_SUPPORT -#include "util/kvm-stat.h" void exit_event_get_key(struct evsel *evsel, struct perf_sample *sample,
tools/perf/util/kvm-stat.h +3 -0
@@ -2,6 +2,8 @@#ifndef __PERF_KVM_STAT_H#define __PERF_KVM_STAT_H +#ifdef HAVE_KVM_STAT_SUPPORT +#include "tool.h" #include "stat.h" #include "record.h"
@@ -144,5 +146,6 @@ extern const int decode_str_len;extern const char *kvm_exit_reason;extern const char *kvm_entry_trace;extern const char *kvm_exit_trace; +#endif /* HAVE_KVM_STAT_SUPPORT */ #endif /* __PERF_KVM_STAT_H */
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 30/31 perf kvm: Add arch neutral function to choose event for perf kvm record
In reply to Arnaldo Carvalho de MeloFrom: Anju T Sudhakar <[email protected]>
'perf kvm record' uses 'cycles'(if the user did not specify any event) as the default event to profile the guest.
This will not provide any proper samples from the guest incase of powerpc architecture, since in powerpc the PMUs are controlled by the guest rather than the host.
Patch adds a function to pick an arch specific event for 'perf kvm record', instead of selecting 'cycles' as a default event for all architectures.
For powerpc this function checks for any user specified event, and if there isn't any it returns invalid instead of proceeding with 'cycles' event.
--- tools/perf/arch/powerpc/util/kvm-stat.c | 37 +++++++++++++++++++++++++ tools/perf/builtin-kvm.c | 12 +++++++- tools/perf/util/kvm-stat.h | 1 + 3 files changed, 49 insertions(+), 1 deletion(-)
tools/perf/arch/powerpc/util/kvm-stat.c +37 -0
@@ -8,6 +8,7 @@#include "book3s_hv_exits.h" #include "book3s_hcalls.h" +#include <subcmd/parse-options.h> #define NR_TPS 4
@@ -172,3 +173,39 @@ int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid __maybe_unused)return ret; } + +/* +* Incase of powerpc architecture, pmu registers are programmable +* by guest kernel. So monitoring guest via host may not provide +* valid samples. It is better to fail the "perf kvm record" +* with default "cycles" event to monitor guest in powerpc. +* +* Function to parse the arguments and return appropriate values. +*/ +int kvm_add_default_arch_event (int *argc,const char **argv) +{ +const char **tmp; +bool event = false; +int i, j = *argc; + +const struct option event_options[] = { +OPT_BOOLEAN ('e' ,"event" , &event,NULL ), +OPT_END () + }; + + tmp =calloc (j +1 ,sizeof (char *)); +if (!tmp) +return -EINVAL ; + +for (i =0 ; i < j; i++) + tmp[i] = argv[i]; + +parse_options (j, tmp, event_options,NULL ,PARSE_OPT_KEEP_UNKNOWN ); +if (!event) { +free (tmp); +return -EINVAL ; + } + +free (tmp); +return 0 ; +}
tools/perf/builtin-kvm.c +11 -1
@@ -1514,11 +1514,21 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) }#endif /* HAVE_KVM_STAT_SUPPORT */ +int __weak kvm_add_default_arch_event (int *argc__maybe_unused , +const char **argv__maybe_unused ) +{ +return 0 ; +} +static int __cmd_record (const char *file_name,int argc,const char **argv) { -int rec_argc, i =0 , j; +int rec_argc, i =0 , j, ret;const char **rec_argv; + ret =kvm_add_default_arch_event (&argc, argv); +if (ret) +return -EINVAL ; + rec_argc = argc +2 ; rec_argv =calloc (rec_argc +1 ,sizeof (char *)); rec_argv[i++] =strdup ("record" );
tools/perf/util/kvm-stat.h +1 -0
@@ -148,4 +148,5 @@ extern const char *kvm_entry_trace;extern const char *kvm_exit_trace;#endif /* HAVE_KVM_STAT_SUPPORT */ +extern int kvm_add_default_arch_event (int *argc,const char **argv);#endif /* __PERF_KVM_STAT_H */
Signature · 1 line
2.21.0
Arnaldo Carvalho de Melo
maintainerPATCH 31/31 perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpc
In reply to Arnaldo Carvalho de MeloFrom: Anju T Sudhakar <[email protected]>
Use 'trace_imc/trace_cycles' as the default event for 'perf kvm record' in powerpc.
--- tools/perf/arch/powerpc/util/kvm-stat.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
tools/perf/arch/powerpc/util/kvm-stat.c +12 -4
@@ -5,6 +5,7 @@#include "util/debug.h" #include "util/evsel.h" #include "util/evlist.h" +#include "util/pmu.h" #include "book3s_hv_exits.h" #include "book3s_hcalls.h"
@@ -177,8 +178,9 @@ int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid __maybe_unused)/* * Incase of powerpc architecture, pmu registers are programmable * by guest kernel. So monitoring guest via host may not provide -* valid samples. It is better to fail the "perf kvm record" -* with default "cycles" event to monitor guest in powerpc. +* valid samples with default 'cycles' event. It is better to use +* 'trace_imc/trace_cycles' event for guest profiling, since it +* can track the guest instruction pointer in the trace-record. * * Function to parse the arguments and return appropriate values. */
@@ -202,8 +204,14 @@ int kvm_add_default_arch_event(int *argc, const char **argv)parse_options (j, tmp, event_options,NULL ,PARSE_OPT_KEEP_UNKNOWN );if (!event) { -free (tmp); -return -EINVAL ; +if (pmu_have_event ("trace_imc" ,"trace_cycles" )) { + argv[j++] =strdup ("-e" ); + argv[j++] =strdup ("trace_imc/trace_cycles/" ); + *argc +=2 ; + }else { +free (tmp); +return -EINVAL ; + } }free (tmp);
Signature · 1 line
2.21.0
Quoted 309 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
e336b4027775cb458dc713745e526fa1a1996b2a:kprobes: Prohibit probing on
BUG()andWARN()address (2019-09-05 10:15: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-20190920-2for you to fetch changes up to
2bff2b828502b5e5d5ea5a52643d3542053df03f:perf kvm stat: Set '
trace_cycles' as default event for 'perf kvm record' in powerpc (2019-09-20 10:28:26 -0300)----------------------------------------------------------------
perf/core improvements and fixes:perf stat:
Srikar Dronamraju:
- Fix a segmentation fault when using repeat forever.
- Reset previous counts on repeat with interval.
aarch64:
James Clark:
- Add PMU event JSON files for Cortex-A76 and Neoverse N1.
PowerPC:
Anju T Sudhakar:
- Make '
trace_cycles' the default event for 'perf kvm record' in PowerPC.S/390:
- Link libjvmti to
tools/lib/string.oto have a weakstrlcpy()implementation, providing previously unresolved symbol on s/390.perf test:
Jiri Olsa:
- Add libperf automated tests to 'make -C
tools/perfbuild-test'.Colin Ian King:
- Fix spelling mistake.
Tree wide:
Arnaldo Carvalho de Melo:
- Some more header file sanitization.
libperf:
Jiri Olsa:
- Add dependency on libperf for python.so binding.
libtraceevent:
Sakari Ailus:
- Convert remaining %p[fF] users to %p[sS].
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>----------------------------------------------------------------
Anju T Sudhakar (3):
perf kvm: Move kvm-stat header file from conditional inclusion to common include section perf kvm: Add arch neutral function to choose event for perf kvm record perf kvm stat: Set 'trace_cycles' as default event for 'perf kvm record' in powerpcArnaldo Carvalho de Melo (19):
perf jvmti: Link againsttools/lib/string.oto have weakstrlcpy()perf tools: Remove needlessbuiltin.hinclude directives perf debug: No need to includeui/util.h
perf tools: Removedebug.hfrom places where it is not needed perf tools: Removeutil.hfrom where it is not needed perf probe: Add missingbuild-id.hheader.
perf symbols: Add missingdso.hheader
perf env: Remove needlesscpumap.hheader
perf event: Move perf_event__synthesize* toevent.hperf stat: Moveperf_stat_synthesize_config()toevent.hperf callchain: Remove needlessevent.hinclude
perf python: Removedebug.h
perf hist: Add missing 'structbranch_stack' forward declaration perf annotate: Add missingmachine.hinclude directive perf sched: Add missingevent.hinclude directive
perf auxtrace: Add missing 'structperf_sample' forward declaration perf tools: Move event synthesizing routines to separate header perf memswap: Adopt 'structu64_swap' fromevsel.h
perf tools: Move event synthesizing routines to separate .c fileColin Ian King (1):
perf test: Fix spelling mistake "allos" -> "allocate"James Clark (1):
perf tools: Add PMU event JSON files for ARM Cortex-A76 and, Neoverse N1.Jiri Olsa (4):
perf python: Add missing python/perf.so dependency for libperf perf tests: Add libperf automated test for 'make -Ctools/perfbuild-test'
libperf: Add missingevent.hfile to install rule
libperf: Adoptperf_cpu_map__max()functionSakari Ailus (1):
tools lib traceevent: Convert remaining %p[fF] users to %p[sS]Srikar Dronamraju (2):
perf stat: Reset previous counts on repeat with interval perf stat: Fix a segmentation fault when using repeat forever.../Documentation/libtraceevent-func_apis.txt | 10 +- tools/lib/traceevent/event-parse.c | 18 +- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 2 +- tools/perf/arch/arm64/util/dwarf-regs.c | 1 - tools/perf/arch/arm64/util/header.c | 4 +- tools/perf/arch/arm64/util/unwind-libunwind.c | 2 +- tools/perf/arch/powerpc/util/dwarf-regs.c | 1 - tools/perf/arch/powerpc/util/header.c | 1 - tools/perf/arch/powerpc/util/kvm-stat.c | 45 + tools/perf/arch/powerpc/util/skip-callchain-idx.c | 1 + tools/perf/arch/powerpc/util/sym-handling.c | 1 - tools/perf/arch/s390/util/machine.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 1 - tools/perf/arch/x86/tests/perf-time-to-tsc.c | 1 - tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/arch/x86/util/archinsn.c | 1 + tools/perf/arch/x86/util/event.c | 2 + tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/arch/x86/util/machine.c | 3 +- tools/perf/arch/x86/util/tsc.c | 2 + tools/perf/bench/epoll-ctl.c | 2 +- tools/perf/bench/epoll-wait.c | 2 +- tools/perf/bench/futex-hash.c | 2 +- tools/perf/bench/futex-lock-pi.c | 2 +- tools/perf/bench/futex-requeue.c | 2 +- tools/perf/bench/futex-wake-parallel.c | 3 +- tools/perf/bench/futex-wake.c | 2 +- tools/perf/bench/numa.c | 1 - tools/perf/bench/sched-messaging.c | 2 - tools/perf/bench/sched-pipe.c | 2 - tools/perf/builtin-annotate.c | 1 + tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-config.c | 1 - tools/perf/builtin-evlist.c | 2 - tools/perf/builtin-inject.c | 1 + tools/perf/builtin-kvm.c | 15 +- tools/perf/builtin-record.c | 10 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-sched.c | 3 + tools/perf/builtin-stat.c | 24 +- tools/perf/builtin-top.c | 1 + tools/perf/builtin-trace.c | 1 + tools/perf/jvmti/Build | 9 + tools/perf/lib/Makefile | 1 + tools/perf/lib/cpumap.c | 12 + tools/perf/lib/include/perf/cpumap.h | 1 + tools/perf/lib/libperf.map | 1 + tools/perf/perf.c | 2 +- .../arch/arm64/arm/cortex-a76-n1/branch.json | 14 + .../arch/arm64/arm/cortex-a76-n1/bus.json | 24 + .../arch/arm64/arm/cortex-a76-n1/cache.json | 207 +++ .../arch/arm64/arm/cortex-a76-n1/exception.json | 52 + .../arch/arm64/arm/cortex-a76-n1/instruction.json | 108 ++ .../arch/arm64/arm/cortex-a76-n1/memory.json | 23 + .../arch/arm64/arm/cortex-a76-n1/other.json | 7 + .../arch/arm64/arm/cortex-a76-n1/pipeline.json | 14 + tools/perf/pmu-events/arch/arm64/mapfile.csv | 2 + tools/perf/tests/bitmap.c | 2 +- tools/perf/tests/clang.c | 2 - tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/cpumap.c | 1 + tools/perf/tests/dso-data.c | 1 - tools/perf/tests/dwarf-unwind.c | 1 + tools/perf/tests/event-times.c | 1 - tools/perf/tests/event_update.c | 4 +- tools/perf/tests/hists_common.c | 2 + tools/perf/tests/keep-tracking.c | 3 +- tools/perf/tests/llvm.c | 1 - tools/perf/tests/make | 6 +- tools/perf/tests/mem2node.c | 2 +- tools/perf/tests/mmap-basic.c | 3 +- tools/perf/tests/mmap-thread-lookup.c | 4 +- tools/perf/tests/openat-syscall-all-cpus.c | 5 +- tools/perf/tests/parse-events.c | 1 - tools/perf/tests/parse-no-sample-id-all.c | 2 - tools/perf/tests/perf-hooks.c | 1 - tools/perf/tests/pmu.c | 1 - tools/perf/tests/sample-parsing.c | 2 +- tools/perf/tests/stat.c | 1 + tools/perf/tests/switch-tracking.c | 1 - tools/perf/tests/task-exit.c | 2 +- tools/perf/tests/thread-map.c | 1 + tools/perf/tests/topology.c | 2 +- tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/ui/browser.c | 1 - tools/perf/ui/browsers/annotate.c | 1 - tools/perf/ui/browsers/header.c | 1 - tools/perf/ui/browsers/map.c | 1 - tools/perf/ui/browsers/res_sample.c | 2 +- tools/perf/ui/browsers/scripts.c | 3 +- tools/perf/ui/gtk/helpline.c | 1 - tools/perf/ui/gtk/progress.c | 1 - tools/perf/ui/gtk/setup.c | 3 +- tools/perf/ui/gtk/util.c | 1 - tools/perf/ui/helpline.c | 2 - tools/perf/ui/hist.c | 1 - tools/perf/ui/setup.c | 2 +- tools/perf/ui/stdio/hist.c | 1 + tools/perf/ui/tui/helpline.c | 1 - tools/perf/ui/tui/setup.c | 2 +- tools/perf/ui/tui/util.c | 1 - tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 2 +- tools/perf/util/arm-spe.c | 1 - tools/perf/util/auxtrace.c | 6 +- tools/perf/util/auxtrace.h | 18 +- tools/perf/util/bpf-event.c | 1 + tools/perf/util/bpf-event.h | 15 +- tools/perf/util/branch.c | 2 - tools/perf/util/branch.h | 9 +- tools/perf/util/build-id.c | 2 +- tools/perf/util/callchain.c | 1 + tools/perf/util/callchain.h | 5 +- tools/perf/util/cloexec.c | 2 +- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 - tools/perf/util/cs-etm.c | 2 +- tools/perf/util/data.c | 3 +- tools/perf/util/debug.c | 1 - tools/perf/util/debug.h | 2 +- tools/perf/util/demangle-java.c | 1 - tools/perf/util/demangle-rust.c | 1 - tools/perf/util/dwarf-regs.c | 1 - tools/perf/util/env.h | 3 +- tools/perf/util/event.c | 1109 +----------- tools/perf/util/event.h | 77 +- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 280 +-- tools/perf/util/evsel.h | 5 - tools/perf/util/evsel_fprintf.c | 1 + tools/perf/util/header.c | 395 +--- tools/perf/util/header.h | 60 +- tools/perf/util/hist.h | 1 + tools/perf/util/intel-bts.c | 2 +- tools/perf/util/intel-pt.c | 1 + tools/perf/util/jitdump.c | 2 - tools/perf/util/kvm-stat.h | 4 + tools/perf/util/libunwind/arm64.c | 1 - tools/perf/util/libunwind/x86_32.c | 1 - tools/perf/util/llvm-utils.c | 1 + tools/perf/util/lzma.c | 2 +- tools/perf/util/machine.c | 15 - tools/perf/util/machine.h | 15 - tools/perf/util/memswap.h | 7 + tools/perf/util/namespaces.c | 18 + tools/perf/util/namespaces.h | 2 + tools/perf/util/parse-events.c | 1 - tools/perf/util/perf-hooks.c | 1 - tools/perf/util/pmu.c | 1 - tools/perf/util/probe-file.c | 1 + tools/perf/util/python.c | 4 +- tools/perf/util/record.c | 2 - tools/perf/util/rwsem.c | 1 + tools/perf/util/s390-cpumsf.c | 1 - tools/perf/util/s390-sample-raw.c | 1 - .../util/scripting-engines/trace-event-python.c | 2 - tools/perf/util/session.c | 72 +- tools/perf/util/session.h | 5 - tools/perf/util/srccode.c | 2 +- tools/perf/util/stat.c | 60 +- tools/perf/util/stat.h | 9 +- tools/perf/util/svghelper.c | 2 +- tools/perf/util/symbol-elf.c | 3 + tools/perf/util/symbol-minimal.c | 3 +- tools/perf/util/symbol.c | 2 +- tools/perf/util/synthetic-events.c | 1884 ++++++++++++++++++++ tools/perf/util/synthetic-events.h | 103 ++ tools/perf/util/target.c | 2 - tools/perf/util/top.c | 1 - tools/perf/util/trace-event-info.c | 2 +- tools/perf/util/trace-event-read.c | 1 - tools/perf/util/trace-event.c | 1 - tools/perf/util/tsc.h | 14 +- tools/perf/util/unwind-libdw.c | 1 - tools/perf/util/unwind-libunwind-local.c | 1 - tools/perf/util/usage.c | 1 - tools/perf/util/vdso.c | 2 +- tools/perf/util/zlib.c | 4 +- 180 files changed, 2763 insertions(+), 2256 deletions(-) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json
Quoted 8 lines
create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/exception.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/instruction.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/memory.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/other.json create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a76-n1/pipeline.json create mode 100644 tools/perf/util/synthetic-events.c create mode 100644 tools/perf/util/synthetic-events.h
Pulled, thanks a lot Arnaldo!
Ingo