* [GIT PULL] perf/core improvements and fixes @ 2020-05-06 15:21 Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 01/91] perf cgroup: Avoid needless closing of unopened fd Arnaldo Carvalho de Melo ` (90 more replies) 0 siblings, 91 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Daniel Díaz, He Zhe, Hulk Robot, Ian Rogers, Jagadeesh Pagadala, Jin Yao, Kajol Jain, Konstantin Khlebnikov, Leo Yan, Mike Leach, Shaokun Zhang, Stephane Eranian, Thomas Backlund Hi Ingo/Thomas, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 87cfeb1920f84f465a738d4c6589033eefa20b45: Merge tag 'perf-core-for-mingo-5.8-20200420' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2020-04-22 14:08:28 +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.8-20200506 for you to fetch changes up to 19ce2321739da5fc27f6a5ed1e1cb15e384ad030: perf flamegraph: Use /bin/bash for report and record scripts (2020-05-05 16:35:32 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf record: - Introduce --switch-output-event to use arbitrary events to be setup and read from a side band thread and, when they take place a signal be sent to the main 'perf record' thread, reusing the --switch-output code to take perf.data snapshots from the --overwrite ring buffer, e.g.: # perf record --overwrite -e sched:* \ --switch-output-event syscalls:*connect* \ workload will take perf.data.YYYYMMDDHHMMSS snapshots up to around the connect syscalls. Stephane Eranian: - Add --num-synthesize-threads option to control degree of parallelism of the synthesize_mmap() code which is scanning /proc/PID/task/PID/maps and can be time consuming. This mimics pre-existing behaviour in 'perf top'. Intel PT: Adrian Hunter: - Add support for synthesizing branch stacks for regular events (cycles, instructions, etc) from Intel PT data. perf bench: Ian Rogers: - Add a multi-threaded synthesize benchmark. - Add kallsyms parsing benchmark. Tommi Rantala: - Fix div-by-zero if runtime is zero. perf synthetic events: - Remove use of sscanf from /proc reading when parsing pre-existing threads to generate synthetic PERF_RECORD_{FORK,MMAP,COMM,etc} events. tools api: - Add a lightweight buffered reading API. libsymbols: - Parse kallsyms using new lightweight buffered reading io API. perf parse-events: - Fix memory leaks found on parse_events. perf mem2node: - Avoid double free related to realloc(). perf stat: Jin Yao: - Zero all the 'ena' and 'run' array slot stats for interval mode. - Improve runtime stat for interval mode Kajol Jain: - Enable Hz/hz printing for --metric-only option - Enhance JSON/metric infrastructure to handle "?". perf tests: Kajol Jain: - Added test for runtime param in metric expression. Tommi Rantala: - Fix data path in the session topology test. perf vendor events power9: Kajol Jain: - Add hv_24x7 socket/chip level metric events Coresight: Leo Yan: - Move definition of 'traceid_list' global variable from header file. Mike Leach: - Update to build with latest opencsd version. perf pmu: Shaokun Zhang: - Fix function name in comment, its get_cpuid_str(), not get_cpustr() Stephane Eranian: - Add perf_pmu__find_by_type() helper perf script: Stephane Eranian: - Remove extraneous newline in perf_sample__fprintf_regs(). Ian Rogers: - Avoid NULL dereference on symbol. tools feature: Stephane Eranian: - Add support for detecting libpfm4. perf symbol: Thomas Richter: - Fix kernel symbol address display in TUI verbose mode. perf cgroup: Tommi Rantala: - Avoid needless closing of unopened fd libperf: He Zhe: - Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus. Ian Rogers: - Fix a refcount leak in evlist method. Arnaldo Carvalho de Melo: - Rename the code in tools/perf/util, i.e. perf tooling specific, that operates on 'struct evsel' to evsel__, leaving the perf_evsel__ namespace for the routines in tools/lib/perf/ that operate on 'struct perf_evsel__'. tools/perf specific libraries: Konstantin Khlebnikov: - Fix reading new topology attribute "core_cpus" - Simplify checking if SMT is active. perf flamegraph: Arnaldo Carvalho de Melo: - Use /bin/bash for report and record scripts, just like all other such scripts, fixing a package dependency bug in a Linaro OpenEmbedded build checker. perf evlist: Jagadeesh Pagadala: - Remove duplicate headers. Miscelaneous: Zou Wei: - Remove unneeded semicolon in libtraceevent, 'perf c2c' and others. - Fix warning assignment of 0/1 to bool variable in 'perf report' Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (9): perf thread-stack: Add branch stack support perf intel-pt: Consolidate thread-stack use condition perf intel-pt: Change branch stack support to use thread-stacks perf auxtrace: Add option to synthesize branch stack for regular events perf evsel: Add support for synthesized branch stack sample type perf thread-stack: Add thread_stack__br_sample_late() perf intel-pt: Add support for synthesizing branch stacks for regular events perf intel-pt: Update documentation about itrace G and L options perf intel-pt: Update documentation about using /proc/kcore Arnaldo Carvalho de Melo (44): perf tools: Move routines that probe for perf API features to separate file perf record: Move sb_evlist to 'struct record' perf top: Move sb_evlist to 'struct perf_top' perf bpf: Decouple creating the evlist from adding the SB event perf parse-events: Add parse_events_option() variant that creates evlist perf evlist: Move the sideband thread routines to separate object perf evlist: Allow reusing the side band thread for more purposes libsubcmd: Introduce OPT_CALLBACK_SET() perf record: Introduce --switch-output-event perf record: Move side band evlist setup to separate routine perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t' perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus() perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas() perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu() perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event() perf evsel: Rename perf_evsel__exit() to evsel__exit() perf evsel: Rename perf_evsel__config*() to evsel__config*() perf evsel: Rename perf_evsel__calc_id_pos() to evsel__calc_id_pos() perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() perf evsel: Rename *perf_evsel__*name() to *evsel__*name() perf evsel: Rename perf_evsel__group_desc() to evsel__group_desc() perf evsel: Rename *perf_evsel__*set_sample_*() to *evsel__*set_sample_*() perf evsel: Rename perf_evsel__*filter*() to evsel__*filter*() perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*() perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*() perf evsel: Rename perf_evsel__is_*() to evsel__is*() perf evsel: Ditch perf_evsel__cmp(), not used for quite a while perf evsel: Rename *perf_evsel__read*() to *evsel__read() perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() perf evsel: Rename perf_evsel__has*() to evsel__has*() perf evsel: Rename perf_evsel__fallback() to evsel__fallback() perf evsel: Rename perf_evsel__group_idx() to evsel__group_idx() perf evsel: Rename perf_evsel__env() to evsel__env() perf evsel: Rename perf_evsel__store_ids() to evsel__store_id() perf stat: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf kmem: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf lock: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf sched: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf script: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf trace: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf annotate: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf inject: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() perf flamegraph: Use /bin/bash for report and record scripts He Zhe (1): libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus. Ian Rogers (13): perf script: Avoid NULL dereference on symbol perf bench: Add a multi-threaded synthesize benchmark tools api: Add a lightweight buffered reading api perf synthetic events: Remove use of sscanf from /proc reading perf parse-events: Fix memory leaks found on parse_events perf parse-events: Fix memory leaks found on parse_events perf parse-events: Fix another memory leaks found on parse_events() libperf evlist: Fix a refcount leak perf mem2node: Avoid double free related to realloc perf doc: Pass ASCIIDOC_EXTRA as an argument perf bench: Add kallsyms parsing libsymbols kallsyms: Parse using io api libsymbols kallsyms: Move hex2u64 out of header Jagadeesh Pagadala (1): perf evlist: Remove duplicate headers Jin Yao (2): perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode perf stat: Improve runtime stat for interval mode Kajol Jain (4): perf metricgroups: Enhance JSON/metric infrastructure to handle "?" perf tests expr: Added test for runtime param in metric expression perf tools: Enable Hz/hz prinitg for --metric-only option perf vendor events power9: Add hv_24x7 socket/chip level metric events Konstantin Khlebnikov (2): perf tools: Fix reading new topology attribute "core_cpus" perf tools: Simplify checking if SMT is active. Leo Yan (1): perf cs-etm: Move definition of 'traceid_list' global variable from header file Mike Leach (1): perf: cs-etm: Update to build with latest opencsd version. Shaokun Zhang (1): perf pmu: Fix function name in comment, its get_cpuid_str(), not get_cpustr() Stephane Eranian (4): perf record: Add num-synthesize-threads option perf script: Remove extraneous newline in perf_sample__fprintf_regs() tools feature: Add support for detecting libpfm4 perf pmu: Add perf_pmu__find_by_type helper Thomas Richter (1): perf symbol: Fix kernel symbol address display Tommi Rantala (3): perf cgroup: Avoid needless closing of unopened fd perf bench: Fix div-by-zero if runtime is zero perf test session topology: Fix data path Zou Wei (4): libtraceevent: Remove unneeded semicolon perf c2c: Remove unneeded semicolon perf tools: Remove unneeded semicolons perf report: Fix warning assignment of 0/1 to bool variable tools/build/Makefile.feature | 3 +- tools/build/feature/Makefile | 6 +- tools/build/feature/test-libopencsd.c | 4 +- tools/build/feature/test-libpfm4.c | 9 + tools/lib/api/io.h | 115 ++++++++ tools/lib/perf/cpumap.c | 2 +- tools/lib/perf/evlist.c | 4 +- tools/lib/subcmd/parse-options.h | 2 + tools/lib/symbol/kallsyms.c | 86 +++--- tools/lib/symbol/kallsyms.h | 2 - tools/lib/traceevent/kbuffer-parse.c | 2 +- tools/perf/Documentation/itrace.txt | 5 + tools/perf/Documentation/perf-intel-pt.txt | 53 +++- tools/perf/Documentation/perf-record.txt | 17 ++ tools/perf/Documentation/perf-stat.txt | 2 + tools/perf/Makefile.perf | 6 +- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/arch/arm64/util/arm-spe.c | 12 +- tools/perf/arch/powerpc/util/header.c | 8 + tools/perf/arch/powerpc/util/kvm-stat.c | 2 +- tools/perf/arch/s390/util/kvm-stat.c | 8 +- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 6 +- tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 21 +- tools/perf/arch/x86/util/kvm-stat.c | 12 +- tools/perf/bench/Build | 1 + tools/perf/bench/bench.h | 1 + tools/perf/bench/epoll-wait.c | 3 +- tools/perf/bench/futex-hash.c | 3 +- tools/perf/bench/futex-lock-pi.c | 3 +- tools/perf/bench/kallsyms-parse.c | 75 +++++ tools/perf/bench/synthesize.c | 211 ++++++++++++-- tools/perf/builtin-annotate.c | 15 +- tools/perf/builtin-bench.c | 1 + tools/perf/builtin-c2c.c | 9 +- tools/perf/builtin-diff.c | 8 +- tools/perf/builtin-inject.c | 19 +- tools/perf/builtin-kmem.c | 65 ++--- tools/perf/builtin-kvm.c | 23 +- tools/perf/builtin-lock.c | 42 ++- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-record.c | 117 ++++++-- tools/perf/builtin-report.c | 21 +- tools/perf/builtin-sched.c | 78 +++--- tools/perf/builtin-script.c | 73 ++--- tools/perf/builtin-stat.c | 31 +-- tools/perf/builtin-timechart.c | 52 ++-- tools/perf/builtin-top.c | 36 ++- tools/perf/builtin-trace.c | 115 ++++---- .../arch/powerpc/power9/nest_metrics.json | 19 ++ tools/perf/pmu-events/pmu-events.h | 2 +- tools/perf/scripts/python/bin/flamegraph-record | 2 +- tools/perf/scripts/python/bin/flamegraph-report | 2 +- tools/perf/tests/Build | 1 + tools/perf/tests/api-io.c | 304 ++++++++++++++++++++ tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/event-times.c | 8 +- tools/perf/tests/event_update.c | 2 +- tools/perf/tests/evsel-roundtrip-name.c | 20 +- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/tests/expr.c | 16 +- tools/perf/tests/hists_cumulate.c | 8 +- tools/perf/tests/mmap-basic.c | 4 +- tools/perf/tests/openat-syscall-all-cpus.c | 6 +- tools/perf/tests/openat-syscall-tp-fields.c | 6 +- tools/perf/tests/openat-syscall.c | 8 +- tools/perf/tests/parse-events.c | 138 ++++----- tools/perf/tests/perf-record.c | 6 +- tools/perf/tests/sample-parsing.c | 6 +- tools/perf/tests/switch-tracking.c | 14 +- tools/perf/tests/tests.h | 1 + tools/perf/tests/topology.c | 12 +- tools/perf/ui/browsers/hists.c | 18 +- tools/perf/ui/gtk/annotate.c | 2 +- tools/perf/ui/gtk/hists.c | 6 +- tools/perf/ui/hist.c | 16 +- tools/perf/util/Build | 2 + tools/perf/util/annotate.c | 20 +- tools/perf/util/auxtrace.c | 33 ++- tools/perf/util/auxtrace.h | 2 + tools/perf/util/bpf-event.c | 3 +- tools/perf/util/bpf-event.h | 7 +- tools/perf/util/bpf-loader.c | 2 +- tools/perf/util/cgroup.c | 3 +- tools/perf/util/cloexec.c | 2 +- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 + tools/perf/util/cs-etm.c | 3 + tools/perf/util/cs-etm.h | 3 - tools/perf/util/data-convert-bt.c | 6 +- tools/perf/util/event.c | 2 +- tools/perf/util/evlist.c | 153 +--------- tools/perf/util/evlist.h | 9 +- tools/perf/util/evsel.c | 308 ++++++++++----------- tools/perf/util/evsel.h | 180 ++++++------ tools/perf/util/evsel_config.h | 2 +- tools/perf/util/evsel_fprintf.c | 8 +- tools/perf/util/expr.c | 11 +- tools/perf/util/expr.h | 5 +- tools/perf/util/expr.l | 27 +- tools/perf/util/header.c | 13 +- tools/perf/util/hist.c | 8 +- tools/perf/util/intel-bts.c | 6 +- .../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 2 +- tools/perf/util/intel-pt.c | 215 +++++++------- tools/perf/util/machine.c | 4 +- tools/perf/util/mem2node.c | 3 +- tools/perf/util/metricgroup.c | 28 +- tools/perf/util/metricgroup.h | 2 + tools/perf/util/ordered-events.c | 2 +- tools/perf/util/parse-events.c | 39 ++- tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.y | 3 +- tools/perf/util/perf_api_probe.c | 164 +++++++++++ tools/perf/util/perf_api_probe.h | 14 + tools/perf/util/pmu.c | 17 +- tools/perf/util/pmu.h | 1 + tools/perf/util/python.c | 4 +- tools/perf/util/record.c | 173 +----------- tools/perf/util/record.h | 1 + tools/perf/util/s390-cpumsf.c | 3 +- .../util/scripting-engines/trace-event-python.c | 6 +- tools/perf/util/session.c | 9 +- tools/perf/util/sideband_evlist.c | 148 ++++++++++ tools/perf/util/smt.c | 10 +- tools/perf/util/sort.c | 10 +- tools/perf/util/stat-display.c | 23 +- tools/perf/util/stat-shadow.c | 53 ++-- tools/perf/util/stat.c | 24 +- tools/perf/util/symbol.c | 14 + tools/perf/util/synthetic-events.c | 159 +++++++---- tools/perf/util/thread-stack.c | 217 ++++++++++++++- tools/perf/util/thread-stack.h | 8 +- tools/perf/util/top.c | 2 +- tools/perf/util/top.h | 2 +- tools/perf/util/trace-event-read.c | 2 +- 135 files changed, 2699 insertions(+), 1517 deletions(-) create mode 100644 tools/build/feature/test-libpfm4.c create mode 100644 tools/lib/api/io.h create mode 100644 tools/perf/bench/kallsyms-parse.c create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json create mode 100644 tools/perf/tests/api-io.c create mode 100644 tools/perf/util/perf_api_probe.c create mode 100644 tools/perf/util/perf_api_probe.h create mode 100644 tools/perf/util/sideband_evlist.c 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. Ubuntu 19.10 and debian experimental are failing when linking against libllvm, which isn't the default, needs to be investigated, haven't tested with CC=gcc, but should be the same problem: + make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= LIBCLANGLLVM=1 -C /git/linux/tools/perf O=/tmp/build/perf CC=clang ... /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x43): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_hasLoopVariable0Matcher::matches(clang::CXXForRangeStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' ... It builds ok with the default set of options. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.7.0-rc2.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.1 (git://git.alpinelinux.org/aports 7c78441134e54efbb34618f457d88c783c913361) (based on LLVM 9.0.1) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus 9.2.1-alt2), clang version 7.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4), clang version 8.0.1 (Red Hat 8.0.1-1.module_el8.1.0+215+a01033fb) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.3.1 20200501 releases/gcc-9.3.0-196-gcb2c76c8b1, clang version 10.0.0 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : FAIL gcc (Debian 9.3.0-11) 9.3.0, clang version 9.0.1-12 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 9.3.0-8) 9.3.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.3.0-8) 9.3.0 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.1 (Fedora 9.0.1-2.fc31) 44 fedora:32 : Ok gcc (GCC) 10.0.1 20200430 (Red Hat 10.0.1-0.13), clang version 10.0.0 (Fedora 10.0.0-1.fc32) 45 fedora:rawhide : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.3.rc2.fc33) 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 51 openmandriva:cooker : Ok gcc (GCC) 10.0.0 20200216 (OpenMandriva), clang version 10.0.0 52 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) 53 opensuse:15.1 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 54 opensuse:15.2 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 55 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 56 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20200128 [revision 83f65674e78d97d27537361de1a9d74067ff228d], clang version 9.0.1 57 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 58 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 59 oraclelinux:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4.5.0.7), clang version 8.0.1 (Red Hat 8.0.1-1.0.1.module+el8.1.0+5428+345cee14) 60 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) 61 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 62 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 63 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 69 ubuntu:18.04 : Ok gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 70 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 71 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 72 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 73 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 76 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 77 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 78 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 79 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 80 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) 81 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 82 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 83 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 84 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 85 ubuntu:19.10 : FAIL gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) 86 ubuntu:20.04 : Ok gcc (Ubuntu 9.3.0-8ubuntu1) 9.3.0, clang version 10.0.0-1ubuntu1 # # uname -a Linux five 5.5.17-200.fc31.x86_64 #1 SMP Mon Apr 13 15:29:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 19ce2321739d perf flamegraph: Use /bin/bash for report and record scripts # perf version --build-options perf version 5.7.rc2.g19ce2321739d dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: PMU events : Ok 11: DSO data read : Ok 12: DSO data cache : Ok 13: DSO data reopen : Ok 14: Roundtrip evsel->name : Ok 15: Parse sched tracepoints fields : Ok 16: syscalls:sys_enter_openat event fields : Ok 17: Setup struct perf_event_attr : Ok 18: Match and link multiple hists : Ok 19: 'import perf' in python : Ok 20: Breakpoint overflow signal handler : Ok 21: Breakpoint overflow sampling : Ok 22: Breakpoint accounting : Ok 23: Watchpoint : 23.1: Read Only Watchpoint : Skip 23.2: Write Only Watchpoint : Ok 23.3: Read / Write Watchpoint : Ok 23.4: Modify Watchpoint : Ok 24: Number of exit events of a simple workload : Ok 25: Software clock events period values : Ok 26: Object code reading : Ok 27: Sample parsing : Ok 28: Use a dummy software event to keep tracking : Ok 29: Parse with no sample_id_all bit set : Ok 30: Filter hist entries : Ok 31: Lookup mmap thread : Ok 32: Share thread maps : Ok 33: Sort output of hist entries : Ok 34: Cumulate child hist entries : Ok 35: Track with sched_switch : Ok 36: Filter fds with revents mask in a fdarray : Ok 37: Add fd to a fdarray, making it autogrow : Ok 38: kmod_path__parse : Ok 39: Thread map : Ok 40: LLVM search and compile : 40.1: Basic BPF llvm compile : Ok 40.2: kbuild searching : Ok 40.3: Compile source for BPF prologue generation : Ok 40.4: Compile source for BPF relocation : Ok 41: Session topology : Ok 42: BPF filter : 42.1: Basic BPF filtering : Ok 42.2: BPF pinning : Ok 42.3: BPF prologue generation : Ok 42.4: BPF relocation checker : Ok 43: Synthesize thread map : Ok 44: Remove thread map : Ok 45: Synthesize cpu map : Ok 46: Synthesize stat config : Ok 47: Synthesize stat : Ok 48: Synthesize stat round : Ok 49: Synthesize attr update : Ok 50: Event times : Ok 51: Read backward ring buffer : Ok 52: Print cpu map : Ok 53: Merge cpu map : Ok 54: Probe SDT events : Ok 55: is_printable_array : Ok 56: Print bitmap : Ok 57: perf hooks : Ok 58: builtin clang support : Skip (not compiled in) 59: unit_number__scnprintf : Ok 60: mem2node : Ok 61: time utils : Ok 62: Test jit_write_elf : Ok 63: Test api io : Ok 64: maps__merge_in : Ok 65: x86 rdpmc : Ok 66: Convert perf time to TSC : Ok 67: DWARF unwind : Ok 68: x86 instruction decoder - new instructions : Ok 69: Intel PT packet decoder : Ok 70: x86 bp modify : Ok 71: probe libc's inet_pton & backtrace it with ping : Ok 72: Use vfs_getname probe to get syscall args filenames : Ok 73: Check open filename arg using perf trace + vfs_getname: Ok 74: Zstd perf.data compression/decompression : Ok 75: Add vfs_getname probe to get syscall args filenames : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_gtk2_O: make NO_GTK2=1 make_clean_all_O: make clean all make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libbpf_O: make NO_LIBBPF=1 make_install_prefix_O: make install prefix=/tmp/krava make_tags_O: make tags make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_perf_o_O: make perf.o make_debug_O: make DEBUG=1 make_doc_O: make doc 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_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_install_O: make install make_install_bin_O: make install-bin make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_pure_O: make make_no_libelf_O: make NO_LIBELF=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_slang_O: make NO_SLANG=1 make_util_map_o_O: make util/map.o make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_newt_O: make NO_NEWT=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_help_O: make help make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libperl_O: make NO_LIBPERL=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* [PATCH 01/91] perf cgroup: Avoid needless closing of unopened fd 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 02/91] perf bench: Fix div-by-zero if runtime is zero Arnaldo Carvalho de Melo ` (89 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Tommi Rantala, Jiri Olsa, Alexander Shishkin, Mark Rutland, Peter Zijlstra, Arnaldo Carvalho de Melo From: Tommi Rantala <tommi.t.rantala@nokia.com> Do not bother with close() if fd is not valid, just to silence valgrind: $ valgrind ./perf script ==59169== Memcheck, a memory error detector ==59169== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==59169== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info ==59169== Command: ./perf script ==59169== ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() ==59169== Warning: invalid file descriptor -1 in syscall close() Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200417132330.119407-1-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/cgroup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c index b73fb7823048..050dea9f1e88 100644 --- a/tools/perf/util/cgroup.c +++ b/tools/perf/util/cgroup.c @@ -107,7 +107,8 @@ static int add_cgroup(struct evlist *evlist, const char *str) static void cgroup__delete(struct cgroup *cgroup) { - close(cgroup->fd); + if (cgroup->fd >= 0) + close(cgroup->fd); zfree(&cgroup->name); free(cgroup); } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 02/91] perf bench: Fix div-by-zero if runtime is zero 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 01/91] perf cgroup: Avoid needless closing of unopened fd Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 03/91] perf evlist: Remove duplicate headers Arnaldo Carvalho de Melo ` (88 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Tommi Rantala, Jiri Olsa, Alexander Shishkin, Darren Hart, Mark Rutland, Peter Zijlstra, Arnaldo Carvalho de Melo From: Tommi Rantala <tommi.t.rantala@nokia.com> Fix div-by-zero if runtime is zero: $ perf bench futex hash --runtime=0 # Running 'futex/hash' benchmark: Run summary [PID 12090]: 4 threads, each operating on 1024 [private] futexes for 0 secs. Floating point exception (core dumped) Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200417132330.119407-4-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/bench/epoll-wait.c | 3 ++- tools/perf/bench/futex-hash.c | 3 ++- tools/perf/bench/futex-lock-pi.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c index f938c585d512..cf797362675b 100644 --- a/tools/perf/bench/epoll-wait.c +++ b/tools/perf/bench/epoll-wait.c @@ -519,7 +519,8 @@ int bench_epoll_wait(int argc, const char **argv) qsort(worker, nthreads, sizeof(struct worker), cmpworker); for (i = 0; i < nthreads; i++) { - unsigned long t = worker[i].ops / bench__runtime.tv_sec; + unsigned long t = bench__runtime.tv_sec > 0 ? + worker[i].ops / bench__runtime.tv_sec : 0; update_stats(&throughput_stats, t); diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index 65eebe06c04d..915bf3da7ce2 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c @@ -205,7 +205,8 @@ int bench_futex_hash(int argc, const char **argv) pthread_mutex_destroy(&thread_lock); for (i = 0; i < nthreads; i++) { - unsigned long t = worker[i].ops / bench__runtime.tv_sec; + unsigned long t = bench__runtime.tv_sec > 0 ? + worker[i].ops / bench__runtime.tv_sec : 0; update_stats(&throughput_stats, t); if (!silent) { if (nfutexes == 1) diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index 89fd8f325f38..bb25d8beb3b8 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c @@ -211,7 +211,8 @@ int bench_futex_lock_pi(int argc, const char **argv) pthread_mutex_destroy(&thread_lock); for (i = 0; i < nthreads; i++) { - unsigned long t = worker[i].ops / bench__runtime.tv_sec; + unsigned long t = bench__runtime.tv_sec > 0 ? + worker[i].ops / bench__runtime.tv_sec : 0; update_stats(&throughput_stats, t); if (!silent) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 03/91] perf evlist: Remove duplicate headers 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 01/91] perf cgroup: Avoid needless closing of unopened fd Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 02/91] perf bench: Fix div-by-zero if runtime is zero Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 04/91] perf script: Avoid NULL dereference on symbol Arnaldo Carvalho de Melo ` (87 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Jagadeesh Pagadala, Andi Kleen, Arnaldo Carvalho de Melo From: Jagadeesh Pagadala <jagdsh.linux@gmail.com> Code cleanup: Remove duplicate headers which are included twice. Signed-off-by: Jagadeesh Pagadala <jagdsh.linux@gmail.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Link: http://lore.kernel.org/lkml/1587276836-17088-1-git-send-email-jagdsh.linux@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/perf/evlist.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c index 5b9f2ca50591..def55054c55b 100644 --- a/tools/lib/perf/evlist.c +++ b/tools/lib/perf/evlist.c @@ -11,10 +11,8 @@ #include <internal/mmap.h> #include <internal/cpumap.h> #include <internal/threadmap.h> -#include <internal/xyarray.h> #include <internal/lib.h> #include <linux/zalloc.h> -#include <sys/ioctl.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 04/91] perf script: Avoid NULL dereference on symbol 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (2 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 03/91] perf evlist: Remove duplicate headers Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 05/91] perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode Arnaldo Carvalho de Melo ` (86 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Jiri Olsa, Alexander Shishkin, Mark Rutland, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> al->sym may be NULL given current if conditions and may cause a segv. Fixes: d2bedb7863e9 ("perf script: Allow --symbol to accept hexadecimal addresses") Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20200421004329.43109-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index dc0e11214ae1..f581550a3015 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -626,7 +626,7 @@ int machine__resolve(struct machine *machine, struct addr_location *al, ret = strlist__has_entry(symbol_conf.sym_list, al->sym->name); } - if (!(ret && al->sym)) { + if (!ret && al->sym) { snprintf(al_addr_str, sz, "0x%"PRIx64, al->map->unmap_ip(al->map, al->sym->start)); ret = strlist__has_entry(symbol_conf.sym_list, -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 05/91] perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (3 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 04/91] perf script: Avoid NULL dereference on symbol Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 06/91] perf stat: Improve runtime stat " Arnaldo Carvalho de Melo ` (85 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Jin Yao, Alexander Shishkin, Andi Kleen, Jin Yao, Kan Liang, Peter Zijlstra, Arnaldo Carvalho de Melo From: Jin Yao <yao.jin@linux.intel.com> As the code comments in perf_stat_process_counter() say, we calculate counter's data every interval, and the display code shows ps->res_stats avg value. We need to zero the stats for interval mode. But the current code only zeros the res_stats[0], it doesn't zero the res_stats[1] and res_stats[2], which are for ena and run of counter. This patch zeros the whole res_stats[] for interval mode. Fixes: 51fd2df1e882 ("perf stat: Fix interval output values") Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200409070755.17261-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/stat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 5f26137b8d60..242476eb808c 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -368,8 +368,10 @@ int perf_stat_process_counter(struct perf_stat_config *config, * interval mode, otherwise overall avg running * averages will be shown for each interval. */ - if (config->interval) - init_stats(ps->res_stats); + if (config->interval) { + for (i = 0; i < 3; i++) + init_stats(&ps->res_stats[i]); + } if (counter->per_pkg) zero_per_pkg(counter); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 06/91] perf stat: Improve runtime stat for interval mode 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (4 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 05/91] perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 07/91] perf test session topology: Fix data path Arnaldo Carvalho de Melo ` (84 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Jin Yao, Jiri Olsa, Kajol Jain, Alexander Shishkin, Andi Kleen, Jin Yao, Kan Liang, Peter Zijlstra, Arnaldo Carvalho de Melo From: Jin Yao <yao.jin@linux.intel.com> For interval mode, the metric is printed after the '#' character if it exists. But it's not calculated by the counts generated in this interval. See the following examples: root@kbl-ppc:~# perf stat -M CPI -I1000 --interval-count 2 # time counts unit events 1.000422803 764,809 inst_retired.any # 2.9 CPI 1.000422803 2,234,932 cycles 2.001464585 1,960,061 inst_retired.any # 1.6 CPI 2.001464585 4,022,591 cycles The second CPI should not be 1.6 (4,022,591/1,960,061 is 2.1) root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2 # time counts unit events 1.000429493 2,869,311 cycles 1.000429493 816,875 instructions # 0.28 insn per cycle 2.001516426 9,260,973 cycles 2.001516426 5,250,634 instructions # 0.87 insn per cycle The second 'insn per cycle' should not be 0.87 (5,250,634/9,260,973 is 0.57). The current code uses a global variable 'rt_stat' for tracking and updating the std dev of runtime stat. Unlike the counts, 'rt_stat' is not reset for interval. While the counts are reset for interval. perf_stat_process_counter() { if (config->interval) init_stats(ps->res_stats); } So for interval mode, the 'rt_stat' variable should be reset too. This patch resets 'rt_stat' before read_counters(), so the runtime stat is only calculated by the counts generated in this interval. With this patch: root@kbl-ppc:~# perf stat -M CPI -I1000 --interval-count 2 # time counts unit events 1.000420924 2,408,818 inst_retired.any # 2.1 CPI 1.000420924 5,010,111 cycles 2.001448579 2,798,407 inst_retired.any # 1.6 CPI 2.001448579 4,599,861 cycles root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2 # time counts unit events 1.000428555 2,769,714 cycles 1.000428555 774,462 instructions # 0.28 insn per cycle 2.001471562 3,595,904 cycles 2.001471562 1,243,703 instructions # 0.35 insn per cycle Now the second 'insn per cycle' and CPI are calculated by the counts generated in this interval. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Tested-By: Kajol Jain <kjain@linux.ibm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@intel.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200420145417.6864-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-stat.txt | 2 ++ tools/perf/builtin-stat.c | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt index 4d56586b2fb9..3fb5028aef08 100644 --- a/tools/perf/Documentation/perf-stat.txt +++ b/tools/perf/Documentation/perf-stat.txt @@ -176,6 +176,8 @@ Print count deltas every N milliseconds (minimum: 1ms) The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution. example: 'perf stat -I 1000 -e cycles -a sleep 5' +If the metric exists, it is calculated by the counts generated in this interval and the metric is printed after #. + --interval-count times:: Print count deltas for fixed number of times. This option should be used together with "-I" option. diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 9207b6c45475..3f050d85c277 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -359,6 +359,7 @@ static void process_interval(void) clock_gettime(CLOCK_MONOTONIC, &ts); diff_timespec(&rs, &ts, &ref_time); + perf_stat__reset_shadow_per_stat(&rt_stat); read_counters(&rs); if (STAT_RECORD) { -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 07/91] perf test session topology: Fix data path 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (5 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 06/91] perf stat: Improve runtime stat " Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 08/91] perf record: Add num-synthesize-threads option Arnaldo Carvalho de Melo ` (83 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Tommi Rantala, Arnaldo Carvalho de Melo, Jiri Olsa, Alexander Shishkin, Mamatha Inamdar, Mark Rutland, Peter Zijlstra, Ravi Bangoria From: Tommi Rantala <tommi.t.rantala@nokia.com> Commit 2d4f27999b88 ("perf data: Add global path holder") missed path conversion in tests/topology.c, causing the "Session topology" testcase to "hang" (waits forever for input from stdin) when doing "ssh $VM perf test". Can be reproduced by running "cat | perf test topo", and crashed by replacing cat with true: $ true | perf test -v topo 40: Session topology : --- start --- test child forked, pid 3638 templ file: /tmp/perf-test-QPvAch incompatible file format incompatible file format (rerun with -v to learn more) free(): invalid pointer test child interrupted ---- end ---- Session topology: FAILED! Committer testing: Reproduced the above result before the patch and after it is back working: # true | perf test -v topo 41: Session topology : --- start --- test child forked, pid 19374 templ file: /tmp/perf-test-YOTEQg CPU 0, core 0, socket 0 CPU 1, core 1, socket 0 CPU 2, core 2, socket 0 CPU 3, core 3, socket 0 CPU 4, core 0, socket 0 CPU 5, core 1, socket 0 CPU 6, core 2, socket 0 CPU 7, core 3, socket 0 test child finished with 0 ---- end ---- Session topology: Ok # Fixes: 2d4f27999b88 ("perf data: Add global path holder") Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Link: http://lore.kernel.org/lkml/20200423115341.562782-1-tommi.t.rantala@nokia.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/topology.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 4a800499d7c3..22daf2bdf5fa 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -33,10 +33,8 @@ static int session_write_header(char *path) { struct perf_session *session; struct perf_data data = { - .file = { - .path = path, - }, - .mode = PERF_DATA_MODE_WRITE, + .path = path, + .mode = PERF_DATA_MODE_WRITE, }; session = perf_session__new(&data, false, NULL); @@ -63,10 +61,8 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) { struct perf_session *session; struct perf_data data = { - .file = { - .path = path, - }, - .mode = PERF_DATA_MODE_READ, + .path = path, + .mode = PERF_DATA_MODE_READ, }; int i; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 08/91] perf record: Add num-synthesize-threads option 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (6 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 07/91] perf test session topology: Fix data path Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 09/91] perf bench: Add a multi-threaded synthesize benchmark Arnaldo Carvalho de Melo ` (82 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Stephane Eranian, Ian Rogers, Jiri Olsa, Adrian Hunter, Alexander Shishkin, Alexey Budankov, Kan Liang, Mark Rutland, Peter Zijlstra, Tony Jones, yuzhoujian, Arnaldo Carvalho de Melo From: Stephane Eranian <eranian@google.com> To control degree of parallelism of the synthesize_mmap() code which is scanning /proc/PID/task/PID/maps and can be time consuming. Mimic perf top way of handling the option. If not specified will default to 1 thread, i.e. default behavior before this option. On a desktop computer the processing of /proc/PID/task/PID/maps isn't slow enough to warrant parallel processing and the thread creation has some cost - hence the default of 1. On a loaded server with >100 cores it is possible to see synthesis times in the order of seconds and in this case having the option is desirable. As the processing is a synchronization point, it is legitimate to worry if Amdahl's law will apply to this patch. Profiling with this patch in place: https://lore.kernel.org/lkml/20200415054050.31645-4-irogers@google.com/ shows: ... - 32.59% __perf_event__synthesize_threads - 32.54% __event__synthesize_thread + 22.13% perf_event__synthesize_mmap_events + 6.68% perf_event__get_comm_ids.constprop.0 + 1.49% process_synthesized_event + 1.29% __GI___readdir64 + 0.60% __opendir ... That is the processing is 1.49% of execution time and there is plenty to make parallel. This is shown in the benchmark in this patch: https://lore.kernel.org/lkml/20200415054050.31645-2-irogers@google.com/ Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 1 Average synthesis took: 127729.000 usec (+- 3372.880 usec) Average num. events: 21548.600 (+- 0.306) Average time per event 5.927 usec Number of synthesis threads: 2 Average synthesis took: 88863.500 usec (+- 385.168 usec) Average num. events: 21552.800 (+- 0.327) Average time per event 4.123 usec Number of synthesis threads: 3 Average synthesis took: 83257.400 usec (+- 348.617 usec) Average num. events: 21553.200 (+- 0.327) Average time per event 3.863 usec Number of synthesis threads: 4 Average synthesis took: 75093.000 usec (+- 422.978 usec) Average num. events: 21554.200 (+- 0.200) Average time per event 3.484 usec Number of synthesis threads: 5 Average synthesis took: 64896.600 usec (+- 353.348 usec) Average num. events: 21558.000 (+- 0.000) Average time per event 3.010 usec Number of synthesis threads: 6 Average synthesis took: 59210.200 usec (+- 342.890 usec) Average num. events: 21560.000 (+- 0.000) Average time per event 2.746 usec Number of synthesis threads: 7 Average synthesis took: 54093.900 usec (+- 306.247 usec) Average num. events: 21562.000 (+- 0.000) Average time per event 2.509 usec Number of synthesis threads: 8 Average synthesis took: 48938.700 usec (+- 341.732 usec) Average num. events: 21564.000 (+- 0.000) Average time per event 2.269 usec Where average time per synthesized event goes from 5.927 usec with 1 thread to 2.269 usec with 8. This isn't a linear speed up as not all of synthesize code has been made parallel. If the synthesis time was about 10 seconds then using 8 threads may bring this down to less than 4. Signed-off-by: Stephane Eranian <eranian@google.com> Reviewed-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tony Jones <tonyj@suse.de> Cc: yuzhoujian <yuzhoujian@didichuxing.com> Link: http://lore.kernel.org/lkml/20200422155038.9380-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-record.txt | 4 +++ tools/perf/builtin-record.c | 34 ++++++++++++++++++++++-- tools/perf/util/record.h | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index b3f3b3f1c161..6e8b4649307c 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -596,6 +596,10 @@ Make a copy of /proc/kcore and place it into a directory with the perf data file Limit the sample data max size, <size> is expected to be a number with appended unit character - B/K/M/G +--num-thread-synthesize:: + The number of threads to run when synthesizing events for existing processes. + By default, the number of threads equals 1. + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-intel-pt[1] diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 1ab349abe904..2e8011f179f2 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -43,6 +43,7 @@ #include "util/time-utils.h" #include "util/units.h" #include "util/bpf-event.h" +#include "util/util.h" #include "asm/bug.h" #include "perf.h" @@ -50,6 +51,7 @@ #include <inttypes.h> #include <locale.h> #include <poll.h> +#include <pthread.h> #include <unistd.h> #include <sched.h> #include <signal.h> @@ -503,6 +505,20 @@ static int process_synthesized_event(struct perf_tool *tool, return record__write(rec, NULL, event, event->header.size); } +static int process_locked_synthesized_event(struct perf_tool *tool, + union perf_event *event, + struct perf_sample *sample __maybe_unused, + struct machine *machine __maybe_unused) +{ + static pthread_mutex_t synth_lock = PTHREAD_MUTEX_INITIALIZER; + int ret; + + pthread_mutex_lock(&synth_lock); + ret = process_synthesized_event(tool, event, sample, machine); + pthread_mutex_unlock(&synth_lock); + return ret; +} + static int record__pushfn(struct mmap *map, void *to, void *bf, size_t size) { struct record *rec = to; @@ -1288,6 +1304,7 @@ static int record__synthesize(struct record *rec, bool tail) struct perf_tool *tool = &rec->tool; int fd = perf_data__fd(data); int err = 0; + event_op f = process_synthesized_event; if (rec->opts.tail_synthesize != tail) return 0; @@ -1402,9 +1419,18 @@ static int record__synthesize(struct record *rec, bool tail) if (err < 0) pr_warning("Couldn't synthesize cgroup events.\n"); + if (rec->opts.nr_threads_synthesize > 1) { + perf_set_multithreaded(); + f = process_locked_synthesized_event; + } + err = __machine__synthesize_threads(machine, tool, &opts->target, rec->evlist->core.threads, - process_synthesized_event, opts->sample_address, - 1); + f, opts->sample_address, + rec->opts.nr_threads_synthesize); + + if (rec->opts.nr_threads_synthesize > 1) + perf_set_singlethreaded(); + out: return err; } @@ -2232,6 +2258,7 @@ static struct record record = { .default_per_cpu = true, }, .mmap_flush = MMAP_FLUSH_DEFAULT, + .nr_threads_synthesize = 1, }, .tool = { .sample = process_sample_event, @@ -2421,6 +2448,9 @@ static struct option __record_options[] = { #endif OPT_CALLBACK(0, "max-size", &record.output_max_size, "size", "Limit the maximum size of the output file", parse_output_max_size), + OPT_UINTEGER(0, "num-thread-synthesize", + &record.opts.nr_threads_synthesize, + "number of threads to run for event synthesis"), OPT_END() }; diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h index 24316458be20..923565c3b155 100644 --- a/tools/perf/util/record.h +++ b/tools/perf/util/record.h @@ -68,6 +68,7 @@ struct record_opts { int affinity; int mmap_flush; unsigned int comp_level; + unsigned int nr_threads_synthesize; }; extern const char * const *record_usage; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 09/91] perf bench: Add a multi-threaded synthesize benchmark 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (7 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 08/91] perf record: Add num-synthesize-threads option Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 10/91] tools api: Add a lightweight buffered reading api Arnaldo Carvalho de Melo ` (81 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Arnaldo Carvalho de Melo, Jiri Olsa, Alexander Shishkin, Andrey Zhizhikin, Kan Liang, Kefeng Wang, Mark Rutland, Peter Zijlstra, Petr Mladek, Stephane Eranian From: Ian Rogers <irogers@google.com> By default this isn't run as it reads /proc and may not have access. For consistency, modify the single threaded benchmark to compute an average time per event. Committer testing: $ grep -m1 "model name" /proc/cpuinfo model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz $ grep "model name" /proc/cpuinfo | wc -l 8 $ $ perf bench internals synthesize -h # Running 'internals/synthesize' benchmark: Usage: perf bench internals synthesize <options> -I, --multi-iterations <n> Number of iterations used to compute multi-threaded average -i, --single-iterations <n> Number of iterations used to compute single-threaded average -M, --max-threads <n> Maximum number of threads in multithreaded bench -m, --min-threads <n> Minimum number of threads in multithreaded bench -s, --st Run single threaded benchmark -t, --mt Run multi-threaded benchmark $ $ perf bench internals synthesize -t # Running 'internals/synthesize' benchmark: Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 1 Average synthesis took: 65449.000 usec (+- 586.442 usec) Average num. events: 9405.400 (+- 0.306) Average time per event 6.959 usec Number of synthesis threads: 2 Average synthesis took: 37838.300 usec (+- 130.259 usec) Average num. events: 9501.800 (+- 20.469) Average time per event 3.982 usec Number of synthesis threads: 3 Average synthesis took: 48551.400 usec (+- 225.686 usec) Average num. events: 9544.000 (+- 0.000) Average time per event 5.087 usec Number of synthesis threads: 4 Average synthesis took: 29632.500 usec (+- 50.808 usec) Average num. events: 9544.000 (+- 0.000) Average time per event 3.105 usec Number of synthesis threads: 5 Average synthesis took: 33920.400 usec (+- 284.509 usec) Average num. events: 9544.000 (+- 0.000) Average time per event 3.554 usec Number of synthesis threads: 6 Average synthesis took: 27604.100 usec (+- 72.344 usec) Average num. events: 9548.000 (+- 0.000) Average time per event 2.891 usec Number of synthesis threads: 7 Average synthesis took: 25406.300 usec (+- 933.371 usec) Average num. events: 9545.500 (+- 0.167) Average time per event 2.662 usec Number of synthesis threads: 8 Average synthesis took: 24110.400 usec (+- 73.229 usec) Average num. events: 9551.000 (+- 0.000) Average time per event 2.524 usec $ Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andrey Zhizhikin <andrey.z@gmail.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200415054050.31645-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/bench/synthesize.c | 211 ++++++++++++++++++++++++++++++---- 1 file changed, 186 insertions(+), 25 deletions(-) diff --git a/tools/perf/bench/synthesize.c b/tools/perf/bench/synthesize.c index 6291257bc9c9..8d624aea1c5e 100644 --- a/tools/perf/bench/synthesize.c +++ b/tools/perf/bench/synthesize.c @@ -10,60 +10,105 @@ #include "bench.h" #include "../util/debug.h" #include "../util/session.h" +#include "../util/stat.h" #include "../util/synthetic-events.h" #include "../util/target.h" #include "../util/thread_map.h" #include "../util/tool.h" +#include "../util/util.h" +#include <linux/atomic.h> #include <linux/err.h> #include <linux/time64.h> #include <subcmd/parse-options.h> -static unsigned int iterations = 10000; +static unsigned int min_threads = 1; +static unsigned int max_threads = UINT_MAX; +static unsigned int single_iterations = 10000; +static unsigned int multi_iterations = 10; +static bool run_st; +static bool run_mt; static const struct option options[] = { - OPT_UINTEGER('i', "iterations", &iterations, - "Number of iterations used to compute average"), + OPT_BOOLEAN('s', "st", &run_st, "Run single threaded benchmark"), + OPT_BOOLEAN('t', "mt", &run_mt, "Run multi-threaded benchmark"), + OPT_UINTEGER('m', "min-threads", &min_threads, + "Minimum number of threads in multithreaded bench"), + OPT_UINTEGER('M', "max-threads", &max_threads, + "Maximum number of threads in multithreaded bench"), + OPT_UINTEGER('i', "single-iterations", &single_iterations, + "Number of iterations used to compute single-threaded average"), + OPT_UINTEGER('I', "multi-iterations", &multi_iterations, + "Number of iterations used to compute multi-threaded average"), OPT_END() }; -static const char *const usage[] = { +static const char *const bench_usage[] = { "perf bench internals synthesize <options>", NULL }; +static atomic_t event_count; -static int do_synthesize(struct perf_session *session, - struct perf_thread_map *threads, - struct target *target, bool data_mmap) +static int process_synthesized_event(struct perf_tool *tool __maybe_unused, + union perf_event *event __maybe_unused, + struct perf_sample *sample __maybe_unused, + struct machine *machine __maybe_unused) +{ + atomic_inc(&event_count); + return 0; +} + +static int do_run_single_threaded(struct perf_session *session, + struct perf_thread_map *threads, + struct target *target, bool data_mmap) { const unsigned int nr_threads_synthesize = 1; struct timeval start, end, diff; u64 runtime_us; unsigned int i; - double average; + double time_average, time_stddev, event_average, event_stddev; int err; + struct stats time_stats, event_stats; - gettimeofday(&start, NULL); - for (i = 0; i < iterations; i++) { - err = machine__synthesize_threads(&session->machines.host, - target, threads, data_mmap, + init_stats(&time_stats); + init_stats(&event_stats); + + for (i = 0; i < single_iterations; i++) { + atomic_set(&event_count, 0); + gettimeofday(&start, NULL); + err = __machine__synthesize_threads(&session->machines.host, + NULL, + target, threads, + process_synthesized_event, + data_mmap, nr_threads_synthesize); if (err) return err; + + gettimeofday(&end, NULL); + timersub(&end, &start, &diff); + runtime_us = diff.tv_sec * USEC_PER_SEC + diff.tv_usec; + update_stats(&time_stats, runtime_us); + update_stats(&event_stats, atomic_read(&event_count)); } - gettimeofday(&end, NULL); - timersub(&end, &start, &diff); - runtime_us = diff.tv_sec * USEC_PER_SEC + diff.tv_usec; - average = (double)runtime_us/(double)iterations; - printf("Average %ssynthesis took: %f usec\n", - data_mmap ? "data " : "", average); + time_average = avg_stats(&time_stats); + time_stddev = stddev_stats(&time_stats); + printf(" Average %ssynthesis took: %.3f usec (+- %.3f usec)\n", + data_mmap ? "data " : "", time_average, time_stddev); + + event_average = avg_stats(&event_stats); + event_stddev = stddev_stats(&event_stats); + printf(" Average num. events: %.3f (+- %.3f)\n", + event_average, event_stddev); + + printf(" Average time per event %.3f usec\n", + time_average / event_average); return 0; } -int bench_synthesize(int argc, const char **argv) +static int run_single_threaded(void) { - struct perf_tool tool; struct perf_session *session; struct target target = { .pid = "self", @@ -71,8 +116,7 @@ int bench_synthesize(int argc, const char **argv) struct perf_thread_map *threads; int err; - argc = parse_options(argc, argv, options, usage, 0); - + perf_set_singlethreaded(); session = perf_session__new(NULL, false, NULL); if (IS_ERR(session)) { pr_err("Session creation failed.\n"); @@ -84,13 +128,16 @@ int bench_synthesize(int argc, const char **argv) err = -ENOMEM; goto err_out; } - perf_tool__fill_defaults(&tool); - err = do_synthesize(session, threads, &target, false); + puts( +"Computing performance of single threaded perf event synthesis by\n" +"synthesizing events on the perf process itself:"); + + err = do_run_single_threaded(session, threads, &target, false); if (err) goto err_out; - err = do_synthesize(session, threads, &target, true); + err = do_run_single_threaded(session, threads, &target, true); err_out: if (threads) @@ -99,3 +146,117 @@ int bench_synthesize(int argc, const char **argv) perf_session__delete(session); return err; } + +static int do_run_multi_threaded(struct target *target, + unsigned int nr_threads_synthesize) +{ + struct timeval start, end, diff; + u64 runtime_us; + unsigned int i; + double time_average, time_stddev, event_average, event_stddev; + int err; + struct stats time_stats, event_stats; + struct perf_session *session; + + init_stats(&time_stats); + init_stats(&event_stats); + for (i = 0; i < multi_iterations; i++) { + session = perf_session__new(NULL, false, NULL); + if (!session) + return -ENOMEM; + + atomic_set(&event_count, 0); + gettimeofday(&start, NULL); + err = __machine__synthesize_threads(&session->machines.host, + NULL, + target, NULL, + process_synthesized_event, + false, + nr_threads_synthesize); + if (err) { + perf_session__delete(session); + return err; + } + + gettimeofday(&end, NULL); + timersub(&end, &start, &diff); + runtime_us = diff.tv_sec * USEC_PER_SEC + diff.tv_usec; + update_stats(&time_stats, runtime_us); + update_stats(&event_stats, atomic_read(&event_count)); + perf_session__delete(session); + } + + time_average = avg_stats(&time_stats); + time_stddev = stddev_stats(&time_stats); + printf(" Average synthesis took: %.3f usec (+- %.3f usec)\n", + time_average, time_stddev); + + event_average = avg_stats(&event_stats); + event_stddev = stddev_stats(&event_stats); + printf(" Average num. events: %.3f (+- %.3f)\n", + event_average, event_stddev); + + printf(" Average time per event %.3f usec\n", + time_average / event_average); + return 0; +} + +static int run_multi_threaded(void) +{ + struct target target = { + .cpu_list = "0" + }; + unsigned int nr_threads_synthesize; + int err; + + if (max_threads == UINT_MAX) + max_threads = sysconf(_SC_NPROCESSORS_ONLN); + + puts( +"Computing performance of multi threaded perf event synthesis by\n" +"synthesizing events on CPU 0:"); + + for (nr_threads_synthesize = min_threads; + nr_threads_synthesize <= max_threads; + nr_threads_synthesize++) { + if (nr_threads_synthesize == 1) + perf_set_singlethreaded(); + else + perf_set_multithreaded(); + + printf(" Number of synthesis threads: %u\n", + nr_threads_synthesize); + + err = do_run_multi_threaded(&target, nr_threads_synthesize); + if (err) + return err; + } + perf_set_singlethreaded(); + return 0; +} + +int bench_synthesize(int argc, const char **argv) +{ + int err = 0; + + argc = parse_options(argc, argv, options, bench_usage, 0); + if (argc) { + usage_with_options(bench_usage, options); + exit(EXIT_FAILURE); + } + + /* + * If neither single threaded or multi-threaded are specified, default + * to running just single threaded. + */ + if (!run_st && !run_mt) + run_st = true; + + if (run_st) + err = run_single_threaded(); + + if (!err && run_mt) + err = run_multi_threaded(); + + return err; +} -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 10/91] tools api: Add a lightweight buffered reading api 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (8 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 09/91] perf bench: Add a multi-threaded synthesize benchmark Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 11/91] perf synthetic events: Remove use of sscanf from /proc reading Arnaldo Carvalho de Melo ` (80 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Jiri Olsa, Arnaldo Carvalho de Melo, Alexander Shishkin, Andrey Zhizhikin, Kan Liang, Kefeng Wang, Mark Rutland, Peter Zijlstra, Petr Mladek, Stephane Eranian From: Ian Rogers <irogers@google.com> The synthesize benchmark shows the majority of execution time going to fgets and sscanf, necessary to parse /proc/pid/maps. Add a new buffered reading library that will be used to replace these calls in a follow-up CL. Add tests for the library to perf test. Committer tests: $ perf test api 63: Test api io : Ok $ Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andrey Zhizhikin <andrey.z@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200415054050.31645-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/api/io.h | 112 ++++++++++++ tools/perf/tests/Build | 1 + tools/perf/tests/api-io.c | 304 ++++++++++++++++++++++++++++++++ tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/tests.h | 1 + 5 files changed, 422 insertions(+) create mode 100644 tools/lib/api/io.h create mode 100644 tools/perf/tests/api-io.c diff --git a/tools/lib/api/io.h b/tools/lib/api/io.h new file mode 100644 index 000000000000..b7e55b5f8a4a --- /dev/null +++ b/tools/lib/api/io.h @@ -0,0 +1,112 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Lightweight buffered reading library. + * + * Copyright 2019 Google LLC. + */ +#ifndef __API_IO__ +#define __API_IO__ + +struct io { + /* File descriptor being read/ */ + int fd; + /* Size of the read buffer. */ + unsigned int buf_len; + /* Pointer to storage for buffering read. */ + char *buf; + /* End of the storage. */ + char *end; + /* Currently accessed data pointer. */ + char *data; + /* Set true on when the end of file on read error. */ + bool eof; +}; + +static inline void io__init(struct io *io, int fd, + char *buf, unsigned int buf_len) +{ + io->fd = fd; + io->buf_len = buf_len; + io->buf = buf; + io->end = buf; + io->data = buf; + io->eof = false; +} + +/* Reads one character from the "io" file with similar semantics to fgetc. */ +static inline int io__get_char(struct io *io) +{ + char *ptr = io->data; + + if (io->eof) + return -1; + + if (ptr == io->end) { + ssize_t n = read(io->fd, io->buf, io->buf_len); + + if (n <= 0) { + io->eof = true; + return -1; + } + ptr = &io->buf[0]; + io->end = &io->buf[n]; + } + io->data = ptr + 1; + return *ptr; +} + +/* Read a hexadecimal value with no 0x prefix into the out argument hex. If the + * first character isn't hexadecimal returns -2, io->eof returns -1, otherwise + * returns the character after the hexadecimal value which may be -1 for eof. + * If the read value is larger than a u64 the high-order bits will be dropped. + */ +static inline int io__get_hex(struct io *io, __u64 *hex) +{ + bool first_read = true; + + *hex = 0; + while (true) { + int ch = io__get_char(io); + + if (ch < 0) + return ch; + if (ch >= '0' && ch <= '9') + *hex = (*hex << 4) | (ch - '0'); + else if (ch >= 'a' && ch <= 'f') + *hex = (*hex << 4) | (ch - 'a' + 10); + else if (ch >= 'A' && ch <= 'F') + *hex = (*hex << 4) | (ch - 'A' + 10); + else if (first_read) + return -2; + else + return ch; + first_read = false; + } +} + +/* Read a positive decimal value with out argument dec. If the first character + * isn't a decimal returns -2, io->eof returns -1, otherwise returns the + * character after the decimal value which may be -1 for eof. If the read value + * is larger than a u64 the high-order bits will be dropped. + */ +static inline int io__get_dec(struct io *io, __u64 *dec) +{ + bool first_read = true; + + *dec = 0; + while (true) { + int ch = io__get_char(io); + + if (ch < 0) + return ch; + if (ch >= '0' && ch <= '9') + *dec = (*dec * 10) + ch - '0'; + else if (first_read) + return -2; + else + return ch; + first_read = false; + } +} + +#endif /* __API_IO__ */ diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build index b3d1bf13ca07..c75557aeef0e 100644 --- a/tools/perf/tests/Build +++ b/tools/perf/tests/Build @@ -56,6 +56,7 @@ perf-y += mem2node.o perf-y += maps.o perf-y += time-utils-test.o perf-y += genelf.o +perf-y += api-io.o $(OUTPUT)tests/llvm-src-base.c: tests/bpf-script-example.c tests/Build $(call rule_mkdir) diff --git a/tools/perf/tests/api-io.c b/tools/perf/tests/api-io.c new file mode 100644 index 000000000000..2ada86ad6084 --- /dev/null +++ b/tools/perf/tests/api-io.c @@ -0,0 +1,304 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "debug.h" +#include "tests.h" +#include <api/io.h> +#include <linux/kernel.h> + +#define TEMPL "/tmp/perf-test-XXXXXX" + +#define EXPECT_EQUAL(val, expected) \ +do { \ + if (val != expected) { \ + pr_debug("%s:%d: %d != %d\n", \ + __FILE__, __LINE__, val, expected); \ + ret = -1; \ + } \ +} while (0) + +#define EXPECT_EQUAL64(val, expected) \ +do { \ + if (val != expected) { \ + pr_debug("%s:%d: %lld != %lld\n", \ + __FILE__, __LINE__, val, expected); \ + ret = -1; \ + } \ +} while (0) + +static int make_test_file(char path[PATH_MAX], const char *contents) +{ + ssize_t contents_len = strlen(contents); + int fd; + + strcpy(path, TEMPL); + fd = mkstemp(path); + if (fd < 0) { + pr_debug("mkstemp failed"); + return -1; + } + if (write(fd, contents, contents_len) < contents_len) { + pr_debug("short write"); + close(fd); + unlink(path); + return -1; + } + close(fd); + return 0; +} + +static int setup_test(char path[PATH_MAX], const char *contents, + size_t buf_size, struct io *io) +{ + if (make_test_file(path, contents)) + return -1; + + io->fd = open(path, O_RDONLY); + if (io->fd < 0) { + pr_debug("Failed to open '%s'\n", path); + unlink(path); + return -1; + } + io->buf = malloc(buf_size); + if (io->buf == NULL) { + pr_debug("Failed to allocate memory"); + close(io->fd); + unlink(path); + return -1; + } + io__init(io, io->fd, io->buf, buf_size); + return 0; +} + +static void cleanup_test(char path[PATH_MAX], struct io *io) +{ + free(io->buf); + close(io->fd); + unlink(path); +} + +static int do_test_get_char(const char *test_string, size_t buf_size) +{ + char path[PATH_MAX]; + struct io io; + int ch, ret = 0; + size_t i; + + if (setup_test(path, test_string, buf_size, &io)) + return -1; + + for (i = 0; i < strlen(test_string); i++) { + ch = io__get_char(&io); + + EXPECT_EQUAL(ch, test_string[i]); + EXPECT_EQUAL(io.eof, false); + } + ch = io__get_char(&io); + EXPECT_EQUAL(ch, -1); + EXPECT_EQUAL(io.eof, true); + + cleanup_test(path, &io); + return ret; +} + +static int test_get_char(void) +{ + int i, ret = 0; + size_t j; + + static const char *const test_strings[] = { + "12345678abcdef90", + "a\nb\nc\nd\n", + "\a\b\t\v\f\r", + }; + for (i = 0; i <= 10; i++) { + for (j = 0; j < ARRAY_SIZE(test_strings); j++) { + if (do_test_get_char(test_strings[j], 1 << i)) + ret = -1; + } + } + return ret; +} + +static int do_test_get_hex(const char *test_string, + __u64 val1, int ch1, + __u64 val2, int ch2, + __u64 val3, int ch3, + bool end_eof) +{ + char path[PATH_MAX]; + struct io io; + int ch, ret = 0; + __u64 hex; + + if (setup_test(path, test_string, 4, &io)) + return -1; + + ch = io__get_hex(&io, &hex); + EXPECT_EQUAL64(hex, val1); + EXPECT_EQUAL(ch, ch1); + + ch = io__get_hex(&io, &hex); + EXPECT_EQUAL64(hex, val2); + EXPECT_EQUAL(ch, ch2); + + ch = io__get_hex(&io, &hex); + EXPECT_EQUAL64(hex, val3); + EXPECT_EQUAL(ch, ch3); + + EXPECT_EQUAL(io.eof, end_eof); + + cleanup_test(path, &io); + return ret; +} + +static int test_get_hex(void) +{ + int ret = 0; + + if (do_test_get_hex("12345678abcdef90", + 0x12345678abcdef90, -1, + 0, -1, + 0, -1, + true)) + ret = -1; + + if (do_test_get_hex("1\n2\n3\n", + 1, '\n', + 2, '\n', + 3, '\n', + false)) + ret = -1; + + if (do_test_get_hex("12345678ABCDEF90;a;b", + 0x12345678abcdef90, ';', + 0xa, ';', + 0xb, -1, + true)) + ret = -1; + + if (do_test_get_hex("0x1x2x", + 0, 'x', + 1, 'x', + 2, 'x', + false)) + ret = -1; + + if (do_test_get_hex("x1x", + 0, -2, + 1, 'x', + 0, -1, + true)) + ret = -1; + + if (do_test_get_hex("10000000000000000000000000000abcdefgh99i", + 0xabcdef, 'g', + 0, -2, + 0x99, 'i', + false)) + ret = -1; + + return ret; +} + +static int do_test_get_dec(const char *test_string, + __u64 val1, int ch1, + __u64 val2, int ch2, + __u64 val3, int ch3, + bool end_eof) +{ + char path[PATH_MAX]; + struct io io; + int ch, ret = 0; + __u64 dec; + + if (setup_test(path, test_string, 4, &io)) + return -1; + + ch = io__get_dec(&io, &dec); + EXPECT_EQUAL64(dec, val1); + EXPECT_EQUAL(ch, ch1); + + ch = io__get_dec(&io, &dec); + EXPECT_EQUAL64(dec, val2); + EXPECT_EQUAL(ch, ch2); + + ch = io__get_dec(&io, &dec); + EXPECT_EQUAL64(dec, val3); + EXPECT_EQUAL(ch, ch3); + + EXPECT_EQUAL(io.eof, end_eof); + + cleanup_test(path, &io); + return ret; +} + +static int test_get_dec(void) +{ + int ret = 0; + + if (do_test_get_dec("12345678abcdef90", + 12345678, 'a', + 0, -2, + 0, -2, + false)) + ret = -1; + + if (do_test_get_dec("1\n2\n3\n", + 1, '\n', + 2, '\n', + 3, '\n', + false)) + ret = -1; + + if (do_test_get_dec("12345678;1;2", + 12345678, ';', + 1, ';', + 2, -1, + true)) + ret = -1; + + if (do_test_get_dec("0x1x2x", + 0, 'x', + 1, 'x', + 2, 'x', + false)) + ret = -1; + + if (do_test_get_dec("x1x", + 0, -2, + 1, 'x', + 0, -1, + true)) + ret = -1; + + if (do_test_get_dec("10000000000000000000000000000000000000000000000000000000000123456789ab99c", + 123456789, 'a', + 0, -2, + 99, 'c', + false)) + ret = -1; + + return ret; +} + +int test__api_io(struct test *test __maybe_unused, + int subtest __maybe_unused) +{ + int ret = 0; + + if (test_get_char()) + ret = TEST_FAIL; + if (test_get_hex()) + ret = TEST_FAIL; + if (test_get_dec()) + ret = TEST_FAIL; + return ret; +} diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index b6322eb0f423..3471ec52ea11 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -309,6 +309,10 @@ static struct test generic_tests[] = { .desc = "Test jit_write_elf", .func = test__jit_write_elf, }, + { + .desc = "Test api io", + .func = test__api_io, + }, { .desc = "maps__merge_in", .func = test__maps__merge_in, diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index 61a1ab032080..d6d4ac34eeb7 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -112,6 +112,7 @@ int test__mem2node(struct test *t, int subtest); int test__maps__merge_in(struct test *t, int subtest); int test__time_utils(struct test *t, int subtest); int test__jit_write_elf(struct test *test, int subtest); +int test__api_io(struct test *test, int subtest); bool test__bp_signal_is_supported(void); bool test__bp_account_is_supported(void); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 11/91] perf synthetic events: Remove use of sscanf from /proc reading 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (9 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 10/91] tools api: Add a lightweight buffered reading api Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 12/91] perf script: Remove extraneous newline in perf_sample__fprintf_regs() Arnaldo Carvalho de Melo ` (79 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Arnaldo Carvalho de Melo, Jiri Olsa, Alexander Shishkin, Andrey Zhizhikin, Kan Liang, Kefeng Wang, Mark Rutland, Peter Zijlstra, Petr Mladek, Stephane Eranian From: Ian Rogers <irogers@google.com> The synthesize benchmark, run on a single process and thread, shows perf_event__synthesize_mmap_events as the hottest function with fgets and sscanf taking the majority of execution time. fscanf performs similarly well. Replace the scanf call with manual reading of each field of the /proc/pid/maps line, and remove some unnecessary buffering. This change also addresses potential, but unlikely, buffer overruns for the string values read by scanf. Performance before is: $ sudo perf bench internals synthesize -m 16 -M 16 -s -t \# Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 102.810 usec (+- 0.027 usec) Average num. events: 17.000 (+- 0.000) Average time per event 6.048 usec Average data synthesis took: 106.325 usec (+- 0.018 usec) Average num. events: 89.000 (+- 0.000) Average time per event 1.195 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 16 Average synthesis took: 68103.100 usec (+- 441.234 usec) Average num. events: 30703.000 (+- 0.730) Average time per event 2.218 usec And after is: $ sudo perf bench internals synthesize -m 16 -M 16 -s -t \# Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 50.388 usec (+- 0.031 usec) Average num. events: 17.000 (+- 0.000) Average time per event 2.964 usec Average data synthesis took: 52.693 usec (+- 0.020 usec) Average num. events: 89.000 (+- 0.000) Average time per event 0.592 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 16 Average synthesis took: 45022.400 usec (+- 552.740 usec) Average num. events: 30624.200 (+- 10.037) Average time per event 1.470 usec On a Intel Xeon 6154 compiling with Debian gcc 9.2.1. Committer testing: On a AMD Ryzen 5 3600X 6-Core Processor: Before: # perf bench internals synthesize --min-threads 12 --max-threads 12 --st --mt # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 267.491 usec (+- 0.176 usec) Average num. events: 56.000 (+- 0.000) Average time per event 4.777 usec Average data synthesis took: 277.257 usec (+- 0.169 usec) Average num. events: 287.000 (+- 0.000) Average time per event 0.966 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 12 Average synthesis took: 81599.500 usec (+- 346.315 usec) Average num. events: 36096.100 (+- 2.523) Average time per event 2.261 usec # After: # perf bench internals synthesize --min-threads 12 --max-threads 12 --st --mt # Running 'internals/synthesize' benchmark: Computing performance of single threaded perf event synthesis by synthesizing events on the perf process itself: Average synthesis took: 110.125 usec (+- 0.080 usec) Average num. events: 56.000 (+- 0.000) Average time per event 1.967 usec Average data synthesis took: 118.518 usec (+- 0.057 usec) Average num. events: 287.000 (+- 0.000) Average time per event 0.413 usec Computing performance of multi threaded perf event synthesis by synthesizing events on CPU 0: Number of synthesis threads: 12 Average synthesis took: 43490.700 usec (+- 284.527 usec) Average num. events: 37028.500 (+- 0.563) Average time per event 1.175 usec # Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andrey Zhizhikin <andrey.z@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200415054050.31645-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/synthetic-events.c | 157 +++++++++++++++++++---------- 1 file changed, 105 insertions(+), 52 deletions(-) diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index 9d4aa951eaa6..1ea9adaef9c7 100644 --- a/tools/perf/util/synthetic-events.c +++ b/tools/perf/util/synthetic-events.c @@ -37,6 +37,7 @@ #include <string.h> #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ #include <api/fs/fs.h> +#include <api/io.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -273,6 +274,79 @@ static int perf_event__synthesize_fork(struct perf_tool *tool, return 0; } +static bool read_proc_maps_line(struct io *io, __u64 *start, __u64 *end, + u32 *prot, u32 *flags, __u64 *offset, + u32 *maj, u32 *min, + __u64 *inode, + ssize_t pathname_size, char *pathname) +{ + __u64 temp; + int ch; + char *start_pathname = pathname; + + if (io__get_hex(io, start) != '-') + return false; + if (io__get_hex(io, end) != ' ') + return false; + + /* map protection and flags bits */ + *prot = 0; + ch = io__get_char(io); + if (ch == 'r') + *prot |= PROT_READ; + else if (ch != '-') + return false; + ch = io__get_char(io); + if (ch == 'w') + *prot |= PROT_WRITE; + else if (ch != '-') + return false; + ch = io__get_char(io); + if (ch == 'x') + *prot |= PROT_EXEC; + else if (ch != '-') + return false; + ch = io__get_char(io); + if (ch == 's') + *flags = MAP_SHARED; + else if (ch == 'p') + *flags = MAP_PRIVATE; + else + return false; + if (io__get_char(io) != ' ') + return false; + + if (io__get_hex(io, offset) != ' ') + return false; + + if (io__get_hex(io, &temp) != ':') + return false; + *maj = temp; + if (io__get_hex(io, &temp) != ' ') + return false; + *min = temp; + + ch = io__get_dec(io, inode); + if (ch != ' ') { + *pathname = '\0'; + return ch == '\n'; + } + do { + ch = io__get_char(io); + } while (ch == ' '); + while (true) { + if (ch < 0) + return false; + if (ch == '\0' || ch == '\n' || + (pathname + 1 - start_pathname) >= pathname_size) { + *pathname = '\0'; + return true; + } + *pathname++ = ch; + ch = io__get_char(io); + } +} + int perf_event__synthesize_mmap_events(struct perf_tool *tool, union perf_event *event, pid_t pid, pid_t tgid, @@ -280,9 +354,9 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, struct machine *machine, bool mmap_data) { - FILE *fp; unsigned long long t; char bf[BUFSIZ]; + struct io io; bool truncation = false; unsigned long long timeout = proc_map_timeout * 1000000ULL; int rc = 0; @@ -295,28 +369,39 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, snprintf(bf, sizeof(bf), "%s/proc/%d/task/%d/maps", machine->root_dir, pid, pid); - fp = fopen(bf, "r"); - if (fp == NULL) { + io.fd = open(bf, O_RDONLY, 0); + if (io.fd < 0) { /* * We raced with a task exiting - just return: */ pr_debug("couldn't open %s\n", bf); return -1; } + io__init(&io, io.fd, bf, sizeof(bf)); event->header.type = PERF_RECORD_MMAP2; t = rdclock(); - while (1) { - char prot[5]; - char execname[PATH_MAX]; - char anonstr[] = "//anon"; - unsigned int ino; + while (!io.eof) { + static const char anonstr[] = "//anon"; size_t size; - ssize_t n; - if (fgets(bf, sizeof(bf), fp) == NULL) - break; + /* ensure null termination since stack will be reused. */ + event->mmap2.filename[0] = '\0'; + + /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ + if (!read_proc_maps_line(&io, + &event->mmap2.start, + &event->mmap2.len, + &event->mmap2.prot, + &event->mmap2.flags, + &event->mmap2.pgoff, + &event->mmap2.maj, + &event->mmap2.min, + &event->mmap2.ino, + sizeof(event->mmap2.filename), + event->mmap2.filename)) + continue; if ((rdclock() - t) > timeout) { pr_warning("Reading %s/proc/%d/task/%d/maps time out. " @@ -327,23 +412,6 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, goto out; } - /* ensure null termination since stack will be reused. */ - strcpy(execname, ""); - - /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ - n = sscanf(bf, "%"PRI_lx64"-%"PRI_lx64" %s %"PRI_lx64" %x:%x %u %[^\n]\n", - &event->mmap2.start, &event->mmap2.len, prot, - &event->mmap2.pgoff, &event->mmap2.maj, - &event->mmap2.min, - &ino, execname); - - /* - * Anon maps don't have the execname. - */ - if (n < 7) - continue; - - event->mmap2.ino = (u64)ino; event->mmap2.ino_generation = 0; /* @@ -354,23 +422,8 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, else event->header.misc = PERF_RECORD_MISC_GUEST_USER; - /* map protection and flags bits */ - event->mmap2.prot = 0; - event->mmap2.flags = 0; - if (prot[0] == 'r') - event->mmap2.prot |= PROT_READ; - if (prot[1] == 'w') - event->mmap2.prot |= PROT_WRITE; - if (prot[2] == 'x') - event->mmap2.prot |= PROT_EXEC; - - if (prot[3] == 's') - event->mmap2.flags |= MAP_SHARED; - else - event->mmap2.flags |= MAP_PRIVATE; - - if (prot[2] != 'x') { - if (!mmap_data || prot[0] != 'r') + if ((event->mmap2.prot & PROT_EXEC) == 0) { + if (!mmap_data || (event->mmap2.prot & PROT_READ) == 0) continue; event->header.misc |= PERF_RECORD_MISC_MMAP_DATA; @@ -380,17 +433,17 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, if (truncation) event->header.misc |= PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT; - if (!strcmp(execname, "")) - strcpy(execname, anonstr); + if (!strcmp(event->mmap2.filename, "")) + strcpy(event->mmap2.filename, anonstr); if (hugetlbfs_mnt_len && - !strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) { - strcpy(execname, anonstr); + !strncmp(event->mmap2.filename, hugetlbfs_mnt, + hugetlbfs_mnt_len)) { + strcpy(event->mmap2.filename, anonstr); event->mmap2.flags |= MAP_HUGETLB; } - size = strlen(execname) + 1; - memcpy(event->mmap2.filename, execname, size); + size = strlen(event->mmap2.filename) + 1; size = PERF_ALIGN(size, sizeof(u64)); event->mmap2.len -= event->mmap.start; event->mmap2.header.size = (sizeof(event->mmap2) - @@ -409,7 +462,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, break; } - fclose(fp); + close(io.fd); return rc; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 12/91] perf script: Remove extraneous newline in perf_sample__fprintf_regs() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (10 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 11/91] perf synthetic events: Remove use of sscanf from /proc reading Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 13/91] libtraceevent: Remove unneeded semicolon Arnaldo Carvalho de Melo ` (78 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Stephane Eranian, Arnaldo Carvalho de Melo, Andi Kleen, Ian Rogers, Jiri Olsa, Kan Liang, Peter Zijlstra From: Stephane Eranian <eranian@google.com> When printing iregs, there was a double newline printed because perf_sample__fprintf_regs() was printing its own and then at the end of all fields, perf script was adding one. This was causing blank line in the output: Before: $ perf script -Fip,iregs 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 401b8d ABI:2 DX:0x100 SI:0x4a9340 DI:0x4a8340 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 401b8d ABI:2 DX:0x100 SI:0x4a9340 DI:0x4a8340 After: $ perf script -Fip,iregs 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 401b8d ABI:2 DX:0x100 SI:0x4a9340 DI:0x4a8340 401b8d ABI:2 DX:0x100 SI:0x4a8340 DI:0x4a9340 Committer testing: First we need to figure out how to request that registers be recorded, so we use: # perf record -h reg Usage: perf record [<options>] [<command>] or: perf record [<options>] -- <command> [<options>] -I, --intr-regs[=<any register>] sample selected machine registers on interrupt, use '-I?' to list register names --buildid-all Record build-id of all DSOs regardless of hits --user-regs[=<any register>] sample selected machine registers on interrupt, use '--user-regs=?' to list register names # Ok, now lets ask for them all: # perf record -a --intr-regs --user-regs sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 4.105 MB perf.data (2760 samples) ] # Lets look at the first 6 output lines: # perf script -Fip,iregs | head -6 ffffffff8a06f2f4 ABI:2 AX:0xffffd168fee0a980 BX:0xffff8a23b087f000 CX:0xfffeb69aaeb25d73 DX:0xffff8a253e8310f0 SI:0xfffffff9bafe7359 DI:0xffffb1690204fb10 BP:0xffffd168fee0a950 SP:0xffffb1690204fb88 IP:0xffffffff8a06f2f4 FLAGS:0x4e CS:0x10 SS:0x18 R8:0x1495f0a91129a R9:0xffff8a23b087f000 R10:0x1 R11:0xffffffff R12:0x0 R13:0xffff8a253e827e00 R14:0xffffd168fee0aa5c R15:0xffffd168fee0a980 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0xffffd168fee0a950 CX:0x5684cc1118491900 DX:0x0 SI:0xffffd168fee0a9d0 DI:0x202 BP:0xffffb1690204fd70 SP:0xffffb1690204fd20 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x18 R8:0x0 R9:0xffffd168fee0a9d0 R10:0x1 R11:0xffffffff R12:0xffffffff8a23e480 R13:0xffff8a23b087f240 R14:0xffff8a23b087f000 R15:0xffffd168fee0a950 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0x0 CX:0x7f25f334335b DX:0x0 SI:0x2400 DI:0x4 BP:0x7fff5f264570 SP:0x7fff5f264538 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x2b R8:0x0 R9:0x2312d20 R10:0x0 R11:0x246 R12:0x22cc0e0 R13:0x0 R14:0x0 R15:0x22d0780 # Reproduced, apply the patch and: [root@five ~]# perf script -Fip,iregs | head -6 ffffffff8a06f2f4 ABI:2 AX:0xffffd168fee0a980 BX:0xffff8a23b087f000 CX:0xfffeb69aaeb25d73 DX:0xffff8a253e8310f0 SI:0xfffffff9bafe7359 DI:0xffffb1690204fb10 BP:0xffffd168fee0a950 SP:0xffffb1690204fb88 IP:0xffffffff8a06f2f4 FLAGS:0x4e CS:0x10 SS:0x18 R8:0x1495f0a91129a R9:0xffff8a23b087f000 R10:0x1 R11:0xffffffff R12:0x0 R13:0xffff8a253e827e00 R14:0xffffd168fee0aa5c R15:0xffffd168fee0a980 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0xffffd168fee0a950 CX:0x5684cc1118491900 DX:0x0 SI:0xffffd168fee0a9d0 DI:0x202 BP:0xffffb1690204fd70 SP:0xffffb1690204fd20 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x18 R8:0x0 R9:0xffffd168fee0a9d0 R10:0x1 R11:0xffffffff R12:0xffffffff8a23e480 R13:0xffff8a23b087f240 R14:0xffff8a23b087f000 R15:0xffffd168fee0a950 ffffffff8a06f2f4 ABI:2 AX:0x0 BX:0x0 CX:0x7f25f334335b DX:0x0 SI:0x2400 DI:0x4 BP:0x7fff5f264570 SP:0x7fff5f264538 IP:0xffffffff8a06f2f4 FLAGS:0x24e CS:0x10 SS:0x2b R8:0x0 R9:0x2312d20 R10:0x0 R11:0x246 R12:0x22cc0e0 R13:0x0 R14:0x0 R15:0x22d0780 ffffffff8a24074b ABI:2 AX:0xcb BX:0xcb CX:0x0 DX:0x0 SI:0xffffb1690204ff58 DI:0xcb BP:0xffffb1690204ff58 SP:0xffffb1690204ff40 IP:0xffffffff8a24074b FLAGS:0x24e CS:0x10 SS:0x18 R8:0x0 R9:0x0 R10:0x0 R11:0x0 R12:0x0 R13:0x0 R14:0x0 R15:0x0 ffffffff8a310600 ABI:2 AX:0x0 BX:0xffffffff8b8c39a0 CX:0x0 DX:0xffff8a2503890300 SI:0xffffb1690204ff20 DI:0xffff8a23e4080000 BP:0xffff8a23e4080000 SP:0xffffb1690204fec0 IP:0xffffffff8a310600 FLAGS:0x28e CS:0x10 SS:0x18 R8:0x0 R9:0x0 R10:0x0 R11:0x0 R12:0xffffffffffffffea R13:0xffff8a23e4080020 R14:0x0 R15:0x0 ffffffff8a11b688 ABI:2 AX:0x0 BX:0xffff8a237b7c8800 CX:0xffffb1690204fae0 DX:0x78 SI:0xffff8a237b7c8800 DI:0xffffb1690204fa10 BP:0xffffb1690204fb00 SP:0xffffb1690204fa00 IP:0xffffffff8a11b688 FLAGS:0x8a CS:0x10 SS:0x18 R8:0x1495f0a917eba R9:0xffffd168fde19a48 R10:0xffffb1690204fd98 R11:0xffff8a253e82afb0 R12:0xffff8a237b7c8800 R13:0xffffb1690204fb00 R14:0x0 R15:0xffff8a237b7c8800 [root@five ~]# To see it more clearly, lets get just two of those registers by sample: # perf record -a --intr-regs=ax,bx --user-regs=cx,dx sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 3.502 MB perf.data (1653 samples) ] # Extra info, lets see what gets setup in that 'struct perf_event_attr': # perf evlist -v cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|REGS_USER|REGS_INTR, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 2, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, sample_regs_user: 0xc, sample_regs_intr: 0x3 # Cook, some PERF_SAMPLE_REGS_USER|PERF_SAMPLE_REGS_INTR + attr.sample_regs_user and attr.sample_regs_intr register masks, now lets see if those newlines are gone in a more compact fashion: # perf script -Fip,iregs,uregs ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a29b78d ABI:2 AX:0x2a20ffcd6000 BX:0x2ec7d9000 ABI:2 CX:0x7f204460e49b DX:0xf42920 # And where was that? # perf script -Fip,iregs,uregs,sym,dso ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a56df78 strrchr (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0xffff8a25137b6028 BX:0xffff8a2502f18000 ABI:2 CX:0x7f204460e49b DX:0xf42920 ffffffff8a29b78d __vma_link_rb (/lib/modules/5.7.0-rc2/build/vmlinux) ABI:2 AX:0x2a20ffcd6000 BX:0x2ec7d9000 ABI:2 CX:0x7f204460e49b DX:0xf42920 # Signed-off-by: Stephane Eranian <eranian@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200418231908.152212-1-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index a2236542900d..3aadefd2791e 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -604,8 +604,6 @@ static int perf_sample__fprintf_regs(struct regs_dump *regs, uint64_t mask, printed += fprintf(fp, "%5s:0x%"PRIx64" ", perf_reg_name(r), val); } - fprintf(fp, "\n"); - return printed; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 13/91] libtraceevent: Remove unneeded semicolon 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (11 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 12/91] perf script: Remove extraneous newline in perf_sample__fprintf_regs() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 14/91] perf c2c: " Arnaldo Carvalho de Melo ` (77 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Zou Wei, Hulk Robot, Steven Rostedt, Arnaldo Carvalho de Melo From: Zou Wei <zou_wei@huawei.com> Fixes coccicheck warning: tools/lib/traceevent/kbuffer-parse.c:441:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: http://lore.kernel.org/lkml/1588065121-71236-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/traceevent/kbuffer-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c index b887e7437d67..27f3b07fdae8 100644 --- a/tools/lib/traceevent/kbuffer-parse.c +++ b/tools/lib/traceevent/kbuffer-parse.c @@ -438,7 +438,7 @@ void *kbuffer_translate_data(int swap, void *data, unsigned int *size) case KBUFFER_TYPE_TIME_EXTEND: case KBUFFER_TYPE_TIME_STAMP: return NULL; - }; + } *size = length; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 14/91] perf c2c: Remove unneeded semicolon 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (12 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 13/91] libtraceevent: Remove unneeded semicolon Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 15/91] perf tools: Remove unneeded semicolons Arnaldo Carvalho de Melo ` (76 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Zou Wei, Hulk Robot, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Arnaldo Carvalho de Melo From: Zou Wei <zou_wei@huawei.com> Fixes coccicheck warnings: tools/perf/builtin-c2c.c:1712:2-3: Unneeded semicolon tools/perf/builtin-c2c.c:1928:2-3: Unneeded semicolon tools/perf/builtin-c2c.c:2962:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/1588064336-70456-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-c2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 0d544c4fb4be..0e14c1821dcb 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1709,7 +1709,7 @@ static struct c2c_dimension *get_dimension(const char *name) if (!strcmp(dim->name, name)) return dim; - }; + } return NULL; } @@ -1925,7 +1925,7 @@ static bool he__display(struct hist_entry *he, struct c2c_stats *stats) FILTER_HITM(tot_hitm); default: break; - }; + } #undef FILTER_HITM @@ -2959,7 +2959,7 @@ static int perf_c2c__record(int argc, const char **argv) rec_argv[i++] = "-e"; rec_argv[i++] = perf_mem_events__name(j); - }; + } if (all_user) rec_argv[i++] = "--all-user"; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 15/91] perf tools: Remove unneeded semicolons 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (13 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 14/91] perf c2c: " Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 16/91] perf report: Fix warning assignment of 0/1 to bool variable Arnaldo Carvalho de Melo ` (75 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Zou Wei, Hulk Robot, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Arnaldo Carvalho de Melo From: Zou Wei <zou_wei@huawei.com> Fixes coccicheck warnings: tools/perf/builtin-diff.c:1565:2-3: Unneeded semicolon tools/perf/builtin-lock.c:778:2-3: Unneeded semicolon tools/perf/builtin-mem.c:126:2-3: Unneeded semicolon tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c:555:2-3: Unneeded semicolon tools/perf/util/ordered-events.c:317:2-3: Unneeded semicolon tools/perf/util/synthetic-events.c:1131:2-3: Unneeded semicolon tools/perf/util/trace-event-read.c:78:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/1588065523-71423-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-lock.c | 2 +- tools/perf/builtin-mem.c | 2 +- tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | 2 +- tools/perf/util/ordered-events.c | 2 +- tools/perf/util/synthetic-events.c | 2 +- tools/perf/util/trace-event-read.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index c94a002f295e..59d40f036587 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -1562,7 +1562,7 @@ hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair, default: BUG_ON(1); - }; + } } static void diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 474dfd59d7eb..543d82fec556 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -775,7 +775,7 @@ static void dump_threads(void) pr_info("%10d: %s\n", st->tid, thread__comm_str(t)); node = rb_next(node); thread__put(t); - }; + } } static void dump_map(void) diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index a13f5817d6fc..68a7eb84561a 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -123,7 +123,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) rec_argv[i++] = "-e"; rec_argv[i++] = perf_mem_events__name(j); - }; + } if (all_user) rec_argv[i++] = "--all-user"; diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c index 0ccf10a0bf44..4ce109993e74 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c @@ -552,7 +552,7 @@ static int intel_pt_do_get_packet(const unsigned char *buf, size_t len, break; default: break; - }; + } if (!(byte & BIT(0))) { if (byte == 0) diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index 359db2b1fcef..48c8f609441b 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -314,7 +314,7 @@ static int __ordered_events__flush(struct ordered_events *oe, enum oe_flush how, case OE_FLUSH__NONE: default: break; - }; + } pr_oe_time(oe->next_flush, "next_flush - ordered_events__flush PRE %s, nr_events %u\n", str[how], oe->nr_events); diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index 1ea9adaef9c7..89b390623b63 100644 --- a/tools/perf/util/synthetic-events.c +++ b/tools/perf/util/synthetic-events.c @@ -1181,7 +1181,7 @@ void cpu_map_data__synthesize(struct perf_record_cpu_map_data *data, struct perf synthesize_mask((struct perf_record_record_cpu_map *)data->data, map, max); default: break; - }; + } } static struct perf_record_cpu_map *cpu_map_event__new(struct perf_cpu_map *map) diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c index 8593d3c200c6..f507dff713c9 100644 --- a/tools/perf/util/trace-event-read.c +++ b/tools/perf/util/trace-event-read.c @@ -75,7 +75,7 @@ static void skip(int size) r = size > BUFSIZ ? BUFSIZ : size; do_read(buf, r); size -= r; - }; + } } static unsigned int read4(struct tep_handle *pevent) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 16/91] perf report: Fix warning assignment of 0/1 to bool variable 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (14 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 15/91] perf tools: Remove unneeded semicolons Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 17/91] perf pmu: Fix function name in comment, its get_cpuid_str(), not get_cpustr() Arnaldo Carvalho de Melo ` (74 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Zou Wei, Hulk Robot, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Arnaldo Carvalho de Melo From: Zou Wei <zou_wei@huawei.com> Fixes coccicheck warning: tools/perf/builtin-report.c:1403:2-34: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/1587904683-3510-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0c32767b1c56..7da1342a1f4e 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -1413,7 +1413,7 @@ int cmd_report(int argc, const char **argv) } if (branch_call_mode) { callchain_param.key = CCKEY_ADDRESS; - callchain_param.branch_callstack = 1; + callchain_param.branch_callstack = true; symbol_conf.use_callchain = true; callchain_register_param(&callchain_param); if (sort_order == NULL) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 17/91] perf pmu: Fix function name in comment, its get_cpuid_str(), not get_cpustr() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (15 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 16/91] perf report: Fix warning assignment of 0/1 to bool variable Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 18/91] perf metricgroups: Enhance JSON/metric infrastructure to handle "?" Arnaldo Carvalho de Melo ` (73 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Shaokun Zhang, Andi Kleen, Arnaldo Carvalho de Melo From: Shaokun Zhang <zhangshaokun@hisilicon.com> get_cpuid_str() is used in tools/perf/arch/xxx/util/header.c, fix the name in comment. Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com> Cc: Andi Kleen <ak@linux.intel.com> Link: http://lore.kernel.org/lkml/1588141992-48382-1-git-send-email-zhangshaokun@hisilicon.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/pmu-events/pmu-events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h index 53e76d5d5b37..c8f306b572f4 100644 --- a/tools/perf/pmu-events/pmu-events.h +++ b/tools/perf/pmu-events/pmu-events.h @@ -26,7 +26,7 @@ struct pmu_event { * Map a CPU to its table of PMU events. The CPU is identified by the * cpuid field, which is an arch-specific identifier for the CPU. * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile - * must match the get_cpustr() in tools/perf/arch/xxx/util/header.c) + * must match the get_cpuid_str() in tools/perf/arch/xxx/util/header.c) * * The cpuid can contain any character other than the comma. */ -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 18/91] perf metricgroups: Enhance JSON/metric infrastructure to handle "?" 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (16 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 17/91] perf pmu: Fix function name in comment, its get_cpuid_str(), not get_cpustr() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 19/91] perf tests expr: Added test for runtime param in metric expression Arnaldo Carvalho de Melo ` (72 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Kajol Jain, Jiri Olsa, Alexander Shishkin, Andi Kleen, Anju T Sudhakar, Benjamin Herrenschmidt, Greg Kroah-Hartman, Jin Yao, Joe Mario, Kan Liang, Madhavan Srinivasan, Mamatha Inamdar, Mark Rutland, Michael Ellerman, Michael Petlan From: Kajol Jain <kjain@linux.ibm.com> Patch enhances current metric infrastructure to handle "?" in the metric expression. The "?" can be use for parameters whose value not known while creating metric events and which can be replace later at runtime to the proper value. It also add flexibility to create multiple events out of single metric event added in JSON file. Patch adds function 'arch_get_runtimeparam' which is a arch specific function, returns the count of metric events need to be created. By default it return 1. This infrastructure needed for hv_24x7 socket/chip level events. "hv_24x7" chip level events needs specific chip-id to which the data is requested. Function 'arch_get_runtimeparam' implemented in header.c which extract number of sockets from sysfs file "sockets" under "/sys/devices/hv_24x7/interface/". With this patch basically we are trying to create as many metric events as define by runtime_param. For that one loop is added in function 'metricgroup__add_metric', which create multiple events at run time depend on return value of 'arch_get_runtimeparam' and merge that event in 'group_list'. To achieve that we are actually passing this parameter value as part of `expr__find_other` function and changing "?" present in metric expression with this value. As in our JSON file, there gonna be single metric event, and out of which we are creating multiple events. To understand which data count belongs to which parameter value, we also printing param value in generic_metric function. For example, command:# ./perf stat -M PowerBUS_Frequency -C 0 -I 1000 1.000101867 9,356,933 hv_24x7/pm_pb_cyc,chip=0/ # 2.3 GHz PowerBUS_Frequency_0 1.000101867 9,366,134 hv_24x7/pm_pb_cyc,chip=1/ # 2.3 GHz PowerBUS_Frequency_1 2.000314878 9,365,868 hv_24x7/pm_pb_cyc,chip=0/ # 2.3 GHz PowerBUS_Frequency_0 2.000314878 9,366,092 hv_24x7/pm_pb_cyc,chip=1/ # 2.3 GHz PowerBUS_Frequency_1 So, here _0 and _1 after PowerBUS_Frequency specify parameter value. Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Joe Mario <jmario@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-5-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/arch/powerpc/util/header.c | 8 ++++++++ tools/perf/tests/expr.c | 8 ++++---- tools/perf/util/expr.c | 11 ++++++----- tools/perf/util/expr.h | 5 +++-- tools/perf/util/expr.l | 27 +++++++++++++++++++------- tools/perf/util/metricgroup.c | 28 ++++++++++++++++++++++++--- tools/perf/util/metricgroup.h | 2 ++ tools/perf/util/stat-shadow.c | 17 ++++++++++------ 8 files changed, 79 insertions(+), 27 deletions(-) diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c index 3b4cdfc5efd6..d4870074f14c 100644 --- a/tools/perf/arch/powerpc/util/header.c +++ b/tools/perf/arch/powerpc/util/header.c @@ -7,6 +7,8 @@ #include <string.h> #include <linux/stringify.h> #include "header.h" +#include "metricgroup.h" +#include <api/fs/fs.h> #define mfspr(rn) ({unsigned long rval; \ asm volatile("mfspr %0," __stringify(rn) \ @@ -44,3 +46,9 @@ get_cpuid_str(struct perf_pmu *pmu __maybe_unused) return bufp; } + +int arch_get_runtimeparam(void) +{ + int count; + return sysfs__read_int("/devices/hv_24x7/interface/sockets", &count) < 0 ? 1 : count; +} diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index ea10fc4412c4..516504cf0ea5 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -10,7 +10,7 @@ static int test(struct expr_parse_ctx *ctx, const char *e, double val2) { double val; - if (expr__parse(&val, ctx, e)) + if (expr__parse(&val, ctx, e, 1)) TEST_ASSERT_VAL("parse test failed", 0); TEST_ASSERT_VAL("unexpected value", val == val2); return 0; @@ -44,15 +44,15 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) return ret; p = "FOO/0"; - ret = expr__parse(&val, &ctx, p); + ret = expr__parse(&val, &ctx, p, 1); TEST_ASSERT_VAL("division by zero", ret == -1); p = "BAR/"; - ret = expr__parse(&val, &ctx, p); + ret = expr__parse(&val, &ctx, p, 1); TEST_ASSERT_VAL("missing operand", ret == -1); TEST_ASSERT_VAL("find other", - expr__find_other("FOO + BAR + BAZ + BOZO", "FOO", &other, &num_other) == 0); + expr__find_other("FOO + BAR + BAZ + BOZO", "FOO", &other, &num_other, 1) == 0); TEST_ASSERT_VAL("find other", num_other == 3); TEST_ASSERT_VAL("find other", !strcmp(other[0], "BAR")); TEST_ASSERT_VAL("find other", !strcmp(other[1], "BAZ")); diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c index c3382d58cf40..aa631e37ad1e 100644 --- a/tools/perf/util/expr.c +++ b/tools/perf/util/expr.c @@ -27,10 +27,11 @@ void expr__ctx_init(struct expr_parse_ctx *ctx) static int __expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr, - int start) + int start, int runtime) { struct expr_scanner_ctx scanner_ctx = { .start_token = start, + .runtime = runtime, }; YY_BUFFER_STATE buffer; void *scanner; @@ -54,9 +55,9 @@ __expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr, return ret; } -int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr) +int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr, int runtime) { - return __expr__parse(final_val, ctx, expr, EXPR_PARSE) ? -1 : 0; + return __expr__parse(final_val, ctx, expr, EXPR_PARSE, runtime) ? -1 : 0; } static bool @@ -74,13 +75,13 @@ already_seen(const char *val, const char *one, const char **other, } int expr__find_other(const char *expr, const char *one, const char ***other, - int *num_other) + int *num_other, int runtime) { int err, i = 0, j = 0; struct expr_parse_ctx ctx; expr__ctx_init(&ctx); - err = __expr__parse(NULL, &ctx, expr, EXPR_OTHER); + err = __expr__parse(NULL, &ctx, expr, EXPR_OTHER, runtime); if (err) return -1; diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h index 0938ad166ece..87d627bb699b 100644 --- a/tools/perf/util/expr.h +++ b/tools/perf/util/expr.h @@ -17,12 +17,13 @@ struct expr_parse_ctx { struct expr_scanner_ctx { int start_token; + int runtime; }; void expr__ctx_init(struct expr_parse_ctx *ctx); void expr__add_id(struct expr_parse_ctx *ctx, const char *id, double val); -int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr); +int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr, int runtime); int expr__find_other(const char *expr, const char *one, const char ***other, - int *num_other); + int *num_other, int runtime); #endif diff --git a/tools/perf/util/expr.l b/tools/perf/util/expr.l index 2582c2464938..74b9b59b1aa5 100644 --- a/tools/perf/util/expr.l +++ b/tools/perf/util/expr.l @@ -35,7 +35,7 @@ static int value(yyscan_t scanner, int base) * Allow @ instead of / to be able to specify pmu/event/ without * conflicts with normal division. */ -static char *normalize(char *str) +static char *normalize(char *str, int runtime) { char *ret = str; char *dst = str; @@ -45,6 +45,19 @@ static char *normalize(char *str) *dst++ = '/'; else if (*str == '\\') *dst++ = *++str; + else if (*str == '?') { + char *paramval; + int i = 0; + int size = asprintf(¶mval, "%d", runtime); + + if (size < 0) + *dst++ = '0'; + else { + while (i < size) + *dst++ = paramval[i++]; + free(paramval); + } + } else *dst++ = *str; str++; @@ -54,16 +67,16 @@ static char *normalize(char *str) return ret; } -static int str(yyscan_t scanner, int token) +static int str(yyscan_t scanner, int token, int runtime) { YYSTYPE *yylval = expr_get_lval(scanner); char *text = expr_get_text(scanner); - yylval->str = normalize(strdup(text)); + yylval->str = normalize(strdup(text), runtime); if (!yylval->str) return EXPR_ERROR; - yylval->str = normalize(yylval->str); + yylval->str = normalize(yylval->str, runtime); return token; } %} @@ -72,8 +85,8 @@ number [0-9]+ sch [-,=] spec \\{sch} -sym [0-9a-zA-Z_\.:@]+ -symbol {spec}*{sym}*{spec}*{sym}* +sym [0-9a-zA-Z_\.:@?]+ +symbol {spec}*{sym}*{spec}*{sym}*{spec}*{sym} %% struct expr_scanner_ctx *sctx = expr_get_extra(yyscanner); @@ -93,7 +106,7 @@ if { return IF; } else { return ELSE; } #smt_on { return SMT_ON; } {number} { return value(yyscanner, 10); } -{symbol} { return str(yyscanner, ID); } +{symbol} { return str(yyscanner, ID, sctx->runtime); } "|" { return '|'; } "^" { return '^'; } "&" { return '&'; } diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 7ad81c8177ea..b071df373f8b 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -90,6 +90,7 @@ struct egroup { const char *metric_name; const char *metric_expr; const char *metric_unit; + int runtime; }; static struct evsel *find_evsel_group(struct evlist *perf_evlist, @@ -202,6 +203,7 @@ static int metricgroup__setup_events(struct list_head *groups, expr->metric_name = eg->metric_name; expr->metric_unit = eg->metric_unit; expr->metric_events = metric_events; + expr->runtime = eg->runtime; list_add(&expr->nd, &me->head); } @@ -485,15 +487,20 @@ static bool metricgroup__has_constraint(struct pmu_event *pe) return false; } +int __weak arch_get_runtimeparam(void) +{ + return 1; +} + static int __metricgroup__add_metric(struct strbuf *events, - struct list_head *group_list, struct pmu_event *pe) + struct list_head *group_list, struct pmu_event *pe, int runtime) { const char **ids; int idnum; struct egroup *eg; - if (expr__find_other(pe->metric_expr, NULL, &ids, &idnum) < 0) + if (expr__find_other(pe->metric_expr, NULL, &ids, &idnum, runtime) < 0) return -EINVAL; if (events->len > 0) @@ -513,6 +520,7 @@ static int __metricgroup__add_metric(struct strbuf *events, eg->metric_name = pe->metric_name; eg->metric_expr = pe->metric_expr; eg->metric_unit = pe->unit; + eg->runtime = runtime; list_add_tail(&eg->nd, group_list); return 0; @@ -540,7 +548,21 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events, pr_debug("metric expr %s for %s\n", pe->metric_expr, pe->metric_name); - ret = __metricgroup__add_metric(events, group_list, pe); + if (!strstr(pe->metric_expr, "?")) { + ret = __metricgroup__add_metric(events, group_list, pe, 1); + } else { + int j, count; + + count = arch_get_runtimeparam(); + + /* This loop is added to create multiple + * events depend on count value and add + * those events to group_list. + */ + + for (j = 0; j < count; j++) + ret = __metricgroup__add_metric(events, group_list, pe, j); + } if (ret == -ENOMEM) break; } diff --git a/tools/perf/util/metricgroup.h b/tools/perf/util/metricgroup.h index 475c7f912864..6b09eb30b4ec 100644 --- a/tools/perf/util/metricgroup.h +++ b/tools/perf/util/metricgroup.h @@ -22,6 +22,7 @@ struct metric_expr { const char *metric_name; const char *metric_unit; struct evsel **metric_events; + int runtime; }; struct metric_event *metricgroup__lookup(struct rblist *metric_events, @@ -34,4 +35,5 @@ int metricgroup__parse_groups(const struct option *opt, void metricgroup__print(bool metrics, bool groups, char *filter, bool raw, bool details); bool metricgroup__has_metric(const char *metric); +int arch_get_runtimeparam(void); #endif diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index 1ad5c5be7e97..518fbb3a6269 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -336,7 +336,7 @@ void perf_stat__collect_metric_expr(struct evlist *evsel_list) metric_events = counter->metric_events; if (!metric_events) { if (expr__find_other(counter->metric_expr, counter->name, - &metric_names, &num_metric_names) < 0) + &metric_names, &num_metric_names, 1) < 0) continue; metric_events = calloc(sizeof(struct evsel *), @@ -723,6 +723,7 @@ static void generic_metric(struct perf_stat_config *config, char *name, const char *metric_name, const char *metric_unit, + int runtime, double avg, int cpu, struct perf_stat_output_ctx *out, @@ -777,7 +778,7 @@ static void generic_metric(struct perf_stat_config *config, } if (!metric_events[i]) { - if (expr__parse(&ratio, &pctx, metric_expr) == 0) { + if (expr__parse(&ratio, &pctx, metric_expr, runtime) == 0) { char *unit; char metric_bf[64]; @@ -786,9 +787,13 @@ static void generic_metric(struct perf_stat_config *config, &unit, &scale) >= 0) { ratio *= scale; } - - scnprintf(metric_bf, sizeof(metric_bf), + if (strstr(metric_expr, "?")) + scnprintf(metric_bf, sizeof(metric_bf), + "%s %s_%d", unit, metric_name, runtime); + else + scnprintf(metric_bf, sizeof(metric_bf), "%s %s", unit, metric_name); + print_metric(config, ctxp, NULL, "%8.1f", metric_bf, ratio); } else { @@ -1022,7 +1027,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, print_metric(config, ctxp, NULL, NULL, name, 0); } else if (evsel->metric_expr) { generic_metric(config, evsel->metric_expr, evsel->metric_events, evsel->name, - evsel->metric_name, NULL, avg, cpu, out, st); + evsel->metric_name, NULL, 1, avg, cpu, out, st); } else if (runtime_stat_n(st, STAT_NSECS, 0, cpu) != 0) { char unit = 'M'; char unit_buf[10]; @@ -1051,7 +1056,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, out->new_line(config, ctxp); generic_metric(config, mexp->metric_expr, mexp->metric_events, evsel->name, mexp->metric_name, - mexp->metric_unit, avg, cpu, out, st); + mexp->metric_unit, mexp->runtime, avg, cpu, out, st); } } if (num == 0) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 19/91] perf tests expr: Added test for runtime param in metric expression 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (17 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 18/91] perf metricgroups: Enhance JSON/metric infrastructure to handle "?" Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 20/91] perf tools: Enable Hz/hz prinitg for --metric-only option Arnaldo Carvalho de Melo ` (71 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Kajol Jain, Jiri Olsa, Alexander Shishkin, Andi Kleen, Anju T Sudhakar, Benjamin Herrenschmidt, Greg Kroah-Hartman, Jin Yao, Joe Mario, Kan Liang, Madhavan Srinivasan, Mamatha Inamdar, Mark Rutland, Michael Ellerman, Michael Petlan From: Kajol Jain <kjain@linux.ibm.com> Added test case for parsing "?" in metric expression. Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Joe Mario <jmario@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-6-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/expr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index 516504cf0ea5..f9e8e5628836 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -59,6 +59,14 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) TEST_ASSERT_VAL("find other", !strcmp(other[2], "BOZO")); TEST_ASSERT_VAL("find other", other[3] == NULL); + TEST_ASSERT_VAL("find other", + expr__find_other("EVENT1\\,param\\=?@ + EVENT2\\,param\\=?@", NULL, + &other, &num_other, 3) == 0); + TEST_ASSERT_VAL("find other", num_other == 2); + TEST_ASSERT_VAL("find other", !strcmp(other[0], "EVENT1,param=3/")); + TEST_ASSERT_VAL("find other", !strcmp(other[1], "EVENT2,param=3/")); + TEST_ASSERT_VAL("find other", other[2] == NULL); + for (i = 0; i < num_other; i++) zfree(&other[i]); free((void *)other); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 20/91] perf tools: Enable Hz/hz prinitg for --metric-only option 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (18 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 19/91] perf tests expr: Added test for runtime param in metric expression Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 21/91] perf vendor events power9: Add hv_24x7 socket/chip level metric events Arnaldo Carvalho de Melo ` (70 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Kajol Jain, Jiri Olsa, Alexander Shishkin, Andi Kleen, Anju T Sudhakar, Benjamin Herrenschmidt, Greg Kroah-Hartman, Jin Yao, Joe Mario, Kan Liang, Madhavan Srinivasan, Mamatha Inamdar, Mark Rutland, Michael Ellerman, Michael Petlan From: Kajol Jain <kjain@linux.ibm.com> Commit 54b5091606c18 ("perf stat: Implement --metric-only mode") added function 'valid_only_metric()' which drops "Hz" or "hz", if it is part of "ScaleUnit". This patch enable it since hv_24x7 supports couple of frequency events. Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Joe Mario <jmario@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-7-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/stat-display.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 9e757d18d713..679aaa655824 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -237,8 +237,6 @@ static bool valid_only_metric(const char *unit) if (!unit) return false; if (strstr(unit, "/sec") || - strstr(unit, "hz") || - strstr(unit, "Hz") || strstr(unit, "CPUs utilized")) return false; return true; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 21/91] perf vendor events power9: Add hv_24x7 socket/chip level metric events 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (19 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 20/91] perf tools: Enable Hz/hz prinitg for --metric-only option Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 22/91] perf tools: Move routines that probe for perf API features to separate file Arnaldo Carvalho de Melo ` (69 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Kajol Jain, Jiri Olsa, Alexander Shishkin, Andi Kleen, Anju T Sudhakar, Benjamin Herrenschmidt, Greg Kroah-Hartman, Jin Yao, Joe Mario, Kan Liang, Madhavan Srinivasan, Mamatha Inamdar, Mark Rutland, Michael Ellerman, Michael Petlan From: Kajol Jain <kjain@linux.ibm.com> The hv_24×7 feature in IBM® POWER9™ processor-based servers provide the facility to continuously collect large numbers of hardware performance metrics efficiently and accurately. This patch adds hv_24x7 metric file for different Socket/chip resources. Result: power9 platform: command:# ./perf stat --metric-only -M Memory_RD_BW_Chip -C 0 -I 1000 1.000096188 0.9 0.3 2.000285720 0.5 0.1 3.000424990 0.4 0.1 command:# ./perf stat --metric-only -M PowerBUS_Frequency -C 0 -I 1000 1.000097981 2.3 2.3 2.000291713 2.3 2.3 3.000421719 2.3 2.3 4.000550912 2.3 2.3 Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Joe Mario <jmario@redhat.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@ozlabs.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20200401203340.31402-8-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../arch/powerpc/power9/nest_metrics.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json diff --git a/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json b/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json new file mode 100644 index 000000000000..c121e526442a --- /dev/null +++ b/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json @@ -0,0 +1,19 @@ +[ + { + "MetricExpr": "(hv_24x7@PM_MCS01_128B_RD_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS01_128B_RD_DISP_PORT23\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_RD_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_RD_DISP_PORT23\\,chip\\=?@)", + "MetricName": "Memory_RD_BW_Chip", + "MetricGroup": "Memory_BW", + "ScaleUnit": "1.6e-2MB" + }, + { + "MetricExpr": "(hv_24x7@PM_MCS01_128B_WR_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS01_128B_WR_DISP_PORT23\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_WR_DISP_PORT01\\,chip\\=?@ + hv_24x7@PM_MCS23_128B_WR_DISP_PORT23\\,chip\\=?@ )", + "MetricName": "Memory_WR_BW_Chip", + "MetricGroup": "Memory_BW", + "ScaleUnit": "1.6e-2MB" + }, + { + "MetricExpr": "(hv_24x7@PM_PB_CYC\\,chip\\=?@ )", + "MetricName": "PowerBUS_Frequency", + "ScaleUnit": "2.5e-7GHz" + } +] -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 22/91] perf tools: Move routines that probe for perf API features to separate file 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (20 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 21/91] perf vendor events power9: Add hv_24x7 socket/chip level metric events Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 23/91] perf record: Move sb_evlist to 'struct record' Arnaldo Carvalho de Melo ` (68 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> Trying to disentangle this a bit further, unfortunately it uses parse_events(), its interesting to have it separated anyway, so do it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/arch/arm/util/cs-etm.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 1 + tools/perf/builtin-record.c | 1 + tools/perf/util/Build | 1 + tools/perf/util/auxtrace.c | 1 + tools/perf/util/evlist.c | 1 + tools/perf/util/evlist.h | 4 - tools/perf/util/intel-pt.c | 1 + tools/perf/util/perf_api_probe.c | 164 ++++++++++++++++++++++++++++ tools/perf/util/perf_api_probe.h | 14 +++ tools/perf/util/record.c | 155 +------------------------- 11 files changed, 186 insertions(+), 158 deletions(-) create mode 100644 tools/perf/util/perf_api_probe.c create mode 100644 tools/perf/util/perf_api_probe.h diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 941f814820b8..b8df8054dd5e 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -23,6 +23,7 @@ #include "../../util/event.h" #include "../../util/evlist.h" #include "../../util/evsel.h" +#include "../../util/perf_api_probe.h" #include "../../util/evsel_config.h" #include "../../util/pmu.h" #include "../../util/cs-etm.h" diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index 1643aed8c4c8..6b888963c21c 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c @@ -25,6 +25,7 @@ #include "../../../util/pmu.h" #include "../../../util/debug.h" #include "../../../util/auxtrace.h" +#include "../../../util/perf_api_probe.h" #include "../../../util/record.h" #include "../../../util/target.h" #include "../../../util/tsc.h" diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 2e8011f179f2..bf3a6f7df463 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -34,6 +34,7 @@ #include "util/tsc.h" #include "util/parse-branch-options.h" #include "util/parse-regs-options.h" +#include "util/perf_api_probe.h" #include "util/llvm-utils.h" #include "util/bpf-loader.h" #include "util/trigger.h" diff --git a/tools/perf/util/Build b/tools/perf/util/Build index c0cf8dff694e..229abefed59a 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -88,6 +88,7 @@ perf-y += counts.o perf-y += stat.o perf-y += stat-shadow.o perf-y += stat-display.o +perf-y += perf_api_probe.o perf-y += record.o perf-y += srcline.o perf-y += srccode.o diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 33ad33378a90..ac6e09965a78 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -33,6 +33,7 @@ #include "evsel.h" #include "evsel_config.h" #include "symbol.h" +#include "util/perf_api_probe.h" #include "util/synthetic-events.h" #include "thread_map.h" #include "asm/bug.h" diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 82d9f9bb8975..3f7e7d5f008b 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -23,6 +23,7 @@ #include "asm/bug.h" #include "bpf-event.h" #include "util/string2.h" +#include "util/perf_api_probe.h" #include <signal.h> #include <unistd.h> #include <sched.h> diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index f5bd5c386df1..48622e593972 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -173,10 +173,6 @@ void evlist__close(struct evlist *evlist); struct callchain_param; void perf_evlist__set_id_pos(struct evlist *evlist); -bool perf_can_sample_identifier(void); -bool perf_can_record_switch_events(void); -bool perf_can_record_cpu_wide(void); -bool perf_can_aux_sample(void); void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, struct callchain_param *callchain); int record_opts__config(struct record_opts *opts); diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 4be7634dccf5..30e1ee6d3e40 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -33,6 +33,7 @@ #include "tsc.h" #include "intel-pt.h" #include "config.h" +#include "util/perf_api_probe.h" #include "util/synthetic-events.h" #include "time-utils.h" diff --git a/tools/perf/util/perf_api_probe.c b/tools/perf/util/perf_api_probe.c new file mode 100644 index 000000000000..1337965673d7 --- /dev/null +++ b/tools/perf/util/perf_api_probe.c @@ -0,0 +1,164 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include "perf-sys.h" +#include "util/cloexec.h" +#include "util/evlist.h" +#include "util/evsel.h" +#include "util/parse-events.h" +#include "util/perf_api_probe.h" +#include <perf/cpumap.h> +#include <errno.h> + +typedef void (*setup_probe_fn_t)(struct evsel *evsel); + +static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str) +{ + struct evlist *evlist; + struct evsel *evsel; + unsigned long flags = perf_event_open_cloexec_flag(); + int err = -EAGAIN, fd; + static pid_t pid = -1; + + evlist = evlist__new(); + if (!evlist) + return -ENOMEM; + + if (parse_events(evlist, str, NULL)) + goto out_delete; + + evsel = evlist__first(evlist); + + while (1) { + fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); + if (fd < 0) { + if (pid == -1 && errno == EACCES) { + pid = 0; + continue; + } + goto out_delete; + } + break; + } + close(fd); + + fn(evsel); + + fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); + if (fd < 0) { + if (errno == EINVAL) + err = -EINVAL; + goto out_delete; + } + close(fd); + err = 0; + +out_delete: + evlist__delete(evlist); + return err; +} + +static bool perf_probe_api(setup_probe_fn_t fn) +{ + const char *try[] = {"cycles:u", "instructions:u", "cpu-clock:u", NULL}; + struct perf_cpu_map *cpus; + int cpu, ret, i = 0; + + cpus = perf_cpu_map__new(NULL); + if (!cpus) + return false; + cpu = cpus->map[0]; + perf_cpu_map__put(cpus); + + do { + ret = perf_do_probe_api(fn, cpu, try[i++]); + if (!ret) + return true; + } while (ret == -EAGAIN && try[i]); + + return false; +} + +static void perf_probe_sample_identifier(struct evsel *evsel) +{ + evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; +} + +static void perf_probe_comm_exec(struct evsel *evsel) +{ + evsel->core.attr.comm_exec = 1; +} + +static void perf_probe_context_switch(struct evsel *evsel) +{ + evsel->core.attr.context_switch = 1; +} + +bool perf_can_sample_identifier(void) +{ + return perf_probe_api(perf_probe_sample_identifier); +} + +bool perf_can_comm_exec(void) +{ + return perf_probe_api(perf_probe_comm_exec); +} + +bool perf_can_record_switch_events(void) +{ + return perf_probe_api(perf_probe_context_switch); +} + +bool perf_can_record_cpu_wide(void) +{ + struct perf_event_attr attr = { + .type = PERF_TYPE_SOFTWARE, + .config = PERF_COUNT_SW_CPU_CLOCK, + .exclude_kernel = 1, + }; + struct perf_cpu_map *cpus; + int cpu, fd; + + cpus = perf_cpu_map__new(NULL); + if (!cpus) + return false; + cpu = cpus->map[0]; + perf_cpu_map__put(cpus); + + fd = sys_perf_event_open(&attr, -1, cpu, -1, 0); + if (fd < 0) + return false; + close(fd); + + return true; +} + +/* + * Architectures are expected to know if AUX area sampling is supported by the + * hardware. Here we check for kernel support. + */ +bool perf_can_aux_sample(void) +{ + struct perf_event_attr attr = { + .size = sizeof(struct perf_event_attr), + .exclude_kernel = 1, + /* + * Non-zero value causes the kernel to calculate the effective + * attribute size up to that byte. + */ + .aux_sample_size = 1, + }; + int fd; + + fd = sys_perf_event_open(&attr, -1, 0, -1, 0); + /* + * If the kernel attribute is big enough to contain aux_sample_size + * then we assume that it is supported. We are relying on the kernel to + * validate the attribute size before anything else that could be wrong. + */ + if (fd < 0 && errno == E2BIG) + return false; + if (fd >= 0) + close(fd); + + return true; +} diff --git a/tools/perf/util/perf_api_probe.h b/tools/perf/util/perf_api_probe.h new file mode 100644 index 000000000000..706c3c6426e2 --- /dev/null +++ b/tools/perf/util/perf_api_probe.h @@ -0,0 +1,14 @@ + +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __PERF_API_PROBE_H +#define __PERF_API_PROBE_H + +#include <stdbool.h> + +bool perf_can_aux_sample(void); +bool perf_can_comm_exec(void); +bool perf_can_record_cpu_wide(void); +bool perf_can_record_switch_events(void); +bool perf_can_sample_identifier(void); + +#endif // __PERF_API_PROBE_H diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 6d3e3df6e2a1..c2c8cce506b4 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -10,163 +10,10 @@ #include <subcmd/parse-options.h> #include <perf/cpumap.h> #include "cloexec.h" +#include "util/perf_api_probe.h" #include "record.h" #include "../perf-sys.h" -typedef void (*setup_probe_fn_t)(struct evsel *evsel); - -static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str) -{ - struct evlist *evlist; - struct evsel *evsel; - unsigned long flags = perf_event_open_cloexec_flag(); - int err = -EAGAIN, fd; - static pid_t pid = -1; - - evlist = evlist__new(); - if (!evlist) - return -ENOMEM; - - if (parse_events(evlist, str, NULL)) - goto out_delete; - - evsel = evlist__first(evlist); - - while (1) { - fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); - if (fd < 0) { - if (pid == -1 && errno == EACCES) { - pid = 0; - continue; - } - goto out_delete; - } - break; - } - close(fd); - - fn(evsel); - - fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); - if (fd < 0) { - if (errno == EINVAL) - err = -EINVAL; - goto out_delete; - } - close(fd); - err = 0; - -out_delete: - evlist__delete(evlist); - return err; -} - -static bool perf_probe_api(setup_probe_fn_t fn) -{ - const char *try[] = {"cycles:u", "instructions:u", "cpu-clock:u", NULL}; - struct perf_cpu_map *cpus; - int cpu, ret, i = 0; - - cpus = perf_cpu_map__new(NULL); - if (!cpus) - return false; - cpu = cpus->map[0]; - perf_cpu_map__put(cpus); - - do { - ret = perf_do_probe_api(fn, cpu, try[i++]); - if (!ret) - return true; - } while (ret == -EAGAIN && try[i]); - - return false; -} - -static void perf_probe_sample_identifier(struct evsel *evsel) -{ - evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; -} - -static void perf_probe_comm_exec(struct evsel *evsel) -{ - evsel->core.attr.comm_exec = 1; -} - -static void perf_probe_context_switch(struct evsel *evsel) -{ - evsel->core.attr.context_switch = 1; -} - -bool perf_can_sample_identifier(void) -{ - return perf_probe_api(perf_probe_sample_identifier); -} - -static bool perf_can_comm_exec(void) -{ - return perf_probe_api(perf_probe_comm_exec); -} - -bool perf_can_record_switch_events(void) -{ - return perf_probe_api(perf_probe_context_switch); -} - -bool perf_can_record_cpu_wide(void) -{ - struct perf_event_attr attr = { - .type = PERF_TYPE_SOFTWARE, - .config = PERF_COUNT_SW_CPU_CLOCK, - .exclude_kernel = 1, - }; - struct perf_cpu_map *cpus; - int cpu, fd; - - cpus = perf_cpu_map__new(NULL); - if (!cpus) - return false; - cpu = cpus->map[0]; - perf_cpu_map__put(cpus); - - fd = sys_perf_event_open(&attr, -1, cpu, -1, 0); - if (fd < 0) - return false; - close(fd); - - return true; -} - -/* - * Architectures are expected to know if AUX area sampling is supported by the - * hardware. Here we check for kernel support. - */ -bool perf_can_aux_sample(void) -{ - struct perf_event_attr attr = { - .size = sizeof(struct perf_event_attr), - .exclude_kernel = 1, - /* - * Non-zero value causes the kernel to calculate the effective - * attribute size up to that byte. - */ - .aux_sample_size = 1, - }; - int fd; - - fd = sys_perf_event_open(&attr, -1, 0, -1, 0); - /* - * If the kernel attribute is big enough to contain aux_sample_size - * then we assume that it is supported. We are relying on the kernel to - * validate the attribute size before anything else that could be wrong. - */ - if (fd < 0 && errno == E2BIG) - return false; - if (fd >= 0) - close(fd); - - return true; -} - /* * perf_evsel__config_leader_sampling() uses special rules for leader sampling. * However, if the leader is an AUX area event, then assume the event to sample -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 23/91] perf record: Move sb_evlist to 'struct record' 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (21 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 22/91] perf tools: Move routines that probe for perf API features to separate file Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 24/91] perf top: Move sb_evlist to 'struct perf_top' Arnaldo Carvalho de Melo ` (67 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> Where state related to a 'perf record' session is grouped. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-2-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index bf3a6f7df463..a6d887d97ceb 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -87,6 +87,7 @@ struct record { struct auxtrace_record *itr; struct evlist *evlist; struct perf_session *session; + struct evlist *sb_evlist; int realtime_prio; bool no_buildid; bool no_buildid_set; @@ -1447,7 +1448,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) struct perf_data *data = &rec->data; struct perf_session *session; bool disabled = false, draining = false; - struct evlist *sb_evlist = NULL; int fd; float ratio = 0; @@ -1582,9 +1582,9 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) } if (!opts->no_bpf_event) - bpf_event__add_sb_event(&sb_evlist, &session->header.env); + bpf_event__add_sb_event(&rec->sb_evlist, &session->header.env); - if (perf_evlist__start_sb_thread(sb_evlist, &rec->opts.target)) { + if (perf_evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) { pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); opts->no_bpf_event = true; } @@ -1858,7 +1858,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) perf_session__delete(session); if (!opts->no_bpf_event) - perf_evlist__stop_sb_thread(sb_evlist); + perf_evlist__stop_sb_thread(rec->sb_evlist); return status; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 24/91] perf top: Move sb_evlist to 'struct perf_top' 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (22 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 23/91] perf record: Move sb_evlist to 'struct record' Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 25/91] perf bpf: Decouple creating the evlist from adding the SB event Arnaldo Carvalho de Melo ` (66 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> Where state related to a 'perf top' session is grouped. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-3-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-top.c | 7 +++---- tools/perf/util/top.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 6b067a5ba1d5..70e1c732db6a 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1580,7 +1580,6 @@ int cmd_top(int argc, const char **argv) OPTS_EVSWITCH(&top.evswitch), OPT_END() }; - struct evlist *sb_evlist = NULL; const char * const top_usage[] = { "perf top [<options>]", NULL @@ -1744,9 +1743,9 @@ int cmd_top(int argc, const char **argv) } if (!top.record_opts.no_bpf_event) - bpf_event__add_sb_event(&sb_evlist, &perf_env); + bpf_event__add_sb_event(&top.sb_evlist, &perf_env); - if (perf_evlist__start_sb_thread(sb_evlist, target)) { + if (perf_evlist__start_sb_thread(top.sb_evlist, target)) { pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); opts->no_bpf_event = true; } @@ -1754,7 +1753,7 @@ int cmd_top(int argc, const char **argv) status = __cmd_top(&top); if (!opts->no_bpf_event) - perf_evlist__stop_sb_thread(sb_evlist); + perf_evlist__stop_sb_thread(top.sb_evlist); out_delete_evlist: evlist__delete(top.evlist); diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index 45dc84ddff37..ff8391208ecd 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h @@ -18,7 +18,7 @@ struct perf_session; struct perf_top { struct perf_tool tool; - struct evlist *evlist; + struct evlist *evlist, *sb_evlist; struct record_opts record_opts; struct annotation_options annotation_opts; struct evswitch evswitch; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 25/91] perf bpf: Decouple creating the evlist from adding the SB event 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (23 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 24/91] perf top: Move sb_evlist to 'struct perf_top' Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 26/91] perf parse-events: Add parse_events_option() variant that creates evlist Arnaldo Carvalho de Melo ` (65 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> Renaming bpf_event__add_sb_event() to evlist__add_sb_event() and requiring that the evlist be allocated beforehand. This will allow using the same side band thread and evlist to be used for multiple purposes in addition to react to PERF_RECORD_BPF_EVENT soon after they are generated. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-4-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 17 ++++++++++++++--- tools/perf/builtin-top.c | 15 +++++++++++++-- tools/perf/util/bpf-event.c | 3 +-- tools/perf/util/bpf-event.h | 7 +++---- tools/perf/util/evlist.c | 21 ++++----------------- tools/perf/util/evlist.h | 2 +- 6 files changed, 36 insertions(+), 29 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index a6d887d97ceb..5b6a1d23efe5 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1573,16 +1573,27 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) goto out_child; } + err = -1; if (!rec->no_buildid && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) { pr_err("Couldn't generate buildids. " "Use --no-buildid to profile anyway.\n"); - err = -1; goto out_child; } - if (!opts->no_bpf_event) - bpf_event__add_sb_event(&rec->sb_evlist, &session->header.env); + if (!opts->no_bpf_event) { + rec->sb_evlist = evlist__new(); + + if (rec->sb_evlist == NULL) { + pr_err("Couldn't create side band evlist.\n."); + goto out_child; + } + + if (evlist__add_bpf_sb_event(rec->sb_evlist, &session->header.env)) { + pr_err("Couldn't ask for PERF_RECORD_BPF_EVENT side band events.\n."); + goto out_child; + } + } if (perf_evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) { pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 70e1c732db6a..de24aced7213 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1742,8 +1742,19 @@ int cmd_top(int argc, const char **argv) goto out_delete_evlist; } - if (!top.record_opts.no_bpf_event) - bpf_event__add_sb_event(&top.sb_evlist, &perf_env); + if (!top.record_opts.no_bpf_event) { + top.sb_evlist = evlist__new(); + + if (top.sb_evlist == NULL) { + pr_err("Couldn't create side band evlist.\n."); + goto out_delete_evlist; + } + + if (evlist__add_bpf_sb_event(top.sb_evlist, &perf_env)) { + pr_err("Couldn't ask for PERF_RECORD_BPF_EVENT side band events.\n."); + goto out_delete_evlist; + } + } if (perf_evlist__start_sb_thread(top.sb_evlist, target)) { pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index 0cd41a862952..3742511a08d1 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -509,8 +509,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data) return 0; } -int bpf_event__add_sb_event(struct evlist **evlist, - struct perf_env *env) +int evlist__add_bpf_sb_event(struct evlist *evlist, struct perf_env *env) { struct perf_event_attr attr = { .type = PERF_TYPE_SOFTWARE, diff --git a/tools/perf/util/bpf-event.h b/tools/perf/util/bpf-event.h index 81fdc88e6c1a..68f315c3df5b 100644 --- a/tools/perf/util/bpf-event.h +++ b/tools/perf/util/bpf-event.h @@ -33,8 +33,7 @@ struct btf_node { #ifdef HAVE_LIBBPF_SUPPORT int machine__process_bpf(struct machine *machine, union perf_event *event, struct perf_sample *sample); -int bpf_event__add_sb_event(struct evlist **evlist, - struct perf_env *env); +int evlist__add_bpf_sb_event(struct evlist *evlist, struct perf_env *env); void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info, struct perf_env *env, FILE *fp); @@ -46,8 +45,8 @@ static inline int machine__process_bpf(struct machine *machine __maybe_unused, return 0; } -static inline int bpf_event__add_sb_event(struct evlist **evlist __maybe_unused, - struct perf_env *env __maybe_unused) +static inline int evlist__add_bpf_sb_event(struct evlist *evlist __maybe_unused, + struct perf_env *env __maybe_unused) { return 0; } diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 3f7e7d5f008b..6fe11f4d856a 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1705,39 +1705,26 @@ struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list, return leader; } -int perf_evlist__add_sb_event(struct evlist **evlist, +int perf_evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, perf_evsel__sb_cb_t cb, void *data) { struct evsel *evsel; - bool new_evlist = (*evlist) == NULL; - - if (*evlist == NULL) - *evlist = evlist__new(); - if (*evlist == NULL) - return -1; if (!attr->sample_id_all) { pr_warning("enabling sample_id_all for all side band events\n"); attr->sample_id_all = 1; } - evsel = perf_evsel__new_idx(attr, (*evlist)->core.nr_entries); + evsel = perf_evsel__new_idx(attr, evlist->core.nr_entries); if (!evsel) - goto out_err; + return -1; evsel->side_band.cb = cb; evsel->side_band.data = data; - evlist__add(*evlist, evsel); + evlist__add(evlist, evsel); return 0; - -out_err: - if (new_evlist) { - evlist__delete(*evlist); - *evlist = NULL; - } - return -1; } static void *perf_evlist__poll_thread(void *arg) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 48622e593972..a9d01a11570a 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -107,7 +107,7 @@ int __perf_evlist__add_default_attrs(struct evlist *evlist, int perf_evlist__add_dummy(struct evlist *evlist); -int perf_evlist__add_sb_event(struct evlist **evlist, +int perf_evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, perf_evsel__sb_cb_t cb, void *data); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 26/91] perf parse-events: Add parse_events_option() variant that creates evlist 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (24 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 25/91] perf bpf: Decouple creating the evlist from adding the SB event Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 27/91] perf evlist: Move the sideband thread routines to separate object Arnaldo Carvalho de Melo ` (64 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> For the upcoming --switch-output-event option we want to create the side band event, populate it with the specified events and then, if it is present multiple times, go on adding to it, then, if the BPF tracking is required, use the first event to set its attr.bpf_event to get those PERF_RECORD_BPF_EVENT metadata events too. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-5-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.c | 23 +++++++++++++++++++++++ tools/perf/util/parse-events.h | 1 + 2 files changed, 24 insertions(+) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 10107747b361..5795f3a8f71c 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2190,6 +2190,29 @@ int parse_events_option(const struct option *opt, const char *str, return ret; } +int parse_events_option_new_evlist(const struct option *opt, const char *str, int unset) +{ + struct evlist **evlistp = opt->value; + int ret; + + if (*evlistp == NULL) { + *evlistp = evlist__new(); + + if (*evlistp == NULL) { + fprintf(stderr, "Not enough memory to create evlist\n"); + return -1; + } + } + + ret = parse_events_option(opt, str, unset); + if (ret) { + evlist__delete(*evlistp); + *evlistp = NULL; + } + + return ret; +} + static int foreach_evsel_in_last_glob(struct evlist *evlist, int (*func)(struct evsel *evsel, diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 27596cbd0ba0..6ead9661238c 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -31,6 +31,7 @@ bool have_tracepoints(struct list_head *evlist); const char *event_type(int type); int parse_events_option(const struct option *opt, const char *str, int unset); +int parse_events_option_new_evlist(const struct option *opt, const char *str, int unset); int parse_events(struct evlist *evlist, const char *str, struct parse_events_error *error); int parse_events_terms(struct list_head *terms, const char *str); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 27/91] perf evlist: Move the sideband thread routines to separate object 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (25 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 26/91] perf parse-events: Add parse_events_option() variant that creates evlist Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 28/91] perf evlist: Allow reusing the side band thread for more purposes Arnaldo Carvalho de Melo ` (63 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> To avoid dragging more stuff into the perf python binding in the following csets. Reported-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/Build | 1 + tools/perf/util/evlist.c | 117 ---------------------------- tools/perf/util/sideband_evlist.c | 125 ++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 117 deletions(-) create mode 100644 tools/perf/util/sideband_evlist.c diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 229abefed59a..ca07a162d602 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -10,6 +10,7 @@ perf-y += db-export.o perf-y += env.o perf-y += event.o perf-y += evlist.o +perf-y += sideband_evlist.o perf-y += evsel.o perf-y += evsel_fprintf.o perf-y += perf_event_attr_fprintf.o diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 6fe11f4d856a..6d902c02fd95 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1704,120 +1704,3 @@ struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list, } return leader; } - -int perf_evlist__add_sb_event(struct evlist *evlist, - struct perf_event_attr *attr, - perf_evsel__sb_cb_t cb, - void *data) -{ - struct evsel *evsel; - - if (!attr->sample_id_all) { - pr_warning("enabling sample_id_all for all side band events\n"); - attr->sample_id_all = 1; - } - - evsel = perf_evsel__new_idx(attr, evlist->core.nr_entries); - if (!evsel) - return -1; - - evsel->side_band.cb = cb; - evsel->side_band.data = data; - evlist__add(evlist, evsel); - return 0; -} - -static void *perf_evlist__poll_thread(void *arg) -{ - struct evlist *evlist = arg; - bool draining = false; - int i, done = 0; - /* - * In order to read symbols from other namespaces perf to needs to call - * setns(2). This isn't permitted if the struct_fs has multiple users. - * unshare(2) the fs so that we may continue to setns into namespaces - * that we're observing when, for instance, reading the build-ids at - * the end of a 'perf record' session. - */ - unshare(CLONE_FS); - - while (!done) { - bool got_data = false; - - if (evlist->thread.done) - draining = true; - - if (!draining) - evlist__poll(evlist, 1000); - - for (i = 0; i < evlist->core.nr_mmaps; i++) { - struct mmap *map = &evlist->mmap[i]; - union perf_event *event; - - if (perf_mmap__read_init(&map->core)) - continue; - while ((event = perf_mmap__read_event(&map->core)) != NULL) { - struct evsel *evsel = perf_evlist__event2evsel(evlist, event); - - if (evsel && evsel->side_band.cb) - evsel->side_band.cb(event, evsel->side_band.data); - else - pr_warning("cannot locate proper evsel for the side band event\n"); - - perf_mmap__consume(&map->core); - got_data = true; - } - perf_mmap__read_done(&map->core); - } - - if (draining && !got_data) - break; - } - return NULL; -} - -int perf_evlist__start_sb_thread(struct evlist *evlist, - struct target *target) -{ - struct evsel *counter; - - if (!evlist) - return 0; - - if (perf_evlist__create_maps(evlist, target)) - goto out_delete_evlist; - - evlist__for_each_entry(evlist, counter) { - if (evsel__open(counter, evlist->core.cpus, - evlist->core.threads) < 0) - goto out_delete_evlist; - } - - if (evlist__mmap(evlist, UINT_MAX)) - goto out_delete_evlist; - - evlist__for_each_entry(evlist, counter) { - if (evsel__enable(counter)) - goto out_delete_evlist; - } - - evlist->thread.done = 0; - if (pthread_create(&evlist->thread.th, NULL, perf_evlist__poll_thread, evlist)) - goto out_delete_evlist; - - return 0; - -out_delete_evlist: - evlist__delete(evlist); - evlist = NULL; - return -1; -} - -void perf_evlist__stop_sb_thread(struct evlist *evlist) -{ - if (!evlist) - return; - evlist->thread.done = 1; - pthread_join(evlist->thread.th, NULL); - evlist__delete(evlist); -} diff --git a/tools/perf/util/sideband_evlist.c b/tools/perf/util/sideband_evlist.c new file mode 100644 index 000000000000..073d201bb6ea --- /dev/null +++ b/tools/perf/util/sideband_evlist.c @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "util/debug.h" +#include "util/evlist.h" +#include "util/evsel.h" +#include "util/mmap.h" +#include <perf/mmap.h> +#include <linux/perf_event.h> +#include <limits.h> +#include <pthread.h> +#include <sched.h> +#include <stdbool.h> + +int perf_evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, + perf_evsel__sb_cb_t cb, void *data) +{ + struct evsel *evsel; + + if (!attr->sample_id_all) { + pr_warning("enabling sample_id_all for all side band events\n"); + attr->sample_id_all = 1; + } + + evsel = perf_evsel__new_idx(attr, evlist->core.nr_entries); + if (!evsel) + return -1; + + evsel->side_band.cb = cb; + evsel->side_band.data = data; + evlist__add(evlist, evsel); + return 0; +} + +static void *perf_evlist__poll_thread(void *arg) +{ + struct evlist *evlist = arg; + bool draining = false; + int i, done = 0; + /* + * In order to read symbols from other namespaces perf to needs to call + * setns(2). This isn't permitted if the struct_fs has multiple users. + * unshare(2) the fs so that we may continue to setns into namespaces + * that we're observing when, for instance, reading the build-ids at + * the end of a 'perf record' session. + */ + unshare(CLONE_FS); + + while (!done) { + bool got_data = false; + + if (evlist->thread.done) + draining = true; + + if (!draining) + evlist__poll(evlist, 1000); + + for (i = 0; i < evlist->core.nr_mmaps; i++) { + struct mmap *map = &evlist->mmap[i]; + union perf_event *event; + + if (perf_mmap__read_init(&map->core)) + continue; + while ((event = perf_mmap__read_event(&map->core)) != NULL) { + struct evsel *evsel = perf_evlist__event2evsel(evlist, event); + + if (evsel && evsel->side_band.cb) + evsel->side_band.cb(event, evsel->side_band.data); + else + pr_warning("cannot locate proper evsel for the side band event\n"); + + perf_mmap__consume(&map->core); + got_data = true; + } + perf_mmap__read_done(&map->core); + } + + if (draining && !got_data) + break; + } + return NULL; +} + +int perf_evlist__start_sb_thread(struct evlist *evlist, struct target *target) +{ + struct evsel *counter; + + if (!evlist) + return 0; + + if (perf_evlist__create_maps(evlist, target)) + goto out_delete_evlist; + + evlist__for_each_entry(evlist, counter) { + if (evsel__open(counter, evlist->core.cpus, evlist->core.threads) < 0) + goto out_delete_evlist; + } + + if (evlist__mmap(evlist, UINT_MAX)) + goto out_delete_evlist; + + evlist__for_each_entry(evlist, counter) { + if (evsel__enable(counter)) + goto out_delete_evlist; + } + + evlist->thread.done = 0; + if (pthread_create(&evlist->thread.th, NULL, perf_evlist__poll_thread, evlist)) + goto out_delete_evlist; + + return 0; + +out_delete_evlist: + evlist__delete(evlist); + evlist = NULL; + return -1; +} + +void perf_evlist__stop_sb_thread(struct evlist *evlist) +{ + if (!evlist) + return; + evlist->thread.done = 1; + pthread_join(evlist->thread.th, NULL); + evlist__delete(evlist); +} -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 28/91] perf evlist: Allow reusing the side band thread for more purposes 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (26 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 27/91] perf evlist: Move the sideband thread routines to separate object Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 29/91] libsubcmd: Introduce OPT_CALLBACK_SET() Arnaldo Carvalho de Melo ` (62 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> I.e. so far we had just one event in that side band thread, a dummy one with attr.bpf_event set, so that 'perf record' can go ahead and ask the kernel for further information about BPF programs being loaded. Allow for more than one event to be there, so that we can use it as well for the upcoming --switch-output-event feature. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-6-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evlist.h | 1 + tools/perf/util/sideband_evlist.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index a9d01a11570a..93de63e2a247 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -111,6 +111,7 @@ int perf_evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, perf_evsel__sb_cb_t cb, void *data); +void evlist__set_cb(struct evlist *evlist, perf_evsel__sb_cb_t cb, void *data); int perf_evlist__start_sb_thread(struct evlist *evlist, struct target *target); void perf_evlist__stop_sb_thread(struct evlist *evlist); diff --git a/tools/perf/util/sideband_evlist.c b/tools/perf/util/sideband_evlist.c index 073d201bb6ea..1d6f470d64c4 100644 --- a/tools/perf/util/sideband_evlist.c +++ b/tools/perf/util/sideband_evlist.c @@ -4,6 +4,7 @@ #include "util/evlist.h" #include "util/evsel.h" #include "util/mmap.h" +#include "util/perf_api_probe.h" #include <perf/mmap.h> #include <linux/perf_event.h> #include <limits.h> @@ -80,6 +81,19 @@ static void *perf_evlist__poll_thread(void *arg) return NULL; } +void evlist__set_cb(struct evlist *evlist, perf_evsel__sb_cb_t cb, void *data) +{ + struct evsel *evsel; + + evlist__for_each_entry(evlist, evsel) { + evsel->core.attr.sample_id_all = 1; + evsel->core.attr.watermark = 1; + evsel->core.attr.wakeup_watermark = 1; + evsel->side_band.cb = cb; + evsel->side_band.data = data; + } +} + int perf_evlist__start_sb_thread(struct evlist *evlist, struct target *target) { struct evsel *counter; @@ -90,6 +104,15 @@ int perf_evlist__start_sb_thread(struct evlist *evlist, struct target *target) if (perf_evlist__create_maps(evlist, target)) goto out_delete_evlist; + if (evlist->core.nr_entries > 1) { + bool can_sample_identifier = perf_can_sample_identifier(); + + evlist__for_each_entry(evlist, counter) + perf_evsel__set_sample_id(counter, can_sample_identifier); + + perf_evlist__set_id_pos(evlist); + } + evlist__for_each_entry(evlist, counter) { if (evsel__open(counter, evlist->core.cpus, evlist->core.threads) < 0) goto out_delete_evlist; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 29/91] libsubcmd: Introduce OPT_CALLBACK_SET() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (27 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 28/91] perf evlist: Allow reusing the side band thread for more purposes Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 30/91] perf record: Introduce --switch-output-event Arnaldo Carvalho de Melo ` (61 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> To register that an option was set, like with the upcoming 'perf record --switch-output-option' one. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-7-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/subcmd/parse-options.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/subcmd/parse-options.h b/tools/lib/subcmd/parse-options.h index af9def589863..d2414144eb8c 100644 --- a/tools/lib/subcmd/parse-options.h +++ b/tools/lib/subcmd/parse-options.h @@ -151,6 +151,8 @@ struct option { { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb } #define OPT_CALLBACK(s, l, v, a, h, f) \ { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f) } +#define OPT_CALLBACK_SET(s, l, v, os, a, h, f) \ + { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .set = check_vtype(os, bool *)} #define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \ { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG } #define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \ -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 30/91] perf record: Introduce --switch-output-event 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (28 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 29/91] libsubcmd: Introduce OPT_CALLBACK_SET() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 31/91] perf record: Move side band evlist setup to separate routine Arnaldo Carvalho de Melo ` (60 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> Now we can use it with --overwrite to have a flight recorder mode that gets snapshot requests from arbitrary events that are processed in the side band thread together with the PERF_RECORD_BPF_EVENT processing. Example: To collect scheduler events until a recvmmsg syscall happens, system wide: [root@five a]# rm -f perf.data.2020042717* [root@five a]# perf record --overwrite -e sched:*switch,syscalls:*recvmmsg --switch-output-event syscalls:sys_enter_recvmmsg [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042717585458 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042717590235 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042717590398 ] ^C[ perf record: Woken up 1 times to write data ] [ perf record: Dump perf.data.2020042717590511 ] [ perf record: Captured and wrote 7.244 MB perf.data.<timestamp> ] So in the above case we had 3 snapshots, the fourth was forced by control+C: [root@five a]# ls -la total 20440 drwxr-xr-x. 2 root root 4096 Apr 27 17:59 . dr-xr-x---. 12 root root 4096 Apr 27 17:46 .. -rw-------. 1 root root 3936125 Apr 27 17:58 perf.data.2020042717585458 -rw-------. 1 root root 5074869 Apr 27 17:59 perf.data.2020042717590235 -rw-------. 1 root root 4291037 Apr 27 17:59 perf.data.2020042717590398 -rw-------. 1 root root 7617037 Apr 27 17:59 perf.data.2020042717590511 [root@five a]# One can make this more precise by adding the switch output event to the main -e events list, as since this is done asynchronously, a few events after the signal event will appear in the snapshots, as can be seen with: [root@five a]# rm -f perf.data.20200427175* [root@five a]# perf record --overwrite -e sched:*switch,syscalls:*recvmmsg --switch-output-event syscalls:sys_enter_recvmmsg [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042718024203 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042718024301 ] [ perf record: dump data: Woken up 1 times ] [ perf record: Dump perf.data.2020042718024484 ] ^C[ perf record: Woken up 1 times to write data ] [ perf record: Dump perf.data.2020042718024562 ] [ perf record: Captured and wrote 7.337 MB perf.data.<timestamp> ] [root@five a]# perf script -i perf.data.2020042718024203 | tail -15 PacerThread 148586 [005] 122.830729: sched:sched_switch: prev_comm=PacerThread prev_pid=148586... swapper 0 [000] 122.833588: sched:sched_switch: prev_comm=swapper/0 prev_pid=... NetworkManager 1251 [000] 122.833619: syscalls:sys_enter_recvmmsg: fd: 0x0000001c, mmsg: 0x7ffe83054a1... swapper 0 [002] 122.833624: sched:sched_switch: prev_comm=swapper/2 prev_pid=... swapper 0 [003] 122.833624: sched:sched_switch: prev_comm=swapper/3 prev_pid=... NetworkManager 1251 [000] 122.833626: syscalls:sys_exit_recvmmsg: 0x1 kworker/3:3-eve 158946 [003] 122.833628: sched:sched_switch: prev_comm=kworker/3:3 prev_pid=15894... swapper 0 [004] 122.833641: sched:sched_switch: prev_comm=swapper/4 prev_pid=... NetworkManager 1251 [000] 122.833642: sched:sched_switch: prev_comm=NetworkManage... perf 228273 [002] 122.833645: sched:sched_switch: prev_comm=perf prev_pid=22827... swapper 0 [011] 122.833646: sched:sched_switch: prev_comm=swapper/1... swapper 0 [002] 122.833648: sched:sched_switch: prev_comm=swapper/... kworker/0:2-eve 207387 [000] 122.833648: sched:sched_switch: prev_comm=kworker/0:2 prev_pid=20738... kworker/2:3-eve 232038 [002] 122.833652: sched:sched_switch: prev_comm=kworker/2:3 prev_pid=23203... perf 235825 [003] 122.833653: sched:sched_switch: prev_comm=perf prev_pid=23582... [root@five a]# Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-8-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-record.txt | 13 ++++++++ tools/perf/builtin-record.c | 41 +++++++++++++++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 6e8b4649307c..561ef55743e2 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -556,6 +556,19 @@ overhead. You can still switch them on with: --switch-output --no-no-buildid --no-no-buildid-cache +--switch-output-event:: +Events that will cause the switch of the perf.data file, auto-selecting +--switch-output=signal, the results are similar as internally the side band +thread will also send a SIGUSR2 to the main one. + +Uses the same syntax as --event, it will just not be recorded, serving only to +switch the perf.data file as soon as the --switch-output event is processed by +a separate sideband thread. + +This sideband thread is also used to other purposes, like processing the +PERF_RECORD_BPF_EVENT records as they happen, asking the kernel for extra BPF +information, etc. + --switch-max-files=N:: When rotating perf.data with --switch-output, only keep N files. diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 5b6a1d23efe5..bb5b4d2fc32b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -88,7 +88,9 @@ struct record { struct evlist *evlist; struct perf_session *session; struct evlist *sb_evlist; + pthread_t thread_id; int realtime_prio; + bool switch_output_event_set; bool no_buildid; bool no_buildid_set; bool no_buildid_cache; @@ -1437,6 +1439,13 @@ static int record__synthesize(struct record *rec, bool tail) return err; } +static int record__process_signal_event(union perf_event *event __maybe_unused, void *data) +{ + struct record *rec = data; + pthread_kill(rec->thread_id, SIGUSR2); + return 0; +} + static int __cmd_record(struct record *rec, int argc, const char **argv) { int err; @@ -1581,12 +1590,24 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) goto out_child; } - if (!opts->no_bpf_event) { - rec->sb_evlist = evlist__new(); + if (rec->sb_evlist != NULL) { + /* + * We get here if --switch-output-event populated the + * sb_evlist, so associate a callback that will send a SIGUSR2 + * to the main thread. + */ + evlist__set_cb(rec->sb_evlist, record__process_signal_event, rec); + rec->thread_id = pthread_self(); + } + if (!opts->no_bpf_event) { if (rec->sb_evlist == NULL) { - pr_err("Couldn't create side band evlist.\n."); - goto out_child; + rec->sb_evlist = evlist__new(); + + if (rec->sb_evlist == NULL) { + pr_err("Couldn't create side band evlist.\n."); + goto out_child; + } } if (evlist__add_bpf_sb_event(rec->sb_evlist, &session->header.env)) { @@ -2180,10 +2201,19 @@ static int switch_output_setup(struct record *rec) }; unsigned long val; + /* + * If we're using --switch-output-events, then we imply its + * --switch-output=signal, as we'll send a SIGUSR2 from the side band + * thread to its parent. + */ + if (rec->switch_output_event_set) + goto do_signal; + if (!s->set) return 0; if (!strcmp(s->str, "signal")) { +do_signal: s->signal = true; pr_debug("switch-output with SIGUSR2 signal\n"); goto enabled; @@ -2441,6 +2471,9 @@ static struct option __record_options[] = { &record.switch_output.set, "signal or size[BKMG] or time[smhd]", "Switch output when receiving SIGUSR2 (signal) or cross a size or time threshold", "signal"), + OPT_CALLBACK_SET(0, "switch-output-event", &record.sb_evlist, &record.switch_output_event_set, "switch output event", + "switch output event selector. use 'perf list' to list available events", + parse_events_option_new_evlist), OPT_INTEGER(0, "switch-max-files", &record.switch_output.num_files, "Limit number of switch output generated files"), OPT_BOOLEAN(0, "dry-run", &dry_run, -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 31/91] perf record: Move side band evlist setup to separate routine 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (29 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 30/91] perf record: Introduce --switch-output-event Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 32/91] libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus Arnaldo Carvalho de Melo ` (59 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> It is quite big by now, move that code to a separate record__setup_sb_evlist() routine. Suggested-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Link: http://lore.kernel.org/lkml/20200429131106.27974-9-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 71 +++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index bb5b4d2fc32b..cfb9a69a42dd 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1446,6 +1446,44 @@ static int record__process_signal_event(union perf_event *event __maybe_unused, return 0; } +static int record__setup_sb_evlist(struct record *rec) +{ + struct record_opts *opts = &rec->opts; + + if (rec->sb_evlist != NULL) { + /* + * We get here if --switch-output-event populated the + * sb_evlist, so associate a callback that will send a SIGUSR2 + * to the main thread. + */ + evlist__set_cb(rec->sb_evlist, record__process_signal_event, rec); + rec->thread_id = pthread_self(); + } + + if (!opts->no_bpf_event) { + if (rec->sb_evlist == NULL) { + rec->sb_evlist = evlist__new(); + + if (rec->sb_evlist == NULL) { + pr_err("Couldn't create side band evlist.\n."); + return -1; + } + } + + if (evlist__add_bpf_sb_event(rec->sb_evlist, &rec->session->header.env)) { + pr_err("Couldn't ask for PERF_RECORD_BPF_EVENT side band events.\n."); + return -1; + } + } + + if (perf_evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) { + pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); + opts->no_bpf_event = true; + } + + return 0; +} + static int __cmd_record(struct record *rec, int argc, const char **argv) { int err; @@ -1590,36 +1628,9 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) goto out_child; } - if (rec->sb_evlist != NULL) { - /* - * We get here if --switch-output-event populated the - * sb_evlist, so associate a callback that will send a SIGUSR2 - * to the main thread. - */ - evlist__set_cb(rec->sb_evlist, record__process_signal_event, rec); - rec->thread_id = pthread_self(); - } - - if (!opts->no_bpf_event) { - if (rec->sb_evlist == NULL) { - rec->sb_evlist = evlist__new(); - - if (rec->sb_evlist == NULL) { - pr_err("Couldn't create side band evlist.\n."); - goto out_child; - } - } - - if (evlist__add_bpf_sb_event(rec->sb_evlist, &session->header.env)) { - pr_err("Couldn't ask for PERF_RECORD_BPF_EVENT side band events.\n."); - goto out_child; - } - } - - if (perf_evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) { - pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); - opts->no_bpf_event = true; - } + err = record__setup_sb_evlist(rec); + if (err) + goto out_child; err = record__synthesize(rec, false); if (err < 0) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 32/91] libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus. 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (30 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 31/91] perf record: Move side band evlist setup to separate routine Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 33/91] perf parse-events: Fix memory leaks found on parse_events Arnaldo Carvalho de Melo ` (58 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, He Zhe, Andi Kleen, Kyle Meyer, Arnaldo Carvalho de Melo From: He Zhe <zhe.he@windriver.com> A NULL pointer may be passed to perf_cpu_map__cpu and then cause a crash, such as the one commit cb71f7d43ece ("libperf: Setup initial evlist::all_cpus value") fix. Signed-off-by: He Zhe <zhe.he@windriver.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Kyle Meyer <meyerk@hpe.com> Link: http://lore.kernel.org/lkml/1583665157-349023-1-git-send-email-zhe.he@windriver.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/perf/cpumap.c | 2 +- tools/lib/perf/evlist.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c index f93f4e703e4c..ca0215047c32 100644 --- a/tools/lib/perf/cpumap.c +++ b/tools/lib/perf/cpumap.c @@ -247,7 +247,7 @@ struct perf_cpu_map *perf_cpu_map__new(const char *cpu_list) int perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx) { - if (idx < cpus->nr) + if (cpus && idx < cpus->nr) return cpus->map[idx]; return -1; diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c index def55054c55b..c481b62f2ce4 100644 --- a/tools/lib/perf/evlist.c +++ b/tools/lib/perf/evlist.c @@ -125,6 +125,7 @@ void perf_evlist__exit(struct perf_evlist *evlist) perf_cpu_map__put(evlist->cpus); perf_thread_map__put(evlist->threads); evlist->cpus = NULL; + evlist->all_cpus = NULL; evlist->threads = NULL; fdarray__exit(&evlist->pollfd); } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 33/91] perf parse-events: Fix memory leaks found on parse_events 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (31 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 32/91] libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 34/91] " Arnaldo Carvalho de Melo ` (57 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Jiri Olsa, Adrian Hunter, Alexander Shishkin, Andi Kleen, Leo Yan, Mark Rutland, Peter Zijlstra, Stephane Eranian, clang-built-linux, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> Fix a memory leak found by applying LLVM's libfuzzer on parse_events(). Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com [ split from a larger patch, use zfree() ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 5795f3a8f71c..6dc9e57ab95b 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1482,6 +1482,7 @@ int parse_events_add_pmu(struct parse_events_state *parse_state, list_for_each_entry_safe(pos, tmp, &config_terms, list) { list_del_init(&pos->list); + zfree(&pos->val.str); free(pos); } return -EINVAL; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 34/91] perf parse-events: Fix memory leaks found on parse_events 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (32 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 33/91] perf parse-events: Fix memory leaks found on parse_events Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 35/91] perf parse-events: Fix another memory leaks found on parse_events() Arnaldo Carvalho de Melo ` (56 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Adrian Hunter, Jiri Olsa, Alexander Shishkin, Andi Kleen, Leo Yan, Mark Rutland, Peter Zijlstra, Stephane Eranian, clang-built-linux, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> free_list_evsel() deals with tools/perf/ evsels, not with libperf perf_evsels, use the right destructor and avoid a leak, as evsel__delete() will delete something perf_evsel__delete() doesn't. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index e879eb257874..6ece67ed244a 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -44,7 +44,7 @@ static void free_list_evsel(struct list_head* list_evsel) list_for_each_entry_safe(evsel, tmp, list_evsel, core.node) { list_del_init(&evsel->core.node); - perf_evsel__delete(evsel); + evsel__delete(evsel); } free(list_evsel); } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 35/91] perf parse-events: Fix another memory leaks found on parse_events() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (33 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 34/91] " Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 36/91] libperf evlist: Fix a refcount leak Arnaldo Carvalho de Melo ` (55 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Jiri Olsa, Adrian Hunter, Alexander Shishkin, Andi Kleen, Leo Yan, Mark Rutland, Peter Zijlstra, Stephane Eranian, clang-built-linux, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> Fix another memory leak found by applying LLVM's libfuzzer on parse_events(). Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.y | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 6ece67ed244a..c4ca932d092d 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -326,6 +326,7 @@ PE_NAME opt_pmu_config } parse_events_terms__delete($2); parse_events_terms__delete(orig_terms); + free(pattern); free($1); $$ = list; #undef CLEANUP_YYABORT -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 36/91] libperf evlist: Fix a refcount leak 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (34 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 35/91] perf parse-events: Fix another memory leaks found on parse_events() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 37/91] perf tools: Fix reading new topology attribute "core_cpus" Arnaldo Carvalho de Melo ` (54 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Adrian Hunter, Alexander Shishkin, Andi Kleen, Jiri Olsa, Leo Yan, Mark Rutland, Peter Zijlstra, Stephane Eranian, clang-built-linux, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> Memory leaks found by applying LLVM's libfuzzer on the tools/perf parse_events function. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200319023101.82458-2-irogers@google.com [ Did a minor adjustment due to some other previous patch having already set evlist->all_cpus to NULL at perf_evlist__exit() ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/perf/evlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c index c481b62f2ce4..6a875a0f01bb 100644 --- a/tools/lib/perf/evlist.c +++ b/tools/lib/perf/evlist.c @@ -123,6 +123,7 @@ static void perf_evlist__purge(struct perf_evlist *evlist) void perf_evlist__exit(struct perf_evlist *evlist) { perf_cpu_map__put(evlist->cpus); + perf_cpu_map__put(evlist->all_cpus); perf_thread_map__put(evlist->threads); evlist->cpus = NULL; evlist->all_cpus = NULL; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 37/91] perf tools: Fix reading new topology attribute "core_cpus" 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (35 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 36/91] libperf evlist: Fix a refcount leak Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 38/91] perf tools: Simplify checking if SMT is active Arnaldo Carvalho de Melo ` (53 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Konstantin Khlebnikov, Andi Kleen, Dmitry Monakhov, Kan Liang, Peter Zijlstra, Arnaldo Carvalho de Melo From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Check if access("devices/system/cpu/cpu%d/topology/core_cpus", F_OK) fails, which will happen unless the current directory is "/sys". Simply try to read this file first. Fixes: 0ccdb8407a46 ("perf tools: Apply new CPU topology sysfs attributes") Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Cc: Andi Kleen <ak@linux.intel.com> Cc: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/158817718710.747528.11009278875028211991.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/smt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/smt.c b/tools/perf/util/smt.c index 3b791ef2cd50..8481842e9edb 100644 --- a/tools/perf/util/smt.c +++ b/tools/perf/util/smt.c @@ -24,13 +24,13 @@ int smt_on(void) snprintf(fn, sizeof fn, "devices/system/cpu/cpu%d/topology/core_cpus", cpu); - if (access(fn, F_OK) == -1) { + if (sysfs__read_str(fn, &str, &strlen) < 0) { snprintf(fn, sizeof fn, "devices/system/cpu/cpu%d/topology/thread_siblings", cpu); + if (sysfs__read_str(fn, &str, &strlen) < 0) + continue; } - if (sysfs__read_str(fn, &str, &strlen) < 0) - continue; /* Entry is hex, but does not have 0x, so need custom parser */ siblings = strtoull(str, NULL, 16); free(str); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 38/91] perf tools: Simplify checking if SMT is active. 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (36 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 37/91] perf tools: Fix reading new topology attribute "core_cpus" Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 39/91] perf thread-stack: Add branch stack support Arnaldo Carvalho de Melo ` (52 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Konstantin Khlebnikov, Andi Kleen, Dmitry Monakhov, Kan Liang, Peter Zijlstra, Arnaldo Carvalho de Melo From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> SMT now could be disabled via "/sys/devices/system/cpu/smt/control". Status is shown in "/sys/devices/system/cpu/smt/active" simply as "0" / "1". If this knob isn't here then fallback to checking topology as before. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Cc: Andi Kleen <ak@linux.intel.com> Cc: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/158817741394.748034.9273604089138009552.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/smt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/smt.c b/tools/perf/util/smt.c index 8481842e9edb..20bacd5972ad 100644 --- a/tools/perf/util/smt.c +++ b/tools/perf/util/smt.c @@ -15,6 +15,9 @@ int smt_on(void) if (cached) return cached_result; + if (sysfs__read_int("devices/system/cpu/smt/active", &cached_result) > 0) + goto done; + ncpu = sysconf(_SC_NPROCESSORS_CONF); for (cpu = 0; cpu < ncpu; cpu++) { unsigned long long siblings; @@ -42,6 +45,7 @@ int smt_on(void) } if (!cached) { cached_result = 0; +done: cached = true; } return cached_result; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 39/91] perf thread-stack: Add branch stack support 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (37 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 38/91] perf tools: Simplify checking if SMT is active Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 40/91] perf intel-pt: Consolidate thread-stack use condition Arnaldo Carvalho de Melo ` (51 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Intel PT already has support for creating branch stacks for each context (per-cpu or per-thread). In the more common per-cpu case, the branch stack is not separated for different threads, instead being cleared in between each sample. That approach will not work very well for adding branch stacks to regular events. The branch stacks really need to be accumulated separately for each thread. As a start to accomplishing that, this patch adds support for putting branch stack support into the thread-stack. The advantages are: 1. the branches are accumulated separately for each thread 2. the branch stack is cleared only in between continuous traces This helps pave the way for adding branch stacks to regular events, not just synthesized events as at present. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/intel-pt.c | 2 +- tools/perf/util/thread-stack.c | 113 +++++++++++++++++++++++++++++---- tools/perf/util/thread-stack.h | 5 +- 4 files changed, 108 insertions(+), 14 deletions(-) diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index 059e1c805ed0..506112f52619 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -432,7 +432,7 @@ static int intel_bts_process_buffer(struct intel_bts_queue *btsq, le64_to_cpu(branch->from), le64_to_cpu(branch->to), btsq->intel_pt_insn.length, - buffer->buffer_nr + 1); + buffer->buffer_nr + 1, true, 0, 0); if (filter && !(filter & btsq->sample_flags)) continue; err = intel_bts_synth_branch_sample(btsq, branch); diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 30e1ee6d3e40..bdb84470f7d0 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -2033,7 +2033,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq) pt->synth_opts.thread_stack) thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip, state->to_ip, ptq->insn_len, - state->trace_nr); + state->trace_nr, true, 0, 0); else thread_stack__set_trace_nr(ptq->thread, ptq->cpu, state->trace_nr); diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c index 83f6c83f5617..79698831b4b9 100644 --- a/tools/perf/util/thread-stack.c +++ b/tools/perf/util/thread-stack.c @@ -80,6 +80,10 @@ struct thread_stack_entry { * @comm: current comm * @arr_sz: size of array if this is the first element of an array * @rstate: used to detect retpolines + * @br_stack_rb: branch stack (ring buffer) + * @br_stack_sz: maximum branch stack size + * @br_stack_pos: current position in @br_stack_rb + * @mispred_all: mark all branches as mispredicted */ struct thread_stack { struct thread_stack_entry *stack; @@ -95,6 +99,10 @@ struct thread_stack { struct comm *comm; unsigned int arr_sz; enum retpoline_state_t rstate; + struct branch_stack *br_stack_rb; + unsigned int br_stack_sz; + unsigned int br_stack_pos; + bool mispred_all; }; /* @@ -126,13 +134,26 @@ static int thread_stack__grow(struct thread_stack *ts) } static int thread_stack__init(struct thread_stack *ts, struct thread *thread, - struct call_return_processor *crp) + struct call_return_processor *crp, + bool callstack, unsigned int br_stack_sz) { int err; - err = thread_stack__grow(ts); - if (err) - return err; + if (callstack) { + err = thread_stack__grow(ts); + if (err) + return err; + } + + if (br_stack_sz) { + size_t sz = sizeof(struct branch_stack); + + sz += br_stack_sz * sizeof(struct branch_entry); + ts->br_stack_rb = zalloc(sz); + if (!ts->br_stack_rb) + return -ENOMEM; + ts->br_stack_sz = br_stack_sz; + } if (thread->maps && thread->maps->machine) { struct machine *machine = thread->maps->machine; @@ -150,7 +171,9 @@ static int thread_stack__init(struct thread_stack *ts, struct thread *thread, } static struct thread_stack *thread_stack__new(struct thread *thread, int cpu, - struct call_return_processor *crp) + struct call_return_processor *crp, + bool callstack, + unsigned int br_stack_sz) { struct thread_stack *ts = thread->ts, *new_ts; unsigned int old_sz = ts ? ts->arr_sz : 0; @@ -176,7 +199,7 @@ static struct thread_stack *thread_stack__new(struct thread *thread, int cpu, ts += cpu; if (!ts->stack && - thread_stack__init(ts, thread, crp)) + thread_stack__init(ts, thread, crp, callstack, br_stack_sz)) return NULL; return ts; @@ -319,6 +342,9 @@ static int __thread_stack__flush(struct thread *thread, struct thread_stack *ts) if (!crp) { ts->cnt = 0; + ts->br_stack_pos = 0; + if (ts->br_stack_rb) + ts->br_stack_rb->nr = 0; return 0; } @@ -353,8 +379,33 @@ int thread_stack__flush(struct thread *thread) return err; } +static void thread_stack__update_br_stack(struct thread_stack *ts, u32 flags, + u64 from_ip, u64 to_ip) +{ + struct branch_stack *bs = ts->br_stack_rb; + struct branch_entry *be; + + if (!ts->br_stack_pos) + ts->br_stack_pos = ts->br_stack_sz; + + ts->br_stack_pos -= 1; + + be = &bs->entries[ts->br_stack_pos]; + be->from = from_ip; + be->to = to_ip; + be->flags.value = 0; + be->flags.abort = !!(flags & PERF_IP_FLAG_TX_ABORT); + be->flags.in_tx = !!(flags & PERF_IP_FLAG_IN_TX); + /* No support for mispredict */ + be->flags.mispred = ts->mispred_all; + + if (bs->nr < ts->br_stack_sz) + bs->nr += 1; +} + int thread_stack__event(struct thread *thread, int cpu, u32 flags, u64 from_ip, - u64 to_ip, u16 insn_len, u64 trace_nr) + u64 to_ip, u16 insn_len, u64 trace_nr, bool callstack, + unsigned int br_stack_sz, bool mispred_all) { struct thread_stack *ts = thread__stack(thread, cpu); @@ -362,12 +413,13 @@ int thread_stack__event(struct thread *thread, int cpu, u32 flags, u64 from_ip, return -EINVAL; if (!ts) { - ts = thread_stack__new(thread, cpu, NULL); + ts = thread_stack__new(thread, cpu, NULL, callstack, br_stack_sz); if (!ts) { pr_warning("Out of memory: no thread stack\n"); return -ENOMEM; } ts->trace_nr = trace_nr; + ts->mispred_all = mispred_all; } /* @@ -381,8 +433,14 @@ int thread_stack__event(struct thread *thread, int cpu, u32 flags, u64 from_ip, ts->trace_nr = trace_nr; } - /* Stop here if thread_stack__process() is in use */ - if (ts->crp) + if (br_stack_sz) + thread_stack__update_br_stack(ts, flags, from_ip, to_ip); + + /* + * Stop here if thread_stack__process() is in use, or not recording call + * stack. + */ + if (ts->crp || !callstack) return 0; if (flags & PERF_IP_FLAG_CALL) { @@ -430,6 +488,7 @@ static void __thread_stack__free(struct thread *thread, struct thread_stack *ts) { __thread_stack__flush(thread, ts); zfree(&ts->stack); + zfree(&ts->br_stack_rb); } static void thread_stack__reset(struct thread *thread, struct thread_stack *ts) @@ -554,6 +613,38 @@ void thread_stack__sample_late(struct thread *thread, int cpu, } } +void thread_stack__br_sample(struct thread *thread, int cpu, + struct branch_stack *dst, unsigned int sz) +{ + struct thread_stack *ts = thread__stack(thread, cpu); + const size_t bsz = sizeof(struct branch_entry); + struct branch_stack *src; + struct branch_entry *be; + unsigned int nr; + + dst->nr = 0; + + if (!ts) + return; + + src = ts->br_stack_rb; + if (!src->nr) + return; + + dst->nr = min((unsigned int)src->nr, sz); + + be = &dst->entries[0]; + nr = min(ts->br_stack_sz - ts->br_stack_pos, (unsigned int)dst->nr); + memcpy(be, &src->entries[ts->br_stack_pos], bsz * nr); + + if (src->nr >= ts->br_stack_sz) { + sz -= nr; + be = &dst->entries[nr]; + nr = min(ts->br_stack_pos, sz); + memcpy(be, &src->entries[0], bsz * ts->br_stack_pos); + } +} + struct call_return_processor * call_return_processor__new(int (*process)(struct call_return *cr, u64 *parent_db_id, void *data), void *data) @@ -921,7 +1012,7 @@ int thread_stack__process(struct thread *thread, struct comm *comm, } if (!ts) { - ts = thread_stack__new(thread, sample->cpu, crp); + ts = thread_stack__new(thread, sample->cpu, crp, true, 0); if (!ts) return -ENOMEM; ts->comm = comm; diff --git a/tools/perf/util/thread-stack.h b/tools/perf/util/thread-stack.h index 8962ddc4e1ab..c279a0cbbdd0 100644 --- a/tools/perf/util/thread-stack.h +++ b/tools/perf/util/thread-stack.h @@ -81,13 +81,16 @@ struct call_return_processor { }; int thread_stack__event(struct thread *thread, int cpu, u32 flags, u64 from_ip, - u64 to_ip, u16 insn_len, u64 trace_nr); + u64 to_ip, u16 insn_len, u64 trace_nr, bool callstack, + unsigned int br_stack_sz, bool mispred_all); void thread_stack__set_trace_nr(struct thread *thread, int cpu, u64 trace_nr); void thread_stack__sample(struct thread *thread, int cpu, struct ip_callchain *chain, size_t sz, u64 ip, u64 kernel_start); void thread_stack__sample_late(struct thread *thread, int cpu, struct ip_callchain *chain, size_t sz, u64 ip, u64 kernel_start); +void thread_stack__br_sample(struct thread *thread, int cpu, + struct branch_stack *dst, unsigned int sz); int thread_stack__flush(struct thread *thread); void thread_stack__free(struct thread *thread); size_t thread_stack__depth(struct thread *thread, int cpu); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 40/91] perf intel-pt: Consolidate thread-stack use condition 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (38 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 39/91] perf thread-stack: Add branch stack support Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 41/91] perf intel-pt: Change branch stack support to use thread-stacks Arnaldo Carvalho de Melo ` (50 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> The components of the condition do not change, so consolidate them in one variable. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/intel-pt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index bdb84470f7d0..b3c45276b664 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -69,6 +69,7 @@ struct intel_pt { bool est_tsc; bool sync_switch; bool mispred_all; + bool use_thread_stack; int have_sched_switch; u32 pmu_type; u64 kernel_start; @@ -2029,8 +2030,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq) if (!(state->type & INTEL_PT_BRANCH)) return 0; - if (pt->synth_opts.callchain || pt->synth_opts.add_callchain || - pt->synth_opts.thread_stack) + if (pt->use_thread_stack) thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip, state->to_ip, ptq->insn_len, state->trace_nr, true, 0, 0); @@ -3441,6 +3441,10 @@ int intel_pt_process_auxtrace_info(union perf_event *event, goto err_delete_thread; } + pt->use_thread_stack = pt->synth_opts.callchain || + pt->synth_opts.add_callchain || + pt->synth_opts.thread_stack; + err = intel_pt_synth_events(pt, session); if (err) goto err_delete_thread; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 41/91] perf intel-pt: Change branch stack support to use thread-stacks 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (39 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 40/91] perf intel-pt: Consolidate thread-stack use condition Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 42/91] perf auxtrace: Add option to synthesize branch stack for regular events Arnaldo Carvalho de Melo ` (49 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Change Intel PT's branch stack support to use thread stacks. The advantages of using branch stack support from the thread-stack are: 1. the branches are accumulated separately for each thread 2. the branch stack is cleared only in between continuous traces This helps pave the way for adding branch stacks to regular events, not just synthesized events as at present. While the 2 approaches are not identical, in simple cases the results can be identical e.g. Before: # perf record --kcore -e intel_pt// uname # perf script --itrace=i10usl -F+brstacksym,+addr,+flags > cmp1.txt After: # perf script --itrace=i10usl -F+brstacksym,+addr,+flags > cmp2.txt # diff -s cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt are identical Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/intel-pt.c | 141 ++++++++++--------------------------- 1 file changed, 39 insertions(+), 102 deletions(-) diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index b3c45276b664..03b76904ca52 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -70,6 +70,8 @@ struct intel_pt { bool sync_switch; bool mispred_all; bool use_thread_stack; + bool callstack; + unsigned int br_stack_sz; int have_sched_switch; u32 pmu_type; u64 kernel_start; @@ -147,8 +149,6 @@ struct intel_pt_queue { const struct intel_pt_state *state; struct ip_callchain *chain; struct branch_stack *last_branch; - struct branch_stack *last_branch_rb; - size_t last_branch_pos; union perf_event *event_buf; bool on_heap; bool stop; @@ -931,14 +931,10 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt, if (pt->synth_opts.last_branch) { size_t sz = sizeof(struct branch_stack); - sz += pt->synth_opts.last_branch_sz * - sizeof(struct branch_entry); + sz += pt->br_stack_sz * sizeof(struct branch_entry); ptq->last_branch = zalloc(sz); if (!ptq->last_branch) goto out_free; - ptq->last_branch_rb = zalloc(sz); - if (!ptq->last_branch_rb) - goto out_free; } ptq->event_buf = malloc(PERF_SAMPLE_MAX_SIZE); @@ -1007,7 +1003,6 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt, out_free: zfree(&ptq->event_buf); zfree(&ptq->last_branch); - zfree(&ptq->last_branch_rb); zfree(&ptq->chain); free(ptq); return NULL; @@ -1023,7 +1018,6 @@ static void intel_pt_free_queue(void *priv) intel_pt_decoder_free(ptq->decoder); zfree(&ptq->event_buf); zfree(&ptq->last_branch); - zfree(&ptq->last_branch_rb); zfree(&ptq->chain); free(ptq); } @@ -1191,58 +1185,6 @@ static int intel_pt_setup_queues(struct intel_pt *pt) return 0; } -static inline void intel_pt_copy_last_branch_rb(struct intel_pt_queue *ptq) -{ - struct branch_stack *bs_src = ptq->last_branch_rb; - struct branch_stack *bs_dst = ptq->last_branch; - size_t nr = 0; - - bs_dst->nr = bs_src->nr; - - if (!bs_src->nr) - return; - - nr = ptq->pt->synth_opts.last_branch_sz - ptq->last_branch_pos; - memcpy(&bs_dst->entries[0], - &bs_src->entries[ptq->last_branch_pos], - sizeof(struct branch_entry) * nr); - - if (bs_src->nr >= ptq->pt->synth_opts.last_branch_sz) { - memcpy(&bs_dst->entries[nr], - &bs_src->entries[0], - sizeof(struct branch_entry) * ptq->last_branch_pos); - } -} - -static inline void intel_pt_reset_last_branch_rb(struct intel_pt_queue *ptq) -{ - ptq->last_branch_pos = 0; - ptq->last_branch_rb->nr = 0; -} - -static void intel_pt_update_last_branch_rb(struct intel_pt_queue *ptq) -{ - const struct intel_pt_state *state = ptq->state; - struct branch_stack *bs = ptq->last_branch_rb; - struct branch_entry *be; - - if (!ptq->last_branch_pos) - ptq->last_branch_pos = ptq->pt->synth_opts.last_branch_sz; - - ptq->last_branch_pos -= 1; - - be = &bs->entries[ptq->last_branch_pos]; - be->from = state->from_ip; - be->to = state->to_ip; - be->flags.abort = !!(state->flags & INTEL_PT_ABORT_TX); - be->flags.in_tx = !!(state->flags & INTEL_PT_IN_TX); - /* No support for mispredict */ - be->flags.mispred = ptq->pt->mispred_all; - - if (bs->nr < ptq->pt->synth_opts.last_branch_sz) - bs->nr += 1; -} - static inline bool intel_pt_skip_event(struct intel_pt *pt) { return pt->synth_opts.initial_skip && @@ -1310,9 +1252,9 @@ static inline int intel_pt_opt_inject(struct intel_pt *pt, return intel_pt_inject_event(event, sample, type); } -static int intel_pt_deliver_synth_b_event(struct intel_pt *pt, - union perf_event *event, - struct perf_sample *sample, u64 type) +static int intel_pt_deliver_synth_event(struct intel_pt *pt, + union perf_event *event, + struct perf_sample *sample, u64 type) { int ret; @@ -1372,8 +1314,8 @@ static int intel_pt_synth_branch_sample(struct intel_pt_queue *ptq) ptq->last_br_cyc_cnt = ptq->ipc_cyc_cnt; } - return intel_pt_deliver_synth_b_event(pt, event, &sample, - pt->branches_sample_type); + return intel_pt_deliver_synth_event(pt, event, &sample, + pt->branches_sample_type); } static void intel_pt_prep_sample(struct intel_pt *pt, @@ -1391,27 +1333,12 @@ static void intel_pt_prep_sample(struct intel_pt *pt, } if (pt->synth_opts.last_branch) { - intel_pt_copy_last_branch_rb(ptq); + thread_stack__br_sample(ptq->thread, ptq->cpu, ptq->last_branch, + pt->br_stack_sz); sample->branch_stack = ptq->last_branch; } } -static inline int intel_pt_deliver_synth_event(struct intel_pt *pt, - struct intel_pt_queue *ptq, - union perf_event *event, - struct perf_sample *sample, - u64 type) -{ - int ret; - - ret = intel_pt_deliver_synth_b_event(pt, event, sample, type); - - if (pt->synth_opts.last_branch) - intel_pt_reset_last_branch_rb(ptq); - - return ret; -} - static int intel_pt_synth_instruction_sample(struct intel_pt_queue *ptq) { struct intel_pt *pt = ptq->pt; @@ -1436,7 +1363,7 @@ static int intel_pt_synth_instruction_sample(struct intel_pt_queue *ptq) ptq->last_insn_cnt = ptq->state->tot_insn_cnt; - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->instructions_sample_type); } @@ -1454,7 +1381,7 @@ static int intel_pt_synth_transaction_sample(struct intel_pt_queue *ptq) sample.id = ptq->pt->transactions_id; sample.stream_id = ptq->pt->transactions_id; - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->transactions_sample_type); } @@ -1495,7 +1422,7 @@ static int intel_pt_synth_ptwrite_sample(struct intel_pt_queue *ptq) sample.raw_size = perf_synth__raw_size(raw); sample.raw_data = perf_synth__raw_data(&raw); - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->ptwrites_sample_type); } @@ -1525,7 +1452,7 @@ static int intel_pt_synth_cbr_sample(struct intel_pt_queue *ptq) sample.raw_size = perf_synth__raw_size(raw); sample.raw_data = perf_synth__raw_data(&raw); - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->pwr_events_sample_type); } @@ -1550,7 +1477,7 @@ static int intel_pt_synth_mwait_sample(struct intel_pt_queue *ptq) sample.raw_size = perf_synth__raw_size(raw); sample.raw_data = perf_synth__raw_data(&raw); - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->pwr_events_sample_type); } @@ -1575,7 +1502,7 @@ static int intel_pt_synth_pwre_sample(struct intel_pt_queue *ptq) sample.raw_size = perf_synth__raw_size(raw); sample.raw_data = perf_synth__raw_data(&raw); - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->pwr_events_sample_type); } @@ -1600,7 +1527,7 @@ static int intel_pt_synth_exstop_sample(struct intel_pt_queue *ptq) sample.raw_size = perf_synth__raw_size(raw); sample.raw_data = perf_synth__raw_data(&raw); - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->pwr_events_sample_type); } @@ -1625,7 +1552,7 @@ static int intel_pt_synth_pwrx_sample(struct intel_pt_queue *ptq) sample.raw_size = perf_synth__raw_size(raw); sample.raw_data = perf_synth__raw_data(&raw); - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, + return intel_pt_deliver_synth_event(pt, event, &sample, pt->pwr_events_sample_type); } @@ -1845,7 +1772,9 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq) intel_pt_add_lbrs(&br.br_stack, items); sample.branch_stack = &br.br_stack; } else if (pt->synth_opts.last_branch) { - intel_pt_copy_last_branch_rb(ptq); + thread_stack__br_sample(ptq->thread, ptq->cpu, + ptq->last_branch, + pt->br_stack_sz); sample.branch_stack = ptq->last_branch; } else { br.br_stack.nr = 0; @@ -1880,7 +1809,7 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq) sample.transaction = txn; } - return intel_pt_deliver_synth_event(pt, ptq, event, &sample, sample_type); + return intel_pt_deliver_synth_event(pt, event, &sample, sample_type); } static int intel_pt_synth_error(struct intel_pt *pt, int code, int cpu, @@ -2030,12 +1959,15 @@ static int intel_pt_sample(struct intel_pt_queue *ptq) if (!(state->type & INTEL_PT_BRANCH)) return 0; - if (pt->use_thread_stack) - thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip, - state->to_ip, ptq->insn_len, - state->trace_nr, true, 0, 0); - else + if (pt->use_thread_stack) { + thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, + state->from_ip, state->to_ip, ptq->insn_len, + state->trace_nr, pt->callstack, + pt->br_stack_sz, + pt->mispred_all); + } else { thread_stack__set_trace_nr(ptq->thread, ptq->cpu, state->trace_nr); + } if (pt->sample_branches) { err = intel_pt_synth_branch_sample(ptq); @@ -2043,9 +1975,6 @@ static int intel_pt_sample(struct intel_pt_queue *ptq) return err; } - if (pt->synth_opts.last_branch) - intel_pt_update_last_branch_rb(ptq); - if (!ptq->sync_switch) return 0; @@ -3441,9 +3370,17 @@ int intel_pt_process_auxtrace_info(union perf_event *event, goto err_delete_thread; } + if (pt->synth_opts.last_branch) + pt->br_stack_sz = pt->synth_opts.last_branch_sz; + pt->use_thread_stack = pt->synth_opts.callchain || pt->synth_opts.add_callchain || - pt->synth_opts.thread_stack; + pt->synth_opts.thread_stack || + pt->synth_opts.last_branch; + + pt->callstack = pt->synth_opts.callchain || + pt->synth_opts.add_callchain || + pt->synth_opts.thread_stack; err = intel_pt_synth_events(pt, session); if (err) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 42/91] perf auxtrace: Add option to synthesize branch stack for regular events 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (40 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 41/91] perf intel-pt: Change branch stack support to use thread-stacks Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 43/91] perf evsel: Add support for synthesized branch stack sample type Arnaldo Carvalho de Melo ` (48 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> There is an existing option to synthesize branch stacks for synthesized events. Add a new option to synthesize branch stacks for regular events. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/itrace.txt | 1 + tools/perf/builtin-inject.c | 3 ++- tools/perf/builtin-report.c | 5 +++-- tools/perf/util/auxtrace.c | 6 +++++- tools/perf/util/auxtrace.h | 2 ++ tools/perf/util/s390-cpumsf.c | 3 ++- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/perf/Documentation/itrace.txt b/tools/perf/Documentation/itrace.txt index 671e154ede03..0326050beebd 100644 --- a/tools/perf/Documentation/itrace.txt +++ b/tools/perf/Documentation/itrace.txt @@ -12,6 +12,7 @@ g synthesize a call chain (use with i or x) G synthesize a call chain on existing event records l synthesize last branch entries (use with i or x) + L synthesize last branch entries on existing event records s skip initial number of events The default is all events i.e. the same as --itrace=ibxwpe, diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 7e124a7b8bfd..7c4403cf8dcb 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -684,7 +684,8 @@ static int __cmd_inject(struct perf_inject *inject) perf_header__clear_feat(&session->header, HEADER_AUXTRACE); - if (inject->itrace_synth_opts.last_branch) + if (inject->itrace_synth_opts.last_branch || + inject->itrace_synth_opts.add_last_branch) perf_header__set_feat(&session->header, HEADER_BRANCH_STACK); evsel = perf_evlist__id2evsel_strict(session->evlist, diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 7da1342a1f4e..0eea667bfb76 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -349,7 +349,8 @@ static int report__setup_sample_type(struct report *rep) !session->itrace_synth_opts->set)) sample_type |= PERF_SAMPLE_CALLCHAIN; - if (session->itrace_synth_opts->last_branch) + if (session->itrace_synth_opts->last_branch || + session->itrace_synth_opts->add_last_branch) sample_type |= PERF_SAMPLE_BRANCH_STACK; if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { @@ -1393,7 +1394,7 @@ int cmd_report(int argc, const char **argv) goto error; } - if (itrace_synth_opts.last_branch) + if (itrace_synth_opts.last_branch || itrace_synth_opts.add_last_branch) has_br_stack = true; if (has_br_stack && branch_call_mode) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index ac6e09965a78..83ea7ca24686 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -1464,8 +1464,12 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str, synth_opts->callchain_sz = val; } break; + case 'L': case 'l': - synth_opts->last_branch = true; + if (p[-1] == 'L') + synth_opts->add_last_branch = true; + else + synth_opts->last_branch = true; synth_opts->last_branch_sz = PERF_ITRACE_DEFAULT_LAST_BRANCH_SZ; while (*p == ' ' || *p == ',') diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index dd8a4ff8209e..0220a2e86c16 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -77,6 +77,7 @@ enum itrace_period_type { * @add_callchain: add callchain to existing event records * @thread_stack: feed branches to the thread_stack * @last_branch: add branch context to 'instruction' events + * @add_last_branch: add branch context to existing event records * @callchain_sz: maximum callchain size * @last_branch_sz: branch context size * @period: 'instructions' events period @@ -105,6 +106,7 @@ struct itrace_synth_opts { bool add_callchain; bool thread_stack; bool last_branch; + bool add_last_branch; unsigned int callchain_sz; unsigned int last_branch_sz; unsigned long long period; diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c index 38a942881d1a..f8861998e5bd 100644 --- a/tools/perf/util/s390-cpumsf.c +++ b/tools/perf/util/s390-cpumsf.c @@ -1079,7 +1079,8 @@ static bool check_auxtrace_itrace(struct itrace_synth_opts *itops) itops->pwr_events || itops->errors || itops->dont_decode || itops->calls || itops->returns || itops->callchain || itops->thread_stack || - itops->last_branch || itops->add_callchain; + itops->last_branch || itops->add_callchain || + itops->add_last_branch; if (!ison) return true; pr_err("Unsupported --itrace options specified\n"); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 43/91] perf evsel: Add support for synthesized branch stack sample type 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (41 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 42/91] perf auxtrace: Add option to synthesize branch stack for regular events Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 44/91] perf thread-stack: Add thread_stack__br_sample_late() Arnaldo Carvalho de Melo ` (47 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Allow for a synthesized branch stack to be added to samples. As with synthesized call chains, the sample type cannot be changed because it is needed to continue to parse events. So add and use helper function evsel__has_br_stack() to indicate a branch stack, whether original or synthesized. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evsel.h | 10 ++++++++++ tools/perf/util/session.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index a463bc65b001..bf999e3c50c7 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -417,6 +417,16 @@ static inline bool evsel__has_callchain(const struct evsel *evsel) evsel->synth_sample_type & PERF_SAMPLE_CALLCHAIN; } +static inline bool evsel__has_br_stack(const struct evsel *evsel) +{ + /* + * For reporting purposes, an evsel sample can have a recorded branch + * stack or a branch stack synthesized from AUX area data. + */ + return evsel->core.attr.sample_type & PERF_SAMPLE_BRANCH_STACK || + evsel->synth_sample_type & PERF_SAMPLE_BRANCH_STACK; +} + struct perf_env *perf_evsel__env(struct evsel *evsel); int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist); diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 0b0bfe5bef17..2b5a08a92ce5 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1243,7 +1243,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event, if (evsel__has_callchain(evsel)) callchain__printf(evsel, sample); - if (sample_type & PERF_SAMPLE_BRANCH_STACK) + if (evsel__has_br_stack(evsel)) branch_stack__printf(sample, perf_evsel__has_branch_callstack(evsel)); if (sample_type & PERF_SAMPLE_REGS_USER) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 44/91] perf thread-stack: Add thread_stack__br_sample_late() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (42 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 43/91] perf evsel: Add support for synthesized branch stack sample type Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 45/91] perf intel-pt: Add support for synthesizing branch stacks for regular events Arnaldo Carvalho de Melo ` (46 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Add a thread stack function to create a branch stack for hardware events where the sample records get created some time after the event occurred. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/thread-stack.c | 104 +++++++++++++++++++++++++++++++++ tools/perf/util/thread-stack.h | 3 + 2 files changed, 107 insertions(+) diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c index 79698831b4b9..1b992bbba4e8 100644 --- a/tools/perf/util/thread-stack.c +++ b/tools/perf/util/thread-stack.c @@ -645,6 +645,110 @@ void thread_stack__br_sample(struct thread *thread, int cpu, } } +/* Start of user space branch entries */ +static bool us_start(struct branch_entry *be, u64 kernel_start, bool *start) +{ + if (!*start) + *start = be->to && be->to < kernel_start; + + return *start; +} + +/* + * Start of branch entries after the ip fell in between 2 branches, or user + * space branch entries. + */ +static bool ks_start(struct branch_entry *be, u64 sample_ip, u64 kernel_start, + bool *start, struct branch_entry *nb) +{ + if (!*start) { + *start = (nb && sample_ip >= be->to && sample_ip <= nb->from) || + be->from < kernel_start || + (be->to && be->to < kernel_start); + } + + return *start; +} + +/* + * Hardware sample records, created some time after the event occurred, need to + * have subsequent addresses removed from the branch stack. + */ +void thread_stack__br_sample_late(struct thread *thread, int cpu, + struct branch_stack *dst, unsigned int sz, + u64 ip, u64 kernel_start) +{ + struct thread_stack *ts = thread__stack(thread, cpu); + struct branch_entry *d, *s, *spos, *ssz; + struct branch_stack *src; + unsigned int nr = 0; + bool start = false; + + dst->nr = 0; + + if (!ts) + return; + + src = ts->br_stack_rb; + if (!src->nr) + return; + + spos = &src->entries[ts->br_stack_pos]; + ssz = &src->entries[ts->br_stack_sz]; + + d = &dst->entries[0]; + s = spos; + + if (ip < kernel_start) { + /* + * User space sample: start copying branch entries when the + * branch is in user space. + */ + for (s = spos; s < ssz && nr < sz; s++) { + if (us_start(s, kernel_start, &start)) { + *d++ = *s; + nr += 1; + } + } + + if (src->nr >= ts->br_stack_sz) { + for (s = &src->entries[0]; s < spos && nr < sz; s++) { + if (us_start(s, kernel_start, &start)) { + *d++ = *s; + nr += 1; + } + } + } + } else { + struct branch_entry *nb = NULL; + + /* + * Kernel space sample: start copying branch entries when the ip + * falls in between 2 branches (or the branch is in user space + * because then the start must have been missed). + */ + for (s = spos; s < ssz && nr < sz; s++) { + if (ks_start(s, ip, kernel_start, &start, nb)) { + *d++ = *s; + nr += 1; + } + nb = s; + } + + if (src->nr >= ts->br_stack_sz) { + for (s = &src->entries[0]; s < spos && nr < sz; s++) { + if (ks_start(s, ip, kernel_start, &start, nb)) { + *d++ = *s; + nr += 1; + } + nb = s; + } + } + } + + dst->nr = nr; +} + struct call_return_processor * call_return_processor__new(int (*process)(struct call_return *cr, u64 *parent_db_id, void *data), void *data) diff --git a/tools/perf/util/thread-stack.h b/tools/perf/util/thread-stack.h index c279a0cbbdd0..3bc47a42af8e 100644 --- a/tools/perf/util/thread-stack.h +++ b/tools/perf/util/thread-stack.h @@ -91,6 +91,9 @@ void thread_stack__sample_late(struct thread *thread, int cpu, u64 kernel_start); void thread_stack__br_sample(struct thread *thread, int cpu, struct branch_stack *dst, unsigned int sz); +void thread_stack__br_sample_late(struct thread *thread, int cpu, + struct branch_stack *dst, unsigned int sz, + u64 sample_ip, u64 kernel_start); int thread_stack__flush(struct thread *thread); void thread_stack__free(struct thread *thread); size_t thread_stack__depth(struct thread *thread, int cpu); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 45/91] perf intel-pt: Add support for synthesizing branch stacks for regular events 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (43 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 44/91] perf thread-stack: Add thread_stack__br_sample_late() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 46/91] perf intel-pt: Update documentation about itrace G and L options Arnaldo Carvalho de Melo ` (45 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Use the new thread_stack__br_sample_late() function to create a thread stack for regular events. Example: # perf record --kcore --aux-sample -e '{intel_pt//,cycles:ppp}' -c 10000 uname Linux [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.743 MB perf.data ] # perf report --itrace=Le --stdio | head -30 | tail -18 # Samples: 11K of event 'cycles:ppp' # Event count (approx.): 11648 # # Overhead Command Source Shared Object Source Symbol Target Symbol Basic Block Cycles # ........ ....... .................... ............................ ............................ .................. # 5.49% uname libc-2.30.so [.] _dl_addr [.] _dl_addr - 2.41% uname ld-2.30.so [.] _dl_relocate_object [.] _dl_relocate_object - 2.31% uname ld-2.30.so [.] do_lookup_x [.] do_lookup_x - 2.17% uname [kernel.kallsyms] [k] unmap_page_range [k] unmap_page_range - 2.05% uname ld-2.30.so [k] _dl_start [k] _dl_start - 1.97% uname ld-2.30.so [.] _dl_lookup_symbol_x [.] _dl_lookup_symbol_x - 1.94% uname [kernel.kallsyms] [k] filemap_map_pages [k] filemap_map_pages - 1.60% uname [kernel.kallsyms] [k] __handle_mm_fault [k] __handle_mm_fault - 1.44% uname [kernel.kallsyms] [k] page_add_file_rmap [k] page_add_file_rmap - 1.12% uname [kernel.kallsyms] [k] vma_interval_tree_insert [k] vma_interval_tree_insert - 0.94% uname [kernel.kallsyms] [k] perf_iterate_ctx [k] perf_iterate_ctx - Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/intel-pt.c | 73 ++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 03b76904ca52..59811b39430c 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -72,6 +72,7 @@ struct intel_pt { bool use_thread_stack; bool callstack; unsigned int br_stack_sz; + unsigned int br_stack_sz_plus; int have_sched_switch; u32 pmu_type; u64 kernel_start; @@ -130,6 +131,7 @@ struct intel_pt { unsigned int range_cnt; struct ip_callchain *chain; + struct branch_stack *br_stack; }; enum switch_state { @@ -911,6 +913,44 @@ static void intel_pt_add_callchain(struct intel_pt *pt, sample->callchain = pt->chain; } +static struct branch_stack *intel_pt_alloc_br_stack(struct intel_pt *pt) +{ + size_t sz = sizeof(struct branch_stack); + + sz += pt->br_stack_sz * sizeof(struct branch_entry); + return zalloc(sz); +} + +static int intel_pt_br_stack_init(struct intel_pt *pt) +{ + struct evsel *evsel; + + evlist__for_each_entry(pt->session->evlist, evsel) { + if (!(evsel->core.attr.sample_type & PERF_SAMPLE_BRANCH_STACK)) + evsel->synth_sample_type |= PERF_SAMPLE_BRANCH_STACK; + } + + pt->br_stack = intel_pt_alloc_br_stack(pt); + if (!pt->br_stack) + return -ENOMEM; + + return 0; +} + +static void intel_pt_add_br_stack(struct intel_pt *pt, + struct perf_sample *sample) +{ + struct thread *thread = machine__findnew_thread(pt->machine, + sample->pid, + sample->tid); + + thread_stack__br_sample_late(thread, sample->cpu, pt->br_stack, + pt->br_stack_sz, sample->ip, + pt->kernel_start); + + sample->branch_stack = pt->br_stack; +} + static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt, unsigned int queue_nr) { @@ -929,10 +969,7 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt, } if (pt->synth_opts.last_branch) { - size_t sz = sizeof(struct branch_stack); - - sz += pt->br_stack_sz * sizeof(struct branch_entry); - ptq->last_branch = zalloc(sz); + ptq->last_branch = intel_pt_alloc_br_stack(pt); if (!ptq->last_branch) goto out_free; } @@ -1963,7 +2000,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq) thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip, state->to_ip, ptq->insn_len, state->trace_nr, pt->callstack, - pt->br_stack_sz, + pt->br_stack_sz_plus, pt->mispred_all); } else { thread_stack__set_trace_nr(ptq->thread, ptq->cpu, state->trace_nr); @@ -2609,6 +2646,8 @@ static int intel_pt_process_event(struct perf_session *session, if (event->header.type == PERF_RECORD_SAMPLE) { if (pt->synth_opts.add_callchain && !sample->callchain) intel_pt_add_callchain(pt, sample); + if (pt->synth_opts.add_last_branch && !sample->branch_stack) + intel_pt_add_br_stack(pt, sample); } if (event->header.type == PERF_RECORD_AUX && @@ -3370,13 +3409,33 @@ int intel_pt_process_auxtrace_info(union perf_event *event, goto err_delete_thread; } - if (pt->synth_opts.last_branch) + if (pt->synth_opts.last_branch || pt->synth_opts.add_last_branch) { pt->br_stack_sz = pt->synth_opts.last_branch_sz; + pt->br_stack_sz_plus = pt->br_stack_sz; + } + + if (pt->synth_opts.add_last_branch) { + err = intel_pt_br_stack_init(pt); + if (err) + goto err_delete_thread; + /* + * Additional branch stack size to cater for tracing from the + * actual sample ip to where the sample time is recorded. + * Measured at about 200 branches, but generously set to 1024. + * If kernel space is not being traced, then add just 1 for the + * branch to kernel space. + */ + if (intel_pt_tracing_kernel(pt)) + pt->br_stack_sz_plus += 1024; + else + pt->br_stack_sz_plus += 1; + } pt->use_thread_stack = pt->synth_opts.callchain || pt->synth_opts.add_callchain || pt->synth_opts.thread_stack || - pt->synth_opts.last_branch; + pt->synth_opts.last_branch || + pt->synth_opts.add_last_branch; pt->callstack = pt->synth_opts.callchain || pt->synth_opts.add_callchain || -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 46/91] perf intel-pt: Update documentation about itrace G and L options 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (44 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 45/91] perf intel-pt: Add support for synthesizing branch stacks for regular events Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 47/91] perf intel-pt: Update documentation about using /proc/kcore Arnaldo Carvalho de Melo ` (44 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Provide a little more information about the new G and L options, particularly the issue with large PEBs. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/itrace.txt | 4 +++ tools/perf/Documentation/perf-intel-pt.txt | 35 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/tools/perf/Documentation/itrace.txt b/tools/perf/Documentation/itrace.txt index 0326050beebd..271484754fee 100644 --- a/tools/perf/Documentation/itrace.txt +++ b/tools/perf/Documentation/itrace.txt @@ -33,6 +33,10 @@ Also the number of last branch entries (default 64, max. 1024) for instructions or transactions events can be specified. + Similar to options g and l, size may also be specified for options G and L. + On x86, note that G and L work poorly when data has been recorded with + large PEBS. Refer linkperf:perf-intel-pt[1] man page for details. + It is also possible to skip events generated (instructions, branches, transactions, ptwrite, power) at the beginning. This is useful to ignore initialization code. diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index 456fdcbf26ac..782eb8a65caf 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -821,7 +821,9 @@ The letters are: e synthesize tracing error events d create a debug log g synthesize a call chain (use with i or x) + G synthesize a call chain on existing event records l synthesize last branch entries (use with i or x) + L synthesize last branch entries on existing event records s skip initial number of events "Instructions" events look like they were recorded by "perf record -e @@ -912,6 +914,39 @@ transactions events can be specified. e.g. Note that last branch entries are cleared for each sample, so there is no overlap from one sample to the next. +The G and L options are designed in particular for sample mode, and work much +like g and l but add call chain and branch stack to the other selected events +instead of synthesized events. For example, to record branch-misses events for +'ls' and then add a call chain derived from the Intel PT trace: + + perf record --aux-sample -e '{intel_pt//u,branch-misses:u}' -- ls + perf report --itrace=Ge + +Although in fact G is a default for perf report, so that is the same as just: + + perf report + +One caveat with the G and L options is that they work poorly with "Large PEBS". +Large PEBS means PEBS records will be accumulated by hardware and the written +into the event buffer in one go. That reduces interrupts, but can give very +late timestamps. Because the Intel PT trace is synchronized by timestamps, +the PEBS events do not match the trace. Currently, Large PEBS is used only in +certain circumstances: + - hardware supports it + - PEBS is used + - event period is specified, instead of frequency + - the sample type is limited to the following flags: + PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_ADDR | + PERF_SAMPLE_ID | PERF_SAMPLE_CPU | PERF_SAMPLE_STREAM_ID | + PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | + PERF_SAMPLE_TRANSACTION | PERF_SAMPLE_PHYS_ADDR | + PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER | + PERF_SAMPLE_PERIOD (and sometimes) | PERF_SAMPLE_TIME +Because Intel PT sample mode uses a different sample type to the list above, +Large PEBS is not used with Intel PT sample mode. To avoid Large PEBS in other +cases, avoid specifying the event period i.e. avoid the 'perf record' -c option, +--count option, or 'period' config term. + To disable trace decoding entirely, use the option --no-itrace. It is also possible to skip events generated (instructions, branches, transactions) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 47/91] perf intel-pt: Update documentation about using /proc/kcore 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (45 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 46/91] perf intel-pt: Update documentation about itrace G and L options Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 48/91] perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t' Arnaldo Carvalho de Melo ` (43 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo From: Adrian Hunter <adrian.hunter@intel.com> Update documentation to reflect the advent of the --kcore option for 'perf record'. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-intel-pt.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index 782eb8a65caf..eb8b7d42591a 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -69,22 +69,22 @@ And profiled with 'perf report' e.g. To also trace kernel space presents a problem, namely kernel self-modifying code. A fairly good kernel image is available in /proc/kcore but to get an accurate image a copy of /proc/kcore needs to be made under the same conditions -as the data capture. A script perf-with-kcore can do that, but beware that the -script makes use of 'sudo' to copy /proc/kcore. If you have perf installed -locally from the source tree you can do: +as the data capture. 'perf record' can make a copy of /proc/kcore if the option +--kcore is used, but access to /proc/kcore is restricted e.g. - ~/libexec/perf-core/perf-with-kcore record pt_ls -e intel_pt// -- ls + sudo perf record -o pt_ls --kcore -e intel_pt// -- ls -which will create a directory named 'pt_ls' and put the perf.data file and -copies of /proc/kcore, /proc/kallsyms and /proc/modules into it. Then to use -'perf report' becomes: +which will create a directory named 'pt_ls' and put the perf.data file (named +simply 'data') and copies of /proc/kcore, /proc/kallsyms and /proc/modules into +it. The other tools understand the directory format, so to use 'perf report' +becomes: - ~/libexec/perf-core/perf-with-kcore report pt_ls + sudo perf report -i pt_ls Because samples are synthesized after-the-fact, the sampling period can be selected for reporting. e.g. sample every microsecond - ~/libexec/perf-core/perf-with-kcore report pt_ls --itrace=i1usge + sudo perf report pt_ls --itrace=i1usge See the sections below for more information about the --itrace option. -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 48/91] perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t' 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (46 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 47/91] perf intel-pt: Update documentation about using /proc/kcore Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 49/91] perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus() Arnaldo Carvalho de Melo ` (42 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Song Liu From: Arnaldo Carvalho de Melo <acme@redhat.com> As the "perf_" prefix should be restricted to functions and types in tools/lib/perf/, aka libperf, this way we reduce a bit the confusion for types only in libperf or the ones in the more contained tools/perf/ project. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Song Liu <songliubraving@fb.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evlist.h | 4 ++-- tools/perf/util/evsel.h | 6 +++--- tools/perf/util/sideband_evlist.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 93de63e2a247..b6f325dfb4d2 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -109,9 +109,9 @@ int perf_evlist__add_dummy(struct evlist *evlist); int perf_evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, - perf_evsel__sb_cb_t cb, + evsel__sb_cb_t cb, void *data); -void evlist__set_cb(struct evlist *evlist, perf_evsel__sb_cb_t cb, void *data); +void evlist__set_cb(struct evlist *evlist, evsel__sb_cb_t cb, void *data); int perf_evlist__start_sb_thread(struct evlist *evlist, struct target *target); void perf_evlist__stop_sb_thread(struct evlist *evlist); diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index bf999e3c50c7..7ff37c4cdf9f 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -18,7 +18,7 @@ struct perf_counts; struct perf_stat_evsel; union perf_event; -typedef int (perf_evsel__sb_cb_t)(union perf_event *event, void *data); +typedef int (evsel__sb_cb_t)(union perf_event *event, void *data); enum perf_tool_event { PERF_TOOL_NONE = 0, @@ -101,8 +101,8 @@ struct evsel { int cpu_iter; const char *pmu_name; struct { - perf_evsel__sb_cb_t *cb; - void *data; + evsel__sb_cb_t *cb; + void *data; } side_band; /* * For reporting purposes, an evsel sample can have a callchain diff --git a/tools/perf/util/sideband_evlist.c b/tools/perf/util/sideband_evlist.c index 1d6f470d64c4..bb3706fbcc0c 100644 --- a/tools/perf/util/sideband_evlist.c +++ b/tools/perf/util/sideband_evlist.c @@ -13,7 +13,7 @@ #include <stdbool.h> int perf_evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, - perf_evsel__sb_cb_t cb, void *data) + evsel__sb_cb_t cb, void *data) { struct evsel *evsel; @@ -81,7 +81,7 @@ static void *perf_evlist__poll_thread(void *arg) return NULL; } -void evlist__set_cb(struct evlist *evlist, perf_evsel__sb_cb_t cb, void *data) +void evlist__set_cb(struct evlist *evlist, evsel__sb_cb_t cb, void *data) { struct evsel *evsel; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 49/91] perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (47 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 48/91] perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t' Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 50/91] perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas() Arnaldo Carvalho de Melo ` (41 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 2 +- tools/perf/util/evsel.h | 2 +- tools/perf/util/stat-display.c | 10 +++++----- tools/perf/util/stat.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 3aadefd2791e..907b5c9f6a4e 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1977,7 +1977,7 @@ static struct scripting_ops *scripting_ops; static void __process_stat(struct evsel *counter, u64 tstamp) { int nthreads = perf_thread_map__nr(counter->core.threads); - int ncpus = perf_evsel__nr_cpus(counter); + int ncpus = evsel__nr_cpus(counter); int cpu, thread; static int header_printed; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 7ff37c4cdf9f..e2a0ebe59365 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -143,7 +143,7 @@ static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel) return perf_evsel__cpus(&evsel->core); } -static inline int perf_evsel__nr_cpus(struct evsel *evsel) +static inline int evsel__nr_cpus(struct evsel *evsel) { return evsel__cpus(evsel)->nr; } diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 679aaa655824..b0e5d8505f57 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -333,7 +333,7 @@ static int first_shadow_cpu(struct perf_stat_config *config, if (config->aggr_mode == AGGR_GLOBAL) return 0; - for (i = 0; i < perf_evsel__nr_cpus(evsel); i++) { + for (i = 0; i < evsel__nr_cpus(evsel); i++) { int cpu2 = evsel__cpus(evsel)->map[i]; if (config->aggr_get_id(config, evlist->core.cpus, cpu2) == id) @@ -508,7 +508,7 @@ static void aggr_update_shadow(struct perf_stat_config *config, id = config->aggr_map->map[s]; evlist__for_each_entry(evlist, counter) { val = 0; - for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { + for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { s2 = config->aggr_get_id(config, evlist->core.cpus, cpu); if (s2 != id) continue; @@ -599,7 +599,7 @@ static void aggr_cb(struct perf_stat_config *config, struct aggr_data *ad = data; int cpu, s2; - for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { + for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { struct perf_counts_values *counts; s2 = config->aggr_get_id(config, evsel__cpus(counter), cpu); @@ -847,7 +847,7 @@ static void print_counter(struct perf_stat_config *config, double uval; int cpu; - for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { + for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { struct aggr_data ad = { .cpu = cpu }; if (!collect_data(config, counter, counter_cb, &ad)) @@ -1148,7 +1148,7 @@ static void print_percore_thread(struct perf_stat_config *config, int s, s2, id; bool first = true; - for (int i = 0; i < perf_evsel__nr_cpus(counter); i++) { + for (int i = 0; i < evsel__nr_cpus(counter); i++) { s2 = config->aggr_get_id(config, evsel__cpus(counter), i); for (s = 0; s < config->aggr_map->nr; s++) { id = config->aggr_map->map[s]; diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 242476eb808c..da3a206e95f7 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -173,7 +173,7 @@ static void perf_evsel__reset_prev_raw_counts(struct evsel *evsel) static int perf_evsel__alloc_stats(struct evsel *evsel, bool alloc_raw) { - int ncpus = perf_evsel__nr_cpus(evsel); + int ncpus = evsel__nr_cpus(evsel); int nthreads = perf_thread_map__nr(evsel->core.threads); if (perf_evsel__alloc_stat_priv(evsel) < 0 || @@ -334,7 +334,7 @@ static int process_counter_maps(struct perf_stat_config *config, struct evsel *counter) { int nthreads = perf_thread_map__nr(counter->core.threads); - int ncpus = perf_evsel__nr_cpus(counter); + int ncpus = evsel__nr_cpus(counter); int cpu, thread; if (counter->core.system_wide) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 50/91] perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (48 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 49/91] perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 51/91] perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu() Arnaldo Carvalho de Melo ` (40 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evsel.c | 6 +++--- tools/perf/util/evsel.h | 4 ++-- tools/perf/util/stat.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 6a571d322bb2..db6d2a5f9b3c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1283,8 +1283,8 @@ void evsel__delete(struct evsel *evsel) free(evsel); } -void perf_evsel__compute_deltas(struct evsel *evsel, int cpu, int thread, - struct perf_counts_values *count) +void evsel__compute_deltas(struct evsel *evsel, int cpu, int thread, + struct perf_counts_values *count) { struct perf_counts_values tmp; @@ -1440,7 +1440,7 @@ int __perf_evsel__read_on_cpu(struct evsel *evsel, if (readn(FD(evsel, cpu, thread), &count, nv * sizeof(u64)) <= 0) return -errno; - perf_evsel__compute_deltas(evsel, cpu, thread, &count); + evsel__compute_deltas(evsel, cpu, thread, &count); perf_counts_values__scale(&count, scale, NULL); *perf_counts(evsel->counts, cpu, thread) = count; return 0; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index e2a0ebe59365..32015057429c 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -151,8 +151,8 @@ static inline int evsel__nr_cpus(struct evsel *evsel) void perf_counts_values__scale(struct perf_counts_values *count, bool scale, s8 *pscaled); -void perf_evsel__compute_deltas(struct evsel *evsel, int cpu, int thread, - struct perf_counts_values *count); +void evsel__compute_deltas(struct evsel *evsel, int cpu, int thread, + struct perf_counts_values *count); int perf_evsel__object_config(size_t object_size, int (*init)(struct evsel *evsel), diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index da3a206e95f7..4e6e770f39aa 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -302,7 +302,7 @@ process_counter_values(struct perf_stat_config *config, struct evsel *evsel, case AGGR_NODE: case AGGR_NONE: if (!evsel->snapshot) - perf_evsel__compute_deltas(evsel, cpu, thread, count); + evsel__compute_deltas(evsel, cpu, thread, count); perf_counts_values__scale(count, config->scale, NULL); if ((config->aggr_mode == AGGR_NONE) && (!evsel->percore)) { perf_stat__update_shadow_stats(evsel, count->val, @@ -384,7 +384,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, return 0; if (!counter->snapshot) - perf_evsel__compute_deltas(counter, -1, -1, aggr); + evsel__compute_deltas(counter, -1, -1, aggr); perf_counts_values__scale(aggr, config->scale, &counter->counts->scaled); for (i = 0; i < 3; i++) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 51/91] perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (49 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 50/91] perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 52/91] perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event() Arnaldo Carvalho de Melo ` (39 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/auxtrace.c | 2 +- tools/perf/util/evsel.h | 2 +- tools/perf/util/pmu.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 83ea7ca24686..cddd1d36f724 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -2542,7 +2542,7 @@ static int parse_addr_filter(struct evsel *evsel, const char *filter, static int perf_evsel__nr_addr_filter(struct evsel *evsel) { - struct perf_pmu *pmu = perf_evsel__find_pmu(evsel); + struct perf_pmu *pmu = evsel__find_pmu(evsel); int nr_addr_filters = 0; if (!pmu) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 32015057429c..868e2be434c4 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -158,7 +158,7 @@ int perf_evsel__object_config(size_t object_size, int (*init)(struct evsel *evsel), void (*fini)(struct evsel *evsel)); -struct perf_pmu *perf_evsel__find_pmu(struct evsel *evsel); +struct perf_pmu *evsel__find_pmu(struct evsel *evsel); bool perf_evsel__is_aux_event(struct evsel *evsel); struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx); diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index d9f89ed18dea..2dd3d6be1a61 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -886,7 +886,7 @@ struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu) return NULL; } -struct perf_pmu *perf_evsel__find_pmu(struct evsel *evsel) +struct perf_pmu *evsel__find_pmu(struct evsel *evsel) { struct perf_pmu *pmu = NULL; @@ -900,7 +900,7 @@ struct perf_pmu *perf_evsel__find_pmu(struct evsel *evsel) bool perf_evsel__is_aux_event(struct evsel *evsel) { - struct perf_pmu *pmu = perf_evsel__find_pmu(evsel); + struct perf_pmu *pmu = evsel__find_pmu(evsel); return pmu && pmu->auxtrace; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 52/91] perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (50 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 51/91] perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 53/91] perf evsel: Rename perf_evsel__exit() to evsel__exit() Arnaldo Carvalho de Melo ` (38 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/auxtrace.c | 6 +++--- tools/perf/util/evsel.h | 2 +- tools/perf/util/pmu.c | 2 +- tools/perf/util/record.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index cddd1d36f724..bd27f73b6d60 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -686,7 +686,7 @@ static int auxtrace_validate_aux_sample_size(struct evlist *evlist, evlist__for_each_entry(evlist, evsel) { sz = evsel->core.attr.aux_sample_size; if (perf_evsel__is_group_leader(evsel)) { - has_aux_leader = perf_evsel__is_aux_event(evsel); + has_aux_leader = evsel__is_aux_event(evsel); if (sz) { if (has_aux_leader) pr_err("Cannot add AUX area sampling to an AUX area event\n"); @@ -760,7 +760,7 @@ int auxtrace_parse_sample_options(struct auxtrace_record *itr, /* Set aux_sample_size based on --aux-sample option */ evlist__for_each_entry(evlist, evsel) { if (perf_evsel__is_group_leader(evsel)) { - has_aux_leader = perf_evsel__is_aux_event(evsel); + has_aux_leader = evsel__is_aux_event(evsel); } else if (has_aux_leader) { evsel->core.attr.aux_sample_size = sz; } @@ -769,7 +769,7 @@ int auxtrace_parse_sample_options(struct auxtrace_record *itr, aux_evsel = NULL; /* Override with aux_sample_size from config term */ evlist__for_each_entry(evlist, evsel) { - if (perf_evsel__is_aux_event(evsel)) + if (evsel__is_aux_event(evsel)) aux_evsel = evsel; term = perf_evsel__get_config_term(evsel, AUX_SAMPLE_SIZE); if (term) { diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 868e2be434c4..6187dba21298 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -159,7 +159,7 @@ int perf_evsel__object_config(size_t object_size, void (*fini)(struct evsel *evsel)); struct perf_pmu *evsel__find_pmu(struct evsel *evsel); -bool perf_evsel__is_aux_event(struct evsel *evsel); +bool evsel__is_aux_event(struct evsel *evsel); struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx); diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 2dd3d6be1a61..5642de7f8be7 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -898,7 +898,7 @@ struct perf_pmu *evsel__find_pmu(struct evsel *evsel) return pmu; } -bool perf_evsel__is_aux_event(struct evsel *evsel) +bool evsel__is_aux_event(struct evsel *evsel) { struct perf_pmu *pmu = evsel__find_pmu(evsel); diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index c2c8cce506b4..97e2c0cedc12 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -24,7 +24,7 @@ static struct evsel *perf_evsel__read_sampler(struct evsel *evsel, { struct evsel *leader = evsel->leader; - if (perf_evsel__is_aux_event(leader)) { + if (evsel__is_aux_event(leader)) { evlist__for_each_entry(evlist, evsel) { if (evsel->leader == leader && evsel != evsel->leader) return evsel; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 53/91] perf evsel: Rename perf_evsel__exit() to evsel__exit() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (51 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 52/91] perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 54/91] perf evsel: Rename perf_evsel__config*() to evsel__config*() Arnaldo Carvalho de Melo ` (37 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evsel.c | 4 ++-- tools/perf/util/evsel.h | 2 +- tools/perf/util/python.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index db6d2a5f9b3c..11e754746984 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1259,7 +1259,7 @@ static void perf_evsel__free_config_terms(struct evsel *evsel) } } -void perf_evsel__exit(struct evsel *evsel) +void evsel__exit(struct evsel *evsel) { assert(list_empty(&evsel->core.node)); assert(evsel->evlist == NULL); @@ -1279,7 +1279,7 @@ void perf_evsel__exit(struct evsel *evsel) void evsel__delete(struct evsel *evsel) { - perf_evsel__exit(evsel); + evsel__exit(evsel); free(evsel); } diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 6187dba21298..2facb16e9f12 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -183,7 +183,7 @@ struct evsel *perf_evsel__new_cycles(bool precise); struct tep_event *event_format__new(const char *sys, const char *name); void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx); -void perf_evsel__exit(struct evsel *evsel); +void evsel__exit(struct evsel *evsel); void evsel__delete(struct evsel *evsel); struct callchain_param; diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 83212c65848b..67810d31f88d 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -801,7 +801,7 @@ static int pyrf_evsel__init(struct pyrf_evsel *pevsel, static void pyrf_evsel__delete(struct pyrf_evsel *pevsel) { - perf_evsel__exit(&pevsel->evsel); + evsel__exit(&pevsel->evsel); Py_TYPE(pevsel)->tp_free((PyObject*)pevsel); } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 54/91] perf evsel: Rename perf_evsel__config*() to evsel__config*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (52 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 53/91] perf evsel: Rename perf_evsel__exit() to evsel__exit() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 55/91] perf evsel: Rename perf_evsel__calc_id_pos() to evsel__calc_id_pos() Arnaldo Carvalho de Melo ` (36 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As they are all 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-trace.c | 8 ++++---- tools/perf/tests/openat-syscall-tp-fields.c | 2 +- tools/perf/util/evsel.c | 22 ++++++++++----------- tools/perf/util/evsel.h | 10 ++++------ tools/perf/util/evsel_config.h | 2 +- tools/perf/util/record.c | 9 ++++----- 6 files changed, 24 insertions(+), 29 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 01d542007c8b..f2e832572fce 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -3124,8 +3124,8 @@ static int trace__add_syscall_newtp(struct trace *trace) if (perf_evsel__init_sc_tp_uint_field(sys_exit, ret)) goto out_delete_sys_exit; - perf_evsel__config_callchain(sys_enter, &trace->opts, &callchain_param); - perf_evsel__config_callchain(sys_exit, &trace->opts, &callchain_param); + evsel__config_callchain(sys_enter, &trace->opts, &callchain_param); + evsel__config_callchain(sys_exit, &trace->opts, &callchain_param); evlist__add(evlist, sys_enter); evlist__add(evlist, sys_exit); @@ -3849,7 +3849,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) pgfault_maj = perf_evsel__new_pgfault(PERF_COUNT_SW_PAGE_FAULTS_MAJ); if (pgfault_maj == NULL) goto out_error_mem; - perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param); + evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param); evlist__add(evlist, pgfault_maj); } @@ -3857,7 +3857,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) pgfault_min = perf_evsel__new_pgfault(PERF_COUNT_SW_PAGE_FAULTS_MIN); if (pgfault_min == NULL) goto out_error_mem; - perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param); + evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param); evlist__add(evlist, pgfault_min); } diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index c6b2d7aab608..a77492bcb4bc 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -60,7 +60,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest goto out_delete_evlist; } - perf_evsel__config(evsel, &opts, NULL); + evsel__config(evsel, &opts, NULL); perf_thread_map__set_pid(evlist->core.threads, 0, getpid()); diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 11e754746984..f88cf7961d49 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -686,9 +686,8 @@ int perf_evsel__group_desc(struct evsel *evsel, char *buf, size_t size) return ret; } -static void __perf_evsel__config_callchain(struct evsel *evsel, - struct record_opts *opts, - struct callchain_param *param) +static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, + struct callchain_param *param) { bool function = perf_evsel__is_function_event(evsel); struct perf_event_attr *attr = &evsel->core.attr; @@ -746,12 +745,11 @@ static void __perf_evsel__config_callchain(struct evsel *evsel, } } -void perf_evsel__config_callchain(struct evsel *evsel, - struct record_opts *opts, - struct callchain_param *param) +void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, + struct callchain_param *param) { if (param->enabled) - return __perf_evsel__config_callchain(evsel, opts, param); + return __evsel__config_callchain(evsel, opts, param); } static void @@ -832,7 +830,7 @@ static void apply_config_terms(struct evsel *evsel, case PERF_EVSEL__CONFIG_TERM_INHERIT: /* * attr->inherit should has already been set by - * perf_evsel__config. If user explicitly set + * evsel__config. If user explicitly set * inherit using config terms, override global * opt->no_inherit setting. */ @@ -901,7 +899,7 @@ static void apply_config_terms(struct evsel *evsel, perf_evsel__set_sample_bit(evsel, DATA_SRC); evsel->core.attr.mmap_data = track; } - perf_evsel__config_callchain(evsel, opts, ¶m); + evsel__config_callchain(evsel, opts, ¶m); } } } @@ -953,8 +951,8 @@ struct perf_evsel_config_term *__perf_evsel__get_config_term(struct evsel *evsel * enable/disable events specifically, as there's no * initial traced exec call. */ -void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, - struct callchain_param *callchain) +void evsel__config(struct evsel *evsel, struct record_opts *opts, + struct callchain_param *callchain) { struct evsel *leader = evsel->leader; struct perf_event_attr *attr = &evsel->core.attr; @@ -1027,7 +1025,7 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, evsel->core.attr.exclude_callchain_user = 1; if (callchain && callchain->enabled && !evsel->no_aux_samples) - perf_evsel__config_callchain(evsel, opts, callchain); + evsel__config_callchain(evsel, opts, callchain); if (opts->sample_intr_regs) { attr->sample_regs_intr = opts->sample_intr_regs; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 2facb16e9f12..617cb3fa0353 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -188,12 +188,10 @@ void evsel__delete(struct evsel *evsel); struct callchain_param; -void perf_evsel__config(struct evsel *evsel, - struct record_opts *opts, - struct callchain_param *callchain); -void perf_evsel__config_callchain(struct evsel *evsel, - struct record_opts *opts, - struct callchain_param *callchain); +void evsel__config(struct evsel *evsel, struct record_opts *opts, + struct callchain_param *callchain); +void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, + struct callchain_param *callchain); int __perf_evsel__sample_size(u64 sample_type); void perf_evsel__calc_id_pos(struct evsel *evsel); diff --git a/tools/perf/util/evsel_config.h b/tools/perf/util/evsel_config.h index e026ab67b008..f8938916577c 100644 --- a/tools/perf/util/evsel_config.h +++ b/tools/perf/util/evsel_config.h @@ -7,7 +7,7 @@ /* * The 'struct perf_evsel_config_term' is used to pass event - * specific configuration data to perf_evsel__config routine. + * specific configuration data to evsel__config routine. * It is allocated within event parsing and attached to * perf_evsel::config_terms list head. */ diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 97e2c0cedc12..18ce2cda462a 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -15,7 +15,7 @@ #include "../perf-sys.h" /* - * perf_evsel__config_leader_sampling() uses special rules for leader sampling. + * evsel__config_leader_sampling() uses special rules for leader sampling. * However, if the leader is an AUX area event, then assume the event to sample * is the next event. */ @@ -34,8 +34,7 @@ static struct evsel *perf_evsel__read_sampler(struct evsel *evsel, return leader; } -static void perf_evsel__config_leader_sampling(struct evsel *evsel, - struct evlist *evlist) +static void evsel__config_leader_sampling(struct evsel *evsel, struct evlist *evlist) { struct perf_event_attr *attr = &evsel->core.attr; struct evsel *leader = evsel->leader; @@ -93,14 +92,14 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, use_comm_exec = perf_can_comm_exec(); evlist__for_each_entry(evlist, evsel) { - perf_evsel__config(evsel, opts, callchain); + evsel__config(evsel, opts, callchain); if (evsel->tracking && use_comm_exec) evsel->core.attr.comm_exec = 1; } /* Configure leader sampling here now that the sample type is known */ evlist__for_each_entry(evlist, evsel) - perf_evsel__config_leader_sampling(evsel, evlist); + evsel__config_leader_sampling(evsel, evlist); if (opts->full_auxtrace) { /* -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 55/91] perf evsel: Rename perf_evsel__calc_id_pos() to evsel__calc_id_pos() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (53 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 54/91] perf evsel: Rename perf_evsel__config*() to evsel__config*() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 56/91] perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() Arnaldo Carvalho de Melo ` (35 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 8 ++++---- tools/perf/util/evsel.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 6d902c02fd95..8b691151bae3 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -119,7 +119,7 @@ static void perf_evlist__update_id_pos(struct evlist *evlist) struct evsel *evsel; evlist__for_each_entry(evlist, evsel) - perf_evsel__calc_id_pos(evsel); + evsel__calc_id_pos(evsel); perf_evlist__set_id_pos(evlist); } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f88cf7961d49..896b0b9798d8 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -178,7 +178,7 @@ static int __perf_evsel__calc_is_pos(u64 sample_type) return idx; } -void perf_evsel__calc_id_pos(struct evsel *evsel) +void evsel__calc_id_pos(struct evsel *evsel) { evsel->id_pos = __perf_evsel__calc_id_pos(evsel->core.attr.sample_type); evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); @@ -190,7 +190,7 @@ void __perf_evsel__set_sample_bit(struct evsel *evsel, if (!(evsel->core.attr.sample_type & bit)) { evsel->core.attr.sample_type |= bit; evsel->sample_size += sizeof(u64); - perf_evsel__calc_id_pos(evsel); + evsel__calc_id_pos(evsel); } } @@ -200,7 +200,7 @@ void __perf_evsel__reset_sample_bit(struct evsel *evsel, if (evsel->core.attr.sample_type & bit) { evsel->core.attr.sample_type &= ~bit; evsel->sample_size -= sizeof(u64); - perf_evsel__calc_id_pos(evsel); + evsel__calc_id_pos(evsel); } } @@ -250,7 +250,7 @@ void evsel__init(struct evsel *evsel, INIT_LIST_HEAD(&evsel->config_terms); perf_evsel__object.init(evsel); evsel->sample_size = __perf_evsel__sample_size(attr->sample_type); - perf_evsel__calc_id_pos(evsel); + evsel__calc_id_pos(evsel); evsel->cmdline_group_boundary = false; evsel->metric_expr = NULL; evsel->metric_name = NULL; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 617cb3fa0353..35ad62807eaf 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -194,7 +194,7 @@ void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, struct callchain_param *callchain); int __perf_evsel__sample_size(u64 sample_type); -void perf_evsel__calc_id_pos(struct evsel *evsel); +void evsel__calc_id_pos(struct evsel *evsel); bool perf_evsel__is_cache_op_valid(u8 type, u8 op); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 56/91] perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (54 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 55/91] perf evsel: Rename perf_evsel__calc_id_pos() to evsel__calc_id_pos() Arnaldo Carvalho de Melo @ 2020-05-06 15:21 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 57/91] perf evsel: Rename *perf_evsel__*name() to *evsel__*name() Arnaldo Carvalho de Melo ` (34 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:21 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' related method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/sample-parsing.c | 2 +- tools/perf/util/evsel.c | 4 ++-- tools/perf/util/evsel.h | 2 +- tools/perf/util/intel-bts.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index 61865699c3f4..ab964db855ac 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c @@ -296,7 +296,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format) goto out_free; } - evsel.sample_size = __perf_evsel__sample_size(sample_type); + evsel.sample_size = __evsel__sample_size(sample_type); err = perf_evsel__parse_sample(&evsel, event, &sample_out); if (err) { diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 896b0b9798d8..3a16728074a9 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -102,7 +102,7 @@ int perf_evsel__object_config(size_t object_size, #define FD(e, x, y) (*(int *)xyarray__entry(e->core.fd, x, y)) -int __perf_evsel__sample_size(u64 sample_type) +int __evsel__sample_size(u64 sample_type) { u64 mask = sample_type & PERF_SAMPLE_MASK; int size = 0; @@ -249,7 +249,7 @@ void evsel__init(struct evsel *evsel, evsel->bpf_fd = -1; INIT_LIST_HEAD(&evsel->config_terms); perf_evsel__object.init(evsel); - evsel->sample_size = __perf_evsel__sample_size(attr->sample_type); + evsel->sample_size = __evsel__sample_size(attr->sample_type); evsel__calc_id_pos(evsel); evsel->cmdline_group_boundary = false; evsel->metric_expr = NULL; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 35ad62807eaf..580975c7086a 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -193,7 +193,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, struct callchain_param *callchain); -int __perf_evsel__sample_size(u64 sample_type); +int __evsel__sample_size(u64 sample_type); void evsel__calc_id_pos(struct evsel *evsel); bool perf_evsel__is_cache_op_valid(u8 type, u8 op); diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index 506112f52619..af1e78d76228 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -825,10 +825,10 @@ static int intel_bts_synth_events(struct intel_bts *bts, bts->branches_id = id; /* * We only use sample types from PERF_SAMPLE_MASK so we can use - * __perf_evsel__sample_size() here. + * __evsel__sample_size() here. */ bts->branches_event_size = sizeof(struct perf_record_sample) + - __perf_evsel__sample_size(attr.sample_type); + __evsel__sample_size(attr.sample_type); } return 0; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 57/91] perf evsel: Rename *perf_evsel__*name() to *evsel__*name() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (55 preceding siblings ...) 2020-05-06 15:21 ` [PATCH 56/91] perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 58/91] perf evsel: Rename perf_evsel__group_desc() to evsel__group_desc() Arnaldo Carvalho de Melo ` (33 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As they are 'struct evsel' methods or related routines, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/builtin-c2c.c | 3 +- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-inject.c | 7 +- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-report.c | 4 +- tools/perf/builtin-sched.c | 4 +- tools/perf/builtin-script.c | 14 ++-- tools/perf/builtin-stat.c | 8 +-- tools/perf/builtin-top.c | 8 +-- tools/perf/builtin-trace.c | 22 +++--- tools/perf/tests/event_update.c | 2 +- tools/perf/tests/evsel-roundtrip-name.c | 14 ++-- tools/perf/tests/mmap-basic.c | 2 +- tools/perf/tests/parse-events.c | 14 ++-- tools/perf/ui/browsers/hists.c | 8 +-- tools/perf/ui/gtk/hists.c | 2 +- tools/perf/util/annotate.c | 4 +- tools/perf/util/data-convert-bt.c | 2 +- tools/perf/util/evsel.c | 70 +++++++++---------- tools/perf/util/evsel.h | 7 +- tools/perf/util/evsel_fprintf.c | 6 +- tools/perf/util/header.c | 7 +- tools/perf/util/hist.c | 4 +- tools/perf/util/intel-pt.c | 2 +- tools/perf/util/parse-events.c | 3 +- .../scripting-engines/trace-event-python.c | 6 +- tools/perf/util/session.c | 3 +- tools/perf/util/stat-display.c | 9 ++- tools/perf/util/stat.c | 4 +- tools/perf/util/top.c | 2 +- 32 files changed, 117 insertions(+), 132 deletions(-) diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index b8df8054dd5e..53db3c20225b 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -233,7 +233,7 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu, ret = perf_pmu__scan_file(pmu, path, "%x", &hash); if (ret != 1) { pr_err("failed to set sink \"%s\" on event %s with %d (%s)\n", - sink, perf_evsel__name(evsel), errno, + sink, evsel__name(evsel), errno, str_error_r(errno, msg, sizeof(msg))); return ret; } diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 0e14c1821dcb..1baf4cae086f 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2259,8 +2259,7 @@ static void print_c2c_info(FILE *out, struct perf_session *session) fprintf(out, "=================================================\n"); evlist__for_each_entry(evlist, evsel) { - fprintf(out, "%-36s: %s\n", first ? " Events" : "", - perf_evsel__name(evsel)); + fprintf(out, "%-36s: %s\n", first ? " Events" : "", evsel__name(evsel)); first = false; } fprintf(out, " Cachelines sort on : %s HITMs\n", diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 59d40f036587..b74a60f5813a 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -981,7 +981,7 @@ static void data_process(void) if (!quiet) { fprintf(stdout, "%s# Event '%s'\n#\n", first ? "" : "\n", - perf_evsel__name(evsel_base)); + evsel__name(evsel_base)); } first = false; diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 7c4403cf8dcb..952df5146d57 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -565,7 +565,7 @@ static int perf_evsel__check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg) { struct perf_event_attr *attr = &evsel->core.attr; - const char *name = perf_evsel__name(evsel); + const char *name = evsel__name(evsel); if (!(attr->sample_type & sample_type)) { pr_err("Samples for %s event do not have %s attribute set.", @@ -622,7 +622,7 @@ static int __cmd_inject(struct perf_inject *inject) struct evsel *evsel; evlist__for_each_entry(session->evlist, evsel) { - const char *name = perf_evsel__name(evsel); + const char *name = evsel__name(evsel); if (!strcmp(name, "sched:sched_switch")) { if (perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID")) @@ -691,8 +691,7 @@ static int __cmd_inject(struct perf_inject *inject) evsel = perf_evlist__id2evsel_strict(session->evlist, inject->aux_id); if (evsel) { - pr_debug("Deleting %s\n", - perf_evsel__name(evsel)); + pr_debug("Deleting %s\n", evsel__name(evsel)); evlist__remove(session->evlist, evsel); evsel__delete(evsel); } diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 003c85f5f56c..f91a050bda11 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -1391,7 +1391,7 @@ static int __cmd_kmem(struct perf_session *session) } evlist__for_each_entry(session->evlist, evsel) { - if (!strcmp(perf_evsel__name(evsel), "kmem:mm_page_alloc") && + if (!strcmp(evsel__name(evsel), "kmem:mm_page_alloc") && perf_evsel__field(evsel, "pfn")) { use_pfn = true; break; diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index cfb9a69a42dd..ab303c4165ac 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -879,7 +879,7 @@ static int record__open(struct record *rec) if (perf_evlist__apply_filters(evlist, &pos)) { pr_err("failed to set filter \"%s\" on event %s with %d (%s)\n", - pos->filter, perf_evsel__name(pos), errno, + pos->filter, evsel__name(pos), errno, str_error_r(errno, msg, sizeof(msg))); rc = -1; goto out; diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0eea667bfb76..b5dd93a76aa1 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -321,7 +321,7 @@ static int process_read_event(struct perf_tool *tool, struct report *rep = container_of(tool, struct report, tool); if (rep->show_threads) { - const char *name = perf_evsel__name(evsel); + const char *name = evsel__name(evsel); int err = perf_read_values_add_value(&rep->show_threads_values, event->read.pid, event->read.tid, evsel->idx, @@ -537,7 +537,7 @@ static int perf_evlist__tty_browse_hists(struct evlist *evlist, evlist__for_each_entry(evlist, pos) { struct hists *hists = evsel__hists(pos); - const char *evname = perf_evsel__name(pos); + const char *evname = evsel__name(pos); if (symbol_conf.event_group && !perf_evsel__is_group_leader(pos)) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 82fcc2c15fe4..5c005260bf13 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -2136,7 +2136,7 @@ static bool is_idle_sample(struct perf_sample *sample, struct evsel *evsel) { /* pid 0 == swapper == idle task */ - if (strcmp(perf_evsel__name(evsel), "sched:sched_switch") == 0) + if (strcmp(evsel__name(evsel), "sched:sched_switch") == 0) return perf_evsel__intval(evsel, sample, "prev_pid") == 0; return sample->pid == 0; @@ -2355,7 +2355,7 @@ static bool timehist_skip_sample(struct perf_sched *sched, } if (sched->idle_hist) { - if (strcmp(perf_evsel__name(evsel), "sched:sched_switch")) + if (strcmp(evsel__name(evsel), "sched:sched_switch")) rc = true; else if (perf_evsel__intval(evsel, sample, "prev_pid") != 0 && perf_evsel__intval(evsel, sample, "next_pid") != 0) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 907b5c9f6a4e..8ca24e307266 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -273,7 +273,7 @@ static struct evsel_script *perf_evsel_script__new(struct evsel *evsel, struct evsel_script *es = zalloc(sizeof(*es)); if (es != NULL) { - if (asprintf(&es->filename, "%s.%s.dump", data->file.path, perf_evsel__name(evsel)) < 0) + if (asprintf(&es->filename, "%s.%s.dump", data->file.path, evsel__name(evsel)) < 0) goto out_free; es->fp = fopen(es->filename, "w"); if (es->fp == NULL) @@ -366,7 +366,7 @@ static int perf_evsel__do_check_stype(struct evsel *evsel, if (output[type].user_set_fields & field) { if (allow_user_set) return 0; - evname = perf_evsel__name(evsel); + evname = evsel__name(evsel); pr_err("Samples for '%s' event do not have %s attribute set. " "Cannot print '%s' field.\n", evname, sample_msg, output_field2str(field)); @@ -375,7 +375,7 @@ static int perf_evsel__do_check_stype(struct evsel *evsel, /* user did not ask for it explicitly so remove from the default list */ output[type].fields &= ~field; - evname = perf_evsel__name(evsel); + evname = evsel__name(evsel); pr_debug("Samples for '%s' event do not have %s attribute set. " "Skipping '%s' field.\n", evname, sample_msg, output_field2str(field)); @@ -1712,7 +1712,7 @@ static int perf_evlist__max_name_len(struct evlist *evlist) int max = 0; evlist__for_each_entry(evlist, evsel) { - int len = strlen(perf_evsel__name(evsel)); + int len = strlen(evsel__name(evsel)); max = MAX(len, max); } @@ -1886,7 +1886,7 @@ static void process_event(struct perf_script *script, fprintf(fp, "%10" PRIu64 " ", sample->period); if (PRINT_FIELD(EVNAME)) { - const char *evname = perf_evsel__name(evsel); + const char *evname = evsel__name(evsel); if (!script->name_width) script->name_width = perf_evlist__max_name_len(script->session->evlist); @@ -2003,7 +2003,7 @@ static void __process_stat(struct evsel *counter, u64 tstamp) counts->ena, counts->run, tstamp, - perf_evsel__name(counter)); + evsel__name(counter)); } } } @@ -2975,7 +2975,7 @@ static int check_ev_match(char *dir_name, char *scriptname, match = 0; evlist__for_each_entry(session->evlist, pos) { - if (!strcmp(perf_evsel__name(pos), evname)) { + if (!strcmp(evsel__name(pos), evname)) { match = 1; break; } diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 3f050d85c277..6bc1336a0429 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -306,7 +306,7 @@ static int read_counter_cpu(struct evsel *counter, struct timespec *rs, int cpu) if (verbose > 1) { fprintf(stat_config.output, "%s: %d: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", - perf_evsel__name(counter), + evsel__name(counter), cpu, count->val, count->ena, count->run); } @@ -455,7 +455,7 @@ static enum counter_recovery stat_handle_error(struct evsel *counter) errno == ENXIO) { if (verbose > 0) ui__warning("%s event is not supported by the kernel.\n", - perf_evsel__name(counter)); + evsel__name(counter)); counter->supported = false; /* * errored is a sticky flag that means one of the counter's @@ -605,7 +605,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) if (!counter->reset_group) continue; try_again_reset: - pr_debug2("reopening weak %s\n", perf_evsel__name(counter)); + pr_debug2("reopening weak %s\n", evsel__name(counter)); if (create_perf_stat_counter(counter, &stat_config, &target, counter->cpu_iter - 1) < 0) { @@ -643,7 +643,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) if (perf_evlist__apply_filters(evsel_list, &counter)) { pr_err("failed to set filter \"%s\" on event %s with %d (%s)\n", - counter->filter, perf_evsel__name(counter), errno, + counter->filter, evsel__name(counter), errno, str_error_r(errno, msg, sizeof(msg))); return -1; } diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index de24aced7213..55edab99b05d 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -255,7 +255,7 @@ static void perf_top__show_details(struct perf_top *top) if (notes->src == NULL) goto out_unlock; - printf("Showing %s for %s\n", perf_evsel__name(top->sym_evsel), symbol->name); + printf("Showing %s for %s\n", evsel__name(top->sym_evsel), symbol->name); printf(" Events Pcnt (>=%d%%)\n", top->annotation_opts.min_pcnt); more = symbol__annotate_printf(&he->ms, top->sym_evsel, &top->annotation_opts); @@ -442,7 +442,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top) fprintf(stdout, "\t[e] display entries (lines). \t(%d)\n", top->print_entries); if (top->evlist->core.nr_entries > 1) - fprintf(stdout, "\t[E] active event counter. \t(%s)\n", perf_evsel__name(top->sym_evsel)); + fprintf(stdout, "\t[E] active event counter. \t(%s)\n", evsel__name(top->sym_evsel)); fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", top->count_filter); @@ -529,13 +529,13 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) fprintf(stderr, "\nAvailable events:"); evlist__for_each_entry(top->evlist, top->sym_evsel) - fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, perf_evsel__name(top->sym_evsel)); + fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, evsel__name(top->sym_evsel)); prompt_integer(&counter, "Enter details event counter"); if (counter >= top->evlist->core.nr_entries) { top->sym_evsel = evlist__first(top->evlist); - fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel)); + fprintf(stderr, "Sorry, no such event, using %s.\n", evsel__name(top->sym_evsel)); sleep(1); break; } diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index f2e832572fce..1411e2735855 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2074,7 +2074,7 @@ static struct syscall *trace__syscall_info(struct trace *trace, if (verbose > 1) { static u64 n; fprintf(trace->output, "Invalid syscall %d id, skipping (%s, %" PRIu64 ") ...\n", - id, perf_evsel__name(evsel), ++n); + id, evsel__name(evsel), ++n); } return NULL; } @@ -2206,7 +2206,7 @@ static int trace__fprintf_sample(struct trace *trace, struct evsel *evsel, double ts = (double)sample->time / NSEC_PER_MSEC; printed += fprintf(trace->output, "%22s %10.3f %s %d/%d [%d]\n", - perf_evsel__name(evsel), ts, + evsel__name(evsel), ts, thread__comm_str(thread), sample->pid, sample->tid, sample->cpu); } @@ -2513,7 +2513,7 @@ errno_print: { if (callchain_ret > 0) trace__fprintf_callchain(trace, sample); else if (callchain_ret < 0) - pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel)); + pr_err("Problem processing %s callchain, skipping...\n", evsel__name(evsel)); out: ttrace->entry_pending = false; err = 0; @@ -2795,7 +2795,7 @@ static int trace__event_handler(struct trace *trace, struct evsel *evsel, if (callchain_ret > 0) trace__fprintf_callchain(trace, sample); else if (callchain_ret < 0) - pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel)); + pr_err("Problem processing %s callchain, skipping...\n", evsel__name(evsel)); ++trace->nr_events_printed; @@ -2890,7 +2890,7 @@ static int trace__pgfault(struct trace *trace, if (callchain_ret > 0) trace__fprintf_callchain(trace, sample); else if (callchain_ret < 0) - pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel)); + pr_err("Problem processing %s callchain, skipping...\n", evsel__name(evsel)); ++trace->nr_events_printed; out: @@ -3032,7 +3032,7 @@ static bool evlist__add_vfs_getname(struct evlist *evlist) } evlist__for_each_entry_safe(evlist, evsel, tmp) { - if (!strstarts(perf_evsel__name(evsel), "probe:vfs_getname")) + if (!strstarts(evsel__name(evsel), "probe:vfs_getname")) continue; if (perf_evsel__field(evsel, "pathname")) { @@ -3093,7 +3093,7 @@ static void trace__handle_event(struct trace *trace, union perf_event *event, st if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT && sample->raw_data == NULL) { fprintf(trace->output, "%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n", - perf_evsel__name(evsel), sample->tid, + evsel__name(evsel), sample->tid, sample->cpu, sample->raw_size); } else { tracepoint_handler handler = evsel->handler; @@ -4108,7 +4108,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) out_error_apply_filters: fprintf(trace->output, "Failed to set filter \"%s\" on event %s with %d (%s)\n", - evsel->filter, perf_evsel__name(evsel), errno, + evsel->filter, evsel__name(evsel), errno, str_error_r(errno, errbuf, sizeof(errbuf))); goto out_delete_evlist; } @@ -4989,7 +4989,7 @@ int cmd_trace(int argc, const char **argv) */ if (trace.syscalls.events.augmented) { evlist__for_each_entry(trace.evlist, evsel) { - bool raw_syscalls_sys_exit = strcmp(perf_evsel__name(evsel), "raw_syscalls:sys_exit") == 0; + bool raw_syscalls_sys_exit = strcmp(evsel__name(evsel), "raw_syscalls:sys_exit") == 0; if (raw_syscalls_sys_exit) { trace.raw_augmented_syscalls = true; @@ -4997,7 +4997,7 @@ int cmd_trace(int argc, const char **argv) } if (trace.syscalls.events.augmented->priv == NULL && - strstr(perf_evsel__name(evsel), "syscalls:sys_enter")) { + strstr(evsel__name(evsel), "syscalls:sys_enter")) { struct evsel *augmented = trace.syscalls.events.augmented; if (perf_evsel__init_augmented_syscall_tp(augmented, evsel) || perf_evsel__init_augmented_syscall_tp_args(augmented)) @@ -5020,7 +5020,7 @@ int cmd_trace(int argc, const char **argv) evsel->handler = trace__sys_enter; } - if (strstarts(perf_evsel__name(evsel), "syscalls:sys_exit_")) { + if (strstarts(evsel__name(evsel), "syscalls:sys_exit_")) { struct syscall_tp *sc; init_augmented_syscall_tp: if (perf_evsel__init_augmented_syscall_tp(evsel, evsel)) diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index c727379cf20e..bdcf032f8516 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c @@ -109,7 +109,7 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu TEST_ASSERT_VAL("failed to synthesize attr update scale", !perf_event__synthesize_event_update_scale(NULL, evsel, process_event_scale)); - tmp.name = perf_evsel__name(evsel); + tmp.name = evsel__name(evsel); TEST_ASSERT_VAL("failed to synthesize attr update name", !perf_event__synthesize_event_update_name(&tmp.tool, evsel, process_event_name)); diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c index 956205bf9326..f052851bad93 100644 --- a/tools/perf/tests/evsel-roundtrip-name.c +++ b/tools/perf/tests/evsel-roundtrip-name.c @@ -24,8 +24,7 @@ static int perf_evsel__roundtrip_cache_name_test(void) continue; for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { - __perf_evsel__hw_cache_type_op_res_name(type, op, i, - name, sizeof(name)); + __evsel__hw_cache_type_op_res_name(type, op, i, name, sizeof(name)); err = parse_events(evlist, name, NULL); if (err) ret = err; @@ -43,15 +42,14 @@ static int perf_evsel__roundtrip_cache_name_test(void) continue; for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { - __perf_evsel__hw_cache_type_op_res_name(type, op, i, - name, sizeof(name)); + __evsel__hw_cache_type_op_res_name(type, op, i, name, sizeof(name)); if (evsel->idx != idx) continue; ++idx; - if (strcmp(perf_evsel__name(evsel), name)) { - pr_debug("%s != %s\n", perf_evsel__name(evsel), name); + if (strcmp(evsel__name(evsel), name)) { + pr_debug("%s != %s\n", evsel__name(evsel), name); ret = -1; } @@ -84,9 +82,9 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names) err = 0; evlist__for_each_entry(evlist, evsel) { - if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) { + if (strcmp(evsel__name(evsel), names[evsel->idx])) { --err; - pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]); + pr_debug("%s != %s\n", evsel__name(evsel), names[evsel->idx]); } } diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 5f4c0dbb4715..e9c0c6498704 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -150,7 +150,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) { pr_debug("expected %d %s events, got %d\n", expected_nr_events[evsel->idx], - perf_evsel__name(evsel), nr_events[evsel->idx]); + evsel__name(evsel), nr_events[evsel->idx]); err = -1; goto out_delete_evlist; } diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 902bd9d591a0..732dde22ab4e 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -371,7 +371,7 @@ static int test__checkevent_breakpoint_modifier(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong name", - !strcmp(perf_evsel__name(evsel), "mem:0:u")); + !strcmp(evsel__name(evsel), "mem:0:u")); return test__checkevent_breakpoint(evlist); } @@ -385,7 +385,7 @@ static int test__checkevent_breakpoint_x_modifier(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong name", - !strcmp(perf_evsel__name(evsel), "mem:0:x:k")); + !strcmp(evsel__name(evsel), "mem:0:x:k")); return test__checkevent_breakpoint_x(evlist); } @@ -399,7 +399,7 @@ static int test__checkevent_breakpoint_r_modifier(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong name", - !strcmp(perf_evsel__name(evsel), "mem:0:r:hp")); + !strcmp(evsel__name(evsel), "mem:0:r:hp")); return test__checkevent_breakpoint_r(evlist); } @@ -413,7 +413,7 @@ static int test__checkevent_breakpoint_w_modifier(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong name", - !strcmp(perf_evsel__name(evsel), "mem:0:w:up")); + !strcmp(evsel__name(evsel), "mem:0:w:up")); return test__checkevent_breakpoint_w(evlist); } @@ -427,7 +427,7 @@ static int test__checkevent_breakpoint_rw_modifier(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong name", - !strcmp(perf_evsel__name(evsel), "mem:0:rw:kp")); + !strcmp(evsel__name(evsel), "mem:0:rw:kp")); return test__checkevent_breakpoint_rw(evlist); } @@ -498,7 +498,7 @@ static int test__checkevent_pmu_name(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); - TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava")); + TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava")); /* cpu/config=2/u" */ evsel = perf_evsel__next(evsel); @@ -506,7 +506,7 @@ static int test__checkevent_pmu_name(struct evlist *evlist) TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); TEST_ASSERT_VAL("wrong name", - !strcmp(perf_evsel__name(evsel), "cpu/config=2/u")); + !strcmp(evsel__name(evsel), "cpu/config=2/u")); return 0; } diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 487e54ef56a9..1ad64ca4e21b 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -3416,7 +3416,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser, struct hists *hists = evsel__hists(evsel); bool current_entry = ui_browser__is_current_entry(browser, row); unsigned long nr_events = hists->stats.nr_events[PERF_RECORD_SAMPLE]; - const char *ev_name = perf_evsel__name(evsel); + const char *ev_name = evsel__name(evsel); char bf[256], unit; const char *warn = " "; size_t printed; @@ -3427,7 +3427,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser, if (perf_evsel__is_group_event(evsel)) { struct evsel *pos; - ev_name = perf_evsel__group_name(evsel); + ev_name = evsel__group_name(evsel); for_each_group_member(pos, evsel) { struct hists *pos_hists = evsel__hists(pos); @@ -3587,7 +3587,7 @@ static int __perf_evlist__tui_browse_hists(struct evlist *evlist, ui_helpline__push("Press ESC to exit"); evlist__for_each_entry(evlist, pos) { - const char *ev_name = perf_evsel__name(pos); + const char *ev_name = evsel__name(pos); size_t line_len = strlen(ev_name) + 7; if (menu.b.width < line_len) @@ -3640,7 +3640,7 @@ static int block_hists_browser__title(struct hist_browser *browser, char *bf, size_t size) { struct hists *hists = evsel__hists(browser->block_evsel); - const char *evname = perf_evsel__name(browser->block_evsel); + const char *evname = evsel__name(browser->block_evsel); unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; int ret; diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index ed1a97b2c4b0..50c072d2f3d3 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c @@ -635,7 +635,7 @@ int perf_evlist__gtk_browse_hists(struct evlist *evlist, evlist__for_each_entry(evlist, pos) { struct hists *hists = evsel__hists(pos); - const char *evname = perf_evsel__name(pos); + const char *evname = evsel__name(pos); GtkWidget *scrolled_window; GtkWidget *tab_label; char buf[512]; diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 9760d58e979a..37d95627c65f 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2344,7 +2344,7 @@ int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel, struct dso *dso = map->dso; char *filename; const char *d_filename; - const char *evsel_name = perf_evsel__name(evsel); + const char *evsel_name = evsel__name(evsel); struct annotation *notes = symbol__annotation(sym); struct sym_hist *h = annotation__histogram(notes, evsel->idx); struct annotation_line *pos, *queue = NULL; @@ -2505,7 +2505,7 @@ static int symbol__annotate_fprintf2(struct symbol *sym, FILE *fp, int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel, struct annotation_options *opts) { - const char *ev_name = perf_evsel__name(evsel); + const char *ev_name = evsel__name(evsel); char buf[1024]; char *filename; int err = -1; diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index dbc772bfb04e..54c345e7b308 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -1155,7 +1155,7 @@ static int add_event(struct ctf_writer *cw, struct evsel *evsel) { struct bt_ctf_event_class *event_class; struct evsel_priv *priv; - const char *name = perf_evsel__name(evsel); + const char *name = evsel__name(evsel); int ret; pr("Adding event '%s' (type %d)\n", name, evsel->core.attr.type); diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 3a16728074a9..167599e8b794 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -385,7 +385,7 @@ const char *perf_evsel__hw_names[PERF_COUNT_HW_MAX] = { "ref-cycles", }; -static const char *__perf_evsel__hw_name(u64 config) +static const char *__evsel__hw_name(u64 config) { if (config < PERF_COUNT_HW_MAX && perf_evsel__hw_names[config]) return perf_evsel__hw_names[config]; @@ -429,9 +429,9 @@ static int perf_evsel__add_modifiers(struct evsel *evsel, char *bf, size_t size) return r; } -static int perf_evsel__hw_name(struct evsel *evsel, char *bf, size_t size) +static int evsel__hw_name(struct evsel *evsel, char *bf, size_t size) { - int r = scnprintf(bf, size, "%s", __perf_evsel__hw_name(evsel->core.attr.config)); + int r = scnprintf(bf, size, "%s", __evsel__hw_name(evsel->core.attr.config)); return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); } @@ -448,20 +448,20 @@ const char *perf_evsel__sw_names[PERF_COUNT_SW_MAX] = { "dummy", }; -static const char *__perf_evsel__sw_name(u64 config) +static const char *__evsel__sw_name(u64 config) { if (config < PERF_COUNT_SW_MAX && perf_evsel__sw_names[config]) return perf_evsel__sw_names[config]; return "unknown-software"; } -static int perf_evsel__sw_name(struct evsel *evsel, char *bf, size_t size) +static int evsel__sw_name(struct evsel *evsel, char *bf, size_t size) { - int r = scnprintf(bf, size, "%s", __perf_evsel__sw_name(evsel->core.attr.config)); + int r = scnprintf(bf, size, "%s", __evsel__sw_name(evsel->core.attr.config)); return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); } -static int __perf_evsel__bp_name(char *bf, size_t size, u64 addr, u64 type) +static int __evsel__bp_name(char *bf, size_t size, u64 addr, u64 type) { int r; @@ -479,10 +479,10 @@ static int __perf_evsel__bp_name(char *bf, size_t size, u64 addr, u64 type) return r; } -static int perf_evsel__bp_name(struct evsel *evsel, char *bf, size_t size) +static int evsel__bp_name(struct evsel *evsel, char *bf, size_t size) { struct perf_event_attr *attr = &evsel->core.attr; - int r = __perf_evsel__bp_name(bf, size, attr->bp_addr, attr->bp_type); + int r = __evsel__bp_name(bf, size, attr->bp_addr, attr->bp_type); return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); } @@ -539,8 +539,7 @@ bool perf_evsel__is_cache_op_valid(u8 type, u8 op) return false; /* invalid */ } -int __perf_evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, - char *bf, size_t size) +int __evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, char *bf, size_t size) { if (result) { return scnprintf(bf, size, "%s-%s-%s", perf_evsel__hw_cache[type][0], @@ -552,7 +551,7 @@ int __perf_evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, perf_evsel__hw_cache_op[op][1]); } -static int __perf_evsel__hw_cache_name(u64 config, char *bf, size_t size) +static int __evsel__hw_cache_name(u64 config, char *bf, size_t size) { u8 op, result, type = (config >> 0) & 0xff; const char *err = "unknown-ext-hardware-cache-type"; @@ -574,30 +573,30 @@ static int __perf_evsel__hw_cache_name(u64 config, char *bf, size_t size) if (!perf_evsel__is_cache_op_valid(type, op)) goto out_err; - return __perf_evsel__hw_cache_type_op_res_name(type, op, result, bf, size); + return __evsel__hw_cache_type_op_res_name(type, op, result, bf, size); out_err: return scnprintf(bf, size, "%s", err); } -static int perf_evsel__hw_cache_name(struct evsel *evsel, char *bf, size_t size) +static int evsel__hw_cache_name(struct evsel *evsel, char *bf, size_t size) { - int ret = __perf_evsel__hw_cache_name(evsel->core.attr.config, bf, size); + int ret = __evsel__hw_cache_name(evsel->core.attr.config, bf, size); return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); } -static int perf_evsel__raw_name(struct evsel *evsel, char *bf, size_t size) +static int evsel__raw_name(struct evsel *evsel, char *bf, size_t size) { int ret = scnprintf(bf, size, "raw 0x%" PRIx64, evsel->core.attr.config); return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); } -static int perf_evsel__tool_name(char *bf, size_t size) +static int evsel__tool_name(char *bf, size_t size) { int ret = scnprintf(bf, size, "duration_time"); return ret; } -const char *perf_evsel__name(struct evsel *evsel) +const char *evsel__name(struct evsel *evsel) { char bf[128]; @@ -609,22 +608,22 @@ const char *perf_evsel__name(struct evsel *evsel) switch (evsel->core.attr.type) { case PERF_TYPE_RAW: - perf_evsel__raw_name(evsel, bf, sizeof(bf)); + evsel__raw_name(evsel, bf, sizeof(bf)); break; case PERF_TYPE_HARDWARE: - perf_evsel__hw_name(evsel, bf, sizeof(bf)); + evsel__hw_name(evsel, bf, sizeof(bf)); break; case PERF_TYPE_HW_CACHE: - perf_evsel__hw_cache_name(evsel, bf, sizeof(bf)); + evsel__hw_cache_name(evsel, bf, sizeof(bf)); break; case PERF_TYPE_SOFTWARE: if (evsel->tool_event) - perf_evsel__tool_name(bf, sizeof(bf)); + evsel__tool_name(bf, sizeof(bf)); else - perf_evsel__sw_name(evsel, bf, sizeof(bf)); + evsel__sw_name(evsel, bf, sizeof(bf)); break; case PERF_TYPE_TRACEPOINT: @@ -632,7 +631,7 @@ const char *perf_evsel__name(struct evsel *evsel) break; case PERF_TYPE_BREAKPOINT: - perf_evsel__bp_name(evsel, bf, sizeof(bf)); + evsel__bp_name(evsel, bf, sizeof(bf)); break; default: @@ -649,7 +648,7 @@ const char *perf_evsel__name(struct evsel *evsel) return "unknown"; } -const char *perf_evsel__group_name(struct evsel *evsel) +const char *evsel__group_name(struct evsel *evsel) { return evsel->group_name ?: "anon group"; } @@ -668,17 +667,15 @@ int perf_evsel__group_desc(struct evsel *evsel, char *buf, size_t size) { int ret = 0; struct evsel *pos; - const char *group_name = perf_evsel__group_name(evsel); + const char *group_name = evsel__group_name(evsel); if (!evsel->forced_leader) ret = scnprintf(buf, size, "%s { ", group_name); - ret += scnprintf(buf + ret, size - ret, "%s", - perf_evsel__name(evsel)); + ret += scnprintf(buf + ret, size - ret, "%s", evsel__name(evsel)); for_each_group_member(pos, evsel) - ret += scnprintf(buf + ret, size - ret, ", %s", - perf_evsel__name(pos)); + ret += scnprintf(buf + ret, size - ret, ", %s", evsel__name(pos)); if (!evsel->forced_leader) ret += scnprintf(buf + ret, size - ret, " }"); @@ -2421,7 +2418,7 @@ bool perf_evsel__fallback(struct evsel *evsel, int err, return true; } else if (err == EACCES && !evsel->core.attr.exclude_kernel && (paranoid = perf_event_paranoid()) > 1) { - const char *name = perf_evsel__name(evsel); + const char *name = evsel__name(evsel); char *new_name; const char *sep = ":"; @@ -2499,8 +2496,7 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, case EACCES: if (err == EPERM) printed = scnprintf(msg, size, - "No permission to enable %s event.\n\n", - perf_evsel__name(evsel)); + "No permission to enable %s event.\n\n", evsel__name(evsel)); return scnprintf(msg + printed, size - printed, "You may not have permission to collect %sstats.\n\n" @@ -2519,8 +2515,7 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, target->system_wide ? "system-wide " : "", perf_event_paranoid()); case ENOENT: - return scnprintf(msg, size, "The %s event is not supported.", - perf_evsel__name(evsel)); + return scnprintf(msg, size, "The %s event is not supported.", evsel__name(evsel)); case EMFILE: return scnprintf(msg, size, "%s", "Too many events are opened.\n" @@ -2544,7 +2539,7 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, if (evsel->core.attr.sample_period != 0) return scnprintf(msg, size, "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'", - perf_evsel__name(evsel)); + evsel__name(evsel)); if (evsel->core.attr.precise_ip) return scnprintf(msg, size, "%s", "\'precise\' request may not be supported. Try removing 'p' modifier."); @@ -2577,8 +2572,7 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, return scnprintf(msg, size, "The sys_perf_event_open() syscall returned with %d (%s) for event (%s).\n" "/bin/dmesg | grep -i perf may provide additional information.\n", - err, str_error_r(err, sbuf, sizeof(sbuf)), - perf_evsel__name(evsel)); + err, str_error_r(err, sbuf, sizeof(sbuf)), evsel__name(evsel)); } struct perf_env *perf_evsel__env(struct evsel *evsel) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 580975c7086a..7160f3d49d6c 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -208,11 +208,10 @@ extern const char *perf_evsel__hw_cache_result[PERF_COUNT_HW_CACHE_RESULT_MAX] [PERF_EVSEL__MAX_ALIASES]; extern const char *perf_evsel__hw_names[PERF_COUNT_HW_MAX]; extern const char *perf_evsel__sw_names[PERF_COUNT_SW_MAX]; -int __perf_evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, - char *bf, size_t size); -const char *perf_evsel__name(struct evsel *evsel); +int __evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, char *bf, size_t size); +const char *evsel__name(struct evsel *evsel); -const char *perf_evsel__group_name(struct evsel *evsel); +const char *evsel__group_name(struct evsel *evsel); int perf_evsel__group_desc(struct evsel *evsel, char *buf, size_t size); void __perf_evsel__set_sample_bit(struct evsel *evsel, diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index 3b4842840db0..b4c3c7b52b2d 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c @@ -50,16 +50,16 @@ int perf_evsel__fprintf(struct evsel *evsel, if (evsel->core.nr_members > 1) printed += fprintf(fp, "%s{", evsel->group_name ?: ""); - printed += fprintf(fp, "%s", perf_evsel__name(evsel)); + printed += fprintf(fp, "%s", evsel__name(evsel)); for_each_group_member(pos, evsel) - printed += fprintf(fp, ",%s", perf_evsel__name(pos)); + printed += fprintf(fp, ",%s", evsel__name(pos)); if (evsel->core.nr_members > 1) printed += fprintf(fp, "}"); goto out; } - printed += fprintf(fp, "%s", perf_evsel__name(evsel)); + printed += fprintf(fp, "%s", evsel__name(evsel)); if (details->verbose) { printed += perf_event_attr__fprintf(fp, &evsel->core.attr, diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 28e82da04b7a..89031942a2a9 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -525,7 +525,7 @@ static int write_event_desc(struct feat_fd *ff, /* * write event string as passed on cmdline */ - ret = do_write_string(ff, perf_evsel__name(evsel)); + ret = do_write_string(ff, evsel__name(evsel)); if (ret < 0) return ret; /* @@ -1909,12 +1909,11 @@ static void print_group_desc(struct feat_fd *ff, FILE *fp) evlist__for_each_entry(session->evlist, evsel) { if (perf_evsel__is_group_leader(evsel) && evsel->core.nr_members > 1) { - fprintf(fp, "# group: %s{%s", evsel->group_name ?: "", - perf_evsel__name(evsel)); + fprintf(fp, "# group: %s{%s", evsel->group_name ?: "", evsel__name(evsel)); nr = evsel->core.nr_members - 1; } else if (nr) { - fprintf(fp, ",%s", perf_evsel__name(evsel)); + fprintf(fp, ",%s", evsel__name(evsel)); if (--nr == 0) fprintf(fp, "}\n"); diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index c2550dbe7dc3..fa77574f12ca 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -2660,7 +2660,7 @@ size_t perf_evlist__fprintf_nr_events(struct evlist *evlist, FILE *fp) size_t ret = 0; evlist__for_each_entry(evlist, pos) { - ret += fprintf(fp, "%s stats:\n", perf_evsel__name(pos)); + ret += fprintf(fp, "%s stats:\n", evsel__name(pos)); ret += events_stats__fprintf(&evsel__hists(pos)->stats, fp); } @@ -2684,7 +2684,7 @@ int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool sh unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; u64 nr_events = hists->stats.total_period; struct evsel *evsel = hists_to_evsel(hists); - const char *ev_name = perf_evsel__name(evsel); + const char *ev_name = evsel__name(evsel); char buf[512], sample_freq_str[64] = ""; size_t buflen = sizeof(buf); char ref[30] = " show reference callgraph, "; diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 59811b39430c..59829f28cbb6 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -3037,7 +3037,7 @@ static struct evsel *intel_pt_find_sched_switch(struct evlist *evlist) struct evsel *evsel; evlist__for_each_entry_reverse(evlist, evsel) { - const char *name = perf_evsel__name(evsel); + const char *name = evsel__name(evsel); if (!strcmp(name, "sched:sched_switch")) return evsel; diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 6dc9e57ab95b..2252f494ff9f 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2631,8 +2631,7 @@ int print_hwcache_events(const char *event_glob, bool name_only) continue; for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { - __perf_evsel__hw_cache_type_op_res_name(type, op, i, - name, sizeof(name)); + __evsel__hw_cache_type_op_res_name(type, op, i, name, sizeof(name)); if (event_glob != NULL && !strglobmatch(name, event_glob)) continue; diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 2c372cf5495e..739516fdf6e3 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -741,7 +741,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, if (!dict_sample) Py_FatalError("couldn't create Python dictionary"); - pydict_set_item_string_decref(dict, "ev_name", _PyUnicode_FromString(perf_evsel__name(evsel))); + pydict_set_item_string_decref(dict, "ev_name", _PyUnicode_FromString(evsel__name(evsel))); pydict_set_item_string_decref(dict, "attr", _PyBytes_FromStringAndSize((const char *)&evsel->core.attr, sizeof(evsel->core.attr))); pydict_set_item_string_decref(dict_sample, "pid", @@ -968,7 +968,7 @@ static int python_export_evsel(struct db_export *dbe, struct evsel *evsel) t = tuple_new(2); tuple_set_u64(t, 0, evsel->db_id); - tuple_set_string(t, 1, perf_evsel__name(evsel)); + tuple_set_string(t, 1, evsel__name(evsel)); call_object(tables->evsel_handler, t, "evsel_table"); @@ -1349,7 +1349,7 @@ static void get_handler_name(char *str, size_t size, { char *p = str; - scnprintf(str, size, "stat__%s", perf_evsel__name(evsel)); + scnprintf(str, size, "stat__%s", evsel__name(evsel)); while ((p = strchr(p, ':'))) { *p = '_'; diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 2b5a08a92ce5..7f7d3a1989fd 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1280,8 +1280,7 @@ static void dump_read(struct evsel *evsel, union perf_event *event) return; printf(": %d %d %s %" PRI_lu64 "\n", event->read.pid, event->read.tid, - perf_evsel__name(evsel), - event->read.value); + evsel__name(evsel), event->read.value); if (!evsel) return; diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index b0e5d8505f57..7f46e2837045 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -246,7 +246,7 @@ static const char *fixunit(char *buf, struct evsel *evsel, const char *unit) { if (!strncmp(unit, "of all", 6)) { - snprintf(buf, 1024, "%s %s", perf_evsel__name(evsel), + snprintf(buf, 1024, "%s %s", evsel__name(evsel), unit); return buf; } @@ -367,7 +367,7 @@ static void abs_printout(struct perf_stat_config *config, config->csv_output ? 0 : config->unit_width, evsel->unit, config->csv_sep); - fprintf(output, "%-*s", config->csv_output ? 0 : 25, perf_evsel__name(evsel)); + fprintf(output, "%-*s", config->csv_output ? 0 : 25, evsel__name(evsel)); print_cgroup(config, evsel); } @@ -461,8 +461,7 @@ static void printout(struct perf_stat_config *config, int id, int nr, counter->unit, config->csv_sep); fprintf(config->output, "%*s", - config->csv_output ? 0 : -25, - perf_evsel__name(counter)); + config->csv_output ? 0 : -25, evsel__name(counter)); print_cgroup(config, counter); @@ -559,7 +558,7 @@ static void collect_all_aliases(struct perf_stat_config *config, struct evsel *c alias = list_prepare_entry(counter, &(evlist->core.entries), core.node); list_for_each_entry_continue (alias, &evlist->core.entries, core.node) { - if (strcmp(perf_evsel__name(alias), perf_evsel__name(counter)) || + if (strcmp(evsel__name(alias), evsel__name(counter)) || alias->scale != counter->scale || alias->cgrp != counter->cgrp || strcmp(alias->unit, counter->unit) || diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 4e6e770f39aa..c27f01b944c5 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -108,7 +108,7 @@ static void perf_stat_evsel_id_init(struct evsel *evsel) /* ps->id is 0 hence PERF_STAT_EVSEL_ID__NONE by default */ for (i = 0; i < PERF_STAT_EVSEL_ID__MAX; i++) { - if (!strcmp(perf_evsel__name(evsel), id_str[i])) { + if (!strcmp(evsel__name(evsel), id_str[i])) { ps->id = i; break; } @@ -392,7 +392,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, if (verbose > 0) { fprintf(config->output, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", - perf_evsel__name(counter), count[0], count[1], count[2]); + evsel__name(counter), count[0], count[1], count[2]); } /* diff --git a/tools/perf/util/top.c b/tools/perf/util/top.c index 3dce2de9d005..27945eeb0cb5 100644 --- a/tools/perf/util/top.c +++ b/tools/perf/util/top.c @@ -77,7 +77,7 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size) opts->freq ? "Hz" : ""); } - ret += SNPRINTF(bf + ret, size - ret, "%s", perf_evsel__name(top->sym_evsel)); + ret += SNPRINTF(bf + ret, size - ret, "%s", evsel__name(top->sym_evsel)); ret += SNPRINTF(bf + ret, size - ret, "], "); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 58/91] perf evsel: Rename perf_evsel__group_desc() to evsel__group_desc() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (56 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 57/91] perf evsel: Rename *perf_evsel__*name() to *evsel__*name() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 59/91] perf evsel: Rename *perf_evsel__*set_sample_*() to *evsel__*set_sample_*() Arnaldo Carvalho de Melo ` (32 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-report.c | 2 +- tools/perf/ui/gtk/hists.c | 2 +- tools/perf/util/annotate.c | 4 ++-- tools/perf/util/evsel.c | 2 +- tools/perf/util/evsel.h | 2 +- tools/perf/util/hist.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index b5dd93a76aa1..e00f6244cbda 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -462,7 +462,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report if (perf_evsel__is_group_event(evsel)) { struct evsel *pos; - perf_evsel__group_desc(evsel, buf, size); + evsel__group_desc(evsel, buf, size); evname = buf; for_each_group_member(pos, evsel) { diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 50c072d2f3d3..40b52ae6ca6a 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c @@ -646,7 +646,7 @@ int perf_evlist__gtk_browse_hists(struct evlist *evlist, continue; if (pos->core.nr_members > 1) { - perf_evsel__group_desc(pos, buf, size); + evsel__group_desc(pos, buf, size); evname = buf; } } diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 37d95627c65f..7d03563b608b 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2370,7 +2370,7 @@ int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel, if (perf_evsel__is_group_event(evsel)) { width *= evsel->core.nr_members; - perf_evsel__group_desc(evsel, buf, sizeof(buf)); + evsel__group_desc(evsel, buf, sizeof(buf)); evsel_name = buf; } @@ -2519,7 +2519,7 @@ int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel, goto out_free_filename; if (perf_evsel__is_group_event(evsel)) { - perf_evsel__group_desc(evsel, buf, sizeof(buf)); + evsel__group_desc(evsel, buf, sizeof(buf)); ev_name = buf; } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 167599e8b794..9b3db6d34d37 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -663,7 +663,7 @@ const char *evsel__group_name(struct evsel *evsel) * For record -e 'cycles,instructions' and report --group * 'cycles:u, instructions:u' */ -int perf_evsel__group_desc(struct evsel *evsel, char *buf, size_t size) +int evsel__group_desc(struct evsel *evsel, char *buf, size_t size) { int ret = 0; struct evsel *pos; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 7160f3d49d6c..82d2d308fa33 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -212,7 +212,7 @@ int __evsel__hw_cache_type_op_res_name(u8 type, u8 op, u8 result, char *bf, size const char *evsel__name(struct evsel *evsel); const char *evsel__group_name(struct evsel *evsel); -int perf_evsel__group_desc(struct evsel *evsel, char *buf, size_t size); +int evsel__group_desc(struct evsel *evsel, char *buf, size_t size); void __perf_evsel__set_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit); diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index fa77574f12ca..bce49ae97532 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -2698,7 +2698,7 @@ int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool sh if (perf_evsel__is_group_event(evsel)) { struct evsel *pos; - perf_evsel__group_desc(evsel, buf, buflen); + evsel__group_desc(evsel, buf, buflen); ev_name = buf; for_each_group_member(pos, evsel) { -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 59/91] perf evsel: Rename *perf_evsel__*set_sample_*() to *evsel__*set_sample_*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (57 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 58/91] perf evsel: Rename perf_evsel__group_desc() to evsel__group_desc() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 60/91] perf evsel: Rename perf_evsel__*filter*() to evsel__*filter*() Arnaldo Carvalho de Melo ` (31 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As they are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/arch/arm/util/cs-etm.c | 4 +- tools/perf/arch/arm64/util/arm-spe.c | 12 ++-- tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 20 +++---- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-kvm.c | 18 +++--- tools/perf/tests/hists_cumulate.c | 8 +-- tools/perf/tests/mmap-basic.c | 2 +- tools/perf/tests/perf-record.c | 6 +- tools/perf/tests/switch-tracking.c | 10 ++-- tools/perf/util/auxtrace.c | 4 +- tools/perf/util/evlist.c | 4 +- tools/perf/util/evsel.c | 88 ++++++++++++++-------------- tools/perf/util/evsel.h | 17 +++--- tools/perf/util/record.c | 2 +- tools/perf/util/sideband_evlist.c | 2 +- 17 files changed, 100 insertions(+), 103 deletions(-) diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 53db3c20225b..97aa02c4491d 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -402,7 +402,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, * when a context switch happened. */ if (!perf_cpu_map__empty(cpus)) { - perf_evsel__set_sample_bit(cs_etm_evsel, CPU); + evsel__set_sample_bit(cs_etm_evsel, CPU); err = cs_etm_set_option(itr, cs_etm_evsel, ETM_OPT_CTXTID | ETM_OPT_TS); @@ -426,7 +426,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, /* In per-cpu case, always need the time of mmap events etc */ if (!perf_cpu_map__empty(cpus)) - perf_evsel__set_sample_bit(tracking_evsel, TIME); + evsel__set_sample_bit(tracking_evsel, TIME); } out: diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index 27653be24447..e3593063b3d1 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -120,9 +120,9 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, */ perf_evlist__to_front(evlist, arm_spe_evsel); - perf_evsel__set_sample_bit(arm_spe_evsel, CPU); - perf_evsel__set_sample_bit(arm_spe_evsel, TIME); - perf_evsel__set_sample_bit(arm_spe_evsel, TID); + evsel__set_sample_bit(arm_spe_evsel, CPU); + evsel__set_sample_bit(arm_spe_evsel, TIME); + evsel__set_sample_bit(arm_spe_evsel, TID); /* Add dummy event to keep tracking */ err = parse_events(evlist, "dummy:u", NULL); @@ -134,9 +134,9 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, tracking_evsel->core.attr.freq = 0; tracking_evsel->core.attr.sample_period = 1; - perf_evsel__set_sample_bit(tracking_evsel, TIME); - perf_evsel__set_sample_bit(tracking_evsel, CPU); - perf_evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); + evsel__set_sample_bit(tracking_evsel, TIME); + evsel__set_sample_bit(tracking_evsel, CPU); + evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); return 0; } diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c index 09f93800bffd..0dc09b5809c1 100644 --- a/tools/perf/arch/x86/util/intel-bts.c +++ b/tools/perf/arch/x86/util/intel-bts.c @@ -224,7 +224,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr, * AUX event. */ if (!perf_cpu_map__empty(cpus)) - perf_evsel__set_sample_bit(intel_bts_evsel, CPU); + evsel__set_sample_bit(intel_bts_evsel, CPU); } /* Add dummy event to keep tracking */ diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index 6b888963c21c..3f7c20cc7b79 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c @@ -421,8 +421,8 @@ static int intel_pt_track_switches(struct evlist *evlist) evsel = evlist__last(evlist); - perf_evsel__set_sample_bit(evsel, CPU); - perf_evsel__set_sample_bit(evsel, TIME); + evsel__set_sample_bit(evsel, CPU); + evsel__set_sample_bit(evsel, TIME); evsel->core.system_wide = true; evsel->no_aux_samples = true; @@ -802,10 +802,10 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, switch_evsel->no_aux_samples = true; switch_evsel->immediate = true; - perf_evsel__set_sample_bit(switch_evsel, TID); - perf_evsel__set_sample_bit(switch_evsel, TIME); - perf_evsel__set_sample_bit(switch_evsel, CPU); - perf_evsel__reset_sample_bit(switch_evsel, BRANCH_STACK); + evsel__set_sample_bit(switch_evsel, TID); + evsel__set_sample_bit(switch_evsel, TIME); + evsel__set_sample_bit(switch_evsel, CPU); + evsel__reset_sample_bit(switch_evsel, BRANCH_STACK); opts->record_switch_events = false; ptr->have_sched_switch = 3; @@ -839,7 +839,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, * AUX event. */ if (!perf_cpu_map__empty(cpus)) - perf_evsel__set_sample_bit(intel_pt_evsel, CPU); + evsel__set_sample_bit(intel_pt_evsel, CPU); } /* Add dummy event to keep tracking */ @@ -863,11 +863,11 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, /* In per-cpu case, always need the time of mmap events etc */ if (!perf_cpu_map__empty(cpus)) { - perf_evsel__set_sample_bit(tracking_evsel, TIME); + evsel__set_sample_bit(tracking_evsel, TIME); /* And the CPU for switch events */ - perf_evsel__set_sample_bit(tracking_evsel, CPU); + evsel__set_sample_bit(tracking_evsel, CPU); } - perf_evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); + evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); } /* diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 6c0a0412502e..e0fbc13884df 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -433,7 +433,7 @@ static int __cmd_annotate(struct perf_annotate *ann) total_nr_samples += nr_samples; hists__collapse_resort(hists, NULL); /* Don't sort callchain */ - perf_evsel__reset_sample_bit(pos, CALLCHAIN); + evsel__reset_sample_bit(pos, CALLCHAIN); perf_evsel__output_resort(pos, NULL); if (symbol_conf.event_group && diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index b74a60f5813a..67d3adadcd5b 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -990,7 +990,7 @@ static void data_process(void) data__fprintf(); /* Don't sort callchain for perf diff */ - perf_evsel__reset_sample_bit(evsel_base, CALLCHAIN); + evsel__reset_sample_bit(evsel_base, CALLCHAIN); hists__process(hists_base); } diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 577af4f3297a..ff74a9a0bbaa 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -1033,16 +1033,16 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm) struct perf_event_attr *attr = &pos->core.attr; /* make sure these *are* set */ - perf_evsel__set_sample_bit(pos, TID); - perf_evsel__set_sample_bit(pos, TIME); - perf_evsel__set_sample_bit(pos, CPU); - perf_evsel__set_sample_bit(pos, RAW); + evsel__set_sample_bit(pos, TID); + evsel__set_sample_bit(pos, TIME); + evsel__set_sample_bit(pos, CPU); + evsel__set_sample_bit(pos, RAW); /* make sure these are *not*; want as small a sample as possible */ - perf_evsel__reset_sample_bit(pos, PERIOD); - perf_evsel__reset_sample_bit(pos, IP); - perf_evsel__reset_sample_bit(pos, CALLCHAIN); - perf_evsel__reset_sample_bit(pos, ADDR); - perf_evsel__reset_sample_bit(pos, READ); + evsel__reset_sample_bit(pos, PERIOD); + evsel__reset_sample_bit(pos, IP); + evsel__reset_sample_bit(pos, CALLCHAIN); + evsel__reset_sample_bit(pos, ADDR); + evsel__reset_sample_bit(pos, READ); attr->mmap = 0; attr->comm = 0; attr->task = 0; diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c index 6367c8f6ca22..7a542f1c1c78 100644 --- a/tools/perf/tests/hists_cumulate.c +++ b/tools/perf/tests/hists_cumulate.c @@ -280,7 +280,7 @@ static int test1(struct evsel *evsel, struct machine *machine) symbol_conf.use_callchain = false; symbol_conf.cumulate_callchain = false; - perf_evsel__reset_sample_bit(evsel, CALLCHAIN); + evsel__reset_sample_bit(evsel, CALLCHAIN); setup_sorting(NULL); callchain_register_param(&callchain_param); @@ -427,7 +427,7 @@ static int test2(struct evsel *evsel, struct machine *machine) symbol_conf.use_callchain = true; symbol_conf.cumulate_callchain = false; - perf_evsel__set_sample_bit(evsel, CALLCHAIN); + evsel__set_sample_bit(evsel, CALLCHAIN); setup_sorting(NULL); callchain_register_param(&callchain_param); @@ -485,7 +485,7 @@ static int test3(struct evsel *evsel, struct machine *machine) symbol_conf.use_callchain = false; symbol_conf.cumulate_callchain = true; - perf_evsel__reset_sample_bit(evsel, CALLCHAIN); + evsel__reset_sample_bit(evsel, CALLCHAIN); setup_sorting(NULL); callchain_register_param(&callchain_param); @@ -669,7 +669,7 @@ static int test4(struct evsel *evsel, struct machine *machine) symbol_conf.use_callchain = true; symbol_conf.cumulate_callchain = true; - perf_evsel__set_sample_bit(evsel, CALLCHAIN); + evsel__set_sample_bit(evsel, CALLCHAIN); setup_sorting(NULL); diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index e9c0c6498704..d4b8eb6e337a 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -86,7 +86,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse } evsels[i]->core.attr.wakeup_events = 1; - perf_evsel__set_sample_id(evsels[i], false); + evsel__set_sample_id(evsels[i], false); evlist__add(evlist, evsels[i]); diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index 2195fc205e72..83adfd846ccd 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c @@ -106,9 +106,9 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus * Config the evsels, setting attr->comm on the first one, etc. */ evsel = evlist__first(evlist); - perf_evsel__set_sample_bit(evsel, CPU); - perf_evsel__set_sample_bit(evsel, TID); - perf_evsel__set_sample_bit(evsel, TIME); + evsel__set_sample_bit(evsel, CPU); + evsel__set_sample_bit(evsel, TID); + evsel__set_sample_bit(evsel, TIME); perf_evlist__config(evlist, &opts, NULL); err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask); diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index fcb0d03dba4e..b08c8a0898d3 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -394,8 +394,8 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ switch_evsel = evlist__last(evlist); - perf_evsel__set_sample_bit(switch_evsel, CPU); - perf_evsel__set_sample_bit(switch_evsel, TIME); + evsel__set_sample_bit(switch_evsel, CPU); + evsel__set_sample_bit(switch_evsel, TIME); switch_evsel->core.system_wide = true; switch_evsel->no_aux_samples = true; @@ -412,8 +412,8 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ goto out_err; } - perf_evsel__set_sample_bit(cycles_evsel, CPU); - perf_evsel__set_sample_bit(cycles_evsel, TIME); + evsel__set_sample_bit(cycles_evsel, CPU); + evsel__set_sample_bit(cycles_evsel, TIME); /* Fourth event */ err = parse_events(evlist, "dummy:u", NULL); @@ -429,7 +429,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ tracking_evsel->core.attr.freq = 0; tracking_evsel->core.attr.sample_period = 1; - perf_evsel__set_sample_bit(tracking_evsel, TIME); + evsel__set_sample_bit(tracking_evsel, TIME); /* Config events */ perf_evlist__config(evlist, &opts, NULL); diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index bd27f73b6d60..e12696fe6f65 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -705,10 +705,10 @@ static int auxtrace_validate_aux_sample_size(struct evlist *evlist, pr_err("Cannot add AUX area sampling because group leader is not an AUX area event\n"); return -EINVAL; } - perf_evsel__set_sample_bit(evsel, AUX); + evsel__set_sample_bit(evsel, AUX); opts->auxtrace_sample_mode = true; } else { - perf_evsel__reset_sample_bit(evsel, AUX); + evsel__reset_sample_bit(evsel, AUX); } } diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 8b691151bae3..58228a54ecd7 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -948,7 +948,7 @@ void __perf_evlist__set_sample_bit(struct evlist *evlist, struct evsel *evsel; evlist__for_each_entry(evlist, evsel) - __perf_evsel__set_sample_bit(evsel, bit); + __evsel__set_sample_bit(evsel, bit); } void __perf_evlist__reset_sample_bit(struct evlist *evlist, @@ -957,7 +957,7 @@ void __perf_evlist__reset_sample_bit(struct evlist *evlist, struct evsel *evsel; evlist__for_each_entry(evlist, evsel) - __perf_evsel__reset_sample_bit(evsel, bit); + __evsel__reset_sample_bit(evsel, bit); } int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 9b3db6d34d37..4f03500253e3 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -184,7 +184,7 @@ void evsel__calc_id_pos(struct evsel *evsel) evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); } -void __perf_evsel__set_sample_bit(struct evsel *evsel, +void __evsel__set_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit) { if (!(evsel->core.attr.sample_type & bit)) { @@ -194,7 +194,7 @@ void __perf_evsel__set_sample_bit(struct evsel *evsel, } } -void __perf_evsel__reset_sample_bit(struct evsel *evsel, +void __evsel__reset_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit) { if (evsel->core.attr.sample_type & bit) { @@ -204,14 +204,14 @@ void __perf_evsel__reset_sample_bit(struct evsel *evsel, } } -void perf_evsel__set_sample_id(struct evsel *evsel, +void evsel__set_sample_id(struct evsel *evsel, bool can_sample_identifier) { if (can_sample_identifier) { - perf_evsel__reset_sample_bit(evsel, ID); - perf_evsel__set_sample_bit(evsel, IDENTIFIER); + evsel__reset_sample_bit(evsel, ID); + evsel__set_sample_bit(evsel, IDENTIFIER); } else { - perf_evsel__set_sample_bit(evsel, ID); + evsel__set_sample_bit(evsel, ID); } evsel->core.attr.read_format |= PERF_FORMAT_ID; } @@ -689,7 +689,7 @@ static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *o bool function = perf_evsel__is_function_event(evsel); struct perf_event_attr *attr = &evsel->core.attr; - perf_evsel__set_sample_bit(evsel, CALLCHAIN); + evsel__set_sample_bit(evsel, CALLCHAIN); attr->sample_max_stack = param->max_stack; @@ -704,7 +704,7 @@ static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *o "to get user callchain information. " "Falling back to framepointers.\n"); } else { - perf_evsel__set_sample_bit(evsel, BRANCH_STACK); + evsel__set_sample_bit(evsel, BRANCH_STACK); attr->branch_sample_type = PERF_SAMPLE_BRANCH_USER | PERF_SAMPLE_BRANCH_CALL_STACK | PERF_SAMPLE_BRANCH_NO_CYCLES | @@ -718,8 +718,8 @@ static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *o if (param->record_mode == CALLCHAIN_DWARF) { if (!function) { - perf_evsel__set_sample_bit(evsel, REGS_USER); - perf_evsel__set_sample_bit(evsel, STACK_USER); + evsel__set_sample_bit(evsel, REGS_USER); + evsel__set_sample_bit(evsel, STACK_USER); if (opts->sample_user_regs && DWARF_MINIMAL_REGS != PERF_REGS_MASK) { attr->sample_regs_user |= DWARF_MINIMAL_REGS; pr_warning("WARNING: The use of --call-graph=dwarf may require all the user registers, " @@ -755,16 +755,16 @@ perf_evsel__reset_callgraph(struct evsel *evsel, { struct perf_event_attr *attr = &evsel->core.attr; - perf_evsel__reset_sample_bit(evsel, CALLCHAIN); + evsel__reset_sample_bit(evsel, CALLCHAIN); if (param->record_mode == CALLCHAIN_LBR) { - perf_evsel__reset_sample_bit(evsel, BRANCH_STACK); + evsel__reset_sample_bit(evsel, BRANCH_STACK); attr->branch_sample_type &= ~(PERF_SAMPLE_BRANCH_USER | PERF_SAMPLE_BRANCH_CALL_STACK | PERF_SAMPLE_BRANCH_HW_INDEX); } if (param->record_mode == CALLCHAIN_DWARF) { - perf_evsel__reset_sample_bit(evsel, REGS_USER); - perf_evsel__reset_sample_bit(evsel, STACK_USER); + evsel__reset_sample_bit(evsel, REGS_USER); + evsel__reset_sample_bit(evsel, STACK_USER); } } @@ -788,32 +788,32 @@ static void apply_config_terms(struct evsel *evsel, if (!(term->weak && opts->user_interval != ULLONG_MAX)) { attr->sample_period = term->val.period; attr->freq = 0; - perf_evsel__reset_sample_bit(evsel, PERIOD); + evsel__reset_sample_bit(evsel, PERIOD); } break; case PERF_EVSEL__CONFIG_TERM_FREQ: if (!(term->weak && opts->user_freq != UINT_MAX)) { attr->sample_freq = term->val.freq; attr->freq = 1; - perf_evsel__set_sample_bit(evsel, PERIOD); + evsel__set_sample_bit(evsel, PERIOD); } break; case PERF_EVSEL__CONFIG_TERM_TIME: if (term->val.time) - perf_evsel__set_sample_bit(evsel, TIME); + evsel__set_sample_bit(evsel, TIME); else - perf_evsel__reset_sample_bit(evsel, TIME); + evsel__reset_sample_bit(evsel, TIME); break; case PERF_EVSEL__CONFIG_TERM_CALLGRAPH: callgraph_buf = term->val.str; break; case PERF_EVSEL__CONFIG_TERM_BRANCH: if (term->val.str && strcmp(term->val.str, "no")) { - perf_evsel__set_sample_bit(evsel, BRANCH_STACK); + evsel__set_sample_bit(evsel, BRANCH_STACK); parse_branch_str(term->val.str, &attr->branch_sample_type); } else - perf_evsel__reset_sample_bit(evsel, BRANCH_STACK); + evsel__reset_sample_bit(evsel, BRANCH_STACK); break; case PERF_EVSEL__CONFIG_TERM_STACK_USER: dump_size = term->val.stack_user; @@ -892,8 +892,8 @@ static void apply_config_terms(struct evsel *evsel, /* set perf-event callgraph */ if (param.enabled) { if (sample_address) { - perf_evsel__set_sample_bit(evsel, ADDR); - perf_evsel__set_sample_bit(evsel, DATA_SRC); + evsel__set_sample_bit(evsel, ADDR); + evsel__set_sample_bit(evsel, DATA_SRC); evsel->core.attr.mmap_data = track; } evsel__config_callchain(evsel, opts, ¶m); @@ -960,17 +960,17 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, attr->inherit = !opts->no_inherit; attr->write_backward = opts->overwrite ? 1 : 0; - perf_evsel__set_sample_bit(evsel, IP); - perf_evsel__set_sample_bit(evsel, TID); + evsel__set_sample_bit(evsel, IP); + evsel__set_sample_bit(evsel, TID); if (evsel->sample_read) { - perf_evsel__set_sample_bit(evsel, READ); + evsel__set_sample_bit(evsel, READ); /* * We need ID even in case of single event, because * PERF_SAMPLE_READ process ID specific data. */ - perf_evsel__set_sample_id(evsel, false); + evsel__set_sample_id(evsel, false); /* * Apply group format only if we belong to group @@ -989,7 +989,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, if (!attr->sample_period || (opts->user_freq != UINT_MAX || opts->user_interval != ULLONG_MAX)) { if (opts->freq) { - perf_evsel__set_sample_bit(evsel, PERIOD); + evsel__set_sample_bit(evsel, PERIOD); attr->freq = 1; attr->sample_freq = opts->freq; } else { @@ -1009,7 +1009,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, } if (opts->sample_address) { - perf_evsel__set_sample_bit(evsel, ADDR); + evsel__set_sample_bit(evsel, ADDR); attr->mmap_data = track; } @@ -1026,16 +1026,16 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, if (opts->sample_intr_regs) { attr->sample_regs_intr = opts->sample_intr_regs; - perf_evsel__set_sample_bit(evsel, REGS_INTR); + evsel__set_sample_bit(evsel, REGS_INTR); } if (opts->sample_user_regs) { attr->sample_regs_user |= opts->sample_user_regs; - perf_evsel__set_sample_bit(evsel, REGS_USER); + evsel__set_sample_bit(evsel, REGS_USER); } if (target__has_cpu(&opts->target) || opts->sample_cpu) - perf_evsel__set_sample_bit(evsel, CPU); + evsel__set_sample_bit(evsel, CPU); /* * When the user explicitly disabled time don't force it here. @@ -1044,31 +1044,31 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, (!perf_missing_features.sample_id_all && (!opts->no_inherit || target__has_cpu(&opts->target) || per_cpu || opts->sample_time_set))) - perf_evsel__set_sample_bit(evsel, TIME); + evsel__set_sample_bit(evsel, TIME); if (opts->raw_samples && !evsel->no_aux_samples) { - perf_evsel__set_sample_bit(evsel, TIME); - perf_evsel__set_sample_bit(evsel, RAW); - perf_evsel__set_sample_bit(evsel, CPU); + evsel__set_sample_bit(evsel, TIME); + evsel__set_sample_bit(evsel, RAW); + evsel__set_sample_bit(evsel, CPU); } if (opts->sample_address) - perf_evsel__set_sample_bit(evsel, DATA_SRC); + evsel__set_sample_bit(evsel, DATA_SRC); if (opts->sample_phys_addr) - perf_evsel__set_sample_bit(evsel, PHYS_ADDR); + evsel__set_sample_bit(evsel, PHYS_ADDR); if (opts->no_buffering) { attr->watermark = 0; attr->wakeup_events = 1; } if (opts->branch_stack && !evsel->no_aux_samples) { - perf_evsel__set_sample_bit(evsel, BRANCH_STACK); + evsel__set_sample_bit(evsel, BRANCH_STACK); attr->branch_sample_type = opts->branch_stack; } if (opts->sample_weight) - perf_evsel__set_sample_bit(evsel, WEIGHT); + evsel__set_sample_bit(evsel, WEIGHT); attr->task = track; attr->mmap = track; @@ -1082,14 +1082,14 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, if (opts->record_cgroup) { attr->cgroup = track && !perf_missing_features.cgroup; - perf_evsel__set_sample_bit(evsel, CGROUP); + evsel__set_sample_bit(evsel, CGROUP); } if (opts->record_switch_events) attr->context_switch = track; if (opts->sample_transaction) - perf_evsel__set_sample_bit(evsel, TRANSACTION); + evsel__set_sample_bit(evsel, TRANSACTION); if (opts->running_time) { evsel->core.attr.read_format |= @@ -1152,9 +1152,9 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, /* The --period option takes the precedence. */ if (opts->period_set) { if (opts->period) - perf_evsel__set_sample_bit(evsel, PERIOD); + evsel__set_sample_bit(evsel, PERIOD); else - perf_evsel__reset_sample_bit(evsel, PERIOD); + evsel__reset_sample_bit(evsel, PERIOD); } /* @@ -1163,7 +1163,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, * if BRANCH_STACK bit is set. */ if (opts->initial_delay && is_dummy_event(evsel)) - perf_evsel__reset_sample_bit(evsel, BRANCH_STACK); + evsel__reset_sample_bit(evsel, BRANCH_STACK); } int perf_evsel__set_filter(struct evsel *evsel, const char *filter) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 82d2d308fa33..ecd3ea89e12c 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -214,19 +214,16 @@ const char *evsel__name(struct evsel *evsel); const char *evsel__group_name(struct evsel *evsel); int evsel__group_desc(struct evsel *evsel, char *buf, size_t size); -void __perf_evsel__set_sample_bit(struct evsel *evsel, - enum perf_event_sample_format bit); -void __perf_evsel__reset_sample_bit(struct evsel *evsel, - enum perf_event_sample_format bit); +void __evsel__set_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit); +void __evsel__reset_sample_bit(struct evsel *evsel, enum perf_event_sample_format bit); -#define perf_evsel__set_sample_bit(evsel, bit) \ - __perf_evsel__set_sample_bit(evsel, PERF_SAMPLE_##bit) +#define evsel__set_sample_bit(evsel, bit) \ + __evsel__set_sample_bit(evsel, PERF_SAMPLE_##bit) -#define perf_evsel__reset_sample_bit(evsel, bit) \ - __perf_evsel__reset_sample_bit(evsel, PERF_SAMPLE_##bit) +#define evsel__reset_sample_bit(evsel, bit) \ + __evsel__reset_sample_bit(evsel, PERF_SAMPLE_##bit) -void perf_evsel__set_sample_id(struct evsel *evsel, - bool use_sample_identifier); +void evsel__set_sample_id(struct evsel *evsel, bool use_sample_identifier); int perf_evsel__set_filter(struct evsel *evsel, const char *filter); int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter); diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 18ce2cda462a..d297f4de253c 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -123,7 +123,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, if (sample_id) { evlist__for_each_entry(evlist, evsel) - perf_evsel__set_sample_id(evsel, use_sample_identifier); + evsel__set_sample_id(evsel, use_sample_identifier); } perf_evlist__set_id_pos(evlist); diff --git a/tools/perf/util/sideband_evlist.c b/tools/perf/util/sideband_evlist.c index bb3706fbcc0c..1580a3cbec2d 100644 --- a/tools/perf/util/sideband_evlist.c +++ b/tools/perf/util/sideband_evlist.c @@ -108,7 +108,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist, struct target *target) bool can_sample_identifier = perf_can_sample_identifier(); evlist__for_each_entry(evlist, counter) - perf_evsel__set_sample_id(counter, can_sample_identifier); + evsel__set_sample_id(counter, can_sample_identifier); perf_evlist__set_id_pos(evlist); } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 60/91] perf evsel: Rename perf_evsel__*filter*() to evsel__*filter*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (58 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 59/91] perf evsel: Rename *perf_evsel__*set_sample_*() to *evsel__*set_sample_*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 61/91] perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*() Arnaldo Carvalho de Melo ` (30 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-trace.c | 7 +++---- tools/perf/util/auxtrace.c | 6 +++--- tools/perf/util/evlist.c | 4 ++-- tools/perf/util/evsel.c | 15 +++++++-------- tools/perf/util/evsel.h | 7 +++---- tools/perf/util/parse-events.c | 6 +++--- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 1411e2735855..12b770abb87a 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -3164,10 +3164,9 @@ static int trace__set_ev_qualifier_tp_filter(struct trace *trace) if (filter == NULL) goto out_enomem; - if (!perf_evsel__append_tp_filter(trace->syscalls.events.sys_enter, - filter)) { + if (!evsel__append_tp_filter(trace->syscalls.events.sys_enter, filter)) { sys_exit = trace->syscalls.events.sys_exit; - err = perf_evsel__append_tp_filter(sys_exit, filter); + err = evsel__append_tp_filter(sys_exit, filter); } free(filter); @@ -3801,7 +3800,7 @@ static int trace__expand_filter(struct trace *trace __maybe_unused, struct evsel if (new_filter != evsel->filter) { pr_debug("New filter for %s: %s\n", evsel->name, new_filter); - perf_evsel__set_filter(evsel, new_filter); + evsel__set_filter(evsel, new_filter); free(new_filter); } diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index e12696fe6f65..c22ef2e3e079 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -2522,7 +2522,7 @@ static int parse_addr_filter(struct evsel *evsel, const char *filter, goto out_exit; } - if (perf_evsel__append_addr_filter(evsel, new_filter)) { + if (evsel__append_addr_filter(evsel, new_filter)) { err = -ENOMEM; goto out_exit; } @@ -2540,7 +2540,7 @@ static int parse_addr_filter(struct evsel *evsel, const char *filter, return err; } -static int perf_evsel__nr_addr_filter(struct evsel *evsel) +static int evsel__nr_addr_filter(struct evsel *evsel) { struct perf_pmu *pmu = evsel__find_pmu(evsel); int nr_addr_filters = 0; @@ -2561,7 +2561,7 @@ int auxtrace_parse_filters(struct evlist *evlist) evlist__for_each_entry(evlist, evsel) { filter = evsel->filter; - max_nr = perf_evsel__nr_addr_filter(evsel); + max_nr = evsel__nr_addr_filter(evsel); if (!filter || !max_nr) continue; evsel->filter = NULL; diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 58228a54ecd7..410cd834c39a 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -995,7 +995,7 @@ int perf_evlist__set_tp_filter(struct evlist *evlist, const char *filter) if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) continue; - err = perf_evsel__set_filter(evsel, filter); + err = evsel__set_filter(evsel, filter); if (err) break; } @@ -1015,7 +1015,7 @@ int perf_evlist__append_tp_filter(struct evlist *evlist, const char *filter) if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) continue; - err = perf_evsel__append_tp_filter(evsel, filter); + err = evsel__append_tp_filter(evsel, filter); if (err) break; } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4f03500253e3..4f271764cbf2 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1166,7 +1166,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, evsel__reset_sample_bit(evsel, BRANCH_STACK); } -int perf_evsel__set_filter(struct evsel *evsel, const char *filter) +int evsel__set_filter(struct evsel *evsel, const char *filter) { char *new_filter = strdup(filter); @@ -1179,13 +1179,12 @@ int perf_evsel__set_filter(struct evsel *evsel, const char *filter) return -1; } -static int perf_evsel__append_filter(struct evsel *evsel, - const char *fmt, const char *filter) +static int evsel__append_filter(struct evsel *evsel, const char *fmt, const char *filter) { char *new_filter; if (evsel->filter == NULL) - return perf_evsel__set_filter(evsel, filter); + return evsel__set_filter(evsel, filter); if (asprintf(&new_filter, fmt, evsel->filter, filter) > 0) { free(evsel->filter); @@ -1196,14 +1195,14 @@ static int perf_evsel__append_filter(struct evsel *evsel, return -1; } -int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter) +int evsel__append_tp_filter(struct evsel *evsel, const char *filter) { - return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter); + return evsel__append_filter(evsel, "(%s) && (%s)", filter); } -int perf_evsel__append_addr_filter(struct evsel *evsel, const char *filter) +int evsel__append_addr_filter(struct evsel *evsel, const char *filter) { - return perf_evsel__append_filter(evsel, "%s,%s", filter); + return evsel__append_filter(evsel, "%s,%s", filter); } /* Caller has to clear disabled after going through all CPUs. */ diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index ecd3ea89e12c..df64d89cd916 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -225,10 +225,9 @@ void __evsel__reset_sample_bit(struct evsel *evsel, enum perf_event_sample_forma void evsel__set_sample_id(struct evsel *evsel, bool use_sample_identifier); -int perf_evsel__set_filter(struct evsel *evsel, const char *filter); -int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter); -int perf_evsel__append_addr_filter(struct evsel *evsel, - const char *filter); +int evsel__set_filter(struct evsel *evsel, const char *filter); +int evsel__append_tp_filter(struct evsel *evsel, const char *filter); +int evsel__append_addr_filter(struct evsel *evsel, const char *filter); int evsel__enable_cpu(struct evsel *evsel, int cpu); int evsel__enable(struct evsel *evsel); int evsel__disable(struct evsel *evsel); diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 2252f494ff9f..899ced466197 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2261,7 +2261,7 @@ static int set_filter(struct evsel *evsel, const void *arg) } if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) { - if (perf_evsel__append_tp_filter(evsel, str) < 0) { + if (evsel__append_tp_filter(evsel, str) < 0) { fprintf(stderr, "not enough memory to hold filter string\n"); return -1; @@ -2286,7 +2286,7 @@ static int set_filter(struct evsel *evsel, const void *arg) return -1; } - if (perf_evsel__append_addr_filter(evsel, str) < 0) { + if (evsel__append_addr_filter(evsel, str) < 0) { fprintf(stderr, "not enough memory to hold filter string\n"); return -1; @@ -2317,7 +2317,7 @@ static int add_exclude_perf_filter(struct evsel *evsel, snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid()); - if (perf_evsel__append_tp_filter(evsel, new_filter) < 0) { + if (evsel__append_tp_filter(evsel, new_filter) < 0) { fprintf(stderr, "not enough memory to hold filter string\n"); return -1; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 61/91] perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (59 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 60/91] perf evsel: Rename perf_evsel__*filter*() to evsel__*filter*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 62/91] perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*() Arnaldo Carvalho de Melo ` (29 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/event-times.c | 8 ++++---- tools/perf/tests/openat-syscall.c | 2 +- tools/perf/util/evsel.c | 7 ++----- tools/perf/util/evsel.h | 7 ++----- tools/perf/util/stat.c | 4 ++-- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c index 1e8a9f5c356d..db68894a6f40 100644 --- a/tools/perf/tests/event-times.c +++ b/tools/perf/tests/event-times.c @@ -72,7 +72,7 @@ static int attach__current_disabled(struct evlist *evlist) evsel->core.attr.disabled = 1; - err = perf_evsel__open_per_thread(evsel, threads); + err = evsel__open_per_thread(evsel, threads); if (err) { pr_debug("Failed to open event cpu-clock:u\n"); return err; @@ -96,7 +96,7 @@ static int attach__current_enabled(struct evlist *evlist) return -1; } - err = perf_evsel__open_per_thread(evsel, threads); + err = evsel__open_per_thread(evsel, threads); perf_thread_map__put(threads); return err == 0 ? TEST_OK : TEST_FAIL; @@ -125,7 +125,7 @@ static int attach__cpu_disabled(struct evlist *evlist) evsel->core.attr.disabled = 1; - err = perf_evsel__open_per_cpu(evsel, cpus, -1); + err = evsel__open_per_cpu(evsel, cpus, -1); if (err) { if (err == -EACCES) return TEST_SKIP; @@ -152,7 +152,7 @@ static int attach__cpu_enabled(struct evlist *evlist) return -1; } - err = perf_evsel__open_per_cpu(evsel, cpus, -1); + err = evsel__open_per_cpu(evsel, cpus, -1); if (err == -EACCES) return TEST_SKIP; diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c index 5ebffae18605..8497a1fe9bac 100644 --- a/tools/perf/tests/openat-syscall.c +++ b/tools/perf/tests/openat-syscall.c @@ -34,7 +34,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m goto out_thread_map_delete; } - if (perf_evsel__open_per_thread(evsel, threads) < 0) { + if (evsel__open_per_thread(evsel, threads) < 0) { pr_debug("failed to open counter: %s, " "tweak /proc/sys/kernel/perf_event_paranoid?\n", str_error_r(errno, sbuf, sizeof(sbuf))); diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4f271764cbf2..bbd57e8fde7d 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1863,9 +1863,7 @@ void evsel__close(struct evsel *evsel) perf_evsel__free_id(&evsel->core); } -int perf_evsel__open_per_cpu(struct evsel *evsel, - struct perf_cpu_map *cpus, - int cpu) +int evsel__open_per_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, int cpu) { if (cpu == -1) return evsel__open_cpu(evsel, cpus, NULL, 0, @@ -1874,8 +1872,7 @@ int perf_evsel__open_per_cpu(struct evsel *evsel, return evsel__open_cpu(evsel, cpus, NULL, cpu, cpu + 1); } -int perf_evsel__open_per_thread(struct evsel *evsel, - struct perf_thread_map *threads) +int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads) { return evsel__open(evsel, NULL, threads); } diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index df64d89cd916..e16a9b23556b 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -233,11 +233,8 @@ int evsel__enable(struct evsel *evsel); int evsel__disable(struct evsel *evsel); int evsel__disable_cpu(struct evsel *evsel, int cpu); -int perf_evsel__open_per_cpu(struct evsel *evsel, - struct perf_cpu_map *cpus, - int cpu); -int perf_evsel__open_per_thread(struct evsel *evsel, - struct perf_thread_map *threads); +int evsel__open_per_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, int cpu); +int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads); int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads); void evsel__close(struct evsel *evsel); diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index c27f01b944c5..3520b7443615 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -521,7 +521,7 @@ int create_perf_stat_counter(struct evsel *evsel, } if (target__has_cpu(target) && !target__has_per_thread(target)) - return perf_evsel__open_per_cpu(evsel, evsel__cpus(evsel), cpu); + return evsel__open_per_cpu(evsel, evsel__cpus(evsel), cpu); - return perf_evsel__open_per_thread(evsel, evsel->core.threads); + return evsel__open_per_thread(evsel, evsel->core.threads); } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 62/91] perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (60 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 61/91] perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 63/91] perf mem2node: Avoid double free related to realloc Arnaldo Carvalho de Melo ` (28 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are not 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/arch/powerpc/util/kvm-stat.c | 2 +- tools/perf/arch/s390/util/kvm-stat.c | 8 +-- tools/perf/arch/x86/util/kvm-stat.c | 12 ++--- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kmem.c | 30 +++++------ tools/perf/builtin-kvm.c | 5 +- tools/perf/builtin-lock.c | 20 ++++---- tools/perf/builtin-sched.c | 57 ++++++++++----------- tools/perf/builtin-timechart.c | 52 +++++++++---------- tools/perf/builtin-trace.c | 20 ++++---- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/tests/openat-syscall-tp-fields.c | 2 +- tools/perf/tests/switch-tracking.c | 4 +- tools/perf/util/evsel.c | 12 ++--- tools/perf/util/evsel.h | 16 +++--- tools/perf/util/intel-pt.c | 2 +- 16 files changed, 119 insertions(+), 127 deletions(-) diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools/perf/arch/powerpc/util/kvm-stat.c index 16807269317c..eed9e5a42935 100644 --- a/tools/perf/arch/powerpc/util/kvm-stat.c +++ b/tools/perf/arch/powerpc/util/kvm-stat.c @@ -39,7 +39,7 @@ static void hcall_event_get_key(struct evsel *evsel, struct event_key *key) { key->info = 0; - key->key = perf_evsel__intval(evsel, sample, "req"); + key->key = evsel__intval(evsel, sample, "req"); } static const char *get_hcall_exit_reason(u64 exit_code) diff --git a/tools/perf/arch/s390/util/kvm-stat.c b/tools/perf/arch/s390/util/kvm-stat.c index 0fd4e9f49ed0..34da89ced29a 100644 --- a/tools/perf/arch/s390/util/kvm-stat.c +++ b/tools/perf/arch/s390/util/kvm-stat.c @@ -30,7 +30,7 @@ static void event_icpt_insn_get_key(struct evsel *evsel, { unsigned long insn; - insn = perf_evsel__intval(evsel, sample, "instruction"); + insn = evsel__intval(evsel, sample, "instruction"); key->key = icpt_insn_decoder(insn); key->exit_reasons = sie_icpt_insn_codes; } @@ -39,7 +39,7 @@ static void event_sigp_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { - key->key = perf_evsel__intval(evsel, sample, "order_code"); + key->key = evsel__intval(evsel, sample, "order_code"); key->exit_reasons = sie_sigp_order_codes; } @@ -47,7 +47,7 @@ static void event_diag_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { - key->key = perf_evsel__intval(evsel, sample, "code"); + key->key = evsel__intval(evsel, sample, "code"); key->exit_reasons = sie_diagnose_codes; } @@ -55,7 +55,7 @@ static void event_icpt_prog_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { - key->key = perf_evsel__intval(evsel, sample, "code"); + key->key = evsel__intval(evsel, sample, "code"); key->exit_reasons = sie_icpt_prog_codes; } diff --git a/tools/perf/arch/x86/util/kvm-stat.c b/tools/perf/arch/x86/util/kvm-stat.c index c0775c39227f..072920475b65 100644 --- a/tools/perf/arch/x86/util/kvm-stat.c +++ b/tools/perf/arch/x86/util/kvm-stat.c @@ -31,8 +31,8 @@ const char *kvm_exit_trace = "kvm:kvm_exit"; static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { - key->key = perf_evsel__intval(evsel, sample, "gpa"); - key->info = perf_evsel__intval(evsel, sample, "type"); + key->key = evsel__intval(evsel, sample, "gpa"); + key->info = evsel__intval(evsel, sample, "type"); } #define KVM_TRACE_MMIO_READ_UNSATISFIED 0 @@ -48,7 +48,7 @@ static bool mmio_event_begin(struct evsel *evsel, /* MMIO write begin event in kernel. */ if (!strcmp(evsel->name, "kvm:kvm_mmio") && - perf_evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { + evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { mmio_event_get_key(evsel, sample, key); return true; } @@ -65,7 +65,7 @@ static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample, /* MMIO read end event in kernel.*/ if (!strcmp(evsel->name, "kvm:kvm_mmio") && - perf_evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_READ) { + evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_READ) { mmio_event_get_key(evsel, sample, key); return true; } @@ -94,8 +94,8 @@ static void ioport_event_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { - key->key = perf_evsel__intval(evsel, sample, "port"); - key->info = perf_evsel__intval(evsel, sample, "rw"); + key->key = evsel__intval(evsel, sample, "port"); + key->info = evsel__intval(evsel, sample, "rw"); } static bool ioport_event_begin(struct evsel *evsel, diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 952df5146d57..842e940523b7 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -536,7 +536,7 @@ static int perf_inject__sched_stat(struct perf_tool *tool, union perf_event *event_sw; struct perf_sample sample_sw; struct perf_inject *inject = container_of(tool, struct perf_inject, tool); - u32 pid = perf_evsel__intval(evsel, sample, "pid"); + u32 pid = evsel__intval(evsel, sample, "pid"); list_for_each_entry(ent, &inject->samples, node) { if (pid == ent->tid) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index f91a050bda11..0a296fbf9194 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -172,10 +172,10 @@ static int insert_caller_stat(unsigned long call_site, static int perf_evsel__process_alloc_event(struct evsel *evsel, struct perf_sample *sample) { - unsigned long ptr = perf_evsel__intval(evsel, sample, "ptr"), - call_site = perf_evsel__intval(evsel, sample, "call_site"); - int bytes_req = perf_evsel__intval(evsel, sample, "bytes_req"), - bytes_alloc = perf_evsel__intval(evsel, sample, "bytes_alloc"); + unsigned long ptr = evsel__intval(evsel, sample, "ptr"), + call_site = evsel__intval(evsel, sample, "call_site"); + int bytes_req = evsel__intval(evsel, sample, "bytes_req"), + bytes_alloc = evsel__intval(evsel, sample, "bytes_alloc"); if (insert_alloc_stat(call_site, ptr, bytes_req, bytes_alloc, sample->cpu) || insert_caller_stat(call_site, bytes_req, bytes_alloc)) @@ -195,7 +195,7 @@ static int perf_evsel__process_alloc_node_event(struct evsel *evsel, if (!ret) { int node1 = cpu__get_node(sample->cpu), - node2 = perf_evsel__intval(evsel, sample, "node"); + node2 = evsel__intval(evsel, sample, "node"); if (node1 != node2) nr_cross_allocs++; @@ -235,7 +235,7 @@ static struct alloc_stat *search_alloc_stat(unsigned long ptr, static int perf_evsel__process_free_event(struct evsel *evsel, struct perf_sample *sample) { - unsigned long ptr = perf_evsel__intval(evsel, sample, "ptr"); + unsigned long ptr = evsel__intval(evsel, sample, "ptr"); struct alloc_stat *s_alloc, *s_caller; s_alloc = search_alloc_stat(ptr, 0, &root_alloc_stat, ptr_cmp); @@ -788,9 +788,9 @@ static int perf_evsel__process_page_alloc_event(struct evsel *evsel, struct perf_sample *sample) { u64 page; - unsigned int order = perf_evsel__intval(evsel, sample, "order"); - unsigned int gfp_flags = perf_evsel__intval(evsel, sample, "gfp_flags"); - unsigned int migrate_type = perf_evsel__intval(evsel, sample, + unsigned int order = evsel__intval(evsel, sample, "order"); + unsigned int gfp_flags = evsel__intval(evsel, sample, "gfp_flags"); + unsigned int migrate_type = evsel__intval(evsel, sample, "migratetype"); u64 bytes = kmem_page_size << order; u64 callsite; @@ -802,9 +802,9 @@ static int perf_evsel__process_page_alloc_event(struct evsel *evsel, }; if (use_pfn) - page = perf_evsel__intval(evsel, sample, "pfn"); + page = evsel__intval(evsel, sample, "pfn"); else - page = perf_evsel__intval(evsel, sample, "page"); + page = evsel__intval(evsel, sample, "page"); nr_page_allocs++; total_page_alloc_bytes += bytes; @@ -861,7 +861,7 @@ static int perf_evsel__process_page_free_event(struct evsel *evsel, struct perf_sample *sample) { u64 page; - unsigned int order = perf_evsel__intval(evsel, sample, "order"); + unsigned int order = evsel__intval(evsel, sample, "order"); u64 bytes = kmem_page_size << order; struct page_stat *pstat; struct page_stat this = { @@ -869,9 +869,9 @@ static int perf_evsel__process_page_free_event(struct evsel *evsel, }; if (use_pfn) - page = perf_evsel__intval(evsel, sample, "pfn"); + page = evsel__intval(evsel, sample, "pfn"); else - page = perf_evsel__intval(evsel, sample, "page"); + page = evsel__intval(evsel, sample, "page"); nr_page_frees++; total_page_free_bytes += bytes; @@ -1392,7 +1392,7 @@ static int __cmd_kmem(struct perf_session *session) evlist__for_each_entry(session->evlist, evsel) { if (!strcmp(evsel__name(evsel), "kmem:mm_page_alloc") && - perf_evsel__field(evsel, "pfn")) { + evsel__field(evsel, "pfn")) { use_pfn = true; break; } diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index ff74a9a0bbaa..95a77058023e 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -69,7 +69,7 @@ void exit_event_get_key(struct evsel *evsel, struct event_key *key) { key->info = 0; - key->key = perf_evsel__intval(evsel, sample, kvm_exit_reason); + key->key = evsel__intval(evsel, sample, kvm_exit_reason); } bool kvm_exit_event(struct evsel *evsel) @@ -416,8 +416,7 @@ struct vcpu_event_record *per_vcpu_record(struct thread *thread, return NULL; } - vcpu_record->vcpu_id = perf_evsel__intval(evsel, sample, - vcpu_id_str); + vcpu_record->vcpu_id = evsel__intval(evsel, sample, vcpu_id_str); thread__set_priv(thread, vcpu_record); } diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 543d82fec556..5a19dc2f1636 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -48,7 +48,7 @@ struct lock_stat { struct rb_node rb; /* used for sorting */ /* - * FIXME: perf_evsel__intval() returns u64, + * FIXME: evsel__intval() returns u64, * so address of lockdep_map should be dealed as 64bit. * Is there more better solution? */ @@ -404,9 +404,9 @@ static int report_lock_acquire_event(struct evsel *evsel, struct lock_stat *ls; struct thread_stat *ts; struct lock_seq_stat *seq; - const char *name = perf_evsel__strval(evsel, sample, "name"); - u64 tmp = perf_evsel__intval(evsel, sample, "lockdep_addr"); - int flag = perf_evsel__intval(evsel, sample, "flag"); + const char *name = evsel__strval(evsel, sample, "name"); + u64 tmp = evsel__intval(evsel, sample, "lockdep_addr"); + int flag = evsel__intval(evsel, sample, "flag"); memcpy(&addr, &tmp, sizeof(void *)); @@ -477,8 +477,8 @@ static int report_lock_acquired_event(struct evsel *evsel, struct thread_stat *ts; struct lock_seq_stat *seq; u64 contended_term; - const char *name = perf_evsel__strval(evsel, sample, "name"); - u64 tmp = perf_evsel__intval(evsel, sample, "lockdep_addr"); + const char *name = evsel__strval(evsel, sample, "name"); + u64 tmp = evsel__intval(evsel, sample, "lockdep_addr"); memcpy(&addr, &tmp, sizeof(void *)); @@ -539,8 +539,8 @@ static int report_lock_contended_event(struct evsel *evsel, struct lock_stat *ls; struct thread_stat *ts; struct lock_seq_stat *seq; - const char *name = perf_evsel__strval(evsel, sample, "name"); - u64 tmp = perf_evsel__intval(evsel, sample, "lockdep_addr"); + const char *name = evsel__strval(evsel, sample, "name"); + u64 tmp = evsel__intval(evsel, sample, "lockdep_addr"); memcpy(&addr, &tmp, sizeof(void *)); @@ -594,8 +594,8 @@ static int report_lock_release_event(struct evsel *evsel, struct lock_stat *ls; struct thread_stat *ts; struct lock_seq_stat *seq; - const char *name = perf_evsel__strval(evsel, sample, "name"); - u64 tmp = perf_evsel__intval(evsel, sample, "lockdep_addr"); + const char *name = evsel__strval(evsel, sample, "name"); + u64 tmp = evsel__intval(evsel, sample, "lockdep_addr"); memcpy(&addr, &tmp, sizeof(void *)); diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 5c005260bf13..b99398031131 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -811,8 +811,8 @@ replay_wakeup_event(struct perf_sched *sched, struct evsel *evsel, struct perf_sample *sample, struct machine *machine __maybe_unused) { - const char *comm = perf_evsel__strval(evsel, sample, "comm"); - const u32 pid = perf_evsel__intval(evsel, sample, "pid"); + const char *comm = evsel__strval(evsel, sample, "comm"); + const u32 pid = evsel__intval(evsel, sample, "pid"); struct task_desc *waker, *wakee; if (verbose > 0) { @@ -833,11 +833,11 @@ static int replay_switch_event(struct perf_sched *sched, struct perf_sample *sample, struct machine *machine __maybe_unused) { - const char *prev_comm = perf_evsel__strval(evsel, sample, "prev_comm"), - *next_comm = perf_evsel__strval(evsel, sample, "next_comm"); - const u32 prev_pid = perf_evsel__intval(evsel, sample, "prev_pid"), - next_pid = perf_evsel__intval(evsel, sample, "next_pid"); - const u64 prev_state = perf_evsel__intval(evsel, sample, "prev_state"); + const char *prev_comm = evsel__strval(evsel, sample, "prev_comm"), + *next_comm = evsel__strval(evsel, sample, "next_comm"); + const u32 prev_pid = evsel__intval(evsel, sample, "prev_pid"), + next_pid = evsel__intval(evsel, sample, "next_pid"); + const u64 prev_state = evsel__intval(evsel, sample, "prev_state"); struct task_desc *prev, __maybe_unused *next; u64 timestamp0, timestamp = sample->time; int cpu = sample->cpu; @@ -1106,9 +1106,9 @@ static int latency_switch_event(struct perf_sched *sched, struct perf_sample *sample, struct machine *machine) { - const u32 prev_pid = perf_evsel__intval(evsel, sample, "prev_pid"), - next_pid = perf_evsel__intval(evsel, sample, "next_pid"); - const u64 prev_state = perf_evsel__intval(evsel, sample, "prev_state"); + const u32 prev_pid = evsel__intval(evsel, sample, "prev_pid"), + next_pid = evsel__intval(evsel, sample, "next_pid"); + const u64 prev_state = evsel__intval(evsel, sample, "prev_state"); struct work_atoms *out_events, *in_events; struct thread *sched_out, *sched_in; u64 timestamp0, timestamp = sample->time; @@ -1176,8 +1176,8 @@ static int latency_runtime_event(struct perf_sched *sched, struct perf_sample *sample, struct machine *machine) { - const u32 pid = perf_evsel__intval(evsel, sample, "pid"); - const u64 runtime = perf_evsel__intval(evsel, sample, "runtime"); + const u32 pid = evsel__intval(evsel, sample, "pid"); + const u64 runtime = evsel__intval(evsel, sample, "runtime"); struct thread *thread = machine__findnew_thread(machine, -1, pid); struct work_atoms *atoms = thread_atoms_search(&sched->atom_root, thread, &sched->cmp_pid); u64 timestamp = sample->time; @@ -1211,7 +1211,7 @@ static int latency_wakeup_event(struct perf_sched *sched, struct perf_sample *sample, struct machine *machine) { - const u32 pid = perf_evsel__intval(evsel, sample, "pid"); + const u32 pid = evsel__intval(evsel, sample, "pid"); struct work_atoms *atoms; struct work_atom *atom; struct thread *wakee; @@ -1272,7 +1272,7 @@ static int latency_migrate_task_event(struct perf_sched *sched, struct perf_sample *sample, struct machine *machine) { - const u32 pid = perf_evsel__intval(evsel, sample, "pid"); + const u32 pid = evsel__intval(evsel, sample, "pid"); u64 timestamp = sample->time; struct work_atoms *atoms; struct work_atom *atom; @@ -1526,7 +1526,7 @@ map__findnew_thread(struct perf_sched *sched, struct machine *machine, pid_t pid static int map_switch_event(struct perf_sched *sched, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { - const u32 next_pid = perf_evsel__intval(evsel, sample, "next_pid"); + const u32 next_pid = evsel__intval(evsel, sample, "next_pid"); struct thread *sched_in; struct thread_runtime *tr; int new_shortname; @@ -1670,8 +1670,8 @@ static int process_sched_switch_event(struct perf_tool *tool, { struct perf_sched *sched = container_of(tool, struct perf_sched, tool); int this_cpu = sample->cpu, err = 0; - u32 prev_pid = perf_evsel__intval(evsel, sample, "prev_pid"), - next_pid = perf_evsel__intval(evsel, sample, "next_pid"); + u32 prev_pid = evsel__intval(evsel, sample, "prev_pid"), + next_pid = evsel__intval(evsel, sample, "next_pid"); if (sched->curr_pid[this_cpu] != (u32)-1) { /* @@ -2004,8 +2004,8 @@ static void timehist_print_sample(struct perf_sched *sched, u64 t, int state) { struct thread_runtime *tr = thread__priv(thread); - const char *next_comm = perf_evsel__strval(evsel, sample, "next_comm"); - const u32 next_pid = perf_evsel__intval(evsel, sample, "next_pid"); + const char *next_comm = evsel__strval(evsel, sample, "next_comm"); + const u32 next_pid = evsel__intval(evsel, sample, "next_pid"); u32 max_cpus = sched->max_cpu + 1; char tstr[64]; char nstr[30]; @@ -2137,7 +2137,7 @@ static bool is_idle_sample(struct perf_sample *sample, { /* pid 0 == swapper == idle task */ if (strcmp(evsel__name(evsel), "sched:sched_switch") == 0) - return perf_evsel__intval(evsel, sample, "prev_pid") == 0; + return evsel__intval(evsel, sample, "prev_pid") == 0; return sample->pid == 0; } @@ -2334,7 +2334,7 @@ static struct thread *timehist_get_thread(struct perf_sched *sched, itr->last_thread = thread; /* copy task callchain when entering to idle */ - if (perf_evsel__intval(evsel, sample, "next_pid") == 0) + if (evsel__intval(evsel, sample, "next_pid") == 0) save_idle_callchain(sched, itr, sample); } } @@ -2357,8 +2357,8 @@ static bool timehist_skip_sample(struct perf_sched *sched, if (sched->idle_hist) { if (strcmp(evsel__name(evsel), "sched:sched_switch")) rc = true; - else if (perf_evsel__intval(evsel, sample, "prev_pid") != 0 && - perf_evsel__intval(evsel, sample, "next_pid") != 0) + else if (evsel__intval(evsel, sample, "prev_pid") != 0 && + evsel__intval(evsel, sample, "next_pid") != 0) rc = true; } @@ -2409,7 +2409,7 @@ static int timehist_sched_wakeup_event(struct perf_tool *tool, struct thread *thread; struct thread_runtime *tr = NULL; /* want pid of awakened task not pid in sample */ - const u32 pid = perf_evsel__intval(evsel, sample, "pid"); + const u32 pid = evsel__intval(evsel, sample, "pid"); thread = machine__findnew_thread(machine, 0, pid); if (thread == NULL) @@ -2445,8 +2445,8 @@ static void timehist_print_migration_event(struct perf_sched *sched, return; max_cpus = sched->max_cpu + 1; - ocpu = perf_evsel__intval(evsel, sample, "orig_cpu"); - dcpu = perf_evsel__intval(evsel, sample, "dest_cpu"); + ocpu = evsel__intval(evsel, sample, "orig_cpu"); + dcpu = evsel__intval(evsel, sample, "dest_cpu"); thread = machine__findnew_thread(machine, sample->pid, sample->tid); if (thread == NULL) @@ -2493,7 +2493,7 @@ static int timehist_migrate_task_event(struct perf_tool *tool, struct thread *thread; struct thread_runtime *tr = NULL; /* want pid of migrated task not pid in sample */ - const u32 pid = perf_evsel__intval(evsel, sample, "pid"); + const u32 pid = evsel__intval(evsel, sample, "pid"); thread = machine__findnew_thread(machine, 0, pid); if (thread == NULL) @@ -2524,8 +2524,7 @@ static int timehist_sched_change_event(struct perf_tool *tool, struct thread_runtime *tr = NULL; u64 tprev, t = sample->time; int rc = 0; - int state = perf_evsel__intval(evsel, sample, "prev_state"); - + int state = evsel__intval(evsel, sample, "prev_state"); if (machine__resolve(machine, &al, sample) < 0) { pr_err("problem processing %d event. skipping it\n", diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 9e84fae9b096..c76f84b174c4 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c @@ -579,8 +579,8 @@ process_sample_cpu_idle(struct timechart *tchart __maybe_unused, struct perf_sample *sample, const char *backtrace __maybe_unused) { - u32 state = perf_evsel__intval(evsel, sample, "state"); - u32 cpu_id = perf_evsel__intval(evsel, sample, "cpu_id"); + u32 state = evsel__intval(evsel, sample, "state"); + u32 cpu_id = evsel__intval(evsel, sample, "cpu_id"); if (state == (u32)PWR_EVENT_EXIT) c_state_end(tchart, cpu_id, sample->time); @@ -595,8 +595,8 @@ process_sample_cpu_frequency(struct timechart *tchart, struct perf_sample *sample, const char *backtrace __maybe_unused) { - u32 state = perf_evsel__intval(evsel, sample, "state"); - u32 cpu_id = perf_evsel__intval(evsel, sample, "cpu_id"); + u32 state = evsel__intval(evsel, sample, "state"); + u32 cpu_id = evsel__intval(evsel, sample, "cpu_id"); p_state_change(tchart, cpu_id, sample->time, state); return 0; @@ -608,9 +608,9 @@ process_sample_sched_wakeup(struct timechart *tchart, struct perf_sample *sample, const char *backtrace) { - u8 flags = perf_evsel__intval(evsel, sample, "common_flags"); - int waker = perf_evsel__intval(evsel, sample, "common_pid"); - int wakee = perf_evsel__intval(evsel, sample, "pid"); + u8 flags = evsel__intval(evsel, sample, "common_flags"); + int waker = evsel__intval(evsel, sample, "common_pid"); + int wakee = evsel__intval(evsel, sample, "pid"); sched_wakeup(tchart, sample->cpu, sample->time, waker, wakee, flags, backtrace); return 0; @@ -622,9 +622,9 @@ process_sample_sched_switch(struct timechart *tchart, struct perf_sample *sample, const char *backtrace) { - int prev_pid = perf_evsel__intval(evsel, sample, "prev_pid"); - int next_pid = perf_evsel__intval(evsel, sample, "next_pid"); - u64 prev_state = perf_evsel__intval(evsel, sample, "prev_state"); + int prev_pid = evsel__intval(evsel, sample, "prev_pid"); + int next_pid = evsel__intval(evsel, sample, "next_pid"); + u64 prev_state = evsel__intval(evsel, sample, "prev_state"); sched_switch(tchart, sample->cpu, sample->time, prev_pid, next_pid, prev_state, backtrace); @@ -638,8 +638,8 @@ process_sample_power_start(struct timechart *tchart __maybe_unused, struct perf_sample *sample, const char *backtrace __maybe_unused) { - u64 cpu_id = perf_evsel__intval(evsel, sample, "cpu_id"); - u64 value = perf_evsel__intval(evsel, sample, "value"); + u64 cpu_id = evsel__intval(evsel, sample, "cpu_id"); + u64 value = evsel__intval(evsel, sample, "value"); c_state_start(cpu_id, sample->time, value); return 0; @@ -661,8 +661,8 @@ process_sample_power_frequency(struct timechart *tchart, struct perf_sample *sample, const char *backtrace __maybe_unused) { - u64 cpu_id = perf_evsel__intval(evsel, sample, "cpu_id"); - u64 value = perf_evsel__intval(evsel, sample, "value"); + u64 cpu_id = evsel__intval(evsel, sample, "cpu_id"); + u64 value = evsel__intval(evsel, sample, "value"); p_state_change(tchart, cpu_id, sample->time, value); return 0; @@ -843,7 +843,7 @@ process_enter_read(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long fd = perf_evsel__intval(evsel, sample, "fd"); + long fd = evsel__intval(evsel, sample, "fd"); return pid_begin_io_sample(tchart, sample->tid, IOTYPE_READ, sample->time, fd); } @@ -853,7 +853,7 @@ process_exit_read(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long ret = perf_evsel__intval(evsel, sample, "ret"); + long ret = evsel__intval(evsel, sample, "ret"); return pid_end_io_sample(tchart, sample->tid, IOTYPE_READ, sample->time, ret); } @@ -863,7 +863,7 @@ process_enter_write(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long fd = perf_evsel__intval(evsel, sample, "fd"); + long fd = evsel__intval(evsel, sample, "fd"); return pid_begin_io_sample(tchart, sample->tid, IOTYPE_WRITE, sample->time, fd); } @@ -873,7 +873,7 @@ process_exit_write(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long ret = perf_evsel__intval(evsel, sample, "ret"); + long ret = evsel__intval(evsel, sample, "ret"); return pid_end_io_sample(tchart, sample->tid, IOTYPE_WRITE, sample->time, ret); } @@ -883,7 +883,7 @@ process_enter_sync(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long fd = perf_evsel__intval(evsel, sample, "fd"); + long fd = evsel__intval(evsel, sample, "fd"); return pid_begin_io_sample(tchart, sample->tid, IOTYPE_SYNC, sample->time, fd); } @@ -893,7 +893,7 @@ process_exit_sync(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long ret = perf_evsel__intval(evsel, sample, "ret"); + long ret = evsel__intval(evsel, sample, "ret"); return pid_end_io_sample(tchart, sample->tid, IOTYPE_SYNC, sample->time, ret); } @@ -903,7 +903,7 @@ process_enter_tx(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long fd = perf_evsel__intval(evsel, sample, "fd"); + long fd = evsel__intval(evsel, sample, "fd"); return pid_begin_io_sample(tchart, sample->tid, IOTYPE_TX, sample->time, fd); } @@ -913,7 +913,7 @@ process_exit_tx(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long ret = perf_evsel__intval(evsel, sample, "ret"); + long ret = evsel__intval(evsel, sample, "ret"); return pid_end_io_sample(tchart, sample->tid, IOTYPE_TX, sample->time, ret); } @@ -923,7 +923,7 @@ process_enter_rx(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long fd = perf_evsel__intval(evsel, sample, "fd"); + long fd = evsel__intval(evsel, sample, "fd"); return pid_begin_io_sample(tchart, sample->tid, IOTYPE_RX, sample->time, fd); } @@ -933,7 +933,7 @@ process_exit_rx(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long ret = perf_evsel__intval(evsel, sample, "ret"); + long ret = evsel__intval(evsel, sample, "ret"); return pid_end_io_sample(tchart, sample->tid, IOTYPE_RX, sample->time, ret); } @@ -943,7 +943,7 @@ process_enter_poll(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long fd = perf_evsel__intval(evsel, sample, "fd"); + long fd = evsel__intval(evsel, sample, "fd"); return pid_begin_io_sample(tchart, sample->tid, IOTYPE_POLL, sample->time, fd); } @@ -953,7 +953,7 @@ process_exit_poll(struct timechart *tchart, struct evsel *evsel, struct perf_sample *sample) { - long ret = perf_evsel__intval(evsel, sample, "ret"); + long ret = evsel__intval(evsel, sample, "ret"); return pid_end_io_sample(tchart, sample->tid, IOTYPE_POLL, sample->time, ret); } diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 12b770abb87a..871d43d68a1b 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -370,7 +370,7 @@ static int perf_evsel__init_tp_uint_field(struct evsel *evsel, struct tp_field *field, const char *name) { - struct tep_format_field *format_field = perf_evsel__field(evsel, name); + struct tep_format_field *format_field = evsel__field(evsel, name); if (format_field == NULL) return -1; @@ -386,7 +386,7 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel, struct tp_field *field, const char *name) { - struct tep_format_field *format_field = perf_evsel__field(evsel, name); + struct tep_format_field *format_field = evsel__field(evsel, name); if (format_field == NULL) return -1; @@ -423,9 +423,9 @@ static int perf_evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evs struct syscall_tp *sc = evsel__syscall_tp(evsel); if (sc != NULL) { - struct tep_format_field *syscall_id = perf_evsel__field(tp, "id"); + struct tep_format_field *syscall_id = evsel__field(tp, "id"); if (syscall_id == NULL) - syscall_id = perf_evsel__field(tp, "__syscall_nr"); + syscall_id = evsel__field(tp, "__syscall_nr"); if (syscall_id == NULL || __tp_field__init_uint(&sc->id, syscall_id->size, syscall_id->offset, evsel->needs_swap)) return -EINVAL; @@ -2531,7 +2531,7 @@ static int trace__vfs_getname(struct trace *trace, struct evsel *evsel, size_t filename_len, entry_str_len, to_move; ssize_t remaining_space; char *pos; - const char *filename = perf_evsel__rawptr(evsel, sample, "pathname"); + const char *filename = evsel__rawptr(evsel, sample, "pathname"); if (!thread) goto out; @@ -2587,7 +2587,7 @@ static int trace__sched_stat_runtime(struct trace *trace, struct evsel *evsel, union perf_event *event __maybe_unused, struct perf_sample *sample) { - u64 runtime = perf_evsel__intval(evsel, sample, "runtime"); + u64 runtime = evsel__intval(evsel, sample, "runtime"); double runtime_ms = (double)runtime / NSEC_PER_MSEC; struct thread *thread = machine__findnew_thread(trace->host, sample->pid, @@ -2606,10 +2606,10 @@ static int trace__sched_stat_runtime(struct trace *trace, struct evsel *evsel, out_dump: fprintf(trace->output, "%s: comm=%s,pid=%u,runtime=%" PRIu64 ",vruntime=%" PRIu64 ")\n", evsel->name, - perf_evsel__strval(evsel, sample, "comm"), - (pid_t)perf_evsel__intval(evsel, sample, "pid"), + evsel__strval(evsel, sample, "comm"), + (pid_t)evsel__intval(evsel, sample, "pid"), runtime, - perf_evsel__intval(evsel, sample, "vruntime")); + evsel__intval(evsel, sample, "vruntime")); goto out_put; } @@ -3035,7 +3035,7 @@ static bool evlist__add_vfs_getname(struct evlist *evlist) if (!strstarts(evsel__name(evsel), "probe:vfs_getname")) continue; - if (perf_evsel__field(evsel, "pathname")) { + if (evsel__field(evsel, "pathname")) { evsel->handler = trace__vfs_getname; found = true; continue; diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c index 261e6eaaee99..ce8aa32bc3ee 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -8,7 +8,7 @@ static int perf_evsel__test_field(struct evsel *evsel, const char *name, int size, bool should_be_signed) { - struct tep_format_field *field = perf_evsel__field(evsel, name); + struct tep_format_field *field = evsel__field(evsel, name); int is_signed; int ret = 0; diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index a77492bcb4bc..6d026e8a7fa6 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -114,7 +114,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest goto out_delete_evlist; } - tp_flags = perf_evsel__intval(evsel, &sample, "flags"); + tp_flags = evsel__intval(evsel, &sample, "flags"); if (flags != tp_flags) { pr_debug("%s: Expected flags=%#x, got %#x\n", diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index b08c8a0898d3..db5e1f70053a 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -135,8 +135,8 @@ static int process_sample_event(struct evlist *evlist, evsel = perf_evlist__id2evsel(evlist, sample.id); if (evsel == switch_tracking->switch_evsel) { - next_tid = perf_evsel__intval(evsel, &sample, "next_pid"); - prev_tid = perf_evsel__intval(evsel, &sample, "prev_pid"); + next_tid = evsel__intval(evsel, &sample, "next_pid"); + prev_tid = evsel__intval(evsel, &sample, "prev_pid"); cpu = sample.cpu; pr_debug3("sched_switch: cpu: %d prev_tid %d next_tid %d\n", cpu, prev_tid, next_tid); diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index bbd57e8fde7d..aedd554fb4bb 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2314,15 +2314,14 @@ int perf_evsel__parse_sample_timestamp(struct evsel *evsel, return 0; } -struct tep_format_field *perf_evsel__field(struct evsel *evsel, const char *name) +struct tep_format_field *evsel__field(struct evsel *evsel, const char *name) { return tep_find_field(evsel->tp_format, name); } -void *perf_evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, - const char *name) +void *evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, const char *name) { - struct tep_format_field *field = perf_evsel__field(evsel, name); + struct tep_format_field *field = evsel__field(evsel, name); int offset; if (!field) @@ -2377,10 +2376,9 @@ u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sam return 0; } -u64 perf_evsel__intval(struct evsel *evsel, struct perf_sample *sample, - const char *name) +u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *name) { - struct tep_format_field *field = perf_evsel__field(evsel, name); + struct tep_format_field *field = evsel__field(evsel, name); if (!field) return 0; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index e16a9b23556b..d83f7007d6d7 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -241,23 +241,19 @@ void evsel__close(struct evsel *evsel); struct perf_sample; -void *perf_evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, - const char *name); -u64 perf_evsel__intval(struct evsel *evsel, struct perf_sample *sample, - const char *name); - -static inline char *perf_evsel__strval(struct evsel *evsel, - struct perf_sample *sample, - const char *name) +void *evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, const char *name); +u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *name); + +static inline char *evsel__strval(struct evsel *evsel, struct perf_sample *sample, const char *name) { - return perf_evsel__rawptr(evsel, sample, name); + return evsel__rawptr(evsel, sample, name); } struct tep_format_field; u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample, bool needs_swap); -struct tep_format_field *perf_evsel__field(struct evsel *evsel, const char *name); +struct tep_format_field *evsel__field(struct evsel *evsel, const char *name); #define perf_evsel__match(evsel, t, c) \ (evsel->core.attr.type == PERF_TYPE_##t && \ diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 59829f28cbb6..f17b1e769ae4 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -2488,7 +2488,7 @@ static int intel_pt_process_switch(struct intel_pt *pt, if (evsel != pt->switch_evsel) return 0; - tid = perf_evsel__intval(evsel, sample, "next_pid"); + tid = evsel__intval(evsel, sample, "next_pid"); cpu = sample->cpu; intel_pt_log("sched_switch: cpu %d tid %d time %"PRIu64" tsc %#"PRIx64"\n", -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 63/91] perf mem2node: Avoid double free related to realloc 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (61 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 62/91] perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 64/91] perf doc: Pass ASCIIDOC_EXTRA as an argument Arnaldo Carvalho de Melo ` (27 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Jiri Olsa, Alexander Shishkin, Mark Rutland, Peter Zijlstra, Stephane Eranian, clang-built-linux, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> Realloc of size zero is a free not an error, avoid this causing a double free. Caught by clang's address sanitizer: ==2634==ERROR: AddressSanitizer: attempting double-free on 0x6020000015f0 in thread T0: #0 0x5649659297fd in free llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:123:3 #1 0x5649659e9251 in __zfree tools/lib/zalloc.c:13:2 #2 0x564965c0f92c in mem2node__exit tools/perf/util/mem2node.c:114:2 #3 0x564965a08b4c in perf_c2c__report tools/perf/builtin-c2c.c:2867:2 #4 0x564965a0616a in cmd_c2c tools/perf/builtin-c2c.c:2989:10 #5 0x564965944348 in run_builtin tools/perf/perf.c:312:11 #6 0x564965943235 in handle_internal_command tools/perf/perf.c:364:8 #7 0x5649659440c4 in run_argv tools/perf/perf.c:408:2 #8 0x564965942e41 in main tools/perf/perf.c:538:3 0x6020000015f0 is located 0 bytes inside of 1-byte region [0x6020000015f0,0x6020000015f1) freed by thread T0 here: #0 0x564965929da3 in realloc third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3 #1 0x564965c0f55e in mem2node__init tools/perf/util/mem2node.c:97:16 #2 0x564965a08956 in perf_c2c__report tools/perf/builtin-c2c.c:2803:8 #3 0x564965a0616a in cmd_c2c tools/perf/builtin-c2c.c:2989:10 #4 0x564965944348 in run_builtin tools/perf/perf.c:312:11 #5 0x564965943235 in handle_internal_command tools/perf/perf.c:364:8 #6 0x5649659440c4 in run_argv tools/perf/perf.c:408:2 #7 0x564965942e41 in main tools/perf/perf.c:538:3 previously allocated by thread T0 here: #0 0x564965929c42 in calloc third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x5649659e9220 in zalloc tools/lib/zalloc.c:8:9 #2 0x564965c0f32d in mem2node__init tools/perf/util/mem2node.c:61:12 #3 0x564965a08956 in perf_c2c__report tools/perf/builtin-c2c.c:2803:8 #4 0x564965a0616a in cmd_c2c tools/perf/builtin-c2c.c:2989:10 #5 0x564965944348 in run_builtin tools/perf/perf.c:312:11 #6 0x564965943235 in handle_internal_command tools/perf/perf.c:364:8 #7 0x5649659440c4 in run_argv tools/perf/perf.c:408:2 #8 0x564965942e41 in main tools/perf/perf.c:538:3 v2: add a WARN_ON_ONCE when the free condition arises. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: clang-built-linux@googlegroups.com Link: http://lore.kernel.org/lkml/20200320182347.87675-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/mem2node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/mem2node.c b/tools/perf/util/mem2node.c index 797d86a1ab09..c84f5841c7ab 100644 --- a/tools/perf/util/mem2node.c +++ b/tools/perf/util/mem2node.c @@ -1,5 +1,6 @@ #include <errno.h> #include <inttypes.h> +#include <asm/bug.h> #include <linux/bitmap.h> #include <linux/kernel.h> #include <linux/zalloc.h> @@ -95,7 +96,7 @@ int mem2node__init(struct mem2node *map, struct perf_env *env) /* Cut unused entries, due to merging. */ tmp_entries = realloc(entries, sizeof(*entries) * j); - if (tmp_entries) + if (tmp_entries || WARN_ON_ONCE(j == 0)) entries = tmp_entries; for (i = 0; i < j; i++) { -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 64/91] perf doc: Pass ASCIIDOC_EXTRA as an argument 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (62 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 63/91] perf mem2node: Avoid double free related to realloc Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 65/91] tools feature: Add support for detecting libpfm4 Arnaldo Carvalho de Melo ` (26 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Jiri Olsa, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Alexey Budankov, Andi Kleen, Andrii Nakryiko, Daniel Borkmann, Florian Fainelli, Greg Kroah-Hartman, Igor Lubashev, Jin Yao, Jiwei Sun, John Garry From: Ian Rogers <irogers@google.com> commit e9cfa47e687d ("perf doc: allow ASCIIDOC_EXTRA to be an argument") allowed ASCIIDOC_EXTRA to be passed as an option to the Documentation Makefile. This change passes ASCIIDOC_EXTRA, set by detected features or command line options, prior to doing a Documentation build. This is necessary to allow conditional compilation, based on configuration variables, in asciidoc code. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrii Nakryiko <andriin@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Igor Lubashev <ilubashe@akamai.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiwei Sun <jiwei.sun@windriver.com> Cc: John Garry <john.garry@huawei.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin KaFai Lau <kafai@fb.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yonghong Song <yhs@fb.com> Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian <yuzhoujian@didichuxing.com> Link: http://lore.kernel.org/lkml/20200429231443.207201-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile.perf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index d15a311408f1..94a495594e99 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -188,7 +188,7 @@ AWK = awk # non-config cases config := 1 -NON_CONFIG_TARGETS := clean python-clean TAGS tags cscope help install-doc install-man install-html install-info install-pdf doc man html info pdf +NON_CONFIG_TARGETS := clean python-clean TAGS tags cscope help ifdef MAKECMDGOALS ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),) @@ -832,7 +832,7 @@ INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html # 'make doc' should call 'make -C Documentation all' $(DOC_TARGETS): - $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:doc=all) + $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:doc=all) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) TAG_FOLDERS= . ../lib ../include TAG_FILES= ../../include/uapi/linux/perf_event.h @@ -959,7 +959,7 @@ install-python_ext: # 'make install-doc' should call 'make -C Documentation install' $(INSTALL_DOC_TARGETS): - $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) + $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) ### Cleaning rules -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 65/91] tools feature: Add support for detecting libpfm4 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (63 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 64/91] perf doc: Pass ASCIIDOC_EXTRA as an argument Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 66/91] perf pmu: Add perf_pmu__find_by_type helper Arnaldo Carvalho de Melo ` (25 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Stephane Eranian, Ian Rogers, Jiri Olsa, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Alexey Budankov, Andi Kleen, Andrii Nakryiko, Daniel Borkmann, Florian Fainelli, Greg Kroah-Hartman, Igor Lubashev, Jin Yao, Jiwei Sun From: Stephane Eranian <eranian@google.com> libpfm4 provides an alternate command line encoding of perf events. Signed-off-by: Stephane Eranian <eranian@google.com> Reviewed-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrii Nakryiko <andriin@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Igor Lubashev <ilubashe@akamai.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiwei Sun <jiwei.sun@windriver.com> Cc: John Garry <john.garry@huawei.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin KaFai Lau <kafai@fb.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yonghong Song <yhs@fb.com> Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian <yuzhoujian@didichuxing.com> Link: http://lore.kernel.org/lkml/20200429231443.207201-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/build/Makefile.feature | 3 ++- tools/build/feature/Makefile | 6 +++++- tools/build/feature/test-libpfm4.c | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tools/build/feature/test-libpfm4.c diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 3e0c019ef297..3abd4316cd4f 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -98,7 +98,8 @@ FEATURE_TESTS_EXTRA := \ llvm \ llvm-version \ clang \ - libbpf + libbpf \ + libpfm4 FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC) diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 92012381393a..84f845b9627d 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -69,7 +69,8 @@ FILES= \ test-libaio.bin \ test-libzstd.bin \ test-clang-bpf-global-var.bin \ - test-file-handle.bin + test-file-handle.bin \ + test-libpfm4.bin FILES := $(addprefix $(OUTPUT),$(FILES)) @@ -331,6 +332,9 @@ $(OUTPUT)test-clang-bpf-global-var.bin: $(OUTPUT)test-file-handle.bin: $(BUILD) +$(OUTPUT)test-libpfm4.bin: + $(BUILD) -lpfm + ############################### clean: diff --git a/tools/build/feature/test-libpfm4.c b/tools/build/feature/test-libpfm4.c new file mode 100644 index 000000000000..af49b259459e --- /dev/null +++ b/tools/build/feature/test-libpfm4.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <sys/types.h> +#include <perfmon/pfmlib.h> + +int main(void) +{ + pfm_initialize(); + return 0; +} -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 66/91] perf pmu: Add perf_pmu__find_by_type helper 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (64 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 65/91] tools feature: Add support for detecting libpfm4 Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 67/91] perf evsel: Rename perf_evsel__is_*() to evsel__is*() Arnaldo Carvalho de Melo ` (24 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Stephane Eranian, Ian Rogers, Jiri Olsa, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Alexey Budankov, Andi Kleen, Andrii Nakryiko, Daniel Borkmann, Florian Fainelli, Greg Kroah-Hartman, Igor Lubashev, Jin Yao, Jiwei Sun From: Stephane Eranian <eranian@google.com> This is used by libpfm4 during event parsing to locate the pmu for an event. Signed-off-by: Stephane Eranian <eranian@google.com> Reviewed-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrii Nakryiko <andriin@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Igor Lubashev <ilubashe@akamai.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiwei Sun <jiwei.sun@windriver.com> Cc: John Garry <john.garry@huawei.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin KaFai Lau <kafai@fb.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yonghong Song <yhs@fb.com> Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: yuzhoujian <yuzhoujian@didichuxing.com> Link: http://lore.kernel.org/lkml/20200429231443.207201-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/pmu.c | 11 +++++++++++ tools/perf/util/pmu.h | 1 + 2 files changed, 12 insertions(+) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 5642de7f8be7..92bd7fafcce6 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -871,6 +871,17 @@ static struct perf_pmu *pmu_find(const char *name) return NULL; } +struct perf_pmu *perf_pmu__find_by_type(unsigned int type) +{ + struct perf_pmu *pmu; + + list_for_each_entry(pmu, &pmus, list) + if (pmu->type == type) + return pmu; + + return NULL; +} + struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu) { /* diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 1edd214b75a5..cb6fbec50313 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -72,6 +72,7 @@ struct perf_pmu_alias { }; struct perf_pmu *perf_pmu__find(const char *name); +struct perf_pmu *perf_pmu__find_by_type(unsigned int type); int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, struct list_head *head_terms, struct parse_events_error *error); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 67/91] perf evsel: Rename perf_evsel__is_*() to evsel__is*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (65 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 66/91] perf pmu: Add perf_pmu__find_by_type helper Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 68/91] perf evsel: Ditch perf_evsel__cmp(), not used for quite a while Arnaldo Carvalho de Melo ` (23 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-annotate.c | 3 +-- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-report.c | 8 +++--- tools/perf/builtin-script.c | 2 +- tools/perf/builtin-top.c | 3 +-- tools/perf/builtin-trace.c | 2 +- tools/perf/tests/evsel-roundtrip-name.c | 4 +-- tools/perf/tests/parse-events.c | 28 +++++++++---------- tools/perf/ui/browsers/hists.c | 6 ++--- tools/perf/ui/gtk/annotate.c | 2 +- tools/perf/ui/gtk/hists.c | 2 +- tools/perf/ui/hist.c | 6 ++--- tools/perf/util/annotate.c | 10 +++---- tools/perf/util/auxtrace.c | 8 +++--- tools/perf/util/bpf-loader.c | 2 +- tools/perf/util/data-convert-bt.c | 4 +-- tools/perf/util/evlist.c | 8 +++--- tools/perf/util/evsel.c | 28 +++++++++---------- tools/perf/util/evsel.h | 29 ++++++++++---------- tools/perf/util/evsel_fprintf.c | 2 +- tools/perf/util/header.c | 6 ++--- tools/perf/util/hist.c | 2 +- tools/perf/util/parse-events.c | 6 ++--- tools/perf/util/stat-display.c | 2 +- tools/perf/util/stat-shadow.c | 36 ++++++++++++------------- tools/perf/util/stat.c | 2 +- 26 files changed, 103 insertions(+), 110 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index e0fbc13884df..b0e5a30755ce 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -436,8 +436,7 @@ static int __cmd_annotate(struct perf_annotate *ann) evsel__reset_sample_bit(pos, CALLCHAIN); perf_evsel__output_resort(pos, NULL); - if (symbol_conf.event_group && - !perf_evsel__is_group_leader(pos)) + if (symbol_conf.event_group && !evsel__is_group_leader(pos)) continue; hists__find_annotations(hists, pos, ann); diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 67d3adadcd5b..f8c9bdd8269a 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -467,7 +467,7 @@ static struct evsel *evsel_match(struct evsel *evsel, struct evsel *e; evlist__for_each_entry(evlist, e) { - if (perf_evsel__match2(evsel, e)) + if (evsel__match2(evsel, e)) return e; } diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index e00f6244cbda..ba63390246c2 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -459,7 +459,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report nr_events = hists->stats.total_non_filtered_period; } - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { struct evsel *pos; evsel__group_desc(evsel, buf, size); @@ -539,8 +539,7 @@ static int perf_evlist__tty_browse_hists(struct evlist *evlist, struct hists *hists = evsel__hists(pos); const char *evname = evsel__name(pos); - if (symbol_conf.event_group && - !perf_evsel__is_group_leader(pos)) + if (symbol_conf.event_group && !evsel__is_group_leader(pos)) continue; hists__fprintf_nr_sample_events(hists, rep, evname, stdout); @@ -682,8 +681,7 @@ static int report__collapse_hists(struct report *rep) break; /* Non-group events are considered as leader */ - if (symbol_conf.event_group && - !perf_evsel__is_group_leader(pos)) { + if (symbol_conf.event_group && !evsel__is_group_leader(pos)) { struct hists *leader_hists = evsel__hists(pos->leader); hists__match(leader_hists, hists); diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 8ca24e307266..fee56474377b 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1948,7 +1948,7 @@ static void process_event(struct perf_script *script, else if (PRINT_FIELD(BRSTACKOFF)) perf_sample__fprintf_brstackoff(sample, thread, attr, fp); - if (perf_evsel__is_bpf_output(evsel) && PRINT_FIELD(BPF_OUTPUT)) + if (evsel__is_bpf_output(evsel) && PRINT_FIELD(BPF_OUTPUT)) perf_sample__fprintf_bpf_output(sample, fp); perf_sample__fprintf_insn(sample, attr, thread, machine, fp); diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 55edab99b05d..4403a76f2047 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -298,8 +298,7 @@ static void perf_top__resort_hists(struct perf_top *t) hists__collapse_resort(hists, NULL); /* Non-group events are considered as leader */ - if (symbol_conf.event_group && - !perf_evsel__is_group_leader(pos)) { + if (symbol_conf.event_group && !evsel__is_group_leader(pos)) { struct hists *leader_hists = evsel__hists(pos->leader); hists__match(leader_hists, hists); diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 871d43d68a1b..025e190fd1c2 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2774,7 +2774,7 @@ static int trace__event_handler(struct trace *trace, struct evsel *evsel, fprintf(trace->output, "%s(", evsel->name); - if (perf_evsel__is_bpf_output(evsel)) { + if (evsel__is_bpf_output(evsel)) { bpf_output__fprintf(trace, sample); } else if (evsel->tp_format) { if (strncmp(evsel->tp_format->name, "sys_enter_", 10) || diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c index f052851bad93..f143de12e38a 100644 --- a/tools/perf/tests/evsel-roundtrip-name.c +++ b/tools/perf/tests/evsel-roundtrip-name.c @@ -20,7 +20,7 @@ static int perf_evsel__roundtrip_cache_name_test(void) for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) { for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) { /* skip invalid cache type */ - if (!perf_evsel__is_cache_op_valid(type, op)) + if (!evsel__is_cache_op_valid(type, op)) continue; for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { @@ -38,7 +38,7 @@ static int perf_evsel__roundtrip_cache_name_test(void) for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) { for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) { /* skip invalid cache type */ - if (!perf_evsel__is_cache_op_valid(type, op)) + if (!evsel__is_cache_op_valid(type, op)) continue; for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 732dde22ab4e..8d0c04855511 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -652,7 +652,7 @@ static int test__group1(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); @@ -694,7 +694,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); @@ -725,7 +725,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); return 0; @@ -750,7 +750,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong group name", !strcmp(leader->group_name, "group1")); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); @@ -785,7 +785,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong group name", !strcmp(leader->group_name, "group2")); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); @@ -817,7 +817,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); return 0; @@ -843,7 +843,7 @@ static int test__group4(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); @@ -886,7 +886,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); @@ -918,7 +918,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); @@ -948,7 +948,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); return 0; } @@ -972,7 +972,7 @@ static int test__group_gh1(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); @@ -1012,7 +1012,7 @@ static int test__group_gh2(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); @@ -1052,7 +1052,7 @@ static int test__group_gh3(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); @@ -1092,7 +1092,7 @@ static int test__group_gh4(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 1ad64ca4e21b..2936697bb696 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -3424,7 +3424,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser, ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : HE_COLORSET_NORMAL); - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { struct evsel *pos; ev_name = evsel__group_name(evsel); @@ -3554,7 +3554,7 @@ static bool filter_group_entries(struct ui_browser *browser __maybe_unused, { struct evsel *evsel = list_entry(entry, struct evsel, core.node); - if (symbol_conf.event_group && !perf_evsel__is_group_leader(evsel)) + if (symbol_conf.event_group && !evsel__is_group_leader(evsel)) return true; return false; @@ -3622,7 +3622,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help, nr_entries = 0; evlist__for_each_entry(evlist, pos) { - if (perf_evsel__is_group_leader(pos)) + if (evsel__is_group_leader(pos)) nr_entries++; } diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c index 35f9641bf670..a7dff77f2018 100644 --- a/tools/perf/ui/gtk/annotate.c +++ b/tools/perf/ui/gtk/annotate.c @@ -130,7 +130,7 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct map_symbol *ms, gtk_list_store_append(store, &iter); - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { for (i = 0; i < evsel->core.nr_members; i++) { ret += perf_gtk__get_percent(s + ret, sizeof(s) - ret, diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 40b52ae6ca6a..53ef71a1b15d 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c @@ -642,7 +642,7 @@ int perf_evlist__gtk_browse_hists(struct evlist *evlist, size_t size = sizeof(buf); if (symbol_conf.event_group) { - if (!perf_evsel__is_group_leader(pos)) + if (!evsel__is_group_leader(pos)) continue; if (pos->core.nr_members > 1) { diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 025f4c7f96bf..1a83614901a4 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -43,7 +43,7 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, } else ret = hpp__call_print_fn(hpp, print_fn, fmt, len, get_field(he)); - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { int prev_idx, idx_delta; struct hist_entry *pair; int nr_members = evsel->core.nr_members; @@ -190,7 +190,7 @@ static int __hpp__group_sort_idx(struct hist_entry *a, struct hist_entry *b, int cmp, nr_members, ret, i; cmp = field_cmp(get_field(a), get_field(b)); - if (!perf_evsel__is_group_event(evsel)) + if (!evsel__is_group_event(evsel)) return cmp; nr_members = evsel->core.nr_members; @@ -240,7 +240,7 @@ static int __hpp__sort(struct hist_entry *a, struct hist_entry *b, return ret; evsel = hists_to_evsel(a->hists); - if (!perf_evsel__is_group_event(evsel)) + if (!evsel__is_group_event(evsel)) return ret; nr_members = evsel->core.nr_members; diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 7d03563b608b..dc3342f5586b 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1191,7 +1191,7 @@ static struct disasm_line *disasm_line__new(struct annotate_args *args) struct disasm_line *dl = NULL; int nr = 1; - if (perf_evsel__is_group_event(args->evsel)) + if (evsel__is_group_event(args->evsel)) nr = args->evsel->core.nr_members; dl = zalloc(disasm_line_size(nr)); @@ -1437,7 +1437,7 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start if (queue) return -1; - if (perf_evsel__is_group_event(evsel)) + if (evsel__is_group_event(evsel)) width *= evsel->core.nr_members; if (!*al->line) @@ -2368,7 +2368,7 @@ int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel, len = symbol__size(sym); - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { width *= evsel->core.nr_members; evsel__group_desc(evsel, buf, sizeof(buf)); evsel_name = buf; @@ -2518,7 +2518,7 @@ int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel, if (fp == NULL) goto out_free_filename; - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { evsel__group_desc(evsel, buf, sizeof(buf)); ev_name = buf; } @@ -3064,7 +3064,7 @@ int symbol__annotate2(struct map_symbol *ms, struct evsel *evsel, if (notes->offsets == NULL) return ENOMEM; - if (perf_evsel__is_group_event(evsel)) + if (evsel__is_group_event(evsel)) nr_pcnt = evsel->core.nr_members; err = symbol__annotate(ms, evsel, options, parch); diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index c22ef2e3e079..749487a41cc7 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -70,7 +70,7 @@ static int perf_evlist__regroup(struct evlist *evlist, struct evsel *evsel; bool grp; - if (!perf_evsel__is_group_leader(leader)) + if (!evsel__is_group_leader(leader)) return -EINVAL; grp = false; @@ -685,7 +685,7 @@ static int auxtrace_validate_aux_sample_size(struct evlist *evlist, evlist__for_each_entry(evlist, evsel) { sz = evsel->core.attr.aux_sample_size; - if (perf_evsel__is_group_leader(evsel)) { + if (evsel__is_group_leader(evsel)) { has_aux_leader = evsel__is_aux_event(evsel); if (sz) { if (has_aux_leader) @@ -759,7 +759,7 @@ int auxtrace_parse_sample_options(struct auxtrace_record *itr, /* Set aux_sample_size based on --aux-sample option */ evlist__for_each_entry(evlist, evsel) { - if (perf_evsel__is_group_leader(evsel)) { + if (evsel__is_group_leader(evsel)) { has_aux_leader = evsel__is_aux_event(evsel); } else if (has_aux_leader) { evsel->core.attr.aux_sample_size = sz; @@ -1247,7 +1247,7 @@ static void unleader_auxtrace(struct perf_session *session) evlist__for_each_entry(session->evlist, evsel) { if (auxtrace__evsel_is_auxtrace(session, evsel) && - perf_evsel__is_group_leader(evsel)) { + evsel__is_group_leader(evsel)) { unleader_evsel(session->evlist, evsel); } } diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 10c187b8b8ea..83bfb8768235 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -1430,7 +1430,7 @@ apply_config_evsel_for_key(const char *name, int map_fd, void *pkey, return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH; } - if (perf_evsel__is_bpf_output(evsel)) + if (evsel__is_bpf_output(evsel)) check_pass = true; if (attr->type == PERF_TYPE_RAW) check_pass = true; diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index 54c345e7b308..5f36fc6a5578 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -835,7 +835,7 @@ static int process_sample_event(struct perf_tool *tool, return -1; } - if (perf_evsel__is_bpf_output(evsel)) { + if (evsel__is_bpf_output(evsel)) { ret = add_bpf_output_values(event_class, event, sample); if (ret) return -1; @@ -1174,7 +1174,7 @@ static int add_event(struct ctf_writer *cw, struct evsel *evsel) goto err; } - if (perf_evsel__is_bpf_output(evsel)) { + if (evsel__is_bpf_output(evsel)) { ret = add_bpf_output_types(cw, event_class); if (ret) goto err; diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 410cd834c39a..404542b69543 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -391,14 +391,14 @@ void evlist__disable(struct evlist *evlist) evlist__for_each_entry(evlist, pos) { if (evsel__cpu_iter_skip(pos, cpu)) continue; - if (pos->disabled || !perf_evsel__is_group_leader(pos) || !pos->core.fd) + if (pos->disabled || !evsel__is_group_leader(pos) || !pos->core.fd) continue; evsel__disable_cpu(pos, pos->cpu_iter - 1); } } affinity__cleanup(&affinity); evlist__for_each_entry(evlist, pos) { - if (!perf_evsel__is_group_leader(pos) || !pos->core.fd) + if (!evsel__is_group_leader(pos) || !pos->core.fd) continue; pos->disabled = true; } @@ -421,14 +421,14 @@ void evlist__enable(struct evlist *evlist) evlist__for_each_entry(evlist, pos) { if (evsel__cpu_iter_skip(pos, cpu)) continue; - if (!perf_evsel__is_group_leader(pos) || !pos->core.fd) + if (!evsel__is_group_leader(pos) || !pos->core.fd) continue; evsel__enable_cpu(pos, pos->cpu_iter - 1); } } affinity__cleanup(&affinity); evlist__for_each_entry(evlist, pos) { - if (!perf_evsel__is_group_leader(pos) || !pos->core.fd) + if (!evsel__is_group_leader(pos) || !pos->core.fd) continue; pos->disabled = false; } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index aedd554fb4bb..ded511c8def3 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -217,14 +217,14 @@ void evsel__set_sample_id(struct evsel *evsel, } /** - * perf_evsel__is_function_event - Return whether given evsel is a function + * evsel__is_function_event - Return whether given evsel is a function * trace event * * @evsel - evsel selector to be tested * * Return %true if event is function trace event */ -bool perf_evsel__is_function_event(struct evsel *evsel) +bool evsel__is_function_event(struct evsel *evsel) { #define FUNCTION_EVENT "ftrace:function" @@ -267,13 +267,13 @@ struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx) return NULL; evsel__init(evsel, attr, idx); - if (perf_evsel__is_bpf_output(evsel)) { + if (evsel__is_bpf_output(evsel)) { evsel->core.attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD), evsel->core.attr.sample_period = 1; } - if (perf_evsel__is_clock(evsel)) { + if (evsel__is_clock(evsel)) { /* * The evsel->unit points to static alias->unit * so it's ok to use static string in here. @@ -531,7 +531,7 @@ static unsigned long perf_evsel__hw_cache_stat[C(MAX)] = { [C(NODE)] = (CACHE_READ | CACHE_WRITE | CACHE_PREFETCH), }; -bool perf_evsel__is_cache_op_valid(u8 type, u8 op) +bool evsel__is_cache_op_valid(u8 type, u8 op) { if (perf_evsel__hw_cache_stat[type] & COP(op)) return true; /* valid */ @@ -570,7 +570,7 @@ static int __evsel__hw_cache_name(u64 config, char *bf, size_t size) goto out_err; err = "invalid-cache"; - if (!perf_evsel__is_cache_op_valid(type, op)) + if (!evsel__is_cache_op_valid(type, op)) goto out_err; return __evsel__hw_cache_type_op_res_name(type, op, result, bf, size); @@ -686,7 +686,7 @@ int evsel__group_desc(struct evsel *evsel, char *buf, size_t size) static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, struct callchain_param *param) { - bool function = perf_evsel__is_function_event(evsel); + bool function = evsel__is_function_event(evsel); struct perf_event_attr *attr = &evsel->core.attr; evsel__set_sample_bit(evsel, CALLCHAIN); @@ -1018,7 +1018,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, * event, due to issues with page faults while tracing page * fault handler and its overall trickiness nature. */ - if (perf_evsel__is_function_event(evsel)) + if (evsel__is_function_event(evsel)) evsel->core.attr.exclude_callchain_user = 1; if (callchain && callchain->enabled && !evsel->no_aux_samples) @@ -1103,15 +1103,15 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, * Disabling only independent events or group leaders, * keeping group members enabled. */ - if (perf_evsel__is_group_leader(evsel)) + if (evsel__is_group_leader(evsel)) attr->disabled = 1; /* * Setting enable_on_exec for independent events and * group leaders for traced executed by perf. */ - if (target__none(&opts->target) && perf_evsel__is_group_leader(evsel) && - !opts->initial_delay) + if (target__none(&opts->target) && evsel__is_group_leader(evsel) && + !opts->initial_delay) attr->enable_on_exec = 1; if (evsel->immediate) { @@ -1389,7 +1389,7 @@ perf_evsel__read_group(struct evsel *leader, int cpu, int thread) if (!(read_format & PERF_FORMAT_ID)) return -EINVAL; - if (!perf_evsel__is_group_leader(leader)) + if (!evsel__is_group_leader(leader)) return -EINVAL; if (!data) { @@ -1445,7 +1445,7 @@ static int get_group_fd(struct evsel *evsel, int cpu, int thread) struct evsel *leader = evsel->leader; int fd; - if (perf_evsel__is_group_leader(evsel)) + if (evsel__is_group_leader(evsel)) return -1; /* @@ -1829,7 +1829,7 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, } else if (!perf_missing_features.group_read && evsel->core.attr.inherit && (evsel->core.attr.read_format & PERF_FORMAT_GROUP) && - perf_evsel__is_group_leader(evsel)) { + evsel__is_group_leader(evsel)) { perf_missing_features.group_read = true; pr_debug2_peo("switching off group read\n"); goto fallback_missing_features; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index d83f7007d6d7..4246cadaf96e 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -196,7 +196,7 @@ void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, int __evsel__sample_size(u64 sample_type); void evsel__calc_id_pos(struct evsel *evsel); -bool perf_evsel__is_cache_op_valid(u8 type, u8 op); +bool evsel__is_cache_op_valid(u8 type, u8 op); #define PERF_EVSEL__MAX_ALIASES 8 @@ -255,12 +255,11 @@ u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sam struct tep_format_field *evsel__field(struct evsel *evsel, const char *name); -#define perf_evsel__match(evsel, t, c) \ +#define evsel__match(evsel, t, c) \ (evsel->core.attr.type == PERF_TYPE_##t && \ evsel->core.attr.config == PERF_COUNT_##c) -static inline bool perf_evsel__match2(struct evsel *e1, - struct evsel *e2) +static inline bool evsel__match2(struct evsel *e1, struct evsel *e2) { return (e1->core.attr.type == e2->core.attr.type) && (e1->core.attr.config == e2->core.attr.config); @@ -321,44 +320,44 @@ static inline struct evsel *perf_evsel__prev(struct evsel *evsel) } /** - * perf_evsel__is_group_leader - Return whether given evsel is a leader event + * evsel__is_group_leader - Return whether given evsel is a leader event * * @evsel - evsel selector to be tested * * Return %true if @evsel is a group leader or a stand-alone event */ -static inline bool perf_evsel__is_group_leader(const struct evsel *evsel) +static inline bool evsel__is_group_leader(const struct evsel *evsel) { return evsel->leader == evsel; } /** - * perf_evsel__is_group_event - Return whether given evsel is a group event + * evsel__is_group_event - Return whether given evsel is a group event * * @evsel - evsel selector to be tested * * Return %true iff event group view is enabled and @evsel is a actual group * leader which has other members in the group */ -static inline bool perf_evsel__is_group_event(struct evsel *evsel) +static inline bool evsel__is_group_event(struct evsel *evsel) { if (!symbol_conf.event_group) return false; - return perf_evsel__is_group_leader(evsel) && evsel->core.nr_members > 1; + return evsel__is_group_leader(evsel) && evsel->core.nr_members > 1; } -bool perf_evsel__is_function_event(struct evsel *evsel); +bool evsel__is_function_event(struct evsel *evsel); -static inline bool perf_evsel__is_bpf_output(struct evsel *evsel) +static inline bool evsel__is_bpf_output(struct evsel *evsel) { - return perf_evsel__match(evsel, SOFTWARE, SW_BPF_OUTPUT); + return evsel__match(evsel, SOFTWARE, SW_BPF_OUTPUT); } -static inline bool perf_evsel__is_clock(struct evsel *evsel) +static inline bool evsel__is_clock(struct evsel *evsel) { - return perf_evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK) || - perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK); + return evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK) || + evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK); } bool perf_evsel__fallback(struct evsel *evsel, int err, diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index b4c3c7b52b2d..99aed708bd5a 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c @@ -44,7 +44,7 @@ int perf_evsel__fprintf(struct evsel *evsel, if (details->event_group) { struct evsel *pos; - if (!perf_evsel__is_group_leader(evsel)) + if (!evsel__is_group_leader(evsel)) return 0; if (evsel->core.nr_members > 1) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 89031942a2a9..0ce47283a8a1 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -783,8 +783,7 @@ static int write_group_desc(struct feat_fd *ff, return ret; evlist__for_each_entry(evlist, evsel) { - if (perf_evsel__is_group_leader(evsel) && - evsel->core.nr_members > 1) { + if (evsel__is_group_leader(evsel) && evsel->core.nr_members > 1) { const char *name = evsel->group_name ?: "{anon_group}"; u32 leader_idx = evsel->idx; u32 nr_members = evsel->core.nr_members; @@ -1907,8 +1906,7 @@ static void print_group_desc(struct feat_fd *ff, FILE *fp) session = container_of(ff->ph, struct perf_session, header); evlist__for_each_entry(session->evlist, evsel) { - if (perf_evsel__is_group_leader(evsel) && - evsel->core.nr_members > 1) { + if (evsel__is_group_leader(evsel) && evsel->core.nr_members > 1) { fprintf(fp, "# group: %s{%s", evsel->group_name ?: "", evsel__name(evsel)); nr = evsel->core.nr_members - 1; diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index bce49ae97532..12b65d00cf65 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -2695,7 +2695,7 @@ int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool sh nr_events = hists->stats.total_non_filtered_period; } - if (perf_evsel__is_group_event(evsel)) { + if (evsel__is_group_event(evsel)) { struct evsel *pos; evsel__group_desc(evsel, buf, buflen); diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 899ced466197..b7a0518d607d 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -461,7 +461,7 @@ int parse_events_add_cache(struct list_head *list, int *idx, cache_op = parse_aliases(str, perf_evsel__hw_cache_op, PERF_COUNT_HW_CACHE_OP_MAX); if (cache_op >= 0) { - if (!perf_evsel__is_cache_op_valid(cache_type, cache_op)) + if (!evsel__is_cache_op_valid(cache_type, cache_op)) return -EINVAL; continue; } @@ -1871,7 +1871,7 @@ int parse_events__modifier_event(struct list_head *list, char *str, bool add) evsel->precise_max = mod.precise_max; evsel->weak_group = mod.weak; - if (perf_evsel__is_group_leader(evsel)) + if (evsel__is_group_leader(evsel)) evsel->core.attr.pinned = mod.pinned; } @@ -2627,7 +2627,7 @@ int print_hwcache_events(const char *event_glob, bool name_only) for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) { for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) { /* skip invalid cache type */ - if (!perf_evsel__is_cache_op_valid(type, op)) + if (!evsel__is_cache_op_valid(type, op)) continue; for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 7f46e2837045..3c6976f7574c 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -562,7 +562,7 @@ static void collect_all_aliases(struct perf_stat_config *config, struct evsel *c alias->scale != counter->scale || alias->cgrp != counter->cgrp || strcmp(alias->unit, counter->unit) || - perf_evsel__is_clock(alias) != perf_evsel__is_clock(counter) || + evsel__is_clock(alias) != evsel__is_clock(counter) || !strcmp(alias->pmu_name, counter->pmu_name)) break; alias->merged_stat = true; diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index 518fbb3a6269..129b8c5f2538 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -216,9 +216,9 @@ void perf_stat__update_shadow_stats(struct evsel *counter, u64 count, count *= counter->scale; - if (perf_evsel__is_clock(counter)) + if (evsel__is_clock(counter)) update_runtime_stat(st, STAT_NSECS, 0, cpu, count_ns); - else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) + else if (evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) update_runtime_stat(st, STAT_CYCLES, ctx, cpu, count); else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) update_runtime_stat(st, STAT_CYCLES_IN_TX, ctx, cpu, count); @@ -241,25 +241,25 @@ void perf_stat__update_shadow_stats(struct evsel *counter, u64 count, else if (perf_stat_evsel__is(counter, TOPDOWN_RECOVERY_BUBBLES)) update_runtime_stat(st, STAT_TOPDOWN_RECOVERY_BUBBLES, ctx, cpu, count); - else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) + else if (evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) update_runtime_stat(st, STAT_STALLED_CYCLES_FRONT, ctx, cpu, count); - else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_BACKEND)) + else if (evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_BACKEND)) update_runtime_stat(st, STAT_STALLED_CYCLES_BACK, ctx, cpu, count); - else if (perf_evsel__match(counter, HARDWARE, HW_BRANCH_INSTRUCTIONS)) + else if (evsel__match(counter, HARDWARE, HW_BRANCH_INSTRUCTIONS)) update_runtime_stat(st, STAT_BRANCHES, ctx, cpu, count); - else if (perf_evsel__match(counter, HARDWARE, HW_CACHE_REFERENCES)) + else if (evsel__match(counter, HARDWARE, HW_CACHE_REFERENCES)) update_runtime_stat(st, STAT_CACHEREFS, ctx, cpu, count); - else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1D)) + else if (evsel__match(counter, HW_CACHE, HW_CACHE_L1D)) update_runtime_stat(st, STAT_L1_DCACHE, ctx, cpu, count); - else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1I)) + else if (evsel__match(counter, HW_CACHE, HW_CACHE_L1I)) update_runtime_stat(st, STAT_L1_ICACHE, ctx, cpu, count); - else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_LL)) + else if (evsel__match(counter, HW_CACHE, HW_CACHE_LL)) update_runtime_stat(st, STAT_LL_CACHE, ctx, cpu, count); - else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_DTLB)) + else if (evsel__match(counter, HW_CACHE, HW_CACHE_DTLB)) update_runtime_stat(st, STAT_DTLB_CACHE, ctx, cpu, count); - else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB)) + else if (evsel__match(counter, HW_CACHE, HW_CACHE_ITLB)) update_runtime_stat(st, STAT_ITLB_CACHE, ctx, cpu, count); else if (perf_stat_evsel__is(counter, SMI_NUM)) update_runtime_stat(st, STAT_SMI_NUM, ctx, cpu, count); @@ -833,7 +833,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, struct metric_event *me; int num = 1; - if (perf_evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS)) { + if (evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS)) { total = runtime_stat_avg(st, STAT_CYCLES, ctx, cpu); if (total) { @@ -858,7 +858,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, "stalled cycles per insn", ratio); } - } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES)) { + } else if (evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES)) { if (runtime_stat_n(st, STAT_BRANCHES, ctx, cpu) != 0) print_branch_misses(config, cpu, evsel, avg, out, st); else @@ -913,7 +913,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, print_ll_cache_misses(config, cpu, evsel, avg, out, st); else print_metric(config, ctxp, NULL, NULL, "of all LL-cache hits", 0); - } else if (perf_evsel__match(evsel, HARDWARE, HW_CACHE_MISSES)) { + } else if (evsel__match(evsel, HARDWARE, HW_CACHE_MISSES)) { total = runtime_stat_avg(st, STAT_CACHEREFS, ctx, cpu); if (total) @@ -924,11 +924,11 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, "of all cache refs", ratio); else print_metric(config, ctxp, NULL, NULL, "of all cache refs", 0); - } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) { + } else if (evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) { print_stalled_cycles_frontend(config, cpu, evsel, avg, out, st); - } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_BACKEND)) { + } else if (evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_BACKEND)) { print_stalled_cycles_backend(config, cpu, evsel, avg, out, st); - } else if (perf_evsel__match(evsel, HARDWARE, HW_CPU_CYCLES)) { + } else if (evsel__match(evsel, HARDWARE, HW_CPU_CYCLES)) { total = runtime_stat_avg(st, STAT_NSECS, 0, cpu); if (total) { @@ -979,7 +979,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, ratio = total / avg; print_metric(config, ctxp, NULL, "%8.0f", "cycles / elision", ratio); - } else if (perf_evsel__is_clock(evsel)) { + } else if (evsel__is_clock(evsel)) { if ((ratio = avg_stats(&walltime_nsecs_stats)) != 0) print_metric(config, ctxp, NULL, "%8.3f", "CPUs utilized", avg / (ratio * evsel->scale)); diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 3520b7443615..774468341851 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -509,7 +509,7 @@ int create_perf_stat_counter(struct evsel *evsel, * either manually by us or by kernel via enable_on_exec * set later. */ - if (perf_evsel__is_group_leader(evsel)) { + if (evsel__is_group_leader(evsel)) { attr->disabled = 1; /* -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 68/91] perf evsel: Ditch perf_evsel__cmp(), not used for quite a while 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (66 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 67/91] perf evsel: Rename perf_evsel__is_*() to evsel__is*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 69/91] perf evsel: Rename *perf_evsel__read*() to *evsel__read() Arnaldo Carvalho de Melo ` (22 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> In 4c358d5cf361 ("perf stat: Replace transaction event possition check with id check") all its uses were removed, so ditch it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evsel.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 4246cadaf96e..8d61109087a1 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -265,12 +265,6 @@ static inline bool evsel__match2(struct evsel *e1, struct evsel *e2) (e1->core.attr.config == e2->core.attr.config); } -#define perf_evsel__cmp(a, b) \ - ((a) && \ - (b) && \ - (a)->core.attr.type == (b)->core.attr.type && \ - (a)->core.attr.config == (b)->core.attr.config) - int perf_evsel__read_counter(struct evsel *evsel, int cpu, int thread); int __perf_evsel__read_on_cpu(struct evsel *evsel, -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 69/91] perf evsel: Rename *perf_evsel__read*() to *evsel__read() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (67 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 68/91] perf evsel: Ditch perf_evsel__cmp(), not used for quite a while Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 70/91] perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() Arnaldo Carvalho de Melo ` (21 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 4 ++-- tools/perf/tests/openat-syscall-all-cpus.c | 6 +++--- tools/perf/tests/openat-syscall.c | 6 +++--- tools/perf/util/evsel.c | 17 +++++++---------- tools/perf/util/evsel.h | 19 ++++++++----------- tools/perf/util/record.c | 5 ++--- 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 6bc1336a0429..e3629ca69827 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -259,7 +259,7 @@ static int read_single_counter(struct evsel *counter, int cpu, count->val = val; return 0; } - return perf_evsel__read_counter(counter, cpu, thread); + return evsel__read_counter(counter, cpu, thread); } /* @@ -284,7 +284,7 @@ static int read_counter_cpu(struct evsel *counter, struct timespec *rs, int cpu) /* * The leader's group read loads data into its group members - * (via perf_evsel__read_counter()) and sets their count->loaded. + * (via evsel__read_counter()) and sets their count->loaded. */ if (!perf_counts__is_loaded(counter->counts, cpu, thread) && read_single_counter(counter, cpu, thread, rs)) { diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c index 93c176523e38..900934be22d2 100644 --- a/tools/perf/tests/openat-syscall-all-cpus.c +++ b/tools/perf/tests/openat-syscall-all-cpus.c @@ -103,15 +103,15 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int if (cpus->map[cpu] >= CPU_SETSIZE) continue; - if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { - pr_debug("perf_evsel__read_on_cpu\n"); + if (evsel__read_on_cpu(evsel, cpu, 0) < 0) { + pr_debug("evsel__read_on_cpu\n"); err = -1; break; } expected = nr_openat_calls + cpu; if (perf_counts(evsel->counts, cpu, 0)->val != expected) { - pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n", + pr_debug("evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n", expected, cpus->map[cpu], perf_counts(evsel->counts, cpu, 0)->val); err = -1; } diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c index 8497a1fe9bac..db5d8bb8cd06 100644 --- a/tools/perf/tests/openat-syscall.c +++ b/tools/perf/tests/openat-syscall.c @@ -46,13 +46,13 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m close(fd); } - if (perf_evsel__read_on_cpu(evsel, 0, 0) < 0) { - pr_debug("perf_evsel__read_on_cpu\n"); + if (evsel__read_on_cpu(evsel, 0, 0) < 0) { + pr_debug("evsel__read_on_cpu\n"); goto out_close_fd; } if (perf_counts(evsel->counts, 0, 0)->val != nr_openat_calls) { - pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %" PRIu64 "\n", + pr_debug("evsel__read_on_cpu: expected to intercept %d calls, got %" PRIu64 "\n", nr_openat_calls, perf_counts(evsel->counts, 0, 0)->val); goto out_close_fd; } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index ded511c8def3..a11d1359ba81 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1317,8 +1317,7 @@ void perf_counts_values__scale(struct perf_counts_values *count, *pscaled = scaled; } -static int -perf_evsel__read_one(struct evsel *evsel, int cpu, int thread) +static int evsel__read_one(struct evsel *evsel, int cpu, int thread) { struct perf_counts_values *count = perf_counts(evsel->counts, cpu, thread); @@ -1378,8 +1377,7 @@ perf_evsel__process_group_data(struct evsel *leader, return 0; } -static int -perf_evsel__read_group(struct evsel *leader, int cpu, int thread) +static int evsel__read_group(struct evsel *leader, int cpu, int thread) { struct perf_stat_evsel *ps = leader->stats; u64 read_format = leader->core.attr.read_format; @@ -1409,18 +1407,17 @@ perf_evsel__read_group(struct evsel *leader, int cpu, int thread) return perf_evsel__process_group_data(leader, cpu, thread, data); } -int perf_evsel__read_counter(struct evsel *evsel, int cpu, int thread) +int evsel__read_counter(struct evsel *evsel, int cpu, int thread) { u64 read_format = evsel->core.attr.read_format; if (read_format & PERF_FORMAT_GROUP) - return perf_evsel__read_group(evsel, cpu, thread); - else - return perf_evsel__read_one(evsel, cpu, thread); + return evsel__read_group(evsel, cpu, thread); + + return evsel__read_one(evsel, cpu, thread); } -int __perf_evsel__read_on_cpu(struct evsel *evsel, - int cpu, int thread, bool scale) +int __evsel__read_on_cpu(struct evsel *evsel, int cpu, int thread, bool scale) { struct perf_counts_values count; size_t nv = scale ? 3 : 1; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 8d61109087a1..a87de95a66c8 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -265,35 +265,32 @@ static inline bool evsel__match2(struct evsel *e1, struct evsel *e2) (e1->core.attr.config == e2->core.attr.config); } -int perf_evsel__read_counter(struct evsel *evsel, int cpu, int thread); +int evsel__read_counter(struct evsel *evsel, int cpu, int thread); -int __perf_evsel__read_on_cpu(struct evsel *evsel, - int cpu, int thread, bool scale); +int __evsel__read_on_cpu(struct evsel *evsel, int cpu, int thread, bool scale); /** - * perf_evsel__read_on_cpu - Read out the results on a CPU and thread + * evsel__read_on_cpu - Read out the results on a CPU and thread * * @evsel - event selector to read value * @cpu - CPU of interest * @thread - thread of interest */ -static inline int perf_evsel__read_on_cpu(struct evsel *evsel, - int cpu, int thread) +static inline int evsel__read_on_cpu(struct evsel *evsel, int cpu, int thread) { - return __perf_evsel__read_on_cpu(evsel, cpu, thread, false); + return __evsel__read_on_cpu(evsel, cpu, thread, false); } /** - * perf_evsel__read_on_cpu_scaled - Read out the results on a CPU and thread, scaled + * evsel__read_on_cpu_scaled - Read out the results on a CPU and thread, scaled * * @evsel - event selector to read value * @cpu - CPU of interest * @thread - thread of interest */ -static inline int perf_evsel__read_on_cpu_scaled(struct evsel *evsel, - int cpu, int thread) +static inline int evsel__read_on_cpu_scaled(struct evsel *evsel, int cpu, int thread) { - return __perf_evsel__read_on_cpu(evsel, cpu, thread, true); + return __evsel__read_on_cpu(evsel, cpu, thread, true); } int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index d297f4de253c..a4cc11592f6b 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -19,8 +19,7 @@ * However, if the leader is an AUX area event, then assume the event to sample * is the next event. */ -static struct evsel *perf_evsel__read_sampler(struct evsel *evsel, - struct evlist *evlist) +static struct evsel *evsel__read_sampler(struct evsel *evsel, struct evlist *evlist) { struct evsel *leader = evsel->leader; @@ -43,7 +42,7 @@ static void evsel__config_leader_sampling(struct evsel *evsel, struct evlist *ev if (!leader->sample_read) return; - read_sampler = perf_evsel__read_sampler(evsel, evlist); + read_sampler = evsel__read_sampler(evsel, evlist); if (evsel == read_sampler) return; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 70/91] perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (68 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 69/91] perf evsel: Rename *perf_evsel__read*() to *evsel__read() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 71/91] perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() Arnaldo Carvalho de Melo ` (20 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As these are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 6 ++---- tools/perf/builtin-inject.c | 2 +- tools/perf/tests/openat-syscall-tp-fields.c | 2 +- tools/perf/tests/sample-parsing.c | 4 ++-- tools/perf/util/evlist.c | 4 ++-- tools/perf/util/evsel.c | 9 ++++----- tools/perf/util/evsel.h | 9 ++++----- tools/perf/util/python.c | 2 +- 8 files changed, 17 insertions(+), 21 deletions(-) diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c index 909ead08a6f6..026d32ed078e 100644 --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c @@ -130,13 +130,11 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe goto next_event; if (strcmp(event->comm.comm, comm1) == 0) { - CHECK__(perf_evsel__parse_sample(evsel, event, - &sample)); + CHECK__(evsel__parse_sample(evsel, event, &sample)); comm1_time = sample.time; } if (strcmp(event->comm.comm, comm2) == 0) { - CHECK__(perf_evsel__parse_sample(evsel, event, - &sample)); + CHECK__(evsel__parse_sample(evsel, event, &sample)); comm2_time = sample.time; } next_event: diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 842e940523b7..aad007bfb581 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -546,7 +546,7 @@ static int perf_inject__sched_stat(struct perf_tool *tool, return 0; found: event_sw = &ent->event[0]; - perf_evsel__parse_sample(evsel, event_sw, &sample_sw); + evsel__parse_sample(evsel, event_sw, &sample_sw); sample_sw.period = sample->period; sample_sw.time = sample->time; diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index 6d026e8a7fa6..1dc2897d2df9 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -108,7 +108,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest continue; } - err = perf_evsel__parse_sample(evsel, event, &sample); + err = evsel__parse_sample(evsel, event, &sample); if (err) { pr_debug("Can't parse sample, err = %d\n", err); goto out_delete_evlist; diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index ab964db855ac..a0bdaf390ac8 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c @@ -298,10 +298,10 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format) evsel.sample_size = __evsel__sample_size(sample_type); - err = perf_evsel__parse_sample(&evsel, event, &sample_out); + err = evsel__parse_sample(&evsel, event, &sample_out); if (err) { pr_debug("%s failed for sample_type %#"PRIx64", error %d\n", - "perf_evsel__parse_sample", sample_type, err); + "evsel__parse_sample", sample_type, err); goto out_free; } diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 404542b69543..0a0b760d6948 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1439,7 +1439,7 @@ int perf_evlist__parse_sample(struct evlist *evlist, union perf_event *event, if (!evsel) return -EFAULT; - return perf_evsel__parse_sample(evsel, event, sample); + return evsel__parse_sample(evsel, event, sample); } int perf_evlist__parse_sample_timestamp(struct evlist *evlist, @@ -1450,7 +1450,7 @@ int perf_evlist__parse_sample_timestamp(struct evlist *evlist, if (!evsel) return -EFAULT; - return perf_evsel__parse_sample_timestamp(evsel, event, timestamp); + return evsel__parse_sample_timestamp(evsel, event, timestamp); } int perf_evlist__strerror_open(struct evlist *evlist, diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index a11d1359ba81..b63d9eebe42f 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1964,8 +1964,8 @@ perf_event__check_size(union perf_event *event, unsigned int sample_size) return 0; } -int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, - struct perf_sample *data) +int evsel__parse_sample(struct evsel *evsel, union perf_event *event, + struct perf_sample *data) { u64 type = evsel->core.attr.sample_type; bool swapped = evsel->needs_swap; @@ -2267,9 +2267,8 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, return 0; } -int perf_evsel__parse_sample_timestamp(struct evsel *evsel, - union perf_event *event, - u64 *timestamp) +int evsel__parse_sample_timestamp(struct evsel *evsel, union perf_event *event, + u64 *timestamp) { u64 type = evsel->core.attr.sample_type; const __u64 *array; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index a87de95a66c8..4b5a411c403c 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -293,12 +293,11 @@ static inline int evsel__read_on_cpu_scaled(struct evsel *evsel, int cpu, int th return __evsel__read_on_cpu(evsel, cpu, thread, true); } -int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, - struct perf_sample *sample); +int evsel__parse_sample(struct evsel *evsel, union perf_event *event, + struct perf_sample *sample); -int perf_evsel__parse_sample_timestamp(struct evsel *evsel, - union perf_event *event, - u64 *timestamp); +int evsel__parse_sample_timestamp(struct evsel *evsel, union perf_event *event, + u64 *timestamp); static inline struct evsel *perf_evsel__next(struct evsel *evsel) { diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 67810d31f88d..75a9b1d62bba 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1044,7 +1044,7 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, pevent->evsel = evsel; - err = perf_evsel__parse_sample(evsel, event, &pevent->sample); + err = evsel__parse_sample(evsel, event, &pevent->sample); /* Consume the even only after we parsed it out. */ perf_mmap__consume(&md->core); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 71/91] perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (69 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 70/91] perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 72/91] perf evsel: Rename perf_evsel__has*() to evsel__has*() Arnaldo Carvalho de Melo ` (19 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/evsel-roundtrip-name.c | 2 +- tools/perf/tests/parse-events.c | 52 ++++++++++++------------- tools/perf/ui/browsers/hists.c | 4 +- tools/perf/util/evsel.h | 4 +- tools/perf/util/sort.c | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c index f143de12e38a..61ecd8e33a01 100644 --- a/tools/perf/tests/evsel-roundtrip-name.c +++ b/tools/perf/tests/evsel-roundtrip-name.c @@ -53,7 +53,7 @@ static int perf_evsel__roundtrip_cache_name_test(void) ret = -1; } - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); } } } diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 8d0c04855511..5b90ee3eda71 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -468,7 +468,7 @@ static int test__checkevent_list(struct evlist *evlist) TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); /* syscalls:sys_enter_openat:k */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); TEST_ASSERT_VAL("wrong sample_type", PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); @@ -479,7 +479,7 @@ static int test__checkevent_list(struct evlist *evlist) TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); /* 1:1:hp */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); @@ -501,7 +501,7 @@ static int test__checkevent_pmu_name(struct evlist *evlist) TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava")); /* cpu/config=2/u" */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); @@ -529,7 +529,7 @@ static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist) TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); /* cpu/config=2,call-graph=no,time=0,period=2000/ */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); /* @@ -577,7 +577,7 @@ static int test__checkevent_pmu_events_mix(struct evlist *evlist) TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); /* cpu/pmu-event/u*/ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); TEST_ASSERT_VAL("wrong exclude_user", @@ -658,7 +658,7 @@ static int test__group1(struct evlist *evlist) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cycles:upp */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); @@ -700,7 +700,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cache-references + :u modifier */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_REFERENCES == evsel->core.attr.config); @@ -715,7 +715,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cycles:k */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); @@ -758,7 +758,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* group1 cycles:kppp */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); @@ -775,7 +775,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* group2 cycles + G modifier */ - evsel = leader = perf_evsel__next(evsel); + evsel = leader = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); @@ -793,7 +793,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* group2 1:3 + G modifier */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 3 == evsel->core.attr.config); TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); @@ -807,7 +807,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions:u */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); @@ -849,7 +849,7 @@ static int test__group4(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions:kp + p */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); @@ -892,7 +892,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions + G */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); @@ -907,7 +907,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cycles:G */ - evsel = leader = perf_evsel__next(evsel); + evsel = leader = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); @@ -924,7 +924,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions:G */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); @@ -938,7 +938,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); /* cycles */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); @@ -977,7 +977,7 @@ static int test__group_gh1(struct evlist *evlist) TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); /* cache-misses:G + :H group modifier */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); @@ -1017,7 +1017,7 @@ static int test__group_gh2(struct evlist *evlist) TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); /* cache-misses:H + :G group modifier */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); @@ -1057,7 +1057,7 @@ static int test__group_gh3(struct evlist *evlist) TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); /* cache-misses:H + :u group modifier */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); @@ -1097,7 +1097,7 @@ static int test__group_gh4(struct evlist *evlist) TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); /* cache-misses:H + :uG group modifier */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); @@ -1135,7 +1135,7 @@ static int test__leader_sample1(struct evlist *evlist) TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); /* cache-misses - not sampling */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); @@ -1149,7 +1149,7 @@ static int test__leader_sample1(struct evlist *evlist) TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); /* branch-misses - not sampling */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); @@ -1188,7 +1188,7 @@ static int test__leader_sample2(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); /* branch-misses - not sampling */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); @@ -1234,14 +1234,14 @@ static int test__pinned_group(struct evlist *evlist) TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); /* cache-misses - can not be pinned, but will go on with the leader */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); /* branch-misses - ditto */ - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 2936697bb696..f98a118dfc49 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -3512,13 +3512,13 @@ static int perf_evsel_menu__run(struct evsel_menu *menu, if (pos->core.node.next == &evlist->core.entries) pos = evlist__first(evlist); else - pos = perf_evsel__next(pos); + pos = evsel__next(pos); goto browse_hists; case K_UNTAB: if (pos->core.node.prev == &evlist->core.entries) pos = evlist__last(evlist); else - pos = perf_evsel__prev(pos); + pos = evsel__prev(pos); goto browse_hists; case K_SWITCH_INPUT_DATA: case K_RELOAD: diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 4b5a411c403c..a84a4f6bcf31 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -299,12 +299,12 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event, int evsel__parse_sample_timestamp(struct evsel *evsel, union perf_event *event, u64 *timestamp); -static inline struct evsel *perf_evsel__next(struct evsel *evsel) +static inline struct evsel *evsel__next(struct evsel *evsel) { return list_entry(evsel->core.node.next, struct evsel, core.node); } -static inline struct evsel *perf_evsel__prev(struct evsel *evsel) +static inline struct evsel *evsel__prev(struct evsel *evsel) { return list_entry(evsel->core.node.prev, struct evsel, core.node); } diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index dc15ddc18b7d..dc23b349fff9 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -2354,7 +2354,7 @@ static struct evsel *find_evsel(struct evlist *evlist, char *event_name) evsel = evlist__first(evlist); while (--nr > 0) - evsel = perf_evsel__next(evsel); + evsel = evsel__next(evsel); return evsel; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 72/91] perf evsel: Rename perf_evsel__has*() to evsel__has*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (70 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 71/91] perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 73/91] perf evsel: Rename perf_evsel__fallback() to evsel__fallback() Arnaldo Carvalho de Melo ` (18 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those are 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/evsel.c | 2 +- tools/perf/util/evsel.h | 4 ++-- tools/perf/util/machine.c | 2 +- tools/perf/util/session.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index b63d9eebe42f..909e993b4dcd 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2159,7 +2159,7 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event, return -EFAULT; sz = data->branch_stack->nr * sizeof(struct branch_entry); - if (perf_evsel__has_branch_hw_idx(evsel)) + if (evsel__has_branch_hw_idx(evsel)) sz += sizeof(u64); else data->no_hw_idx = true; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index a84a4f6bcf31..101cfff647c7 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -372,12 +372,12 @@ for ((_evsel) = _leader; \ (_evsel) && (_evsel)->leader == (_leader); \ (_evsel) = list_entry((_evsel)->core.node.next, struct evsel, core.node)) -static inline bool perf_evsel__has_branch_callstack(const struct evsel *evsel) +static inline bool evsel__has_branch_callstack(const struct evsel *evsel) { return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; } -static inline bool perf_evsel__has_branch_hw_idx(const struct evsel *evsel) +static inline bool evsel__has_branch_hw_idx(const struct evsel *evsel) { return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_HW_INDEX; } diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 5ac32cabe4e6..da630e9339d3 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2618,7 +2618,7 @@ static int thread__resolve_callchain_sample(struct thread *thread, if (chain) chain_nr = chain->nr; - if (perf_evsel__has_branch_callstack(evsel)) { + if (evsel__has_branch_callstack(evsel)) { struct perf_env *env = perf_evsel__env(evsel); err = resolve_lbr_callchain_sample(thread, cursor, sample, parent, diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 7f7d3a1989fd..c11d89e0ee55 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1059,7 +1059,7 @@ static void callchain__printf(struct evsel *evsel, unsigned int i; struct ip_callchain *callchain = sample->callchain; - if (perf_evsel__has_branch_callstack(evsel)) + if (evsel__has_branch_callstack(evsel)) callchain__lbr_callstack_printf(sample); printf("... FP chain: nr:%" PRIu64 "\n", callchain->nr); @@ -1244,7 +1244,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event, callchain__printf(evsel, sample); if (evsel__has_br_stack(evsel)) - branch_stack__printf(sample, perf_evsel__has_branch_callstack(evsel)); + branch_stack__printf(sample, evsel__has_branch_callstack(evsel)); if (sample_type & PERF_SAMPLE_REGS_USER) regs_user__printf(sample); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 73/91] perf evsel: Rename perf_evsel__fallback() to evsel__fallback() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (71 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 72/91] perf evsel: Rename perf_evsel__has*() to evsel__has*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 74/91] perf evsel: Rename perf_evsel__group_idx() to evsel__group_idx() Arnaldo Carvalho de Melo ` (17 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/util/cloexec.c | 2 +- tools/perf/util/evsel.c | 3 +-- tools/perf/util/evsel.h | 3 +-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index ab303c4165ac..46aaa6b14ca1 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -845,7 +845,7 @@ static int record__open(struct record *rec) evlist__for_each_entry(evlist, pos) { try_again: if (evsel__open(pos, pos->core.cpus, pos->core.threads) < 0) { - if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) { + if (evsel__fallback(pos, errno, msg, sizeof(msg))) { if (verbose > 0) ui__warning("%s\n", msg); goto try_again; diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e3629ca69827..92a59f08db71 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -466,7 +466,7 @@ static enum counter_recovery stat_handle_error(struct evsel *counter) if ((counter->leader != counter) || !(counter->leader->core.nr_members > 1)) return COUNTER_SKIP; - } else if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) { + } else if (evsel__fallback(counter, errno, msg, sizeof(msg))) { if (verbose > 0) ui__warning("%s\n", msg); return COUNTER_RETRY; diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4403a76f2047..d5bfffed2843 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1045,7 +1045,7 @@ static int perf_top__start_counters(struct perf_top *top) perf_top_overwrite_fallback(top, counter)) goto try_again; - if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) { + if (evsel__fallback(counter, errno, msg, sizeof(msg))) { if (verbose > 0) ui__warning("%s\n", msg); goto try_again; diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c index a12872f2856a..6b3988a7aba8 100644 --- a/tools/perf/util/cloexec.c +++ b/tools/perf/util/cloexec.c @@ -28,7 +28,7 @@ int __weak sched_getcpu(void) static int perf_flag_probe(void) { - /* use 'safest' configuration as used in perf_evsel__fallback() */ + /* use 'safest' configuration as used in evsel__fallback() */ struct perf_event_attr attr = { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_CLOCK, diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 909e993b4dcd..a75bcb95bf23 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2382,8 +2382,7 @@ u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *n return field ? format_field__intval(field, sample, evsel->needs_swap) : 0; } -bool perf_evsel__fallback(struct evsel *evsel, int err, - char *msg, size_t msgsize) +bool evsel__fallback(struct evsel *evsel, int err, char *msg, size_t msgsize) { int paranoid; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 101cfff647c7..783246bf8d0d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -350,8 +350,7 @@ static inline bool evsel__is_clock(struct evsel *evsel) evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK); } -bool perf_evsel__fallback(struct evsel *evsel, int err, - char *msg, size_t msgsize); +bool evsel__fallback(struct evsel *evsel, int err, char *msg, size_t msgsize); int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, int err, char *msg, size_t size); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 74/91] perf evsel: Rename perf_evsel__group_idx() to evsel__group_idx() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (72 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 73/91] perf evsel: Rename perf_evsel__fallback() to evsel__fallback() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 75/91] perf evsel: Rename perf_evsel__env() to evsel__env() Arnaldo Carvalho de Melo ` (16 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 3 +-- tools/perf/builtin-stat.c | 3 +-- tools/perf/builtin-top.c | 3 +-- tools/perf/tests/parse-events.c | 44 ++++++++++++++++----------------- tools/perf/ui/hist.c | 10 ++++---- tools/perf/util/evsel.c | 7 +++--- tools/perf/util/evsel.h | 6 ++--- 7 files changed, 36 insertions(+), 40 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 46aaa6b14ca1..e4efdbf1a81e 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -857,8 +857,7 @@ static int record__open(struct record *rec) goto try_again; } rc = -errno; - perf_evsel__open_strerror(pos, &opts->target, - errno, msg, sizeof(msg)); + evsel__open_strerror(pos, &opts->target, errno, msg, sizeof(msg)); ui__error("%s\n", msg); goto out; } diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 92a59f08db71..188b2f957856 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -484,8 +484,7 @@ static enum counter_recovery stat_handle_error(struct evsel *counter) } } - perf_evsel__open_strerror(counter, &target, - errno, msg, sizeof(msg)); + evsel__open_strerror(counter, &target, errno, msg, sizeof(msg)); ui__error("%s\n", msg); if (child_pid != -1) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index d5bfffed2843..372c38254654 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1051,8 +1051,7 @@ static int perf_top__start_counters(struct perf_top *top) goto try_again; } - perf_evsel__open_strerror(counter, &opts->target, - errno, msg, sizeof(msg)); + evsel__open_strerror(counter, &opts->target, errno, msg, sizeof(msg)); ui__error("%s\n", msg); goto out_err; } diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 5b90ee3eda71..895188b63f96 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -654,7 +654,7 @@ static int test__group1(struct evlist *evlist) TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cycles:upp */ @@ -670,7 +670,7 @@ static int test__group1(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); return 0; @@ -696,7 +696,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cache-references + :u modifier */ @@ -711,7 +711,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cycles:k */ @@ -754,7 +754,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong group name", !strcmp(leader->group_name, "group1")); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* group1 cycles:kppp */ @@ -771,7 +771,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 3); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); TEST_ASSERT_VAL("wrong group name", !evsel->group_name); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* group2 cycles + G modifier */ @@ -789,7 +789,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong group name", !strcmp(leader->group_name, "group2")); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* group2 1:3 + G modifier */ @@ -803,7 +803,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions:u */ @@ -845,7 +845,7 @@ static int test__group4(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions:kp + p */ @@ -861,7 +861,7 @@ static int test__group4(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); return 0; @@ -888,7 +888,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions + G */ @@ -903,7 +903,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* cycles:G */ @@ -920,7 +920,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); /* instructions:G */ @@ -935,7 +935,7 @@ static int test__group5(struct evlist *evlist __maybe_unused) TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); /* cycles */ evsel = evsel__next(evsel); @@ -974,7 +974,7 @@ static int test__group_gh1(struct evlist *evlist) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); /* cache-misses:G + :H group modifier */ evsel = evsel__next(evsel); @@ -988,7 +988,7 @@ static int test__group_gh1(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); return 0; } @@ -1014,7 +1014,7 @@ static int test__group_gh2(struct evlist *evlist) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); /* cache-misses:H + :G group modifier */ evsel = evsel__next(evsel); @@ -1028,7 +1028,7 @@ static int test__group_gh2(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); return 0; } @@ -1054,7 +1054,7 @@ static int test__group_gh3(struct evlist *evlist) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); /* cache-misses:H + :u group modifier */ evsel = evsel__next(evsel); @@ -1068,7 +1068,7 @@ static int test__group_gh3(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); return 0; } @@ -1094,7 +1094,7 @@ static int test__group_gh4(struct evlist *evlist) TEST_ASSERT_VAL("wrong group name", !evsel->group_name); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); /* cache-misses:H + :uG group modifier */ evsel = evsel__next(evsel); @@ -1108,7 +1108,7 @@ static int test__group_gh4(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); return 0; } diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 1a83614901a4..c1f24d004852 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -48,7 +48,7 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, struct hist_entry *pair; int nr_members = evsel->core.nr_members; - prev_idx = perf_evsel__group_idx(evsel); + prev_idx = evsel__group_idx(evsel); list_for_each_entry(pair, &he->pairs.head, pairs.node) { u64 period = get_field(pair); @@ -58,7 +58,7 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, continue; evsel = hists_to_evsel(pair->hists); - idx_delta = perf_evsel__group_idx(evsel) - prev_idx - 1; + idx_delta = evsel__group_idx(evsel) - prev_idx - 1; while (idx_delta--) { /* @@ -82,7 +82,7 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he, len, period); } - prev_idx = perf_evsel__group_idx(evsel); + prev_idx = evsel__group_idx(evsel); } idx_delta = nr_members - prev_idx - 1; @@ -164,12 +164,12 @@ static int hist_entry__new_pair(struct hist_entry *a, struct hist_entry *b, list_for_each_entry(pair, &a->pairs.head, pairs.node) { struct evsel *evsel = hists_to_evsel(pair->hists); - fa[perf_evsel__group_idx(evsel)] = get_field(pair); + fa[evsel__group_idx(evsel)] = get_field(pair); } list_for_each_entry(pair, &b->pairs.head, pairs.node) { struct evsel *evsel = hists_to_evsel(pair->hists); - fb[perf_evsel__group_idx(evsel)] = get_field(pair); + fb[evsel__group_idx(evsel)] = get_field(pair); } *fields_a = fa; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index a75bcb95bf23..5908cd8761d9 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1721,8 +1721,7 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, /* * If we succeeded but had to kill clockid, fail and - * have perf_evsel__open_strerror() print us a nice - * error. + * have evsel__open_strerror() print us a nice error. */ if (perf_missing_features.clockid || perf_missing_features.clockid_wrong) { @@ -2474,8 +2473,8 @@ static bool find_process(const char *name) return ret ? false : true; } -int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, - int err, char *msg, size_t size) +int evsel__open_strerror(struct evsel *evsel, struct target *target, + int err, char *msg, size_t size) { char sbuf[STRERR_BUFSIZE]; int printed = 0; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 783246bf8d0d..9de7efb83ffc 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -351,10 +351,10 @@ static inline bool evsel__is_clock(struct evsel *evsel) } bool evsel__fallback(struct evsel *evsel, int err, char *msg, size_t msgsize); -int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, - int err, char *msg, size_t size); +int evsel__open_strerror(struct evsel *evsel, struct target *target, + int err, char *msg, size_t size); -static inline int perf_evsel__group_idx(struct evsel *evsel) +static inline int evsel__group_idx(struct evsel *evsel) { return evsel->idx - evsel->leader->idx; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 75/91] perf evsel: Rename perf_evsel__env() to evsel__env() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (73 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 74/91] perf evsel: Rename perf_evsel__group_idx() to evsel__group_idx() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 76/91] perf evsel: Rename perf_evsel__store_ids() to evsel__store_id() Arnaldo Carvalho de Melo ` (15 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-trace.c | 2 +- tools/perf/util/annotate.c | 2 +- tools/perf/util/evsel.c | 2 +- tools/perf/util/evsel.h | 2 +- tools/perf/util/machine.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 025e190fd1c2..31575713ad0b 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2382,7 +2382,7 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_sample *sam static const char *errno_to_name(struct evsel *evsel, int err) { - struct perf_env *env = perf_evsel__env(evsel); + struct perf_env *env = evsel__env(evsel); const char *arch_name = perf_env__arch(env); return arch_syscalls__strerrno(arch_name, err); diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index dc3342f5586b..d828c2d2edee 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2156,7 +2156,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel, .evsel = evsel, .options = options, }; - struct perf_env *env = perf_evsel__env(evsel); + struct perf_env *env = evsel__env(evsel); const char *arch_name = perf_env__arch(env); struct arch *arch; int err; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 5908cd8761d9..32d178a3f933 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2563,7 +2563,7 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, err, str_error_r(err, sbuf, sizeof(sbuf)), evsel__name(evsel)); } -struct perf_env *perf_evsel__env(struct evsel *evsel) +struct perf_env *evsel__env(struct evsel *evsel) { if (evsel && evsel->evlist) return evsel->evlist->env; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 9de7efb83ffc..d76111c2d6a8 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -401,7 +401,7 @@ static inline bool evsel__has_br_stack(const struct evsel *evsel) evsel->synth_sample_type & PERF_SAMPLE_BRANCH_STACK; } -struct perf_env *perf_evsel__env(struct evsel *evsel); +struct perf_env *evsel__env(struct evsel *evsel); int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist); #endif /* __PERF_EVSEL_H */ diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index da630e9339d3..8ed2135893bb 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2619,7 +2619,7 @@ static int thread__resolve_callchain_sample(struct thread *thread, chain_nr = chain->nr; if (evsel__has_branch_callstack(evsel)) { - struct perf_env *env = perf_evsel__env(evsel); + struct perf_env *env = evsel__env(evsel); err = resolve_lbr_callchain_sample(thread, cursor, sample, parent, root_al, max_stack, -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 76/91] perf evsel: Rename perf_evsel__store_ids() to evsel__store_id() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (74 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 75/91] perf evsel: Rename perf_evsel__env() to evsel__env() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 77/91] perf stat: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() Arnaldo Carvalho de Melo ` (14 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As it is a 'struct evsel' method, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 2 +- tools/perf/util/evsel.c | 2 +- tools/perf/util/evsel.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 188b2f957856..b2a971961364 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -636,7 +636,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) stat_config.unit_width = l; if (perf_evsel__should_store_id(counter) && - perf_evsel__store_ids(counter, evsel_list)) + evsel__store_ids(counter, evsel_list)) return -1; } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 32d178a3f933..f3e60c45d59a 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2588,7 +2588,7 @@ static int store_evsel_ids(struct evsel *evsel, struct evlist *evlist) return 0; } -int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist) +int evsel__store_ids(struct evsel *evsel, struct evlist *evlist) { struct perf_cpu_map *cpus = evsel->core.cpus; struct perf_thread_map *threads = evsel->core.threads; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index d76111c2d6a8..351c0aaf2a11 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -403,5 +403,5 @@ static inline bool evsel__has_br_stack(const struct evsel *evsel) struct perf_env *evsel__env(struct evsel *evsel); -int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist); +int evsel__store_ids(struct evsel *evsel, struct evlist *evlist); #endif /* __PERF_EVSEL_H */ -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 77/91] perf stat: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (75 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 76/91] perf evsel: Rename perf_evsel__store_ids() to evsel__store_id() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 78/91] perf kmem: " Arnaldo Carvalho de Melo ` (13 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index b2a971961364..e0c1ad23c768 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -238,9 +238,8 @@ static int write_stat_round_event(u64 tm, u64 type) #define SID(e, x, y) xyarray__entry(e->core.sample_id, x, y) -static int -perf_evsel__write_stat_event(struct evsel *counter, u32 cpu, u32 thread, - struct perf_counts_values *count) +static int evsel__write_stat_event(struct evsel *counter, u32 cpu, u32 thread, + struct perf_counts_values *count) { struct perf_sample_id *sid = SID(counter, cpu, thread); @@ -297,7 +296,7 @@ static int read_counter_cpu(struct evsel *counter, struct timespec *rs, int cpu) perf_counts__set_loaded(counter->counts, cpu, thread, false); if (STAT_RECORD) { - if (perf_evsel__write_stat_event(counter, cpu, thread, count)) { + if (evsel__write_stat_event(counter, cpu, thread, count)) { pr_err("failed to write stat event\n"); return -1; } @@ -410,7 +409,7 @@ static void workload_exec_failed_signal(int signo __maybe_unused, siginfo_t *inf workload_exec_errno = info->si_value.sival_int; } -static bool perf_evsel__should_store_id(struct evsel *counter) +static bool evsel__should_store_id(struct evsel *counter) { return STAT_RECORD || counter->core.attr.read_format & PERF_FORMAT_ID; } @@ -635,7 +634,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) if (l > stat_config.unit_width) stat_config.unit_width = l; - if (perf_evsel__should_store_id(counter) && + if (evsel__should_store_id(counter) && evsel__store_ids(counter, evsel_list)) return -1; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 78/91] perf kmem: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (76 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 77/91] perf stat: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 79/91] perf lock: " Arnaldo Carvalho de Melo ` (12 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-kmem.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 0a296fbf9194..38a5ab683ebc 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -169,8 +169,7 @@ static int insert_caller_stat(unsigned long call_site, return 0; } -static int perf_evsel__process_alloc_event(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_alloc_event(struct evsel *evsel, struct perf_sample *sample) { unsigned long ptr = evsel__intval(evsel, sample, "ptr"), call_site = evsel__intval(evsel, sample, "call_site"); @@ -188,10 +187,9 @@ static int perf_evsel__process_alloc_event(struct evsel *evsel, return 0; } -static int perf_evsel__process_alloc_node_event(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_alloc_node_event(struct evsel *evsel, struct perf_sample *sample) { - int ret = perf_evsel__process_alloc_event(evsel, sample); + int ret = evsel__process_alloc_event(evsel, sample); if (!ret) { int node1 = cpu__get_node(sample->cpu), @@ -232,8 +230,7 @@ static struct alloc_stat *search_alloc_stat(unsigned long ptr, return NULL; } -static int perf_evsel__process_free_event(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_free_event(struct evsel *evsel, struct perf_sample *sample) { unsigned long ptr = evsel__intval(evsel, sample, "ptr"); struct alloc_stat *s_alloc, *s_caller; @@ -784,8 +781,7 @@ static int parse_gfp_flags(struct evsel *evsel, struct perf_sample *sample, return 0; } -static int perf_evsel__process_page_alloc_event(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_page_alloc_event(struct evsel *evsel, struct perf_sample *sample) { u64 page; unsigned int order = evsel__intval(evsel, sample, "order"); @@ -857,8 +853,7 @@ static int perf_evsel__process_page_alloc_event(struct evsel *evsel, return 0; } -static int perf_evsel__process_page_free_event(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_page_free_event(struct evsel *evsel, struct perf_sample *sample) { u64 page; unsigned int order = evsel__intval(evsel, sample, "order"); @@ -1371,15 +1366,15 @@ static int __cmd_kmem(struct perf_session *session) struct evsel *evsel; const struct evsel_str_handler kmem_tracepoints[] = { /* slab allocator */ - { "kmem:kmalloc", perf_evsel__process_alloc_event, }, - { "kmem:kmem_cache_alloc", perf_evsel__process_alloc_event, }, - { "kmem:kmalloc_node", perf_evsel__process_alloc_node_event, }, - { "kmem:kmem_cache_alloc_node", perf_evsel__process_alloc_node_event, }, - { "kmem:kfree", perf_evsel__process_free_event, }, - { "kmem:kmem_cache_free", perf_evsel__process_free_event, }, + { "kmem:kmalloc", evsel__process_alloc_event, }, + { "kmem:kmem_cache_alloc", evsel__process_alloc_event, }, + { "kmem:kmalloc_node", evsel__process_alloc_node_event, }, + { "kmem:kmem_cache_alloc_node", evsel__process_alloc_node_event, }, + { "kmem:kfree", evsel__process_free_event, }, + { "kmem:kmem_cache_free", evsel__process_free_event, }, /* page allocator */ - { "kmem:mm_page_alloc", perf_evsel__process_page_alloc_event, }, - { "kmem:mm_page_free", perf_evsel__process_page_free_event, }, + { "kmem:mm_page_alloc", evsel__process_page_alloc_event, }, + { "kmem:mm_page_free", evsel__process_page_free_event, }, }; if (!perf_session__has_traces(session, "kmem record")) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 79/91] perf lock: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (77 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 78/91] perf kmem: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 80/91] perf sched: " Arnaldo Carvalho de Melo ` (11 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-lock.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 5a19dc2f1636..f0a1dbacb46c 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -657,32 +657,28 @@ static struct trace_lock_handler report_lock_ops = { static struct trace_lock_handler *trace_handler; -static int perf_evsel__process_lock_acquire(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_lock_acquire(struct evsel *evsel, struct perf_sample *sample) { if (trace_handler->acquire_event) return trace_handler->acquire_event(evsel, sample); return 0; } -static int perf_evsel__process_lock_acquired(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_lock_acquired(struct evsel *evsel, struct perf_sample *sample) { if (trace_handler->acquired_event) return trace_handler->acquired_event(evsel, sample); return 0; } -static int perf_evsel__process_lock_contended(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_lock_contended(struct evsel *evsel, struct perf_sample *sample) { if (trace_handler->contended_event) return trace_handler->contended_event(evsel, sample); return 0; } -static int perf_evsel__process_lock_release(struct evsel *evsel, - struct perf_sample *sample) +static int evsel__process_lock_release(struct evsel *evsel, struct perf_sample *sample) { if (trace_handler->release_event) return trace_handler->release_event(evsel, sample); @@ -849,10 +845,10 @@ static void sort_result(void) } static const struct evsel_str_handler lock_tracepoints[] = { - { "lock:lock_acquire", perf_evsel__process_lock_acquire, }, /* CONFIG_LOCKDEP */ - { "lock:lock_acquired", perf_evsel__process_lock_acquired, }, /* CONFIG_LOCKDEP, CONFIG_LOCK_STAT */ - { "lock:lock_contended", perf_evsel__process_lock_contended, }, /* CONFIG_LOCKDEP, CONFIG_LOCK_STAT */ - { "lock:lock_release", perf_evsel__process_lock_release, }, /* CONFIG_LOCKDEP */ + { "lock:lock_acquire", evsel__process_lock_acquire, }, /* CONFIG_LOCKDEP */ + { "lock:lock_acquired", evsel__process_lock_acquired, }, /* CONFIG_LOCKDEP, CONFIG_LOCK_STAT */ + { "lock:lock_contended", evsel__process_lock_contended, }, /* CONFIG_LOCKDEP, CONFIG_LOCK_STAT */ + { "lock:lock_release", evsel__process_lock_release, }, /* CONFIG_LOCKDEP */ }; static bool force; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 80/91] perf sched: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (78 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 79/91] perf lock: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 81/91] perf script: " Arnaldo Carvalho de Melo ` (10 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-sched.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index b99398031131..459e4229945e 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1848,7 +1848,7 @@ static inline void print_sched_time(unsigned long long nsecs, int width) * returns runtime data for event, allocating memory for it the * first time it is used. */ -static struct evsel_runtime *perf_evsel__get_runtime(struct evsel *evsel) +static struct evsel_runtime *evsel__get_runtime(struct evsel *evsel) { struct evsel_runtime *r = evsel->priv; @@ -1863,10 +1863,9 @@ static struct evsel_runtime *perf_evsel__get_runtime(struct evsel *evsel) /* * save last time event was seen per cpu */ -static void perf_evsel__save_time(struct evsel *evsel, - u64 timestamp, u32 cpu) +static void evsel__save_time(struct evsel *evsel, u64 timestamp, u32 cpu) { - struct evsel_runtime *r = perf_evsel__get_runtime(evsel); + struct evsel_runtime *r = evsel__get_runtime(evsel); if (r == NULL) return; @@ -1890,9 +1889,9 @@ static void perf_evsel__save_time(struct evsel *evsel, } /* returns last time this event was seen on the given cpu */ -static u64 perf_evsel__get_time(struct evsel *evsel, u32 cpu) +static u64 evsel__get_time(struct evsel *evsel, u32 cpu) { - struct evsel_runtime *r = perf_evsel__get_runtime(evsel); + struct evsel_runtime *r = evsel__get_runtime(evsel); if ((r == NULL) || (r->last_time == NULL) || (cpu >= r->ncpu)) return 0; @@ -2548,7 +2547,7 @@ static int timehist_sched_change_event(struct perf_tool *tool, goto out; } - tprev = perf_evsel__get_time(evsel, sample->cpu); + tprev = evsel__get_time(evsel, sample->cpu); /* * If start time given: @@ -2631,7 +2630,7 @@ static int timehist_sched_change_event(struct perf_tool *tool, tr->ready_to_run = 0; } - perf_evsel__save_time(evsel, sample->time, sample->cpu); + evsel__save_time(evsel, sample->time, sample->cpu); return rc; } @@ -2941,7 +2940,7 @@ static int timehist_check_attr(struct perf_sched *sched, struct evsel_runtime *er; list_for_each_entry(evsel, &evlist->core.entries, core.node) { - er = perf_evsel__get_runtime(evsel); + er = evsel__get_runtime(evsel); if (er == NULL) { pr_err("Failed to allocate memory for evsel runtime data\n"); return -1; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 81/91] perf script: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (79 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 80/91] perf sched: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 82/91] perf trace: " Arnaldo Carvalho de Melo ` (9 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 53 +++++++++++++------------------------ 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index fee56474377b..56d7bcd12671 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -351,10 +351,8 @@ static const char *output_field2str(enum perf_output_field field) #define PRINT_FIELD(x) (output[output_type(attr->type)].fields & PERF_OUTPUT_##x) -static int perf_evsel__do_check_stype(struct evsel *evsel, - u64 sample_type, const char *sample_msg, - enum perf_output_field field, - bool allow_user_set) +static int evsel__do_check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg, + enum perf_output_field field, bool allow_user_set) { struct perf_event_attr *attr = &evsel->core.attr; int type = output_type(attr->type); @@ -383,16 +381,13 @@ static int perf_evsel__do_check_stype(struct evsel *evsel, return 0; } -static int perf_evsel__check_stype(struct evsel *evsel, - u64 sample_type, const char *sample_msg, - enum perf_output_field field) +static int evsel__check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg, + enum perf_output_field field) { - return perf_evsel__do_check_stype(evsel, sample_type, sample_msg, field, - false); + return evsel__do_check_stype(evsel, sample_type, sample_msg, field, false); } -static int perf_evsel__check_attr(struct evsel *evsel, - struct perf_session *session) +static int perf_evsel__check_attr(struct evsel *evsel, struct perf_session *session) { struct perf_event_attr *attr = &evsel->core.attr; bool allow_user_set; @@ -404,32 +399,28 @@ static int perf_evsel__check_attr(struct evsel *evsel, HEADER_AUXTRACE); if (PRINT_FIELD(TRACE) && - !perf_session__has_traces(session, "record -R")) + !perf_session__has_traces(session, "record -R")) return -EINVAL; if (PRINT_FIELD(IP)) { - if (perf_evsel__check_stype(evsel, PERF_SAMPLE_IP, "IP", - PERF_OUTPUT_IP)) + if (evsel__check_stype(evsel, PERF_SAMPLE_IP, "IP", PERF_OUTPUT_IP)) return -EINVAL; } if (PRINT_FIELD(ADDR) && - perf_evsel__do_check_stype(evsel, PERF_SAMPLE_ADDR, "ADDR", - PERF_OUTPUT_ADDR, allow_user_set)) + evsel__do_check_stype(evsel, PERF_SAMPLE_ADDR, "ADDR", PERF_OUTPUT_ADDR, allow_user_set)) return -EINVAL; if (PRINT_FIELD(DATA_SRC) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", - PERF_OUTPUT_DATA_SRC)) + evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", PERF_OUTPUT_DATA_SRC)) return -EINVAL; if (PRINT_FIELD(WEIGHT) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", - PERF_OUTPUT_WEIGHT)) + evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", PERF_OUTPUT_WEIGHT)) return -EINVAL; if (PRINT_FIELD(SYM) && - !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { + !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { pr_err("Display of symbols requested but neither sample IP nor " "sample address\navailable. Hence, no addresses to convert " "to symbols.\n"); @@ -441,7 +432,7 @@ static int perf_evsel__check_attr(struct evsel *evsel, return -EINVAL; } if (PRINT_FIELD(DSO) && - !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { + !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { pr_err("Display of DSO requested but no address to convert.\n"); return -EINVAL; } @@ -458,33 +449,27 @@ static int perf_evsel__check_attr(struct evsel *evsel, return -EINVAL; } if ((PRINT_FIELD(PID) || PRINT_FIELD(TID)) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID", - PERF_OUTPUT_TID|PERF_OUTPUT_PID)) + evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID", PERF_OUTPUT_TID|PERF_OUTPUT_PID)) return -EINVAL; if (PRINT_FIELD(TIME) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_TIME, "TIME", - PERF_OUTPUT_TIME)) + evsel__check_stype(evsel, PERF_SAMPLE_TIME, "TIME", PERF_OUTPUT_TIME)) return -EINVAL; if (PRINT_FIELD(CPU) && - perf_evsel__do_check_stype(evsel, PERF_SAMPLE_CPU, "CPU", - PERF_OUTPUT_CPU, allow_user_set)) + evsel__do_check_stype(evsel, PERF_SAMPLE_CPU, "CPU", PERF_OUTPUT_CPU, allow_user_set)) return -EINVAL; if (PRINT_FIELD(IREGS) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS", - PERF_OUTPUT_IREGS)) + evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS", PERF_OUTPUT_IREGS)) return -EINVAL; if (PRINT_FIELD(UREGS) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", - PERF_OUTPUT_UREGS)) + evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", PERF_OUTPUT_UREGS)) return -EINVAL; if (PRINT_FIELD(PHYS_ADDR) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", - PERF_OUTPUT_PHYS_ADDR)) + evsel__check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", PERF_OUTPUT_PHYS_ADDR)) return -EINVAL; return 0; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 82/91] perf trace: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (80 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 81/91] perf script: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 83/91] perf annotate: " Arnaldo Carvalho de Melo ` (8 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-trace.c | 54 ++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 31575713ad0b..a46efb907bd4 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -366,9 +366,7 @@ static struct syscall_arg_fmt *evsel__syscall_arg_fmt(struct evsel *evsel) return NULL; } -static int perf_evsel__init_tp_uint_field(struct evsel *evsel, - struct tp_field *field, - const char *name) +static int evsel__init_tp_uint_field(struct evsel *evsel, struct tp_field *field, const char *name) { struct tep_format_field *format_field = evsel__field(evsel, name); @@ -380,11 +378,9 @@ static int perf_evsel__init_tp_uint_field(struct evsel *evsel, #define perf_evsel__init_sc_tp_uint_field(evsel, name) \ ({ struct syscall_tp *sc = __evsel__syscall_tp(evsel);\ - perf_evsel__init_tp_uint_field(evsel, &sc->name, #name); }) + evsel__init_tp_uint_field(evsel, &sc->name, #name); }) -static int perf_evsel__init_tp_ptr_field(struct evsel *evsel, - struct tp_field *field, - const char *name) +static int evsel__init_tp_ptr_field(struct evsel *evsel, struct tp_field *field, const char *name) { struct tep_format_field *format_field = evsel__field(evsel, name); @@ -396,7 +392,7 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel, #define perf_evsel__init_sc_tp_ptr_field(evsel, name) \ ({ struct syscall_tp *sc = __evsel__syscall_tp(evsel);\ - perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); }) + evsel__init_tp_ptr_field(evsel, &sc->name, #name); }) static void evsel__delete_priv(struct evsel *evsel) { @@ -404,13 +400,13 @@ static void evsel__delete_priv(struct evsel *evsel) evsel__delete(evsel); } -static int perf_evsel__init_syscall_tp(struct evsel *evsel) +static int evsel__init_syscall_tp(struct evsel *evsel) { struct syscall_tp *sc = evsel__syscall_tp(evsel); if (sc != NULL) { - if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") && - perf_evsel__init_tp_uint_field(evsel, &sc->id, "nr")) + if (evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") && + evsel__init_tp_uint_field(evsel, &sc->id, "nr")) return -ENOENT; return 0; } @@ -418,7 +414,7 @@ static int perf_evsel__init_syscall_tp(struct evsel *evsel) return -ENOMEM; } -static int perf_evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evsel *tp) +static int evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evsel *tp) { struct syscall_tp *sc = evsel__syscall_tp(evsel); @@ -436,21 +432,21 @@ static int perf_evsel__init_augmented_syscall_tp(struct evsel *evsel, struct evs return -ENOMEM; } -static int perf_evsel__init_augmented_syscall_tp_args(struct evsel *evsel) +static int evsel__init_augmented_syscall_tp_args(struct evsel *evsel) { struct syscall_tp *sc = __evsel__syscall_tp(evsel); return __tp_field__init_ptr(&sc->args, sc->id.offset + sizeof(u64)); } -static int perf_evsel__init_augmented_syscall_tp_ret(struct evsel *evsel) +static int evsel__init_augmented_syscall_tp_ret(struct evsel *evsel) { struct syscall_tp *sc = __evsel__syscall_tp(evsel); return __tp_field__init_uint(&sc->ret, sizeof(u64), sc->id.offset + sizeof(u64), evsel->needs_swap); } -static int perf_evsel__init_raw_syscall_tp(struct evsel *evsel, void *handler) +static int evsel__init_raw_syscall_tp(struct evsel *evsel, void *handler) { if (evsel__syscall_tp(evsel) != NULL) { if (perf_evsel__init_sc_tp_uint_field(evsel, id)) @@ -474,7 +470,7 @@ static struct evsel *perf_evsel__raw_syscall_newtp(const char *direction, void * if (IS_ERR(evsel)) return NULL; - if (perf_evsel__init_raw_syscall_tp(evsel, handler)) + if (evsel__init_raw_syscall_tp(evsel, handler)) goto out_delete; return evsel; @@ -1801,7 +1797,7 @@ static int trace__read_syscall_info(struct trace *trace, int id) return syscall__set_arg_fmts(sc); } -static int perf_evsel__init_tp_arg_scnprintf(struct evsel *evsel) +static int evsel__init_tp_arg_scnprintf(struct evsel *evsel) { struct syscall_arg_fmt *fmt = evsel__syscall_arg_fmt(evsel); @@ -3694,7 +3690,7 @@ static int ordered_events__deliver_event(struct ordered_events *oe, return __trace__deliver_event(trace, event->event); } -static struct syscall_arg_fmt *perf_evsel__syscall_arg_fmt(struct evsel *evsel, char *arg) +static struct syscall_arg_fmt *evsel__find_syscall_arg_fmt_by_name(struct evsel *evsel, char *arg) { struct tep_format_field *field; struct syscall_arg_fmt *fmt = __evsel__syscall_arg_fmt(evsel); @@ -3749,7 +3745,7 @@ static int trace__expand_filter(struct trace *trace __maybe_unused, struct evsel scnprintf(arg, sizeof(arg), "%.*s", left_size, left); - fmt = perf_evsel__syscall_arg_fmt(evsel, arg); + fmt = evsel__find_syscall_arg_fmt_by_name(evsel, arg); if (fmt == NULL) { pr_err("\"%s\" not found in \"%s\", can't set filter \"%s\"\n", arg, evsel->name, evsel->filter); @@ -4178,7 +4174,7 @@ static int trace__replay(struct trace *trace) "syscalls:sys_enter"); if (evsel && - (perf_evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 || + (evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 || perf_evsel__init_sc_tp_ptr_field(evsel, args))) { pr_err("Error during initialize raw_syscalls:sys_enter event\n"); goto out; @@ -4190,7 +4186,7 @@ static int trace__replay(struct trace *trace) evsel = perf_evlist__find_tracepoint_by_name(session->evlist, "syscalls:sys_exit"); if (evsel && - (perf_evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 || + (evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 || perf_evsel__init_sc_tp_uint_field(evsel, ret))) { pr_err("Error during initialize raw_syscalls:sys_exit event\n"); goto out; @@ -4470,11 +4466,11 @@ static int evlist__set_syscall_tp_fields(struct evlist *evlist) continue; if (strcmp(evsel->tp_format->system, "syscalls")) { - perf_evsel__init_tp_arg_scnprintf(evsel); + evsel__init_tp_arg_scnprintf(evsel); continue; } - if (perf_evsel__init_syscall_tp(evsel)) + if (evsel__init_syscall_tp(evsel)) return -1; if (!strncmp(evsel->tp_format->name, "sys_enter_", 10)) { @@ -4998,8 +4994,8 @@ int cmd_trace(int argc, const char **argv) if (trace.syscalls.events.augmented->priv == NULL && strstr(evsel__name(evsel), "syscalls:sys_enter")) { struct evsel *augmented = trace.syscalls.events.augmented; - if (perf_evsel__init_augmented_syscall_tp(augmented, evsel) || - perf_evsel__init_augmented_syscall_tp_args(augmented)) + if (evsel__init_augmented_syscall_tp(augmented, evsel) || + evsel__init_augmented_syscall_tp_args(augmented)) goto out; /* * Augmented is __augmented_syscalls__ BPF_OUTPUT event @@ -5013,8 +5009,8 @@ int cmd_trace(int argc, const char **argv) * as not to filter it, then we'll handle it just like we would * for the BPF_OUTPUT one: */ - if (perf_evsel__init_augmented_syscall_tp(evsel, evsel) || - perf_evsel__init_augmented_syscall_tp_args(evsel)) + if (evsel__init_augmented_syscall_tp(evsel, evsel) || + evsel__init_augmented_syscall_tp_args(evsel)) goto out; evsel->handler = trace__sys_enter; } @@ -5022,7 +5018,7 @@ int cmd_trace(int argc, const char **argv) if (strstarts(evsel__name(evsel), "syscalls:sys_exit_")) { struct syscall_tp *sc; init_augmented_syscall_tp: - if (perf_evsel__init_augmented_syscall_tp(evsel, evsel)) + if (evsel__init_augmented_syscall_tp(evsel, evsel)) goto out; sc = __evsel__syscall_tp(evsel); /* @@ -5046,7 +5042,7 @@ int cmd_trace(int argc, const char **argv) */ if (trace.raw_augmented_syscalls) trace.raw_augmented_syscalls_args_size = (6 + 1) * sizeof(long) + sc->id.offset; - perf_evsel__init_augmented_syscall_tp_ret(evsel); + evsel__init_augmented_syscall_tp_ret(evsel); evsel->handler = trace__sys_exit; } } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 83/91] perf annotate: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (81 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 82/91] perf trace: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 84/91] perf inject: " Arnaldo Carvalho de Melo ` (7 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-annotate.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index b0e5a30755ce..d3e5a84f87a2 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -212,11 +212,9 @@ static bool has_annotation(struct perf_annotate *ann) return ui__has_annotation() || ann->use_stdio2; } -static int perf_evsel__add_sample(struct evsel *evsel, - struct perf_sample *sample, - struct addr_location *al, - struct perf_annotate *ann, - struct machine *machine) +static int evsel__add_sample(struct evsel *evsel, struct perf_sample *sample, + struct addr_location *al, struct perf_annotate *ann, + struct machine *machine) { struct hists *hists = evsel__hists(evsel); struct hist_entry *he; @@ -278,7 +276,7 @@ static int process_sample_event(struct perf_tool *tool, goto out_put; if (!al.filtered && - perf_evsel__add_sample(evsel, sample, &al, ann, machine)) { + evsel__add_sample(evsel, sample, &al, ann, machine)) { pr_warning("problem incrementing symbol count, " "skipping event\n"); ret = -1; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 84/91] perf inject: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (82 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 83/91] perf annotate: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 85/91] perf symbol: Fix kernel symbol address display Arnaldo Carvalho de Melo ` (6 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter From: Arnaldo Carvalho de Melo <acme@redhat.com> As those is a 'struct evsel' methods, not part of tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-inject.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index aad007bfb581..53932db97a79 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -561,8 +561,7 @@ static void sig_handler(int sig __maybe_unused) session_done = 1; } -static int perf_evsel__check_stype(struct evsel *evsel, - u64 sample_type, const char *sample_msg) +static int evsel__check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg) { struct perf_event_attr *attr = &evsel->core.attr; const char *name = evsel__name(evsel); @@ -625,7 +624,7 @@ static int __cmd_inject(struct perf_inject *inject) const char *name = evsel__name(evsel); if (!strcmp(name, "sched:sched_switch")) { - if (perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID")) + if (evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID")) return -EINVAL; evsel->handler = perf_inject__sched_switch; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 85/91] perf symbol: Fix kernel symbol address display 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (83 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 84/91] perf inject: " Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 86/91] perf: cs-etm: Update to build with latest opencsd version Arnaldo Carvalho de Melo ` (5 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Thomas Richter, Sumanth Korikkar, Heiko Carstens, Vasily Gorbik, Arnaldo Carvalho de Melo From: Thomas Richter <tmricht@linux.ibm.com> Running commands ./perf record -e rb0000 -- find . ./perf report -v reveals symbol names and its addresses. There is a mismatch between kernel symbol and address. Here is an example for kernel symbol check_chain_key: 3.55% find /lib/modules/.../build/vmlinux 0xf11ec v [k] check_chain_key This address is off by 0xff000 as can be seen with: [root@t35lp46 ~]# fgrep check_chain_key /proc/kallsyms 00000000001f00d0 t check_chain_key [root@t35lp46 ~]# objdump -t ~/linux/vmlinux| fgrep check_chain_key 00000000001f00d0 l F .text 00000000000001e8 check_chain_key [root@t35lp46 ~]# This function is located in main memory 0x1f00d0 - 0x1f02b4. It has several entries in the perf data file with the correct address: [root@t35lp46 perf]# ./perf report -D -i perf.data.find-bad | \ fgrep SAMPLE| fgrep 0x1f01ec PERF_RECORD_SAMPLE(IP, 0x1): 22228/22228: 0x1f01ec period: 1300000 addr: 0 PERF_RECORD_SAMPLE(IP, 0x1): 22228/22228: 0x1f01ec period: 1300000 addr: 0 The root cause happens when reading symbol tables during perf report. A long gdb call chain leads to machine__deliver_events perf_evlist__deliver_event perf_evlist__deliver_sample build_id__mark_dso_hits thread__find_map(1) Read correct address from sample entry map__load dso__load Some more functions to end up in .... dso__load_sym. Function dso__load_syms checks for kernel relocation and symbol adjustment for the kernel and results in kernel map adjustment of kernel .text segment address (0x100000 on s390) kernel .text segment offset in file (0x1000 on s390). This results in all kernel symbol addresses to be changed by subtracting 0xff000 (on s390). For the symbol check_chain_key we end up with 0x1f00d0 - 0x100000 + 0x1000 = 0xf11d0 and this address is saved in the perf symbol table. This calculation is also applied by the mapping functions map__mapip() and map__unmapip() to map IP addresses to dso mappings. During perf report processing functions process_sample_event (builtin-report.c) machine__resolve thread__find_map hist_entry_iter_add are called. Function thread__find_map(1) takes the correct sample address and applies the mapping function map__mapip() from the kernel dso and saves the modified address in struct addr_location for further reference. From now on this address is used. Funktion process_sample_event() then calls hist_entry_iter_add() to save the address in member ip of struct hist_entry. When samples are displayed using perf_evlist__tty_browse_hists hists__fprintf hist_entry__fprintf hist_entry__snprintf __hist_entry__snprintf _hist_entry__sym_snprintf() This simply displays the address of the symbol and ignores the dso <-> map mappings done in function thread__find_map. This leads to the address mismatch. Output before: ot@t35lp46 perf]# ./perf report -v | fgrep check_chain_key 3.55% find /lib/modules/5.6.0d-perf+/build/vmlinux 0xf11ec v [k] check_chain_key [root@t35lp46 perf]# Output after: [root@t35lp46 perf]# ./perf report -v | fgrep check_chain_key 3.55% find /lib/modules/5.6.0d-perf+/build/vmlinux 0x1f01ec v [k] check_chain_key [root@t35lp46 perf]# Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Link: http://lore.kernel.org/lkml/20200415070744.59919-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/sort.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index dc23b349fff9..c1f8879f92cc 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -300,8 +300,14 @@ static int _hist_entry__sym_snprintf(struct map_symbol *ms, if (verbose > 0) { char o = map ? dso__symtab_origin(map->dso) : '!'; + u64 rip = ip; + + if (map && map->dso && map->dso->kernel + && map->dso->adjust_symbols) + rip = map->unmap_ip(map, ip); + ret += repsep_snprintf(bf, size, "%-#*llx %c ", - BITS_PER_LONG / 4 + 2, ip, o); + BITS_PER_LONG / 4 + 2, rip, o); } ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", level); -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 86/91] perf: cs-etm: Update to build with latest opencsd version. 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (84 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 85/91] perf symbol: Fix kernel symbol address display Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 87/91] perf bench: Add kallsyms parsing Arnaldo Carvalho de Melo ` (4 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Mike Leach, Leo Yan, Mathieu Poirier, Peter Zijlstra, Suzuki Poulouse, coresight, linux-arm-kernel, Arnaldo Carvalho de Melo From: Mike Leach <mike.leach@linaro.org> OpenCSD version v0.14.0 adds in a new output element. This is represented by a new value in the generic element type enum, which must be added to the handling code in perf cs-etm-decoder to prevent build errors due to build options on the perf project. This element is not currently used by the perf decoder. Perf build feature test updated to require a minimum of 0.14.0 Tested on Linux 5.7-rc3. Signed-off-by: Mike Leach <mike.leach@linaro.org> Reviewed-by: Leo Yan <leo.yan@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200501143615.1180-1-mike.leach@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/build/feature/test-libopencsd.c | 4 ++-- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c index 2b0e02c38870..1547bc2c0950 100644 --- a/tools/build/feature/test-libopencsd.c +++ b/tools/build/feature/test-libopencsd.c @@ -4,9 +4,9 @@ /* * Check OpenCSD library version is sufficient to provide required features */ -#define OCSD_MIN_VER ((0 << 16) | (11 << 8) | (0)) +#define OCSD_MIN_VER ((0 << 16) | (14 << 8) | (0)) #if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER) -#error "OpenCSD >= 0.11.0 is required" +#error "OpenCSD >= 0.14.0 is required" #endif int main(void) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index cd92a99eb89d..cd007cc9c283 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -564,6 +564,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( resp = cs_etm_decoder__set_tid(etmq, packet_queue, elem, trace_chan_id); break; + /* Unused packet types */ + case OCSD_GEN_TRC_ELEM_I_RANGE_NOPATH: case OCSD_GEN_TRC_ELEM_ADDR_NACC: case OCSD_GEN_TRC_ELEM_CYCLE_COUNT: case OCSD_GEN_TRC_ELEM_ADDR_UNKNOWN: -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 87/91] perf bench: Add kallsyms parsing 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (85 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 86/91] perf: cs-etm: Update to build with latest opencsd version Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 88/91] libsymbols kallsyms: Parse using io api Arnaldo Carvalho de Melo ` (3 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Stephane Eranian From: Ian Rogers <irogers@google.com> Add a benchmark for kallsyms parsing. Example output: Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 103.971 ms (+- 0.121 ms) Committer testing: Test Machine: AMD Ryzen 5 3600X 6-Core Processor [root@five ~]# perf bench internals kallsyms-parse # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 79.692 ms (+- 0.101 ms) [root@five ~]# perf stat -r5 perf bench internals kallsyms-parse # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 80.563 ms (+- 0.079 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 81.046 ms (+- 0.155 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 80.874 ms (+- 0.104 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 81.173 ms (+- 0.133 ms) # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 81.169 ms (+- 0.074 ms) Performance counter stats for 'perf bench internals kallsyms-parse' (5 runs): 8,093.54 msec task-clock # 0.999 CPUs utilized ( +- 0.14% ) 3,165 context-switches # 0.391 K/sec ( +- 0.18% ) 10 cpu-migrations # 0.001 K/sec ( +- 23.13% ) 744 page-faults # 0.092 K/sec ( +- 0.21% ) 34,551,564,954 cycles # 4.269 GHz ( +- 0.05% ) (83.33%) 1,160,584,308 stalled-cycles-frontend # 3.36% frontend cycles idle ( +- 1.60% ) (83.33%) 14,974,323,985 stalled-cycles-backend # 43.34% backend cycles idle ( +- 0.24% ) (83.33%) 58,712,905,705 instructions # 1.70 insn per cycle # 0.26 stalled cycles per insn ( +- 0.01% ) (83.34%) 14,136,433,778 branches # 1746.632 M/sec ( +- 0.01% ) (83.33%) 141,943,217 branch-misses # 1.00% of all branches ( +- 0.04% ) (83.33%) 8.1040 +- 0.0115 seconds time elapsed ( +- 0.14% ) [root@five ~]# Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200501221315.54715-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/bench/Build | 1 + tools/perf/bench/bench.h | 1 + tools/perf/bench/kallsyms-parse.c | 75 +++++++++++++++++++++++++++++++ tools/perf/builtin-bench.c | 1 + 4 files changed, 78 insertions(+) create mode 100644 tools/perf/bench/kallsyms-parse.c diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build index 042827385c87..768e408757a0 100644 --- a/tools/perf/bench/Build +++ b/tools/perf/bench/Build @@ -9,6 +9,7 @@ perf-y += futex-lock-pi.o perf-y += epoll-wait.o perf-y += epoll-ctl.o perf-y += synthesize.o +perf-y += kallsyms-parse.o perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-lib.o perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h index 4d669c803237..61cae4966cae 100644 --- a/tools/perf/bench/bench.h +++ b/tools/perf/bench/bench.h @@ -44,6 +44,7 @@ int bench_futex_lock_pi(int argc, const char **argv); int bench_epoll_wait(int argc, const char **argv); int bench_epoll_ctl(int argc, const char **argv); int bench_synthesize(int argc, const char **argv); +int bench_kallsyms_parse(int argc, const char **argv); #define BENCH_FORMAT_DEFAULT_STR "default" #define BENCH_FORMAT_DEFAULT 0 diff --git a/tools/perf/bench/kallsyms-parse.c b/tools/perf/bench/kallsyms-parse.c new file mode 100644 index 000000000000..2b0d0f980ae9 --- /dev/null +++ b/tools/perf/bench/kallsyms-parse.c @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Benchmark of /proc/kallsyms parsing. + * + * Copyright 2020 Google LLC. + */ +#include <stdlib.h> +#include "bench.h" +#include "../util/stat.h" +#include <linux/time64.h> +#include <subcmd/parse-options.h> +#include <symbol/kallsyms.h> + +static unsigned int iterations = 100; + +static const struct option options[] = { + OPT_UINTEGER('i', "iterations", &iterations, + "Number of iterations used to compute average"), + OPT_END() +}; + +static const char *const bench_usage[] = { + "perf bench internals kallsyms-parse <options>", + NULL +}; + +static int bench_process_symbol(void *arg __maybe_unused, + const char *name __maybe_unused, + char type __maybe_unused, + u64 start __maybe_unused) +{ + return 0; +} + +static int do_kallsyms_parse(void) +{ + struct timeval start, end, diff; + u64 runtime_us; + unsigned int i; + double time_average, time_stddev; + int err; + struct stats time_stats; + + init_stats(&time_stats); + + for (i = 0; i < iterations; i++) { + gettimeofday(&start, NULL); + err = kallsyms__parse("/proc/kallsyms", NULL, + bench_process_symbol); + if (err) + return err; + + gettimeofday(&end, NULL); + timersub(&end, &start, &diff); + runtime_us = diff.tv_sec * USEC_PER_SEC + diff.tv_usec; + update_stats(&time_stats, runtime_us); + } + + time_average = avg_stats(&time_stats) / USEC_PER_MSEC; + time_stddev = stddev_stats(&time_stats) / USEC_PER_MSEC; + printf(" Average kallsyms__parse took: %.3f ms (+- %.3f ms)\n", + time_average, time_stddev); + return 0; +} + +int bench_kallsyms_parse(int argc, const char **argv) +{ + argc = parse_options(argc, argv, options, bench_usage, 0); + if (argc) { + usage_with_options(bench_usage, options); + exit(EXIT_FAILURE); + } + + return do_kallsyms_parse(); +} diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c index 11c79a8d85d6..083273209c88 100644 --- a/tools/perf/builtin-bench.c +++ b/tools/perf/builtin-bench.c @@ -78,6 +78,7 @@ static struct bench epoll_benchmarks[] = { static struct bench internals_benchmarks[] = { { "synthesize", "Benchmark perf event synthesis", bench_synthesize }, + { "kallsyms-parse", "Benchmark kallsyms parsing", bench_kallsyms_parse }, { NULL, NULL, NULL } }; -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 88/91] libsymbols kallsyms: Parse using io api 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (86 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 87/91] perf bench: Add kallsyms parsing Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 89/91] libsymbols kallsyms: Move hex2u64 out of header Arnaldo Carvalho de Melo ` (2 subsequent siblings) 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Stephane Eranian From: Ian Rogers <irogers@google.com> 'perf record' will call kallsyms__parse 4 times during startup and process megabytes of data. This changes kallsyms__parse to use the io library rather than fgets to improve performance of the user code by over 8%. Before: Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 103.988 ms (+- 0.203 ms) After: Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 95.571 ms (+- 0.006 ms) For a workload like: $ perf record /bin/true Run under 'perf record -e cycles:u -g' the time goes from: Before 30.10% 1.67% perf perf [.] kallsyms__parse After 25.55% 20.04% perf perf [.] kallsyms__parse So a little under 5% of the start-up time is removed. A lot of what remains is on the kernel side, but caching kallsyms within perf would at least impact memory footprint. Committer notes: The internal/kallsyms-parse bench is run using: [root@five ~]# perf bench internals kallsyms-parse # Running 'internals/kallsyms-parse' benchmark: Average kallsyms__parse took: 80.381 ms (+- 0.115 ms) [root@five ~]# And this pre-existing test uses these routines to parse kallsyms and then compare with the info obtained from the matching ELF symtab: [root@five ~]# perf test vmlinux 1: vmlinux symtab matches kallsyms : Ok [root@five ~]# Also we can't remove hex2u64() in this patch as this breaks the build: /usr/bin/ld: /tmp/build/perf/perf-in.o: in function `modules__parse': /home/acme/git/perf/tools/perf/util/symbol.c:607: undefined reference to `hex2u64' /usr/bin/ld: /home/acme/git/perf/tools/perf/util/symbol.c:607: undefined reference to `hex2u64' /usr/bin/ld: /tmp/build/perf/perf-in.o: in function `dso__load_perf_map': /home/acme/git/perf/tools/perf/util/symbol.c:1477: undefined reference to `hex2u64' /usr/bin/ld: /home/acme/git/perf/tools/perf/util/symbol.c:1483: undefined reference to `hex2u64' collect2: error: ld returned 1 exit status Leave it there, move it in the next patch. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200501221315.54715-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/api/io.h | 3 ++ tools/lib/symbol/kallsyms.c | 93 +++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/tools/lib/api/io.h b/tools/lib/api/io.h index b7e55b5f8a4a..777c20f6b604 100644 --- a/tools/lib/api/io.h +++ b/tools/lib/api/io.h @@ -7,6 +7,9 @@ #ifndef __API_IO__ #define __API_IO__ +#include <stdlib.h> +#include <unistd.h> + struct io { /* File descriptor being read/ */ int fd; diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c index 1a7a9f877095..a5edc75c346c 100644 --- a/tools/lib/symbol/kallsyms.c +++ b/tools/lib/symbol/kallsyms.c @@ -1,7 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 #include "symbol/kallsyms.h" +#include "api/io.h" #include <stdio.h> -#include <stdlib.h> +#include <sys/stat.h> +#include <fcntl.h> u8 kallsyms2elf_type(char type) { @@ -9,12 +11,6 @@ u8 kallsyms2elf_type(char type) return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT; } -bool kallsyms__is_function(char symbol_type) -{ - symbol_type = toupper(symbol_type); - return symbol_type == 'T' || symbol_type == 'W'; -} - /* * While we find nice hex chars, build a long_val. * Return number of chars processed. @@ -28,61 +24,68 @@ int hex2u64(const char *ptr, u64 *long_val) return p - ptr; } +bool kallsyms__is_function(char symbol_type) +{ + symbol_type = toupper(symbol_type); + return symbol_type == 'T' || symbol_type == 'W'; +} + +static void read_to_eol(struct io *io) +{ + int ch; + + for (;;) { + ch = io__get_char(io); + if (ch < 0 || ch == '\n') + return; + } +} + int kallsyms__parse(const char *filename, void *arg, int (*process_symbol)(void *arg, const char *name, char type, u64 start)) { - char *line = NULL; - size_t n; - int err = -1; - FILE *file = fopen(filename, "r"); - - if (file == NULL) - goto out_failure; - - err = 0; + struct io io; + char bf[BUFSIZ]; + int err; - while (!feof(file)) { - u64 start; - int line_len, len; - char symbol_type; - char *symbol_name; + io.fd = open(filename, O_RDONLY, 0); - line_len = getline(&line, &n, file); - if (line_len < 0 || !line) - break; + if (io.fd < 0) + return -1; - line[--line_len] = '\0'; /* \n */ + io__init(&io, io.fd, bf, sizeof(bf)); - len = hex2u64(line, &start); + err = 0; + while (!io.eof) { + __u64 start; + int ch; + size_t i; + char symbol_type; + char symbol_name[KSYM_NAME_LEN + 1]; - /* Skip the line if we failed to parse the address. */ - if (!len) + if (io__get_hex(&io, &start) != ' ') { + read_to_eol(&io); continue; - - len++; - if (len + 2 >= line_len) + } + symbol_type = io__get_char(&io); + if (io__get_char(&io) != ' ') { + read_to_eol(&io); continue; - - symbol_type = line[len]; - len += 2; - symbol_name = line + len; - len = line_len - len; - - if (len >= KSYM_NAME_LEN) { - err = -1; - break; } + for (i = 0; i < sizeof(symbol_name); i++) { + ch = io__get_char(&io); + if (ch < 0 || ch == '\n') + break; + symbol_name[i] = ch; + } + symbol_name[i] = '\0'; err = process_symbol(arg, symbol_name, symbol_type, start); if (err) break; } - free(line); - fclose(file); + close(io.fd); return err; - -out_failure: - return -1; } -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 89/91] libsymbols kallsyms: Move hex2u64 out of header 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (87 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 88/91] libsymbols kallsyms: Parse using io api Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 90/91] perf cs-etm: Move definition of 'traceid_list' global variable from header file Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 91/91] perf flamegraph: Use /bin/bash for report and record scripts Arnaldo Carvalho de Melo 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo From: Ian Rogers <irogers@google.com> hex2u64 is a helper that's out of place in kallsyms.h as not being kallsyms related. Move from kallsyms.h to the only user. Committer notes: Move it out of tools/lib/symbol/kallsyms.c as well, as we had to leave it there in the previous patch lest we break the build. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lore.kernel.org/lkml/20200501221315.54715-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/lib/symbol/kallsyms.c | 13 ------------- tools/lib/symbol/kallsyms.h | 2 -- tools/perf/util/symbol.c | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c index a5edc75c346c..e335ac2b9e19 100644 --- a/tools/lib/symbol/kallsyms.c +++ b/tools/lib/symbol/kallsyms.c @@ -11,19 +11,6 @@ u8 kallsyms2elf_type(char type) return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT; } -/* - * While we find nice hex chars, build a long_val. - * Return number of chars processed. - */ -int hex2u64(const char *ptr, u64 *long_val) -{ - char *p; - - *long_val = strtoull(ptr, &p, 16); - - return p - ptr; -} - bool kallsyms__is_function(char symbol_type) { symbol_type = toupper(symbol_type); diff --git a/tools/lib/symbol/kallsyms.h b/tools/lib/symbol/kallsyms.h index bd988f7b18d4..72ab9870454b 100644 --- a/tools/lib/symbol/kallsyms.h +++ b/tools/lib/symbol/kallsyms.h @@ -18,8 +18,6 @@ static inline u8 kallsyms2elf_binding(char type) return isupper(type) ? STB_GLOBAL : STB_LOCAL; } -int hex2u64(const char *ptr, u64 *long_val); - u8 kallsyms2elf_type(char type); bool kallsyms__is_function(char symbol_type); diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 8f4300492dc7..381da6b39f89 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -566,6 +566,20 @@ void dso__sort_by_name(struct dso *dso) return symbols__sort_by_name(&dso->symbol_names, &dso->symbols); } +/* + * While we find nice hex chars, build a long_val. + * Return number of chars processed. + */ +static int hex2u64(const char *ptr, u64 *long_val) +{ + char *p; + + *long_val = strtoull(ptr, &p, 16); + + return p - ptr; +} + + int modules__parse(const char *filename, void *arg, int (*process_module)(void *arg, const char *name, u64 start, u64 size)) -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 90/91] perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (88 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 89/91] libsymbols kallsyms: Move hex2u64 out of header Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 91/91] perf flamegraph: Use /bin/bash for report and record scripts Arnaldo Carvalho de Melo 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Leo Yan, Thomas Backlund, Mathieu Poirier, Mike Leach, Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra, Suzuki Poulouse, Tor Jeremiassen, linux-arm-kernel, Arnaldo Carvalho de Melo From: Leo Yan <leo.yan@linaro.org> The variable 'traceid_list' is defined in the header file cs-etm.h, if multiple C files include cs-etm.h the compiler might complaint for multiple definition of 'traceid_list'. To fix multiple definition error, move the definition of 'traceid_list' into cs-etm.c. Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") Reported-by: Thomas Backlund <tmb@mageia.org> Signed-off-by: Leo Yan <leo.yan@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Mike Leach <mike.leach@linaro.org> Tested-by: Mike Leach <mike.leach@linaro.org> Tested-by: Thomas Backlund <tmb@mageia.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Tor Jeremiassen <tor@ti.com> Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20200505133642.4756-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/cs-etm.c | 3 +++ tools/perf/util/cs-etm.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 3c802fde4954..c283223fb31f 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -94,6 +94,9 @@ struct cs_etm_queue { struct cs_etm_traceid_queue **traceid_queues; }; +/* RB tree for quick conversion between traceID and metadata pointers */ +static struct intlist *traceid_list; + static int cs_etm__update_queues(struct cs_etm_auxtrace *etm); static int cs_etm__process_queues(struct cs_etm_auxtrace *etm); static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm, diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h index 650ecc2a6349..4ad925d6d799 100644 --- a/tools/perf/util/cs-etm.h +++ b/tools/perf/util/cs-etm.h @@ -114,9 +114,6 @@ enum cs_etm_isa { CS_ETM_ISA_T32, }; -/* RB tree for quick conversion between traceID and metadata pointers */ -struct intlist *traceid_list; - struct cs_etm_queue; struct cs_etm_packet { -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [PATCH 91/91] perf flamegraph: Use /bin/bash for report and record scripts 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (89 preceding siblings ...) 2020-05-06 15:22 ` [PATCH 90/91] perf cs-etm: Move definition of 'traceid_list' global variable from header file Arnaldo Carvalho de Melo @ 2020-05-06 15:22 ` Arnaldo Carvalho de Melo 90 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-06 15:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Daniel Díaz, Andreas Gerstmayr, Adrian Hunter, lkft-triage From: Arnaldo Carvalho de Melo <acme@redhat.com> As all the other tools/perf/scripts/python/bin/*-{report,record} scripts, fixing the this problem reported by Daniel Diaz: Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf script: Add flamegraph.py script"): ERROR: perf-1.0-r9 do_package_qa: QA Issue: /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained in package perf-python requires /usr/bin/sh, but no providers found in RDEPENDS_perf-python? [file-rdeps] This means that there is a new binary pulled in in the shebang line which was unaccounted for: `/usr/bin/sh`. I don't see any other usage of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu dev machine) but plenty of /bin/sh. This patch is needed: -----8<----------8<----------8<----- diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..a2f3fa25ef81 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/sh perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..b0177355619b 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/sh # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ----->8---------->8---------->8----- Fixes: 5287f9269206 ("perf script: Add flamegraph.py script") Reported-by: Daniel Díaz <daniel.diaz@linaro.org> Acked-by: Andreas Gerstmayr <agerstmayr@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: lkft-triage@lists.linaro.org Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lore.kernel.org/lkml/CAEUSe7_wmKS361mKLTB1eYbzYXcKkXdU26BX5BojdKRz8MfPCw@mail.gmail.com Link: http://lore.kernel.org/lkml/20200505170320.GZ30487@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/scripts/python/bin/flamegraph-record | 2 +- tools/perf/scripts/python/bin/flamegraph-report | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..7df5a19c0163 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/bash perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..53c5dc90c87e 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/bash # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" -- 2.21.1 ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2020-04-20 11:52 Arnaldo Carvalho de Melo 2020-04-22 12:09 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-04-20 11:52 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov, Andreas Gerstmayr, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, 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 cd0943357bc7570f081701d005318c20982178b8: Merge tag 'perf-urgent-for-mingo-5.7-20200414' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2020-04-16 10:21:31 +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.8-20200420 for you to fetch changes up to 12e89e65f446476951f42aedeef56b6bd6f7f1e6: perf hist: Add fast path for duplicate entries check (2020-04-18 09:05:01 -0300) ---------------------------------------------------------------- perf/core fixes and improvements: kernel + tools/perf: Alexey Budankov: - Introduce CAP_PERFMON to kernel and user space. callchains: Adrian Hunter: - Allow using Intel PT to synthesize callchains for regular events. Kan Liang: - Stitch LBR records from multiple samples to get deeper backtraces, there are caveats, see the csets for details. perf script: Andreas Gerstmayr: - Add flamegraph.py script BPF: Jiri Olsa: - Synthesize bpf_trampoline/dispatcher ksymbol events. perf stat: Arnaldo Carvalho de Melo: - Honour --timeout for forked workloads. Stephane Eranian: - Force error in fallback on :k events, to avoid counting nothing when the user asks for kernel events but is not allowed to. perf bench: Ian Rogers: - Add event synthesis benchmark. tools api fs: Stephane Eranian: - Make xxx__mountpoint() more scalable libtraceevent: He Zhe: - Handle return value of asprintf. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (18): perf script: Simplify auxiliary event printing functions perf auxtrace: Add ->evsel_is_auxtrace() callback perf intel-pt: Implement ->evsel_is_auxtrace() callback perf intel-bts: Implement ->evsel_is_auxtrace() callback perf arm-spe: Implement ->evsel_is_auxtrace() callback perf cs-etm: Implement ->evsel_is_auxtrace() callback perf s390-cpumsf: Implement ->evsel_is_auxtrace() callback perf auxtrace: For reporting purposes, un-group AUX area event perf auxtrace: Add an option to synthesize callchains for regular events perf thread-stack: Add thread_stack__sample_late() perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set perf evsel: Add support for synthesized sample type perf intel-pt: Add support for synthesizing callchains for regular events perf evsel: Move and globalize perf_evsel__find_pmu() and perf_evsel__is_aux_event() perf evlist: Move leader-sampling configuration perf evsel: Rearrange perf_evsel__config_leader_sampling() perf evlist: Allow multiple read formats perf tools: Add support for leader-sampling with AUX area events Alexey Budankov (12): capabilities: Introduce CAP_PERFMON to kernel and user space perf/core: Open access to the core for CAP_PERFMON privileged process perf/core: open access to probes for CAP_PERFMON privileged process perf tools: Support CAP_PERFMON capability drm/i915/perf: Open access for CAP_PERFMON privileged process trace/bpf_trace: Open access for CAP_PERFMON privileged process powerpc/perf: open access for CAP_PERFMON privileged process parisc/perf: open access for CAP_PERFMON privileged process drivers/perf: Open access for CAP_PERFMON privileged process drivers/oprofile: Open access for CAP_PERFMON privileged process doc/admin-guide: Update perf-security.rst with CAP_PERFMON information doc/admin-guide: update kernel.rst with CAP_PERFMON information Andreas Gerstmayr (1): perf script: Add flamegraph.py script Arnaldo Carvalho de Melo (1): perf stat: Honour --timeout for forked workloads He Zhe (1): tools lib traceevent: Take care of return value of asprintf Ian Rogers (3): perf bench: Add event synthesis benchmark perf synthetic-events: save 4kb from 2 stack frames perf doc: allow ASCIIDOC_EXTRA to be an argument Jiri Olsa (6): perf tools: Synthesize bpf_trampoline/dispatcher ksymbol event perf machine: Set ksymbol dso as loaded on arrival perf annotate: Add basic support for bpf_image perf expr: Add expr_ prefix for parse_ctx and parse_id perf expr: Add expr_scanner_ctx object perf parser: Add support to specify rXXX event with pmu Kajol Jain (1): perf metrictroup: Split the metricgroup__add_metric function Kan Liang (15): perf pmu: Add support for PMU capabilities perf header: Support CPU PMU capabilities perf machine: Remove the indent in resolve_lbr_callchain_sample perf machine: Refine the function for LBR call stack reconstruction perf machine: Factor out lbr_callchain_add_kernel_ip() perf machine: Factor out lbr_callchain_add_lbr_ip() perf thread: Add a knob for LBR stitch approach perf thread: Save previous sample for LBR stitching approach perf callchain: Save previous cursor nodes for LBR stitching approach perf callchain: Stitch LBR call stack perf report: Add option to enable the LBR stitching approach perf script: Add option to enable the LBR stitching approach perf top: Add option to enable the LBR stitching approach perf c2c: Add option to enable the LBR stitching approach perf hist: Add fast path for duplicate entries check Stephane Eranian (2): tools api fs: Make xxx__mountpoint() more scalable perf stat: Force error in fallback on :k events Documentation/admin-guide/perf-security.rst | 86 ++-- Documentation/admin-guide/sysctl/kernel.rst | 16 +- arch/parisc/kernel/perf.c | 2 +- arch/powerpc/perf/imc-pmu.c | 4 +- drivers/gpu/drm/i915/i915_perf.c | 13 +- drivers/oprofile/event_buffer.c | 2 +- drivers/perf/arm_spe_pmu.c | 4 +- include/linux/capability.h | 4 + include/linux/perf_event.h | 6 +- include/uapi/linux/capability.h | 8 +- kernel/events/core.c | 6 +- kernel/trace/bpf_trace.c | 2 +- security/selinux/include/classmap.h | 4 +- tools/lib/api/fs/fs.c | 17 + tools/lib/api/fs/fs.h | 12 + tools/lib/traceevent/parse-filter.c | 29 +- tools/perf/Documentation/Makefile | 4 +- tools/perf/Documentation/itrace.txt | 1 + tools/perf/Documentation/perf-bench.txt | 8 + tools/perf/Documentation/perf-c2c.txt | 11 + tools/perf/Documentation/perf-list.txt | 8 + tools/perf/Documentation/perf-report.txt | 11 + tools/perf/Documentation/perf-script.txt | 11 + tools/perf/Documentation/perf-top.txt | 9 + tools/perf/Documentation/perf.data-file-format.txt | 16 + tools/perf/bench/Build | 2 +- tools/perf/bench/bench.h | 2 +- tools/perf/bench/synthesize.c | 101 +++++ tools/perf/builtin-bench.c | 6 + tools/perf/builtin-c2c.c | 12 + tools/perf/builtin-ftrace.c | 5 +- tools/perf/builtin-report.c | 15 +- tools/perf/builtin-script.c | 318 ++++----------- tools/perf/builtin-stat.c | 5 +- tools/perf/builtin-top.c | 11 + tools/perf/design.txt | 3 +- tools/perf/scripts/python/bin/flamegraph-record | 2 + tools/perf/scripts/python/bin/flamegraph-report | 3 + tools/perf/scripts/python/flamegraph.py | 124 ++++++ tools/perf/tests/expr.c | 4 +- tools/perf/tests/parse-events.c | 17 +- tools/perf/util/annotate.c | 20 + tools/perf/util/arm-spe.c | 9 + tools/perf/util/auxtrace.c | 94 +++-- tools/perf/util/auxtrace.h | 14 + tools/perf/util/bpf-event.c | 93 +++++ tools/perf/util/branch.h | 19 +- tools/perf/util/callchain.h | 8 + tools/perf/util/cap.h | 4 + tools/perf/util/cs-etm.c | 11 + tools/perf/util/dso.c | 1 + tools/perf/util/dso.h | 1 + tools/perf/util/env.h | 3 + tools/perf/util/evlist.c | 6 +- tools/perf/util/evsel.c | 35 +- tools/perf/util/evsel.h | 18 +- tools/perf/util/expr.c | 16 +- tools/perf/util/expr.h | 16 +- tools/perf/util/expr.l | 10 +- tools/perf/util/expr.y | 6 +- tools/perf/util/header.c | 108 +++++ tools/perf/util/header.h | 1 + tools/perf/util/hist.c | 23 ++ tools/perf/util/intel-bts.c | 10 + tools/perf/util/intel-pt.c | 95 ++++- tools/perf/util/machine.c | 434 ++++++++++++++++++--- tools/perf/util/metricgroup.c | 60 +-- tools/perf/util/parse-events.l | 1 + tools/perf/util/parse-events.y | 9 + tools/perf/util/pmu.c | 102 +++++ tools/perf/util/pmu.h | 9 + tools/perf/util/record.c | 62 +++ tools/perf/util/s390-cpumcf-kernel.h | 1 + tools/perf/util/s390-cpumsf.c | 11 +- tools/perf/util/sort.c | 2 +- tools/perf/util/sort.h | 2 + tools/perf/util/stat-shadow.c | 2 +- tools/perf/util/symbol.c | 1 + tools/perf/util/synthetic-events.c | 22 +- tools/perf/util/thread-stack.c | 57 +++ tools/perf/util/thread-stack.h | 3 + tools/perf/util/thread.c | 24 ++ tools/perf/util/thread.h | 15 + tools/perf/util/top.h | 1 + tools/perf/util/util.c | 1 + 85 files changed, 1851 insertions(+), 513 deletions(-) create mode 100644 tools/perf/bench/synthesize.c create mode 100755 tools/perf/scripts/python/bin/flamegraph-record create mode 100755 tools/perf/scripts/python/bin/flamegraph-report create mode 100755 tools/perf/scripts/python/flamegraph.py 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. Ubuntu 19.10 is failing when linking against libllvm, which isn't the default, needs to be investigated, haven't tested with CC=gcc, but should be the same problem: + make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= LIBCLANGLLVM=1 -C /git/linux/tools/perf O=/tmp/build/perf CC=clang ... /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x43): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_hasLoopVariable0Matcher::matches(clang::CXXForRangeStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' ... It builds ok with the default set of options. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.7.0-rc1.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.1 (git://git.alpinelinux.org/aports 7c78441134e54efbb34618f457d88c783c913361) (based on LLVM 9.0.1) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus 9.2.1-alt2), clang version 7.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4), clang version 8.0.1 (Red Hat 8.0.1-1.module_el8.1.0+215+a01033fb) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20200214 gcc_9_2_0_release-615-g7866f9ebf1, clang version 9.0.1 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : Ok gcc (Debian 9.2.1-28) 9.2.1 20200203, clang version 8.0.1-7 (tags/RELEASE_801/final) 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-24) 9.2.1 20200117 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.1 (Fedora 9.0.1-2.fc31) 44 fedora:32 : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.1.rc2.fc32) 45 fedora:rawhide : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.3.rc2.fc33) 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 51 openmandriva:cooker : Ok gcc (GCC) 10.0.0 20200216 (OpenMandriva), clang version 10.0.0 52 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) 53 opensuse:15.1 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 54 opensuse:15.2 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 55 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 56 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20200128 [revision 83f65674e78d97d27537361de1a9d74067ff228d], clang version 9.0.1 57 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 58 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 59 oraclelinux:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4.5.0.5), clang version 8.0.1 (Red Hat 8.0.1-1.0.1.module+el8.1.0+5428+345cee14) 60 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) 61 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 62 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 63 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 69 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) 70 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 77 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 78 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 79 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 80 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) 81 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 82 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 83 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 84 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 85 ubuntu:19.10 : FAIL gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) 86 ubuntu:20.04 : Ok gcc (Ubuntu 9.3.0-8ubuntu1) 9.3.0, clang version 10.0.0-1ubuntu1 # # uname -a Linux five 5.5.17-200.fc31.x86_64 #1 SMP Mon Apr 13 15:29:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 12e89e65f446 perf hist: Add fast path for duplicate entries check # perf version --build-options perf version 5.7.rc1.g12e89e65f446 dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: PMU events : Ok 11: DSO data read : Ok 12: DSO data cache : Ok 13: DSO data reopen : Ok 14: Roundtrip evsel->name : Ok 15: Parse sched tracepoints fields : Ok 16: syscalls:sys_enter_openat event fields : Ok 17: Setup struct perf_event_attr : Ok 18: Match and link multiple hists : Ok 19: 'import perf' in python : Ok 20: Breakpoint overflow signal handler : Ok 21: Breakpoint overflow sampling : Ok 22: Breakpoint accounting : Ok 23: Watchpoint : 23.1: Read Only Watchpoint : Skip 23.2: Write Only Watchpoint : Ok 23.3: Read / Write Watchpoint : Ok 23.4: Modify Watchpoint : Ok 24: Number of exit events of a simple workload : Ok 25: Software clock events period values : Ok 26: Object code reading : Ok 27: Sample parsing : Ok 28: Use a dummy software event to keep tracking : Ok 29: Parse with no sample_id_all bit set : Ok 30: Filter hist entries : Ok 31: Lookup mmap thread : Ok 32: Share thread maps : Ok 33: Sort output of hist entries : Ok 34: Cumulate child hist entries : Ok 35: Track with sched_switch : Ok 36: Filter fds with revents mask in a fdarray : Ok 37: Add fd to a fdarray, making it autogrow : Ok 38: kmod_path__parse : Ok 39: Thread map : Ok 40: LLVM search and compile : 40.1: Basic BPF llvm compile : Ok 40.2: kbuild searching : Ok 40.3: Compile source for BPF prologue generation : Ok 40.4: Compile source for BPF relocation : Ok 41: Session topology : Ok 42: BPF filter : 42.1: Basic BPF filtering : Ok 42.2: BPF pinning : Ok 42.3: BPF prologue generation : Ok 42.4: BPF relocation checker : Ok 43: Synthesize thread map : Ok 44: Remove thread map : Ok 45: Synthesize cpu map : Ok 46: Synthesize stat config : Ok 47: Synthesize stat : Ok 48: Synthesize stat round : Ok 49: Synthesize attr update : Ok 50: Event times : Ok 51: Read backward ring buffer : Ok 52: Print cpu map : Ok 53: Merge cpu map : Ok 54: Probe SDT events : Ok 55: is_printable_array : Ok 56: Print bitmap : Ok 57: perf hooks : Ok 58: builtin clang support : Skip (not compiled in) 59: unit_number__scnprintf : Ok 60: mem2node : Ok 61: time utils : Ok 62: Test jit_write_elf : Ok 63: maps__merge_in : Ok 64: x86 rdpmc : Ok 65: Convert perf time to TSC : Ok 66: DWARF unwind : Ok 67: x86 instruction decoder - new instructions : Ok 68: Intel PT packet decoder : Ok 69: x86 bp modify : Ok 70: probe libc's inet_pton & backtrace it with ping : Ok 71: Use vfs_getname probe to get syscall args filenames : Ok 72: Check open filename arg using perf trace + vfs_getname: Ok 73: Zstd perf.data compression/decompression : Ok 74: Add vfs_getname probe to get syscall args filenames : Ok # $ git log --oneline -1 ; make -C tools/perf build-test 12e89e65f446 (HEAD -> perf/core, five/perf/core) perf hist: Add fast path for duplicate entries check make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_libbpf_O: make NO_LIBBPF=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_newt_O: make NO_NEWT=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_slang_O: make NO_SLANG=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_demangle_O: make NO_DEMANGLE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_perf_o_O: make perf.o make_cscope_O: make cscope make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_util_pmu_bison_o_O: make util/pmu-bison.o make_clean_all_O: make clean all make_no_libnuma_O: make NO_LIBNUMA=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_gtk2_O: make NO_GTK2=1 make_tags_O: make tags make_no_libaudit_O: make NO_LIBAUDIT=1 make_help_O: make help make_no_libperl_O: make NO_LIBPERL=1 make_install_O: make install make_no_libelf_O: make NO_LIBELF=1 make_pure_O: make make_install_bin_O: make install-bin make_debug_O: make DEBUG=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_doc_O: make doc make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_util_map_o_O: make util/map.o make_no_libbionic_O: make NO_LIBBIONIC=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2020-04-22 12:09 ` Ingo Molnar 2020-04-23 21:28 ` Daniel Díaz 0 siblings, 1 reply; 160+ messages in thread From: Ingo Molnar @ 2020-04-22 12:09 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Andreas Gerstmayr, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit cd0943357bc7570f081701d005318c20982178b8: > > Merge tag 'perf-urgent-for-mingo-5.7-20200414' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2020-04-16 10:21:31 +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.8-20200420 > > for you to fetch changes up to 12e89e65f446476951f42aedeef56b6bd6f7f1e6: > > perf hist: Add fast path for duplicate entries check (2020-04-18 09:05:01 -0300) > 85 files changed, 1851 insertions(+), 513 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-04-22 12:09 ` Ingo Molnar @ 2020-04-23 21:28 ` Daniel Díaz 2020-04-24 13:07 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 160+ messages in thread From: Daniel Díaz @ 2020-04-23 21:28 UTC (permalink / raw) To: Ingo Molnar Cc: Arnaldo Carvalho de Melo, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, Andreas Gerstmayr, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, Arnaldo Carvalho de Melo, lkft-triage Hello! On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > Hi Ingo/Thomas, > > > > Please consider pulling, > > > > Best regards, > > > > - Arnaldo > > > > Test results at the end of this message, as usual. > > > > The following changes since commit cd0943357bc7570f081701d005318c20982178b8: > > > > Merge tag 'perf-urgent-for-mingo-5.7-20200414' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2020-04-16 10:21:31 +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.8-20200420 > > > > for you to fetch changes up to 12e89e65f446476951f42aedeef56b6bd6f7f1e6: > > > > perf hist: Add fast path for duplicate entries check (2020-04-18 09:05:01 -0300) > > > 85 files changed, 1851 insertions(+), 513 deletions(-) > > Pulled, thanks a lot Arnaldo! Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf script: Add flamegraph.py script"): ERROR: perf-1.0-r9 do_package_qa: QA Issue: /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained in package perf-python requires /usr/bin/sh, but no providers found in RDEPENDS_perf-python? [file-rdeps] This means that there is a new binary pulled in in the shebang line which was unaccounted for: `/usr/bin/sh`. I don't see any other usage of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu dev machine) but plenty of /bin/sh. This patch is needed: -----8<----------8<----------8<----- diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..a2f3fa25ef81 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/sh perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..b0177355619b 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/sh # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ----->8---------->8---------->8----- Greetings! Daniel Díaz daniel.diaz@linaro.org ^ permalink raw reply related [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-04-23 21:28 ` Daniel Díaz @ 2020-04-24 13:07 ` Arnaldo Carvalho de Melo 2020-04-24 14:10 ` Andreas Gerstmayr 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-04-24 13:07 UTC (permalink / raw) To: Andreas Gerstmayr, Daniel Díaz Cc: Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, Arnaldo Carvalho de Melo, lkft-triage Em Thu, Apr 23, 2020 at 04:28:46PM -0500, Daniel Díaz escreveu: > On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: > > > 85 files changed, 1851 insertions(+), 513 deletions(-) > > Pulled, thanks a lot Arnaldo! > Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > script: Add flamegraph.py script"): > ERROR: perf-1.0-r9 do_package_qa: QA Issue: > /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > in package perf-python requires /usr/bin/sh, but no providers found in > RDEPENDS_perf-python? [file-rdeps] yeah, the flamegraph scripts are the outliers, there, everything else is using /bin/bash, so I'll switch to that, ok Andreas? [acme@quaco perf]$ vim tools/perf/scripts/python/bin/* 34 files to edit [acme@quaco perf]$ head -1 tools/perf/scripts/python/bin/* ==> tools/perf/scripts/python/bin/compaction-times-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/compaction-times-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/event_analyzing_sample-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/event_analyzing_sample-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/export-to-postgresql-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/export-to-postgresql-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/export-to-sqlite-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/export-to-sqlite-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/failed-syscalls-by-pid-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/failed-syscalls-by-pid-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/flamegraph-record <== #!/usr/bin/sh ==> tools/perf/scripts/python/bin/flamegraph-report <== #!/usr/bin/sh ==> tools/perf/scripts/python/bin/futex-contention-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/futex-contention-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/intel-pt-events-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/intel-pt-events-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/mem-phys-addr-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/mem-phys-addr-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/netdev-times-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/netdev-times-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/net_dropmonitor-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/net_dropmonitor-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/powerpc-hcalls-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/powerpc-hcalls-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/sched-migration-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/sched-migration-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/sctop-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/sctop-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/stackcollapse-record <== #!/bin/sh ==> tools/perf/scripts/python/bin/stackcollapse-report <== #!/bin/sh ==> tools/perf/scripts/python/bin/syscall-counts-by-pid-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/syscall-counts-by-pid-report <== #!/bin/bash ==> tools/perf/scripts/python/bin/syscall-counts-record <== #!/bin/bash ==> tools/perf/scripts/python/bin/syscall-counts-report <== #!/bin/bash [acme@quaco perf]$ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-04-24 13:07 ` Arnaldo Carvalho de Melo @ 2020-04-24 14:10 ` Andreas Gerstmayr 2020-05-04 19:07 ` Daniel Díaz 0 siblings, 1 reply; 160+ messages in thread From: Andreas Gerstmayr @ 2020-04-24 14:10 UTC (permalink / raw) To: Arnaldo Carvalho de Melo, Daniel Díaz Cc: Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, Arnaldo Carvalho de Melo, lkft-triage On 24.04.20 15:07, Arnaldo Carvalho de Melo wrote: > Em Thu, Apr 23, 2020 at 04:28:46PM -0500, Daniel Díaz escreveu: >> On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: >>>> 85 files changed, 1851 insertions(+), 513 deletions(-) > >>> Pulled, thanks a lot Arnaldo! > >> Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf >> script: Add flamegraph.py script"): >> ERROR: perf-1.0-r9 do_package_qa: QA Issue: >> /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained >> in package perf-python requires /usr/bin/sh, but no providers found in >> RDEPENDS_perf-python? [file-rdeps] > > > yeah, the flamegraph scripts are the outliers, there, everything else is > using /bin/bash, so I'll switch to that, ok Andreas? Sure, no problem. Thanks! Cheers, Andreas ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-04-24 14:10 ` Andreas Gerstmayr @ 2020-05-04 19:07 ` Daniel Díaz 2020-05-05 16:37 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 160+ messages in thread From: Daniel Díaz @ 2020-05-04 19:07 UTC (permalink / raw) To: Andreas Gerstmayr Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, Arnaldo Carvalho de Melo, lkft-triage Hello! On Fri, 24 Apr 2020 at 09:10, Andreas Gerstmayr <agerstmayr@redhat.com> wrote: > > On 24.04.20 15:07, Arnaldo Carvalho de Melo wrote: > > Em Thu, Apr 23, 2020 at 04:28:46PM -0500, Daniel Díaz escreveu: > >> On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: > >>>> 85 files changed, 1851 insertions(+), 513 deletions(-) > > > >>> Pulled, thanks a lot Arnaldo! > > > >> Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > >> script: Add flamegraph.py script"): > >> ERROR: perf-1.0-r9 do_package_qa: QA Issue: > >> /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > >> in package perf-python requires /usr/bin/sh, but no providers found in > >> RDEPENDS_perf-python? [file-rdeps] > > > > > > yeah, the flamegraph scripts are the outliers, there, everything else is > > using /bin/bash, so I'll switch to that, ok Andreas? > > Sure, no problem. Thanks! Just a gentle reminder that this can still be fixed in today's linux-next tree (next-20200504). Greetings! Daniel Díaz daniel.diaz@linaro.org ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-05-04 19:07 ` Daniel Díaz @ 2020-05-05 16:37 ` Arnaldo Carvalho de Melo 2020-05-05 16:57 ` Daniel Díaz 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-05 16:37 UTC (permalink / raw) To: Daniel Díaz Cc: Andreas Gerstmayr, Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, lkft-triage Em Mon, May 04, 2020 at 02:07:56PM -0500, Daniel Díaz escreveu: > Hello! > > On Fri, 24 Apr 2020 at 09:10, Andreas Gerstmayr <agerstmayr@redhat.com> wrote: > > > > On 24.04.20 15:07, Arnaldo Carvalho de Melo wrote: > > > Em Thu, Apr 23, 2020 at 04:28:46PM -0500, Daniel Díaz escreveu: > > >> On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: > > >>>> 85 files changed, 1851 insertions(+), 513 deletions(-) > > > > > >>> Pulled, thanks a lot Arnaldo! > > > > > >> Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > > >> script: Add flamegraph.py script"): > > >> ERROR: perf-1.0-r9 do_package_qa: QA Issue: > > >> /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > > >> in package perf-python requires /usr/bin/sh, but no providers found in > > >> RDEPENDS_perf-python? [file-rdeps] > > > > > > > > > yeah, the flamegraph scripts are the outliers, there, everything else is > > > using /bin/bash, so I'll switch to that, ok Andreas? > > > > Sure, no problem. Thanks! > > Just a gentle reminder that this can still be fixed in today's > linux-next tree (next-20200504). Thanks for the reminder, I've just added this to my tree: commit c74ab13a30d3bec443c116e25b611255c58f32c0 Author: Arnaldo Carvalho de Melo <acme@redhat.com> Date: Tue May 5 13:33:12 2020 -0300 perf flamegraph: Use /bin/bash for report script As all the other tools/perf/scripts/python/bin/*-report scripts, fixing the this problem reported by Daniel Diaz: Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf script: Add flamegraph.py script"): ERROR: perf-1.0-r9 do_package_qa: QA Issue: /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained in package perf-python requires /usr/bin/sh, but no providers found in RDEPENDS_perf-python? [file-rdeps] This means that there is a new binary pulled in in the shebang line which was unaccounted for: `/usr/bin/sh`. I don't see any other usage of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu dev machine) but plenty of /bin/sh. This patch is needed: -----8<----------8<----------8<----- diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..a2f3fa25ef81 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/sh perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..b0177355619b 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/sh # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ----->8---------->8---------->8----- Fixes: 5287f9269206 ("perf script: Add flamegraph.py script") Reported-by: Daniel Díaz <daniel.diaz@linaro.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andreas Gerstmayr <agerstmayr@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: lkft-triage@lists.linaro.org Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lore.kernel.org/lkml/CAEUSe7_wmKS361mKLTB1eYbzYXcKkXdU26BX5BojdKRz8MfPCw@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..53c5dc90c87e 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/bash # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ^ permalink raw reply related [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-05-05 16:37 ` Arnaldo Carvalho de Melo @ 2020-05-05 16:57 ` Daniel Díaz 2020-05-05 17:03 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 160+ messages in thread From: Daniel Díaz @ 2020-05-05 16:57 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Andreas Gerstmayr, Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, lkft-triage Hello! On Tue, 5 May 2020 at 11:37, Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> wrote: > > Em Mon, May 04, 2020 at 02:07:56PM -0500, Daniel Díaz escreveu: > > Hello! > > > > On Fri, 24 Apr 2020 at 09:10, Andreas Gerstmayr <agerstmayr@redhat.com> wrote: > > > > > > On 24.04.20 15:07, Arnaldo Carvalho de Melo wrote: > > > > Em Thu, Apr 23, 2020 at 04:28:46PM -0500, Daniel Díaz escreveu: > > > >> On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: > > > >>>> 85 files changed, 1851 insertions(+), 513 deletions(-) > > > > > > > >>> Pulled, thanks a lot Arnaldo! > > > > > > > >> Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > > > >> script: Add flamegraph.py script"): > > > >> ERROR: perf-1.0-r9 do_package_qa: QA Issue: > > > >> /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > > > >> in package perf-python requires /usr/bin/sh, but no providers found in > > > >> RDEPENDS_perf-python? [file-rdeps] > > > > > > > > > > > > yeah, the flamegraph scripts are the outliers, there, everything else is > > > > using /bin/bash, so I'll switch to that, ok Andreas? > > > > > > Sure, no problem. Thanks! > > > > Just a gentle reminder that this can still be fixed in today's > > linux-next tree (next-20200504). > > Thanks for the reminder, I've just added this to my tree: > > commit c74ab13a30d3bec443c116e25b611255c58f32c0 > Author: Arnaldo Carvalho de Melo <acme@redhat.com> > Date: Tue May 5 13:33:12 2020 -0300 > > perf flamegraph: Use /bin/bash for report script > > As all the other tools/perf/scripts/python/bin/*-report scripts, fixing > the this problem reported by Daniel Diaz: > > Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > script: Add flamegraph.py script"): > ERROR: perf-1.0-r9 do_package_qa: QA Issue: > /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > in package perf-python requires /usr/bin/sh, but no providers found in > RDEPENDS_perf-python? [file-rdeps] > > This means that there is a new binary pulled in in the shebang line > which was unaccounted for: `/usr/bin/sh`. I don't see any other usage > of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu > dev machine) but plenty of /bin/sh. This patch is needed: > -----8<----------8<----------8<----- > diff --git a/tools/perf/scripts/python/bin/flamegraph-record > b/tools/perf/scripts/python/bin/flamegraph-record > index 725d66e71570..a2f3fa25ef81 100755 > --- a/tools/perf/scripts/python/bin/flamegraph-record > +++ b/tools/perf/scripts/python/bin/flamegraph-record > @@ -1,2 +1,2 @@ > -#!/usr/bin/sh > +#!/bin/sh > perf record -g "$@" > diff --git a/tools/perf/scripts/python/bin/flamegraph-report > b/tools/perf/scripts/python/bin/flamegraph-report > index b1a79afd903b..b0177355619b 100755 > --- a/tools/perf/scripts/python/bin/flamegraph-report > +++ b/tools/perf/scripts/python/bin/flamegraph-report > @@ -1,3 +1,3 @@ > -#!/usr/bin/sh > +#!/bin/sh > # description: create flame graphs > perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" > ----->8---------->8---------->8----- > > Fixes: 5287f9269206 ("perf script: Add flamegraph.py script") > Reported-by: Daniel Díaz <daniel.diaz@linaro.org> > Cc: Adrian Hunter <adrian.hunter@intel.com> > Cc: Andreas Gerstmayr <agerstmayr@redhat.com> > Cc: Jiri Olsa <jolsa@kernel.org> > Cc: lkft-triage@lists.linaro.org > Cc: Namhyung Kim <namhyung@kernel.org> > Link: http://lore.kernel.org/lkml/CAEUSe7_wmKS361mKLTB1eYbzYXcKkXdU26BX5BojdKRz8MfPCw@mail.gmail.com > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report > index b1a79afd903b..53c5dc90c87e 100755 > --- a/tools/perf/scripts/python/bin/flamegraph-report > +++ b/tools/perf/scripts/python/bin/flamegraph-report > @@ -1,3 +1,3 @@ > -#!/usr/bin/sh > +#!/bin/bash > # description: create flame graphs > perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" What about flamegraph-record? Thanks and greetings! Daniel Díaz daniel.diaz@linaro.org ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-05-05 16:57 ` Daniel Díaz @ 2020-05-05 17:03 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-05-05 17:03 UTC (permalink / raw) To: Daniel Díaz Cc: Arnaldo Carvalho de Melo, Andreas Gerstmayr, Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, open list, linux-perf-users, Adrian Hunter, Alexey Budankov, He Zhe, Ian Rogers, Kajol Jain, Kan Liang, Konstantin Kharlamov, Stephane Eranian, Thomas Richter, lkft-triage Em Tue, May 05, 2020 at 11:57:18AM -0500, Daniel Díaz escreveu: > Hello! > > On Tue, 5 May 2020 at 11:37, Arnaldo Carvalho de Melo > <arnaldo.melo@gmail.com> wrote: > > > > Em Mon, May 04, 2020 at 02:07:56PM -0500, Daniel Díaz escreveu: > > > Hello! > > > > > > On Fri, 24 Apr 2020 at 09:10, Andreas Gerstmayr <agerstmayr@redhat.com> wrote: > > > > > > > > On 24.04.20 15:07, Arnaldo Carvalho de Melo wrote: > > > > > Em Thu, Apr 23, 2020 at 04:28:46PM -0500, Daniel Díaz escreveu: > > > > >> On Wed, 22 Apr 2020 at 07:09, Ingo Molnar <mingo@kernel.org> wrote: > > > > >>>> 85 files changed, 1851 insertions(+), 513 deletions(-) > > > > > > > > > >>> Pulled, thanks a lot Arnaldo! > > > > > > > > > >> Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > > > > >> script: Add flamegraph.py script"): > > > > >> ERROR: perf-1.0-r9 do_package_qa: QA Issue: > > > > >> /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > > > > >> in package perf-python requires /usr/bin/sh, but no providers found in > > > > >> RDEPENDS_perf-python? [file-rdeps] > > > > > > > > > > > > > > > yeah, the flamegraph scripts are the outliers, there, everything else is > > > > > using /bin/bash, so I'll switch to that, ok Andreas? > > > > > > > > Sure, no problem. Thanks! > > > > > > Just a gentle reminder that this can still be fixed in today's > > > linux-next tree (next-20200504). > > > > Thanks for the reminder, I've just added this to my tree: > > > > commit c74ab13a30d3bec443c116e25b611255c58f32c0 > > Author: Arnaldo Carvalho de Melo <acme@redhat.com> > > Date: Tue May 5 13:33:12 2020 -0300 > > > > perf flamegraph: Use /bin/bash for report script > > > > As all the other tools/perf/scripts/python/bin/*-report scripts, fixing > > the this problem reported by Daniel Diaz: > > > > Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf > > script: Add flamegraph.py script"): > > ERROR: perf-1.0-r9 do_package_qa: QA Issue: > > /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained > > in package perf-python requires /usr/bin/sh, but no providers found in > > RDEPENDS_perf-python? [file-rdeps] > > > > This means that there is a new binary pulled in in the shebang line > > which was unaccounted for: `/usr/bin/sh`. I don't see any other usage > > of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu > > dev machine) but plenty of /bin/sh. This patch is needed: > > -----8<----------8<----------8<----- > > diff --git a/tools/perf/scripts/python/bin/flamegraph-record > > b/tools/perf/scripts/python/bin/flamegraph-record > > index 725d66e71570..a2f3fa25ef81 100755 > > --- a/tools/perf/scripts/python/bin/flamegraph-record > > +++ b/tools/perf/scripts/python/bin/flamegraph-record > > @@ -1,2 +1,2 @@ > > -#!/usr/bin/sh > > +#!/bin/sh > > perf record -g "$@" > > diff --git a/tools/perf/scripts/python/bin/flamegraph-report > > b/tools/perf/scripts/python/bin/flamegraph-report > > index b1a79afd903b..b0177355619b 100755 > > --- a/tools/perf/scripts/python/bin/flamegraph-report > > +++ b/tools/perf/scripts/python/bin/flamegraph-report > > @@ -1,3 +1,3 @@ > > -#!/usr/bin/sh > > +#!/bin/sh > > # description: create flame graphs > > perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" > > ----->8---------->8---------->8----- > > > > Fixes: 5287f9269206 ("perf script: Add flamegraph.py script") > > Reported-by: Daniel Díaz <daniel.diaz@linaro.org> > > Cc: Adrian Hunter <adrian.hunter@intel.com> > > Cc: Andreas Gerstmayr <agerstmayr@redhat.com> > > Cc: Jiri Olsa <jolsa@kernel.org> > > Cc: lkft-triage@lists.linaro.org > > Cc: Namhyung Kim <namhyung@kernel.org> > > Link: http://lore.kernel.org/lkml/CAEUSe7_wmKS361mKLTB1eYbzYXcKkXdU26BX5BojdKRz8MfPCw@mail.gmail.com > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > > > diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report > > index b1a79afd903b..53c5dc90c87e 100755 > > --- a/tools/perf/scripts/python/bin/flamegraph-report > > +++ b/tools/perf/scripts/python/bin/flamegraph-report > > @@ -1,3 +1,3 @@ > > -#!/usr/bin/sh > > +#!/bin/bash > > # description: create flame graphs > > perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" > > What about flamegraph-record? oops, make that this instead: commit b3a63d0c17e6e1d23a6b44502b55f066adfd8e6a Author: Arnaldo Carvalho de Melo <acme@redhat.com> Date: Tue May 5 13:33:12 2020 -0300 perf flamegraph: Use /bin/bash for report and record scripts As all the other tools/perf/scripts/python/bin/*-{report,record} scripts, fixing the this problem reported by Daniel Diaz: Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf script: Add flamegraph.py script"): ERROR: perf-1.0-r9 do_package_qa: QA Issue: /usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained in package perf-python requires /usr/bin/sh, but no providers found in RDEPENDS_perf-python? [file-rdeps] This means that there is a new binary pulled in in the shebang line which was unaccounted for: `/usr/bin/sh`. I don't see any other usage of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu dev machine) but plenty of /bin/sh. This patch is needed: -----8<----------8<----------8<----- diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..a2f3fa25ef81 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/sh perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..b0177355619b 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/sh # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ----->8---------->8---------->8----- Fixes: 5287f9269206 ("perf script: Add flamegraph.py script") Reported-by: Daniel Díaz <daniel.diaz@linaro.org> Acked-by: Andreas Gerstmayr <agerstmayr@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: lkft-triage@lists.linaro.org Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lore.kernel.org/lkml/CAEUSe7_wmKS361mKLTB1eYbzYXcKkXdU26BX5BojdKRz8MfPCw@mail.gmail.com Link: http://lore.kernel.org/lkml/20200505163745.GD3777@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record index 725d66e71570..7df5a19c0163 100755 --- a/tools/perf/scripts/python/bin/flamegraph-record +++ b/tools/perf/scripts/python/bin/flamegraph-record @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/bash perf record -g "$@" diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report index b1a79afd903b..53c5dc90c87e 100755 --- a/tools/perf/scripts/python/bin/flamegraph-report +++ b/tools/perf/scripts/python/bin/flamegraph-report @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/bash # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@" ^ permalink raw reply related [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2020-03-25 12:41 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-03-25 12:41 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Christophe JAILLET, David Laight, Ian Rogers, Jin Yao, John Garry, Kajol Jain, Leo Yan, Mike Leach, Naveen N . Rao, Ravi Bangoria, Vijay Thakkar, 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 3442a9ecb8e72a33c28a2b969b766c659830e410: perf/x86/intel/uncore: Factor out __snr_uncore_mmio_init_box (2020-03-20 13:06:23 +0100) 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.7-20200325 for you to fetch changes up to 0d33b34352531ff7029c58eda2321340c0ea3f5f: perf dso: Fix dso comparison (2020-03-24 10:57:38 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report/top: Jin Yao: - Support annotation of unresolved symbols, just using its addresses. - Print addr_location.al_addr when finding a map but not a symbol, so that we have the address relative to the map which is what objdump produces, then we can match the output of perf and objdump for such unresolved addresses. - Allow sorting by non-group leaders when working with multiple events, be it in a explicit group, i.e. an event list surrounded by {} (e.g. 'perf record -e '{cycles,instructions,cache-misses}', or without, using --group in 'perf report', e.g.: perf record -e cycles,instructions,cache-misses perf report --group --group-sort-idx 1 That '1' will ask for the output to be sorted by 'instructions', not the default 'cycles'. - Add hotkeys to interactively resort the output when using multiple events, '0', '1', ... '9' to resort by the nth event, just like when using --group-sort-idx, as explained above. perf stat: Jin Yao: - Align the output for interval aggregation mode. event parsing: Ian Rogers: - Fix 3 use after frees found with clang ASAN. perf tools: Jiri Olsa: - Unify a bit the build directory output. perf tests: John Garry: - Add PMU events tests, checking that JSON files are properly parsed. perf stat: Kajol Jain: - Fix printing event names of metric group with multiple events incase of overlapping events. perf symbols: Leo Yan: - Consolidate symbol fixup issue. vendor events AMD: Vijay Thakkar: - Restrict model detection for zen1 based processors - Add Zen2 events. - Update Zen1 events to V2. perf cpumap: Christophe JAILLET: - Fix snprintf overflow check DSOs: Ravi Bangoria: - Fix dso comparison wrt IDs (maj, min, etc), that had made 'perf archive' stop working when build-ids were not being collected. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (1): tools headers uapi: Update linux/in.h copy Christophe JAILLET (1): perf cpumap: Fix snprintf overflow check Ian Rogers (1): perf parse-events: Fix 3 use after frees found with clang ASAN Jin Yao (7): perf report: Print al_addr when symbol is not found perf report: Support interactive annotation of code without symbols perf report/top TUI: Support hotkey 'a' for annotation of unresolved addresses perf report: Allow specifying event to be used as sort key in --group output perf report: Support a new key to reload the browser perf report/top TUI: Support hotkeys to let user select any event for sorting perf stat: Align the output for interval aggregation mode Jiri Olsa (1): perf tools: Unify a bit the build directory output John Garry (7): perf jevents: Add some test events perf jevents: Support test events folder perf pmu: Refactor pmu_add_cpu_aliases() perf test: Add pmu-events test perf pmu: Add is_pmu_core() perf pmu: Make pmu_uncore_alias_match() public perf test: Test pmu-events aliases Kajol Jain (1): perf metricgroup: Fix printing event names of metric group with multiple events incase of overlapping events Leo Yan (1): perf symbols: Consolidate symbol fixup issue Ravi Bangoria (1): perf dso: Fix dso comparison Vijay Thakkar (3): perf vendor events amd: Restrict model detection for zen1 based processors perf vendor events amd: Add Zen2 events perf vendor events amd: Update Zen1 events to V2 tools/include/uapi/linux/in.h | 2 + tools/perf/Documentation/perf-report.txt | 5 + tools/perf/Makefile.perf | 9 +- tools/perf/arch/arm64/util/Build | 1 - tools/perf/arch/arm64/util/sym-handling.c | 19 -- tools/perf/arch/powerpc/util/Build | 1 - tools/perf/arch/powerpc/util/sym-handling.c | 10 - tools/perf/builtin-report.c | 16 +- .../{x86/amdfam17h => test/test_cpu}/branch.json | 0 .../perf/pmu-events/arch/test/test_cpu/other.json | 26 ++ .../perf/pmu-events/arch/test/test_cpu/uncore.json | 21 ++ .../perf/pmu-events/arch/x86/amdfam17h/cache.json | 329 ------------------ .../perf/pmu-events/arch/x86/amdfam17h/other.json | 65 ---- tools/perf/pmu-events/arch/x86/amdzen1/branch.json | 23 ++ tools/perf/pmu-events/arch/x86/amdzen1/cache.json | 294 ++++++++++++++++ .../arch/x86/{amdfam17h => amdzen1}/core.json | 15 +- .../x86/{amdfam17h => amdzen1}/floating-point.json | 64 +++- .../arch/x86/{amdfam17h => amdzen1}/memory.json | 82 +++-- tools/perf/pmu-events/arch/x86/amdzen1/other.json | 56 +++ tools/perf/pmu-events/arch/x86/amdzen2/branch.json | 52 +++ tools/perf/pmu-events/arch/x86/amdzen2/cache.json | 338 ++++++++++++++++++ tools/perf/pmu-events/arch/x86/amdzen2/core.json | 130 +++++++ .../arch/x86/amdzen2/floating-point.json | 140 ++++++++ tools/perf/pmu-events/arch/x86/amdzen2/memory.json | 341 ++++++++++++++++++ tools/perf/pmu-events/arch/x86/amdzen2/other.json | 115 +++++++ tools/perf/pmu-events/arch/x86/mapfile.csv | 3 +- tools/perf/pmu-events/jevents.c | 30 ++ tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/pmu-events.c | 379 +++++++++++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/hists.c | 118 ++++++- tools/perf/ui/hist.c | 93 ++++- tools/perf/ui/keysyms.h | 1 + tools/perf/util/annotate.h | 1 + tools/perf/util/cpumap.c | 10 +- tools/perf/util/dsos.c | 22 +- tools/perf/util/evsel.c | 1 + tools/perf/util/hist.h | 1 + tools/perf/util/metricgroup.c | 49 +-- tools/perf/util/parse-events.c | 6 +- tools/perf/util/pmu.c | 28 +- tools/perf/util/pmu.h | 5 + tools/perf/util/sort.c | 6 +- tools/perf/util/stat-display.c | 6 +- tools/perf/util/symbol-elf.c | 10 +- tools/perf/util/symbol_conf.h | 1 + 47 files changed, 2374 insertions(+), 556 deletions(-) delete mode 100644 tools/perf/arch/arm64/util/sym-handling.c rename tools/perf/pmu-events/arch/{x86/amdfam17h => test/test_cpu}/branch.json (100%) create mode 100644 tools/perf/pmu-events/arch/test/test_cpu/other.json create mode 100644 tools/perf/pmu-events/arch/test/test_cpu/uncore.json delete mode 100644 tools/perf/pmu-events/arch/x86/amdfam17h/cache.json delete mode 100644 tools/perf/pmu-events/arch/x86/amdfam17h/other.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen1/branch.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen1/cache.json rename tools/perf/pmu-events/arch/x86/{amdfam17h => amdzen1}/core.json (87%) rename tools/perf/pmu-events/arch/x86/{amdfam17h => amdzen1}/floating-point.json (61%) rename tools/perf/pmu-events/arch/x86/{amdfam17h => amdzen1}/memory.json (63%) create mode 100644 tools/perf/pmu-events/arch/x86/amdzen1/other.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen2/branch.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen2/cache.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen2/core.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen2/floating-point.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen2/memory.json create mode 100644 tools/perf/pmu-events/arch/x86/amdzen2/other.json create mode 100644 tools/perf/tests/pmu-events.c 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. Ubuntu 19.10 is failing when linking against libllvm, which isn't the default, needs to be investigated, haven't tested with CC=gcc, but should be the same problem: + make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= LIBCLANGLLVM=1 -C /git/linux/tools/perf O=/tmp/build/perf CC=clang ... /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x43): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_hasLoopVariable0Matcher::matches(clang::CXXForRangeStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' ... It builds ok with the default set of options. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.6.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:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.1 (git://git.alpinelinux.org/aports 7c78441134e54efbb34618f457d88c783c913361) (based on LLVM 9.0.1) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus 9.2.1-alt2), clang version 7.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4), clang version 8.0.1 (Red Hat 8.0.1-1.module_el8.1.0+215+a01033fb) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20200214 gcc_9_2_0_release-615-g7866f9ebf1, clang version 9.0.1 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : Ok gcc (Debian 9.2.1-28) 9.2.1 20200203, clang version 8.0.1-7 (tags/RELEASE_801/final) 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-24) 9.2.1 20200117 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.1 (Fedora 9.0.1-2.fc31) 44 fedora:32 : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.1.rc2.fc32) 45 fedora:rawhide : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.3.rc2.fc33) 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 51 openmandriva:cooker : Ok gcc (GCC) 10.0.0 20200216 (OpenMandriva), clang version 10.0.0 52 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) 53 opensuse:15.1 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 54 opensuse:15.2 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 55 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 56 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20200128 [revision 83f65674e78d97d27537361de1a9d74067ff228d], clang version 9.0.1 57 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 58 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 59 oraclelinux:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4.5.0.5), clang version 8.0.1 (Red Hat 8.0.1-1.0.1.module+el8.1.0+5428+345cee14) 60 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) 61 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 62 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 63 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 69 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) 70 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 77 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 78 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 79 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 80 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) 81 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 82 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 83 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 84 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 85 ubuntu:19.10 : FAIL gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux five 5.5.10-200.fc31.x86_64 #1 SMP Wed Mar 18 14:21:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 0d33b3435253 perf dso: Fix dso comparison # perf version --build-options perf version 5.6.rc6.g9a13a0215c8d dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: PMU events : Ok 11: DSO data read : Ok 12: DSO data cache : Ok 13: DSO data reopen : Ok 14: Roundtrip evsel->name : Ok 15: Parse sched tracepoints fields : Ok 16: syscalls:sys_enter_openat event fields : Ok 17: Setup struct perf_event_attr : Ok 18: Match and link multiple hists : Ok 19: 'import perf' in python : Ok 20: Breakpoint overflow signal handler : Ok 21: Breakpoint overflow sampling : Ok 22: Breakpoint accounting : Ok 23: Watchpoint : 23.1: Read Only Watchpoint : Skip 23.2: Write Only Watchpoint : Ok 23.3: Read / Write Watchpoint : Ok 23.4: Modify Watchpoint : Ok 24: Number of exit events of a simple workload : Ok 25: Software clock events period values : Ok 26: Object code reading : Ok 27: Sample parsing : Ok 28: Use a dummy software event to keep tracking : Ok 29: Parse with no sample_id_all bit set : Ok 30: Filter hist entries : Ok 31: Lookup mmap thread : Ok 32: Share thread maps : Ok 33: Sort output of hist entries : Ok 34: Cumulate child hist entries : Ok 35: Track with sched_switch : Ok 36: Filter fds with revents mask in a fdarray : Ok 37: Add fd to a fdarray, making it autogrow : Ok 38: kmod_path__parse : Ok 39: Thread map : Ok 40: LLVM search and compile : 40.1: Basic BPF llvm compile : Ok 40.2: kbuild searching : Ok 40.3: Compile source for BPF prologue generation : Ok 40.4: Compile source for BPF relocation : Ok 41: Session topology : Ok 42: BPF filter : 42.1: Basic BPF filtering : Ok 42.2: BPF pinning : Ok 42.3: BPF prologue generation : Ok 42.4: BPF relocation checker : Ok 43: Synthesize thread map : Ok 44: Remove thread map : Ok 45: Synthesize cpu map : Ok 46: Synthesize stat config : Ok 47: Synthesize stat : Ok 48: Synthesize stat round : Ok 49: Synthesize attr update : Ok 50: Event times : Ok 51: Read backward ring buffer : Ok 52: Print cpu map : Ok 53: Merge cpu map : Ok 54: Probe SDT events : Ok 55: is_printable_array : Ok 56: Print bitmap : Ok 57: perf hooks : Ok 58: builtin clang support : Skip (not compiled in) 59: unit_number__scnprintf : Ok 60: mem2node : Ok 61: time utils : Ok 62: Test jit_write_elf : Ok 63: maps__merge_in : Ok 64: x86 rdpmc : Ok 65: Convert perf time to TSC : Ok 66: DWARF unwind : Ok 67: x86 instruction decoder - new instructions : Ok 68: Intel PT packet decoder : Ok 69: x86 bp modify : Ok 70: probe libc's inet_pton & backtrace it with ping : Ok 71: Use vfs_getname probe to get syscall args filenames : Ok 72: Check open filename arg using perf trace + vfs_getname: Ok 73: Zstd perf.data compression/decompression : Ok 74: Add vfs_getname probe to get syscall args filenames : Ok $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_tags_O: make tags make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libelf_O: make NO_LIBELF=1 make_debug_O: make DEBUG=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_newt_O: make NO_NEWT=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_bin_O: make install-bin make_help_O: make help make_pure_O: make make_no_slang_O: make NO_SLANG=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_gtk2_O: make NO_GTK2=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_demangle_O: make NO_DEMANGLE=1 make_util_map_o_O: make util/map.o make_no_backtrace_O: make NO_BACKTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_doc_O: make doc make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libbpf_O: make NO_LIBBPF=1 make_perf_o_O: make perf.o make_clean_all_O: make clean all make_install_O: make install make_with_babeltrace_O: make LIBBABELTRACE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2020-03-17 21:32 Arnaldo Carvalho de Melo 2020-03-19 14:03 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-03-17 21:32 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov, Andi Kleen, disconnect3d, Ian Rogers, Jin Yao, Kan Liang, Leo Yan, Michael Petlan, Mike Leach, Thomas Richter, 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 f787feff69c466dfc6f261c9632627e383b49187: perf block-info: Support color ops to print block percents in color (2020-03-09 21:43:25 -0300) 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.7-20200317 for you to fetch changes up to 59a08b4b3b1a9374adacd13cd7544c03e5582e0e: perf expr: Fix copy/paste mistake (2020-03-17 18:01:40 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf record: Alexey Budankov: - Fix binding of AIO user space buffers to nodes maps: Dominik b. Czarnota: - Fix off by one in strncpy() size argument. Arnaldo Carvalho de Melo: - Use strstarts() to look for Android libraries. Ian Rogers: - Give synthetic mmap events an inode generation. man pages: Ian Rogers: - Set man page date to last git commit. perf test: Ian Rogers: - Print if shell directory isn't present. perf report: Jin Yao: - Fix no branch type statistics report issue. perf expr: Jiri Olsa: - Fix copy/paste mistake vendor events: Kan Liang: - Support metric constraints. vendor events intel: Kan Liang: - Add NO_NMI_WATCHDOG metric constraint. vendor events s390: Thomas Richter: - Add new deflate counters for IBM z15. ARM cs-etm: Leo Yan: - Last branch improvements. intel-pt: Adrian Hunter: - Update intel-pt.txt file with new location of the documentation. - Add Intel PT man page references. - Rename intel-pt.txt and put it in man page format. perl scripting: Michael Petlan: - Add common_callchain to fix argument order. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (3): perf intel-pt: Rename intel-pt.txt and put it in man page format perf intel-pt: Add Intel PT man page references perf intel-pt: Update intel-pt.txt file with new location of the documentation Alexey Budankov (1): perf record: Fix binding of AIO user space buffers to nodes Arnaldo Carvalho de Melo (1): perf map: Use strstarts() to look for Android libraries Ian Rogers (3): perf doc: Set man page date to last git commit perf test: Print if shell directory isn't present perf tools: Give synthetic mmap events an inode generation Jin Yao (1): perf report: Fix no branch type statistics report issue Jiri Olsa (1): perf expr: Fix copy/paste mistake Kan Liang (5): perf jevents: Support metric constraint perf metricgroup: Factor out metricgroup__add_metric_weak_group() perf util: Factor out sysctl__nmi_watchdog_enabled() perf metricgroup: Support metric constraint perf vendor events intel: Add NO_NMI_WATCHDOG metric constraint Leo Yan (5): perf cs-etm: Swap packets for instruction samples perf cs-etm: Continuously record last branch perf cs-etm: Correct synthesizing instruction samples perf cs-etm: Optimize copying last branches perf cs-etm: Fix unsigned variable comparison to zero Michael Petlan (1): perf scripting perl: Add common_callchain to fix argument order Thomas Richter (1): perf vendor events s390: Add new deflate counters for IBM z15 disconnect3d (1): perf map: Fix off by one in strncpy() size argument tools/perf/Documentation/Makefile | 5 +- tools/perf/Documentation/intel-pt.txt | 992 +------------------ tools/perf/Documentation/perf-inject.txt | 3 +- tools/perf/Documentation/perf-intel-pt.txt | 1007 ++++++++++++++++++++ tools/perf/Documentation/perf-record.txt | 2 +- tools/perf/Documentation/perf-report.txt | 3 +- tools/perf/Documentation/perf-script.txt | 2 +- tools/perf/builtin-report.c | 9 +- .../perf/pmu-events/arch/s390/cf_z15/crypto6.json | 8 +- .../perf/pmu-events/arch/s390/cf_z15/extended.json | 30 +- .../arch/x86/cascadelakex/clx-metrics.json | 3 +- .../pmu-events/arch/x86/skylake/skl-metrics.json | 3 +- .../pmu-events/arch/x86/skylakex/skx-metrics.json | 3 +- tools/perf/pmu-events/jevents.c | 19 +- tools/perf/pmu-events/jevents.h | 2 +- tools/perf/pmu-events/pmu-events.h | 1 + tools/perf/scripts/perl/check-perf-trace.pl | 6 +- tools/perf/scripts/perl/failed-syscalls.pl | 2 +- tools/perf/scripts/perl/rw-by-file.pl | 6 +- tools/perf/scripts/perl/rw-by-pid.pl | 10 +- tools/perf/scripts/perl/rwtop.pl | 10 +- tools/perf/scripts/perl/wakeup-latency.pl | 6 +- tools/perf/tests/builtin-test.c | 5 +- tools/perf/util/cs-etm.c | 157 ++- tools/perf/util/expr.l | 4 +- tools/perf/util/map.c | 8 +- tools/perf/util/metricgroup.c | 109 ++- tools/perf/util/mmap.c | 21 +- tools/perf/util/stat-display.c | 6 +- tools/perf/util/synthetic-events.c | 1 + tools/perf/util/util.c | 18 + tools/perf/util/util.h | 2 + 32 files changed, 1340 insertions(+), 1123 deletions(-) create mode 100644 tools/perf/Documentation/perf-intel-pt.txt 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 and debian:experimental are failing when due to: `.gnu.debuglto_.debug_macro' referenced in section `.gnu.debuglto_.debug_macro' of /tmp/build/perf/util/scripting-engines/perf-in.o: defined in discarded section `.gnu.debuglto_.debug_macro[wm4.stdcpredef.h.19.8dc41bed5d9037ff9622e015fb5f0ce3]' of /tmp/build/perf/util/scripting-engines/perf-in.o Ubuntu 19.10 is failing when linking against libllvm, which isn't the default, needs to be investigated, haven't tested with CC=gcc, but should be the same problem: + make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= LIBCLANGLLVM=1 -C /git/linux/tools/perf O=/tmp/build/perf CC=clang ... /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x43): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_hasLoopVariable0Matcher::matches(clang::CXXForRangeStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' ... It builds ok with the default set of options. # export PERF_TARBALL=http://192.168.122.1/perf/perf-5.6.0-rc4.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.1 (git://git.alpinelinux.org/aports 7c78441134e54efbb34618f457d88c783c913361) (based on LLVM 9.0.1) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20200123 (ALT Sisyphus 9.2.1-alt3), clang version 9.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4), clang version 8.0.1 (Red Hat 8.0.1-1.module_el8.1.0+215+a01033fb) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20200305 gcc_9_2_0_release-738-ge50627ff8c, clang version 9.0.1 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : FAIL gcc (Debian 9.2.1-31) 9.2.1 20200306, clang version 9.0.1-9 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 9.2.1-28) 9.2.1 20200203 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 9.2.1-24) 9.2.1 20200117 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-24) 9.2.1 20200117 29 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 30 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 31 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 32 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 33 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 34 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 35 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 36 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 37 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 38 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) 39 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 40 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 41 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.1 (Fedora 9.0.1-2.fc31) 43 fedora:32 : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.1.rc2.fc32) 44 fedora:rawhide : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.5.rc3.fc33) 45 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 46 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 47 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 48 mageia:7 : Ok gcc (Mageia 8.4.0-1.mga7) 8.4.0, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 49 manjaro:latest : Ok gcc (Arch Linux 9.2.1+20200130-2) 9.2.1 20200130, clang version 9.0.1 50 openmandriva:cooker : Ok gcc (GCC) 10.0.0 20200301 (OpenMandriva), clang version 10.0.0 51 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 5.0.1 (tags/RELEASE_501/final 312548) 52 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 53 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20200128 [revision 83f65674e78d97d27537361de1a9d74067ff228d], clang version 9.0.1 54 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 55 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 56 oraclelinux:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4.5.0.5), clang version 8.0.1 (Red Hat 8.0.1-1.0.1.module+el8.1.0+5428+345cee14) 57 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) 58 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 59 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 60 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:18.04 : Ok gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 67 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 68 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 69 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 70 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 71 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 72 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 73 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 74 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 75 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 76 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 77 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 78 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 79 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 80 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 81 ubuntu:19.10 : FAIL gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) $ # uname -a Linux five 5.5.8-200.fc31.x86_64 #1 SMP Thu Mar 5 21:28:03 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 59a08b4b3b1a perf expr: Fix copy/paste mistake # perf version --build-options perf version 5.6.rc4.g59a08b4b3b1a 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 maps : 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: Merge cpu map : Ok 53: Probe SDT events : Ok 54: is_printable_array : Ok 55: Print bitmap : Ok 56: perf hooks : Ok 57: builtin clang support : Skip (not compiled in) 58: unit_number__scnprintf : Ok 59: mem2node : Ok 60: time utils : Ok 61: Test jit_write_elf : Ok 62: maps__merge_in : Ok 63: x86 rdpmc : Ok 64: Convert perf time to TSC : Ok 65: DWARF unwind : Ok 66: x86 instruction decoder - new instructions : Ok 67: Intel PT packet decoder : Ok 68: x86 bp modify : Ok 69: probe libc's inet_pton & backtrace it with ping : Ok 70: Use vfs_getname probe to get syscall args filenames : Ok 71: Check open filename arg using perf trace + vfs_getname: Ok 72: Zstd perf.data compression/decompression : Ok 73: Add vfs_getname probe to get syscall args filenames : Ok $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_auxtrace_O: make NO_AUXTRACE=1 make_help_O: make help make_doc_O: make doc make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_slang_O: make NO_SLANG=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_tags_O: make tags make_no_demangle_O: make NO_DEMANGLE=1 make_install_prefix_O: make install prefix=/tmp/krava make_pure_O: make make_perf_o_O: make perf.o make_no_gtk2_O: make NO_GTK2=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_clean_all_O: make clean all make_no_newt_O: make NO_NEWT=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_debug_O: make DEBUG=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libelf_O: make NO_LIBELF=1 make_install_O: make install make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_util_map_o_O: make util/map.o make_install_bin_O: make install-bin make_no_libperl_O: make NO_LIBPERL=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_with_babeltrace_O: make LIBBABELTRACE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-03-17 21:32 Arnaldo Carvalho de Melo @ 2020-03-19 14:03 ` Ingo Molnar 2020-03-19 14:07 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 160+ messages in thread From: Ingo Molnar @ 2020-03-19 14:03 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Andi Kleen, disconnect3d, Ian Rogers, Jin Yao, Kan Liang, Leo Yan, Michael Petlan, Mike Leach, Thomas Richter, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit f787feff69c466dfc6f261c9632627e383b49187: > > perf block-info: Support color ops to print block percents in color (2020-03-09 21:43:25 -0300) > > 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.7-20200317 > > for you to fetch changes up to 59a08b4b3b1a9374adacd13cd7544c03e5582e0e: > > perf expr: Fix copy/paste mistake (2020-03-17 18:01:40 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf record: > > Alexey Budankov: > > - Fix binding of AIO user space buffers to nodes > > maps: > > Dominik b. Czarnota: > > - Fix off by one in strncpy() size argument. > > Arnaldo Carvalho de Melo: > > - Use strstarts() to look for Android libraries. > > Ian Rogers: > > - Give synthetic mmap events an inode generation. > > man pages: > > Ian Rogers: > > - Set man page date to last git commit. > > perf test: > > Ian Rogers: > > - Print if shell directory isn't present. > > perf report: > > Jin Yao: > > - Fix no branch type statistics report issue. > > perf expr: > > Jiri Olsa: > > - Fix copy/paste mistake > > vendor events: > > Kan Liang: > > - Support metric constraints. > > vendor events intel: > > Kan Liang: > > - Add NO_NMI_WATCHDOG metric constraint. > > vendor events s390: > > Thomas Richter: > > - Add new deflate counters for IBM z15. > > ARM cs-etm: > > Leo Yan: > > - Last branch improvements. > > intel-pt: > > Adrian Hunter: > > - Update intel-pt.txt file with new location of the documentation. > > - Add Intel PT man page references. > > - Rename intel-pt.txt and put it in man page format. > > perl scripting: > > Michael Petlan: > > - Add common_callchain to fix argument order. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (3): > perf intel-pt: Rename intel-pt.txt and put it in man page format > perf intel-pt: Add Intel PT man page references > perf intel-pt: Update intel-pt.txt file with new location of the documentation > > Alexey Budankov (1): > perf record: Fix binding of AIO user space buffers to nodes > > Arnaldo Carvalho de Melo (1): > perf map: Use strstarts() to look for Android libraries > > Ian Rogers (3): > perf doc: Set man page date to last git commit > perf test: Print if shell directory isn't present > perf tools: Give synthetic mmap events an inode generation > > Jin Yao (1): > perf report: Fix no branch type statistics report issue > > Jiri Olsa (1): > perf expr: Fix copy/paste mistake > > Kan Liang (5): > perf jevents: Support metric constraint > perf metricgroup: Factor out metricgroup__add_metric_weak_group() > perf util: Factor out sysctl__nmi_watchdog_enabled() > perf metricgroup: Support metric constraint > perf vendor events intel: Add NO_NMI_WATCHDOG metric constraint > > Leo Yan (5): > perf cs-etm: Swap packets for instruction samples > perf cs-etm: Continuously record last branch > perf cs-etm: Correct synthesizing instruction samples > perf cs-etm: Optimize copying last branches > perf cs-etm: Fix unsigned variable comparison to zero > > Michael Petlan (1): > perf scripting perl: Add common_callchain to fix argument order > > Thomas Richter (1): > perf vendor events s390: Add new deflate counters for IBM z15 > > disconnect3d (1): > perf map: Fix off by one in strncpy() size argument > > tools/perf/Documentation/Makefile | 5 +- > tools/perf/Documentation/intel-pt.txt | 992 +------------------ > tools/perf/Documentation/perf-inject.txt | 3 +- > tools/perf/Documentation/perf-intel-pt.txt | 1007 ++++++++++++++++++++ > tools/perf/Documentation/perf-record.txt | 2 +- > tools/perf/Documentation/perf-report.txt | 3 +- > tools/perf/Documentation/perf-script.txt | 2 +- > tools/perf/builtin-report.c | 9 +- > .../perf/pmu-events/arch/s390/cf_z15/crypto6.json | 8 +- > .../perf/pmu-events/arch/s390/cf_z15/extended.json | 30 +- > .../arch/x86/cascadelakex/clx-metrics.json | 3 +- > .../pmu-events/arch/x86/skylake/skl-metrics.json | 3 +- > .../pmu-events/arch/x86/skylakex/skx-metrics.json | 3 +- > tools/perf/pmu-events/jevents.c | 19 +- > tools/perf/pmu-events/jevents.h | 2 +- > tools/perf/pmu-events/pmu-events.h | 1 + > tools/perf/scripts/perl/check-perf-trace.pl | 6 +- > tools/perf/scripts/perl/failed-syscalls.pl | 2 +- > tools/perf/scripts/perl/rw-by-file.pl | 6 +- > tools/perf/scripts/perl/rw-by-pid.pl | 10 +- > tools/perf/scripts/perl/rwtop.pl | 10 +- > tools/perf/scripts/perl/wakeup-latency.pl | 6 +- > tools/perf/tests/builtin-test.c | 5 +- > tools/perf/util/cs-etm.c | 157 ++- > tools/perf/util/expr.l | 4 +- > tools/perf/util/map.c | 8 +- > tools/perf/util/metricgroup.c | 109 ++- > tools/perf/util/mmap.c | 21 +- > tools/perf/util/stat-display.c | 6 +- > tools/perf/util/synthetic-events.c | 1 + > tools/perf/util/util.c | 18 + > tools/perf/util/util.h | 2 + > 32 files changed, 1340 insertions(+), 1123 deletions(-) > create mode 100644 tools/perf/Documentation/perf-intel-pt.txt Pulled this and the previous perf/core pull request into tip:perf/core, thanks Arnaldo! (You might want to double check my conflict resolution with perf/urgent, to tools/perf/util/map.c.) Thanks, Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-03-19 14:03 ` Ingo Molnar @ 2020-03-19 14:07 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-03-19 14:07 UTC (permalink / raw) To: Ingo Molnar Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Andi Kleen, disconnect3d, Ian Rogers, Jin Yao, Kan Liang, Leo Yan, Michael Petlan, Mike Leach, Thomas Richter, Arnaldo Carvalho de Melo Em Thu, Mar 19, 2020 at 03:03:38PM +0100, Ingo Molnar escreveu: > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > 32 files changed, 1340 insertions(+), 1123 deletions(-) > > create mode 100644 tools/perf/Documentation/perf-intel-pt.txt > Pulled this and the previous perf/core pull request into tip:perf/core, thanks Arnaldo! > (You might want to double check my conflict resolution with perf/urgent, > to tools/perf/util/map.c.) I'll check, thanks for pulling the outstanding pull reqs! - Arnaldo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2020-03-10 11:15 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-03-10 11:15 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jin Yao, Kan Liang, Michael Petlan, Ravi Bangoria, Steven Rostedt, 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 d46eec8e975a8180e178e01ba505801c44bc9a6c: Merge remote-tracking branch 'acme/perf/urgent' into perf/core (2020-03-04 10:29:19 -0300) 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.7-20200310 for you to fetch changes up to f787feff69c466dfc6f261c9632627e383b49187: perf block-info: Support color ops to print block percents in color (2020-03-09 21:43:25 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf stat: Jin Yao: - Show percore counts in per CPU output. perf report: Jin Yao: - Allow selecting which block info columns to report and its order. - Support color ops to print block percents in color. - Fix wrong block address comparison in block_info__cmp(). perf annotate: Ravi Bangoria: - Get rid of annotation->nr_jumps, unused. expr: Jiri Olsa: - Move expr lexer to flex. llvm: Arnaldo Carvalho de Melo: - Add debug hint message about missing kernel-devel package. core: Kan Liang: - Initial patches to support the recently added PERF_SAMPLE_BRANCH_HW_INDEX kernel feature. - Add check for unexpected use of reserved membrs in event attr, so that in the future older perf tools will complain instead of silently try to process unknown features. libapi: Namhyung Kim: - Adopt cgroupsfs_find_mountpoint() from tools/perf/util/. libperf: Michael Petlan: - Add counting example. libtraceevent: Steven Rostedt (VMware): - Remove extra '\n' in print_event_time(). Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf llvm: Add debug hint message about missing kernel-devel package tools headers UAPI: Update tools's copy of linux/perf_event.h Jin Yao (5): perf stat: Show percore counts in per CPU output perf block-info: Fix wrong block address comparison in block_info__cmp() perf diff: Use __block_info__cmp() to replace block_pair_cmp() perf block-info: Allow selecting which columns to report and its order perf block-info: Support color ops to print block percents in color Jiri Olsa (5): perf expr: Add expr.c object perf expr: Move expr lexer to flex perf expr: Increase EXPR_MAX_OTHER to support metrics with more than 15 variables perf expr: Straighten expr__parse()/expr__find_other() interface perf expr: Make expr__parse() return -1 on error Kan Liang (3): perf tools: Add hw_idx in struct branch_stack perf evsel: Support PERF_SAMPLE_BRANCH_HW_INDEX perf header: Add check for unexpected use of reserved membrs in event attr Michael Petlan (1): libperf: Add counting example Namhyung Kim (1): tools lib api fs: Move cgroupsfs_find_mountpoint() Ravi Bangoria (1): perf annotate: Get rid of annotation->nr_jumps Steven Rostedt (VMware) (1): tools lib traceevent: Remove extra '\n' in print_event_time() tools/include/uapi/linux/perf_event.h | 8 +- tools/lib/api/fs/Build | 1 + tools/lib/api/fs/cgroup.c | 67 ++++++++ tools/lib/api/fs/fs.h | 2 + tools/lib/perf/Documentation/examples/counting.c | 83 +++++++++ tools/lib/traceevent/event-parse.c | 2 +- tools/perf/Documentation/perf-stat.txt | 9 + tools/perf/builtin-diff.c | 21 +-- tools/perf/builtin-report.c | 21 ++- tools/perf/builtin-script.c | 70 ++++---- tools/perf/builtin-stat.c | 4 + tools/perf/tests/expr.c | 10 +- tools/perf/tests/sample-parsing.c | 7 +- tools/perf/util/Build | 11 +- tools/perf/util/annotate.c | 2 - tools/perf/util/annotate.h | 1 - tools/perf/util/block-info.c | 106 +++++++----- tools/perf/util/block-info.h | 9 +- tools/perf/util/branch.h | 22 +++ tools/perf/util/cgroup.c | 63 +------ tools/perf/util/cs-etm.c | 2 + tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 20 ++- tools/perf/util/evsel.h | 6 + tools/perf/util/expr.c | 112 +++++++++++++ tools/perf/util/expr.h | 8 +- tools/perf/util/expr.l | 114 +++++++++++++ tools/perf/util/expr.y | 185 ++++----------------- tools/perf/util/header.c | 37 +++++ tools/perf/util/hist.c | 3 +- tools/perf/util/intel-pt.c | 2 + tools/perf/util/llvm-utils.c | 2 + tools/perf/util/machine.c | 35 ++-- tools/perf/util/perf_event_attr_fprintf.c | 1 + .../util/scripting-engines/trace-event-python.c | 30 ++-- tools/perf/util/session.c | 8 +- tools/perf/util/stat-display.c | 33 +++- tools/perf/util/stat-shadow.c | 4 +- tools/perf/util/stat.h | 1 + tools/perf/util/synthetic-events.c | 6 +- 40 files changed, 750 insertions(+), 379 deletions(-) create mode 100644 tools/lib/api/fs/cgroup.c create mode 100644 tools/lib/perf/Documentation/examples/counting.c create mode 100644 tools/perf/util/expr.c create mode 100644 tools/perf/util/expr.l 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 due to: `.gnu.debuglto_.debug_macro' referenced in section `.gnu.debuglto_.debug_macro' of /tmp/build/perf/util/scripting-engines/perf-in.o: defined in discarded section `.gnu.debuglto_.debug_macro[wm4.stdcpredef.h.19.8dc41bed5d9037ff9622e015fb5f0ce3]' of /tmp/build/perf/util/scripting-engines/perf-in.o Ubuntu 19.10 is failing when linking against libllvm, which isn't the default, needs to be investigated, haven't tested with CC=gcc, but should be the same problem: + make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= LIBCLANGLLVM=1 -C /git/linux/tools/perf O=/tmp/build/perf CC=clang ... /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x43): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_hasLoopVariable0Matcher::matches(clang::CXXForRangeStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' ... It builds ok with the default set of options. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.6.0-rc4.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.1 (git://git.alpinelinux.org/aports 7c78441134e54efbb34618f457d88c783c913361) (based on LLVM 9.0.1) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus 9.2.1-alt2), clang version 7.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4), clang version 8.0.1 (Red Hat 8.0.1-1.module_el8.1.0+215+a01033fb) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20200214 gcc_9_2_0_release-615-g7866f9ebf1, clang version 9.0.1 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : Ok gcc (Debian 9.2.1-28) 9.2.1 20200203, clang version 8.0.1-7 (tags/RELEASE_801/final) 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-24) 9.2.1 20200117 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.1 (Fedora 9.0.1-2.fc31) 44 fedora:32 : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.1.rc2.fc32) 45 fedora:rawhide : Ok gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8), clang version 10.0.0 (Fedora 10.0.0-0.3.rc2.fc33) 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 51 openmandriva:cooker : Ok gcc (GCC) 10.0.0 20200216 (OpenMandriva), clang version 10.0.0 52 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) 53 opensuse:15.1 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 54 opensuse:15.2 : Ok gcc (SUSE Linux) 7.5.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 55 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 56 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20200128 [revision 83f65674e78d97d27537361de1a9d74067ff228d], clang version 9.0.1 57 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 58 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 59 oraclelinux:8 : Ok gcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4.5.0.5), clang version 8.0.1 (Red Hat 8.0.1-1.0.1.module+el8.1.0+5428+345cee14) 60 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) 61 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 62 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 63 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 69 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) 70 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 77 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 78 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 79 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 80 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) 81 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 82 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 83 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 84 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 85 ubuntu:19.10 : FAIL gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux five 5.5.5-200.fc31.x86_64 #1 SMP Wed Feb 19 23:28:07 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 f787feff69c4 perf block-info: Support color ops to print block percents in color # perf version --build-options perf version 5.6.rc4.gf787feff69c4 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 maps : 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: Merge cpu map : Ok 53: Probe SDT events : Ok 54: is_printable_array : Ok 55: Print bitmap : Ok 56: perf hooks : Ok 57: builtin clang support : Skip (not compiled in) 58: unit_number__scnprintf : Ok 59: mem2node : Ok 60: time utils : Ok 61: Test jit_write_elf : Ok 62: maps__merge_in : Ok 63: x86 rdpmc : Ok 64: Convert perf time to TSC : Ok 65: DWARF unwind : Ok 66: x86 instruction decoder - new instructions : Ok 67: Intel PT packet decoder : Ok 68: x86 bp modify : Ok 69: probe libc's inet_pton & backtrace it with ping : Ok 70: Use vfs_getname probe to get syscall args filenames : Ok 71: Check open filename arg using perf trace + vfs_getname: Ok 72: Zstd perf.data compression/decompression : Ok 73: Add vfs_getname probe to get syscall args filenames : Ok $ git log --oneline -1 f787feff69c4 (HEAD -> perf/core, quaco/perf/core) perf block-info: Support color ops to print block percents in color $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libnuma_O: make NO_LIBNUMA=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_install_bin_O: make install-bin make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_doc_O: make doc make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libelf_O: make NO_LIBELF=1 make_perf_o_O: make perf.o make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_gtk2_O: make NO_GTK2=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_tags_O: make tags make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_slang_O: make NO_SLANG=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_pure_O: make make_clean_all_O: make clean all make_no_libbpf_O: make NO_LIBBPF=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_libperl_O: make NO_LIBPERL=1 make_util_map_o_O: make util/map.o make_with_babeltrace_O: make LIBBABELTRACE=1 make_help_O: make help make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_newt_O: make NO_NEWT=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_install_O: make install make_no_demangle_O: make NO_DEMANGLE=1 make_debug_O: make DEBUG=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2020-01-16 13:48 Arnaldo Carvalho de Melo 2020-01-20 8:23 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-01-16 13:48 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andi Kleen, Andres Freund, Cengiz Can, Jann Horn, Jin Yao, Maciej S . Szmigiero, Michael Petlan, Ravi Bangoria, Thomas Richter, 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 53f3feeb7bd2d78039b3dc9ab158bad2a5dbe012: Merge tag 'perf-core-for-mingo-5.6-20200106' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2020-01-10 18:49:34 +0100) 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.6-20200116 for you to fetch changes up to 8af19d66b956401bab1ef24049eec9421be93862: perf header: Use last modification time for timestamp (2020-01-15 10:17:20 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report: Andi Kleen: - Clarify in help that --children is default. Jin Yao: - Fix no libunwind compiled warning breaking s390. perf annotate/report/top: Andi Kleen: - Support --prefix/--prefix-strip, use it with objdump when doing disassembly. perf c2c: Andres Freund: - Fix return type for histogram sorting comparision functions. perf header: Michael Petlan: - Use last modification time for timestamp, i.e. st.st_mtime instead of the st_ctime. perf beauty: Cengiz Can: - Fix sockaddr printf format for long integers. libperf: Jiri Olsa: - Setup initial evlist::all_cpus value perf parser: Jiri Olsa: - Use %define api.pure full instead of %pure-parser, nuking warning from bison about using deprecated stuff. perf ui gtk: - Add missing zalloc object, fixing gtk browser build. perf clang: Maciej S. Szmigiero: - Fix build issues with Clang 9 and 8+. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (2): perf report: Clarify in help that --children is default perf tools: Support --prefix/--prefix-strip Andres Freund (1): perf c2c: Fix return type for histogram sorting comparision functions Cengiz Can (1): perf beauty sockaddr: Fix augmented syscall format warning Jin Yao (1): perf report: Fix no libunwind compiled warning break s390 issue Jiri Olsa (4): libperf: Setup initial evlist::all_cpus value perf tools: Use %define api.pure full instead of %pure-parser perf ui gtk: Add missing zalloc object perf/ui/gtk: Fix gtk2 build Maciej S. Szmigiero (2): perf clang: Fix build with Clang 9 tools build: Fix test-clang.cpp with Clang 8+ Michael Petlan (1): perf header: Use last modification time for timestamp tools/build/feature/Makefile | 2 +- tools/build/feature/test-clang.cpp | 6 ++++++ tools/lib/perf/evlist.c | 3 +++ tools/perf/Documentation/perf-annotate.txt | 6 ++++++ tools/perf/Documentation/perf-report.txt | 6 ++++++ tools/perf/Documentation/perf-top.txt | 6 ++++++ tools/perf/builtin-annotate.c | 7 +++++++ tools/perf/builtin-c2c.c | 10 ++++++---- tools/perf/builtin-report.c | 16 ++++++++++++---- tools/perf/builtin-top.c | 7 +++++++ tools/perf/trace/beauty/sockaddr.c | 2 +- tools/perf/ui/gtk/Build | 7 ++++++- tools/perf/util/annotate.c | 19 +++++++++++++++++-- tools/perf/util/annotate.h | 5 +++++ tools/perf/util/c++/clang.cpp | 4 ++++ tools/perf/util/expr.y | 3 ++- tools/perf/util/header.c | 2 +- tools/perf/util/parse-events.y | 2 +- 18 files changed, 97 insertions(+), 16 deletions(-) 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 due to: `.gnu.debuglto_.debug_macro' referenced in section `.gnu.debuglto_.debug_macro' of /tmp/build/perf/util/scripting-engines/perf-in.o: defined in discarded section `.gnu.debuglto_.debug_macro[wm4.stdcpredef.h.19.8dc41bed5d9037ff9622e015fb5f0ce3]' of /tmp/build/perf/util/scripting-engines/perf-in.o OpenMandriva Cooker works well with gcc, uncovers a bug where we have to get compiler-clang.h from the kernel sources, will be fixed soon. With the update of linux/linkage.h to move from ENTRY()/ENDPROC() to SYM_FUNC_START()/etc some of the older containers can't be used with clang, as the minimum version for the constructs used in the new linkage.h is 3.5, older versions (3.4, 3.4.2, etc) end up with: bench/../../arch/x86/lib/memcpy_64.S:44:14: error: unexpected token in '.type' directive .type MEMCPY STT_FUNC ; .size MEMCPY, .-MEMCPY ^ Ubuntu 19.10 is failing when linking against libllvm, which isn't the default, needs to be investigated, haven't tested with CC=gcc, but should be the same problem: + make ARCH= CROSS_COMPILE= EXTRA_CFLAGS= LIBCLANGLLVM=1 -C /git/linux/tools/perf O=/tmp/build/perf CC=clang ... /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x43): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' /usr/bin/ld: /usr/lib/llvm-9/lib/libclangAnalysis.a(ExprMutationAnalyzer.cpp.o): in function `clang::ast_matchers::internal::matcher_hasLoopVariable0Matcher::matches(clang::CXXForRangeStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const': (.text._ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal31matcher_hasLoopVariable0Matcher7matchesERKNS_15CXXForRangeStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' ... It builds ok with the default set of options. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.5.0-rc3.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (git://git.alpinelinux.org/aports 25c73ae7b95bdb42ae5f0ceac3b703e766582527) (based on LLVM 9.0.0) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus 9.2.1-alt2), clang version 7.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191210 gcc-9-branch@279166, clang version 9.0.0 (tags/RELEASE_900/final) 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : Ok gcc (Debian 9.2.1-19) 9.2.1 20191109, clang version 8.0.1-4 (tags/RELEASE_801/final) 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-8) 9.2.1 20190909 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 44 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 45 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 51 openmandriva:cooker : Ok gcc (GCC) 9.2.1 20191123 (OpenMandriva) 52 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) 53 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 54 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 55 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 56 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 57 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 58 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 59 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) 60 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) 61 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 62 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 63 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 69 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) 70 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 77 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 78 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 79 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 80 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) 81 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 82 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 83 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 84 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 85 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # uname -a Linux quaco 5.5.0-rc6+ #2 SMP Tue Jan 14 13:13:43 -03 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 8af19d66b956 perf header: Use last modification time for timestamp # perf version --build-options perf version 5.5.rc3.g8af19d66b956 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 maps : 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: Merge cpu map : Ok 53: Probe SDT events : Ok 54: is_printable_array : Ok 55: Print bitmap : Ok 56: perf hooks : Ok 57: builtin clang support : Skip (not compiled in) 58: unit_number__scnprintf : Ok 59: mem2node : Ok 60: time utils : Ok 61: Test jit_write_elf : Ok 62: maps__merge_in : Ok 63: x86 rdpmc : Ok 64: Convert perf time to TSC : Ok 65: DWARF unwind : Ok 66: x86 instruction decoder - new instructions : Ok 67: Intel PT packet decoder : Ok 68: x86 bp modify : Ok 69: probe libc's inet_pton & backtrace it with ping : Ok 70: Use vfs_getname probe to get syscall args filenames : Ok 71: Add vfs_getname probe to get syscall args filenames : Ok 72: Check open filename arg using perf trace + vfs_getname: Ok 73: 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 . - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make_no_libperl_O: make NO_LIBPERL=1 make_perf_o_O: make perf.o make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_doc_O: make doc make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_gtk2_O: make NO_GTK2=1 make_no_slang_O: make NO_SLANG=1 make_install_bin_O: make install-bin make_no_libpython_O: make NO_LIBPYTHON=1 make_help_O: make help make_install_O: make install make_debug_O: make DEBUG=1 make_cscope_O: make cscope make_util_map_o_O: make util/map.o make_no_newt_O: make NO_NEWT=1 make_clean_all_O: make clean all make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libaudit_O: make NO_LIBAUDIT=1 make_pure_O: make make_tags_O: make tags make_no_libbpf_O: make NO_LIBBPF=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_demangle_O: make NO_DEMANGLE=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libelf_O: make NO_LIBELF=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-01-16 13:48 Arnaldo Carvalho de Melo @ 2020-01-20 8:23 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2020-01-20 8:23 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Andi Kleen, Andres Freund, Cengiz Can, Jann Horn, Jin Yao, Maciej S . Szmigiero, Michael Petlan, Ravi Bangoria, Thomas Richter, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 53f3feeb7bd2d78039b3dc9ab158bad2a5dbe012: > > Merge tag 'perf-core-for-mingo-5.6-20200106' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2020-01-10 18:49:34 +0100) > > 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.6-20200116 > 18 files changed, 97 insertions(+), 16 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2020-01-06 16:06 Arnaldo Carvalho de Melo 2020-01-10 17:50 ` Ingo Molnar 2020-01-28 19:10 ` pr-tracker-bot 0 siblings, 2 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2020-01-06 16:06 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Alexey Budankov, Andi Kleen, Andrey Zhizhikin, David Ahern, Linus Torvalds, Vitaly Chikunov, 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 b9fb2de0115bbacab36da31fd10483ea66d9cfab: Merge tag 'perf-urgent-for-mingo-5.5-20191223' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2019-12-23 22:27:44 +0100) 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.6-20200106 for you to fetch changes up to 6c4798d3f08b81c2c52936b10e0fa872590c96ae: tools lib: Fix builds when glibc contains strlcpy() (2020-01-06 11:46:10 -0300) ---------------------------------------------------------------- perf/core improvements and fixes. perf record: Alexey Budankov: - Adapt affinity for machines with #CPUs > 1K to overcome current 1024 CPUs mask size limitation of cpu_set_t type. perf report/top TUI: Arnaldo Carvalho de Melo: - Make ENTER consistently present the pop up menu with and without call chains, to eliminate confusion. The menu continues available at all times use 'm' and '+' can be used to toggle just one call chain level, 'e' for all the call chains for a top level histogram entry and 'E' to expand all call chains in all top level entries. Extra info about these options was added to the pop up menu entries. Pressing 'k' serves as special hotkey to go straight to the main vmlinux entries, to avoid having to press enter and then select "Zoom into the kernel DSO". perf sched timehist: David Ahern: - Add support for filtering on CPU. perf tests: Arnaldo Carvalho de Melo: - Show expected versus obtained values in bp_signal test. libperf: Jiri Olsa: - Move to tools/lib/perf. - Add man pages. libapi: Andrey Zhizhikin: - Fix gcc9 stringop-truncation compilation error. tools lib: Vitaly Chikunov: - Fix builds when glibc contains strlcpy(), which is the case for ALT Linux. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Alexey Budankov (3): tools bitmap: Implement bitmap_equal() operation at bitmap API perf mmap: Declare type for cpu mask of arbitrary length perf record: Adapt affinity to machines with #CPUs > 1K Andrey Zhizhikin (1): tools lib api fs: Fix gcc9 stringop-truncation compilation error Arnaldo Carvalho de Melo (12): perf tests bp_signal: Show expected versus obtained values perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc perf report/top: Make ENTER consistently bring up menu perf report/top: Add menu entry for toggling callchain expansion perf report/top: Improve toggle callchain menu option perf hists browser: Generalize the do_zoom_dso() function perf report/top: Add 'k' hotkey to zoom directly into the kernel map perf hists browser: Allow passing an initial hotkey tools ui popup: Allow returning hotkeys perf report/top: Allow pressing hotkeys in the options popup menu perf report/top: Do not offer annotation for symbols without samples perf report/top: Make 'e' visible in the help and make it toggle showing callchains David Ahern (1): perf sched timehist: Add support for filtering on CPU Jiri Olsa (2): libperf: Move to tools/lib/perf libperf: Add man pages Vitaly Chikunov (1): tools lib: Fix builds when glibc contains strlcpy() tools/include/linux/bitmap.h | 30 +++ tools/include/linux/string.h | 8 + tools/lib/api/fs/fs.c | 4 +- tools/lib/bitmap.c | 15 ++ tools/{perf/lib => lib/perf}/Build | 0 tools/lib/perf/Documentation/Makefile | 156 ++++++++++++ tools/lib/perf/Documentation/asciidoc.conf | 120 +++++++++ tools/lib/perf/Documentation/examples/sampling.c | 119 +++++++++ tools/lib/perf/Documentation/libperf-counting.txt | 211 ++++++++++++++++ tools/lib/perf/Documentation/libperf-sampling.txt | 243 ++++++++++++++++++ tools/lib/perf/Documentation/libperf.txt | 246 ++++++++++++++++++ tools/lib/perf/Documentation/manpage-1.72.xsl | 14 ++ tools/lib/perf/Documentation/manpage-base.xsl | 35 +++ .../perf/Documentation/manpage-bold-literal.xsl | 17 ++ tools/lib/perf/Documentation/manpage-normal.xsl | 13 + .../lib/perf/Documentation/manpage-suppress-sp.xsl | 21 ++ tools/{perf/lib => lib/perf}/Makefile | 7 +- tools/{perf/lib => lib/perf}/core.c | 0 tools/{perf/lib => lib/perf}/cpumap.c | 0 tools/{perf/lib => lib/perf}/evlist.c | 0 tools/{perf/lib => lib/perf}/evsel.c | 0 .../lib => lib/perf}/include/internal/cpumap.h | 0 .../lib => lib/perf}/include/internal/evlist.h | 0 .../lib => lib/perf}/include/internal/evsel.h | 0 .../{perf/lib => lib/perf}/include/internal/lib.h | 0 .../{perf/lib => lib/perf}/include/internal/mmap.h | 0 .../lib => lib/perf}/include/internal/tests.h | 0 .../lib => lib/perf}/include/internal/threadmap.h | 0 .../lib => lib/perf}/include/internal/xyarray.h | 0 tools/{perf/lib => lib/perf}/include/perf/core.h | 0 tools/{perf/lib => lib/perf}/include/perf/cpumap.h | 0 tools/{perf/lib => lib/perf}/include/perf/event.h | 0 tools/{perf/lib => lib/perf}/include/perf/evlist.h | 0 tools/{perf/lib => lib/perf}/include/perf/evsel.h | 0 tools/{perf/lib => lib/perf}/include/perf/mmap.h | 0 .../lib => lib/perf}/include/perf/threadmap.h | 0 tools/{perf/lib => lib/perf}/internal.h | 0 tools/{perf/lib => lib/perf}/lib.c | 0 tools/{perf/lib => lib/perf}/libperf.map | 0 tools/{perf/lib => lib/perf}/libperf.pc.template | 0 tools/{perf/lib => lib/perf}/mmap.c | 0 tools/{perf/lib => lib/perf}/tests/Makefile | 2 +- tools/{perf/lib => lib/perf}/tests/test-cpumap.c | 0 tools/{perf/lib => lib/perf}/tests/test-evlist.c | 0 tools/{perf/lib => lib/perf}/tests/test-evsel.c | 0 .../{perf/lib => lib/perf}/tests/test-threadmap.c | 0 tools/{perf/lib => lib/perf}/threadmap.c | 0 tools/{perf/lib => lib/perf}/xyarray.c | 0 tools/lib/string.c | 7 + tools/perf/Documentation/perf-sched.txt | 4 + tools/perf/MANIFEST | 1 + tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 2 +- tools/perf/builtin-c2c.c | 4 +- tools/perf/builtin-record.c | 28 ++- tools/perf/builtin-sched.c | 13 + tools/perf/lib/Documentation/Makefile | 7 - tools/perf/lib/Documentation/man/libperf.rst | 100 -------- tools/perf/lib/Documentation/tutorial/tutorial.rst | 123 --------- tools/perf/tests/bp_signal.c | 10 +- tools/perf/ui/browsers/hists.c | 277 ++++++++++++++------- tools/perf/ui/browsers/hists.h | 2 +- tools/perf/ui/browsers/res_sample.c | 2 +- tools/perf/ui/browsers/scripts.c | 2 +- tools/perf/ui/tui/util.c | 12 +- tools/perf/ui/util.h | 2 +- tools/perf/util/mmap.c | 40 ++- tools/perf/util/mmap.h | 13 +- tools/perf/util/sort.c | 3 +- tools/perf/util/sort.h | 2 + 70 files changed, 1565 insertions(+), 352 deletions(-) rename tools/{perf/lib => lib/perf}/Build (100%) create mode 100644 tools/lib/perf/Documentation/Makefile create mode 100644 tools/lib/perf/Documentation/asciidoc.conf create mode 100644 tools/lib/perf/Documentation/examples/sampling.c create mode 100644 tools/lib/perf/Documentation/libperf-counting.txt create mode 100644 tools/lib/perf/Documentation/libperf-sampling.txt create mode 100644 tools/lib/perf/Documentation/libperf.txt create mode 100644 tools/lib/perf/Documentation/manpage-1.72.xsl create mode 100644 tools/lib/perf/Documentation/manpage-base.xsl create mode 100644 tools/lib/perf/Documentation/manpage-bold-literal.xsl create mode 100644 tools/lib/perf/Documentation/manpage-normal.xsl create mode 100644 tools/lib/perf/Documentation/manpage-suppress-sp.xsl rename tools/{perf/lib => lib/perf}/Makefile (96%) rename tools/{perf/lib => lib/perf}/core.c (100%) rename tools/{perf/lib => lib/perf}/cpumap.c (100%) rename tools/{perf/lib => lib/perf}/evlist.c (100%) rename tools/{perf/lib => lib/perf}/evsel.c (100%) rename tools/{perf/lib => lib/perf}/include/internal/cpumap.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/evlist.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/evsel.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/lib.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/mmap.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/tests.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/threadmap.h (100%) rename tools/{perf/lib => lib/perf}/include/internal/xyarray.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/core.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/cpumap.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/event.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/evlist.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/evsel.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/mmap.h (100%) rename tools/{perf/lib => lib/perf}/include/perf/threadmap.h (100%) rename tools/{perf/lib => lib/perf}/internal.h (100%) rename tools/{perf/lib => lib/perf}/lib.c (100%) rename tools/{perf/lib => lib/perf}/libperf.map (100%) rename tools/{perf/lib => lib/perf}/libperf.pc.template (100%) rename tools/{perf/lib => lib/perf}/mmap.c (100%) rename tools/{perf/lib => lib/perf}/tests/Makefile (93%) rename tools/{perf/lib => lib/perf}/tests/test-cpumap.c (100%) rename tools/{perf/lib => lib/perf}/tests/test-evlist.c (100%) rename tools/{perf/lib => lib/perf}/tests/test-evsel.c (100%) rename tools/{perf/lib => lib/perf}/tests/test-threadmap.c (100%) rename tools/{perf/lib => lib/perf}/threadmap.c (100%) rename tools/{perf/lib => lib/perf}/xyarray.c (100%) delete mode 100644 tools/perf/lib/Documentation/Makefile delete mode 100644 tools/perf/lib/Documentation/man/libperf.rst delete mode 100644 tools/perf/lib/Documentation/tutorial/tutorial.rst 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 due to: `.gnu.debuglto_.debug_macro' referenced in section `.gnu.debuglto_.debug_macro' of /tmp/build/perf/util/scripting-engines/perf-in.o: defined in discarded section `.gnu.debuglto_.debug_macro[wm4.stdcpredef.h.19.8dc41bed5d9037ff9622e015fb5f0ce3]' of /tmp/build/perf/util/scripting-engines/perf-in.o OpenMandriva Cooker works well with gcc, uncovers a bug where we have to get compiler-clang.h from the kernel sources, will be fixed soon. With the update of linux/linkage.h to move from ENTRY()/ENDPROC() to SYM_FUNC_START()/etc some of the older containers can't be used with clang, as the minimum version for the constructs used in the new linkage.h is 3.5, older versions (3.4, 3.4.2, etc) end up with: bench/../../arch/x86/lib/memcpy_64.S:44:14: error: unexpected token in '.type' directive .type MEMCPY STT_FUNC ; .size MEMCPY, .-MEMCPY ^ # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.5.0-rc3.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:3.11 : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (https://git.alpinelinux.org/aports f7f0d2c2b8bcd6a5843401a9a702029556492689) (based on LLVM 9.0.0) 9 alpine:edge : Ok gcc (Alpine 9.2.0) 9.2.0, Alpine clang version 9.0.0 (git://git.alpinelinux.org/aports 25c73ae7b95bdb42ae5f0ceac3b703e766582527) (based on LLVM 9.0.0) 10 alt:p8 : Ok x86_64-alt-linux-gcc (GCC) 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1), clang version 3.8.0 (tags/RELEASE_380/final) 11 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.3.1 20190507 (ALT p9 8.3.1-alt5), clang version 7.0.1 12 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus 9.2.1-alt2), clang version 7.0.1 13 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 14 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 15 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 16 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 17 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 18 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 19 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 20 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 21 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191210 gcc-9-branch@279166, clang version 9.0.0 (tags/RELEASE_900/final) 22 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 23 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 24 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 25 debian:experimental : Ok gcc (Debian 9.2.1-19) 9.2.1 20191109, clang version 8.0.1-4 (tags/RELEASE_801/final) 26 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 27 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 28 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-8) 9.2.1 20190909 29 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 30 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 31 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 32 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 33 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 34 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 35 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 36 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 37 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 38 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 39 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 40 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 41 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 42 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 43 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 44 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 45 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 46 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 47 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 48 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 49 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 50 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 51 openmandriva:cooker : Ok gcc (GCC) 9.2.1 20191123 (OpenMandriva) 52 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) 53 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 54 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 55 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 56 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 57 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 58 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 59 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) 60 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) 61 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 62 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 63 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 66 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 67 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 68 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 69 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) 70 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 77 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 78 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 79 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 80 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) 81 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 82 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 83 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 84 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 85 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux quaco 5.5.0-rc4+ #2 SMP Thu Jan 2 11:17:21 -03 2020 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 6c4798d3f08b tools lib: Fix builds when glibc contains strlcpy() # perf version --build-options perf version 5.5.rc3.g6c4798d3f08b 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 maps : 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: Merge cpu map : Ok 53: Probe SDT events : Ok 54: is_printable_array : Ok 55: Print bitmap : Ok 56: perf hooks : Ok 57: builtin clang support : Skip (not compiled in) 58: unit_number__scnprintf : Ok 59: mem2node : Ok 60: time utils : Ok 61: Test jit_write_elf : Ok 62: maps__merge_in : Ok 63: x86 rdpmc : Ok 64: Convert perf time to TSC : Ok 65: DWARF unwind : Ok 66: x86 instruction decoder - new instructions : Ok 67: Intel PT packet decoder : Ok 68: x86 bp modify : Ok 69: probe libc's inet_pton & backtrace it with ping : Ok 70: Use vfs_getname probe to get syscall args filenames : Ok 71: Add vfs_getname probe to get syscall args filenames : Ok 72: Check open filename arg using perf trace + vfs_getname: Ok 73: Zstd perf.data compression/decompression : Ok $ time make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_util_pmu_bison_o_O: make util/pmu-bison.o make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_doc_O: make doc make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libbpf_O: make NO_LIBBPF=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_cscope_O: make cscope make_clean_all_O: make clean all make_install_bin_O: make install-bin make_no_libpython_O: make NO_LIBPYTHON=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_util_map_o_O: make util/map.o make_perf_o_O: make perf.o make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_newt_O: make NO_NEWT=1 make_debug_O: make DEBUG=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_help_O: make help make_no_libnuma_O: make NO_LIBNUMA=1 make_no_slang_O: make NO_SLANG=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_tags_O: make tags make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_pure_O: make make_no_libelf_O: make NO_LIBELF=1 make_install_prefix_O: make install prefix=/tmp/krava OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-01-06 16:06 Arnaldo Carvalho de Melo @ 2020-01-10 17:50 ` Ingo Molnar 2020-01-28 19:10 ` pr-tracker-bot 1 sibling, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2020-01-10 17:50 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Alexey Budankov, Andi Kleen, Andrey Zhizhikin, David Ahern, Linus Torvalds, Vitaly Chikunov, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit b9fb2de0115bbacab36da31fd10483ea66d9cfab: > > Merge tag 'perf-urgent-for-mingo-5.5-20191223' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2019-12-23 22:27:44 +0100) > > 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.6-20200106 > > for you to fetch changes up to 6c4798d3f08b81c2c52936b10e0fa872590c96ae: > > tools lib: Fix builds when glibc contains strlcpy() (2020-01-06 11:46:10 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes. > > perf record: > > Alexey Budankov: > > - Adapt affinity for machines with #CPUs > 1K to overcome current 1024 CPUs > mask size limitation of cpu_set_t type. > > perf report/top TUI: > > Arnaldo Carvalho de Melo: > > - Make ENTER consistently present the pop up menu with and without call > chains, to eliminate confusion. The menu continues available at all times > use 'm' and '+' can be used to toggle just one call chain level, 'e' for all > the call chains for a top level histogram entry and 'E' to expand all call > chains in all top level entries. Extra info about these options was added to > the pop up menu entries. Pressing 'k' serves as special hotkey to go straight > to the main vmlinux entries, to avoid having to press enter and then select > "Zoom into the kernel DSO". > > perf sched timehist: > > David Ahern: > > - Add support for filtering on CPU. > > perf tests: > > Arnaldo Carvalho de Melo: > > - Show expected versus obtained values in bp_signal test. > > libperf: > > Jiri Olsa: > > - Move to tools/lib/perf. > > - Add man pages. > > libapi: > > Andrey Zhizhikin: > > - Fix gcc9 stringop-truncation compilation error. > > tools lib: > > Vitaly Chikunov: > > - Fix builds when glibc contains strlcpy(), which is the case for ALT Linux. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Alexey Budankov (3): > tools bitmap: Implement bitmap_equal() operation at bitmap API > perf mmap: Declare type for cpu mask of arbitrary length > perf record: Adapt affinity to machines with #CPUs > 1K > > Andrey Zhizhikin (1): > tools lib api fs: Fix gcc9 stringop-truncation compilation error > > Arnaldo Carvalho de Melo (12): > perf tests bp_signal: Show expected versus obtained values > perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc > perf report/top: Make ENTER consistently bring up menu > perf report/top: Add menu entry for toggling callchain expansion > perf report/top: Improve toggle callchain menu option > perf hists browser: Generalize the do_zoom_dso() function > perf report/top: Add 'k' hotkey to zoom directly into the kernel map > perf hists browser: Allow passing an initial hotkey > tools ui popup: Allow returning hotkeys > perf report/top: Allow pressing hotkeys in the options popup menu > perf report/top: Do not offer annotation for symbols without samples > perf report/top: Make 'e' visible in the help and make it toggle showing callchains > > David Ahern (1): > perf sched timehist: Add support for filtering on CPU > > Jiri Olsa (2): > libperf: Move to tools/lib/perf > libperf: Add man pages > > Vitaly Chikunov (1): > tools lib: Fix builds when glibc contains strlcpy() > 70 files changed, 1565 insertions(+), 352 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2020-01-06 16:06 Arnaldo Carvalho de Melo 2020-01-10 17:50 ` Ingo Molnar @ 2020-01-28 19:10 ` pr-tracker-bot 1 sibling, 0 replies; 160+ messages in thread From: pr-tracker-bot @ 2020-01-28 19:10 UTC (permalink / raw) Cc: Ingo Molnar, Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Alexey Budankov, Andi Kleen, Andrey Zhizhikin, David Ahern, Linus Torvalds, Vitaly Chikunov, Arnaldo Carvalho de Melo The pull request you sent on Mon, 6 Jan 2020 13:06:45 -0300: > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-5.6-20200106 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/53f3feeb7bd2d78039b3dc9ab158bad2a5dbe012 Thank you! -- Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-12-03 13:55 Arnaldo Carvalho de Melo 2019-12-04 7:51 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-12-03 13:55 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andi Kleen, Ian Rogers, Sudipm Mukherjee, 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 e680a41fcaf07ccac8817c589fc4824988b48eac: Merge tag 'perf-core-for-mingo-5.5-20191128' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2019-11-29 06:56:05 +0100) 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.5-20191203 for you to fetch changes up to 15b3904f8e884e0d34d5f09906cf6526d0b889a2: libtraceevent: Copy pkg-config file to output folder when using O= (2019-12-02 21:58:20 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report/top: - Fix segfault due to missing initialization of recently introduced struct map_symbol 'maps' field in append_inlines(), when running with DWARF callchains. perf stat: Andi Kleen: - Affinity based optimizations for sessions with many events in machines with large core counts, avoiding excessive number of IPIs. libtraceevent: - Sudip Mukherjee: - Fix installation with O=. - Copy pkg-config file to output folder when using O=. perf bench: Arnaldo Carvalho de Melo: - Update the copies of x86's mem{cpy,set}_64.S, and because that now uses new stuff in linux/linkage.h, update that header too, which made the minimal clang version to build perf to be 3.5, as 3.4 as found in some of the container images used to test build perf can't grok STT_FUNC as a token in .type lines. ABI headers: Arnaldo Carvalho de Melo: - Sync x86's msr-index.h copy with the kernel sources, resulting in new MSRs to be usable in filter expressions in 'perf trace', such as IA32_TSX_CTRL. - Sync linux/fscrypt.h, linux/stat.h, sched.h and the kvm headers. perf trace: Arnaldo Carvalho de Melo: - Add CLEAR_SIGHAND support for clone's flags arg perf kvm: Arnaldo Carvalho de Melo: - Clarify the 'perf kvm' -i and -o command line options perf test: Ian Rogers: - Move test functionality in to a 'perf test' entry. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (10): perf cpumap: Maintain cpumaps ordered and without dups perf evlist: Maintain evlist->all_cpus perf evsel: Add iterator to iterate over events ordered by CPU perf evsel: Add functions to close evsel on a CPU perf stat: Use affinity for closing file descriptors perf stat: Factor out open error handling perf stat: Use affinity for opening events perf stat: Use affinity for reading perf evsel: Add functions to enable/disable for a specific CPU perf stat: Use affinity for enabling/disabling events Arnaldo Carvalho de Melo (10): perf machine: Fill map_symbol->maps in append_inlines() to fix segfault perf bench: Update the copies of x86's mem{cpy,set}_64.S tools arch x86: Sync the msr-index.h copy with the kernel sources tools headers uapi: Sync linux/fscrypt.h with the kernel sources tools headers uapi: Sync linux/stat.h with the kernel sources tools headers kvm: Sync kvm headers with the kernel sources tools headers UAPI: Sync sched.h with the kernel perf beauty: Add CLEAR_SIGHAND support for clone's flags arg tools arch x86: Sync asm/cpufeatures.h with the kernel sources perf kvm: Clarify the 'perf kvm' -i and -o command line options Ian Rogers (1): perf jit: Move test functionality in to a test Sudip Mukherjee (2): libtraceevent: Fix lib installation with O= libtraceevent: Copy pkg-config file to output folder when using O= tools/arch/arm/include/uapi/asm/kvm.h | 3 +- tools/arch/arm64/include/uapi/asm/kvm.h | 5 +- tools/arch/powerpc/include/uapi/asm/kvm.h | 3 + tools/arch/x86/include/asm/cpufeatures.h | 3 + tools/arch/x86/include/asm/msr-index.h | 18 ++ tools/arch/x86/lib/memcpy_64.S | 20 +-- tools/arch/x86/lib/memset_64.S | 16 +- tools/include/uapi/linux/fscrypt.h | 3 +- tools/include/uapi/linux/kvm.h | 11 ++ tools/include/uapi/linux/sched.h | 60 +++++-- tools/include/uapi/linux/stat.h | 2 +- tools/lib/traceevent/Makefile | 6 +- tools/perf/Documentation/perf-kvm.txt | 5 +- tools/perf/arch/arm/tests/regs_load.S | 4 +- tools/perf/arch/arm64/tests/regs_load.S | 4 +- tools/perf/arch/x86/tests/regs_load.S | 8 +- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-stat.c | 288 +++++++++++++++++++++--------- tools/perf/check-headers.sh | 4 +- tools/perf/lib/cpumap.c | 73 +++++++- tools/perf/lib/evlist.c | 1 + tools/perf/lib/evsel.c | 76 ++++++-- tools/perf/lib/include/internal/evlist.h | 1 + tools/perf/lib/include/perf/cpumap.h | 2 + tools/perf/lib/include/perf/evsel.h | 3 + tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 9 + tools/perf/tests/cpumap.c | 16 ++ tools/perf/tests/event-times.c | 4 +- tools/perf/tests/genelf.c | 51 ++++++ tools/perf/tests/tests.h | 2 + tools/perf/trace/beauty/clone.c | 1 + tools/perf/util/cpumap.h | 1 + tools/perf/util/evlist.c | 113 +++++++++++- tools/perf/util/evlist.h | 11 +- tools/perf/util/evsel.c | 35 +++- tools/perf/util/evsel.h | 9 +- tools/perf/util/genelf.c | 46 ----- tools/perf/util/include/linux/linkage.h | 89 ++++++++- tools/perf/util/machine.c | 1 + tools/perf/util/stat.c | 5 +- tools/perf/util/stat.h | 3 +- 42 files changed, 789 insertions(+), 229 deletions(-) create mode 100644 tools/perf/tests/genelf.c 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. OpenMandriva Cooker works well with gcc, uncovers a bug where we have to get compiler-clang.h from the kernel sources, will be fixed soon. With the update of linux/linkage.h to move from ENTRY()/ENDPROC() to SYM_FUNC_START()/etc some of the older containers can't be used with clang, as the minimum version for the constructs used in the new linkage.h is 3.5, older versions (3.4, 3.4.2, etc) end up with: bench/../../arch/x86/lib/memcpy_64.S:44:14: error: unexpected token in '.type' directive .type MEMCPY STT_FUNC ; .size MEMCPY, .-MEMCPY ^ Finally the build-tests and container tests were performed with the following two fixes (different sha, same contents), that are not in this patch series, will go thru the bpf/net trees. The 'perf test' was performed with what is in this series tho. $ git log --oneline -2 e1bc15a8e7d1 (HEAD -> perf/core) libbpf: Use PRIu64 for sym->st_value to fix build on 32-bit arches 0d0f9df96c5a libbpf: Fix up generation of bpf_helper_defs.h $ [root@quaco ~]# export PERF_TARBALL=http://192.168.124.1/perf/perf-5.4.0.tar.xz [root@quaco ~]# time dm # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.4.0.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 9.2.0) 9.2.0, Alpine clang version 9.0.0 (git://git.alpinelinux.org/aports 25c73ae7b95bdb42ae5f0ceac3b703e766582527) (based on LLVM 9.0.0) 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 20180712 (Red Hat 7.3.1-6), 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) 16 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191121 gcc-9-branch@278551, clang version 9.0.0 (tags/RELEASE_900/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-19) 9.2.1 20191109, clang version 8.0.1-4 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-8) 9.2.1 20190909 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 26 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 42 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 43 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 44 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 45 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) 46 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 47 openmandriva:cooker : Ok gcc (GCC) 9.2.1 20191123 (OpenMandriva) 48 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) 49 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 50 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 51 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 52 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 53 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 54 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 55 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) 56 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) 57 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 58 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 59 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 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) 66 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 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) 77 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 78 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 79 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 80 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 81 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux quaco 5.4.0+ #1 SMP Wed Nov 27 12:05:27 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 15b3904f8e88 libtraceevent: Copy pkg-config file to output folder when using O= # perf version --build-options perf version 5.4.g15b3904f8e88 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 maps : 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: Merge cpu map : Ok 53: Probe SDT events : Ok 54: is_printable_array : Ok 55: Print bitmap : Ok 56: perf hooks : Ok 57: builtin clang support : Skip (not compiled in) 58: unit_number__scnprintf : Ok 59: mem2node : Ok 60: time utils : Ok 61: Test jit_write_elf : Ok 62: maps__merge_in : Ok 63: x86 rdpmc : Ok 64: Convert perf time to TSC : Ok 65: DWARF unwind : Ok 66: x86 instruction decoder - new instructions : Ok 67: Intel PT packet decoder : Ok 68: x86 bp modify : Ok 69: probe libc's inet_pton & backtrace it with ping : Ok 70: Use vfs_getname probe to get syscall args filenames : Ok 71: Add vfs_getname probe to get syscall args filenames : Ok 72: Check open filename arg using perf trace + vfs_getname: Ok 73: 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_no_libpython_O: make NO_LIBPYTHON=1 make_perf_o_O: make perf.o make_no_libnuma_O: make NO_LIBNUMA=1 make_help_O: make help make_no_backtrace_O: make NO_BACKTRACE=1 make_no_slang_O: make NO_SLANG=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_newt_O: make NO_NEWT=1 make_debug_O: make DEBUG=1 make_tags_O: make tags make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_doc_O: make doc 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_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libbpf_O: make NO_LIBBPF=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_demangle_O: make NO_DEMANGLE=1 make_install_bin_O: make install-bin make_pure_O: make make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_util_map_o_O: make util/map.o make_clean_all_O: make clean all make_install_prefix_O: make install prefix=/tmp/krava make_cscope_O: make cscope make_no_libperl_O: make NO_LIBPERL=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_install_O: make install OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-12-03 13:55 Arnaldo Carvalho de Melo @ 2019-12-04 7:51 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-12-04 7:51 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Andi Kleen, Ian Rogers, Sudipm Mukherjee, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit e680a41fcaf07ccac8817c589fc4824988b48eac: > > Merge tag 'perf-core-for-mingo-5.5-20191128' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2019-11-29 06:56:05 +0100) > > 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.5-20191203 > > for you to fetch changes up to 15b3904f8e884e0d34d5f09906cf6526d0b889a2: > > libtraceevent: Copy pkg-config file to output folder when using O= (2019-12-02 21:58:20 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf report/top: > > - Fix segfault due to missing initialization of recently introduced > struct map_symbol 'maps' field in append_inlines(), when running > with DWARF callchains. > > perf stat: > > Andi Kleen: > > - Affinity based optimizations for sessions with many events in > machines with large core counts, avoiding excessive number of IPIs. > > libtraceevent: > > - Sudip Mukherjee: > > - Fix installation with O=. > > - Copy pkg-config file to output folder when using O=. > > perf bench: > > Arnaldo Carvalho de Melo: > > - Update the copies of x86's mem{cpy,set}_64.S, and because that > now uses new stuff in linux/linkage.h, update that header too, which > made the minimal clang version to build perf to be 3.5, as > 3.4 as found in some of the container images used to test build perf > can't grok STT_FUNC as a token in .type lines. > > ABI headers: > > Arnaldo Carvalho de Melo: > > - Sync x86's msr-index.h copy with the kernel sources, resulting > in new MSRs to be usable in filter expressions in 'perf trace', > such as IA32_TSX_CTRL. > > - Sync linux/fscrypt.h, linux/stat.h, sched.h and the kvm headers. > > perf trace: > > Arnaldo Carvalho de Melo: > > - Add CLEAR_SIGHAND support for clone's flags arg > > perf kvm: > > Arnaldo Carvalho de Melo: > > - Clarify the 'perf kvm' -i and -o command line options > > perf test: > > Ian Rogers: > > - Move test functionality in to a 'perf test' entry. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (10): > perf cpumap: Maintain cpumaps ordered and without dups > perf evlist: Maintain evlist->all_cpus > perf evsel: Add iterator to iterate over events ordered by CPU > perf evsel: Add functions to close evsel on a CPU > perf stat: Use affinity for closing file descriptors > perf stat: Factor out open error handling > perf stat: Use affinity for opening events > perf stat: Use affinity for reading > perf evsel: Add functions to enable/disable for a specific CPU > perf stat: Use affinity for enabling/disabling events > > Arnaldo Carvalho de Melo (10): > perf machine: Fill map_symbol->maps in append_inlines() to fix segfault > perf bench: Update the copies of x86's mem{cpy,set}_64.S > tools arch x86: Sync the msr-index.h copy with the kernel sources > tools headers uapi: Sync linux/fscrypt.h with the kernel sources > tools headers uapi: Sync linux/stat.h with the kernel sources > tools headers kvm: Sync kvm headers with the kernel sources > tools headers UAPI: Sync sched.h with the kernel > perf beauty: Add CLEAR_SIGHAND support for clone's flags arg > tools arch x86: Sync asm/cpufeatures.h with the kernel sources > perf kvm: Clarify the 'perf kvm' -i and -o command line options > > Ian Rogers (1): > perf jit: Move test functionality in to a test > > Sudip Mukherjee (2): > libtraceevent: Fix lib installation with O= > libtraceevent: Copy pkg-config file to output folder when using O= > > tools/arch/arm/include/uapi/asm/kvm.h | 3 +- > tools/arch/arm64/include/uapi/asm/kvm.h | 5 +- > tools/arch/powerpc/include/uapi/asm/kvm.h | 3 + > tools/arch/x86/include/asm/cpufeatures.h | 3 + > tools/arch/x86/include/asm/msr-index.h | 18 ++ > tools/arch/x86/lib/memcpy_64.S | 20 +-- > tools/arch/x86/lib/memset_64.S | 16 +- > tools/include/uapi/linux/fscrypt.h | 3 +- > tools/include/uapi/linux/kvm.h | 11 ++ > tools/include/uapi/linux/sched.h | 60 +++++-- > tools/include/uapi/linux/stat.h | 2 +- > tools/lib/traceevent/Makefile | 6 +- > tools/perf/Documentation/perf-kvm.txt | 5 +- > tools/perf/arch/arm/tests/regs_load.S | 4 +- > tools/perf/arch/arm64/tests/regs_load.S | 4 +- > tools/perf/arch/x86/tests/regs_load.S | 8 +- > tools/perf/builtin-record.c | 2 +- > tools/perf/builtin-stat.c | 288 +++++++++++++++++++++--------- > tools/perf/check-headers.sh | 4 +- > tools/perf/lib/cpumap.c | 73 +++++++- > tools/perf/lib/evlist.c | 1 + > tools/perf/lib/evsel.c | 76 ++++++-- > tools/perf/lib/include/internal/evlist.h | 1 + > tools/perf/lib/include/perf/cpumap.h | 2 + > tools/perf/lib/include/perf/evsel.h | 3 + > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 9 + > tools/perf/tests/cpumap.c | 16 ++ > tools/perf/tests/event-times.c | 4 +- > tools/perf/tests/genelf.c | 51 ++++++ > tools/perf/tests/tests.h | 2 + > tools/perf/trace/beauty/clone.c | 1 + > tools/perf/util/cpumap.h | 1 + > tools/perf/util/evlist.c | 113 +++++++++++- > tools/perf/util/evlist.h | 11 +- > tools/perf/util/evsel.c | 35 +++- > tools/perf/util/evsel.h | 9 +- > tools/perf/util/genelf.c | 46 ----- > tools/perf/util/include/linux/linkage.h | 89 ++++++++- > tools/perf/util/machine.c | 1 + > tools/perf/util/stat.c | 5 +- > tools/perf/util/stat.h | 3 +- > 42 files changed, 789 insertions(+), 229 deletions(-) > create mode 100644 tools/perf/tests/genelf.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-11-28 13:40 Arnaldo Carvalho de Melo 2019-11-29 5:58 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-11-28 13:40 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Andi Kleen, Andrii Nakryiko, Arnaldo Carvalho de Melo Hi Ingo/Thomas, Please consider pulling, this has a merge with mainline to pick bpf stuff, and the build-test and container build tests were performed with two extra patches I cooked to fix libbpf issuers in some odd 32-bit arches and on generation of some bpf helpers headers that will hit mainline via the bpf/net trees. Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 2ea352d5960ad469f5712cf3e293db97beac4e01: Merge remote-tracking branch 'torvalds/master' into perf/core (2019-11-26 11:06:19 -0300) 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.5-20191128 for you to fetch changes up to 5172672da02e483d9b3c4d814c3482d0c8ffb1a6: perf script: Fix invalid LBR/binary mismatch error (2019-11-28 08:08:38 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf script: Adrian Hunter: - Fix brstackinsn for AUXTRACE. - Fix invalid LBR/binary mismatch error. perf diff: Arnaldo Carvalho de Melo: - Use llabs() with 64-bit values, fixing the build in some 32-bit architectures. perf pmu: Andi Kleen: - Use file system cache to optimize sysfs access. x86: Adrian Hunter: - Add some more Intel instructions to the opcode map and to the perf test entry: gf2p8affineinvqb, gf2p8affineqb, gf2p8mulb, v4fmaddps, v4fmaddss, v4fnmaddps, v4fnmaddss, vaesdec, vaesdeclast, vaesenc, vaesenclast, vcvtne2ps2bf16, vcvtneps2bf16, vdpbf16ps, vgf2p8affineinvqb, vgf2p8affineqb, vgf2p8mulb, vp2intersectd, vp2intersectq, vp4dpwssd, vp4dpwssds, vpclmulqdq, vpcompressb, vpcompressw, vpdpbusd, vpdpbusds, vpdpwssd, vpdpwssds, vpexpandb, vpexpandw, vpopcntb, vpopcntd, vpopcntq, vpopcntw, vpshldd, vpshldq, vpshldvd, vpshldvq, vpshldvw, vpshldw, vpshrdd, vpshrdq, vpshrdvd, vpshrdvq, vpshrdvw, vpshrdw, vpshufbitqmb. perf affinity: Andi Kleen: - Add infrastructure to save/restore affinity perf maps: Arnaldo Carvalho de Melo: - Merge 'struct maps' with 'struct map_groups', as there is a 1x1 relationship, simplifying code overal. perf build: Jiri Olsa: - Allow to link with libbpf dynamicaly. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (4): x86/insn: Add some more Intel instructions to the opcode map x86/insn: perf tools: Add some more instructions to the new instructions test perf script: Fix brstackinsn for AUXTRACE perf script: Fix invalid LBR/binary mismatch error Andi Kleen (2): perf pmu: Use file system cache to optimize sysfs access perf affinity: Add infrastructure to save/restore affinity Arnaldo Carvalho de Melo (15): perf script: Move map__fprintf_srccode() to near its only user perf map: Ditch leftover map__reloc_vmlinux() prototype perf map: Remove needless struct forward declarations perf map: Remove unused functions perf maps: Merge 'struct maps' with 'struct map_groups' perf thread: Rename thread->mg to thread->maps perf addr_location: Rename al->mg to al->maps perf map_symbol: Rename ms->mg to ms->maps perf maps: Rename 'mg' variables to 'maps' perf maps: Rename map_groups.h to maps.h perf tests: Rename thread-mg-share to thread-maps-share perf tests: Rename tests/map_groups.c to tests/maps.c perf diff: Use llabs() with 64-bit values perf diff: Use llabs() with 64-bit values perf regs: Make perf_reg_name() return "unknown" instead of NULL Jiri Olsa (1): perf tools: Allow to link with libbpf dynamicaly arch/x86/lib/x86-opcode-map.txt | 44 +- tools/arch/x86/lib/x86-opcode-map.txt | 44 +- tools/build/Makefile.feature | 3 +- tools/build/feature/Makefile | 4 + tools/build/feature/test-libbpf.c | 7 + tools/perf/Makefile.config | 10 + tools/perf/Makefile.perf | 6 +- tools/perf/arch/arm/tests/dwarf-unwind.c | 4 +- tools/perf/arch/arm64/tests/dwarf-unwind.c | 4 +- tools/perf/arch/powerpc/tests/dwarf-unwind.c | 4 +- tools/perf/arch/s390/annotate/instructions.c | 2 +- tools/perf/arch/x86/tests/dwarf-unwind.c | 4 +- tools/perf/arch/x86/tests/insn-x86-dat-32.c | 366 ++++++++++++ tools/perf/arch/x86/tests/insn-x86-dat-64.c | 484 +++++++++++++++ tools/perf/arch/x86/tests/insn-x86-dat-src.c | 655 +++++++++++++++++++++ tools/perf/arch/x86/util/event.c | 5 +- tools/perf/builtin-diff.c | 6 +- tools/perf/builtin-report.c | 7 +- tools/perf/builtin-script.c | 46 +- tools/perf/tests/Build | 4 +- tools/perf/tests/builtin-test.c | 8 +- tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/{map_groups.c => maps.c} | 26 +- tools/perf/tests/tests.h | 4 +- .../{thread-mg-share.c => thread-maps-share.c} | 36 +- tools/perf/tests/vmlinux-kallsyms.c | 9 +- tools/perf/ui/browsers/annotate.c | 2 +- tools/perf/ui/stdio/hist.c | 4 +- tools/perf/util/Build | 2 + tools/perf/util/affinity.c | 73 +++ tools/perf/util/affinity.h | 17 + tools/perf/util/annotate.c | 8 +- tools/perf/util/bpf-event.c | 4 +- tools/perf/util/callchain.c | 8 +- tools/perf/util/cs-etm.c | 2 +- tools/perf/util/db-export.c | 12 +- tools/perf/util/event.c | 14 +- tools/perf/util/fncache.c | 63 ++ tools/perf/util/fncache.h | 7 + tools/perf/util/hist.c | 8 +- tools/perf/util/intel-pt.c | 2 +- tools/perf/util/machine.c | 80 ++- tools/perf/util/machine.h | 10 +- tools/perf/util/map.c | 223 ++----- tools/perf/util/map.h | 14 +- tools/perf/util/map_groups.h | 106 ---- tools/perf/util/map_symbol.h | 4 +- tools/perf/util/maps.h | 87 +++ tools/perf/util/perf_regs.h | 2 +- tools/perf/util/pmu.c | 34 +- tools/perf/util/probe-event.c | 4 +- tools/perf/util/python-ext-sources | 1 + .../util/scripting-engines/trace-event-python.c | 2 +- tools/perf/util/srccode.c | 9 +- tools/perf/util/symbol-elf.c | 16 +- tools/perf/util/symbol.c | 91 ++- tools/perf/util/symbol.h | 6 +- tools/perf/util/synthetic-events.c | 2 +- tools/perf/util/thread-stack.c | 4 +- tools/perf/util/thread.c | 38 +- tools/perf/util/thread.h | 4 +- tools/perf/util/unwind-libdw.c | 4 +- tools/perf/util/unwind-libunwind-local.c | 22 +- tools/perf/util/unwind-libunwind.c | 36 +- tools/perf/util/unwind.h | 27 +- tools/perf/util/vdso.c | 2 +- 66 files changed, 2230 insertions(+), 618 deletions(-) create mode 100644 tools/build/feature/test-libbpf.c rename tools/perf/tests/{map_groups.c => maps.c} (83%) rename tools/perf/tests/{thread-mg-share.c => thread-maps-share.c} (64%) create mode 100644 tools/perf/util/affinity.c create mode 100644 tools/perf/util/affinity.h create mode 100644 tools/perf/util/fncache.c create mode 100644 tools/perf/util/fncache.h delete mode 100644 tools/perf/util/map_groups.h create mode 100644 tools/perf/util/maps.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. OpenMandriva Cooker works well with gcc, uncovers a bug where we have to get compiler-clang.h from the kernel sources, will be fixed soon. Finally the build-tests and container tests were performed with the following two fixes, that are not in this patch series, will go thru the bpf/net trees: $ git log --oneline -2 e1bc15a8e7d1 (HEAD -> perf/core) libbpf: Use PRIu64 for sym->st_value to fix build on 32-bit arches 0d0f9df96c5a libbpf: Fix up generation of bpf_helper_defs.h $ The 'perf test' was performed with what is in this series tho. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.4.0.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 9.2.0) 9.2.0, Alpine clang version 9.0.0 (git://git.alpinelinux.org/aports 25c73ae7b95bdb42ae5f0ceac3b703e766582527) (based on LLVM 9.0.0) 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 20180712 (Red Hat 7.3.1-6), 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 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191121 gcc-9-branch@278551, clang version 9.0.0 (tags/RELEASE_900/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-19) 9.2.1 20191109, clang version 8.0.1-4 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 9.2.1-8) 9.2.1 20190909 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 9.2.1-8) 9.2.1 20190909 26 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) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 42 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 9.2.0-r2 p3) 9.2.0 43 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 44 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 45 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) 46 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 47 openmandriva:cooker : Ok gcc (GCC) 9.2.1 20191123 (OpenMandriva) 48 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) 49 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 50 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 51 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 52 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 53 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 54 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) 55 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) 56 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) 57 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) 58 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 59 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 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) 66 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 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) 77 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 78 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 79 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 80 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 81 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux quaco 5.4.0+ #1 SMP Wed Nov 27 12:05:27 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 5172672da02e perf script: Fix invalid LBR/binary mismatch error # perf version --build-options perf version 5.4.g5172672da02e 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 maps : 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: maps__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_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_clean_all_O: make clean all make_pure_O: make make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libelf_O: make NO_LIBELF=1 make_help_O: make help make_doc_O: make doc make_no_libbionic_O: make NO_LIBBIONIC=1 - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_newt_O: make NO_NEWT=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_util_map_o_O: make util/map.o make_install_bin_O: make install-bin make_debug_O: make DEBUG=1 make_no_libbpf_O: make NO_LIBBPF=1 make_cscope_O: make cscope make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_O: make install make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_slang_O: make NO_SLANG=1 make_perf_o_O: make perf.o make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_gtk2_O: make NO_GTK2=1 make_no_libperl_O: make NO_LIBPERL=1 make_tags_O: make tags OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-11-28 13:40 Arnaldo Carvalho de Melo @ 2019-11-29 5:58 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-11-29 5:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexei Starovoitov, Andi Kleen, Andrii Nakryiko, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, this has a merge with mainline to pick > bpf stuff, and the build-test and container build tests were performed > with two extra patches I cooked to fix libbpf issuers in some odd 32-bit > arches and on generation of some bpf helpers headers that will hit > mainline via the bpf/net trees. > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 2ea352d5960ad469f5712cf3e293db97beac4e01: > > Merge remote-tracking branch 'torvalds/master' into perf/core (2019-11-26 11:06:19 -0300) > > 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.5-20191128 > > for you to fetch changes up to 5172672da02e483d9b3c4d814c3482d0c8ffb1a6: > > perf script: Fix invalid LBR/binary mismatch error (2019-11-28 08:08:38 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf script: > > Adrian Hunter: > > - Fix brstackinsn for AUXTRACE. > > - Fix invalid LBR/binary mismatch error. > > perf diff: > > Arnaldo Carvalho de Melo: > > - Use llabs() with 64-bit values, fixing the build in some 32-bit > architectures. > > perf pmu: > > Andi Kleen: > > - Use file system cache to optimize sysfs access. > > x86: > > Adrian Hunter: > > - Add some more Intel instructions to the opcode map and to the perf > test entry: > > gf2p8affineinvqb, gf2p8affineqb, gf2p8mulb, v4fmaddps, > v4fmaddss, v4fnmaddps, v4fnmaddss, vaesdec, vaesdeclast, vaesenc, > vaesenclast, vcvtne2ps2bf16, vcvtneps2bf16, vdpbf16ps, > vgf2p8affineinvqb, vgf2p8affineqb, vgf2p8mulb, vp2intersectd, > vp2intersectq, vp4dpwssd, vp4dpwssds, vpclmulqdq, vpcompressb, > vpcompressw, vpdpbusd, vpdpbusds, vpdpwssd, vpdpwssds, vpexpandb, > vpexpandw, vpopcntb, vpopcntd, vpopcntq, vpopcntw, vpshldd, vpshldq, > vpshldvd, vpshldvq, vpshldvw, vpshldw, vpshrdd, vpshrdq, vpshrdvd, > vpshrdvq, vpshrdvw, vpshrdw, vpshufbitqmb. > > perf affinity: > > Andi Kleen: > > - Add infrastructure to save/restore affinity > > perf maps: > > Arnaldo Carvalho de Melo: > > - Merge 'struct maps' with 'struct map_groups', as there is a > 1x1 relationship, simplifying code overal. > > perf build: > > Jiri Olsa: > > - Allow to link with libbpf dynamicaly. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > 66 files changed, 2230 insertions(+), 618 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-11-22 14:56 Arnaldo Carvalho de Melo 2019-11-23 8:07 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-11-22 14:56 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov, Colin King, Hewenliang, Ian Rogers, Jin Yao, Steven Rostedt, Sudipm Mukherjee, 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 8f6ee51d772d0dab407d868449d2c5d9c8d2b6fc: Merge tag 'perf-core-for-mingo-5.5-20191119' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-11-19 12:59:03 +0100) 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.5-20191122 for you to fetch changes up to 4584f084aa9d8033d5911935837dbee7b082d0e9: perf parse: Fix potential memory leak when handling tracepoint errors (2019-11-22 10:48:14 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report: Jin Yao: - Allow entering the annotation view (symbol source/assembly + overhead/cycles/etc column) from the 'perf report --total-cycles' interface. E.g.: # perf record --all-cpus --branch-any --all-kernel ^C[ perf record: Woken up 5 times to write data ] # # perf evlist -v cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|BRANCH_STACK, read_format: ID, disabled: 1, inherit: 1, exclude_user: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, branch_sample_type: ANY # # perf report --total-cycles # # Samples: 78762 of event 'cycles' Sampled Sampled Avg Avg Cycles% Cycles Cycles% Cycles [Program Block Range] Shared Object 1.72% 95.8K 0.00% 254 [msr.h:105 -> msr.h:166] [kernel.vmlinux] 1.56% 107.6K 0.00% 618 [compiler.h:199 -> common.c:301] [kernel.vmlinux] 0.83% 46.3K 0.00% 409 [entry_64.S:153 -> entry_64.S:175] [kernel.vmlinux] 0.83% 46.1K 0.00% 83 [jump_label.h:41 -> tsc.c:230] [kernel.vmlinux] 0.64% 36.9K 0.01% 1.4K [hda_intel.c:904 -> hda_intel.c:916] [snd_hda_intel] 0.57% 30.2K 0.00% 282 [file.c:710 -> file.c:730] [kernel.vmlinux] 0.48% 25.8K 0.00% 82 [spinlock.c:158 -> spinlock.c:160] [kernel.vmlinux] 0.45% 23.7K 0.00% 369 [tick-broadcast.c:585 -> tick-broadcast.c:586] [kernel.vmlinux] 0.44% 24.4K 0.00% 73 [msr.h:236 -> tsc.c:1088] [kernel.vmlinux] 0.43% 22.7K 0.00% 144 [cpuidle.c:229 -> cpuidle.c:232] [kernel.vmlinux] Then press 'A' or Enter on one of those lines, just like with 'perf top', say the top one: [msr.h:105 -> msr.h:166], then this shows up: Samples: 78K of event 'cycles', 4000 Hz, Event count (approx.): 78762 native_write_msr /lib/modules/5.4.0-rc8/build/vmlinux [Percent: local period] Percent│ IPC Cycle (Average IPC: 0.02, IPC Coverage: 50.0%) │ │ Disassembly of section .text: │ │ ffffffff8106c480 <native_write_msr>: │ __wrmsr(): │ return EAX_EDX_VAL(val, low, high); │ } │ │ static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) │ { │ asm volatile("1: wrmsr\n" 49.16 │0.02 mov %edi,%ecx │0.02 mov %esi,%eax │0.02 wrmsr │ arch_static_branch(): │ #include <linux/stringify.h> │ #include <linux/types.h> │ │ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) │ { │ asm_volatile_goto("1:" 0.79 │0.02 nop │ native_write_msr(): │ { │ __wrmsr(msr, low, high); │ │ if (msr_tracepoint_active(__tracepoint_write_msr)) │ do_trace_write_msr(msr, ((u64)high << 32 | low), 0); │ } 50.05 │0.02 254 ← retq │ do_trace_write_msr(msr, ((u64)high << 32 | low), 0); │ shl $0x20,%rdx │ mov %esi,%esi │ or %rdx,%rsi │ xor %edx,%edx │ → jmpq do_trace_write_msr We need to improve this to show the source code line numbers in the annotation view, so one can go from that program block to the annotation view and see those source code line numbers straight away. auxtrace/Intel PT: Adrian Hunter: - Add support for AUX area sampling, requires new functionality that will land in 5.5, its already in tip. This includes kernel capability querying so that it fails gracefully with older kernels, duimping aux area samples in 'perf report -D' and 'perf script'. perf.data: Alexey Budankov: - Fix decompression of PERF_RECORD_COMPRESSED records. core: Arnaldo Carvalho de Melo: - Use the 'dcacheline' cmp routine to find the right DSOs taking into account the 'maj', 'min', 'ino' and 'ino_generation', that got moved from 'struct map' to 'struct dso', where it belongs. This further reduces the size of 'struct map', there is still more work to do to maybe get it to max one cacheline. libtraceevent: Hewenliang: - Fix memory leakage in copy_filter_type(). Sudip Mukherjee: - Fix header installation. perf parse: Ian Rogers : - Fix potential memory leak when handling tracepoint errors, found using LLVM's libFuzzer. perf probe: Colin Ian King: - Fix spelling mistake "addrees" -> "address". Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (14): perf tools: Add kernel AUX area sampling definitions perf record: Add a function to test for kernel support for AUX area sampling perf auxtrace: Move perf_evsel__find_pmu() perf auxtrace: Add support for AUX area sample recording perf record: Add support for AUX area sampling perf record: Add aux-sample-size config term perf inject: Cut AUX area samples perf auxtrace: Add support for dumping AUX area samples perf session: Add facility to peek at all events perf auxtrace: Add support for queuing AUX area samples perf pmu: When using default config, record which bits of config were changed by the user perf intel-pt: Add support for recording AUX area samples perf intel-pt: Add support for decoding AUX area samples perf intel-bts: Does not support AUX area sampling Alexey Budankov (1): perf session: Fix decompression of PERF_RECORD_COMPRESSED records Arnaldo Carvalho de Melo (5): perf map: Move maj/min/ino/ino_generation to separate struct perf map: Pass a dso_id to map__new() perf map: Move comparision of map's dso_id to a separate function perf dsos: Remove unused dsos__find() method perf dso: Move dso_id from 'struct map' to 'struct dso' Colin Ian King (1): perf probe: Fix spelling mistake "addrees" -> "address" Hewenliang (1): libtraceevent: Fix memory leakage in copy_filter_type Ian Rogers (1): perf parse: Fix potential memory leak when handling tracepoint errors Jin Yao (2): perf util: Move block TUI function to ui browsers perf report: Jump to symbol source view from total cycles view Sudip Mukherjee (1): libtraceevent: Fix header installation tools/include/uapi/linux/perf_event.h | 10 +- tools/lib/traceevent/Makefile | 8 +- tools/lib/traceevent/parse-filter.c | 9 +- tools/perf/Documentation/intel-pt.txt | 59 +++++- tools/perf/Documentation/perf-record.txt | 9 + tools/perf/arch/x86/util/auxtrace.c | 4 + tools/perf/arch/x86/util/intel-bts.c | 5 + tools/perf/arch/x86/util/intel-pt.c | 81 +++++++- tools/perf/builtin-inject.c | 29 +++ tools/perf/builtin-record.c | 21 +- tools/perf/builtin-report.c | 11 +- tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/base-stat | 2 +- tools/perf/tests/sample-parsing.c | 16 +- tools/perf/ui/browsers/hists.c | 78 +++++++- tools/perf/util/auxtrace.c | 322 ++++++++++++++++++++++++++++-- tools/perf/util/auxtrace.h | 43 ++++ tools/perf/util/block-info.c | 71 +------ tools/perf/util/block-info.h | 3 +- tools/perf/util/dso.c | 24 ++- tools/perf/util/dso.h | 13 ++ tools/perf/util/dsos.c | 97 +++++++-- tools/perf/util/dsos.h | 14 +- tools/perf/util/event.h | 6 + tools/perf/util/evlist.h | 1 + tools/perf/util/evsel.c | 31 +++ tools/perf/util/evsel_config.h | 13 ++ tools/perf/util/hist.h | 15 ++ tools/perf/util/intel-pt.c | 109 +++++++++- tools/perf/util/machine.c | 22 +- tools/perf/util/machine.h | 2 + tools/perf/util/map.c | 11 +- tools/perf/util/map.h | 9 +- tools/perf/util/parse-events.c | 65 +++++- tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 1 + tools/perf/util/perf_event_attr_fprintf.c | 3 +- tools/perf/util/pmu.c | 10 + tools/perf/util/pmu.h | 2 + tools/perf/util/probe-finder.c | 2 +- tools/perf/util/record.c | 31 +++ tools/perf/util/record.h | 2 + tools/perf/util/session.c | 82 ++++++-- tools/perf/util/session.h | 5 + tools/perf/util/sort.c | 24 +-- tools/perf/util/synthetic-events.c | 12 ++ 46 files changed, 1190 insertions(+), 200 deletions(-) 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. Manjaro got fixed by adding the 'gettext' package, that provides a library needed by bison but not present in its dependencies list, i.e. a distro bug. cooker is failing with: In file included from cpumap.c:4: In file included from /git/linux/tools/include/linux/refcount.h:41: In file included from /git/linux/tools/include/linux/atomic.h:5: In file included from /git/linux/tools/include/asm/atomic.h:6: In file included from /git/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h:11: /git/linux/tools/arch/x86/include/asm/cmpxchg.h:12:2: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes] __compiletime_error("Bad argument size for cmpxchg"); ^ /git/linux/tools/include/linux/compiler-gcc.h:20:54: note: expanded from macro '__compiletime_error' # define __compiletime_error(message) __attribute__((error(message))) ^ LD /tmp/build/perf/fs/libapi-in.o Still needs investigating, new image, just leaving it here for documentation purposes, maybe related to it using the most recent gcc and clang versions? # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.4.0-rc7.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 9.2.0) 9.2.0, Alpine clang version 9.0.0 (git://git.alpinelinux.org/aports 25c73ae7b95bdb42ae5f0ceac3b703e766582527) (based on LLVM 9.0.0) 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 20180712 (Red Hat 7.3.1-6), 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 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191101 gcc-9-branch@277702, clang version 9.0.0 (tags/RELEASE_900/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-9) 9.2.1 20191008, clang version 8.0.1-3+b1 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-19) 8.3.0 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 26 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) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 42 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 43 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 44 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 45 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) 46 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 47 openmandriva:cooker : FAIL gcc (GCC) 9.2.1 20191109 (OpenMandriva), clang version 9.0.1 48 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) 49 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 50 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 51 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 52 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 53 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 54 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) 55 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) 56 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) 57 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) 58 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) 59 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 65 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) 66 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 76 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) 77 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 78 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 79 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 80 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 81 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux quaco 5.4.0-rc8 #1 SMP Mon Nov 18 06:15:31 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 4584f084aa9d perf parse: Fix potential memory leak when handling tracepoint errors # perf version --build-options perf version 5.4.rc7.g4584f084aa9d 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_no_slang_O: make NO_SLANG=1 make_no_gtk2_O: make NO_GTK2=1 make_perf_o_O: make perf.o make_install_O: make install make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_pure_O: make make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_help_O: make help make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_cscope_O: make cscope make_no_newt_O: make NO_NEWT=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_debug_O: make DEBUG=1 make_clean_all_O: make clean all make_no_libperl_O: make NO_LIBPERL=1 make_install_bin_O: make install-bin make_util_pmu_bison_o_O: make util/pmu-bison.o make_doc_O: make doc make_install_prefix_O: make install prefix=/tmp/krava make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_auxtrace_O: make NO_AUXTRACE=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_util_map_o_O: make util/map.o make_tags_O: make tags OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-11-22 14:56 Arnaldo Carvalho de Melo @ 2019-11-23 8:07 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-11-23 8:07 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Colin King, Hewenliang, Ian Rogers, Jin Yao, Steven Rostedt, Sudipm Mukherjee, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 8f6ee51d772d0dab407d868449d2c5d9c8d2b6fc: > > Merge tag 'perf-core-for-mingo-5.5-20191119' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-11-19 12:59:03 +0100) > > 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.5-20191122 > > for you to fetch changes up to 4584f084aa9d8033d5911935837dbee7b082d0e9: > > perf parse: Fix potential memory leak when handling tracepoint errors (2019-11-22 10:48:14 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf report: > > Jin Yao: > > - Allow entering the annotation view (symbol source/assembly + > overhead/cycles/etc column) from the 'perf report --total-cycles' > interface. > > E.g.: > > # perf record --all-cpus --branch-any --all-kernel > ^C[ perf record: Woken up 5 times to write data ] > # > # perf evlist -v > cycles: size: 120, { sample_period, sample_freq }: 4000, > sample_type: IP|TID|TIME|CPU|PERIOD|BRANCH_STACK, > read_format: ID, disabled: 1, inherit: 1, exclude_user: 1, mmap: 1, comm: 1, freq: 1, task: 1, > precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, > bpf_event: 1, branch_sample_type: ANY > # > # perf report --total-cycles > # > # Samples: 78762 of event 'cycles' > Sampled Sampled Avg Avg > Cycles% Cycles Cycles% Cycles [Program Block Range] Shared Object > 1.72% 95.8K 0.00% 254 [msr.h:105 -> msr.h:166] [kernel.vmlinux] > 1.56% 107.6K 0.00% 618 [compiler.h:199 -> common.c:301] [kernel.vmlinux] > 0.83% 46.3K 0.00% 409 [entry_64.S:153 -> entry_64.S:175] [kernel.vmlinux] > 0.83% 46.1K 0.00% 83 [jump_label.h:41 -> tsc.c:230] [kernel.vmlinux] > 0.64% 36.9K 0.01% 1.4K [hda_intel.c:904 -> hda_intel.c:916] [snd_hda_intel] > 0.57% 30.2K 0.00% 282 [file.c:710 -> file.c:730] [kernel.vmlinux] > 0.48% 25.8K 0.00% 82 [spinlock.c:158 -> spinlock.c:160] [kernel.vmlinux] > 0.45% 23.7K 0.00% 369 [tick-broadcast.c:585 -> tick-broadcast.c:586] [kernel.vmlinux] > 0.44% 24.4K 0.00% 73 [msr.h:236 -> tsc.c:1088] [kernel.vmlinux] > 0.43% 22.7K 0.00% 144 [cpuidle.c:229 -> cpuidle.c:232] [kernel.vmlinux] > > Then press 'A' or Enter on one of those lines, just like with 'perf top', say > the top one: [msr.h:105 -> msr.h:166], then this shows up: > > Samples: 78K of event 'cycles', 4000 Hz, Event count (approx.): 78762 > native_write_msr /lib/modules/5.4.0-rc8/build/vmlinux [Percent: local period] > Percent│ IPC Cycle (Average IPC: 0.02, IPC Coverage: 50.0%) > │ > │ Disassembly of section .text: > │ > │ ffffffff8106c480 <native_write_msr>: > │ __wrmsr(): > │ return EAX_EDX_VAL(val, low, high); > │ } > │ > │ static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) > │ { > │ asm volatile("1: wrmsr\n" > 49.16 │0.02 mov %edi,%ecx > │0.02 mov %esi,%eax > │0.02 wrmsr > │ arch_static_branch(): > │ #include <linux/stringify.h> > │ #include <linux/types.h> > │ > │ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) > │ { > │ asm_volatile_goto("1:" > 0.79 │0.02 nop > │ native_write_msr(): > │ { > │ __wrmsr(msr, low, high); > │ > │ if (msr_tracepoint_active(__tracepoint_write_msr)) > │ do_trace_write_msr(msr, ((u64)high << 32 | low), 0); > │ } > 50.05 │0.02 254 ← retq > │ do_trace_write_msr(msr, ((u64)high << 32 | low), 0); > │ shl $0x20,%rdx > │ mov %esi,%esi > │ or %rdx,%rsi > │ xor %edx,%edx > │ → jmpq do_trace_write_msr > > We need to improve this to show the source code line numbers in the > annotation view, so one can go from that program block to the annotation view > and see those source code line numbers straight away. > > auxtrace/Intel PT: > > Adrian Hunter: > > - Add support for AUX area sampling, requires new functionality that > will land in 5.5, its already in tip. > > This includes kernel capability querying so that it fails gracefully > with older kernels, duimping aux area samples in 'perf report -D' and > 'perf script'. > > perf.data: > > Alexey Budankov: > > - Fix decompression of PERF_RECORD_COMPRESSED records. > > core: > > Arnaldo Carvalho de Melo: > > - Use the 'dcacheline' cmp routine to find the right DSOs taking into > account the 'maj', 'min', 'ino' and 'ino_generation', that got moved > from 'struct map' to 'struct dso', where it belongs. > > This further reduces the size of 'struct map', there is still more > work to do to maybe get it to max one cacheline. > > libtraceevent: > > Hewenliang: > > - Fix memory leakage in copy_filter_type(). > > Sudip Mukherjee: > > - Fix header installation. > > perf parse: > > Ian Rogers : > > - Fix potential memory leak when handling tracepoint errors, found using > LLVM's libFuzzer. > > perf probe: > > Colin Ian King: > > - Fix spelling mistake "addrees" -> "address". > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > 46 files changed, 1190 insertions(+), 200 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-11-19 11:32 Arnaldo Carvalho de Melo 2019-11-19 12:00 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-11-19 11:32 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Ian Rogers, James Clark, Konstantin Khlebnikov, Masami Hiramatsu, Arnaldo Carvalho de Melo Hi Ingo/Thomas, Please consider pulling, Best regards, - Arnaldo The following changes since commit e1e9b78d3957a267346a86c8f2c433f6a332af65: perf parse: Use YYABORT to clear stack after failure, plugging leaks (2019-11-12 08:34:16 -0300) 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.5-20191119 for you to fetch changes up to a910e4666d61712840c78de33cc7f89de8affa78: perf parse: Report initial event parsing error (2019-11-18 19:14:29 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: x86/insn: Adrian Hunter: - Add some more Intel instructions to the opcode map: cldemote, encls, enclu, enclv, enqcmd, enqcmds, movdir64b, movdiri, pconfig, tpause, umonitor, umwait, wbnoinvd. - The instruction decoding can be tested using the perf tools' "x86 instruction decoder - new instructions" test as folllows: $ perf test -v "new " 2>&1 | grep -i cldemote Decoded ok: 0f 1c 00 cldemote (%eax) Decoded ok: 0f 1c 05 78 56 34 12 cldemote 0x12345678 Decoded ok: 0f 1c 84 c8 78 56 34 12 cldemote 0x12345678(%eax,%ecx,8) Decoded ok: 0f 1c 00 cldemote (%rax) Decoded ok: 41 0f 1c 00 cldemote (%r8) Decoded ok: 0f 1c 04 25 78 56 34 12 cldemote 0x12345678 Decoded ok: 0f 1c 84 c8 78 56 34 12 cldemote 0x12345678(%rax,%rcx,8) Decoded ok: 41 0f 1c 84 c8 78 56 34 12 cldemote 0x12345678(%r8,%rcx,8) $ perf test -v "new " 2>&1 | grep -i tpause Decoded ok: 66 0f ae f3 tpause %ebx Decoded ok: 66 0f ae f3 tpause %ebx Decoded ok: 66 41 0f ae f0 tpause %r8d callchains: Adrian Hunter: - Fix segfault in thread__resolve_callchain_sample(). perf probe: - Line fixes to show only lines where probes can be used with 'perf probe -L', and when reporting them via 'perf probe -l'. - Support multiprobe events. perf scripts python: Adrian Hunter: - Fix use of TRUE with SQLite < 3.23 in exported-sql-viewer.py. perf maps: - Trim 'struct map' by removing the rb_node member for sorting by map name, as that is only needed for processing kernel maps, and only when classifying symbols by section at load time. Sort them by name using qsort() and do lookups using bsearch() when map_groups__find_by_name() is used. perf parse: Ian Rogers: - Report initial event parsing error, providing a less cryptic message to state that a PMU wasn't found in the system. perf vendor events: James Clark: - Fix commas so that PMU event files for arm64, power8 and power nine become valid JSON. libtraceevent: Konstantin Khlebnikov: - Fix parsing of event %o and %X argument types. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (4): perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite perf callchain: Fix segfault in thread__resolve_callchain_sample() x86/insn: perf tools: Add some instructions to the new instructions test x86/insn: Add some Intel instructions to the opcode map Arnaldo Carvalho de Melo (9): perf maps: Purge the entries from maps->names in __maps__purge() perf maps: Do not use an rbtree to sort by map name perf map_groups: Add a front end cache for map lookups by name perf map: No need to adjust the long name of modules perf record: No need to process the synthesized MMAP events twice perf machine: No need to check if kernel module maps pre-exist perf map_groups: Auto sort maps by name, if needed perf map: Use bitmap for booleans perf map: Move seldom used ->flags field to second cacheline Ian Rogers (1): perf parse: Report initial event parsing error James Clark (3): perf vendor events arm64: Fix commas so PMU event files are valid JSON perf vendor events power8: Fix commas so PMU event files are valid JSON perf vendor events power9: Fix commas so PMU event files are valid JSON Konstantin Khlebnikov (1): libtraceevent: Fix parsing of event %o and %X argument types Masami Hiramatsu (7): perf probe: Show correct statement line number by perf probe -l perf probe: Verify given line is a representive line perf probe: Do not show non representive lines by perf-probe -L perf probe: Generate event name with line number perf probe: Support multiprobe event perf probe: Support DW_AT_const_value constant value perf probe: Trace a magic number if variable is not found arch/x86/lib/x86-opcode-map.txt | 18 +- tools/arch/x86/lib/x86-opcode-map.txt | 18 +- tools/lib/traceevent/event-parse.c | 7 +- tools/perf/arch/powerpc/util/kvm-stat.c | 4 +- tools/perf/arch/x86/tests/insn-x86-dat-32.c | 52 + tools/perf/arch/x86/tests/insn-x86-dat-64.c | 62 ++ tools/perf/arch/x86/tests/insn-x86-dat-src.c | 109 ++ tools/perf/builtin-record.c | 29 +- tools/perf/builtin-stat.c | 2 + tools/perf/builtin-trace.c | 16 +- .../pmu-events/arch/arm64/ampere/emag/branch.json | 8 +- .../pmu-events/arch/arm64/ampere/emag/bus.json | 14 +- .../pmu-events/arch/arm64/ampere/emag/cache.json | 28 +- .../pmu-events/arch/arm64/ampere/emag/clock.json | 2 +- .../arch/arm64/ampere/emag/exception.json | 26 +- .../arch/arm64/ampere/emag/instruction.json | 28 +- .../arch/arm64/ampere/emag/intrinsic.json | 10 +- .../pmu-events/arch/arm64/ampere/emag/memory.json | 12 +- .../arch/arm64/ampere/emag/pipeline.json | 2 +- .../arch/arm64/arm/cortex-a53/branch.json | 2 +- .../pmu-events/arch/arm64/arm/cortex-a53/bus.json | 4 +- .../arch/arm64/arm/cortex-a53/other.json | 4 +- .../arm64/arm/cortex-a57-a72/core-imp-def.json | 120 +- .../pmu-events/arch/arm64/armv8-recommended.json | 158 +-- .../arch/arm64/cavium/thunderx2/core-imp-def.json | 74 +- .../arch/arm64/hisilicon/hip08/core-imp-def.json | 60 +- .../arch/arm64/hisilicon/hip08/uncore-ddrc.json | 18 +- .../arch/arm64/hisilicon/hip08/uncore-hha.json | 22 +- .../arch/arm64/hisilicon/hip08/uncore-l3c.json | 28 +- .../perf/pmu-events/arch/powerpc/power8/cache.json | 60 +- .../arch/powerpc/power8/floating-point.json | 6 +- .../pmu-events/arch/powerpc/power8/frontend.json | 158 +-- .../pmu-events/arch/powerpc/power8/marked.json | 266 ++--- .../pmu-events/arch/powerpc/power8/memory.json | 72 +- .../perf/pmu-events/arch/powerpc/power8/other.json | 1150 ++++++++++---------- .../pmu-events/arch/powerpc/power8/pipeline.json | 118 +- tools/perf/pmu-events/arch/powerpc/power8/pmc.json | 48 +- .../arch/powerpc/power8/translation.json | 60 +- .../perf/pmu-events/arch/powerpc/power9/cache.json | 44 +- .../arch/powerpc/power9/floating-point.json | 14 +- .../pmu-events/arch/powerpc/power9/frontend.json | 142 +-- .../pmu-events/arch/powerpc/power9/marked.json | 250 ++--- .../pmu-events/arch/powerpc/power9/memory.json | 52 +- .../perf/pmu-events/arch/powerpc/power9/other.json | 934 ++++++++-------- .../pmu-events/arch/powerpc/power9/pipeline.json | 212 ++-- tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 48 +- .../arch/powerpc/power9/translation.json | 92 +- tools/perf/scripts/python/exported-sql-viewer.py | 12 +- tools/perf/tests/map_groups.c | 2 +- tools/perf/tests/parse-events.c | 3 +- tools/perf/util/dwarf-aux.c | 62 +- tools/perf/util/machine.c | 43 +- tools/perf/util/machine.h | 2 - tools/perf/util/map.c | 116 +- tools/perf/util/map.h | 7 +- tools/perf/util/map_groups.h | 21 +- tools/perf/util/metricgroup.c | 2 +- tools/perf/util/parse-events.c | 78 +- tools/perf/util/parse-events.h | 4 + tools/perf/util/probe-event.c | 19 +- tools/perf/util/probe-event.h | 3 + tools/perf/util/probe-file.c | 14 + tools/perf/util/probe-file.h | 2 + tools/perf/util/probe-finder.c | 116 +- tools/perf/util/probe-finder.h | 1 + tools/perf/util/symbol.c | 84 +- 66 files changed, 2888 insertions(+), 2366 deletions(-) ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-11-19 11:32 Arnaldo Carvalho de Melo @ 2019-11-19 12:00 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-11-19 12:00 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Ian Rogers, James Clark, Konstantin Khlebnikov, Masami Hiramatsu, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > > The following changes since commit e1e9b78d3957a267346a86c8f2c433f6a332af65: > > perf parse: Use YYABORT to clear stack after failure, plugging leaks (2019-11-12 08:34:16 -0300) > > 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.5-20191119 > > for you to fetch changes up to a910e4666d61712840c78de33cc7f89de8affa78: > > perf parse: Report initial event parsing error (2019-11-18 19:14:29 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > x86/insn: > > Adrian Hunter: > > - Add some more Intel instructions to the opcode map: > > cldemote, encls, enclu, enclv, enqcmd, enqcmds, movdir64b, > movdiri, pconfig, tpause, umonitor, umwait, wbnoinvd. > > - The instruction decoding can be tested using the perf tools' > "x86 instruction decoder - new instructions" test as folllows: > > $ perf test -v "new " 2>&1 | grep -i cldemote > Decoded ok: 0f 1c 00 cldemote (%eax) > Decoded ok: 0f 1c 05 78 56 34 12 cldemote 0x12345678 > Decoded ok: 0f 1c 84 c8 78 56 34 12 cldemote 0x12345678(%eax,%ecx,8) > Decoded ok: 0f 1c 00 cldemote (%rax) > Decoded ok: 41 0f 1c 00 cldemote (%r8) > Decoded ok: 0f 1c 04 25 78 56 34 12 cldemote 0x12345678 > Decoded ok: 0f 1c 84 c8 78 56 34 12 cldemote 0x12345678(%rax,%rcx,8) > Decoded ok: 41 0f 1c 84 c8 78 56 34 12 cldemote 0x12345678(%r8,%rcx,8) > $ perf test -v "new " 2>&1 | grep -i tpause > Decoded ok: 66 0f ae f3 tpause %ebx > Decoded ok: 66 0f ae f3 tpause %ebx > Decoded ok: 66 41 0f ae f0 tpause %r8d > > callchains: > > Adrian Hunter: > > - Fix segfault in thread__resolve_callchain_sample(). > > perf probe: > > - Line fixes to show only lines where probes can be used with 'perf probe -L', > and when reporting them via 'perf probe -l'. > > - Support multiprobe events. > > perf scripts python: > > Adrian Hunter: > > - Fix use of TRUE with SQLite < 3.23 in exported-sql-viewer.py. > > perf maps: > > - Trim 'struct map' by removing the rb_node member for sorting > by map name, as that is only needed for processing kernel maps, > and only when classifying symbols by section at load time. > Sort them by name using qsort() and do lookups using bsearch() > when map_groups__find_by_name() is used. > > perf parse: > > Ian Rogers: > > - Report initial event parsing error, providing a less cryptic message > to state that a PMU wasn't found in the system. > > perf vendor events: > > James Clark: > > - Fix commas so that PMU event files for arm64, power8 and power nine > become valid JSON. > > libtraceevent: > > Konstantin Khlebnikov: > > - Fix parsing of event %o and %X argument types. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > 66 files changed, 2888 insertions(+), 2366 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-11-12 18:37 Arnaldo Carvalho de Melo 2019-11-15 7:35 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-11-12 18:37 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Ian Rogers, Ravi Bangoria, 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 56b2147f34d057b0898c53a3eb2e9e70756ab89f: Merge tag 'perf-core-for-mingo-5.5-20191107' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-11-12 12:06:08 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf-core-for-mingo-5.5-20191112 for you to fetch changes up to e1e9b78d3957a267346a86c8f2c433f6a332af65: perf parse: Use YYABORT to clear stack after failure, plugging leaks (2019-11-12 08:34:16 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf record: Ravi Bangoria: - Provide an option to print perf_event_open args and syscall return value. This was already possible using -v, but then lots of other debug info would be output as well, provide a way to show just the syscall args and return value, e.g.: # perf --debug perf-event-open=1 record perf_event_attr: size 112 { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|PERIOD read_format ID disabled 1 inherit 1 <SNIP> ksymbol 1 bpf_event 1 ------------------------------------------------------------ sys_perf_event_open: pid 4308 cpu 0 group_fd -1 flags 0x8 = 4 core: - Remove map->groups, we can get that information in other ways, reduces the size of a key data structure and paves the way to have it shared by multiple threads. - Use 'struct map_symbol' in more places, where we already were using a 'struct map' + 'struct symbol', this helps passing that usual pair of information across callchain, browser code, etc. - Add 'struct map_groups' (where the map_symbol->map is) to 'struct map_symbol', to ease annotation code, for instance, where we call from functions in one map we're browsing to functions in another DSO, mapped in another 'struct map'. event parsing: Ian Rogers: - Use YYABORT to clear stack after failure, plugging leaks Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (13): perf map: Use map->dso->kernel + map__kmaps() in map__kmaps() perf symbols: Stop using map->groups, we can use kmaps instead perf map_groups: Pass the object to map_groups__find_ams() perf tools: Add map_groups to 'struct addr_location' perf annotate: Pass a 'map_symbol' in places receiving a pair of 'map' and 'symbol' pointers perf unwind: Use 'struct map_symbol' in 'struct unwind_entry' perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' pref tools: Make 'struct addr_map_symbol' contain 'struct map_symbol' perf symbols: Use kmaps(map)->machine when we know its a kernel map perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' perf annotate: Stop using map->groups, use map_symbol->mg instead perf map: Combine maps__fixup_overlappings with its only use perf map: Remove ->groups from 'struct map' Ian Rogers (1): perf parse: Use YYABORT to clear stack after failure, plugging leaks Ravi Bangoria (1): perf tool: Provide an option to print perf_event_open args and return value tools/perf/Documentation/perf.txt | 2 + tools/perf/arch/s390/annotate/instructions.c | 8 +- tools/perf/builtin-annotate.c | 6 +- tools/perf/builtin-kmem.c | 4 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-top.c | 6 +- tools/perf/tests/dwarf-unwind.c | 2 +- tools/perf/ui/browsers/annotate.c | 25 +++-- tools/perf/ui/browsers/hists.c | 20 ++-- tools/perf/ui/gtk/annotate.c | 27 +++--- tools/perf/util/annotate.c | 105 ++++++++++----------- tools/perf/util/annotate.h | 22 ++--- tools/perf/util/callchain.c | 40 ++++---- tools/perf/util/callchain.h | 5 +- tools/perf/util/db-export.c | 16 ++-- tools/perf/util/debug.c | 2 + tools/perf/util/debug.h | 9 ++ tools/perf/util/event.c | 6 +- tools/perf/util/evsel.c | 36 +++---- tools/perf/util/evsel_fprintf.c | 29 +++--- tools/perf/util/hist.c | 58 ++++++------ tools/perf/util/machine.c | 48 ++++++---- tools/perf/util/map.c | 46 +++------ tools/perf/util/map.h | 1 - tools/perf/util/map_groups.h | 2 +- tools/perf/util/map_symbol.h | 5 +- tools/perf/util/mem-events.c | 2 +- tools/perf/util/parse-events.y | 3 +- tools/perf/util/python.c | 1 + .../perf/util/scripting-engines/trace-event-perl.c | 16 ++-- .../util/scripting-engines/trace-event-python.c | 18 ++-- tools/perf/util/sort.c | 89 ++++++++--------- tools/perf/util/symbol-elf.c | 2 +- tools/perf/util/symbol.c | 16 +--- tools/perf/util/symbol.h | 2 +- tools/perf/util/unwind-libdw.c | 7 +- tools/perf/util/unwind-libunwind-local.c | 7 +- tools/perf/util/unwind.h | 8 +- 39 files changed, 347 insertions(+), 358 deletions(-) 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. Manjaro is failing due to some missing library related to bison, looks like a distro bug. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.4.0-rc7.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 9.2.0) 9.2.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 20180712 (Red Hat 7.3.1-6), 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 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191101 gcc-9-branch@277702, clang version 9.0.0 (tags/RELEASE_900/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-9) 9.2.1 20191008, clang version 8.0.1-3+b1 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-19) 8.3.0 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 26 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) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 42 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 43 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 44 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 45 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) 46 manjaro:latest : FAIL gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 47 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) 48 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 49 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 7.0.1 (tags/RELEASE_701/final 349238) 50 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 51 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 52 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 53 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) 54 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) 55 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) 56 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) 57 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) 58 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 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) 65 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 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) 76 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 77 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 78 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 79 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 80 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux quaco 5.3.8-200.fc30.x86_64 #1 SMP Tue Oct 29 14:46:22 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 e1e9b78d3957 perf parse: Use YYABORT to clear stack after failure, plugging leaks # perf version --build-options perf version 5.4.rc7.ge1e9b78d3957 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_no_libelf_O: make NO_LIBELF=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_demangle_O: make NO_DEMANGLE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libbpf_O: make NO_LIBBPF=1 make_install_O: make install make_install_prefix_O: make install prefix=/tmp/krava make_cscope_O: make cscope make_no_libnuma_O: make NO_LIBNUMA=1 make_help_O: make help make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_debug_O: make DEBUG=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_perf_o_O: make perf.o make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libperl_O: make NO_LIBPERL=1 make_install_bin_O: make install-bin make_tags_O: make tags make_pure_O: make make_no_newt_O: make NO_NEWT=1 make_no_gtk2_O: make NO_GTK2=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_clean_all_O: make clean all make_doc_O: make doc make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_util_map_o_O: make util/map.o make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_slang_O: make NO_SLANG=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_auxtrace_O: make NO_AUXTRACE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-11-12 18:37 Arnaldo Carvalho de Melo @ 2019-11-15 7:35 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-11-15 7:35 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Ian Rogers, Ravi Bangoria, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 56b2147f34d057b0898c53a3eb2e9e70756ab89f: > > Merge tag 'perf-core-for-mingo-5.5-20191107' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-11-12 12:06:08 +0100) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf-core-for-mingo-5.5-20191112 > > for you to fetch changes up to e1e9b78d3957a267346a86c8f2c433f6a332af65: > > perf parse: Use YYABORT to clear stack after failure, plugging leaks (2019-11-12 08:34:16 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf record: > > Ravi Bangoria: > > - Provide an option to print perf_event_open args and syscall return value. > This was already possible using -v, but then lots of other debug info > would be output as well, provide a way to show just the syscall args > and return value, e.g.: > > # perf --debug perf-event-open=1 record > perf_event_attr: > size 112 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|PERIOD > read_format ID > disabled 1 > inherit 1 > <SNIP> > ksymbol 1 > bpf_event 1 > ------------------------------------------------------------ > sys_perf_event_open: pid 4308 cpu 0 group_fd -1 flags 0x8 = 4 > > core: > > - Remove map->groups, we can get that information in other ways, reduces > the size of a key data structure and paves the way to have it shared > by multiple threads. > > - Use 'struct map_symbol' in more places, where we already were using a > 'struct map' + 'struct symbol', this helps passing that usual pair of > information across callchain, browser code, etc. > > - Add 'struct map_groups' (where the map_symbol->map is) to 'struct map_symbol', > to ease annotation code, for instance, where we call from functions in one map > we're browsing to functions in another DSO, mapped in another 'struct map'. > > event parsing: > > Ian Rogers: > > - Use YYABORT to clear stack after failure, plugging leaks > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (13): > perf map: Use map->dso->kernel + map__kmaps() in map__kmaps() > perf symbols: Stop using map->groups, we can use kmaps instead > perf map_groups: Pass the object to map_groups__find_ams() > perf tools: Add map_groups to 'struct addr_location' > perf annotate: Pass a 'map_symbol' in places receiving a pair of 'map' and 'symbol' pointers > perf unwind: Use 'struct map_symbol' in 'struct unwind_entry' > perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' > pref tools: Make 'struct addr_map_symbol' contain 'struct map_symbol' > perf symbols: Use kmaps(map)->machine when we know its a kernel map > perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' > perf annotate: Stop using map->groups, use map_symbol->mg instead > perf map: Combine maps__fixup_overlappings with its only use > perf map: Remove ->groups from 'struct map' > > Ian Rogers (1): > perf parse: Use YYABORT to clear stack after failure, plugging leaks > > Ravi Bangoria (1): > perf tool: Provide an option to print perf_event_open args and return value > > tools/perf/Documentation/perf.txt | 2 + > tools/perf/arch/s390/annotate/instructions.c | 8 +- > tools/perf/builtin-annotate.c | 6 +- > tools/perf/builtin-kmem.c | 4 +- > tools/perf/builtin-report.c | 2 +- > tools/perf/builtin-sched.c | 2 +- > tools/perf/builtin-top.c | 6 +- > tools/perf/tests/dwarf-unwind.c | 2 +- > tools/perf/ui/browsers/annotate.c | 25 +++-- > tools/perf/ui/browsers/hists.c | 20 ++-- > tools/perf/ui/gtk/annotate.c | 27 +++--- > tools/perf/util/annotate.c | 105 ++++++++++----------- > tools/perf/util/annotate.h | 22 ++--- > tools/perf/util/callchain.c | 40 ++++---- > tools/perf/util/callchain.h | 5 +- > tools/perf/util/db-export.c | 16 ++-- > tools/perf/util/debug.c | 2 + > tools/perf/util/debug.h | 9 ++ > tools/perf/util/event.c | 6 +- > tools/perf/util/evsel.c | 36 +++---- > tools/perf/util/evsel_fprintf.c | 29 +++--- > tools/perf/util/hist.c | 58 ++++++------ > tools/perf/util/machine.c | 48 ++++++---- > tools/perf/util/map.c | 46 +++------ > tools/perf/util/map.h | 1 - > tools/perf/util/map_groups.h | 2 +- > tools/perf/util/map_symbol.h | 5 +- > tools/perf/util/mem-events.c | 2 +- > tools/perf/util/parse-events.y | 3 +- > tools/perf/util/python.c | 1 + > .../perf/util/scripting-engines/trace-event-perl.c | 16 ++-- > .../util/scripting-engines/trace-event-python.c | 18 ++-- > tools/perf/util/sort.c | 89 ++++++++--------- > tools/perf/util/symbol-elf.c | 2 +- > tools/perf/util/symbol.c | 16 +--- > tools/perf/util/symbol.h | 2 +- > tools/perf/util/unwind-libdw.c | 7 +- > tools/perf/util/unwind-libunwind-local.c | 7 +- > tools/perf/util/unwind.h | 8 +- > 39 files changed, 347 insertions(+), 358 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-11-07 18:59 Arnaldo Carvalho de Melo 2019-11-12 11:08 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-11-07 18:59 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Haiyan Song, Ian Rogers, Igor Lubashev, James Clark, Jin Yao, Jiwei Sun, John Garry, Leo Yan, Masami Hiramatsu, Will Deacon, Yunfeng Ye, 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 d44f821b0e13275735e8f3fe4db8703b45f05d52: perf/core: Optimize perf_init_event() for TYPE_SOFTWARE (2019-10-28 12:53:28 +0100) 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.5-20191107 for you to fetch changes up to 7fa46cbf20d327d78114b1c8c7e69fabe7c57794: perf report: Sort by sampled cycles percent per block for tui (2019-11-07 10:14:48 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report: Jin Yao: - Introduce --total-cycles, for basic block profiling, further using data obtained from LBR, an example should suffice: # perf record -b ^C[ perf record: Woken up 595 times to write data ] [ perf record: Captured and wrote 156.672 MB perf.data (196873 samples) ] # perf evlist -v cycles: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD|BRANCH_STACK, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, branch_sample_type: ANY # perf report --total-cycles --stdio # To display the perf.data header info, please use --header/--header-only options. # # Total Lost Samples: 0 # # Samples: 6M of event 'cycles' # Event count (approx.): 6299936 # # Sampled Sampled Avg Avg # Cycles% Cycles Cycles% Cycles [Program Block Range] Shared Object # ....... ...... ....... ..... .................................... ................ # 2.17% 1.7M 0.08% 607 [compiler.h:199 -> common.c:221] [kernel.vmlinux] 0.72% 544.5K 0.03% 230 [entry_64.S:657 -> entry_64.S:662] [kernel.vmlinux] 0.56% 541.8K 0.09% 672 [compiler.h:199 -> common.c:300] [kernel.vmlinux] 0.39% 293.2K 0.01% 104 [list_debug.c:43 -> list_debug.c:61] [kernel.vmlinux] 0.36% 278.6K 0.03% 272 [entry_64.S:1289 -> entry_64.S:1308] [kernel.vmlinux] perf record: Adrian Hunter: - Allow storing perf.data in a directory together with a copy of /proc/kcore. Jiwei Sun: - Add support for limit perf output file size, i.e.: # perf record --all-cpus -F 10000 --max-size=4M sleep 10h [ perf record: perf size limit reached (4097 KB), stopping session ] [ perf record: Woken up 6 times to write data ] [ perf record: Captured and wrote 4.048 MB perf.data (54094 samples) ] Terminated # ls -lah perf.data -rw-------. 1 root root 4.1M Nov 7 15:27 perf.data # perf stat: Jiri Olsa: - Add --per-node agregation support: In live mode: # perf stat -a -I 1000 -e cycles --per-node # time node cpus counts unit events 1.000542550 N0 20 6,202,097 cycles 1.000542550 N1 20 639,559 cycles 2.002040063 N0 20 7,412,495 cycles 2.002040063 N1 20 2,185,577 cycles 3.003451699 N0 20 6,508,917 cycles 3.003451699 N1 20 765,607 cycles ... Or in the record/report stat session: # perf stat record -a -I 1000 -e cycles # time counts unit events 1.000536937 10,008,468 cycles 2.002090152 9,578,539 cycles 3.003625233 7,647,869 cycles 4.005135036 7,032,086 cycles ^C 4.340902364 3,923,893 cycles # perf stat report --per-node # time node cpus counts unit events 1.000536937 N0 20 9,355,086 cycles 1.000536937 N1 20 653,382 cycles 2.002090152 N0 20 7,712,838 cycles 2.002090152 N1 20 1,865,701 cycles ... perf probe: Masami Hiramatsu: Various fixes related to recent additions to the DWARF format: - Fix to find range-only function instance - Walk function lines in lexical blocks - Fix to show function entry line as probe-able - Fix wrong address verification - Fix to probe a function which has no entry pc - Fix to probe an inline function which has no entry pc - Fix to list probe event with correct line number - Fix to show inlined function callsite without entry_pc - Fix to show ranges of variables in functions without entry_pc - Return a better scope DIE if there is no best scope - Skip end-of-sequence and non statement lines - Filter out instances except for inlined subroutine and subprogram - Fix to show calling lines of inlined functions - Skip overlapped location on searching variables perf inject: Adrian Hunter: - Do not strip evsels with --strip, as they are needed for create_gcov (see the autofdo example in tools/perf/Documentation/intel-pt.txt). Intel PT: Adrian Hunter: - Intel PT uses an auxtrace_cache to store the results of code-walking, to avoid repeated decoding. Add an auxtrace_cache__remove to handle text poke events. core: Andi Kleen: - Always preserve errno while cleaning up perf_event_open failures. llvm: Arnaldo Carvalho de Melo: - No need to tell that the request for saving a .o file for BPF events, as expressed in ~/.perfconfig was satisfied, make that a debug message. perf vendor events: Intel: Haiyan Song: - Update CascadelakeX events to v1.05. - Update all the Intel JSON metrics from TMAM 3.6. Treewide: Ian Rogers: - Improve error paths, plugging leaks found using LLVM tools such as libFuzzer. jevents: Yunfeng Ye: - Fix resource leak in process_mapfile() and main() perf kvm: Igor Lubashev: - Use evlist layer api when possible. libsubcmd: James Clark: - Move EXTRA_FLAGS to the end to allow overriding existing flags. - Use -O0 with DEBUG=1 perf diff: Jin Yao: - Don't use hack to skip column length calculation CoreSight ETM: Leo yan: - Fix definition of macro TO_CS_QUEUE_NR ARM64: John Garry: - Do not try to include libelf header files when its feature detection failed, fixing the cross build for ARM64. perf tests: Leo Yan: - Fix out of bounds memory access in the backward ring buffer test. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (9): perf data: Correctly identify directory data files perf data: Move perf_dir_version into data.h perf data: Rename directory "header" file to "data" perf data: Support single perf.data file directory perf record: Put a copy of kcore into the perf.data directory perf auxtrace: Add auxtrace_cache__remove() perf dso: Refactor dso_cache__read() perf dso: Add dso__data_write_cache_addr() perf inject: Make --strip keep evsels Andi Kleen (2): perf evsel: Always preserve errno while cleaning up perf_event_open failures perf evsel: Avoid close(-1) Arnaldo Carvalho de Melo (7): perf llvm: Make .o saving a debug message, not an info one perf map: Check if the map still has some refcounts on exit perf map: Allow map__next() to receive a NULL arg perf maps: Add for_each_entry()/_safe() iterators perf map_groups: Introduce for_each_entry() and for_each_entry_safe() iterators perf symbols: Remove needless checks for map->groups->machine perf machine: Add kernel_dso() method Haiyan Song (2): perf vendor events intel: Update CascadelakeX events to v1.05 perf vendor events intel: Update all the Intel JSON metrics from TMAM 3.6. Ian Rogers (10): perf tools: Move ALLOC_LIST into a function perf tools: Avoid a malloc() for array events perf tools: Splice events onto evlist even on error perf parse: Add parse events handle error perf parse: Ensure config and str in terms are unique perf parse: Add destructors for parse event terms perf parse: Before yyabort-ing free components perf parse: If pmu configuration fails free terms perf parse: Add a deep delete for parse event terms perf annotate: Fix heap overflow Igor Lubashev (1): perf kvm: Use evlist layer api when possible James Clark (2): libsubcmd: Move EXTRA_FLAGS to the end to allow overriding existing flags libsubcmd: Use -O0 with DEBUG=1 Jin Yao (7): perf diff: Don't use hack to skip column length calculation perf block: Cleanup and refactor block info functions perf hist: Count the total cycles of all samples perf hist: Support block formats with compare/sort/display perf report: Sort by sampled cycles percent per block for stdio perf report: Support --percent-limit for --total-cycles perf report: Sort by sampled cycles percent per block for tui Jiri Olsa (3): perf session: Fix indent in perf_session__new()" perf env: Add perf_env__numa_node() perf stat: Add --per-node agregation support Jiwei Sun (1): perf record: Add support for limit perf output file size John Garry (1): perf tools: Fix cross compile for ARM64 Leo Yan (3): perf cs-etm: Fix definition of macro TO_CS_QUEUE_NR perf tests: Fix a typo perf tests: Fix out of bounds memory access Masami Hiramatsu (14): perf probe: Fix to find range-only function instance perf probe: Walk function lines in lexical blocks perf probe: Fix to show function entry line as probe-able perf probe: Fix wrong address verification perf probe: Fix to probe a function which has no entry pc perf probe: Fix to probe an inline function which has no entry pc perf probe: Fix to list probe event with correct line number perf probe: Fix to show inlined function callsite without entry_pc perf probe: Fix to show ranges of variables in functions without entry_pc perf probe: Return a better scope DIE if there is no best scope perf probe: Skip end-of-sequence and non statement lines perf probe: Filter out instances except for inlined subroutine and subprogram perf probe: Fix to show calling lines of inlined functions perf probe: Skip overlapped location on searching variables Yunfeng Ye (1): perf jevents: Fix resource leak in process_mapfile() and main() tools/lib/subcmd/Makefile | 9 +- tools/perf/Documentation/perf-record.txt | 7 + tools/perf/Documentation/perf-report.txt | 11 + tools/perf/Documentation/perf-stat.txt | 5 + .../Documentation/perf.data-directory-format.txt | 63 + tools/perf/arch/arm64/util/sym-handling.c | 3 +- tools/perf/arch/x86/util/event.c | 2 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-diff.c | 121 +- tools/perf/builtin-inject.c | 54 - tools/perf/builtin-kvm.c | 2 +- tools/perf/builtin-record.c | 100 +- tools/perf/builtin-report.c | 67 +- tools/perf/builtin-stat.c | 52 + tools/perf/builtin-top.c | 3 +- tools/perf/lib/evsel.c | 3 +- .../pmu-events/arch/x86/broadwell/bdw-metrics.json | 178 +- .../arch/x86/broadwellx/bdx-metrics.json | 184 +- .../pmu-events/arch/x86/cascadelakex/cache.json | 12068 +++++++++---------- .../arch/x86/cascadelakex/clx-metrics.json | 210 +- .../arch/x86/cascadelakex/floating-point.json | 92 +- .../pmu-events/arch/x86/cascadelakex/frontend.json | 656 +- .../pmu-events/arch/x86/cascadelakex/memory.json | 11408 +++++++++--------- .../pmu-events/arch/x86/cascadelakex/other.json | 9620 +++++++-------- .../pmu-events/arch/x86/cascadelakex/pipeline.json | 1234 +- .../arch/x86/cascadelakex/uncore-memory.json | 191 + .../arch/x86/cascadelakex/uncore-other.json | 1585 ++- .../arch/x86/cascadelakex/virtual-memory.json | 339 +- .../pmu-events/arch/x86/haswell/hsw-metrics.json | 164 +- .../pmu-events/arch/x86/haswellx/hsx-metrics.json | 170 +- .../pmu-events/arch/x86/ivybridge/ivb-metrics.json | 170 +- .../pmu-events/arch/x86/ivytown/ivt-metrics.json | 172 +- .../pmu-events/arch/x86/jaketown/jkt-metrics.json | 114 +- .../arch/x86/sandybridge/snb-metrics.json | 112 +- .../pmu-events/arch/x86/skylake/skl-metrics.json | 188 +- .../pmu-events/arch/x86/skylakex/skx-metrics.json | 204 +- tools/perf/pmu-events/jevents.c | 13 +- tools/perf/tests/backward-ring-buffer.c | 9 + tools/perf/tests/bp_signal.c | 2 +- tools/perf/tests/map_groups.c | 9 +- tools/perf/tests/vmlinux-kallsyms.c | 6 +- tools/perf/ui/browsers/hists.c | 7 +- tools/perf/ui/browsers/hists.h | 2 + tools/perf/ui/stdio/hist.c | 29 +- tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 2 +- tools/perf/util/auxtrace.c | 28 + tools/perf/util/auxtrace.h | 1 + tools/perf/util/block-info.c | 538 + tools/perf/util/block-info.h | 78 + tools/perf/util/cpumap.c | 18 + tools/perf/util/cpumap.h | 3 + tools/perf/util/cs-etm.c | 4 +- tools/perf/util/data.c | 46 +- tools/perf/util/data.h | 12 + tools/perf/util/dso.c | 135 +- tools/perf/util/dso.h | 7 + tools/perf/util/dwarf-aux.c | 80 +- tools/perf/util/dwarf-aux.h | 3 + tools/perf/util/env.c | 40 + tools/perf/util/env.h | 6 + tools/perf/util/evsel.c | 9 +- tools/perf/util/header.h | 4 - tools/perf/util/hist.c | 13 +- tools/perf/util/hist.h | 3 +- tools/perf/util/llvm-utils.c | 5 +- tools/perf/util/machine.c | 12 +- tools/perf/util/map.c | 65 +- tools/perf/util/map_groups.h | 24 +- tools/perf/util/parse-events.c | 175 +- tools/perf/util/parse-events.h | 3 + tools/perf/util/parse-events.y | 390 +- tools/perf/util/pmu.c | 32 +- tools/perf/util/probe-event.c | 2 +- tools/perf/util/probe-finder.c | 77 +- tools/perf/util/record.h | 1 + tools/perf/util/session.c | 8 +- tools/perf/util/stat-display.c | 15 + tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 1 + tools/perf/util/symbol.c | 64 +- tools/perf/util/symbol.h | 24 - tools/perf/util/symbol_conf.h | 1 + tools/perf/util/synthetic-events.c | 2 +- tools/perf/util/thread.c | 2 +- tools/perf/util/util.c | 19 +- tools/perf/util/vdso.c | 4 +- 87 files changed, 22145 insertions(+), 19453 deletions(-) create mode 100644 tools/perf/Documentation/perf.data-directory-format.txt create mode 100644 tools/perf/util/block-info.c create mode 100644 tools/perf/util/block-info.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. Manjaro is failing due to some missing library related to bison, looks like a distro bug. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.4.0-rc5.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 9.2.0) 9.2.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 20180712 (Red Hat 7.3.1-6), 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 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20191101 gcc-9-branch@277702, clang version 9.0.0 (tags/RELEASE_900/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-9) 9.2.1 20191008, clang version 8.0.1-3+b1 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-19) 8.3.0 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 26 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) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 42 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 43 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 44 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 45 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) 46 manjaro:latest : FAIL gcc (GCC) 9.2.0, clang version 9.0.0 (tags/RELEASE_900/final) 47 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) 48 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407], clang version 7.0.1 (tags/RELEASE_701/final 349238) 49 opensuse:15.2 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 7.0.1 (tags/RELEASE_701/final 349238) 50 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 51 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 9.0.0 (tags/RELEASE_900/final 372316) 52 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 53 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) 54 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) 55 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) 56 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) 57 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) 58 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 64 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) 65 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 75 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) 76 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 77 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 78 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 79 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 80 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008, clang version 9.0.0-2 (tags/RELEASE_900/final) # # uname -a Linux quaco 5.3.8-200.fc30.x86_64 #1 SMP Tue Oct 29 14:46:22 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 7fa46cbf20d3 perf report: Sort by sampled cycles percent per block for tui # perf version --build-options perf version 5.4.rc5.g7fa46cbf20d3 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_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_help_O: make help make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_slang_O: make NO_SLANG=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_gtk2_O: make NO_GTK2=1 make_no_libbpf_O: make NO_LIBBPF=1 make_doc_O: make doc make_install_O: make install make_install_prefix_O: make install prefix=/tmp/krava make_debug_O: make DEBUG=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_util_map_o_O: make util/map.o make_no_libnuma_O: make NO_LIBNUMA=1 make_tags_O: make tags make_no_libperl_O: make NO_LIBPERL=1 make_install_bin_O: make install-bin make_cscope_O: make cscope make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_newt_O: make NO_NEWT=1 make_clean_all_O: make clean all make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_perf_o_O: make perf.o make_pure_O: make make_no_demangle_O: make NO_DEMANGLE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-11-07 18:59 Arnaldo Carvalho de Melo @ 2019-11-12 11:08 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-11-12 11:08 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Haiyan Song, Ian Rogers, Igor Lubashev, James Clark, Jin Yao, Jiwei Sun, John Garry, Leo Yan, Masami Hiramatsu, Will Deacon, Yunfeng Ye, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit d44f821b0e13275735e8f3fe4db8703b45f05d52: > > perf/core: Optimize perf_init_event() for TYPE_SOFTWARE (2019-10-28 12:53:28 +0100) > > 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.5-20191107 > > for you to fetch changes up to 7fa46cbf20d327d78114b1c8c7e69fabe7c57794: > > perf report: Sort by sampled cycles percent per block for tui (2019-11-07 10:14:48 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > 87 files changed, 22145 insertions(+), 19453 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-10-21 13:37 Arnaldo Carvalho de Melo 2019-10-21 23:16 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-10-21 13:37 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andi Kleen, Brendan Gregg, Daniel Bristot de Oliveira, Ian Rogers, Jin Yao, John Garry, Leo Yan, Steven Rostedt, Thomas Richter, 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 39b656ee9f2ce41eb969c86525f9a2a63fefac5b: Merge tag 'perf-core-for-mingo-5.5-20191011' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-10-15 07:19:55 +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.5-20191021 for you to fetch changes up to 27198a893ba074407e7a87e346252b3e6fab454f: perf trace: Use STUL_STRARRAY_FLAGS with mmap (2019-10-19 15:35:02 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf trace: - Add syscall failure stats to -s/--summary and -S/--with-summary, also works in combination with specifying just a set of syscalls, see below first with -s/--summary, then with -S/--with-summary just for the syscalls we saw failing with -s: # perf trace -s sleep 1 Summary of events: sleep (16218), 80 events, 93.0% syscall calls errors total min avg max stddev (msec) (msec) (msec) (msec) (%) ----------- ----- ------ -------- -------- -------- -------- ------ nanosleep 1 0 1000.091 1000.091 1000.091 1000.091 0.00% mmap 8 0 0.045 0.005 0.006 0.008 7.09% mprotect 4 0 0.028 0.005 0.007 0.009 11.38% openat 3 0 0.021 0.005 0.007 0.009 14.07% munmap 1 0 0.017 0.017 0.017 0.017 0.00% brk 4 0 0.010 0.001 0.002 0.004 23.15% read 4 0 0.009 0.002 0.002 0.003 8.13% close 5 0 0.008 0.001 0.002 0.002 10.83% fstat 3 0 0.006 0.002 0.002 0.002 6.97% access 1 1 0.006 0.006 0.006 0.006 0.00% lseek 3 0 0.005 0.001 0.002 0.002 7.37% arch_prctl 2 1 0.004 0.001 0.002 0.002 17.64% execve 1 0 0.000 0.000 0.000 0.000 0.00% # perf trace -e access,arch_prctl -S sleep 1 0.000 ( 0.006 ms): sleep/19503 arch_prctl(option: 0x3001, arg2: 0x7fff165996b0) = -1 EINVAL (Invalid argument) 0.024 ( 0.006 ms): sleep/19503 access(filename: 0x2177e510, mode: R) = -1 ENOENT (No such file or directory) 0.136 ( 0.002 ms): sleep/19503 arch_prctl(option: SET_FS, arg2: 0x7f9421737580) = 0 Summary of events: sleep (19503), 6 events, 50.0% syscall calls errors total min avg max stddev (msec) (msec) (msec) (msec) (%) ---------- ----- ------ ------ ------ ------ ------ ------ arch_prctl 2 1 0.008 0.002 0.004 0.006 57.22% access 1 1 0.006 0.006 0.006 0.006 0.00% # - Introduce --errno-summary, to drill down a bit more in the errno stats: # perf trace --errno-summary -e access,arch_prctl -S sleep 1 0.000 ( 0.006 ms): sleep/5587 arch_prctl(option: 0x3001, arg2: 0x7ffd6ba6aa00) = -1 EINVAL (Invalid argument) 0.028 ( 0.007 ms): sleep/5587 access(filename: 0xb83d9510, mode: R) = -1 ENOENT (No such file or directory) 0.172 ( 0.003 ms): sleep/5587 arch_prctl(option: SET_FS, arg2: 0x7f45b8392580) = 0 Summary of events: sleep (5587), 6 events, 50.0% syscall calls errors total min avg max stddev (msec) (msec) (msec) (msec) (%) ---------- ----- ------ ------ ------ ------ ------ ------ arch_prctl 2 1 0.009 0.003 0.005 0.006 38.90% EINVAL: 1 access 1 1 0.007 0.007 0.007 0.007 0.00% ENOENT: 1 # - Filter own pid to avoid a feedback look in 'perf trace record -a' - Add the glue for the auto generated x86 IRQ vector array. - Show error message when not finding a field used in a filter expression # perf trace --max-events=4 -e syscalls:sys_enter_write --filter="cnt>32767" Failed to set filter "(cnt>32767) && (common_pid != 19938 && common_pid != 8922)" on event syscalls:sys_enter_write with 22 (Invalid argument) # # perf trace --max-events=4 -e syscalls:sys_enter_write --filter="count>32767" 0.000 python3.5/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0dc53600, count: 172086) 12.641 python3.5.post/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0db63660, count: 75994) 27.738 python3.5.post/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0db4b1e0, count: 41635) 136.070 python3.5.post/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0dbab510, count: 62232) # - Add a generator for x86's IRQ vectors -> strings - Introduce stroul() (string -> number) methods for the strarray and strarrays classes, also strtoul_flags, allowing to go from both strings and or-ed strings to numbers, allowing things like: # perf trace -e syscalls:sys_enter_mmap --filter="flags==DENYWRITE|PRIVATE|FIXED" sleep 1 0.000 sleep/22588 syscalls:sys_enter_mmap(addr: 0x7f42d2aa5000, len: 1363968, prot: READ|EXEC, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x22000) 0.011 sleep/22588 syscalls:sys_enter_mmap(addr: 0x7f42d2bf2000, len: 311296, prot: READ, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x16f000) 0.015 sleep/22588 syscalls:sys_enter_mmap(addr: 0x7f42d2c3f000, len: 24576, prot: READ|WRITE, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x1bb000) # Allowing to narrow down from the complete set of mmap calls for that workload: # perf trace -e syscalls:sys_enter_mmap sleep 1 0.000 sleep/22695 syscalls:sys_enter_mmap(len: 134773, prot: READ, flags: PRIVATE, fd: 3) 0.041 sleep/22695 syscalls:sys_enter_mmap(len: 8192, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS) 0.053 sleep/22695 syscalls:sys_enter_mmap(len: 1857472, prot: READ, flags: PRIVATE|DENYWRITE, fd: 3) 0.069 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd23ffb6000, len: 1363968, prot: READ|EXEC, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x22000) 0.077 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd240103000, len: 311296, prot: READ, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x16f000) 0.083 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd240150000, len: 24576, prot: READ|WRITE, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x1bb000) 0.095 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd240156000, len: 14272, prot: READ|WRITE, flags: PRIVATE|FIXED|ANONYMOUS) 0.339 sleep/22695 syscalls:sys_enter_mmap(len: 217750512, prot: READ, flags: PRIVATE, fd: 3) # Works with all targets, so, for system wide, looking at who calls mmap with flags set to just "PRIVATE": # perf trace --max-events=5 -e syscalls:sys_enter_mmap --filter="flags==PRIVATE" 0.000 pool/2242 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 14) 0.050 pool/2242 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 14) 0.062 pool/2242 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 14) 0.145 goa-identity-s/2240 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 18) 0.183 goa-identity-s/2240 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 18) # # perf trace --max-events=2 -e syscalls:sys_enter_lseek --filter="whence==SET && offset != 0" 0.000 Cache2 I/O/12047 syscalls:sys_enter_lseek(fd: 277, offset: 43, whence: SET) 1142.070 mozStorage #5/12302 syscalls:sys_enter_lseek(fd: 44</home/acme/.mozilla/firefox/ina67tev.default/cookies.sqlite-wal>, offset: 393536, whence: SET) # perf annotate: - Fix objdump --no-show-raw-insn flag to work with goth gcc and clang. - Streamline objdump execution, preserving the right error codes for better reporting to user. perf report: - Add warning when libunwind not compiled in. perf stat: Jin Yao: - Support --all-kernel/--all-user, to match options available in 'perf record', asking that all the events specified work just with kernel or user events. perf list: Jin Yao: - Hide deprecated events by default, allow showing them with --deprecated. libbperf: Jiri Olsa: - Allow to build with -ltcmalloc. - Finish mmap interface, getting more stuff from tools/perf while adding abstractions to avoid pulling too much stuff, to get libperf to grow as tools needs things like auxtrace, etc. perf scripting engines: Steven Rostedt (VMware): - Iterate on tep event arrays directly, fixing script generation with '-g python' when having multiple tracepoints in a perf.data file. core: - Allow to build with -ltcmalloc. perf test: Leo Yan: - Report failure for mmap events. - Avoid infinite loop for task exit case. - Remove needless headers for bp_account test. - Add dedicated checking helper is_supported(). - Disable bp_signal testing for arm64. Vendor events: arm64: John Garry: - Fix Hisi hip08 DDRC PMU eventname. - Add some missing events for Hisi hip08 DDRC, L3C and HHA PMUs. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (2): perf script: Fix --reltime with --time perf evlist: Fix fix for freed id arrays Arnaldo Carvalho de Melo (25): perf trace: Add syscall failure stats to -s/--summary and -S/--with-summary perf trace: Introduce --errno-summary perf string: Export asprintf__tp_filter_pids() perf trace: Filter own pid to avoid a feedback look in 'perf trace record -a' perf trace: Support tracepoint dynamic char arrays tools arch x86: Grab a copy of the file containing the IRQ vector defines libbeauty: Add a generator for x86's IRQ vectors -> strings libbeauty: Hook up the x86 irq_vectors table generator libbeauty: Add a strarray__scnprintf_suffix() method perf trace beauty: Add the glue for the autogenerated x86 IRQ vector array perf trace: Hook the 'vec' tracepoint argument with the x86 IRQ vectors scnprintf/strtoul perf trace: Show error message when not finding a field used in a filter expression perf trace: Introduce accessors to trace specific evsel->priv perf trace: Hide evsel->access further, simplify code perf trace: Introduce 'struct evsel__trace' for evsel->priv needs perf trace: Initialize evsel_trace->fmt for syscalls:sys_enter_* tracepoints libbeauty: Introduce syscall_arg__strtoul_strarray() perf trace: Honour --max-events in processing syscalls:sys_enter_* perf trace: Pass a syscall_arg to syscall_arg_fmt->strtoul() libbeauty: Introduce syscall_arg__strtoul_strarrays() perf trace: Use strtoul for the fcntl 'cmd' argument libbeauty: Make the mmap_flags strarray visible outside of its beautifier libbeauty: Introduce strarray__strtoul_flags() perf trace: Wire up strarray__strtoul_flags() perf trace: Use STUL_STRARRAY_FLAGS with mmap Ian Rogers (5): perf annotate: Avoid reallocation in objdump parsing perf annotate: Use libsubcmd's run-command.h to fork objdump perf annotate: Don't pipe objdump output through 'grep' command perf annotate: Don't pipe objdump output through 'expand' command perf annotate: Fix objdump --no-show-raw-insn flag Jin Yao (3): perf report: Add warning when libunwind not compiled in perf stat: Support --all-kernel/--all-user perf list: Hide deprecated events by default Jiri Olsa (10): perf tools: Allow to build with -ltcmalloc libperf: Introduce perf_evlist__for_each_mmap() libperf: Move mmap allocation to perf_evlist__mmap_ops::get libperf: Move mask setup to perf_evlist__mmap_ops() libperf: Link static tests with libapi.a libperf: Add tests_mmap_thread test libperf: Add tests_mmap_cpus test libperf: Keep count of failed tests libperf: Do not export perf_evsel__init()/perf_evlist__init() libperf: Add pr_err() macro John Garry (4): perf vendor events arm64: Fix Hisi hip08 DDRC PMU eventname perf vendor events arm64: Add some missing events for Hisi hip08 DDRC PMU perf vendor events arm64: Add some missing events for Hisi hip08 L3C PMU perf vendor events arm64: Add some missing events for Hisi hip08 HHA PMU Leo Yan (5): perf test: Report failure for mmap events perf test: Avoid infinite loop for task exit case perf tests: Remove needless headers for bp_account perf tests bp_account: Add dedicated checking helper is_supported() perf tests: Disable bp_signal testing for arm64 Steven Rostedt (VMware) (2): perf scripting engines: Iterate on tep event arrays directly perf tools: Remove unused trace_find_next_event() Thomas Richter (1): perf jvmti: Link against tools/lib/ctype.h to have weak strlcpy() tools/arch/x86/include/asm/irq_vectors.h | 146 +++++++ tools/perf/Documentation/perf-list.txt | 3 + tools/perf/Documentation/perf-stat.txt | 6 + tools/perf/Documentation/perf-trace.txt | 4 + tools/perf/Makefile.config | 5 + tools/perf/Makefile.perf | 10 + tools/perf/builtin-list.c | 14 +- tools/perf/builtin-report.c | 7 + tools/perf/builtin-script.c | 5 +- tools/perf/builtin-stat.c | 6 + tools/perf/builtin-trace.c | 420 ++++++++++++++++----- tools/perf/check-headers.sh | 1 + tools/perf/jvmti/Build | 6 +- tools/perf/lib/Makefile | 1 + tools/perf/lib/evlist.c | 71 +++- tools/perf/lib/include/internal/evlist.h | 3 + tools/perf/lib/include/internal/evsel.h | 1 + tools/perf/lib/include/internal/mmap.h | 5 +- tools/perf/lib/include/internal/tests.h | 20 +- tools/perf/lib/include/perf/core.h | 1 + tools/perf/lib/include/perf/evlist.h | 10 +- tools/perf/lib/include/perf/evsel.h | 2 - tools/perf/lib/internal.h | 3 + tools/perf/lib/libperf.map | 3 +- tools/perf/lib/mmap.c | 6 +- tools/perf/lib/tests/Makefile | 6 +- tools/perf/lib/tests/test-cpumap.c | 2 +- tools/perf/lib/tests/test-evlist.c | 219 ++++++++++- tools/perf/lib/tests/test-evsel.c | 2 +- tools/perf/lib/tests/test-threadmap.c | 2 +- .../arch/arm64/hisilicon/hip08/uncore-ddrc.json | 16 +- .../arch/arm64/hisilicon/hip08/uncore-hha.json | 23 +- .../arch/arm64/hisilicon/hip08/uncore-l3c.json | 56 +++ tools/perf/pmu-events/jevents.c | 26 +- tools/perf/pmu-events/jevents.h | 3 +- tools/perf/pmu-events/pmu-events.h | 1 + tools/perf/tests/bp_account.c | 20 +- tools/perf/tests/bp_signal.c | 15 +- tools/perf/tests/builtin-test.c | 2 +- tools/perf/tests/task-exit.c | 9 + tools/perf/tests/tests.h | 1 + tools/perf/trace/beauty/beauty.h | 19 + tools/perf/trace/beauty/mmap.c | 4 +- tools/perf/trace/beauty/tracepoints/Build | 1 + .../trace/beauty/tracepoints/x86_irq_vectors.c | 29 ++ .../trace/beauty/tracepoints/x86_irq_vectors.sh | 27 ++ tools/perf/util/annotate.c | 196 ++++++---- tools/perf/util/evlist.c | 34 +- tools/perf/util/parse-events.c | 4 +- tools/perf/util/parse-events.h | 2 +- tools/perf/util/pmu.c | 17 +- tools/perf/util/pmu.h | 4 +- .../perf/util/scripting-engines/trace-event-perl.c | 8 +- .../util/scripting-engines/trace-event-python.c | 9 +- tools/perf/util/stat.c | 10 + tools/perf/util/stat.h | 2 + tools/perf/util/string2.h | 3 + tools/perf/util/time-utils.c | 27 +- tools/perf/util/time-utils.h | 5 + tools/perf/util/trace-event-parse.c | 31 -- tools/perf/util/trace-event.h | 2 - 61 files changed, 1307 insertions(+), 289 deletions(-) create mode 100644 tools/arch/x86/include/asm/irq_vectors.h create mode 100644 tools/perf/trace/beauty/tracepoints/x86_irq_vectors.c create mode 100755 tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh 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.4.0-rc3.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 9.2.0) 9.2.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 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190930 gcc-9-branch@276275, clang version 8.0.0 (tags/RELEASE_800/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-8) 9.2.1 20190909, clang version 8.0.1-3+b1 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-19) 8.3.0 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 26 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) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:32 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 42 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 43 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 44 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 45 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) 46 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 8.0.1 (tags/RELEASE_801/final) 47 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) 48 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) 49 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 50 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 8.0.1 (tags/RELEASE_801/final 366581) 51 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 52 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) 53 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) 54 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) 55 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) 56 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) 57 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 63 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) 64 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 74 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) 75 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 76 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 77 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 78 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 79 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.2.18-200.fc30.x86_64 #1 SMP Tue Oct 1 13:14:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 27198a893ba0 perf trace: Use STUL_STRARRAY_FLAGS with mmap # perf version --build-options perf version 5.4.rc3.g27198a893ba0 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_with_babeltrace_O: make LIBBABELTRACE=1 make_perf_o_O: make perf.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_util_map_o_O: make util/map.o make_no_gtk2_O: make NO_GTK2=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_pure_O: make make_no_libbpf_O: make NO_LIBBPF=1 make_clean_all_O: make clean all make_install_bin_O: make install-bin make_no_demangle_O: make NO_DEMANGLE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_debug_O: make DEBUG=1 make_no_newt_O: make NO_NEWT=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_tags_O: make tags 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_doc_O: make doc make_no_backtrace_O: make NO_BACKTRACE=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_slang_O: make NO_SLANG=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_help_O: make help make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_no_libelf_O: make NO_LIBELF=1 make_cscope_O: make cscope make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_install_O: make install make_with_clangllvm_O: make LIBCLANGLLVM=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-10-21 13:37 Arnaldo Carvalho de Melo @ 2019-10-21 23:16 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-10-21 23:16 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Andi Kleen, Brendan Gregg, Daniel Bristot de Oliveira, Ian Rogers, Jin Yao, John Garry, Leo Yan, Steven Rostedt, Thomas Richter, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 39b656ee9f2ce41eb969c86525f9a2a63fefac5b: > > Merge tag 'perf-core-for-mingo-5.5-20191011' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-10-15 07:19:55 +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.5-20191021 > > for you to fetch changes up to 27198a893ba074407e7a87e346252b3e6fab454f: > > perf trace: Use STUL_STRARRAY_FLAGS with mmap (2019-10-19 15:35:02 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf trace: > > - Add syscall failure stats to -s/--summary and -S/--with-summary, also works in > combination with specifying just a set of syscalls, see below first with > -s/--summary, then with -S/--with-summary just for the syscalls we saw failing > with -s: > > # perf trace -s sleep 1 > > Summary of events: > > sleep (16218), 80 events, 93.0% > > syscall calls errors total min avg max stddev > (msec) (msec) (msec) (msec) (%) > ----------- ----- ------ -------- -------- -------- -------- ------ > nanosleep 1 0 1000.091 1000.091 1000.091 1000.091 0.00% > mmap 8 0 0.045 0.005 0.006 0.008 7.09% > mprotect 4 0 0.028 0.005 0.007 0.009 11.38% > openat 3 0 0.021 0.005 0.007 0.009 14.07% > munmap 1 0 0.017 0.017 0.017 0.017 0.00% > brk 4 0 0.010 0.001 0.002 0.004 23.15% > read 4 0 0.009 0.002 0.002 0.003 8.13% > close 5 0 0.008 0.001 0.002 0.002 10.83% > fstat 3 0 0.006 0.002 0.002 0.002 6.97% > access 1 1 0.006 0.006 0.006 0.006 0.00% > lseek 3 0 0.005 0.001 0.002 0.002 7.37% > arch_prctl 2 1 0.004 0.001 0.002 0.002 17.64% > execve 1 0 0.000 0.000 0.000 0.000 0.00% > > # perf trace -e access,arch_prctl -S sleep 1 > 0.000 ( 0.006 ms): sleep/19503 arch_prctl(option: 0x3001, arg2: 0x7fff165996b0) = -1 EINVAL (Invalid argument) > 0.024 ( 0.006 ms): sleep/19503 access(filename: 0x2177e510, mode: R) = -1 ENOENT (No such file or directory) > 0.136 ( 0.002 ms): sleep/19503 arch_prctl(option: SET_FS, arg2: 0x7f9421737580) = 0 > > Summary of events: > > sleep (19503), 6 events, 50.0% > > syscall calls errors total min avg max stddev > (msec) (msec) (msec) (msec) (%) > ---------- ----- ------ ------ ------ ------ ------ ------ > arch_prctl 2 1 0.008 0.002 0.004 0.006 57.22% > access 1 1 0.006 0.006 0.006 0.006 0.00% > > # > > - Introduce --errno-summary, to drill down a bit more in the errno stats: > > # perf trace --errno-summary -e access,arch_prctl -S sleep 1 > 0.000 ( 0.006 ms): sleep/5587 arch_prctl(option: 0x3001, arg2: 0x7ffd6ba6aa00) = -1 EINVAL (Invalid argument) > 0.028 ( 0.007 ms): sleep/5587 access(filename: 0xb83d9510, mode: R) = -1 ENOENT (No such file or directory) > 0.172 ( 0.003 ms): sleep/5587 arch_prctl(option: SET_FS, arg2: 0x7f45b8392580) = 0 > > Summary of events: > > sleep (5587), 6 events, 50.0% > > syscall calls errors total min avg max stddev > (msec) (msec) (msec) (msec) (%) > ---------- ----- ------ ------ ------ ------ ------ ------ > arch_prctl 2 1 0.009 0.003 0.005 0.006 38.90% > EINVAL: 1 > access 1 1 0.007 0.007 0.007 0.007 0.00% > ENOENT: 1 > # > > - Filter own pid to avoid a feedback look in 'perf trace record -a' > > - Add the glue for the auto generated x86 IRQ vector array. > > - Show error message when not finding a field used in a filter expression > > # perf trace --max-events=4 -e syscalls:sys_enter_write --filter="cnt>32767" > Failed to set filter "(cnt>32767) && (common_pid != 19938 && common_pid != 8922)" on event syscalls:sys_enter_write with 22 (Invalid argument) > # > # perf trace --max-events=4 -e syscalls:sys_enter_write --filter="count>32767" > 0.000 python3.5/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0dc53600, count: 172086) > 12.641 python3.5.post/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0db63660, count: 75994) > 27.738 python3.5.post/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0db4b1e0, count: 41635) > 136.070 python3.5.post/17535 syscalls:sys_enter_write(fd: 3, buf: 0x564b0dbab510, count: 62232) > # > > - Add a generator for x86's IRQ vectors -> strings > > - Introduce stroul() (string -> number) methods for the strarray and > strarrays classes, also strtoul_flags, allowing to go from both strings > and or-ed strings to numbers, allowing things like: > > # perf trace -e syscalls:sys_enter_mmap --filter="flags==DENYWRITE|PRIVATE|FIXED" sleep 1 > 0.000 sleep/22588 syscalls:sys_enter_mmap(addr: 0x7f42d2aa5000, len: 1363968, prot: READ|EXEC, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x22000) > 0.011 sleep/22588 syscalls:sys_enter_mmap(addr: 0x7f42d2bf2000, len: 311296, prot: READ, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x16f000) > 0.015 sleep/22588 syscalls:sys_enter_mmap(addr: 0x7f42d2c3f000, len: 24576, prot: READ|WRITE, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x1bb000) > # > > Allowing to narrow down from the complete set of mmap calls for that workload: > > # perf trace -e syscalls:sys_enter_mmap sleep 1 > 0.000 sleep/22695 syscalls:sys_enter_mmap(len: 134773, prot: READ, flags: PRIVATE, fd: 3) > 0.041 sleep/22695 syscalls:sys_enter_mmap(len: 8192, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS) > 0.053 sleep/22695 syscalls:sys_enter_mmap(len: 1857472, prot: READ, flags: PRIVATE|DENYWRITE, fd: 3) > 0.069 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd23ffb6000, len: 1363968, prot: READ|EXEC, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x22000) > 0.077 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd240103000, len: 311296, prot: READ, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x16f000) > 0.083 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd240150000, len: 24576, prot: READ|WRITE, flags: PRIVATE|FIXED|DENYWRITE, fd: 3, off: 0x1bb000) > 0.095 sleep/22695 syscalls:sys_enter_mmap(addr: 0x7fd240156000, len: 14272, prot: READ|WRITE, flags: PRIVATE|FIXED|ANONYMOUS) > 0.339 sleep/22695 syscalls:sys_enter_mmap(len: 217750512, prot: READ, flags: PRIVATE, fd: 3) > # > > Works with all targets, so, for system wide, looking at who calls mmap with flags set to just "PRIVATE": > > # perf trace --max-events=5 -e syscalls:sys_enter_mmap --filter="flags==PRIVATE" > 0.000 pool/2242 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 14) > 0.050 pool/2242 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 14) > 0.062 pool/2242 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 14) > 0.145 goa-identity-s/2240 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 18) > 0.183 goa-identity-s/2240 syscalls:sys_enter_mmap(len: 756, prot: READ, flags: PRIVATE, fd: 18) > # > > # perf trace --max-events=2 -e syscalls:sys_enter_lseek --filter="whence==SET && offset != 0" > 0.000 Cache2 I/O/12047 syscalls:sys_enter_lseek(fd: 277, offset: 43, whence: SET) > 1142.070 mozStorage #5/12302 syscalls:sys_enter_lseek(fd: 44</home/acme/.mozilla/firefox/ina67tev.default/cookies.sqlite-wal>, offset: 393536, whence: SET) > # > > perf annotate: > > - Fix objdump --no-show-raw-insn flag to work with goth gcc and clang. > > - Streamline objdump execution, preserving the right error codes for better > reporting to user. > > perf report: > > - Add warning when libunwind not compiled in. > > perf stat: > > Jin Yao: > > - Support --all-kernel/--all-user, to match options available in 'perf record', > asking that all the events specified work just with kernel or user events. > > perf list: > > Jin Yao: > > - Hide deprecated events by default, allow showing them with --deprecated. > > libbperf: > > Jiri Olsa: > > - Allow to build with -ltcmalloc. > > - Finish mmap interface, getting more stuff from tools/perf while adding > abstractions to avoid pulling too much stuff, to get libperf to grow as > tools needs things like auxtrace, etc. > > perf scripting engines: > > Steven Rostedt (VMware): > > - Iterate on tep event arrays directly, fixing script generation with > '-g python' when having multiple tracepoints in a perf.data file. > > core: > > - Allow to build with -ltcmalloc. > > perf test: > > Leo Yan: > > - Report failure for mmap events. > > - Avoid infinite loop for task exit case. > > - Remove needless headers for bp_account test. > > - Add dedicated checking helper is_supported(). > > - Disable bp_signal testing for arm64. > > Vendor events: > > arm64: > > John Garry: > > - Fix Hisi hip08 DDRC PMU eventname. > > - Add some missing events for Hisi hip08 DDRC, L3C and HHA PMUs. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (2): > perf script: Fix --reltime with --time > perf evlist: Fix fix for freed id arrays > > Arnaldo Carvalho de Melo (25): > perf trace: Add syscall failure stats to -s/--summary and -S/--with-summary > perf trace: Introduce --errno-summary > perf string: Export asprintf__tp_filter_pids() > perf trace: Filter own pid to avoid a feedback look in 'perf trace record -a' > perf trace: Support tracepoint dynamic char arrays > tools arch x86: Grab a copy of the file containing the IRQ vector defines > libbeauty: Add a generator for x86's IRQ vectors -> strings > libbeauty: Hook up the x86 irq_vectors table generator > libbeauty: Add a strarray__scnprintf_suffix() method > perf trace beauty: Add the glue for the autogenerated x86 IRQ vector array > perf trace: Hook the 'vec' tracepoint argument with the x86 IRQ vectors scnprintf/strtoul > perf trace: Show error message when not finding a field used in a filter expression > perf trace: Introduce accessors to trace specific evsel->priv > perf trace: Hide evsel->access further, simplify code > perf trace: Introduce 'struct evsel__trace' for evsel->priv needs > perf trace: Initialize evsel_trace->fmt for syscalls:sys_enter_* tracepoints > libbeauty: Introduce syscall_arg__strtoul_strarray() > perf trace: Honour --max-events in processing syscalls:sys_enter_* > perf trace: Pass a syscall_arg to syscall_arg_fmt->strtoul() > libbeauty: Introduce syscall_arg__strtoul_strarrays() > perf trace: Use strtoul for the fcntl 'cmd' argument > libbeauty: Make the mmap_flags strarray visible outside of its beautifier > libbeauty: Introduce strarray__strtoul_flags() > perf trace: Wire up strarray__strtoul_flags() > perf trace: Use STUL_STRARRAY_FLAGS with mmap > > Ian Rogers (5): > perf annotate: Avoid reallocation in objdump parsing > perf annotate: Use libsubcmd's run-command.h to fork objdump > perf annotate: Don't pipe objdump output through 'grep' command > perf annotate: Don't pipe objdump output through 'expand' command > perf annotate: Fix objdump --no-show-raw-insn flag > > Jin Yao (3): > perf report: Add warning when libunwind not compiled in > perf stat: Support --all-kernel/--all-user > perf list: Hide deprecated events by default > > Jiri Olsa (10): > perf tools: Allow to build with -ltcmalloc > libperf: Introduce perf_evlist__for_each_mmap() > libperf: Move mmap allocation to perf_evlist__mmap_ops::get > libperf: Move mask setup to perf_evlist__mmap_ops() > libperf: Link static tests with libapi.a > libperf: Add tests_mmap_thread test > libperf: Add tests_mmap_cpus test > libperf: Keep count of failed tests > libperf: Do not export perf_evsel__init()/perf_evlist__init() > libperf: Add pr_err() macro > > John Garry (4): > perf vendor events arm64: Fix Hisi hip08 DDRC PMU eventname > perf vendor events arm64: Add some missing events for Hisi hip08 DDRC PMU > perf vendor events arm64: Add some missing events for Hisi hip08 L3C PMU > perf vendor events arm64: Add some missing events for Hisi hip08 HHA PMU > > Leo Yan (5): > perf test: Report failure for mmap events > perf test: Avoid infinite loop for task exit case > perf tests: Remove needless headers for bp_account > perf tests bp_account: Add dedicated checking helper is_supported() > perf tests: Disable bp_signal testing for arm64 > > Steven Rostedt (VMware) (2): > perf scripting engines: Iterate on tep event arrays directly > perf tools: Remove unused trace_find_next_event() > > Thomas Richter (1): > perf jvmti: Link against tools/lib/ctype.h to have weak strlcpy() > > tools/arch/x86/include/asm/irq_vectors.h | 146 +++++++ > tools/perf/Documentation/perf-list.txt | 3 + > tools/perf/Documentation/perf-stat.txt | 6 + > tools/perf/Documentation/perf-trace.txt | 4 + > tools/perf/Makefile.config | 5 + > tools/perf/Makefile.perf | 10 + > tools/perf/builtin-list.c | 14 +- > tools/perf/builtin-report.c | 7 + > tools/perf/builtin-script.c | 5 +- > tools/perf/builtin-stat.c | 6 + > tools/perf/builtin-trace.c | 420 ++++++++++++++++----- > tools/perf/check-headers.sh | 1 + > tools/perf/jvmti/Build | 6 +- > tools/perf/lib/Makefile | 1 + > tools/perf/lib/evlist.c | 71 +++- > tools/perf/lib/include/internal/evlist.h | 3 + > tools/perf/lib/include/internal/evsel.h | 1 + > tools/perf/lib/include/internal/mmap.h | 5 +- > tools/perf/lib/include/internal/tests.h | 20 +- > tools/perf/lib/include/perf/core.h | 1 + > tools/perf/lib/include/perf/evlist.h | 10 +- > tools/perf/lib/include/perf/evsel.h | 2 - > tools/perf/lib/internal.h | 3 + > tools/perf/lib/libperf.map | 3 +- > tools/perf/lib/mmap.c | 6 +- > tools/perf/lib/tests/Makefile | 6 +- > tools/perf/lib/tests/test-cpumap.c | 2 +- > tools/perf/lib/tests/test-evlist.c | 219 ++++++++++- > tools/perf/lib/tests/test-evsel.c | 2 +- > tools/perf/lib/tests/test-threadmap.c | 2 +- > .../arch/arm64/hisilicon/hip08/uncore-ddrc.json | 16 +- > .../arch/arm64/hisilicon/hip08/uncore-hha.json | 23 +- > .../arch/arm64/hisilicon/hip08/uncore-l3c.json | 56 +++ > tools/perf/pmu-events/jevents.c | 26 +- > tools/perf/pmu-events/jevents.h | 3 +- > tools/perf/pmu-events/pmu-events.h | 1 + > tools/perf/tests/bp_account.c | 20 +- > tools/perf/tests/bp_signal.c | 15 +- > tools/perf/tests/builtin-test.c | 2 +- > tools/perf/tests/task-exit.c | 9 + > tools/perf/tests/tests.h | 1 + > tools/perf/trace/beauty/beauty.h | 19 + > tools/perf/trace/beauty/mmap.c | 4 +- > tools/perf/trace/beauty/tracepoints/Build | 1 + > .../trace/beauty/tracepoints/x86_irq_vectors.c | 29 ++ > .../trace/beauty/tracepoints/x86_irq_vectors.sh | 27 ++ > tools/perf/util/annotate.c | 196 ++++++---- > tools/perf/util/evlist.c | 34 +- > tools/perf/util/parse-events.c | 4 +- > tools/perf/util/parse-events.h | 2 +- > tools/perf/util/pmu.c | 17 +- > tools/perf/util/pmu.h | 4 +- > .../perf/util/scripting-engines/trace-event-perl.c | 8 +- > .../util/scripting-engines/trace-event-python.c | 9 +- > tools/perf/util/stat.c | 10 + > tools/perf/util/stat.h | 2 + > tools/perf/util/string2.h | 3 + > tools/perf/util/time-utils.c | 27 +- > tools/perf/util/time-utils.h | 5 + > tools/perf/util/trace-event-parse.c | 31 -- > tools/perf/util/trace-event.h | 2 - > 61 files changed, 1307 insertions(+), 289 deletions(-) > create mode 100644 tools/arch/x86/include/asm/irq_vectors.h > create mode 100644 tools/perf/trace/beauty/tracepoints/x86_irq_vectors.c > create mode 100755 tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-10-11 20:04 Arnaldo Carvalho de Melo 2019-10-15 5:25 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-10-11 20:04 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Björn Töpel, Ian Rogers, Jin Yao, John Garry, KP Singh, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit f733c6b508bcaa3441ba1eacf16efb9abd47489f: perf/core: Fix inheritance of aux_output groups (2019-10-07 16:50:42 +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.5-20191011 for you to fetch changes up to cebf7d51a6c3babc4d0589da7aec0de1af0a5691: perf diff: Report noisy for cycles diff (2019-10-11 10:57:00 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf trace: Arnaldo Carvalho de Melo: - Reuse the strace-like syscall_arg_fmt->scnprintf() beautification routines (convert integer arguments into strings, like open flags, etc) in tracepoint arguments. For now the type based scnprintf routines (pid_t, umode_t, etc) and the ones based in well known arg name based ("fd", etc) gets associated with tracepoint args of that type. A tracepoint only arg, "msr", for the msr:{write,read}_msr gets added as an initial step. - Introduce syscall_arg_fmt->strtoul() methods to be the reverse operation of ->scnprintf(), i.e. to go from a string to an integer. - Implement --filter, just like in 'perf record', that affects the tracepoint events specied thus far in the command line, use the ->strtoul() methods to allow strings in tables associated with beautifiers to the integers the in-kernel tracepoint (eBPF later) filters expect, e.g.: # perf trace --max-events 1 -e sched:*ipi --filter="cpu==1 || cpu==2" 0.000 as/24630 sched:sched_wake_idle_without_ipi(cpu: 1) # # perf trace --max-events 1 --max-stack=32 -e msr:* --filter="msr==IA32_TSC_DEADLINE" 207.000 cc1/19963 msr:write_msr(msr: IA32_TSC_DEADLINE, val: 5442316760822) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) lapic_next_deadline ([kernel.kallsyms]) clockevents_program_event ([kernel.kallsyms]) hrtimer_interrupt ([kernel.kallsyms]) smp_apic_timer_interrupt ([kernel.kallsyms]) apic_timer_interrupt ([kernel.kallsyms]) [0x6ff66c] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x7047c3] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x707708] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) execute_one_pass (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x4f3d37] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x4f3d49] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) execute_pass_list (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) cgraph_node::expand (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x2625b4] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) symbol_table::finalize_compilation_unit (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x5ae8b9] (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) toplev::main (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) main (/usr/lib/gcc-cross/alpha-linux-gnu/8/cc1) [0x26b6a] (/usr/lib/x86_64-linux-gnu/libc-2.29.so) # # perf trace --max-events 8 -e msr:* --filter="msr==IA32_SPEC_CTRL" 0.000 :13281/13281 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) 0.063 migration/3/25 msr:write_msr(msr: IA32_SPEC_CTRL) 0.217 kworker/u16:1-/4826 msr:write_msr(msr: IA32_SPEC_CTRL) 0.687 rcu_sched/11 msr:write_msr(msr: IA32_SPEC_CTRL) 0.696 :13280/13280 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) 0.305 :13281/13281 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) 0.355 :13274/13274 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) 2.743 kworker/u16:0-/6711 msr:write_msr(msr: IA32_SPEC_CTRL) # # perf trace --max-events 8 --cpu 1 -e msr:* --filter="msr!=IA32_SPEC_CTRL && msr!=IA32_TSC_DEADLINE && msr != FS_BASE" 0.000 mtr-packet/30819 msr:write_msr(msr: 0x830, val: 68719479037) 0.096 :0/0 msr:read_msr(msr: IA32_TSC_ADJUST) 238.925 mtr-packet/30819 msr:write_msr(msr: 0x830, val: 8589936893) 511.010 :0/0 msr:write_msr(msr: 0x830, val: 68719479037) 1005.052 :0/0 msr:read_msr(msr: IA32_TSC_ADJUST) 1235.131 CPU 0/KVM/3750 msr:write_msr(msr: 0x830, val: 4294969595) 1235.195 CPU 0/KVM/3750 msr:read_msr(msr: IA32_SYSENTER_ESP, val: -2199023037952) 1235.201 CPU 0/KVM/3750 msr:read_msr(msr: IA32_APICBASE, val: 4276096000) # - Default to not using libtraceevent and its plugins for beautifying tracepoint arguments, since now we're reusing the strace-like beautifiers. Use --libtraceevent_print (using just --libtrace is unambiguous and can be used as a short hand) to go back to those beautifiers. This will help in the transition, as can be seen in some of the sched tracepoints that still need some work in the libbeauty based mode: # trace --no-inherit -e msr:*,*sleep,sched:* sleep 1 0.000 ( ): sched:sched_waking(comm: "trace", pid: 3319 (trace), prio: 120, success: 1) 0.006 ( ): sched:sched_wakeup(comm: "trace", pid: 3319 (trace), prio: 120, success: 1) 0.348 ( ): sched:sched_process_exec(filename: 140212596720100, pid: 3319 (sleep), old_pid: 3319 (sleep)) 0.490 ( ): msr:write_msr(msr: FS_BASE, val: 139631189321088) 0.670 ( ): nanosleep(rqtp: 0x7ffc52c23bc0) ... 0.674 ( ): sched:sched_stat_runtime(comm: "sleep", pid: 3319 (sleep), runtime: 659259, vruntime: 78942418342) 0.675 ( ): sched:sched_switch(prev_comm: "sleep", prev_pid: 3319 (sleep), prev_prio: 120, prev_state: 1, next_comm: "swapper/0", next_prio: 120) 1001.059 ( ): sched:sched_waking(comm: "sleep", pid: 3319 (sleep), prio: 120, success: 1) 1001.098 ( ): sched:sched_wakeup(comm: "sleep", pid: 3319 (sleep), prio: 120, success: 1) 0.670 (1000.504 ms): ... [continued]: nanosleep()) = 0 1001.456 ( ): sched:sched_process_exit(comm: "sleep", pid: 3319 (sleep), prio: 120) # trace --libtrace --no-inherit -e msr:*,*sleep,sched:* sleep 1 # trace --libtrace --no-inherit -e msr:*,*sleep,sched:* sleep 1 0.000 ( ): sched:sched_waking(comm=trace pid=3323 prio=120 target_cpu=000) 0.007 ( ): sched:sched_wakeup(comm=trace pid=3323 prio=120 target_cpu=000) 0.382 ( ): sched:sched_process_exec(filename=/usr/bin/sleep pid=3323 old_pid=3323) 0.525 ( ): msr:write_msr(c0000100, value 7f5d508a0580) 0.713 ( ): nanosleep(rqtp: 0x7fff487fb4a0) ... 0.717 ( ): sched:sched_stat_runtime(comm=sleep pid=3323 runtime=617722 [ns] vruntime=78957731636 [ns]) 0.719 ( ): sched:sched_switch(prev_comm=sleep prev_pid=3323 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120) 1001.117 ( ): sched:sched_waking(comm=sleep pid=3323 prio=120 target_cpu=000) 1001.157 ( ): sched:sched_wakeup(comm=sleep pid=3323 prio=120 target_cpu=000) 0.713 (1000.522 ms): ... [continued]: nanosleep()) = 0 1001.538 ( ): sched:sched_process_exit(comm=sleep pid=3323 prio=120) # - Make -v (verbose) mode be honoured for .perfconfig based trace.add_events, to help in diagnosing problems with building eBPF events (-e source.c). - When using eBPF syscall payload augmentation do not show strace-like syscalls when all the user specified was some tracepoint event, bringing the behaviour in line with that of when not using eBPF augmentation. Intel PT: exported-sql-viewer GUI: Adrian Hunter: - Add LookupModel, HBoxLayout, VBoxLayout, global time range calculations so as to add a time chart by CPU. perf script: Andi Kleen: - Allow --time (to specify a time span of interest) with --reltime perf diff: Jin Yao: - Report noise for cycles diff, i.e. a histogram + stddev. (timestamps relative to start). perf annotate: Arnaldo Carvalho de Melo: - Initialize env->cpuid when running in live mode (perf top), as it is used in some of the per arch annotation init routines. samples bpf: Björn Töpel: - Fixup fallout of using tools/perf/perf-sys. from outside tools/perf. Core: Ian Rogers: - Avoid 'sample_reg_masks' being const + weak, as this breaks with some compilers that constant-propagate from the weak symbol. libperf: - First part of moving the perf_mmap class from tools/perf to libperf. - Propagate CFLAGS to libperf from the tools/perf Makefile. Vendor events: John Garry: - Add entry in MAINTAINERS with reviewers for the for perf tool arm64 pmu-events files. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (6): perf scripts python: exported-sql-viewer.py: Add LookupModel() perf scripts python: exported-sql-viewer.py: Add HBoxLayout and VBoxLayout perf scripts python: exported-sql-viewer.py: Add global time range calculations perf scripts python: exported-sql-viewer.py: Tidy up Call tree call_time perf scripts python: exported-sql-viewer.py: Add ability for Call tree to open at a specified task and time perf scripts python: exported-sql-viewer.py: Add Time chart by CPU Andi Kleen (1): perf script: Allow --time with --reltime Arnaldo Carvalho de Melo (30): perf env: Add routine to read the env->cpuid from the running machine perf top: Initialize perf_env->cpuid, needed by the per arch annotation init routine perf evlist: Adopt __set_tracepoint_handlers method from perf_session perf trace: Make evlist__set_evsel_handler() affect just entries without a handler perf trace: Separate 'struct syscall_fmt' definition from syscall_fmts variable perf trace: Generalize the syscall_fmt find routines perf trace: Postpone parsing .perfconfig trace.add_events to after --verbose is processed perf trace augmented_syscalls: Do not show syscalls when none was asked for perf trace: Factor out the initialization of syscal_arg_fmt->scnprintf perf trace: Allocate an array of beautifiers for tracepoint args perf trace: Move some scnprintf methods from syscall to syscall_arg_fmt perf trace: Add the syscall_arg_fmt pointer to syscall_arg perf trace: Add array of chars scnprintf beautifier perf trace: Enclose all events argument lists with () perf trace: Allow choosing how to augment the tracepoint arguments tools arch x86: Grab a copy of the file containing the MSR numbers perf beauty: Make strarray's offset be u64 perf trace beauty: Add a x86 MSR cmd id->str table generator perf beauty: Hook up the x86 MSR table generator perf trace: Allow associating scnprintf routines with well known arg names perf trace beauty: Add the glue for the autogenerated MSR arrays perf trace: Associate the "msr" tracepoint arg name with x86_MSR__scnprintf() perf evlist: Factor out asprintf routine to build a tracepoint pid filter perf evlist: Introduce append_tp_filter() method perf evlist: Introduce append_tp_filter_pid() and append_tp_filter_pids() perf trace: Introduce --filter for tracepoint events perf trace: Add a strtoul() method to 'struct syscall_arg_fmt' perf trace: Introduce a strtoul() method for 'struct strarrays' perf trace: Expand strings in filters to integers perf beauty: Introduce strtoul() for x86 MSRs Björn Töpel (2): perf tools: Make usage of test_attr__* optional for perf-sys.h samples/bpf: fix build by setting HAVE_ATTR_TEST to zero Ian Rogers (1): perf tools: Avoid 'sample_reg_masks' being const + weak Jin Yao (1): perf diff: Report noisy for cycles diff Jiri Olsa (27): libperf: Add perf_mmap__init() function libperf: Add 'struct perf_mmap_param' libperf: Adopt perf_mmap__mmap_len() function from tools/perf libperf: Adopt perf_mmap__mmap() function from tools/perf libperf: Adopt perf_mmap__get() function from tools/perf libperf: Adopt perf_mmap__unmap() function from tools/perf libperf: Adopt perf_mmap__put() function from tools/perf perf tools: Use perf_mmap way to detect aux mmap libperf: Adopt perf_mmap__consume() function from tools/perf libperf: Adopt perf_mmap__read_init() from tools/perf libperf: Adopt perf_mmap__read_done() from tools/perf libperf: Adopt perf_mmap__read_event() from tools/perf libperf: Adopt perf_evlist__mmap()/munmap() from tools/perf libperf: Introduce perf_evlist__mmap_ops() libperf: Introduce perf_evlist_mmap_ops::idx callback libperf: Add perf_evlist_mmap_ops::get callback libperf: Introduce perf_evlist_mmap_ops::mmap callback perf tools: Introduce perf_evlist__mmap_cb_idx() perf evlist: Introduce perf_evlist__mmap_cb_get() perf evlist: Introduce perf_evlist__mmap_cb_mmap() perf evlist: Switch to libperf's mmap interface libperf: Centralize map refcnt setting libperf: Move the pollfd allocation from tools/perf to libperf libperf: Introduce perf_evlist__exit() libperf: Introduce perf_evlist__purge() libperf: Adopt perf_evlist__filter_pollfd() from tools/perf perf tools: Propagate CFLAGS to libperf John Garry (1): MAINTAINERS: Add entry for perf tool arm64 pmu-events files MAINTAINERS | 7 + samples/bpf/Makefile | 1 + tools/arch/x86/include/asm/msr-index.h | 857 ++++++++++++ tools/perf/Documentation/perf-config.txt | 5 + tools/perf/Documentation/perf-diff.txt | 5 + tools/perf/Documentation/perf-trace.txt | 10 + tools/perf/Makefile.config | 28 +- tools/perf/Makefile.perf | 11 +- tools/perf/arch/arm/util/Build | 2 + tools/perf/arch/arm/util/perf_regs.c | 6 + tools/perf/arch/arm64/util/Build | 1 + tools/perf/arch/arm64/util/perf_regs.c | 6 + tools/perf/arch/csky/util/Build | 2 + tools/perf/arch/csky/util/perf_regs.c | 6 + tools/perf/arch/riscv/util/Build | 2 + tools/perf/arch/riscv/util/perf_regs.c | 6 + tools/perf/arch/s390/util/Build | 1 + tools/perf/arch/s390/util/perf_regs.c | 6 + tools/perf/arch/x86/tests/perf-time-to-tsc.c | 9 +- tools/perf/builtin-diff.c | 143 ++ tools/perf/builtin-kvm.c | 11 +- tools/perf/builtin-record.c | 10 +- tools/perf/builtin-script.c | 5 - tools/perf/builtin-top.c | 20 +- tools/perf/builtin-trace.c | 593 +++++++-- tools/perf/check-headers.sh | 1 + tools/perf/lib/Build | 1 + tools/perf/lib/Makefile | 5 +- tools/perf/lib/core.c | 3 +- tools/perf/lib/evlist.c | 324 +++++ tools/perf/lib/include/internal/evlist.h | 40 + tools/perf/lib/include/internal/mmap.h | 44 +- tools/perf/lib/include/perf/core.h | 2 + tools/perf/lib/include/perf/evlist.h | 5 + tools/perf/lib/include/perf/mmap.h | 15 + tools/perf/lib/internal.h | 2 + tools/perf/lib/libperf.map | 7 + tools/perf/lib/mmap.c | 273 ++++ tools/perf/perf-sys.h | 6 +- tools/perf/scripts/python/exported-sql-viewer.py | 1555 +++++++++++++++++++++- tools/perf/tests/backward-ring-buffer.c | 7 +- tools/perf/tests/bpf.c | 7 +- tools/perf/tests/code-reading.c | 9 +- tools/perf/tests/keep-tracking.c | 9 +- tools/perf/tests/mmap-basic.c | 9 +- tools/perf/tests/openat-syscall-tp-fields.c | 9 +- tools/perf/tests/perf-record.c | 9 +- tools/perf/tests/sw-clock.c | 9 +- tools/perf/tests/switch-tracking.c | 9 +- tools/perf/tests/task-exit.c | 9 +- tools/perf/trace/beauty/Build | 1 + tools/perf/trace/beauty/beauty.h | 16 +- tools/perf/trace/beauty/tracepoints/Build | 1 + tools/perf/trace/beauty/tracepoints/x86_msr.c | 39 + tools/perf/trace/beauty/tracepoints/x86_msr.sh | 40 + tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 4 + tools/perf/util/annotate.h | 2 + tools/perf/util/env.c | 16 + tools/perf/util/env.h | 1 + tools/perf/util/evlist.c | 322 ++--- tools/perf/util/evlist.h | 12 + tools/perf/util/mmap.c | 260 +--- tools/perf/util/mmap.h | 28 +- tools/perf/util/parse-regs-options.c | 8 +- tools/perf/util/perf_regs.c | 4 - tools/perf/util/perf_regs.h | 4 +- tools/perf/util/python.c | 7 +- tools/perf/util/session.c | 29 - tools/perf/util/session.h | 6 +- tools/perf/util/sort.h | 4 + tools/perf/util/spark.c | 34 + tools/perf/util/spark.h | 8 + tools/perf/util/symbol.h | 2 + 74 files changed, 4266 insertions(+), 705 deletions(-) create mode 100644 tools/arch/x86/include/asm/msr-index.h create mode 100644 tools/perf/arch/arm/util/perf_regs.c create mode 100644 tools/perf/arch/arm64/util/perf_regs.c create mode 100644 tools/perf/arch/csky/util/perf_regs.c create mode 100644 tools/perf/arch/riscv/util/perf_regs.c create mode 100644 tools/perf/arch/s390/util/perf_regs.c create mode 100644 tools/perf/lib/include/perf/mmap.h create mode 100644 tools/perf/lib/mmap.c create mode 100644 tools/perf/trace/beauty/tracepoints/Build create mode 100644 tools/perf/trace/beauty/tracepoints/x86_msr.c create mode 100755 tools/perf/trace/beauty/tracepoints/x86_msr.sh create mode 100644 tools/perf/util/spark.c create mode 100644 tools/perf/util/spark.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.4.0-rc2.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 9.2.0) 9.2.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 centos:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3), clang version 7.0.1 (tags/RELEASE_701/final) 17 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190930 gcc-9-branch@276275, clang version 8.0.0 (tags/RELEASE_800/final) 18 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) 19 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 20 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental : Ok gcc (Debian 9.2.1-8) 9.2.1 20190909, clang version 8.0.1-3+b1 (tags/RELEASE_801/final) 22 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 24 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-19) 8.3.0 25 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 26 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) 27 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 28 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 29 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 30 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 31 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 32 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 33 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 34 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 35 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) 36 fedora:30 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc30) 37 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 39 fedora:31 : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc31) 40 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-1.fc32) 41 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 42 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 43 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 44 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) 45 manjaro:latest : Ok gcc (GCC) 9.2.0, clang version 8.0.1 (tags/RELEASE_801/final) 46 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) 47 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) 48 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 49 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.2.1 20190903 [gcc-9-branch revision 275330], clang version 8.0.1 (tags/RELEASE_801/final 366581) 50 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 51 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) 52 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) 53 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) 54 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) 55 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) 56 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 62 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) 63 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 73 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) 74 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 75 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 77 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 78 ubuntu:19.10 : Ok gcc (Ubuntu 9.2.1-8ubuntu1) 9.2.1 20190909, clang version 9.0.0-+rc5-1~exp1 (tags/RELEASE_900/rc5) # # uname -a Linux quaco 5.2.17-200.fc30.x86_64 #1 SMP Mon Sep 23 13:42:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 cebf7d51a6c3 perf diff: Report noisy for cycles diff # perf version --build-options perf version 5.4.rc2.g32fdc2ca7e2a 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_debug_O: make DEBUG=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_newt_O: make NO_NEWT=1 make_help_O: make help make_no_libbpf_O: make NO_LIBBPF=1 make_no_demangle_O: make NO_DEMANGLE=1 make_perf_o_O: make perf.o make_pure_O: make make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libelf_O: make NO_LIBELF=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_util_map_o_O: make util/map.o make_no_auxtrace_O: make NO_AUXTRACE=1 make_cscope_O: make cscope make_doc_O: make doc make_install_bin_O: make install-bin make_no_libperl_O: make NO_LIBPERL=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_install_O: make install make_tags_O: make tags make_no_slang_O: make NO_SLANG=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_gtk2_O: make NO_GTK2=1 make_clean_all_O: make clean all make_with_babeltrace_O: make LIBBABELTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libaudit_O: make NO_LIBAUDIT=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-10-11 20:04 Arnaldo Carvalho de Melo @ 2019-10-15 5:25 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-10-15 5:25 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Björn Töpel, Ian Rogers, Jin Yao, John Garry, KP Singh, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit f733c6b508bcaa3441ba1eacf16efb9abd47489f: > > perf/core: Fix inheritance of aux_output groups (2019-10-07 16:50:42 +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.5-20191011 > > for you to fetch changes up to cebf7d51a6c3babc4d0589da7aec0de1af0a5691: > > perf diff: Report noisy for cycles diff (2019-10-11 10:57:00 -0300) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-09-26 0:31 Arnaldo Carvalho de Melo 2019-09-26 5:55 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-09-26 0:31 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andi Kleen, Andreas Krebbel, Kim Phillips, Mamatha Inamdar, Stephane Eranian, Steven Rostedt, Thomas Richter, Tzvetomir Stoyanov, 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 2b32769700f857a8e608a8ee24080833889965b9: Merge tag 'perf-urgent-for-mingo-5.4-20190921' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2019-09-22 12:45:11 +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.5-20190925 for you to fetch changes up to d6840d87b2d148e19e244ad2b44d28ba07f437a0: perf parser: Remove needless include directives (2019-09-25 16:26:41 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf record: Stephane Eranian: - Fix priv level with branch sampling for paranoid=2, i.e. the kernel checks if perf_event_attr_attr.exclude_hv is set in addition to .exclude_kernel, so reset both to zero. Arnaldo Carvalho de Melo: - Don't warn about not being able to read kernel maps (kallsyms, etc) when kernel samples aren't being collected. perf list: Kim Phillips: - Allow plurals for metric, metricgroup., i.e.: $ perf list metrics was showing nothing, which is very confusing, make it work like: $ perf stat metric perf stat: Andi Kleen: - Free memory access/leaks detected via valgrind, related to metrics. Libraries: libperf: Jiri Olsa: - Move more stuff from tools/perf, this time a first stab at moving perf_mmap methods. libtracevent: Steven Rostedt (VMware): - Round up in tep_print_event() time precision. Tzvetomir Stoyanov (VMware): - Man pages for event print and related and plugins APIs. - Move traceevent plugins in its own subdirectory. Feature detection: Thomas Richter: - Add detection of java-11-openjdk-devel package, in addition to the older versions supported. Architecture specific: S/390: Thomas Richter (2): - Include JVMTI support for s390 Vendor events: AMD: Kim Phillips: - Add L3 cache events for Family 17h. - Remove redundant '['. PowerPC: Mamatha Inamdar: - Remove P8 HW events which are not supported. Cleanups: Arnaldo Carvalho de Melo: - Remove needless headers, add needed ones, move things around to reduce the headers dependency tree, speeding up builds by not doing needless compiles when unrelated stuff gets changed. - Ditch unused code that was dragging headers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (2): perf stat: Fix free memory access / memory leaks in metrics perf evlist: Fix access of freed id arrays Arnaldo Carvalho de Melo (12): perf record: Move restricted maps check to after a possible fallback to not collect kernel samples perf evlist: Adopt backwards ring buffer state enum libperf: Add missing 'struct xyarray' forward declaration perf tools: No need to include internal/lib.h from util/util.h libperf: Use sys/types.h to get ssize_t, not unistd.h perf copyfile: Move copyfile routines to separate files perf evsel: Remove need for symbol_conf in evsel_fprintf.c perf evsel: Introduce evsel_fprintf.h perf evlist: Remove unused perf_evlist__fprintf() method perf evsel: Move config terms to a separate header perf tools: Replace needless mmap.h with what is needed, event.h perf parser: Remove needless include directives Jiri Olsa (37): tools: Add missing stdio.h include to asm/bug.h header perf tools: Rename 'struct perf_mmap' to 'struct mmap' perf tools: Rename perf_evlist__mmap() to evlist__mmap() perf tools: Rename perf_evlist__munmap() to evlist__munmap() perf tools: Rename perf_evlist__alloc_mmap() to evlist__alloc_mmap() perf tools: Rename perf_evlist__exit() to evlist__exit() perf tools: Rename perf_evlist__purge() to evlist__purge() libperf: Link libapi.a in libperf.so libperf: Add perf_mmap struct libperf: Add 'mask' to struct perf_mmap libperf: Add 'fd' to struct perf_mmap libperf: Add 'cpu' to struct perf_mmap libperf: Add 'refcnt' to struct perf_mmap libperf: Add prev/start/end to struct perf_mmap libperf: Add 'overwrite' to 'struct perf_mmap' libperf: Add 'event_copy' to 'struct perf_mmap' libperf: Add 'flush' to 'struct perf_mmap' libperf: Move 'system_wide' from 'struct evsel' to 'struct perf_evsel' libperf: Move 'nr_mmaps' from 'struct evlist' to 'struct perf_evlist' libperf: Move 'mmap_len' from 'struct evlist' to 'struct perf_evlist' libperf: Move 'pollfd' from 'struct evlist' to 'struct perf_evlist' libperf: Move 'sample_id' from 'struct evsel' to 'struct perf_evsel' libperf: Move 'id' from 'struct evsel' to 'struct perf_evsel' libperf: Move 'ids' from 'struct evsel' to 'struct perf_evsel' libperf: Move 'heads' from 'struct evlist' to 'struct perf_evlist' libperf: Add perf_evsel__alloc_id/perf_evsel__free_id functions libperf: Add perf_evlist__first()/last() functions libperf: Add perf_evlist__read_format() function libperf: Add perf_evlist__id_add() function libperf: Add perf_evlist__id_add_fd() function libperf: Move 'page_size' global variable to libperf libperf: Add libperf dependency for tests targets libperf: Merge libperf_set_print() into libperf_init() libperf: Add libperf_init() call to the tests libperf: Add perf_evlist__alloc_pollfd() function libperf: Add perf_evlist__add_pollfd() function libperf: Add perf_evlist__poll() function Kim Phillips (4): perf vendor events amd: Add L3 cache events for Family 17h perf vendor events amd: Remove redundant '[' perf vendor events: Minor fixes to the README perf list: Allow plurals for metric, metricgroup Mamatha Inamdar (1): perf vendor events: Remove P8 HW events which are not supported Stephane Eranian (1): perf record: Fix priv level with branch sampling for paranoid=2 Steven Rostedt (VMware) (1): libtraceevent: Round up in tep_print_event() time precision Thomas Richter (2): perf jvmti: Include JVMTI support for s390 perf build: Add detection of java-11-openjdk-devel package Tzvetomir Stoyanov (2): libtraceevent: Man pages for libtraceevent event print related API libtraceevent: Man pages for tep plugins APIs Tzvetomir Stoyanov (VMware) (4): libtraceevent: Man pages fix, rename tep_ref_get() to tep_get_ref() libtraceevent: Man pages fix, changes in event printing APIs libtraceevent: Add tep_get_event() in event-parse.h libtraceevent: Move traceevent plugins in its own subdirectory tools/include/asm/bug.h | 1 + tools/lib/traceevent/Build | 11 - .../Documentation/libtraceevent-event_print.txt | 130 +++++++++ .../Documentation/libtraceevent-handle.txt | 8 +- .../Documentation/libtraceevent-plugins.txt | 99 +++++++ .../lib/traceevent/Documentation/libtraceevent.txt | 15 +- tools/lib/traceevent/Makefile | 94 ++----- tools/lib/traceevent/event-parse.c | 4 +- tools/lib/traceevent/event-parse.h | 2 + tools/lib/traceevent/plugins/Build | 10 + tools/lib/traceevent/plugins/Makefile | 222 ++++++++++++++++ .../lib/traceevent/{ => plugins}/plugin_cfg80211.c | 0 .../lib/traceevent/{ => plugins}/plugin_function.c | 0 .../lib/traceevent/{ => plugins}/plugin_hrtimer.c | 0 tools/lib/traceevent/{ => plugins}/plugin_jbd2.c | 0 tools/lib/traceevent/{ => plugins}/plugin_kmem.c | 0 tools/lib/traceevent/{ => plugins}/plugin_kvm.c | 0 .../lib/traceevent/{ => plugins}/plugin_mac80211.c | 0 .../traceevent/{ => plugins}/plugin_sched_switch.c | 0 tools/lib/traceevent/{ => plugins}/plugin_scsi.c | 0 tools/lib/traceevent/{ => plugins}/plugin_xen.c | 0 tools/perf/Makefile.config | 2 +- tools/perf/Makefile.perf | 4 +- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/arch/arm64/util/arm-spe.c | 6 +- tools/perf/arch/s390/Makefile | 1 + tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/arch/s390/util/machine.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 5 +- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 11 +- tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 9 +- tools/perf/arch/x86/util/intel-pt.c | 17 +- tools/perf/arch/x86/util/machine.c | 2 +- tools/perf/builtin-evlist.c | 1 + tools/perf/builtin-kvm.c | 13 +- tools/perf/builtin-list.c | 4 +- tools/perf/builtin-record.c | 102 +++---- tools/perf/builtin-sched.c | 3 +- tools/perf/builtin-script.c | 11 +- tools/perf/builtin-stat.c | 6 +- tools/perf/builtin-top.c | 22 +- tools/perf/builtin-trace.c | 17 +- tools/perf/lib/Makefile | 35 ++- tools/perf/lib/core.c | 13 +- tools/perf/lib/evlist.c | 124 +++++++++ tools/perf/lib/evsel.c | 30 +++ tools/perf/lib/include/internal/evlist.h | 33 +++ tools/perf/lib/include/internal/evsel.h | 33 +++ tools/perf/lib/include/internal/lib.h | 4 +- tools/perf/lib/include/internal/mmap.h | 32 +++ tools/perf/lib/include/perf/core.h | 2 +- tools/perf/lib/include/perf/evlist.h | 1 + tools/perf/lib/lib.c | 2 + tools/perf/lib/libperf.map | 3 +- tools/perf/lib/tests/test-cpumap.c | 10 + tools/perf/lib/tests/test-evlist.c | 10 + tools/perf/lib/tests/test-evsel.c | 10 + tools/perf/lib/tests/test-threadmap.c | 10 + tools/perf/perf.c | 13 +- tools/perf/pmu-events/README | 22 +- .../perf/pmu-events/arch/powerpc/power8/other.json | 24 -- .../perf/pmu-events/arch/x86/amdfam17h/cache.json | 42 +++ tools/perf/pmu-events/arch/x86/amdfam17h/core.json | 2 +- tools/perf/pmu-events/jevents.c | 1 + tools/perf/tests/backward-ring-buffer.c | 11 +- tools/perf/tests/bpf.c | 9 +- tools/perf/tests/code-reading.c | 11 +- tools/perf/tests/event-times.c | 14 +- tools/perf/tests/event_update.c | 6 +- tools/perf/tests/evsel-roundtrip-name.c | 2 +- tools/perf/tests/hists_cumulate.c | 2 +- tools/perf/tests/hists_link.c | 5 +- tools/perf/tests/hists_output.c | 2 +- tools/perf/tests/keep-tracking.c | 11 +- tools/perf/tests/mmap-basic.c | 5 +- tools/perf/tests/mmap-thread-lookup.c | 2 +- tools/perf/tests/openat-syscall-tp-fields.c | 11 +- tools/perf/tests/parse-events.c | 116 ++++---- tools/perf/tests/perf-record.c | 13 +- tools/perf/tests/sdt.c | 1 + tools/perf/tests/sw-clock.c | 5 +- tools/perf/tests/switch-tracking.c | 29 +- tools/perf/tests/task-exit.c | 9 +- tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/ui/browsers/hists.c | 6 +- tools/perf/ui/gtk/hists.c | 1 + tools/perf/util/Build | 2 + tools/perf/util/annotate.c | 1 + tools/perf/util/auxtrace.c | 8 +- tools/perf/util/auxtrace.h | 8 +- tools/perf/util/bpf-loader.c | 2 +- tools/perf/util/build-id.c | 3 +- tools/perf/util/copyfile.c | 144 ++++++++++ tools/perf/util/copyfile.h | 16 ++ tools/perf/util/cs-etm.c | 2 +- tools/perf/util/evlist.c | 295 ++++++--------------- tools/perf/util/evlist.h | 81 +++--- tools/perf/util/evsel.c | 204 ++------------ tools/perf/util/evsel.h | 121 +-------- tools/perf/util/evsel_config.h | 50 ++++ tools/perf/util/evsel_fprintf.c | 15 +- tools/perf/util/evsel_fprintf.h | 50 ++++ tools/perf/util/genelf.h | 3 + tools/perf/util/header.c | 29 +- tools/perf/util/intel-bts.c | 4 +- tools/perf/util/intel-pt.c | 10 +- tools/perf/util/jitdump.c | 2 +- tools/perf/util/machine.c | 1 + tools/perf/util/mmap.c | 185 ++++++------- tools/perf/util/mmap.h | 77 ++---- tools/perf/util/parse-events.c | 8 +- tools/perf/util/parse-events.y | 4 +- tools/perf/util/perf_event_attr_fprintf.c | 148 +++++++++++ tools/perf/util/python-ext-sources | 1 + tools/perf/util/python.c | 24 +- tools/perf/util/record.c | 6 +- tools/perf/util/session.c | 5 +- tools/perf/util/sort.c | 2 +- tools/perf/util/srccode.c | 2 +- tools/perf/util/stat-shadow.c | 4 +- tools/perf/util/stat.c | 2 +- tools/perf/util/symbol-elf.c | 2 +- tools/perf/util/synthetic-events.c | 20 +- tools/perf/util/top.c | 2 +- tools/perf/util/trace-event-info.c | 2 +- tools/perf/util/util.c | 136 ---------- tools/perf/util/util.h | 8 - 128 files changed, 1941 insertions(+), 1321 deletions(-) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt create mode 100644 tools/lib/traceevent/plugins/Build create mode 100644 tools/lib/traceevent/plugins/Makefile rename tools/lib/traceevent/{ => plugins}/plugin_cfg80211.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_function.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_hrtimer.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_jbd2.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_kmem.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_kvm.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_mac80211.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_sched_switch.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_scsi.c (100%) rename tools/lib/traceevent/{ => plugins}/plugin_xen.c (100%) create mode 100644 tools/perf/lib/include/internal/mmap.h create mode 100644 tools/perf/util/copyfile.c create mode 100644 tools/perf/util/copyfile.h create mode 100644 tools/perf/util/evsel_config.h create mode 100644 tools/perf/util/evsel_fprintf.h create mode 100644 tools/perf/util/perf_event_attr_fprintf.c 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.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-19) 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.2.1 20190827 (Red Hat 9.2.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.2.1 20190827 (Red Hat 9.2.1-1), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1), clang version 9.0.0 (Fedora 9.0.0-0.2.rc3.fc31) 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.2.17-200.fc30.x86_64 #1 SMP Mon Sep 23 13:42:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 d6840d87b2d1 perf parser: Remove needless include directives # perf version --build-options perf version 5.3.gd6840d87b2d1 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 | tee /wb/build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libbpf_O: make NO_LIBBPF=1 make_install_O: make install make_cscope_O: make cscope make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_perf_o_O: make perf.o make_no_libpython_O: make NO_LIBPYTHON=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_slang_O: make NO_SLANG=1 make_no_gtk2_O: make NO_GTK2=1 make_tags_O: make tags make_pure_O: make make_util_map_o_O: make util/map.o make_help_O: make help make_no_libnuma_O: make NO_LIBNUMA=1 make_install_prefix_O: make install prefix=/tmp/krava make_with_babeltrace_O: make LIBBABELTRACE=1 make_clean_all_O: make clean all make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_newt_O: make NO_NEWT=1 make_static_O: make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_doc_O: make doc make_no_libperl_O: make NO_LIBPERL=1 make_install_bin_O: make install-bin make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_debug_O: make DEBUG=1 make_no_libaudit_O: make NO_LIBAUDIT=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-09-26 0:31 Arnaldo Carvalho de Melo @ 2019-09-26 5:55 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-09-26 5:55 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Andi Kleen, Andreas Krebbel, Kim Phillips, Mamatha Inamdar, Stephane Eranian, Steven Rostedt, Thomas Richter, Tzvetomir Stoyanov, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 2b32769700f857a8e608a8ee24080833889965b9: > > Merge tag 'perf-urgent-for-mingo-5.4-20190921' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2019-09-22 12:45:11 +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.5-20190925 > > for you to fetch changes up to d6840d87b2d148e19e244ad2b44d28ba07f437a0: > > perf parser: Remove needless include directives (2019-09-25 16:26:41 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf record: > > Stephane Eranian: > > - Fix priv level with branch sampling for paranoid=2, i.e. the kernel checks > if perf_event_attr_attr.exclude_hv is set in addition to .exclude_kernel, > so reset both to zero. > > Arnaldo Carvalho de Melo: > > - Don't warn about not being able to read kernel maps (kallsyms, etc) when > kernel samples aren't being collected. > > perf list: > > Kim Phillips: > > - Allow plurals for metric, metricgroup., i.e.: > > $ perf list metrics > > was showing nothing, which is very confusing, make it work like: > > $ perf stat metric > > perf stat: > > Andi Kleen: > > - Free memory access/leaks detected via valgrind, related to metrics. > > Libraries: > > libperf: > > Jiri Olsa: > > - Move more stuff from tools/perf, this time a first stab at moving perf_mmap > methods. > > libtracevent: > > Steven Rostedt (VMware): > > - Round up in tep_print_event() time precision. > > Tzvetomir Stoyanov (VMware): > > - Man pages for event print and related and plugins APIs. > > - Move traceevent plugins in its own subdirectory. > > Feature detection: > > Thomas Richter: > > - Add detection of java-11-openjdk-devel package, in addition to the older > versions supported. > > Architecture specific: > > S/390: > > Thomas Richter (2): > > - Include JVMTI support for s390 > > Vendor events: > > AMD: > > Kim Phillips: > > - Add L3 cache events for Family 17h. > > - Remove redundant '['. > > PowerPC: > > Mamatha Inamdar: > > - Remove P8 HW events which are not supported. > > Cleanups: > > Arnaldo Carvalho de Melo: > > - Remove needless headers, add needed ones, move things around to reduce the > headers dependency tree, speeding up builds by not doing needless compiles > when unrelated stuff gets changed. > > - Ditch unused code that was dragging headers. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (2): > perf stat: Fix free memory access / memory leaks in metrics > perf evlist: Fix access of freed id arrays > > Arnaldo Carvalho de Melo (12): > perf record: Move restricted maps check to after a possible fallback to not collect kernel samples > perf evlist: Adopt backwards ring buffer state enum > libperf: Add missing 'struct xyarray' forward declaration > perf tools: No need to include internal/lib.h from util/util.h > libperf: Use sys/types.h to get ssize_t, not unistd.h > perf copyfile: Move copyfile routines to separate files > perf evsel: Remove need for symbol_conf in evsel_fprintf.c > perf evsel: Introduce evsel_fprintf.h > perf evlist: Remove unused perf_evlist__fprintf() method > perf evsel: Move config terms to a separate header > perf tools: Replace needless mmap.h with what is needed, event.h > perf parser: Remove needless include directives > > Jiri Olsa (37): > tools: Add missing stdio.h include to asm/bug.h header > perf tools: Rename 'struct perf_mmap' to 'struct mmap' > perf tools: Rename perf_evlist__mmap() to evlist__mmap() > perf tools: Rename perf_evlist__munmap() to evlist__munmap() > perf tools: Rename perf_evlist__alloc_mmap() to evlist__alloc_mmap() > perf tools: Rename perf_evlist__exit() to evlist__exit() > perf tools: Rename perf_evlist__purge() to evlist__purge() > libperf: Link libapi.a in libperf.so > libperf: Add perf_mmap struct > libperf: Add 'mask' to struct perf_mmap > libperf: Add 'fd' to struct perf_mmap > libperf: Add 'cpu' to struct perf_mmap > libperf: Add 'refcnt' to struct perf_mmap > libperf: Add prev/start/end to struct perf_mmap > libperf: Add 'overwrite' to 'struct perf_mmap' > libperf: Add 'event_copy' to 'struct perf_mmap' > libperf: Add 'flush' to 'struct perf_mmap' > libperf: Move 'system_wide' from 'struct evsel' to 'struct perf_evsel' > libperf: Move 'nr_mmaps' from 'struct evlist' to 'struct perf_evlist' > libperf: Move 'mmap_len' from 'struct evlist' to 'struct perf_evlist' > libperf: Move 'pollfd' from 'struct evlist' to 'struct perf_evlist' > libperf: Move 'sample_id' from 'struct evsel' to 'struct perf_evsel' > libperf: Move 'id' from 'struct evsel' to 'struct perf_evsel' > libperf: Move 'ids' from 'struct evsel' to 'struct perf_evsel' > libperf: Move 'heads' from 'struct evlist' to 'struct perf_evlist' > libperf: Add perf_evsel__alloc_id/perf_evsel__free_id functions > libperf: Add perf_evlist__first()/last() functions > libperf: Add perf_evlist__read_format() function > libperf: Add perf_evlist__id_add() function > libperf: Add perf_evlist__id_add_fd() function > libperf: Move 'page_size' global variable to libperf > libperf: Add libperf dependency for tests targets > libperf: Merge libperf_set_print() into libperf_init() > libperf: Add libperf_init() call to the tests > libperf: Add perf_evlist__alloc_pollfd() function > libperf: Add perf_evlist__add_pollfd() function > libperf: Add perf_evlist__poll() function > > Kim Phillips (4): > perf vendor events amd: Add L3 cache events for Family 17h > perf vendor events amd: Remove redundant '[' > perf vendor events: Minor fixes to the README > perf list: Allow plurals for metric, metricgroup > > Mamatha Inamdar (1): > perf vendor events: Remove P8 HW events which are not supported > > Stephane Eranian (1): > perf record: Fix priv level with branch sampling for paranoid=2 > > Steven Rostedt (VMware) (1): > libtraceevent: Round up in tep_print_event() time precision > > Thomas Richter (2): > perf jvmti: Include JVMTI support for s390 > perf build: Add detection of java-11-openjdk-devel package > > Tzvetomir Stoyanov (2): > libtraceevent: Man pages for libtraceevent event print related API > libtraceevent: Man pages for tep plugins APIs > > Tzvetomir Stoyanov (VMware) (4): > libtraceevent: Man pages fix, rename tep_ref_get() to tep_get_ref() > libtraceevent: Man pages fix, changes in event printing APIs > libtraceevent: Add tep_get_event() in event-parse.h > libtraceevent: Move traceevent plugins in its own subdirectory > > tools/include/asm/bug.h | 1 + > tools/lib/traceevent/Build | 11 - > .../Documentation/libtraceevent-event_print.txt | 130 +++++++++ > .../Documentation/libtraceevent-handle.txt | 8 +- > .../Documentation/libtraceevent-plugins.txt | 99 +++++++ > .../lib/traceevent/Documentation/libtraceevent.txt | 15 +- > tools/lib/traceevent/Makefile | 94 ++----- > tools/lib/traceevent/event-parse.c | 4 +- > tools/lib/traceevent/event-parse.h | 2 + > tools/lib/traceevent/plugins/Build | 10 + > tools/lib/traceevent/plugins/Makefile | 222 ++++++++++++++++ > .../lib/traceevent/{ => plugins}/plugin_cfg80211.c | 0 > .../lib/traceevent/{ => plugins}/plugin_function.c | 0 > .../lib/traceevent/{ => plugins}/plugin_hrtimer.c | 0 > tools/lib/traceevent/{ => plugins}/plugin_jbd2.c | 0 > tools/lib/traceevent/{ => plugins}/plugin_kmem.c | 0 > tools/lib/traceevent/{ => plugins}/plugin_kvm.c | 0 > .../lib/traceevent/{ => plugins}/plugin_mac80211.c | 0 > .../traceevent/{ => plugins}/plugin_sched_switch.c | 0 > tools/lib/traceevent/{ => plugins}/plugin_scsi.c | 0 > tools/lib/traceevent/{ => plugins}/plugin_xen.c | 0 > tools/perf/Makefile.config | 2 +- > tools/perf/Makefile.perf | 4 +- > tools/perf/arch/arm/util/cs-etm.c | 7 +- > tools/perf/arch/arm64/util/arm-spe.c | 6 +- > tools/perf/arch/s390/Makefile | 1 + > tools/perf/arch/s390/util/auxtrace.c | 1 + > tools/perf/arch/s390/util/machine.c | 2 +- > tools/perf/arch/x86/tests/intel-cqm.c | 5 +- > tools/perf/arch/x86/tests/perf-time-to-tsc.c | 11 +- > tools/perf/arch/x86/tests/rdpmc.c | 2 +- > tools/perf/arch/x86/util/intel-bts.c | 9 +- > tools/perf/arch/x86/util/intel-pt.c | 17 +- > tools/perf/arch/x86/util/machine.c | 2 +- > tools/perf/builtin-evlist.c | 1 + > tools/perf/builtin-kvm.c | 13 +- > tools/perf/builtin-list.c | 4 +- > tools/perf/builtin-record.c | 102 +++---- > tools/perf/builtin-sched.c | 3 +- > tools/perf/builtin-script.c | 11 +- > tools/perf/builtin-stat.c | 6 +- > tools/perf/builtin-top.c | 22 +- > tools/perf/builtin-trace.c | 17 +- > tools/perf/lib/Makefile | 35 ++- > tools/perf/lib/core.c | 13 +- > tools/perf/lib/evlist.c | 124 +++++++++ > tools/perf/lib/evsel.c | 30 +++ > tools/perf/lib/include/internal/evlist.h | 33 +++ > tools/perf/lib/include/internal/evsel.h | 33 +++ > tools/perf/lib/include/internal/lib.h | 4 +- > tools/perf/lib/include/internal/mmap.h | 32 +++ > tools/perf/lib/include/perf/core.h | 2 +- > tools/perf/lib/include/perf/evlist.h | 1 + > tools/perf/lib/lib.c | 2 + > tools/perf/lib/libperf.map | 3 +- > tools/perf/lib/tests/test-cpumap.c | 10 + > tools/perf/lib/tests/test-evlist.c | 10 + > tools/perf/lib/tests/test-evsel.c | 10 + > tools/perf/lib/tests/test-threadmap.c | 10 + > tools/perf/perf.c | 13 +- > tools/perf/pmu-events/README | 22 +- > .../perf/pmu-events/arch/powerpc/power8/other.json | 24 -- > .../perf/pmu-events/arch/x86/amdfam17h/cache.json | 42 +++ > tools/perf/pmu-events/arch/x86/amdfam17h/core.json | 2 +- > tools/perf/pmu-events/jevents.c | 1 + > tools/perf/tests/backward-ring-buffer.c | 11 +- > tools/perf/tests/bpf.c | 9 +- > tools/perf/tests/code-reading.c | 11 +- > tools/perf/tests/event-times.c | 14 +- > tools/perf/tests/event_update.c | 6 +- > tools/perf/tests/evsel-roundtrip-name.c | 2 +- > tools/perf/tests/hists_cumulate.c | 2 +- > tools/perf/tests/hists_link.c | 5 +- > tools/perf/tests/hists_output.c | 2 +- > tools/perf/tests/keep-tracking.c | 11 +- > tools/perf/tests/mmap-basic.c | 5 +- > tools/perf/tests/mmap-thread-lookup.c | 2 +- > tools/perf/tests/openat-syscall-tp-fields.c | 11 +- > tools/perf/tests/parse-events.c | 116 ++++---- > tools/perf/tests/perf-record.c | 13 +- > tools/perf/tests/sdt.c | 1 + > tools/perf/tests/sw-clock.c | 5 +- > tools/perf/tests/switch-tracking.c | 29 +- > tools/perf/tests/task-exit.c | 9 +- > tools/perf/tests/vmlinux-kallsyms.c | 2 +- > tools/perf/ui/browsers/hists.c | 6 +- > tools/perf/ui/gtk/hists.c | 1 + > tools/perf/util/Build | 2 + > tools/perf/util/annotate.c | 1 + > tools/perf/util/auxtrace.c | 8 +- > tools/perf/util/auxtrace.h | 8 +- > tools/perf/util/bpf-loader.c | 2 +- > tools/perf/util/build-id.c | 3 +- > tools/perf/util/copyfile.c | 144 ++++++++++ > tools/perf/util/copyfile.h | 16 ++ > tools/perf/util/cs-etm.c | 2 +- > tools/perf/util/evlist.c | 295 ++++++--------------- > tools/perf/util/evlist.h | 81 +++--- > tools/perf/util/evsel.c | 204 ++------------ > tools/perf/util/evsel.h | 121 +-------- > tools/perf/util/evsel_config.h | 50 ++++ > tools/perf/util/evsel_fprintf.c | 15 +- > tools/perf/util/evsel_fprintf.h | 50 ++++ > tools/perf/util/genelf.h | 3 + > tools/perf/util/header.c | 29 +- > tools/perf/util/intel-bts.c | 4 +- > tools/perf/util/intel-pt.c | 10 +- > tools/perf/util/jitdump.c | 2 +- > tools/perf/util/machine.c | 1 + > tools/perf/util/mmap.c | 185 ++++++------- > tools/perf/util/mmap.h | 77 ++---- > tools/perf/util/parse-events.c | 8 +- > tools/perf/util/parse-events.y | 4 +- > tools/perf/util/perf_event_attr_fprintf.c | 148 +++++++++++ > tools/perf/util/python-ext-sources | 1 + > tools/perf/util/python.c | 24 +- > tools/perf/util/record.c | 6 +- > tools/perf/util/session.c | 5 +- > tools/perf/util/sort.c | 2 +- > tools/perf/util/srccode.c | 2 +- > tools/perf/util/stat-shadow.c | 4 +- > tools/perf/util/stat.c | 2 +- > tools/perf/util/symbol-elf.c | 2 +- > tools/perf/util/synthetic-events.c | 20 +- > tools/perf/util/top.c | 2 +- > tools/perf/util/trace-event-info.c | 2 +- > tools/perf/util/util.c | 136 ---------- > tools/perf/util/util.h | 8 - > 128 files changed, 1941 insertions(+), 1321 deletions(-) > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt > create mode 100644 tools/lib/traceevent/plugins/Build > create mode 100644 tools/lib/traceevent/plugins/Makefile > rename tools/lib/traceevent/{ => plugins}/plugin_cfg80211.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_function.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_hrtimer.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_jbd2.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_kmem.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_kvm.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_mac80211.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_sched_switch.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_scsi.c (100%) > rename tools/lib/traceevent/{ => plugins}/plugin_xen.c (100%) > create mode 100644 tools/perf/lib/include/internal/mmap.h > create mode 100644 tools/perf/util/copyfile.c > create mode 100644 tools/perf/util/copyfile.h > create mode 100644 tools/perf/util/evsel_config.h > create mode 100644 tools/perf/util/evsel_fprintf.h > create mode 100644 tools/perf/util/perf_event_attr_fprintf.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-09-20 14:25 Arnaldo Carvalho de Melo 2019-09-20 16:15 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-09-20 14:25 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Anju T Sudhakar, Colin King, James Clark, Ravi Bangoria, Sakari Ailus, Srikar Dronamraju, Thomas Richter, 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() 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]. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- 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' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-09-20 14:25 Arnaldo Carvalho de Melo @ 2019-09-20 16:15 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-09-20 16:15 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Anju T Sudhakar, Colin King, James Clark, Ravi Bangoria, Sakari Ailus, Srikar Dronamraju, Thomas Richter, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > 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() 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]. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > 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 Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-09-01 12:22 Arnaldo Carvalho de Melo 2019-09-02 7:14 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-09-01 12:22 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Jin Yao, Joe Mario, Josh Poimboeuf, Kyle Meyer, Patrick McLean, Steven Rostedt, Tzvetomir Stoyanov, 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 39c2ca43465e0f52ebba3ee96fd03436367c1880: Merge tag 'perf-core-for-mingo-5.4-20190829' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-29 20:56:32 +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-20190901 for you to fetch changes up to ae31a514a134d9e4ca1d7b0f0a19b5934747d79f: objtool: Ignore intentional differences for the x86 insn decoder (2019-08-31 22:27:52 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: objtool: Josh Poimboeuf: - Move x86 insn decoder to a common location. Arnaldo Carvalho de Melo: - Ignore intentional differences for the x86 insn decoder. build: Arnaldo Carvalho de Melo: - Ignore intentional differences for the x86 insn decoder. Intel PT: Josh Poimboeuf: - Use shared x86 insn decoder. metric groups: Jin Yao: - Scale the metric result. - Support multiple events. perf c2c: Jiri Olsa: - Display proper cpu count in nodes column. Miscellaneous: Kyle Meyer: - Replace MAX_NR_CPUS with perf_env::nr_cpus_online, i.e. with the number of online CPUs as detected at tool start and/or recorded in the perf.data file. libtraceevent: Tzvetomir Stoyanov: - Simplify the tep_print_event_* APIs. - Remove tep_register_trace_clock(). - Change users plugin directory. Cleanups: Arnaldo Carvalho de Melo: - Continue taming the includes hell: remove needless include directives, fix the fallout, rinse, repeat. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (29): perf tools: Remove needless libtraceevent include directives perf header: Move CPUINFO_PROC to the only file where it is used perf tools: Move everything related to sys_perf_event_open() to perf-sys.h perf time-utils: Adopt rdclock() from perf.h perf tools: Remove needless perf.h include directive from headers perf tools: Remove perf.h from source files not needing it perf tools: Remove debug.h from header files not needing it perf debug: Remove needless include directives from debug.h perf env: Remove env.h from other headers where just a fwd decl is needed perf event: Remove needless include directives from event.h perf dso: Adopt DSO related macros from symbol.h perf symbol: Move C++ demangle defines to the only file using it perf symbols: Add missing linux/refcount.h to symbol.h perf symbols: Move symsrc prototypes to a separate header perf dsos: Move the dsos struct and its methods to separate source files perf hist: Remove needless ui/progress.h from hist.h perf tools: Move 'struct events_stats' and prototypes to separate header perf tools: Remove needless sort.h include directives perf probe: No need for symbol.h, symbol_conf is enough perf tools: Remove needless map.h include directives perf tools: Remove needless thread.h include directives perf tools: Remove needless thread_map.h include directives perf tools: Remove needless evlist.h include directives perf tools: Remove needless evlist.h include directives perf auxtrace: Uninline functions that touch perf_session perf symbols: Move mem_info and branch_info out of symbol.h perf build: Ignore intentional differences for the x86 insn decoder objtool: Update sync-check.sh from perf's check-headers.sh objtool: Ignore intentional differences for the x86 insn decoder Jin Yao (3): perf pmu: Change convert_scale from static to global perf metricgroup: Scale the metric result perf metricgroup: Support multiple events for metricgroup Jiri Olsa (1): perf c2c: Display proper cpu count in nodes column Josh Poimboeuf (4): objtool: Move x86 insn decoder to a common location perf: Update .gitignore file perf intel-pt: Remove inat.c from build dependency list perf intel-pt: Use shared x86 insn decoder Kyle Meyer (7): perf timechart: Refactor svg_build_topology_map() perf svghelper: Replace MAX_NR_CPUS with perf_env::nr_cpus_online perf stat: Replace MAX_NR_CPUS with cpu__max_cpu() perf session: Replace MAX_NR_CPUS with perf_env::nr_cpus_online perf machine: Replace MAX_NR_CPUS with perf_env::nr_cpus_online perf header: Replace MAX_NR_CPUS with cpu__max_cpu() libperf: Warn when exceeding MAX_NR_CPUS in cpumap Tzvetomir Stoyanov (3): libtraceevent, perf tools: Changes in tep_print_event_* APIs libtraceevent: Remove tep_register_trace_clock() libtraceevent: Change users plugin directory .../x86/include/asm}/inat.h | 0 .../arch/x86/include/asm/inat_types.h | 0 .../x86/include/asm}/insn.h | 0 .../{objtool => }/arch/x86/include/asm/orc_types.h | 0 tools/{objtool => }/arch/x86/lib/inat.c | 2 +- tools/{objtool => }/arch/x86/lib/insn.c | 4 +- .../{objtool => }/arch/x86/lib/x86-opcode-map.txt | 0 .../arch/x86/tools/gen-insn-attr-x86.awk | 0 tools/lib/traceevent/Makefile | 6 +- tools/lib/traceevent/event-parse-api.c | 40 - tools/lib/traceevent/event-parse-local.h | 6 - tools/lib/traceevent/event-parse.c | 333 +++--- tools/lib/traceevent/event-parse.h | 30 +- tools/lib/traceevent/event-plugin.c | 2 +- tools/objtool/Makefile | 4 +- tools/objtool/arch/x86/Build | 4 +- tools/objtool/arch/x86/decode.c | 4 +- tools/objtool/arch/x86/include/asm/inat.h | 230 ----- tools/objtool/arch/x86/include/asm/insn.h | 216 ---- tools/objtool/sync-check.sh | 44 +- tools/perf/.gitignore | 3 + tools/perf/arch/arm/annotate/instructions.c | 1 + tools/perf/arch/arm/util/auxtrace.c | 1 + tools/perf/arch/arm/util/cs-etm.c | 4 +- tools/perf/arch/arm64/annotate/instructions.c | 1 + tools/perf/arch/arm64/util/sym-handling.c | 8 +- tools/perf/arch/common.c | 3 + tools/perf/arch/common.h | 4 +- tools/perf/arch/powerpc/util/mem-events.c | 1 + tools/perf/arch/powerpc/util/perf_regs.c | 1 - tools/perf/arch/powerpc/util/sym-handling.c | 1 + tools/perf/arch/powerpc/util/unwind-libdw.c | 1 + tools/perf/arch/x86/tests/bp-modify.c | 1 + tools/perf/arch/x86/tests/insn-x86.c | 3 +- tools/perf/arch/x86/tests/intel-cqm.c | 1 - tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 + tools/perf/arch/x86/tests/rdpmc.c | 4 +- tools/perf/arch/x86/util/archinsn.c | 3 +- tools/perf/arch/x86/util/perf_regs.c | 4 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/bench/epoll-ctl.c | 1 + tools/perf/bench/epoll-wait.c | 1 + tools/perf/bench/mem-functions.c | 3 +- tools/perf/bench/numa.c | 1 - tools/perf/bench/sched-messaging.c | 1 - tools/perf/bench/sched-pipe.c | 1 - tools/perf/builtin-annotate.c | 4 +- tools/perf/builtin-bench.c | 1 - tools/perf/builtin-buildid-cache.c | 5 +- tools/perf/builtin-buildid-list.c | 4 +- tools/perf/builtin-c2c.c | 7 +- tools/perf/builtin-config.c | 3 +- tools/perf/builtin-data.c | 2 + tools/perf/builtin-diff.c | 2 + tools/perf/builtin-ftrace.c | 5 +- tools/perf/builtin-help.c | 5 +- tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kallsyms.c | 1 + tools/perf/builtin-kmem.c | 5 +- tools/perf/builtin-kvm.c | 5 +- tools/perf/builtin-list.c | 5 +- tools/perf/builtin-lock.c | 4 +- tools/perf/builtin-mem.c | 2 + tools/perf/builtin-probe.c | 5 +- tools/perf/builtin-record.c | 2 + tools/perf/builtin-report.c | 7 + tools/perf/builtin-sched.c | 3 +- tools/perf/builtin-script.c | 4 +- tools/perf/builtin-stat.c | 3 +- tools/perf/builtin-timechart.c | 10 +- tools/perf/builtin-top.c | 5 +- tools/perf/builtin-trace.c | 4 + tools/perf/builtin-version.c | 2 +- tools/perf/check-headers.sh | 11 +- tools/perf/lib/cpumap.c | 6 + tools/perf/perf-sys.h | 51 +- tools/perf/perf.c | 7 +- tools/perf/perf.h | 21 - tools/perf/scripts/perl/Perf-Trace-Util/Context.c | 1 - .../perf/scripts/python/Perf-Trace-Util/Context.c | 1 - tools/perf/tests/attr.c | 3 +- tools/perf/tests/backward-ring-buffer.c | 2 + tools/perf/tests/bp_account.c | 3 +- tools/perf/tests/bp_signal.c | 3 +- tools/perf/tests/bp_signal_overflow.c | 3 +- tools/perf/tests/bpf.c | 2 + tools/perf/tests/builtin-test.c | 1 + tools/perf/tests/code-reading.c | 8 + tools/perf/tests/dso-data.c | 1 + tools/perf/tests/dwarf-unwind.c | 1 + tools/perf/tests/event-times.c | 2 + tools/perf/tests/event_update.c | 3 + tools/perf/tests/expr.c | 1 + tools/perf/tests/hists_common.c | 3 +- tools/perf/tests/hists_cumulate.c | 2 +- tools/perf/tests/hists_filter.c | 2 - tools/perf/tests/hists_link.c | 2 - tools/perf/tests/hists_output.c | 2 +- tools/perf/tests/keep-tracking.c | 2 + tools/perf/tests/kmod-path.c | 2 + tools/perf/tests/llvm.c | 2 +- tools/perf/tests/mem.c | 1 + tools/perf/tests/mem2node.c | 2 + tools/perf/tests/mmap-basic.c | 3 + tools/perf/tests/openat-syscall-all-cpus.c | 1 + tools/perf/tests/openat-syscall-tp-fields.c | 1 + tools/perf/tests/openat-syscall.c | 1 + tools/perf/tests/parse-events.c | 1 + tools/perf/tests/perf-record.c | 1 + tools/perf/tests/sample-parsing.c | 2 + tools/perf/tests/sdt.c | 3 +- tools/perf/tests/sw-clock.c | 2 + tools/perf/tests/switch-tracking.c | 2 + tools/perf/tests/task-exit.c | 2 + tools/perf/tests/thread-map.c | 7 + tools/perf/tests/thread-mg-share.c | 1 - tools/perf/tests/unit_number__scnprintf.c | 1 + tools/perf/tests/vmlinux-kallsyms.c | 1 + tools/perf/tests/wp.c | 5 + tools/perf/ui/browser.c | 1 - tools/perf/ui/browsers/annotate.c | 2 + tools/perf/ui/browsers/header.c | 1 - tools/perf/ui/browsers/hists.c | 6 + tools/perf/ui/browsers/map.c | 1 + tools/perf/ui/browsers/res_sample.c | 3 + tools/perf/ui/browsers/scripts.c | 4 +- tools/perf/ui/gtk/annotate.c | 1 + tools/perf/ui/gtk/browser.c | 2 - tools/perf/ui/gtk/helpline.c | 1 + tools/perf/ui/gtk/hists.c | 1 - tools/perf/ui/gtk/setup.c | 1 - tools/perf/ui/gtk/util.c | 1 + tools/perf/ui/helpline.h | 2 - tools/perf/ui/hist.c | 4 + tools/perf/ui/progress.c | 1 - tools/perf/ui/setup.c | 3 +- tools/perf/ui/stdio/hist.c | 1 + tools/perf/ui/tui/helpline.c | 2 + tools/perf/ui/tui/progress.c | 1 - tools/perf/ui/tui/setup.c | 3 +- tools/perf/ui/tui/util.c | 1 - tools/perf/ui/util.c | 2 +- tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 5 +- tools/perf/util/arm-spe.c | 4 +- tools/perf/util/auxtrace.c | 33 + tools/perf/util/auxtrace.h | 52 +- tools/perf/util/bpf-event.c | 1 + tools/perf/util/bpf-event.h | 1 + tools/perf/util/bpf-loader.c | 2 +- tools/perf/util/bpf-prologue.c | 2 +- tools/perf/util/branch.c | 3 +- tools/perf/util/branch.h | 8 + tools/perf/util/build-id.c | 1 + tools/perf/util/cacheline.c | 1 - tools/perf/util/callchain.c | 3 + tools/perf/util/callchain.h | 1 + tools/perf/util/cgroup.c | 3 +- tools/perf/util/cloexec.c | 4 +- tools/perf/util/color.c | 3 +- tools/perf/util/color_config.c | 3 +- tools/perf/util/config.c | 4 + tools/perf/util/cpumap.c | 1 - tools/perf/util/cputopo.h | 1 - tools/perf/util/cs-etm.c | 6 +- tools/perf/util/cs-etm.h | 3 +- tools/perf/util/data.c | 1 + tools/perf/util/db-export.c | 1 + tools/perf/util/debug.c | 6 +- tools/perf/util/debug.h | 6 +- tools/perf/util/dso.c | 237 +---- tools/perf/util/dso.h | 28 +- tools/perf/util/dsos.c | 232 +++++ tools/perf/util/dsos.h | 44 + tools/perf/util/dwarf-aux.c | 1 + tools/perf/util/dwarf-aux.h | 2 + tools/perf/util/env.c | 1 + tools/perf/util/event.c | 5 +- tools/perf/util/event.h | 61 +- tools/perf/util/events_stats.h | 51 + tools/perf/util/evlist.c | 3 + tools/perf/util/evlist.h | 3 +- tools/perf/util/evsel.c | 2 + tools/perf/util/evsel.h | 1 + tools/perf/util/expr.y | 2 + tools/perf/util/genelf.c | 3 +- tools/perf/util/genelf_debug.c | 1 - tools/perf/util/header.c | 27 +- tools/perf/util/hist.c | 7 + tools/perf/util/hist.h | 6 +- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/intel-pt-decoder/Build | 22 +- .../util/intel-pt-decoder/gen-insn-attr-x86.awk | 392 ------- tools/perf/util/intel-pt-decoder/inat.c | 82 -- tools/perf/util/intel-pt-decoder/inat_types.h | 15 - tools/perf/util/intel-pt-decoder/insn.c | 593 ----------- .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 +- .../util/intel-pt-decoder/intel-pt-insn-decoder.c | 10 +- .../perf/util/intel-pt-decoder/x86-opcode-map.txt | 1072 -------------------- tools/perf/util/intel-pt.c | 2 +- tools/perf/util/jitdump.c | 1 + tools/perf/util/llvm-utils.c | 1 + tools/perf/util/llvm-utils.h | 2 +- tools/perf/util/lzma.c | 1 + tools/perf/util/machine.c | 18 +- tools/perf/util/machine.h | 3 +- tools/perf/util/map.c | 3 + tools/perf/util/mem-events.c | 2 +- tools/perf/util/mem-events.h | 9 + tools/perf/util/mem2node.c | 2 + tools/perf/util/mem2node.h | 3 +- tools/perf/util/metricgroup.c | 89 +- tools/perf/util/metricgroup.h | 1 + tools/perf/util/mmap.c | 4 + tools/perf/util/mmap.h | 1 + tools/perf/util/ordered-events.c | 1 + tools/perf/util/parse-branch-options.c | 3 +- tools/perf/util/parse-events.c | 4 +- tools/perf/util/path.c | 3 +- tools/perf/util/path.h | 3 + tools/perf/util/perf-hooks.c | 1 + tools/perf/util/pmu.c | 9 +- tools/perf/util/pmu.h | 2 + tools/perf/util/probe-event.c | 6 +- tools/perf/util/probe-file.c | 4 +- tools/perf/util/probe-finder.c | 1 + tools/perf/util/pstack.c | 1 + tools/perf/util/python.c | 4 + tools/perf/util/record.c | 4 + tools/perf/util/s390-cpumsf.c | 2 +- tools/perf/util/s390-sample-raw.c | 2 - .../perf/util/scripting-engines/trace-event-perl.c | 2 +- .../util/scripting-engines/trace-event-python.c | 3 +- tools/perf/util/session.c | 10 +- tools/perf/util/sort.c | 9 +- tools/perf/util/sort.h | 1 - tools/perf/util/stat-display.c | 1 + tools/perf/util/stat-shadow.c | 65 +- tools/perf/util/stat.c | 8 +- tools/perf/util/strbuf.c | 5 + tools/perf/util/svghelper.c | 54 +- tools/perf/util/svghelper.h | 4 +- tools/perf/util/symbol-elf.c | 7 + tools/perf/util/symbol-minimal.c | 2 + tools/perf/util/symbol.c | 5 + tools/perf/util/symbol.h | 63 +- tools/perf/util/symbol_fprintf.c | 1 + tools/perf/util/symsrc.h | 46 + tools/perf/util/target.c | 3 + tools/perf/util/thread-stack.c | 1 + tools/perf/util/thread.c | 2 +- tools/perf/util/time-utils.c | 1 - tools/perf/util/time-utils.h | 9 + tools/perf/util/top.c | 1 + tools/perf/util/top.h | 1 + tools/perf/util/trace-event-info.c | 1 - tools/perf/util/trace-event-parse.c | 3 +- tools/perf/util/trace-event-read.c | 1 - tools/perf/util/trace-event-scripting.c | 1 - tools/perf/util/trace-event.h | 1 - tools/perf/util/trigger.h | 1 - tools/perf/util/unwind-libdw.c | 1 + tools/perf/util/unwind-libunwind.c | 1 + tools/perf/util/util.c | 2 +- tools/perf/util/values.c | 1 + tools/perf/util/vdso.c | 1 + tools/perf/util/zlib.c | 1 + 267 files changed, 1319 insertions(+), 3578 deletions(-) rename tools/{perf/util/intel-pt-decoder => arch/x86/include/asm}/inat.h (100%) rename tools/{objtool => }/arch/x86/include/asm/inat_types.h (100%) rename tools/{perf/util/intel-pt-decoder => arch/x86/include/asm}/insn.h (100%) rename tools/{objtool => }/arch/x86/include/asm/orc_types.h (100%) rename tools/{objtool => }/arch/x86/lib/inat.c (98%) rename tools/{objtool => }/arch/x86/lib/insn.c (99%) rename tools/{objtool => }/arch/x86/lib/x86-opcode-map.txt (100%) rename tools/{objtool => }/arch/x86/tools/gen-insn-attr-x86.awk (100%) delete mode 100644 tools/objtool/arch/x86/include/asm/inat.h delete mode 100644 tools/objtool/arch/x86/include/asm/insn.h create mode 100644 tools/perf/util/dsos.c create mode 100644 tools/perf/util/dsos.h create mode 100644 tools/perf/util/events_stats.h delete mode 100644 tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk delete mode 100644 tools/perf/util/intel-pt-decoder/inat.c delete mode 100644 tools/perf/util/intel-pt-decoder/inat_types.h delete mode 100644 tools/perf/util/intel-pt-decoder/insn.c delete mode 100644 tools/perf/util/intel-pt-decoder/x86-opcode-map.txt create mode 100644 tools/perf/util/symsrc.h Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. Clearlinux is failing when building with libpython, but that is not a perf regression, will try to remove one compiler warning that is causing the problem when building some of the glue code files in the python files, outside perf. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.3.0-rc6.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190816 gcc-9-branch@274554, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 9.2.1-4) 9.2.1 20190821, clang version 7.0.1-9+b1 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.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-4ubuntu1) 9.2.1 20190821, clang version 9.0.0-+rc2-1~exp1 (tags/RELEASE_900/rc2) # # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 ae31a514a134 objtool: Ignore intentional differences for the x86 insn decoder # perf version --build-options perf version 5.3.rc6.gae31a514a134 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 . - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_util_map_o_O: make util/map.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_slang_O: make NO_SLANG=1 make_install_O: make install make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_clean_all_O: make clean all make_no_gtk2_O: make NO_GTK2=1 make_pure_O: make make_no_libelf_O: make NO_LIBELF=1 make_debug_O: make DEBUG=1 make_no_newt_O: make NO_NEWT=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libperl_O: make NO_LIBPERL=1 make_help_O: make help make_no_libnuma_O: make NO_LIBNUMA=1 make_no_demangle_O: make NO_DEMANGLE=1 make_tags_O: make tags make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libpython_O: make NO_LIBPYTHON=1 - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make_static_O: make LDFLAGS=-static make_with_clangllvm_O: make LIBCLANGLLVM=1 make_install_bin_O: make install-bin make_cscope_O: make cscope make_perf_o_O: make perf.o make_doc_O: make doc make_no_libbpf_O: make NO_LIBBPF=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_with_babeltrace_O: make LIBBABELTRACE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-09-01 12:22 Arnaldo Carvalho de Melo @ 2019-09-02 7:14 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-09-02 7:14 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Jin Yao, Joe Mario, Josh Poimboeuf, Kyle Meyer, Patrick McLean, Steven Rostedt, Tzvetomir Stoyanov, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 39c2ca43465e0f52ebba3ee96fd03436367c1880: > > Merge tag 'perf-core-for-mingo-5.4-20190829' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-29 20:56:32 +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-20190901 > > for you to fetch changes up to ae31a514a134d9e4ca1d7b0f0a19b5934747d79f: > > objtool: Ignore intentional differences for the x86 insn decoder (2019-08-31 22:27:52 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > objtool: > > Josh Poimboeuf: > > - Move x86 insn decoder to a common location. > > Arnaldo Carvalho de Melo: > > - Ignore intentional differences for the x86 insn decoder. > > build: > > Arnaldo Carvalho de Melo: > > - Ignore intentional differences for the x86 insn decoder. > > Intel PT: > > Josh Poimboeuf: > > - Use shared x86 insn decoder. > > metric groups: > > Jin Yao: > > - Scale the metric result. > > - Support multiple events. > > perf c2c: > > Jiri Olsa: > > - Display proper cpu count in nodes column. > > Miscellaneous: > > Kyle Meyer: > > - Replace MAX_NR_CPUS with perf_env::nr_cpus_online, i.e. with > the number of online CPUs as detected at tool start and/or > recorded in the perf.data file. > > libtraceevent: > > Tzvetomir Stoyanov: > > - Simplify the tep_print_event_* APIs. > > - Remove tep_register_trace_clock(). > > - Change users plugin directory. > > Cleanups: > > Arnaldo Carvalho de Melo: > > - Continue taming the includes hell: remove needless include directives, fix > the fallout, rinse, repeat. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (29): > perf tools: Remove needless libtraceevent include directives > perf header: Move CPUINFO_PROC to the only file where it is used > perf tools: Move everything related to sys_perf_event_open() to perf-sys.h > perf time-utils: Adopt rdclock() from perf.h > perf tools: Remove needless perf.h include directive from headers > perf tools: Remove perf.h from source files not needing it > perf tools: Remove debug.h from header files not needing it > perf debug: Remove needless include directives from debug.h > perf env: Remove env.h from other headers where just a fwd decl is needed > perf event: Remove needless include directives from event.h > perf dso: Adopt DSO related macros from symbol.h > perf symbol: Move C++ demangle defines to the only file using it > perf symbols: Add missing linux/refcount.h to symbol.h > perf symbols: Move symsrc prototypes to a separate header > perf dsos: Move the dsos struct and its methods to separate source files > perf hist: Remove needless ui/progress.h from hist.h > perf tools: Move 'struct events_stats' and prototypes to separate header > perf tools: Remove needless sort.h include directives > perf probe: No need for symbol.h, symbol_conf is enough > perf tools: Remove needless map.h include directives > perf tools: Remove needless thread.h include directives > perf tools: Remove needless thread_map.h include directives > perf tools: Remove needless evlist.h include directives > perf tools: Remove needless evlist.h include directives > perf auxtrace: Uninline functions that touch perf_session > perf symbols: Move mem_info and branch_info out of symbol.h > perf build: Ignore intentional differences for the x86 insn decoder > objtool: Update sync-check.sh from perf's check-headers.sh > objtool: Ignore intentional differences for the x86 insn decoder > > Jin Yao (3): > perf pmu: Change convert_scale from static to global > perf metricgroup: Scale the metric result > perf metricgroup: Support multiple events for metricgroup > > Jiri Olsa (1): > perf c2c: Display proper cpu count in nodes column > > Josh Poimboeuf (4): > objtool: Move x86 insn decoder to a common location > perf: Update .gitignore file > perf intel-pt: Remove inat.c from build dependency list > perf intel-pt: Use shared x86 insn decoder > > Kyle Meyer (7): > perf timechart: Refactor svg_build_topology_map() > perf svghelper: Replace MAX_NR_CPUS with perf_env::nr_cpus_online > perf stat: Replace MAX_NR_CPUS with cpu__max_cpu() > perf session: Replace MAX_NR_CPUS with perf_env::nr_cpus_online > perf machine: Replace MAX_NR_CPUS with perf_env::nr_cpus_online > perf header: Replace MAX_NR_CPUS with cpu__max_cpu() > libperf: Warn when exceeding MAX_NR_CPUS in cpumap > > Tzvetomir Stoyanov (3): > libtraceevent, perf tools: Changes in tep_print_event_* APIs > libtraceevent: Remove tep_register_trace_clock() > libtraceevent: Change users plugin directory > > 267 files changed, 1319 insertions(+), 3578 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-08-29 14:38 Arnaldo Carvalho de Melo 2019-08-29 18:58 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-29 14:38 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Igor Lubashev, Karl Rister, Mathieu Poirier, Naveen N . Rao, Nicholas Piggin, Steven Rostedt, Arnaldo Carvalho de Melo Hi Ingo/Thomas, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 42880f726c66f13ae1d9ac9ce4c43abe64ecac84: perf/x86/intel: Support PEBS output to PT (2019-08-28 11:29:39 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-5.4-20190829 for you to fetch changes up to 301011ba622513cb41ced59973972204e0da2f71: tools lib traceevent: Remove unneeded qsort and uses memmove instead (2019-08-29 08:36:12 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf top: Namhyung Kim: - Decay all events in the evlist, we were decaying just the first event in a group. - Fix linking of histograms in different evsels in a event group with more than two events. With the two fixes above a command line such as: # perf top -e '{cycles,instructions,cache-misses,cache-references} Should work as expected, with four columns and with all of them being decayed over time, i.e. less weight is given for older samples. perf record: Arnaldo Carvalho de Melo: - Fix collection of build-ids when using setns() to get into namespaces, which had been broken with the introduction of the extra thread to react to PERF_RECORD_BPF_EVENT, i.e. to collect extra info for BPF programs. We need to unshare(CLONE_FS) in that thread so that the main one can do the setns(CLONE_NEWNS) when collectingthe build-ids. Without that symbol resolution gets more difficult and potentially misresolves symbols. core: Igor Lubashev: - Further alignment in permission checking via capabilities to how the kernel checks what tooling tries to do. PowerPC: Naveen N. Rao: - Sync powerpc syscall.tbl, so that 'perf trace' gets the definitions for recent syscalls. libperf: Jiri Olsa: - Move the rest of the PERF_RECORD_ metadata struct definitions so that we can use 'union perf_event'. libtraceevent: Steven Rostedt (VMware): - Do not free tep->cmdlines in add_new_comm() on failure. - Remove unneeded qsort and uses memmove instead Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (4): perf tools: Remove needless util.h include from builtin.h perf evlist: Remove needless util.h from evlist.h perf clang: Delete needless util-cxx.h header perf evlist: Use unshare(CLONE_FS) in sb threads to let setns(CLONE_NEWNS) work Igor Lubashev (5): perf event: Check ref_reloc_sym before using it perf tools: Use CAP_SYS_ADMIN with perf_event_paranoid checks perf evsel: Kernel profiling is disallowed only when perf_event_paranoid > 1 perf symbols: Use CAP_SYSLOG with kptr_restrict checks perf tools: Warn that perf_event_paranoid can restrict kernel symbols Jiri Olsa (23): libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h libperf: Add 'union perf_event' to perf/event.h libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix libperf: Move 'enum perf_user_event_type' to perf/event.h Namhyung Kim (2): perf top: Decay all events in the evlist perf top: Fix event group with more than two events Naveen N. Rao (1): perf arch powerpc: Sync powerpc syscall.tbl Steven Rostedt (VMware) (2): tools lib traceevent: Do not free tep->cmdlines in add_new_comm() on failure tools lib traceevent: Remove unneeded qsort and uses memmove instead tools/lib/traceevent/event-parse.c | 58 ++++- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/arch/arm64/util/arm-spe.c | 5 +- tools/perf/arch/powerpc/entry/syscalls/syscall.tbl | 146 +++++++++-- tools/perf/arch/s390/util/auxtrace.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 6 +- tools/perf/arch/x86/util/intel-pt.c | 7 +- tools/perf/arch/x86/util/tsc.c | 2 +- tools/perf/builtin-buildid-cache.c | 1 + tools/perf/builtin-record.c | 6 +- tools/perf/builtin-report.c | 3 +- tools/perf/builtin-script.c | 3 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 47 ++-- tools/perf/builtin-trace.c | 3 +- tools/perf/builtin.h | 2 - tools/perf/lib/include/perf/event.h | 273 ++++++++++++++++++++ tools/perf/perf.c | 1 + tools/perf/tests/cpumap.c | 12 +- tools/perf/tests/event_update.c | 16 +- tools/perf/tests/sdt.c | 1 + tools/perf/tests/stat.c | 8 +- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/arm-spe.c | 6 +- tools/perf/util/auxtrace.c | 21 +- tools/perf/util/auxtrace.h | 8 +- tools/perf/util/bpf-loader.c | 1 + tools/perf/util/build-id.c | 2 +- tools/perf/util/c++/clang-c.h | 2 +- tools/perf/util/c++/clang-test.cpp | 4 +- tools/perf/util/cpumap.c | 6 +- tools/perf/util/cpumap.h | 4 +- tools/perf/util/cs-etm.c | 4 +- tools/perf/util/event.c | 45 ++-- tools/perf/util/event.h | 278 +-------------------- tools/perf/util/evlist.c | 10 + tools/perf/util/evlist.h | 1 - tools/perf/util/evsel.c | 3 +- tools/perf/util/header.c | 57 ++--- tools/perf/util/hist.c | 39 +-- tools/perf/util/hist.h | 1 + tools/perf/util/intel-bts.c | 6 +- tools/perf/util/intel-pt.c | 12 +- tools/perf/util/python.c | 4 +- tools/perf/util/s390-cpumsf.c | 4 +- tools/perf/util/session.c | 29 +-- tools/perf/util/session.h | 2 +- tools/perf/util/stat.c | 12 +- tools/perf/util/symbol.c | 15 +- tools/perf/util/thread_map.c | 4 +- tools/perf/util/thread_map.h | 4 +- tools/perf/util/util-cxx.h | 27 -- 52 files changed, 684 insertions(+), 540 deletions(-) delete mode 100644 tools/perf/util/util-cxx.h Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. Clearlinux is failing when building with libpython, but that is not a perf regression, will try to remove one compiler warning that is causing the problem when building some of the glue code files in the python files, outside perf. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.3.0-rc6.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190816 gcc-9-branch@274554, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 9.2.1-4) 9.2.1 20190821, clang version 7.0.1-9+b1 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190805 [gcc-9-branch revision 274114], clang version 8.0.1 (tags/RELEASE_801/final 366581) 49 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 50 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 oraclelinux:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3.0.1), clang version 7.0.1 (tags/RELEASE_701/final) 52 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) 53 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) 54 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 55 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 62 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.10 : Ok gcc (Ubuntu 8.3.0-6ubuntu1~18.10.1) 8.3.0, clang version 7.0.0-3 (tags/RELEASE_700/final) 73 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 74 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 # # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 301011ba6225 tools lib traceevent: Remove unneeded qsort and uses memmove instead # perf version --build-options perf version 5.3.rc6.g301011ba6225 dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Breakpoint accounting : Ok 22: Watchpoint : 22.1: Read Only Watchpoint : Skip 22.2: Write Only Watchpoint : Ok 22.3: Read / Write Watchpoint : Ok 22.4: Modify Watchpoint : Ok 23: Number of exit events of a simple workload : Ok 24: Software clock events period values : Ok 25: Object code reading : Ok 26: Sample parsing : Ok 27: Use a dummy software event to keep tracking : Ok 28: Parse with no sample_id_all bit set : Ok 29: Filter hist entries : Ok 30: Lookup mmap thread : Ok 31: Share thread mg : Ok 32: Sort output of hist entries : Ok 33: Cumulate child hist entries : Ok 34: Track with sched_switch : Ok 35: Filter fds with revents mask in a fdarray : Ok 36: Add fd to a fdarray, making it autogrow : Ok 37: kmod_path__parse : Ok 38: Thread map : Ok 39: LLVM search and compile : 39.1: Basic BPF llvm compile : Ok 39.2: kbuild searching : Ok 39.3: Compile source for BPF prologue generation : Ok 39.4: Compile source for BPF relocation : Ok 40: Session topology : Ok 41: BPF filter : 41.1: Basic BPF filtering : Ok 41.2: BPF pinning : Ok 41.3: BPF prologue generation : Ok 41.4: BPF relocation checker : Ok 42: Synthesize thread map : Ok 43: Remove thread map : Ok 44: Synthesize cpu map : Ok 45: Synthesize stat config : Ok 46: Synthesize stat : Ok 47: Synthesize stat round : Ok 48: Synthesize attr update : Ok 49: Event times : Ok 50: Read backward ring buffer : Ok 51: Print cpu map : Ok 52: Probe SDT events : Ok 53: is_printable_array : Ok 54: Print bitmap : Ok 55: perf hooks : Ok 56: builtin clang support : Skip (not compiled in) 57: unit_number__scnprintf : Ok 58: mem2node : Ok 59: time utils : Ok 60: map_groups__merge_in : Ok 61: x86 rdpmc : Ok 62: Convert perf time to TSC : Ok 63: DWARF unwind : Ok 64: x86 instruction decoder - new instructions : Ok 65: Intel PT packet decoder : Ok 66: x86 bp modify : Ok 67: probe libc's inet_pton & backtrace it with ping : Ok 68: Use vfs_getname probe to get syscall args filenames : Ok 69: Add vfs_getname probe to get syscall args filenames : Ok 70: Check open filename arg using perf trace + vfs_getname: Ok 71: Zstd perf.data compression/decompression : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_help_O: make help make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_debug_O: make DEBUG=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_gtk2_O: make NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libperl_O: make NO_LIBPERL=1 make_clean_all_O: make clean all make_no_libbpf_O: make NO_LIBBPF=1 make_cscope_O: make cscope make_tags_O: make tags make_no_libbionic_O: make NO_LIBBIONIC=1 make_static_O: make LDFLAGS=-static make_no_libelf_O: make NO_LIBELF=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_doc_O: make doc make_no_slang_O: make NO_SLANG=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_perf_o_O: make perf.o make_install_bin_O: make install-bin make_pure_O: make make_no_newt_O: make NO_NEWT=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_O: make install make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_util_map_o_O: make util/map.o make_no_libnuma_O: make NO_LIBNUMA=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-08-29 14:38 Arnaldo Carvalho de Melo @ 2019-08-29 18:58 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-08-29 18:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Igor Lubashev, Karl Rister, Mathieu Poirier, Naveen N . Rao, Nicholas Piggin, Steven Rostedt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 42880f726c66f13ae1d9ac9ce4c43abe64ecac84: > > perf/x86/intel: Support PEBS output to PT (2019-08-28 11:29:39 +0200) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-5.4-20190829 > > for you to fetch changes up to 301011ba622513cb41ced59973972204e0da2f71: > > tools lib traceevent: Remove unneeded qsort and uses memmove instead (2019-08-29 08:36:12 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf top: > > Namhyung Kim: > > - Decay all events in the evlist, we were decaying just the first event > in a group. > > - Fix linking of histograms in different evsels in a event group with more > than two events. > > With the two fixes above a command line such as: > > # perf top -e '{cycles,instructions,cache-misses,cache-references} > > Should work as expected, with four columns and with all of them being > decayed over time, i.e. less weight is given for older samples. > > perf record: > > Arnaldo Carvalho de Melo: > > - Fix collection of build-ids when using setns() to get into namespaces, > which had been broken with the introduction of the extra thread to > react to PERF_RECORD_BPF_EVENT, i.e. to collect extra info for BPF > programs. We need to unshare(CLONE_FS) in that thread so that the > main one can do the setns(CLONE_NEWNS) when collectingthe build-ids. > Without that symbol resolution gets more difficult and potentially > misresolves symbols. > > core: > > Igor Lubashev: > > - Further alignment in permission checking via capabilities to how the > kernel checks what tooling tries to do. > > PowerPC: > > Naveen N. Rao: > > - Sync powerpc syscall.tbl, so that 'perf trace' gets the definitions > for recent syscalls. > > libperf: > > Jiri Olsa: > > - Move the rest of the PERF_RECORD_ metadata struct definitions so that > we can use 'union perf_event'. > > libtraceevent: > > Steven Rostedt (VMware): > > - Do not free tep->cmdlines in add_new_comm() on failure. > > - Remove unneeded qsort and uses memmove instead > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (4): > perf tools: Remove needless util.h include from builtin.h > perf evlist: Remove needless util.h from evlist.h > perf clang: Delete needless util-cxx.h header > perf evlist: Use unshare(CLONE_FS) in sb threads to let setns(CLONE_NEWNS) work > > Igor Lubashev (5): > perf event: Check ref_reloc_sym before using it > perf tools: Use CAP_SYS_ADMIN with perf_event_paranoid checks > perf evsel: Kernel profiling is disallowed only when perf_event_paranoid > 1 > perf symbols: Use CAP_SYSLOG with kptr_restrict checks > perf tools: Warn that perf_event_paranoid can restrict kernel symbols > > Jiri Olsa (23): > libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h > libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h > libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h > libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h > libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h > libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h > libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h > libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h > libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h > libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h > libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h > libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h > libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h > libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h > libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h > libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h > libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h > libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h > libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h > libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h > libperf: Add 'union perf_event' to perf/event.h > libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix > libperf: Move 'enum perf_user_event_type' to perf/event.h > > Namhyung Kim (2): > perf top: Decay all events in the evlist > perf top: Fix event group with more than two events > > Naveen N. Rao (1): > perf arch powerpc: Sync powerpc syscall.tbl > > Steven Rostedt (VMware) (2): > tools lib traceevent: Do not free tep->cmdlines in add_new_comm() on failure > tools lib traceevent: Remove unneeded qsort and uses memmove instead > > tools/lib/traceevent/event-parse.c | 58 ++++- > tools/perf/arch/arm/util/cs-etm.c | 7 +- > tools/perf/arch/arm64/util/arm-spe.c | 5 +- > tools/perf/arch/powerpc/entry/syscalls/syscall.tbl | 146 +++++++++-- > tools/perf/arch/s390/util/auxtrace.c | 2 +- > tools/perf/arch/x86/util/intel-bts.c | 6 +- > tools/perf/arch/x86/util/intel-pt.c | 7 +- > tools/perf/arch/x86/util/tsc.c | 2 +- > tools/perf/builtin-buildid-cache.c | 1 + > tools/perf/builtin-record.c | 6 +- > tools/perf/builtin-report.c | 3 +- > tools/perf/builtin-script.c | 3 +- > tools/perf/builtin-stat.c | 2 +- > tools/perf/builtin-top.c | 47 ++-- > tools/perf/builtin-trace.c | 3 +- > tools/perf/builtin.h | 2 - > tools/perf/lib/include/perf/event.h | 273 ++++++++++++++++++++ > tools/perf/perf.c | 1 + > tools/perf/tests/cpumap.c | 12 +- > tools/perf/tests/event_update.c | 16 +- > tools/perf/tests/sdt.c | 1 + > tools/perf/tests/stat.c | 8 +- > tools/perf/tests/thread-map.c | 2 +- > tools/perf/util/arm-spe.c | 6 +- > tools/perf/util/auxtrace.c | 21 +- > tools/perf/util/auxtrace.h | 8 +- > tools/perf/util/bpf-loader.c | 1 + > tools/perf/util/build-id.c | 2 +- > tools/perf/util/c++/clang-c.h | 2 +- > tools/perf/util/c++/clang-test.cpp | 4 +- > tools/perf/util/cpumap.c | 6 +- > tools/perf/util/cpumap.h | 4 +- > tools/perf/util/cs-etm.c | 4 +- > tools/perf/util/event.c | 45 ++-- > tools/perf/util/event.h | 278 +-------------------- > tools/perf/util/evlist.c | 10 + > tools/perf/util/evlist.h | 1 - > tools/perf/util/evsel.c | 3 +- > tools/perf/util/header.c | 57 ++--- > tools/perf/util/hist.c | 39 +-- > tools/perf/util/hist.h | 1 + > tools/perf/util/intel-bts.c | 6 +- > tools/perf/util/intel-pt.c | 12 +- > tools/perf/util/python.c | 4 +- > tools/perf/util/s390-cpumsf.c | 4 +- > tools/perf/util/session.c | 29 +-- > tools/perf/util/session.h | 2 +- > tools/perf/util/stat.c | 12 +- > tools/perf/util/symbol.c | 15 +- > tools/perf/util/thread_map.c | 4 +- > tools/perf/util/thread_map.h | 4 +- > tools/perf/util/util-cxx.h | 27 -- > 52 files changed, 684 insertions(+), 540 deletions(-) > delete mode 100644 tools/perf/util/util-cxx.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-08-27 1:36 Arnaldo Carvalho de Melo 2019-08-27 8:24 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-27 1:36 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andi Kleen, Benjamin Peterson, Gustavo A . R . Silva, James Clark, Souptick Joarder, Arnaldo Carvalho de Melo Hi Ingo/Thomas, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 39152ee51b77851689f9b23fde6f610d13566c39: perf/x86/intel/pt: Get rid of reverse lookup table for ToPA (2019-08-26 12:00:16 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-5.4-20190826 for you to fetch changes up to 74a1e863eb73dcc9f069b671dfb40650f3832116: perf evsel: Rename perf_missing_features::bpf_event to ::bpf (2019-08-26 19:39:11 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf report: Andi Kleen: - Make --ns time sort key output column wide enough for nanoseconds. perf script: Gustavo A. R. Silva: - Fix memory leaks in list_scripts() perf tests: James Clark: - Fixes hang in zstd compression test by changing the source of random data. perf trace: Arnaldo Carvalho de Melo: - augmented_raw_syscalls.c BPF helper improvements. Benjamin Peterson: - Fix off-by-one error in ioctl cmd->string table. libperf: Jiri Olsa: - Move most PERF_RECORD_ structs to perf/event.h. headers: Arnaldo Carvalho de Melo: - Move cacheline related routines to separate source files. - Move record_opts and other record declarations to separate files. - Explicitly add some more needed headers here and there. Souptick Joarder: - Remove some duplicate include directives. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (2): perf report: Use timestamp__scnprintf_nsec() for time sort key perf report: Fix --ns time sort key output Arnaldo Carvalho de Melo (15): perf cpumap: No need to include perf.h, ditch it perf stat: Remove needless headers from stat.h perf record: Move record_opts and other record decls out of perf.h perf cacheline: Move cacheline related routines to separate files perf srcline: Add missing srcline.h header to files needing its defs perf sort: Remove needless headers from sort.h, provide fwd struct decls perf augmented_raw_syscalls: Rename augmented_filename to augmented_arg perf augmented_raw_syscalls: Postpone tmp map lookup to after pid_filter perf augmented_raw_syscalls: Introduce helper to get the scratch space perf augmented_raw_syscalls: Reduce perf_event_output() boilerplate libperf: Rename the PERF_RECORD_ structs to have a "perf" suffix perf tools: Rename perf_event::ksymbol_event to perf_event::ksymbol perf tools: Rename perf_event::bpf_event to perf_event::bpf perf tool: Rename perf_tool::bpf_event to bpf perf evsel: Rename perf_missing_features::bpf_event to ::bpf Benjamin Peterson (1): perf trace beauty ioctl: Fix off-by-one error in cmd->string table Gustavo A. R. Silva (1): perf script: Fix memory leaks in list_scripts() James Clark (1): perf tests: Fixes hang in zstd compression test by changing the source of random data Jiri Olsa (12): libperf: Add PERF_RECORD_MMAP 'struct mmap_event' to perf/event.h libperf: Add PERF_RECORD_MMAP2 'struct mmap2_event' to perf/event.h libperf: Add PERF_RECORD_COMM 'struct comm_event' to perf/event.h libperf: Add PERF_RECORD_NAMESPACES 'struct namespaces_event' to perf/event.h libperf: Add PERF_RECORD_FORK 'struct fork_event' to perf/event.h libperf: Add PERF_RECORD_LOST 'struct lost_event' to perf/event.h libperf: Add PERF_RECORD_LOST_SAMPLES 'struct lost_samples_event' to perf/event.h libperf: Add PERF_RECORD_READ 'struct read_event' to perf/event.h libperf: Add PERF_RECORD_THROTTLE 'struct throttle_event' to perf/event.h libperf: Add PERF_RECORD_KSYMBOL 'struct ksymbol_event' to perf/event.h libperf: Add PERF_RECORD_BPF_EVENT 'struct bpf_event' to perf/event.h libperf: Add PERF_RECORD_SAMPLE 'struct sample_event' to perf/event.h Souptick Joarder (1): perf tools: Remove duplicate headers tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 1 + tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 + tools/perf/arch/x86/util/intel-bts.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 3 +- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-diff.c | 2 + tools/perf/builtin-record.c | 4 +- tools/perf/builtin-report.c | 1 + tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-script.c | 7 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/examples/bpf/augmented_raw_syscalls.c | 100 +++++++-------- tools/perf/lib/include/perf/event.h | 112 ++++++++++++++++ tools/perf/perf.h | 62 --------- tools/perf/tests/backward-ring-buffer.c | 2 +- tools/perf/tests/bpf.c | 1 + tools/perf/tests/code-reading.c | 1 + tools/perf/tests/keep-tracking.c | 1 + tools/perf/tests/openat-syscall-tp-fields.c | 3 +- tools/perf/tests/parse-no-sample-id-all.c | 4 +- tools/perf/tests/perf-record.c | 2 +- tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 +- tools/perf/tests/switch-tracking.c | 1 + tools/perf/tests/task-exit.c | 1 + tools/perf/trace/beauty/ioctl.c | 2 +- tools/perf/ui/browsers/res_sample.c | 2 + tools/perf/ui/browsers/scripts.c | 8 +- tools/perf/ui/stdio/hist.c | 1 + tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 2 + tools/perf/util/auxtrace.c | 2 +- tools/perf/util/bpf-event.c | 36 +++--- tools/perf/util/bpf-event.h | 10 +- tools/perf/util/cacheline.c | 26 ++++ tools/perf/util/cacheline.h | 21 +++ tools/perf/util/callchain.c | 1 + tools/perf/util/cpumap.h | 2 - tools/perf/util/data.c | 1 - tools/perf/util/event.c | 35 +++-- tools/perf/util/event.h | 149 +++++----------------- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 22 ++-- tools/perf/util/evsel.h | 4 +- tools/perf/util/get_current_dir_name.c | 1 - tools/perf/util/hist.c | 5 +- tools/perf/util/intel-bts.c | 2 +- tools/perf/util/kvm-stat.h | 2 +- tools/perf/util/machine.c | 25 ++-- tools/perf/util/machine.h | 1 + tools/perf/util/namespaces.c | 2 +- tools/perf/util/namespaces.h | 4 +- tools/perf/util/python.c | 58 ++++----- tools/perf/util/record.c | 1 + tools/perf/util/record.h | 74 +++++++++++ tools/perf/util/session.c | 16 +-- tools/perf/util/sort.c | 12 +- tools/perf/util/sort.h | 27 +--- tools/perf/util/stat-display.c | 1 - tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 7 +- tools/perf/util/thread.c | 4 +- tools/perf/util/thread.h | 4 +- tools/perf/util/tool.h | 2 +- tools/perf/util/top.h | 1 + tools/perf/util/util.c | 20 --- tools/perf/util/util.h | 1 - 69 files changed, 493 insertions(+), 427 deletions(-) create mode 100644 tools/perf/lib/include/perf/event.h create mode 100644 tools/perf/util/cacheline.c create mode 100644 tools/perf/util/cacheline.h create mode 100644 tools/perf/util/record.h Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. Clearlinux is failing when building with libpython, but that is not a perf regression, will try to remove one compiler warning that is causing the problem when building some of the glue code files in the python files, outside perf. # export PERF_TARBALL=http://192.168.124.1/perf/perf-5.3.0-rc6.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.2.1 20190816 gcc-9-branch@274554, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 8.3.0-19) 8.3.0, clang version 7.0.1-9 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190805 [gcc-9-branch revision 274114], clang version 8.0.1 (tags/RELEASE_801/final 366581) 49 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 50 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 oraclelinux:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3.0.1), clang version 7.0.1 (tags/RELEASE_701/final) 52 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) 53 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) 54 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 55 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 62 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.10 : Ok gcc (Ubuntu 8.3.0-6ubuntu1~18.10.1) 8.3.0, clang version 7.0.0-3 (tags/RELEASE_700/final) 73 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 74 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 78 ubuntu:19.10 : Ok gcc (Ubuntu 9.1.0-9ubuntu2) 9.1.0, clang version 8.0.1-+rc4-1 (tags/RELEASE_801/rc4) # # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 74a1e863eb73 perf evsel: Rename perf_missing_features::bpf_event to ::bpf # perf version --build-options perf version 5.3.rc6.g74a1e863eb73 dwarf: [ on ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT glibc: [ on ] # HAVE_GLIBC_SUPPORT gtk2: [ on ] # HAVE_GTK2_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ on ] # HAVE_LIBBFD_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Breakpoint accounting : Ok 22: Watchpoint : 22.1: Read Only Watchpoint : Skip 22.2: Write Only Watchpoint : Ok 22.3: Read / Write Watchpoint : Ok 22.4: Modify Watchpoint : Ok 23: Number of exit events of a simple workload : Ok 24: Software clock events period values : Ok 25: Object code reading : Ok 26: Sample parsing : Ok 27: Use a dummy software event to keep tracking : Ok 28: Parse with no sample_id_all bit set : Ok 29: Filter hist entries : Ok 30: Lookup mmap thread : Ok 31: Share thread mg : Ok 32: Sort output of hist entries : Ok 33: Cumulate child hist entries : Ok 34: Track with sched_switch : Ok 35: Filter fds with revents mask in a fdarray : Ok 36: Add fd to a fdarray, making it autogrow : Ok 37: kmod_path__parse : Ok 38: Thread map : Ok 39: LLVM search and compile : 39.1: Basic BPF llvm compile : Ok 39.2: kbuild searching : Ok 39.3: Compile source for BPF prologue generation : Ok 39.4: Compile source for BPF relocation : Ok 40: Session topology : Ok 41: BPF filter : 41.1: Basic BPF filtering : Ok 41.2: BPF pinning : Ok 41.3: BPF prologue generation : Ok 41.4: BPF relocation checker : Ok 42: Synthesize thread map : Ok 43: Remove thread map : Ok 44: Synthesize cpu map : Ok 45: Synthesize stat config : Ok 46: Synthesize stat : Ok 47: Synthesize stat round : Ok 48: Synthesize attr update : Ok 49: Event times : Ok 50: Read backward ring buffer : Ok 51: Print cpu map : Ok 52: Probe SDT events : Ok 53: is_printable_array : Ok 54: Print bitmap : Ok 55: perf hooks : Ok 56: builtin clang support : Skip (not compiled in) 57: unit_number__scnprintf : Ok 58: mem2node : Ok 59: time utils : Ok 60: map_groups__merge_in : Ok 61: x86 rdpmc : Ok 62: Convert perf time to TSC : Ok 63: DWARF unwind : Ok 64: x86 instruction decoder - new instructions : Ok 65: Intel PT packet decoder : Ok 66: x86 bp modify : Ok 67: probe libc's inet_pton & backtrace it with ping : Ok 68: Use vfs_getname probe to get syscall args filenames : Ok 69: Add vfs_getname probe to get syscall args filenames : Ok 70: Check open filename arg using perf trace + vfs_getname: Ok 71: Zstd perf.data compression/decompression : Ok $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_perf_o_O: make perf.o make_no_backtrace_O: make NO_BACKTRACE=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_util_map_o_O: make util/map.o make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_gtk2_O: make NO_GTK2=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libperl_O: make NO_LIBPERL=1 make_install_bin_O: make install-bin make_tags_O: make tags make_install_prefix_O: make install prefix=/tmp/krava make_with_babeltrace_O: make LIBBABELTRACE=1 make_doc_O: make doc make_cscope_O: make cscope make_pure_O: make make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libbpf_O: make NO_LIBBPF=1 make_help_O: make help make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_slang_O: make NO_SLANG=1 make_clean_all_O: make clean all make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_debug_O: make DEBUG=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_newt_O: make NO_NEWT=1 make_static_O: make LDFLAGS=-static make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libelf_O: make NO_LIBELF=1 make_install_O: make install make_no_libunwind_O: make NO_LIBUNWIND=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-08-27 1:36 Arnaldo Carvalho de Melo @ 2019-08-27 8:24 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-08-27 8:24 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Andi Kleen, Benjamin Peterson, Gustavo A . R . Silva, James Clark, Souptick Joarder, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 39152ee51b77851689f9b23fde6f610d13566c39: > > perf/x86/intel/pt: Get rid of reverse lookup table for ToPA (2019-08-26 12:00:16 +0200) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-5.4-20190826 > > for you to fetch changes up to 74a1e863eb73dcc9f069b671dfb40650f3832116: > > perf evsel: Rename perf_missing_features::bpf_event to ::bpf (2019-08-26 19:39:11 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf report: > > Andi Kleen: > > - Make --ns time sort key output column wide enough for nanoseconds. > > perf script: > > Gustavo A. R. Silva: > > - Fix memory leaks in list_scripts() > > perf tests: > > James Clark: > > - Fixes hang in zstd compression test by changing the source of random data. > > perf trace: > > Arnaldo Carvalho de Melo: > > - augmented_raw_syscalls.c BPF helper improvements. > > Benjamin Peterson: > > - Fix off-by-one error in ioctl cmd->string table. > > libperf: > > Jiri Olsa: > > - Move most PERF_RECORD_ structs to perf/event.h. > > headers: > > Arnaldo Carvalho de Melo: > > - Move cacheline related routines to separate source files. > > - Move record_opts and other record declarations to separate files. > > - Explicitly add some more needed headers here and there. > > Souptick Joarder: > > - Remove some duplicate include directives. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (2): > perf report: Use timestamp__scnprintf_nsec() for time sort key > perf report: Fix --ns time sort key output > > Arnaldo Carvalho de Melo (15): > perf cpumap: No need to include perf.h, ditch it > perf stat: Remove needless headers from stat.h > perf record: Move record_opts and other record decls out of perf.h > perf cacheline: Move cacheline related routines to separate files > perf srcline: Add missing srcline.h header to files needing its defs > perf sort: Remove needless headers from sort.h, provide fwd struct decls > perf augmented_raw_syscalls: Rename augmented_filename to augmented_arg > perf augmented_raw_syscalls: Postpone tmp map lookup to after pid_filter > perf augmented_raw_syscalls: Introduce helper to get the scratch space > perf augmented_raw_syscalls: Reduce perf_event_output() boilerplate > libperf: Rename the PERF_RECORD_ structs to have a "perf" suffix > perf tools: Rename perf_event::ksymbol_event to perf_event::ksymbol > perf tools: Rename perf_event::bpf_event to perf_event::bpf > perf tool: Rename perf_tool::bpf_event to bpf > perf evsel: Rename perf_missing_features::bpf_event to ::bpf > > Benjamin Peterson (1): > perf trace beauty ioctl: Fix off-by-one error in cmd->string table > > Gustavo A. R. Silva (1): > perf script: Fix memory leaks in list_scripts() > > James Clark (1): > perf tests: Fixes hang in zstd compression test by changing the source of random data > > Jiri Olsa (12): > libperf: Add PERF_RECORD_MMAP 'struct mmap_event' to perf/event.h > libperf: Add PERF_RECORD_MMAP2 'struct mmap2_event' to perf/event.h > libperf: Add PERF_RECORD_COMM 'struct comm_event' to perf/event.h > libperf: Add PERF_RECORD_NAMESPACES 'struct namespaces_event' to perf/event.h > libperf: Add PERF_RECORD_FORK 'struct fork_event' to perf/event.h > libperf: Add PERF_RECORD_LOST 'struct lost_event' to perf/event.h > libperf: Add PERF_RECORD_LOST_SAMPLES 'struct lost_samples_event' to perf/event.h > libperf: Add PERF_RECORD_READ 'struct read_event' to perf/event.h > libperf: Add PERF_RECORD_THROTTLE 'struct throttle_event' to perf/event.h > libperf: Add PERF_RECORD_KSYMBOL 'struct ksymbol_event' to perf/event.h > libperf: Add PERF_RECORD_BPF_EVENT 'struct bpf_event' to perf/event.h > libperf: Add PERF_RECORD_SAMPLE 'struct sample_event' to perf/event.h > > Souptick Joarder (1): > perf tools: Remove duplicate headers > > tools/perf/arch/arm/util/cs-etm.c | 2 +- > tools/perf/arch/arm64/util/arm-spe.c | 1 + > tools/perf/arch/s390/util/auxtrace.c | 1 + > tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 + > tools/perf/arch/x86/util/intel-bts.c | 1 + > tools/perf/arch/x86/util/intel-pt.c | 3 +- > tools/perf/builtin-c2c.c | 1 + > tools/perf/builtin-diff.c | 2 + > tools/perf/builtin-record.c | 4 +- > tools/perf/builtin-report.c | 1 + > tools/perf/builtin-sched.c | 2 +- > tools/perf/builtin-script.c | 7 +- > tools/perf/builtin-stat.c | 2 +- > tools/perf/builtin-trace.c | 1 + > tools/perf/examples/bpf/augmented_raw_syscalls.c | 100 +++++++-------- > tools/perf/lib/include/perf/event.h | 112 ++++++++++++++++ > tools/perf/perf.h | 62 --------- > tools/perf/tests/backward-ring-buffer.c | 2 +- > tools/perf/tests/bpf.c | 1 + > tools/perf/tests/code-reading.c | 1 + > tools/perf/tests/keep-tracking.c | 1 + > tools/perf/tests/openat-syscall-tp-fields.c | 3 +- > tools/perf/tests/parse-no-sample-id-all.c | 4 +- > tools/perf/tests/perf-record.c | 2 +- > tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 +- > tools/perf/tests/switch-tracking.c | 1 + > tools/perf/tests/task-exit.c | 1 + > tools/perf/trace/beauty/ioctl.c | 2 +- > tools/perf/ui/browsers/res_sample.c | 2 + > tools/perf/ui/browsers/scripts.c | 8 +- > tools/perf/ui/stdio/hist.c | 1 + > tools/perf/util/Build | 1 + > tools/perf/util/annotate.c | 2 + > tools/perf/util/auxtrace.c | 2 +- > tools/perf/util/bpf-event.c | 36 +++--- > tools/perf/util/bpf-event.h | 10 +- > tools/perf/util/cacheline.c | 26 ++++ > tools/perf/util/cacheline.h | 21 +++ > tools/perf/util/callchain.c | 1 + > tools/perf/util/cpumap.h | 2 - > tools/perf/util/data.c | 1 - > tools/perf/util/event.c | 35 +++-- > tools/perf/util/event.h | 149 +++++----------------- > tools/perf/util/evlist.c | 2 +- > tools/perf/util/evsel.c | 22 ++-- > tools/perf/util/evsel.h | 4 +- > tools/perf/util/get_current_dir_name.c | 1 - > tools/perf/util/hist.c | 5 +- > tools/perf/util/intel-bts.c | 2 +- > tools/perf/util/kvm-stat.h | 2 +- > tools/perf/util/machine.c | 25 ++-- > tools/perf/util/machine.h | 1 + > tools/perf/util/namespaces.c | 2 +- > tools/perf/util/namespaces.h | 4 +- > tools/perf/util/python.c | 58 ++++----- > tools/perf/util/record.c | 1 + > tools/perf/util/record.h | 74 +++++++++++ > tools/perf/util/session.c | 16 +-- > tools/perf/util/sort.c | 12 +- > tools/perf/util/sort.h | 27 +--- > tools/perf/util/stat-display.c | 1 - > tools/perf/util/stat.c | 1 + > tools/perf/util/stat.h | 7 +- > tools/perf/util/thread.c | 4 +- > tools/perf/util/thread.h | 4 +- > tools/perf/util/tool.h | 2 +- > tools/perf/util/top.h | 1 + > tools/perf/util/util.c | 20 --- > tools/perf/util/util.h | 1 - > 69 files changed, 493 insertions(+), 427 deletions(-) > create mode 100644 tools/perf/lib/include/perf/event.h > create mode 100644 tools/perf/util/cacheline.c > create mode 100644 tools/perf/util/cacheline.h > create mode 100644 tools/perf/util/record.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-08-22 21:00 Arnaldo Carvalho de Melo 2019-08-23 10:30 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-22 21:00 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Gerald Baeza, Nageswara R Sastry, Ravi Bangoria, 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 4e92b18e5b0b61211f4511cdbc5803300eeead40: Merge tag 'perf-core-for-mingo-5.4-20190820' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-20 21:38:22 +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-20190822 for you to fetch changes up to d9c5c083416500e95da098c01be092b937def7fa: libperf: Fix alignment trap with xyarray contents in 'perf stat' (2019-08-22 17:16:57 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf c2c: Ravi Bangoria: - Fix report with offline cpus. libperf: Gerald BAEZA: - Fix alignment trap with xyarray contents in 'perf stat', noticed on ARMv7. Jiri Olsa: - Move some more cpu_map and thread_map methods from tools/perf/util/ to libperf. headers: Arnaldo Carvalho de Melo: - Do some house cleaning on the headers, removing needless includes in some places, providing forward declarations when those are the only thing needed, and fixing up the fallout from that for cases where we were using stuff and not adding the necessary headers. Should speed up the build and avoid needless rebuilds when something unrelated gets touched. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (18): perf arm64: Add missing debug.h header perf kvm s390: Add missing string.h header perf metricgroup: Remove needless includes from metricgroup.h perf evsel: Move xyarray.h from evsel.c to evsel.h to reduce include dep tree perf counts: Add missing headers needed for types used perf bpf: Add missing xyarray.h header perf evlist: Add missing xyarray.h header perf script: Add missing counts.h perf tests: Add missing counts.h perf stat: Add missing counts.h perf scripting python: Add missing counts.h header perf evsel: Add missing perf/evsel.h header in util/evsel.h perf evsel: Remove needless counts.h header from util/evsel.h perf evsel: Remove needless stddef.h from util/evsel.h perf evsel: util/evsel.h needs stdio.h as it uses FILE perf x86 kvm-stat: Add missing string.h header perf evsel: Switch to libperf's cpumap.h perf cpumap: Remove needless includes from cpumap.h Gerald BAEZA (1): libperf: Fix alignment trap with xyarray contents in 'perf stat' Jiri Olsa (5): tools headers: Add missing perf_event.h include perf tools: Use perf_cpu_map__nr instead of cpu_map__nr libperf: Move perf's cpu_map__empty() to perf_cpu_map__empty() libperf: Move perf's cpu_map__idx() to perf_cpu_map__idx() libperf: Add perf_thread_map__nr/perf_thread_map__pid functions Ravi Bangoria (1): perf c2c: Fix report with offline cpus tools/include/linux/ring_buffer.h | 1 + tools/perf/arch/arm/util/cs-etm.c | 12 ++++---- tools/perf/arch/arm64/util/header.c | 1 + tools/perf/arch/s390/util/kvm-stat.c | 1 + tools/perf/arch/x86/util/header.c | 1 + tools/perf/arch/x86/util/intel-bts.c | 4 +-- tools/perf/arch/x86/util/intel-pt.c | 10 +++---- tools/perf/arch/x86/util/kvm-stat.c | 1 + tools/perf/builtin-c2c.c | 4 +-- tools/perf/builtin-ftrace.c | 2 +- tools/perf/builtin-script.c | 5 ++-- tools/perf/builtin-stat.c | 8 +++--- tools/perf/builtin-trace.c | 4 +-- tools/perf/lib/cpumap.c | 17 ++++++++++++ tools/perf/lib/include/internal/cpumap.h | 2 ++ tools/perf/lib/include/internal/xyarray.h | 3 +- tools/perf/lib/include/perf/cpumap.h | 2 ++ tools/perf/lib/include/perf/threadmap.h | 2 ++ tools/perf/lib/libperf.map | 3 ++ tools/perf/lib/threadmap.c | 10 +++++++ tools/perf/tests/mem2node.c | 1 + tools/perf/tests/openat-syscall-all-cpus.c | 1 + tools/perf/tests/openat-syscall.c | 1 + tools/perf/tests/thread-map.c | 6 ++-- tools/perf/util/auxtrace.c | 4 +-- tools/perf/util/bpf-loader.c | 2 ++ tools/perf/util/counts.h | 4 +++ tools/perf/util/cpumap.c | 22 ++++----------- tools/perf/util/cpumap.h | 17 ++---------- tools/perf/util/cputopo.c | 2 ++ tools/perf/util/env.c | 1 + tools/perf/util/event.c | 10 +++---- tools/perf/util/evlist.c | 32 ++++++++++++---------- tools/perf/util/evsel.c | 6 ++-- tools/perf/util/evsel.h | 12 +++++--- tools/perf/util/mem2node.c | 1 + tools/perf/util/metricgroup.c | 3 +- tools/perf/util/metricgroup.h | 13 +++++---- tools/perf/util/mmap.c | 2 +- tools/perf/util/pmu.c | 1 + tools/perf/util/record.c | 2 +- .../util/scripting-engines/trace-event-python.c | 3 +- tools/perf/util/stat-display.c | 7 +++-- tools/perf/util/stat.c | 7 +++-- tools/perf/util/svghelper.c | 1 + tools/perf/util/thread_map.c | 4 +-- tools/perf/util/thread_map.h | 10 ------- 47 files changed, 155 insertions(+), 113 deletions(-) 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-rc5.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190808 gcc-9-branch@274204, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 8.3.0-19) 8.3.0, clang version 7.0.1-9 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190805 [gcc-9-branch revision 274114], clang version 8.0.1 (tags/RELEASE_801/final 366581) 49 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 50 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 oraclelinux:8 : Ok gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3.0.1), clang version 7.0.1 (tags/RELEASE_701/final) 52 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) 53 ubuntu:14.04 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) 54 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) 55 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 61 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 62 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 72 ubuntu:18.10 : Ok gcc (Ubuntu 8.3.0-6ubuntu1~18.10.1) 8.3.0, clang version 7.0.0-3 (tags/RELEASE_700/final) 73 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 74 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 77 ubuntu:19.10 : Ok gcc (Ubuntu 9.1.0-9ubuntu2) 9.1.0, clang version 8.0.1-+rc4-1 (tags/RELEASE_801/rc4) # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 d9c5c0834165 libperf: Fix alignment trap with xyarray contents in 'perf stat' # perf version --build-options perf version 5.3.rc5.gd9c5c0834165 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_debug_O: make DEBUG=1 make_doc_O: make doc make_no_newt_O: make NO_NEWT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_pure_O: make make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libunwind_O: make NO_LIBUNWIND=1 make_tags_O: make tags make_with_clangllvm_O: make LIBCLANGLLVM=1 make_static_O: make LDFLAGS=-static make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_slang_O: make NO_SLANG=1 make_help_O: make help make_no_libbpf_O: make NO_LIBBPF=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_clean_all_O: make clean all make_no_libelf_O: make NO_LIBELF=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_install_O: make install make_install_prefix_O: make install prefix=/tmp/krava make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_gtk2_O: make NO_GTK2=1 make_no_demangle_O: make NO_DEMANGLE=1 make_cscope_O: make cscope make_with_babeltrace_O: make LIBBABELTRACE=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_install_bin_O: make install-bin make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_perf_o_O: make perf.o make_util_map_o_O: make util/map.o make_no_libnuma_O: make NO_LIBNUMA=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libperl_O: make NO_LIBPERL=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-08-22 21:00 Arnaldo Carvalho de Melo @ 2019-08-23 10:30 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-08-23 10:30 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Gerald Baeza, Nageswara R Sastry, Ravi Bangoria, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 4e92b18e5b0b61211f4511cdbc5803300eeead40: > > Merge tag 'perf-core-for-mingo-5.4-20190820' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-20 21:38:22 +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-20190822 > > for you to fetch changes up to d9c5c083416500e95da098c01be092b937def7fa: > > libperf: Fix alignment trap with xyarray contents in 'perf stat' (2019-08-22 17:16:57 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf c2c: > > Ravi Bangoria: > > - Fix report with offline cpus. > > libperf: > > Gerald BAEZA: > > - Fix alignment trap with xyarray contents in 'perf stat', noticed on ARMv7. > > Jiri Olsa: > > - Move some more cpu_map and thread_map methods from tools/perf/util/ to libperf. > > headers: > > Arnaldo Carvalho de Melo: > > - Do some house cleaning on the headers, removing needless includes in some places, > providing forward declarations when those are the only thing needed, and fixing > up the fallout from that for cases where we were using stuff and not adding the > necessary headers. Should speed up the build and avoid needless rebuilds when > something unrelated gets touched. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (18): > perf arm64: Add missing debug.h header > perf kvm s390: Add missing string.h header > perf metricgroup: Remove needless includes from metricgroup.h > perf evsel: Move xyarray.h from evsel.c to evsel.h to reduce include dep tree > perf counts: Add missing headers needed for types used > perf bpf: Add missing xyarray.h header > perf evlist: Add missing xyarray.h header > perf script: Add missing counts.h > perf tests: Add missing counts.h > perf stat: Add missing counts.h > perf scripting python: Add missing counts.h header > perf evsel: Add missing perf/evsel.h header in util/evsel.h > perf evsel: Remove needless counts.h header from util/evsel.h > perf evsel: Remove needless stddef.h from util/evsel.h > perf evsel: util/evsel.h needs stdio.h as it uses FILE > perf x86 kvm-stat: Add missing string.h header > perf evsel: Switch to libperf's cpumap.h > perf cpumap: Remove needless includes from cpumap.h > > Gerald BAEZA (1): > libperf: Fix alignment trap with xyarray contents in 'perf stat' > > Jiri Olsa (5): > tools headers: Add missing perf_event.h include > perf tools: Use perf_cpu_map__nr instead of cpu_map__nr > libperf: Move perf's cpu_map__empty() to perf_cpu_map__empty() > libperf: Move perf's cpu_map__idx() to perf_cpu_map__idx() > libperf: Add perf_thread_map__nr/perf_thread_map__pid functions > > Ravi Bangoria (1): > perf c2c: Fix report with offline cpus > > tools/include/linux/ring_buffer.h | 1 + > tools/perf/arch/arm/util/cs-etm.c | 12 ++++---- > tools/perf/arch/arm64/util/header.c | 1 + > tools/perf/arch/s390/util/kvm-stat.c | 1 + > tools/perf/arch/x86/util/header.c | 1 + > tools/perf/arch/x86/util/intel-bts.c | 4 +-- > tools/perf/arch/x86/util/intel-pt.c | 10 +++---- > tools/perf/arch/x86/util/kvm-stat.c | 1 + > tools/perf/builtin-c2c.c | 4 +-- > tools/perf/builtin-ftrace.c | 2 +- > tools/perf/builtin-script.c | 5 ++-- > tools/perf/builtin-stat.c | 8 +++--- > tools/perf/builtin-trace.c | 4 +-- > tools/perf/lib/cpumap.c | 17 ++++++++++++ > tools/perf/lib/include/internal/cpumap.h | 2 ++ > tools/perf/lib/include/internal/xyarray.h | 3 +- > tools/perf/lib/include/perf/cpumap.h | 2 ++ > tools/perf/lib/include/perf/threadmap.h | 2 ++ > tools/perf/lib/libperf.map | 3 ++ > tools/perf/lib/threadmap.c | 10 +++++++ > tools/perf/tests/mem2node.c | 1 + > tools/perf/tests/openat-syscall-all-cpus.c | 1 + > tools/perf/tests/openat-syscall.c | 1 + > tools/perf/tests/thread-map.c | 6 ++-- > tools/perf/util/auxtrace.c | 4 +-- > tools/perf/util/bpf-loader.c | 2 ++ > tools/perf/util/counts.h | 4 +++ > tools/perf/util/cpumap.c | 22 ++++----------- > tools/perf/util/cpumap.h | 17 ++---------- > tools/perf/util/cputopo.c | 2 ++ > tools/perf/util/env.c | 1 + > tools/perf/util/event.c | 10 +++---- > tools/perf/util/evlist.c | 32 ++++++++++++---------- > tools/perf/util/evsel.c | 6 ++-- > tools/perf/util/evsel.h | 12 +++++--- > tools/perf/util/mem2node.c | 1 + > tools/perf/util/metricgroup.c | 3 +- > tools/perf/util/metricgroup.h | 13 +++++---- > tools/perf/util/mmap.c | 2 +- > tools/perf/util/pmu.c | 1 + > tools/perf/util/record.c | 2 +- > .../util/scripting-engines/trace-event-python.c | 3 +- > tools/perf/util/stat-display.c | 7 +++-- > tools/perf/util/stat.c | 7 +++-- > tools/perf/util/svghelper.c | 1 + > tools/perf/util/thread_map.c | 4 +-- > tools/perf/util/thread_map.h | 10 ------- > 47 files changed, 155 insertions(+), 113 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-08-20 19:27 Arnaldo Carvalho de Melo 2019-08-20 19:39 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-20 19:27 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov, Guenter Roeck, Leo Yan, Mathieu Poirier, Steven Rostedt, Tzvetomir Stoyanov, 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 cfb104ca8a26affb28d81720a4ed49c30b2a3b01: Merge tag 'perf-core-for-mingo-5.4-20190816' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-16 22:43:42 +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-20190820 for you to fetch changes up to b81d39c7a1efb83caa3f4419939a46e96191abb6: libperf: Fix arch include paths (2019-08-20 12:29:36 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: callchains: Alexey Budankov: - Allow collecting LBR together with DWARF callchains, for workloads where the userspace stack size collected is not big enough for pure DWARF based unwinding. - Dump the LBR call stack in 'perf report -D'. perf top: Arnaldo Carvalho de Melo: - Show visual cue at start to state that the minimal set of samples are being collected prior to sorting/bucketizing/displaying. CoreSight (ARM hardware tracing): Leo Yan: - Support sample flags 'insn' and 'insnlen'. core: Adrian Hunter: - Add comment for 'idx' member in 'struct perf_sample_id. tools headers: Arnaldo Carvalho de Melo: - Synchronize linux/bits.h, which required grabbing a copy of the kernel const.h headers and some changes in the ordering of header directories. - Sync x86's asm/cpufeatures.h with the with the kernel, no change in any of the tools. libperf: Jiri Olsa: - Fix arch include paths. libtraceevent: Steven Rostedt (VMware): - Fix "robust" test of do_generate_dynamic_list_file. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (1): perf evsel: Add comment for 'idx' member in 'struct perf_sample_id Alexey Budankov (3): perf record: Enable LBR callstack capture jointly with thread stack perf report: Dump LBR callstack data by -D jointly with thread stack perf report: Prefer DWARF callstacks to LBR ones when captured both Arnaldo Carvalho de Melo (10): tools headers: Add limits.h to access __WORDSIZE perf tools: tools/include should come before tools/uapi/include tools headers: Grab copy of linux/const.h, needed by linux/bits.h tools headers: Synchronize linux/bits.h with the kernel sources tools arch x86: Sync asm/cpufeatures.h with the with the kernel perf ui: Make 'exit_msg' optional in ui__question_window() perf ui: Introduce non-interactive ui__info_window() function perf ui browser: Allow specifying message to show when no samples are available to display perf top: Show info message while collecting samples tools headers: Fixup bitsperlong per arch includes Jiri Olsa (1): libperf: Fix arch include paths Leo Yan (1): perf cs-etm: Support sample flags 'insn' and 'insnlen' Steven Rostedt (VMware) (1): tools lib traceevent: Fix "robust" test of do_generate_dynamic_list_file tools/arch/x86/include/asm/cpufeatures.h | 3 +++ tools/include/linux/bitops.h | 1 + tools/include/linux/bits.h | 17 +++++++++------ tools/include/linux/const.h | 9 ++++++++ tools/include/uapi/asm/bitsperlong.h | 18 ++++++++-------- tools/include/uapi/linux/const.h | 31 ++++++++++++++++++++++++++ tools/lib/traceevent/Makefile | 4 ++-- tools/perf/Makefile.config | 2 +- tools/perf/builtin-report.c | 2 ++ tools/perf/check-headers.sh | 2 ++ tools/perf/lib/Makefile | 2 +- tools/perf/ui/browser.c | 2 ++ tools/perf/ui/browser.h | 1 + tools/perf/ui/browsers/hists.c | 3 +++ tools/perf/ui/tui/util.c | 37 ++++++++++++++++++++++---------- tools/perf/ui/util.h | 2 ++ tools/perf/util/cs-etm.c | 35 +++++++++++++++++++++++++++++- tools/perf/util/evsel.h | 7 ++++++ tools/perf/util/parse-branch-options.c | 1 + tools/perf/util/session.c | 31 +++++++++++++++----------- 20 files changed, 166 insertions(+), 44 deletions(-) create mode 100644 tools/include/linux/const.h create mode 100644 tools/include/uapi/linux/const.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-rc4.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190808 gcc-9-branch@274204, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 8.3.0-19) 8.3.0, clang version 7.0.1-9 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/fi 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190723 [gcc-9-branch revision 273734], 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.1.0-9ubuntu2) 9.1.0, clang version 8.0.1-+rc4-1 (tags/RELEASE_801/rc4) # # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 b81d39c7a1ef libperf: Fix arch include paths # perf version --build-options perf version 5.3.rc4.gb81d39c7a1ef 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/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_libelf_O: make NO_LIBELF=1 make_util_map_o_O: make util/map.o make_debug_O: make DEBUG=1 make_no_libperl_O: make NO_LIBPERL=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_backtrace_O: make NO_BACKTRACE=1 make_install_O: make install make_perf_o_O: make perf.o make_pure_O: make make_no_gtk2_O: make NO_GTK2=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_doc_O: make doc make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_help_O: make help make_install_bin_O: make install-bin make_no_demangle_O: make NO_DEMANGLE=1 make_no_newt_O: make NO_NEWT=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_install_prefix_O: make install prefix=/tmp/krava make_static_O: make LDFLAGS=-static make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_slang_O: make NO_SLANG=1 make_cscope_O: make cscope make_with_babeltrace_O: make LIBBABELTRACE=1 make_clean_all_O: make clean all make_no_libbpf_O: make NO_LIBBPF=1 make_tags_O: make tags make_no_libpython_O: make NO_LIBPYTHON=1 OK make: Leaving directory `/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-08-20 19:27 Arnaldo Carvalho de Melo @ 2019-08-20 19:39 ` Ingo Molnar 2019-08-20 19:44 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 160+ messages in thread From: Ingo Molnar @ 2019-08-20 19:39 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Guenter Roeck, Leo Yan, Mathieu Poirier, Steven Rostedt, Tzvetomir Stoyanov, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo/Thomas, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit cfb104ca8a26affb28d81720a4ed49c30b2a3b01: > > Merge tag 'perf-core-for-mingo-5.4-20190816' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-16 22:43:42 +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-20190820 > > for you to fetch changes up to b81d39c7a1efb83caa3f4419939a46e96191abb6: > > libperf: Fix arch include paths (2019-08-20 12:29:36 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > callchains: > > Alexey Budankov: > > - Allow collecting LBR together with DWARF callchains, for workloads > where the userspace stack size collected is not big enough for > pure DWARF based unwinding. > > - Dump the LBR call stack in 'perf report -D'. > > perf top: > > Arnaldo Carvalho de Melo: > > - Show visual cue at start to state that the minimal set of samples > are being collected prior to sorting/bucketizing/displaying. > > CoreSight (ARM hardware tracing): > > Leo Yan: > > - Support sample flags 'insn' and 'insnlen'. > > core: > > Adrian Hunter: > > - Add comment for 'idx' member in 'struct perf_sample_id. > > tools headers: > > Arnaldo Carvalho de Melo: > > - Synchronize linux/bits.h, which required grabbing a copy of the kernel > const.h headers and some changes in the ordering of header directories. > > - Sync x86's asm/cpufeatures.h with the with the kernel, no change in > any of the tools. > > libperf: > > Jiri Olsa: > > - Fix arch include paths. > > libtraceevent: > > Steven Rostedt (VMware): > > - Fix "robust" test of do_generate_dynamic_list_file. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (1): > perf evsel: Add comment for 'idx' member in 'struct perf_sample_id > > Alexey Budankov (3): > perf record: Enable LBR callstack capture jointly with thread stack > perf report: Dump LBR callstack data by -D jointly with thread stack > perf report: Prefer DWARF callstacks to LBR ones when captured both > > Arnaldo Carvalho de Melo (10): > tools headers: Add limits.h to access __WORDSIZE > perf tools: tools/include should come before tools/uapi/include > tools headers: Grab copy of linux/const.h, needed by linux/bits.h > tools headers: Synchronize linux/bits.h with the kernel sources > tools arch x86: Sync asm/cpufeatures.h with the with the kernel > perf ui: Make 'exit_msg' optional in ui__question_window() > perf ui: Introduce non-interactive ui__info_window() function > perf ui browser: Allow specifying message to show when no samples are available to display > perf top: Show info message while collecting samples > tools headers: Fixup bitsperlong per arch includes > > Jiri Olsa (1): > libperf: Fix arch include paths > > Leo Yan (1): > perf cs-etm: Support sample flags 'insn' and 'insnlen' > > Steven Rostedt (VMware) (1): > tools lib traceevent: Fix "robust" test of do_generate_dynamic_list_file > > tools/arch/x86/include/asm/cpufeatures.h | 3 +++ > tools/include/linux/bitops.h | 1 + > tools/include/linux/bits.h | 17 +++++++++------ > tools/include/linux/const.h | 9 ++++++++ > tools/include/uapi/asm/bitsperlong.h | 18 ++++++++-------- > tools/include/uapi/linux/const.h | 31 ++++++++++++++++++++++++++ > tools/lib/traceevent/Makefile | 4 ++-- > tools/perf/Makefile.config | 2 +- > tools/perf/builtin-report.c | 2 ++ > tools/perf/check-headers.sh | 2 ++ > tools/perf/lib/Makefile | 2 +- > tools/perf/ui/browser.c | 2 ++ > tools/perf/ui/browser.h | 1 + > tools/perf/ui/browsers/hists.c | 3 +++ > tools/perf/ui/tui/util.c | 37 ++++++++++++++++++++++---------- > tools/perf/ui/util.h | 2 ++ > tools/perf/util/cs-etm.c | 35 +++++++++++++++++++++++++++++- > tools/perf/util/evsel.h | 7 ++++++ > tools/perf/util/parse-branch-options.c | 1 + > tools/perf/util/session.c | 31 +++++++++++++++----------- > 20 files changed, 166 insertions(+), 44 deletions(-) > create mode 100644 tools/include/linux/const.h > create mode 100644 tools/include/uapi/linux/const.h Pulled, thanks a lot Arnaldo! This one's very nice: > Arnaldo Carvalho de Melo (10): > perf top: Show info message while collecting samples :-) Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-08-20 19:39 ` Ingo Molnar @ 2019-08-20 19:44 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-20 19:44 UTC (permalink / raw) To: Ingo Molnar Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Guenter Roeck, Leo Yan, Mathieu Poirier, Steven Rostedt, Tzvetomir Stoyanov, Arnaldo Carvalho de Melo Em Tue, Aug 20, 2019 at 09:39:53PM +0200, Ingo Molnar escreveu: > Pulled, thanks a lot Arnaldo! Wow, that was fast, thanks! > This one's very nice: > > > Arnaldo Carvalho de Melo (10): > > perf top: Show info message while collecting samples > > :-) Yeah, we need to polish these kind of little details, pressing 'C' and getting callchains enabled/disabled would be nice as well in 'perf top', just thought about that :-) - Arnaldo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-08-16 20:16 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-16 20:16 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Florian Weimer, William Cohen, Haiyan Song, John Keeping, 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 4511708b9a044f2bc83c7c7f7f8a2c45ec488219: Merge tag 'perf-core-for-mingo-5.4-20190814' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-08-15 11:10:38 +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-20190816 for you to fetch changes up to e2736219e6ca3117e10651e215b96d66775220da: perf unwind: Remove unnecessary test (2019-08-16 12:30:14 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: report/script/trace/top: Arnaldo Carvalho de Melo: - Allow specifying marker events demarcating when to consider the other events, i.e. one now can state something like: # perf probe kernel_function # perf record -e cycles,probe:kernel_function And then, in 'perf script' or 'perf report' say: # perf report --switch-on=probe:kernel_function And then the cycles event samples will be considered only after we find the first probe:kernel_function event. There is also --switch-off=event, to make it stop considering events out of some window, say to avoid some winding down of a workload. The same can be done with the "live mode" tools: 'perf top' and 'perf trace'. There are examples in the cset comments showing how to use it with SDT events in things like 'systemtap', that have those tracepoint-like events for the start/end of passes, etc. Another example involves selecting scheduler events + entry/exit of a syscall, using the syscalls tracepoints, one can then see the scheduler events that take place while that syscall is being processed. In the future this should be possible in record/top/trace via eBPF where the perf tools would hook into the marker events and enable events put in place but not enabled when the on/off conditions are the desired ones, reducing the amount of events sampled, but this userspace only solution should be good enough for many scenarios. perf vendor events intel: Haiyan Song: - Add Tremontx event file v1.02. unwind: John Keeping: - Fix callchain unwinding when tid != pid, that was working only for the thread group leader. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (13): perf script: Allow specifying event to switch on processing of other events perf script: Allow showing the --switch-on event perf script: Allow specifying event to switch off processing of other events perf evswitch: Move struct to a separate header to use in other tools perf evswitch: Move switch logic to use in other tools perf evswitch: Add the names of on/off events perf evswitch: Introduce OPTS_EVSWITCH() for cmd line processing perf evswitch: Introduce init() method to set the on/off evsels from the command line perf evswitch: Move enoent error message printing to separate function perf evswitch: Add hint when not finding specified on/off events perf trace: Add --switch-on/--switch-off events perf top: Add --switch-on/--switch-off events perf report: Add --switch-on/--switch-off events Haiyan Song (1): perf vendor events intel: Add Tremontx event file v1.02 John Keeping (3): perf map: Use zalloc for map_groups perf unwind: Fix libunwind when tid != pid perf unwind: Remove unnecessary test tools/perf/Documentation/perf-report.txt | 17 + tools/perf/Documentation/perf-script.txt | 9 + tools/perf/Documentation/perf-top.txt | 38 ++ tools/perf/Documentation/perf-trace.txt | 9 + tools/perf/builtin-report.c | 10 + tools/perf/builtin-script.c | 10 + tools/perf/builtin-top.c | 10 +- tools/perf/builtin-trace.c | 10 + tools/perf/pmu-events/arch/x86/mapfile.csv | 1 + tools/perf/pmu-events/arch/x86/tremontx/cache.json | 111 ++++++ .../pmu-events/arch/x86/tremontx/frontend.json | 26 ++ .../perf/pmu-events/arch/x86/tremontx/memory.json | 26 ++ tools/perf/pmu-events/arch/x86/tremontx/other.json | 26 ++ .../pmu-events/arch/x86/tremontx/pipeline.json | 111 ++++++ .../arch/x86/tremontx/uncore-memory.json | 73 ++++ .../pmu-events/arch/x86/tremontx/uncore-other.json | 431 +++++++++++++++++++++ .../pmu-events/arch/x86/tremontx/uncore-power.json | 11 + .../arch/x86/tremontx/virtual-memory.json | 86 ++++ tools/perf/util/Build | 1 + tools/perf/util/evswitch.c | 61 +++ tools/perf/util/evswitch.h | 31 ++ tools/perf/util/map.c | 5 +- tools/perf/util/map_groups.h | 4 + tools/perf/util/thread.c | 7 +- tools/perf/util/thread.h | 4 - tools/perf/util/top.h | 2 + tools/perf/util/unwind-libunwind-local.c | 18 +- tools/perf/util/unwind-libunwind.c | 40 +- tools/perf/util/unwind.h | 25 +- 29 files changed, 1158 insertions(+), 55 deletions(-) create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/cache.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/frontend.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/memory.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/other.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/pipeline.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/uncore-memory.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/uncore-other.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/uncore-power.json create mode 100644 tools/perf/pmu-events/arch/x86/tremontx/virtual-memory.json create mode 100644 tools/perf/util/evswitch.c create mode 100644 tools/perf/util/evswitch.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-rc4.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190808 gcc-9-branch@274204, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 8.3.0-19) 8.3.0, clang version 7.0.1-9 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190723 [gcc-9-branch revision 273734], 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.1.0-9ubuntu2) 9.1.0, clang version 8.0.1-+rc4-1 (tags/RELEASE_801/rc4) # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 e2736219e6ca perf unwind: Remove unnecessary test # perf version --build-options perf version 5.3.rc4.ge2736219e6ca 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 # $ time make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_gtk2_O: make NO_GTK2=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_cscope_O: make cscope make_debug_O: make DEBUG=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_newt_O: make NO_NEWT=1 make_no_libbpf_O: make NO_LIBBPF=1 make_util_map_o_O: make util/map.o make_install_prefix_O: make install prefix=/tmp/krava make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_clean_all_O: make clean all make_help_O: make help make_no_libpython_O: make NO_LIBPYTHON=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_install_bin_O: make install-bin make_no_demangle_O: make NO_DEMANGLE=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_static_O: make LDFLAGS=-static make_no_libelf_O: make NO_LIBELF=1 make_no_slang_O: make NO_SLANG=1 make_tags_O: make tags make_no_libunwind_O: make NO_LIBUNWIND=1 make_doc_O: make doc make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_with_babeltrace_O: make LIBBABELTRACE=1 make_perf_o_O: make perf.o make_install_O: make install make_pure_O: make OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-08-14 18:40 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-08-14 18:40 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andy Shevchenko, Haiyan Song, Igor Lubashev, Leo Yan, Luke Mujica, Tan Xiaojun, Vince Weaver, Arnaldo Carvalho de Melo Hi, Please consider pulling, this has v5.3-rc4 merged in to pick up libbpf fixes, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 272172bd418cc32aa466588150c8001bc229c712: Merge remote-tracking branch 'torvalds/master' into perf/core (2019-08-12 16:25:00 -0300) 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-20190814 for you to fetch changes up to 1cd8fa288eb83c1fe0dfa492b09d228a8d802fbf: perf ui: No need to set ui_browser to 1 twice (2019-08-14 11:00:00 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Intel PT: Adrian Hunter: - Add PEBS via Intel PT support, the kernel bits went via PeterZ. perf record: Alexander Shishkin: - Add an option to take an AUX snapshot on exit. Tan Xiaojun: - Support aarch64 random socket_id assignment, just like was fixed for S/390. tools: Andy Shevchenko: - Keep list of tools in alphabetical order on 'make -C tools help'. perf session: Arnaldo Carvalho de Melo: - Avoid infinite loop when seeing invalid header.size, reported by Vince Weaver using a perf.data fuzzer. Documentation: Vince Weaver: - Clarify HEADER_SAMPLE_TOPOLOGY format in the perf.data spec. perf config: Arnaldo Carvalho de Melo: - Honour $PERF_CONFIG env var to specify alternate .perfconfig. perf test: Arnaldo Carvalho de Melo: - Disable ~/.perfconfig to get default output in 'perf trace' tests. perf top: Arnaldo Carvalho de Melo: - Set display thread COMM to help with debugging. - Collapse and resort evsels in a group, so that we have output similar to 'perf report' when using event groups, i.e. perf top -e '{cycles,instructions}' Will have two columns, and the instructions one will work. core: Igor Lubashev: - Detect if libcap development files are available so that we can use capabilities to match the checks made by the kernel instead of using plain (geteuid() == 0). Intel: Haiyan Song: - Add Icelake V1.00 event file. perf trace: Leo Yan: - Fix segmentation fault when access syscall info on arm64. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (5): perf tools: Add aux_output attribute flag perf tools: Add itrace option 'o' to synthesize aux-output events perf intel-pt: Process options for PEBS event synthesis perf tools: Add aux-output config term perf intel-pt: Add brief documentation for PEBS via Intel PT Alexander Shishkin (1): perf record: Add an option to take an AUX snapshot on exit Andy Shevchenko (1): tools: Keep list of tools in alphabetical order Arnaldo Carvalho de Melo (13): perf session: Avoid infinite loop when seeing invalid header.size perf config: Honour $PERF_CONFIG env var to specify alternate .perfconfig perf config: Document the PERF_CONFIG environment variable perf test vfs_getname: Disable ~/.perfconfig to get default output perf top: Set display thread COMM to help with debugging perf hists: Do not link a pair if already linked perf hist: Remove dummy entries when finding real ones. perf top: Collapse and resort all evsels in a group perf tools: Add NO_LIBCAP=1 to the minimal build test perf tools: Add CAP_SYSLOG define for older systems perf ftrace: Improve error message about capability to use ftrace perf evsel: Provide meaningful warning when trying to use 'aux_output' on older kernels perf ui: No need to set ui_browser to 1 twice Haiyan Song (1): perf vendor events intel: Add Icelake V1.00 event file Igor Lubashev (3): tools build: Add capability-related feature detection perf tools: Add helpers to use capabilities if present perf ftrace: Use CAP_SYS_ADMIN instead of euid==0 Leo Yan (1): perf trace: Fix segmentation fault when access syscall info on arm64 Luke Mujica (1): perf tools: Fix paths in include statements Tan Xiaojun (1): perf record: Support aarch64 random socket_id assignment Vince Weaver (1): perf.data documentation: Clarify HEADER_SAMPLE_TOPOLOGY format tools/Makefile | 4 +- tools/build/Makefile.feature | 2 + tools/build/feature/Makefile | 4 + tools/build/feature/test-libcap.c | 20 + tools/include/uapi/linux/perf_event.h | 3 +- tools/perf/Documentation/intel-pt.txt | 15 + tools/perf/Documentation/itrace.txt | 2 + tools/perf/Documentation/perf-config.txt | 4 + tools/perf/Documentation/perf-record.txt | 13 +- tools/perf/Documentation/perf.data-file-format.txt | 25 +- tools/perf/Makefile.config | 11 + tools/perf/Makefile.perf | 2 + tools/perf/arch/x86/util/intel-pt.c | 23 + tools/perf/arch/x86/util/kvm-stat.c | 4 +- tools/perf/arch/x86/util/tsc.c | 6 +- tools/perf/builtin-ftrace.c | 12 +- tools/perf/builtin-record.c | 35 +- tools/perf/builtin-top.c | 34 +- tools/perf/builtin-trace.c | 2 +- tools/perf/perf.c | 3 + tools/perf/perf.h | 1 + tools/perf/pmu-events/arch/x86/icelake/cache.json | 552 +++++++++++++ .../arch/x86/icelake/floating-point.json | 102 +++ .../perf/pmu-events/arch/x86/icelake/frontend.json | 424 ++++++++++ tools/perf/pmu-events/arch/x86/icelake/memory.json | 410 ++++++++++ tools/perf/pmu-events/arch/x86/icelake/other.json | 121 +++ .../perf/pmu-events/arch/x86/icelake/pipeline.json | 892 +++++++++++++++++++++ .../arch/x86/icelake/virtual-memory.json | 236 ++++++ tools/perf/pmu-events/arch/x86/mapfile.csv | 2 + tools/perf/tests/make | 1 + tools/perf/tests/shell/trace+probe_vfs_getname.sh | 4 + tools/perf/ui/helpline.c | 4 +- tools/perf/ui/setup.c | 2 +- tools/perf/ui/util.c | 2 +- tools/perf/util/Build | 2 + tools/perf/util/auxtrace.c | 18 +- tools/perf/util/auxtrace.h | 5 +- tools/perf/util/cap.c | 29 + tools/perf/util/cap.h | 32 + tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 15 +- tools/perf/util/evsel.h | 3 + tools/perf/util/header.c | 4 +- tools/perf/util/hist.c | 20 +- tools/perf/util/intel-pt.c | 18 + tools/perf/util/parse-events.c | 8 + tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 1 + tools/perf/util/python-ext-sources | 1 + tools/perf/util/session.c | 11 +- tools/perf/util/setup.py | 2 + tools/perf/util/util.c | 9 + 52 files changed, 3112 insertions(+), 45 deletions(-) create mode 100644 tools/build/feature/test-libcap.c create mode 100644 tools/perf/pmu-events/arch/x86/icelake/cache.json create mode 100644 tools/perf/pmu-events/arch/x86/icelake/floating-point.json create mode 100644 tools/perf/pmu-events/arch/x86/icelake/frontend.json create mode 100644 tools/perf/pmu-events/arch/x86/icelake/memory.json create mode 100644 tools/perf/pmu-events/arch/x86/icelake/other.json create mode 100644 tools/perf/pmu-events/arch/x86/icelake/pipeline.json create mode 100644 tools/perf/pmu-events/arch/x86/icelake/virtual-memory.json create mode 100644 tools/perf/util/cap.c create mode 100644 tools/perf/util/cap.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-rc4.tar.xz # dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0, clang version 3.8.0 (tags/RELEASE_380/final) 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822, clang version 3.8.1 (tags/RELEASE_381/final) 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0, clang version 4.0.0 (tags/RELEASE_400/final) 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0, Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 7 alpine:3.10 : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.0 (tags/RELEASE_800/final) (based on LLVM 8.0.0) 8 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190808 gcc-9-branch@274204, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 8.3.0-19) 8.3.0, clang version 7.0.1-9 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 23 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 24 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-19) 8.3.0 25 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 26 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 27 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 28 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 29 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 30 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 31 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 32 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 33 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 34 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 7.0.1 (Fedora 7.0.1-6.fc29) 35 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1), clang version 8.0.0 (Fedora 8.0.0-1.fc30) 36 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 37 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 38 fedora:31 : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 39 fedora:rawhide : Ok gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2), clang version 8.0.0 (Fedora 8.0.0-3.fc31.1) 40 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 41 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 42 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 43 mageia:7 : Ok gcc (Mageia 8.3.1-0.20190524.1.mga7) 8.3.1 20190524, clang version 8.0.0 (Mageia 8.0.0-1.mga7) 44 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.1 (tags/RELEASE_801/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190723 [gcc-9-branch revision 273734], 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 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.1.0-9ubuntu2) 9.1.0, clang version 8.0.1-+rc4-1 (tags/RELEASE_801/rc4) # uname -a Linux quaco 5.2.6-200.fc30.x86_64 #1 SMP Mon Aug 5 13:20:47 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 1cd8fa288eb8 perf ui: No need to set ui_browser to 1 twice # perf version --build-options perf version 5.3.rc4.g1cd8fa288eb8 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_clean_all_O: make clean all make_no_backtrace_O: make NO_BACKTRACE=1 make_tags_O: make tags make_install_O: make install make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_static_O: make LDFLAGS=-static make_doc_O: make doc make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_cscope_O: make cscope make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_demangle_O: make NO_DEMANGLE=1 make_help_O: make help make_no_libelf_O: make NO_LIBELF=1 make_util_map_o_O: make util/map.o make_pure_O: make make_with_clangllvm_O: make LIBCLANGLLVM=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 NO_LIBCAP=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_bin_O: make install-bin make_install_prefix_O: make install prefix=/tmp/krava make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_debug_O: make DEBUG=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_perf_o_O: make perf.o make_no_newt_O: make NO_NEWT=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_gtk2_O: make NO_GTK2=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_slang_O: make NO_SLANG=1 make_no_libunwind_O: make NO_LIBUNWIND=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-07-22 17:38 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-07-22 17:38 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Alexey Budankov, Andi Kleen, Cong Wang, Denis Bakhvalov, Numfor Mbiziwo-Tiapo Hi Ingo, Please consider pulling, Best regards, - Arnaldo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-07-15 21:11 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-07-15 21:11 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Mamatha Inamdar, Ravi Bangoria, Thomas Richter, YueHaibing, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 323fd749821daab0f327ec86d707c4542963cdb0: perf intel-pt: Fix potential NULL pointer dereference found by the smatch tool (2019-07-09 10:13:28 -0300) 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.3-20190715 for you to fetch changes up to 916c31fff946fae0e05862f9b2435fdb29fd5090: perf version: Fix segfault due to missing OPT_END() (2019-07-15 07:59:05 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf db-export: Adrian Hunter: - Improvements in how COMM details are exported to databases for post processing and use in the sql-viewer.py UI. - Export switch events to the database. BPF: Arnaldo Carvalho de Melo: - Bump rlimit(MEMLOCK) for 'perf test bpf' and 'perf trace', just like selftests/bpf/bpf_rlimit.h do, which makes errors due to exhaustion of this limit, which are kinda cryptic (EPERM sometimes) less frequent. perf version: Ravi Bangoria: - Fix segfault due to missing OPT_END(), noticed on PowerPC. perf vendor events: Thomas Richter: - Add JSON files for IBM s/390 machine type 8561. perf cs-etm (ARM): YueHaibing: - Fix two cases of error returns not bing done properly: Invalid ERR_PTR() use and loss of propagation error codes. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (21): perf db-export: Get rid of db_export__deferred() perf db-export: Rename db_export__comm() to db_export__exec_comm() perf db-export: Pass main_thread to db_export__thread() perf db-export: Export main_thread in db_export__sample() perf db-export: Export comm before exporting thread perf db-export: Move export__comm_thread into db_export__sample() perf db-export: Fix a white space issue in db_export__sample() perf db-export: Export comm details perf scripts python: export-to-sqlite.py: Export comm details perf scripts python: export-to-postgresql.py: Export comm details perf db-export: Factor out db_export__comm() perf db-export: Also export thread's current comm perf scripts python: export-to-sqlite.py: Add has_calls column to comms table perf scripts python: export-to-postgresql.py: Add has_calls column to comms table perf scripts python: exported-sql-viewer.py: Remove redundant semi-colons perf scripts python: exported-sql-viewer.py: Use new 'has_calls' column perf script: Add scripting operation process_switch() perf db-export: Factor out db_export__threads() perf db-export: Export switch events perf scripts python: export-to-sqlite.py: Export switch events perf scripts python: export-to-postgresql.py: Export switch events Arnaldo Carvalho de Melo (3): perf tools: Introduce rlimit__bump_memlock() helper perf test: Auto bump rlimit(MEMLOCK) for BPF test sake perf trace: Auto bump rlimit(MEMLOCK) for eBPF maps sake Ravi Bangoria (1): perf version: Fix segfault due to missing OPT_END() Thomas Richter (1): perf vendor events s390: Add JSON files for machine type 8561 YueHaibing (2): perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info perf cs-etm: Return errcode in cs_etm__process_auxtrace_info() tools/perf/builtin-script.c | 8 +- tools/perf/builtin-trace.c | 10 + tools/perf/builtin-version.c | 1 + .../perf/pmu-events/arch/s390/cf_m8561/basic.json | 58 ++++ .../perf/pmu-events/arch/s390/cf_m8561/crypto.json | 114 +++++++ .../pmu-events/arch/s390/cf_m8561/crypto6.json | 30 ++ .../pmu-events/arch/s390/cf_m8561/extended.json | 373 +++++++++++++++++++++ tools/perf/pmu-events/arch/s390/mapfile.csv | 1 + tools/perf/scripts/python/export-to-postgresql.py | 68 +++- tools/perf/scripts/python/export-to-sqlite.py | 54 ++- tools/perf/scripts/python/exported-sql-viewer.py | 34 +- tools/perf/tests/builtin-test.c | 6 + tools/perf/util/Build | 1 + tools/perf/util/cs-etm.c | 12 +- tools/perf/util/db-export.c | 291 ++++++++++------ tools/perf/util/db-export.h | 19 +- tools/perf/util/rlimit.c | 29 ++ tools/perf/util/rlimit.h | 6 + .../util/scripting-engines/trace-event-python.c | 53 ++- tools/perf/util/trace-event.h | 3 + 20 files changed, 1029 insertions(+), 142 deletions(-) create mode 100644 tools/perf/pmu-events/arch/s390/cf_m8561/basic.json create mode 100644 tools/perf/pmu-events/arch/s390/cf_m8561/crypto.json create mode 100644 tools/perf/pmu-events/arch/s390/cf_m8561/crypto6.json create mode 100644 tools/perf/pmu-events/arch/s390/cf_m8561/extended.json create mode 100644 tools/perf/util/rlimit.c create mode 100644 tools/perf/util/rlimit.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. The 'perf test bpf' test is about rlimit(MEMLOCK), bump it a to 128K from the default 64K and it'll work. Next pull req will have auto-adjustment for 'perf test' and 'perf trace', where BPF programs creating maps are also failing. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.2.0.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 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190628 gcc-9-branch@272773, clang version 8.0.0 (tags/RELEASE_800/final) 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2, Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 19 debian:10 : Ok gcc (Debian 8.3.0-6) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 21 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 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-7) 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) 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) 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.0 (tags/RELEASE_800/final) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190611 [gcc-9-branch revision 272147], clang version 8.0.0 (tags/RELEASE_800/final 356365) 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-36.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 52 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) 53 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) 54 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 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) 61 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 62 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 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) 72 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 73 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 74 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.10 : Ok gcc (Ubuntu 8.3.0-14ubuntu1) 8.3.0, clang version 8.0.1-+rc1-1~exp1 (tags/RELEASE_801/rc1) $ # uname -a Linux quaco 5.2.0-rc7+ #4 SMP Sat Jul 6 14:43:41 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 916c31fff946 perf version: Fix segfault due to missing OPT_END() # perf version --build-options perf version 5.2.g916c31fff946 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 . - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_install_prefix_O: make install prefix=/tmp/krava make_install_bin_O: make install-bin make_clean_all_O: make clean all make_doc_O: make doc make_install_O: make install make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_static_O: make LDFLAGS=-static make_pure_O: make make_no_libbpf_O: make NO_LIBBPF=1 make_help_O: make help make_no_slang_O: make NO_SLANG=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_tags_O: make tags make_no_libunwind_O: make NO_LIBUNWIND=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_newt_O: make NO_NEWT=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_cscope_O: make cscope make_perf_o_O: make perf.o make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libpython_O: make NO_LIBPYTHON=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libperl_O: make NO_LIBPERL=1 make_debug_O: make DEBUG=1 make_util_map_o_O: make util/map.o make_util_pmu_bison_o_O: make util/pmu-bison.o OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-07-09 18:31 Arnaldo Carvalho de Melo 2019-07-13 9:13 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-07-09 18:31 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, David Carrillo Cisneros, Leo Yan, Luke Mujica, Numfor Mbiziwo-Tiapo, Song Liu, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit d1d59b817939821bee149e870ce7723f61ffb512: Merge tag 'perf-urgent-for-mingo-5.3-20190708-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-07-09 13:22:03 +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.3-20190709 for you to fetch changes up to 323fd749821daab0f327ec86d707c4542963cdb0: perf intel-pt: Fix potential NULL pointer dereference found by the smatch tool (2019-07-09 10:13:28 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Intel PT: Adrian Hunter: - Fix DROP VIEW power_events_view in the postgresql and sqlite export-db python scripts. perf script: Song Liu: - Assume native_arch for pipe mode, fixing a segfault. perf inject: Arnaldo Carvalho de Melo: - The tool->read() call may pass a NULL evsel, handle it. core: Arnaldo Carvalho de Melo: - Move zalloc/zfree.c to tools/lib, further eroding tools/perf/util.[ch] - Use zfree() where applicable instead of open coded equivalent. - Add stdlib.h and some other headers to places where its needed and were getting via util.h, that doesn't need that anymore. - Use list_del_init() more thoroughly. Miscellaneous: Leo Yan: - Fix use after free and potential NULL pointer derefs detected by the smatch tool in various places. Luke Mujica: - Remove a couple unused variables in the parse-events code. Numfor Mbiziwo-Tiapo: - Initialize variable to suppress memory sanitizer warning in the mmap-thread-lookup 'perf test' entry. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (2): perf scripts python: export-to-postgresql.py: Fix DROP VIEW power_events_view perf scripts python: export-to-sqlite.py: Fix DROP VIEW power_events_view Arnaldo Carvalho de Melo (9): perf inject: The tool->read() call may pass a NULL evsel, handle it perf evsel: perf_evsel__name(NULL) is valid, no need to check evsel perf tools: Add missing headers, mostly stdlib.h perf namespaces: Move the conditional setns() prototype to namespaces.h perf tools: Move get_current_dir_name() cond prototype out of util.h tools lib: Adopt zalloc()/zfree() from tools/perf perf tools: Use zfree() where applicable perf tools: Use list_del_init() more thorougly perf metricgroup: Add missing list_del_init() when flushing egroups list Leo Yan (10): perf stat: Fix use-after-freed pointer detected by the smatch tool perf top: Fix potential NULL pointer dereference detected by the smatch tool perf annotate: Fix dereferencing freed memory found by the smatch tool perf trace: Fix potential NULL pointer dereference found by the smatch tool perf map: Fix potential NULL pointer dereference found by smatch tool perf session: Fix potential NULL pointer dereference found by the smatch tool perf cs-etm: Fix potential NULL pointer dereference found by the smatch tool perf hists browser: Fix potential NULL pointer dereference found by the smatch tool perf intel-bts: Fix potential NULL pointer dereference found by the smatch tool perf intel-pt: Fix potential NULL pointer dereference found by the smatch tool Luke Mujica (2): perf parse-events: Remove unused variable 'i' perf parse-events: Remove unused variable: error Numfor Mbiziwo-Tiapo (1): perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning Song Liu (1): perf script: Assume native_arch for pipe mode tools/include/linux/zalloc.h | 12 +++++ tools/lib/zalloc.c | 15 ++++++ tools/perf/MANIFEST | 1 + tools/perf/arch/arm/annotate/instructions.c | 1 + tools/perf/arch/arm/util/auxtrace.c | 1 + tools/perf/arch/arm/util/cs-etm.c | 1 + tools/perf/arch/arm64/util/arm-spe.c | 1 + tools/perf/arch/common.c | 3 +- tools/perf/arch/powerpc/util/perf_regs.c | 4 +- tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/arch/s390/util/header.c | 3 +- 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/perf_regs.c | 2 +- tools/perf/bench/futex-hash.c | 3 +- tools/perf/bench/futex-lock-pi.c | 3 +- tools/perf/bench/mem-functions.c | 2 +- tools/perf/bench/numa.c | 2 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-bench.c | 2 +- tools/perf/builtin-c2c.c | 2 +- tools/perf/builtin-config.c | 1 + tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-ftrace.c | 2 +- tools/perf/builtin-help.c | 2 + tools/perf/builtin-inject.c | 2 +- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-kvm.c | 2 +- tools/perf/builtin-lock.c | 10 ++-- tools/perf/builtin-probe.c | 2 +- tools/perf/builtin-record.c | 4 +- tools/perf/builtin-report.c | 4 +- tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-script.c | 5 +- tools/perf/builtin-stat.c | 8 ++-- tools/perf/builtin-timechart.c | 4 +- tools/perf/builtin-top.c | 8 +++- tools/perf/builtin-trace.c | 7 +-- tools/perf/perf.c | 2 +- tools/perf/pmu-events/jevents.c | 2 +- tools/perf/scripts/python/export-to-postgresql.py | 2 +- tools/perf/scripts/python/export-to-sqlite.py | 2 +- tools/perf/tests/dwarf-unwind.c | 5 +- tools/perf/tests/expr.c | 3 +- tools/perf/tests/llvm.c | 1 + tools/perf/tests/mem2node.c | 3 +- tools/perf/tests/mmap-thread-lookup.c | 2 +- tools/perf/tests/sample-parsing.c | 1 + tools/perf/tests/switch-tracking.c | 3 +- tools/perf/tests/thread-map.c | 3 +- tools/perf/tests/vmlinux-kallsyms.c | 1 + tools/perf/ui/browser.c | 2 +- tools/perf/ui/browser.h | 1 + tools/perf/ui/browsers/annotate.c | 2 +- tools/perf/ui/browsers/hists.c | 17 +++++-- tools/perf/ui/browsers/map.c | 1 + tools/perf/ui/browsers/res_sample.c | 6 +-- tools/perf/ui/browsers/scripts.c | 4 +- tools/perf/ui/gtk/annotate.c | 2 +- tools/perf/ui/gtk/util.c | 3 +- tools/perf/ui/stdio/hist.c | 2 +- tools/perf/ui/tui/setup.c | 1 + tools/perf/ui/tui/util.c | 2 +- tools/perf/util/Build | 5 ++ tools/perf/util/annotate.c | 13 ++--- tools/perf/util/arm-spe.c | 2 +- tools/perf/util/auxtrace.c | 11 ++--- tools/perf/util/bpf-loader.c | 3 +- tools/perf/util/build-id.c | 1 + tools/perf/util/call-path.c | 5 +- tools/perf/util/callchain.c | 12 ++--- tools/perf/util/cgroup.c | 4 +- tools/perf/util/comm.c | 2 +- tools/perf/util/config.c | 3 +- tools/perf/util/counts.c | 2 +- tools/perf/util/cpumap.c | 2 +- tools/perf/util/cputopo.c | 5 +- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 + tools/perf/util/cs-etm.c | 8 ++-- tools/perf/util/data-convert-bt.c | 4 +- tools/perf/util/data.c | 3 +- tools/perf/util/db-export.c | 7 +-- tools/perf/util/debug.c | 1 + tools/perf/util/demangle-java.c | 3 +- tools/perf/util/dso.c | 5 +- tools/perf/util/dwarf-aux.c | 2 +- tools/perf/util/env.c | 11 +++-- tools/perf/util/event.c | 3 +- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 4 +- tools/perf/util/get_current_dir_name.c | 6 +-- tools/perf/util/get_current_dir_name.h | 8 ++++ tools/perf/util/header.c | 8 ++-- tools/perf/util/help-unknown-cmd.c | 2 + tools/perf/util/hist.c | 20 ++++---- tools/perf/util/intel-bts.c | 7 ++- .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 +- tools/perf/util/intel-pt.c | 15 +++--- tools/perf/util/jitdump.c | 7 ++- tools/perf/util/llvm-utils.c | 4 +- tools/perf/util/machine.c | 6 +-- tools/perf/util/map.c | 9 ++-- tools/perf/util/mem2node.c | 2 +- tools/perf/util/metricgroup.c | 10 ++-- tools/perf/util/mmap.c | 1 + tools/perf/util/namespaces.c | 3 +- tools/perf/util/namespaces.h | 4 ++ tools/perf/util/ordered-events.c | 6 +-- tools/perf/util/parse-branch-options.c | 2 +- tools/perf/util/parse-events.c | 3 +- tools/perf/util/parse-events.y | 2 - tools/perf/util/parse-regs-options.c | 8 +++- tools/perf/util/pmu.c | 4 +- tools/perf/util/probe-event.c | 55 ++++++++++------------ tools/perf/util/probe-file.c | 2 +- tools/perf/util/probe-finder.c | 2 +- tools/perf/util/pstack.c | 2 +- tools/perf/util/python-ext-sources | 1 + tools/perf/util/s390-cpumsf.c | 11 ++--- tools/perf/util/session.c | 7 ++- tools/perf/util/setns.c | 4 +- tools/perf/util/srccode.c | 11 +++-- tools/perf/util/srcline.c | 2 +- tools/perf/util/stat-shadow.c | 3 +- tools/perf/util/stat.c | 3 +- tools/perf/util/strbuf.c | 3 +- tools/perf/util/strfilter.c | 3 +- tools/perf/util/strlist.c | 2 +- tools/perf/util/svghelper.c | 2 +- tools/perf/util/symbol-elf.c | 18 +++---- tools/perf/util/symbol-minimal.c | 3 +- tools/perf/util/symbol.c | 1 + tools/perf/util/syscalltbl.c | 2 +- tools/perf/util/target.c | 2 +- tools/perf/util/thread-stack.c | 3 +- tools/perf/util/thread.c | 6 +-- tools/perf/util/thread_map.c | 4 +- tools/perf/util/trace-event-info.c | 1 + tools/perf/util/trace-event-scripting.c | 2 +- tools/perf/util/unwind-libdw.c | 1 + tools/perf/util/unwind-libunwind-local.c | 3 +- tools/perf/util/usage.c | 3 ++ tools/perf/util/util.h | 17 ------- tools/perf/util/values.c | 2 +- tools/perf/util/vdso.c | 1 + tools/perf/util/xyarray.c | 2 +- 147 files changed, 375 insertions(+), 279 deletions(-) create mode 100644 tools/include/linux/zalloc.h create mode 100644 tools/lib/zalloc.c create mode 100644 tools/perf/util/get_current_dir_name.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. The 'perf test bpf' test is about rlimit(MEMLOCK), bump it a to 128K from the default 64K and it'll work. Next pull req will have auto-adjustment for 'perf test' and 'perf trace', where BPF programs creating maps are also failing. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.2.0.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 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190628 gcc-9-branch@272773, 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:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 21 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 23 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 24 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) 25 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 26 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 27 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 29 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 30 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 31 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 32 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 33 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) 34 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) 35 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 36 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 37 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) 38 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) 39 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 40 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 41 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 42 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) 43 manjaro:latest : Ok gcc (GCC) 9.1.0, clang version 8.0.0 (tags/RELEASE_800/final) 44 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) 45 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 46 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 47 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190611 [gcc-9-branch revision 272147], clang version 8.0.0 (tags/RELEASE_800/final 356365) 48 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 49 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 50 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 51 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) 52 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) 53 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 54 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 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) 60 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 61 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 62 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 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) 71 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 72 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 73 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 74 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.10 : Ok gcc (Ubuntu 8.3.0-14ubuntu1) 8.3.0, clang version 8.0.1-+rc1-1~exp1 (tags/RELEASE_801/rc1) $ # uname -a Linux quaco 5.2.0-rc7+ #4 SMP Sat Jul 6 14:43:41 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 323fd749821d perf intel-pt: Fix potential NULL pointer dereference found by the smatch tool # perf version --build-options perf version 5.2.g323fd749821d 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 : Skip 41.2: BPF pinning : Skip 41.3: BPF prologue generation : Skip 41.4: BPF relocation checker : Skip 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 | tee /wb/build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_libbpf_O: make NO_LIBBPF=1 make_static_O: make LDFLAGS=-static make_util_map_o_O: make util/map.o make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_clean_all_O: make clean all make_doc_O: make doc make_no_libperl_O: make NO_LIBPERL=1 make_install_O: make install make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_cscope_O: make cscope make_tags_O: make tags make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_slang_O: make NO_SLANG=1 make_install_bin_O: make install-bin make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_perf_o_O: make perf.o make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_gtk2_O: make NO_GTK2=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libelf_O: make NO_LIBELF=1 make_pure_O: make make_no_newt_O: make NO_NEWT=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_help_O: make help make_debug_O: make DEBUG=1 make_no_demangle_O: make NO_DEMANGLE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-07-09 18:31 Arnaldo Carvalho de Melo @ 2019-07-13 9:13 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-07-13 9:13 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, David Carrillo Cisneros, Leo Yan, Luke Mujica, Numfor Mbiziwo-Tiapo, Song Liu, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit d1d59b817939821bee149e870ce7723f61ffb512: > > Merge tag 'perf-urgent-for-mingo-5.3-20190708-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-07-09 13:22:03 +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.3-20190709 > > for you to fetch changes up to 323fd749821daab0f327ec86d707c4542963cdb0: > > perf intel-pt: Fix potential NULL pointer dereference found by the smatch tool (2019-07-09 10:13:28 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > Intel PT: > > Adrian Hunter: > > - Fix DROP VIEW power_events_view in the postgresql and sqlite export-db > python scripts. > > perf script: > > Song Liu: > > - Assume native_arch for pipe mode, fixing a segfault. > > perf inject: > > Arnaldo Carvalho de Melo: > > - The tool->read() call may pass a NULL evsel, handle it. > > core: > > Arnaldo Carvalho de Melo: > > - Move zalloc/zfree.c to tools/lib, further eroding tools/perf/util.[ch] > > - Use zfree() where applicable instead of open coded equivalent. > > - Add stdlib.h and some other headers to places where its needed and were > getting via util.h, that doesn't need that anymore. > > - Use list_del_init() more thoroughly. > > Miscellaneous: > > Leo Yan: > > - Fix use after free and potential NULL pointer derefs detected by the > smatch tool in various places. > > Luke Mujica: > > - Remove a couple unused variables in the parse-events code. > > Numfor Mbiziwo-Tiapo: > > - Initialize variable to suppress memory sanitizer warning in the > mmap-thread-lookup 'perf test' entry. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (2): > perf scripts python: export-to-postgresql.py: Fix DROP VIEW power_events_view > perf scripts python: export-to-sqlite.py: Fix DROP VIEW power_events_view > > Arnaldo Carvalho de Melo (9): > perf inject: The tool->read() call may pass a NULL evsel, handle it > perf evsel: perf_evsel__name(NULL) is valid, no need to check evsel > perf tools: Add missing headers, mostly stdlib.h > perf namespaces: Move the conditional setns() prototype to namespaces.h > perf tools: Move get_current_dir_name() cond prototype out of util.h > tools lib: Adopt zalloc()/zfree() from tools/perf > perf tools: Use zfree() where applicable > perf tools: Use list_del_init() more thorougly > perf metricgroup: Add missing list_del_init() when flushing egroups list > > Leo Yan (10): > perf stat: Fix use-after-freed pointer detected by the smatch tool > perf top: Fix potential NULL pointer dereference detected by the smatch tool > perf annotate: Fix dereferencing freed memory found by the smatch tool > perf trace: Fix potential NULL pointer dereference found by the smatch tool > perf map: Fix potential NULL pointer dereference found by smatch tool > perf session: Fix potential NULL pointer dereference found by the smatch tool > perf cs-etm: Fix potential NULL pointer dereference found by the smatch tool > perf hists browser: Fix potential NULL pointer dereference found by the smatch tool > perf intel-bts: Fix potential NULL pointer dereference found by the smatch tool > perf intel-pt: Fix potential NULL pointer dereference found by the smatch tool > > Luke Mujica (2): > perf parse-events: Remove unused variable 'i' > perf parse-events: Remove unused variable: error > > Numfor Mbiziwo-Tiapo (1): > perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning > > Song Liu (1): > perf script: Assume native_arch for pipe mode > > tools/include/linux/zalloc.h | 12 +++++ > tools/lib/zalloc.c | 15 ++++++ > tools/perf/MANIFEST | 1 + > tools/perf/arch/arm/annotate/instructions.c | 1 + > tools/perf/arch/arm/util/auxtrace.c | 1 + > tools/perf/arch/arm/util/cs-etm.c | 1 + > tools/perf/arch/arm64/util/arm-spe.c | 1 + > tools/perf/arch/common.c | 3 +- > tools/perf/arch/powerpc/util/perf_regs.c | 4 +- > tools/perf/arch/s390/util/auxtrace.c | 1 + > tools/perf/arch/s390/util/header.c | 3 +- > 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/perf_regs.c | 2 +- > tools/perf/bench/futex-hash.c | 3 +- > tools/perf/bench/futex-lock-pi.c | 3 +- > tools/perf/bench/mem-functions.c | 2 +- > tools/perf/bench/numa.c | 2 +- > tools/perf/builtin-annotate.c | 2 +- > tools/perf/builtin-bench.c | 2 +- > tools/perf/builtin-c2c.c | 2 +- > tools/perf/builtin-config.c | 1 + > tools/perf/builtin-diff.c | 2 +- > tools/perf/builtin-ftrace.c | 2 +- > tools/perf/builtin-help.c | 2 + > tools/perf/builtin-inject.c | 2 +- > tools/perf/builtin-kmem.c | 2 +- > tools/perf/builtin-kvm.c | 2 +- > tools/perf/builtin-lock.c | 10 ++-- > tools/perf/builtin-probe.c | 2 +- > tools/perf/builtin-record.c | 4 +- > tools/perf/builtin-report.c | 4 +- > tools/perf/builtin-sched.c | 2 +- > tools/perf/builtin-script.c | 5 +- > tools/perf/builtin-stat.c | 8 ++-- > tools/perf/builtin-timechart.c | 4 +- > tools/perf/builtin-top.c | 8 +++- > tools/perf/builtin-trace.c | 7 +-- > tools/perf/perf.c | 2 +- > tools/perf/pmu-events/jevents.c | 2 +- > tools/perf/scripts/python/export-to-postgresql.py | 2 +- > tools/perf/scripts/python/export-to-sqlite.py | 2 +- > tools/perf/tests/dwarf-unwind.c | 5 +- > tools/perf/tests/expr.c | 3 +- > tools/perf/tests/llvm.c | 1 + > tools/perf/tests/mem2node.c | 3 +- > tools/perf/tests/mmap-thread-lookup.c | 2 +- > tools/perf/tests/sample-parsing.c | 1 + > tools/perf/tests/switch-tracking.c | 3 +- > tools/perf/tests/thread-map.c | 3 +- > tools/perf/tests/vmlinux-kallsyms.c | 1 + > tools/perf/ui/browser.c | 2 +- > tools/perf/ui/browser.h | 1 + > tools/perf/ui/browsers/annotate.c | 2 +- > tools/perf/ui/browsers/hists.c | 17 +++++-- > tools/perf/ui/browsers/map.c | 1 + > tools/perf/ui/browsers/res_sample.c | 6 +-- > tools/perf/ui/browsers/scripts.c | 4 +- > tools/perf/ui/gtk/annotate.c | 2 +- > tools/perf/ui/gtk/util.c | 3 +- > tools/perf/ui/stdio/hist.c | 2 +- > tools/perf/ui/tui/setup.c | 1 + > tools/perf/ui/tui/util.c | 2 +- > tools/perf/util/Build | 5 ++ > tools/perf/util/annotate.c | 13 ++--- > tools/perf/util/arm-spe.c | 2 +- > tools/perf/util/auxtrace.c | 11 ++--- > tools/perf/util/bpf-loader.c | 3 +- > tools/perf/util/build-id.c | 1 + > tools/perf/util/call-path.c | 5 +- > tools/perf/util/callchain.c | 12 ++--- > tools/perf/util/cgroup.c | 4 +- > tools/perf/util/comm.c | 2 +- > tools/perf/util/config.c | 3 +- > tools/perf/util/counts.c | 2 +- > tools/perf/util/cpumap.c | 2 +- > tools/perf/util/cputopo.c | 5 +- > tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 + > tools/perf/util/cs-etm.c | 8 ++-- > tools/perf/util/data-convert-bt.c | 4 +- > tools/perf/util/data.c | 3 +- > tools/perf/util/db-export.c | 7 +-- > tools/perf/util/debug.c | 1 + > tools/perf/util/demangle-java.c | 3 +- > tools/perf/util/dso.c | 5 +- > tools/perf/util/dwarf-aux.c | 2 +- > tools/perf/util/env.c | 11 +++-- > tools/perf/util/event.c | 3 +- > tools/perf/util/evlist.c | 2 +- > tools/perf/util/evsel.c | 4 +- > tools/perf/util/get_current_dir_name.c | 6 +-- > tools/perf/util/get_current_dir_name.h | 8 ++++ > tools/perf/util/header.c | 8 ++-- > tools/perf/util/help-unknown-cmd.c | 2 + > tools/perf/util/hist.c | 20 ++++---- > tools/perf/util/intel-bts.c | 7 ++- > .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 +- > tools/perf/util/intel-pt.c | 15 +++--- > tools/perf/util/jitdump.c | 7 ++- > tools/perf/util/llvm-utils.c | 4 +- > tools/perf/util/machine.c | 6 +-- > tools/perf/util/map.c | 9 ++-- > tools/perf/util/mem2node.c | 2 +- > tools/perf/util/metricgroup.c | 10 ++-- > tools/perf/util/mmap.c | 1 + > tools/perf/util/namespaces.c | 3 +- > tools/perf/util/namespaces.h | 4 ++ > tools/perf/util/ordered-events.c | 6 +-- > tools/perf/util/parse-branch-options.c | 2 +- > tools/perf/util/parse-events.c | 3 +- > tools/perf/util/parse-events.y | 2 - > tools/perf/util/parse-regs-options.c | 8 +++- > tools/perf/util/pmu.c | 4 +- > tools/perf/util/probe-event.c | 55 ++++++++++------------ > tools/perf/util/probe-file.c | 2 +- > tools/perf/util/probe-finder.c | 2 +- > tools/perf/util/pstack.c | 2 +- > tools/perf/util/python-ext-sources | 1 + > tools/perf/util/s390-cpumsf.c | 11 ++--- > tools/perf/util/session.c | 7 ++- > tools/perf/util/setns.c | 4 +- > tools/perf/util/srccode.c | 11 +++-- > tools/perf/util/srcline.c | 2 +- > tools/perf/util/stat-shadow.c | 3 +- > tools/perf/util/stat.c | 3 +- > tools/perf/util/strbuf.c | 3 +- > tools/perf/util/strfilter.c | 3 +- > tools/perf/util/strlist.c | 2 +- > tools/perf/util/svghelper.c | 2 +- > tools/perf/util/symbol-elf.c | 18 +++---- > tools/perf/util/symbol-minimal.c | 3 +- > tools/perf/util/symbol.c | 1 + > tools/perf/util/syscalltbl.c | 2 +- > tools/perf/util/target.c | 2 +- > tools/perf/util/thread-stack.c | 3 +- > tools/perf/util/thread.c | 6 +-- > tools/perf/util/thread_map.c | 4 +- > tools/perf/util/trace-event-info.c | 1 + > tools/perf/util/trace-event-scripting.c | 2 +- > tools/perf/util/unwind-libdw.c | 1 + > tools/perf/util/unwind-libunwind-local.c | 3 +- > tools/perf/util/usage.c | 3 ++ > tools/perf/util/util.h | 17 ------- > tools/perf/util/values.c | 2 +- > tools/perf/util/vdso.c | 1 + > tools/perf/util/xyarray.c | 2 +- > 147 files changed, 375 insertions(+), 279 deletions(-) > create mode 100644 tools/include/linux/zalloc.h > create mode 100644 tools/lib/zalloc.c > create mode 100644 tools/perf/util/get_current_dir_name.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-07-03 3:27 Arnaldo Carvalho de Melo 2019-07-03 13:56 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-07-03 3:27 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andi Kleen, Jin Yao, John Garry, Mariano Pache, Seeteena Thoufeek, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, this is on top of perf-core-for-mingo-5.3-20190701. Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 06c642c0e9fceafd16b1a4c80d44b1c09e282215: perf jevents: Use nonlocal include statements in pmu-events.c (2019-07-01 22:50:42 -0300) 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.3-20190703 for you to fetch changes up to 15a108af1a18b597bfbd7f7b3c7b4823bfbaf8df: perf script: Allow specifying the files to process guest samples (2019-07-03 00:13:25 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf metrics: Andi Kleen: - Fixes for SkylakeX and CascadeLakeX Intel vendor events. - Avoid extra ':' for --raw metrics. - Don't include duration_time in group. perf script: Arnaldo Carvalho de Melo/Jiri Olsa: - Fix processing guest samples. perf diff: Jin Yao: - Do diffs by basic blocks. objtool: Jiri Olsa: - Fix build by linking against tools/lib/ctype.o sources. perf pmu: John Garry: - Support more complex PMU event aliasing. - Add support for Hisi hip08 DDRC, HHA and L3C PMU aliasing. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (4): perf tools: Fix typos / broken sentences perf vendor events intel: Metric fixes for SKX/CLX perf list: Avoid extra : for --raw metrics perf tools metric: Don't include duration_time in group Arnaldo Carvalho de Melo (1): perf script: Allow specifying the files to process guest samples Jin Yao (7): perf symbol: Create block_info structure perf hists: Add block_info in hist_entry perf diff: Check if all data files with branch stacks perf diff: Use hists to manage basic blocks per symbol perf diff: Link same basic blocks among different data perf diff: Print the basic block cycles diff perf diff: Documentation -c cycles option Jiri Olsa (1): objtool: Fix build by linking against tools/lib/ctype.o sources John Garry (4): perf pmu: Support more complex PMU event aliasing perf jevents: Add support for Hisi hip08 DDRC PMU aliasing perf jevents: Add support for Hisi hip08 HHA PMU aliasing perf jevents: Add support for Hisi hip08 L3C PMU aliasing tools/objtool/Build | 5 + tools/perf/Documentation/perf-diff.txt | 17 +- tools/perf/Documentation/perf-report.txt | 2 +- tools/perf/Documentation/tips.txt | 2 +- tools/perf/builtin-diff.c | 382 ++++++++++++++++++++- tools/perf/builtin-script.c | 19 + .../arch/arm64/hisilicon/hip08/uncore-ddrc.json | 44 +++ .../arch/arm64/hisilicon/hip08/uncore-hha.json | 51 +++ .../arch/arm64/hisilicon/hip08/uncore-l3c.json | 37 ++ .../arch/x86/cascadelakex/clx-metrics.json | 4 +- .../pmu-events/arch/x86/skylakex/skx-metrics.json | 22 +- tools/perf/pmu-events/jevents.c | 3 + tools/perf/ui/stdio/hist.c | 27 ++ tools/perf/util/hist.c | 41 ++- tools/perf/util/hist.h | 8 + tools/perf/util/metricgroup.c | 21 +- tools/perf/util/pmu.c | 46 ++- tools/perf/util/sort.h | 13 + tools/perf/util/srcline.c | 4 +- tools/perf/util/symbol.c | 22 ++ tools/perf/util/symbol.h | 23 ++ tools/perf/util/symbol_conf.h | 4 +- 22 files changed, 753 insertions(+), 44 deletions(-) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json 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. Investigating the failure for ubuntu:18.04-x-arm, doesn't look like something introduced by this patchkit. ubuntu:18.04-x-arm failure not yet resolved, doesn't seem related to this patchkit nor the previous one. & export PERF_TARBALL=http://192.168.124.1/perf/perf-5.2.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 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190628 gcc-9-branch@272773, 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:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 21 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 23 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 24 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) 25 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 26 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 27 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 29 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 30 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 31 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 32 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 33 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) 34 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) 35 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 36 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 37 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) 38 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) 39 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 40 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 41 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 42 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) 43 manjaro:latest : Ok gcc (GCC) 8.3.0, clang version 8.0.0 (tags/RELEASE_800/final) 44 openmandriva:cooker : Ok gcc (GCC) 9.1.0 20190503 (OpenMandriva) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190520 [gcc-9-branch revision 271396], clang version 8.0.0 (tags/RELEASE_800/final 356365) 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-36.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 52 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) 53 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) 54 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 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) 61 ubuntu:18.04-x-arm : FAIL arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 arch/arm64/util/dwarf-regs.c: In function 'regs_query_register_offset': arch/arm64/util/dwarf-regs.c:26:43: error: dereferencing pointer to incomplete type 'struct user_pt_regs' (index * sizeof((struct user_pt_regs *)0)->regs[0]) ^ arch/arm64/util/dwarf-regs.c:91:11: note: in expansion of macro 'DWARFNUM2OFFSET' return DWARFNUM2OFFSET(roff->dwarfnum); ^~~~~~~~~~~~~~~ 62 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 71 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) 72 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 73 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 74 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 76 ubuntu:19.10 : Ok gcc (Ubuntu 8.3.0-14ubuntu1) 8.3.0, clang version 8.0.1-+rc1-1~exp1 (tags/RELEASE_801/rc1) # uname -a Linux quaco 5.2.0-rc7 #2 SMP Mon Jul 1 23:05:41 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 15a108af1a18 perf script: Allow specifying the files to process guest samples # perf version --build-options perf version 5.2.rc6.g15a108af1a18 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 $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_pure_O: make make_install_bin_O: make install-bin make_no_gtk2_O: make NO_GTK2=1 make_no_newt_O: make NO_NEWT=1 make_perf_o_O: make perf.o make_debug_O: make DEBUG=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_doc_O: make doc make_install_prefix_O: make install prefix=/tmp/krava make_no_demangle_O: make NO_DEMANGLE=1 make_util_map_o_O: make util/map.o make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_clean_all_O: make clean all make_no_backtrace_O: make NO_BACKTRACE=1 make_cscope_O: make cscope make_no_libaudit_O: make NO_LIBAUDIT=1 make_static_O: make LDFLAGS=-static make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_help_O: make help 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 make_no_libbpf_O: make NO_LIBBPF=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_install_O: make install make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_no_slang_O: make NO_SLANG=1 make_tags_O: make tags make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_auxtrace_O: make NO_AUXTRACE=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-07-03 3:27 Arnaldo Carvalho de Melo @ 2019-07-03 13:56 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-07-03 13:56 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Andi Kleen, Jin Yao, John Garry, Mariano Pache, Seeteena Thoufeek, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, this is on top of perf-core-for-mingo-5.3-20190701. > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 06c642c0e9fceafd16b1a4c80d44b1c09e282215: > > perf jevents: Use nonlocal include statements in pmu-events.c (2019-07-01 22:50:42 -0300) > > 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.3-20190703 > > for you to fetch changes up to 15a108af1a18b597bfbd7f7b3c7b4823bfbaf8df: > > perf script: Allow specifying the files to process guest samples (2019-07-03 00:13:25 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf metrics: > > Andi Kleen: > > - Fixes for SkylakeX and CascadeLakeX Intel vendor events. > > - Avoid extra ':' for --raw metrics. > > - Don't include duration_time in group. > > perf script: > > Arnaldo Carvalho de Melo/Jiri Olsa: > > - Fix processing guest samples. > > perf diff: > > Jin Yao: > > - Do diffs by basic blocks. > > objtool: > > Jiri Olsa: > > - Fix build by linking against tools/lib/ctype.o sources. > > perf pmu: > > John Garry: > > - Support more complex PMU event aliasing. > > - Add support for Hisi hip08 DDRC, HHA and L3C PMU aliasing. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (4): > perf tools: Fix typos / broken sentences > perf vendor events intel: Metric fixes for SKX/CLX > perf list: Avoid extra : for --raw metrics > perf tools metric: Don't include duration_time in group > > Arnaldo Carvalho de Melo (1): > perf script: Allow specifying the files to process guest samples > > Jin Yao (7): > perf symbol: Create block_info structure > perf hists: Add block_info in hist_entry > perf diff: Check if all data files with branch stacks > perf diff: Use hists to manage basic blocks per symbol > perf diff: Link same basic blocks among different data > perf diff: Print the basic block cycles diff > perf diff: Documentation -c cycles option > > Jiri Olsa (1): > objtool: Fix build by linking against tools/lib/ctype.o sources > > John Garry (4): > perf pmu: Support more complex PMU event aliasing > perf jevents: Add support for Hisi hip08 DDRC PMU aliasing > perf jevents: Add support for Hisi hip08 HHA PMU aliasing > perf jevents: Add support for Hisi hip08 L3C PMU aliasing > > tools/objtool/Build | 5 + > tools/perf/Documentation/perf-diff.txt | 17 +- > tools/perf/Documentation/perf-report.txt | 2 +- > tools/perf/Documentation/tips.txt | 2 +- > tools/perf/builtin-diff.c | 382 ++++++++++++++++++++- > tools/perf/builtin-script.c | 19 + > .../arch/arm64/hisilicon/hip08/uncore-ddrc.json | 44 +++ > .../arch/arm64/hisilicon/hip08/uncore-hha.json | 51 +++ > .../arch/arm64/hisilicon/hip08/uncore-l3c.json | 37 ++ > .../arch/x86/cascadelakex/clx-metrics.json | 4 +- > .../pmu-events/arch/x86/skylakex/skx-metrics.json | 22 +- > tools/perf/pmu-events/jevents.c | 3 + > tools/perf/ui/stdio/hist.c | 27 ++ > tools/perf/util/hist.c | 41 ++- > tools/perf/util/hist.h | 8 + > tools/perf/util/metricgroup.c | 21 +- > tools/perf/util/pmu.c | 46 ++- > tools/perf/util/sort.h | 13 + > tools/perf/util/srcline.c | 4 +- > tools/perf/util/symbol.c | 22 ++ > tools/perf/util/symbol.h | 23 ++ > tools/perf/util/symbol_conf.h | 4 +- > 22 files changed, 753 insertions(+), 44 deletions(-) > create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json > create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json > create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-07-02 2:25 Arnaldo Carvalho de Melo 2019-07-03 13:55 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-07-02 2:25 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Kyle Meyer, Luke Mujica, Mao Han, Numfor Mbiziwo-Tiapo, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit fd7d55172d1e2e501e6da0a5c1de25f06612dc2e: perf/cgroups: Don't rotate events for cgroups unnecessarily (2019-06-24 19:30:04 +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.3-20190701 for you to fetch changes up to 06c642c0e9fceafd16b1a4c80d44b1c09e282215: perf jevents: Use nonlocal include statements in pmu-events.c (2019-07-01 22:50:42 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf annotate: Mao Han: - Add support for the csky processor architecture. perf stat: Andi Kleen: - Fix metrics with --no-merge. - Don't merge events in the same PMU. - Fix group lookup for metric group. Intel PT: Adrian Hunter: - Improve CBR (Core to Bus Ratio) packets support. - Fix thread stack return from kernel for kernel only case. - Export power and ptwrite events to sqlite and postgresql. core libraries: Arnaldo Carvalho de Melo: - Find routines in tools/perf/util/ that have implementations in the kernel libraries (lib/*.c), such as strreplace(), strim(), skip_spaces() and reuse them after making a copy into tools/lib and tools/include/. This continues the effort of having tools/ code looking as much as possible like kernel source code, to help encourage people to work on both the kernel and in tools hosted in the kernel sources. That in turn will help moving stuff that uses those routines to tools/lib/perf/ where they will be made available for use in other tools. In the process ditch old cruft, remove unused variables and add missing include directives for headers providing things used in places that were building by sheer luck. Kyle Meyer: - Bump MAX_NR_CPUS and MAX_CACHES to get these tools to work on more machines. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (9): perf thread-stack: Fix thread stack return from kernel for kernel-only case perf thread-stack: Eliminate code duplicating thread_stack__pop_ks() perf intel-pt: Decoder to output CBR changes immediately perf intel-pt: Cater for CBR change in PSB+ perf intel-pt: Add CBR value to decoder state perf intel-pt: Synthesize CBR events when last seen value changes perf db-export: Export synth events perf scripts python: export-to-sqlite.py: Export Intel PT power and ptwrite events perf scripts python: export-to-postgresql.py: Export Intel PT power and ptwrite events Andi Kleen (4): perf stat: Make metric event lookup more robust perf stat: Don't merge events in the same PMU perf stat: Fix group lookup for metric group perf stat: Fix metrics with --no-merge Arnaldo Carvalho de Melo (26): perf ctype: Remove unused 'graph_line' variable perf ui stdio: No need to use 'spaces' to left align perf ctype: Remove now unused 'spaces' variable perf string: Move 'dots' and 'graph_dotted_line' out of sane_ctype.h tools x86 machine: Add missing util.h to pick up 'page_size' perf kallsyms: Adopt hex2u64 from tools/perf/util/util.h perf symbols: We need util.h in symbol-elf.c for zfree() perf tools: Remove old baggage that is util/include/linux/ctype.h perf tools: Add missing util.h to pick up 'page_size' variable tools perf: Move from sane_ctype.h obtained from git to the Linux's original perf tools: Use linux/ctype.h in more places tools lib: Adopt skip_spaces() from the kernel sources perf stat: Use recently introduced skip_spaces() perf header: Use skip_spaces() in __write_cpudesc() perf time-utils: Use skip_spaces() perf probe: Use skip_spaces() for argv handling perf strfilter: Use skip_spaces() perf metricgroup: Use strsep() perf report: Use skip_spaces() perf tools: Ditch rtrim(), use skip_spaces() to get closer to the kernel tools lib: Adopt strim() from the kernel perf tools: Remove trim() implementation, use tools/lib's strim() perf tools: Ditch rtrim(), use strim() from tools/lib tools lib: Adopt strreplace() from the kernel perf tools: Drop strxfrchar(), use strreplace() equivalent from kernel tools lib: Move argv_{split,free} from tools/perf/util/ Kyle Meyer (1): perf tools: Increase MAX_NR_CPUS and MAX_CACHES Luke Mujica (1): perf jevents: Use nonlocal include statements in pmu-events.c Mao Han (1): perf annotate: Add csky support Numfor Mbiziwo-Tiapo (1): perf tools: Fix cache.h include directive tools/include/linux/ctype.h | 75 ++++++ tools/include/linux/string.h | 11 +- tools/lib/argv_split.c | 100 ++++++++ tools/lib/ctype.c | 35 +++ tools/lib/string.c | 55 +++++ tools/lib/symbol/kallsyms.c | 14 +- tools/lib/symbol/kallsyms.h | 2 + tools/perf/MANIFEST | 2 + tools/perf/arch/arm/util/cs-etm.c | 1 + tools/perf/arch/csky/annotate/instructions.c | 48 ++++ tools/perf/arch/s390/util/header.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 1 + tools/perf/arch/x86/util/intel-pt.c | 1 + tools/perf/arch/x86/util/machine.c | 3 +- tools/perf/builtin-kmem.c | 3 +- tools/perf/builtin-report.c | 5 +- tools/perf/builtin-sched.c | 3 +- tools/perf/builtin-script.c | 14 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-top.c | 3 +- tools/perf/builtin-trace.c | 2 +- tools/perf/check-headers.sh | 2 + tools/perf/perf.c | 1 + tools/perf/perf.h | 2 +- tools/perf/pmu-events/jevents.c | 4 +- tools/perf/scripts/python/export-to-postgresql.py | 251 +++++++++++++++++++++ tools/perf/scripts/python/export-to-sqlite.py | 239 ++++++++++++++++++++ tools/perf/tests/builtin-test.c | 3 +- tools/perf/tests/code-reading.c | 2 +- tools/perf/ui/browser.c | 4 +- tools/perf/ui/browsers/hists.c | 10 +- tools/perf/ui/browsers/map.c | 2 +- tools/perf/ui/gtk/hists.c | 5 +- tools/perf/ui/progress.c | 2 +- tools/perf/ui/stdio/hist.c | 16 +- tools/perf/util/Build | 9 + tools/perf/util/annotate.c | 20 +- tools/perf/util/auxtrace.c | 2 +- tools/perf/util/build-id.c | 2 +- tools/perf/util/config.c | 2 +- tools/perf/util/cpumap.c | 2 +- tools/perf/util/ctype.c | 49 ---- tools/perf/util/data-convert-bt.c | 2 +- tools/perf/util/debug.c | 2 +- tools/perf/util/demangle-java.c | 2 +- tools/perf/util/dso.c | 3 +- tools/perf/util/env.c | 2 +- tools/perf/util/event.c | 6 +- tools/perf/util/evsel.c | 3 +- tools/perf/util/header.c | 15 +- tools/perf/util/include/linux/ctype.h | 1 - .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 24 +- .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 1 + tools/perf/util/intel-pt.c | 65 ++++-- tools/perf/util/jitdump.c | 2 +- tools/perf/util/machine.c | 3 +- tools/perf/util/metricgroup.c | 52 +++-- tools/perf/util/pmu.c | 5 +- tools/perf/util/print_binary.c | 2 +- tools/perf/util/probe-event.c | 2 +- tools/perf/util/probe-finder.h | 2 +- tools/perf/util/python-ext-sources | 3 +- tools/perf/util/python.c | 1 + tools/perf/util/sane_ctype.h | 52 ----- .../util/scripting-engines/trace-event-python.c | 46 +++- tools/perf/util/srcline.c | 3 +- tools/perf/util/stat-display.c | 14 +- tools/perf/util/stat-shadow.c | 23 +- tools/perf/util/strfilter.c | 6 +- tools/perf/util/string.c | 169 +------------- tools/perf/util/string2.h | 15 +- tools/perf/util/symbol-elf.c | 3 +- tools/perf/util/symbol.c | 2 +- tools/perf/util/thread-stack.c | 48 ++-- tools/perf/util/thread_map.c | 3 +- tools/perf/util/time-utils.c | 8 +- tools/perf/util/trace-event-parse.c | 2 +- tools/perf/util/util.c | 13 -- tools/perf/util/util.h | 1 - 79 files changed, 1167 insertions(+), 450 deletions(-) create mode 100644 tools/include/linux/ctype.h create mode 100644 tools/lib/argv_split.c create mode 100644 tools/lib/ctype.c create mode 100644 tools/perf/arch/csky/annotate/instructions.c delete mode 100644 tools/perf/util/ctype.c delete mode 100644 tools/perf/util/include/linux/ctype.h delete mode 100644 tools/perf/util/sane_ctype.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. Investigating the failure for ubuntu:18.04-x-arm, doesn't look like something introduced by this patchkit. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.2.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 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 16 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) 17 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 18 debian:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 19 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 20 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 21 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 23 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) 24 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.5.0 (tags/RELEASE_350/final) 25 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 26 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 27 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 28 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 29 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 30 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 31 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 32 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) 33 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) 34 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 35 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 36 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) 37 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) 38 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 39 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 40 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 41 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) 42 manjaro:latest : Ok gcc (GCC) 8.3.0, clang version 8.0.0 (tags/RELEASE_800/final) 43 openmandriva:cooker : Ok gcc (GCC) 9.1.0 20190503 (OpenMandriva) 44 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) 45 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 46 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 47 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190520 [gcc-9-branch revision 271396], clang version 8.0.0 (tags/RELEASE_800/final 356365) 48 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 49 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 50 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 51 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) 52 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) 53 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 54 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 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) 60 ubuntu:18.04-x-arm : FAIL arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 arch/arm64/util/dwarf-regs.c: In function 'regs_query_register_offset': arch/arm64/util/dwarf-regs.c:26:43: error: dereferencing pointer to incomplete type 'struct user_pt_regs' (index * sizeof((struct user_pt_regs *)0)->regs[0]) ^ arch/arm64/util/dwarf-regs.c:91:11: note: in expansion of macro 'DWARFNUM2OFFSET' return DWARFNUM2OFFSET(roff->dwarfnum); ^~~~~~~~~~~~~~~ mv: cannot stat '/tmp/build/perf/arch/arm64/util/.dwarf-regs.o.tmp': No such file or directory 61 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 62 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 63 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 64 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 65 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 66 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 67 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 68 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 69 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 70 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) 71 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 72 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 73 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 74 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.10 : Ok gcc (Ubuntu 8.3.0-14ubuntu1) 8.3.0, clang version 8.0.1-+rc1-1~exp1 (tags/RELEASE_801/rc1) $ # uname -a Linux quaco 5.2.0-rc7 #2 SMP Mon Jul 1 23:05:41 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 06c642c0e9fc perf jevents: Use nonlocal include statements in pmu-events.c # perf version --build-options perf version 5.2.rc6.g06c642c0e9fc 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_no_libbpf_O: make NO_LIBBPF=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_static_O: make LDFLAGS=-static make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_prefix_O: make install prefix=/tmp/krava make_no_libelf_O: make NO_LIBELF=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_gtk2_O: make NO_GTK2=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_doc_O: make doc make_help_O: make help make_perf_o_O: make perf.o make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_debug_O: make DEBUG=1 make_pure_O: make make_install_O: make install make_install_bin_O: make install-bin make_no_newt_O: make NO_NEWT=1 make_cscope_O: make cscope 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 make_tags_O: make tags make_no_libnuma_O: make NO_LIBNUMA=1 make_util_map_o_O: make util/map.o make_no_slang_O: make NO_SLANG=1 make_clean_all_O: make clean all make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-07-02 2:25 Arnaldo Carvalho de Melo @ 2019-07-03 13:55 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-07-03 13:55 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Kyle Meyer, Luke Mujica, Mao Han, Numfor Mbiziwo-Tiapo, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit fd7d55172d1e2e501e6da0a5c1de25f06612dc2e: > > perf/cgroups: Don't rotate events for cgroups unnecessarily (2019-06-24 19:30:04 +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.3-20190701 > > for you to fetch changes up to 06c642c0e9fceafd16b1a4c80d44b1c09e282215: > > perf jevents: Use nonlocal include statements in pmu-events.c (2019-07-01 22:50:42 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf annotate: > > Mao Han: > > - Add support for the csky processor architecture. > > perf stat: > > Andi Kleen: > > - Fix metrics with --no-merge. > > - Don't merge events in the same PMU. > > - Fix group lookup for metric group. > > Intel PT: > > Adrian Hunter: > > - Improve CBR (Core to Bus Ratio) packets support. > > - Fix thread stack return from kernel for kernel only case. > > - Export power and ptwrite events to sqlite and postgresql. > > core libraries: > > Arnaldo Carvalho de Melo: > > - Find routines in tools/perf/util/ that have implementations in the kernel > libraries (lib/*.c), such as strreplace(), strim(), skip_spaces() and reuse > them after making a copy into tools/lib and tools/include/. > > This continues the effort of having tools/ code looking as much as possible > like kernel source code, to help encourage people to work on both the kernel > and in tools hosted in the kernel sources. > > That in turn will help moving stuff that uses those routines to > tools/lib/perf/ where they will be made available for use in other tools. > > In the process ditch old cruft, remove unused variables and add missing > include directives for headers providing things used in places that were > building by sheer luck. > > Kyle Meyer: > > - Bump MAX_NR_CPUS and MAX_CACHES to get these tools to work on more machines. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (9): > perf thread-stack: Fix thread stack return from kernel for kernel-only case > perf thread-stack: Eliminate code duplicating thread_stack__pop_ks() > perf intel-pt: Decoder to output CBR changes immediately > perf intel-pt: Cater for CBR change in PSB+ > perf intel-pt: Add CBR value to decoder state > perf intel-pt: Synthesize CBR events when last seen value changes > perf db-export: Export synth events > perf scripts python: export-to-sqlite.py: Export Intel PT power and ptwrite events > perf scripts python: export-to-postgresql.py: Export Intel PT power and ptwrite events > > Andi Kleen (4): > perf stat: Make metric event lookup more robust > perf stat: Don't merge events in the same PMU > perf stat: Fix group lookup for metric group > perf stat: Fix metrics with --no-merge > > Arnaldo Carvalho de Melo (26): > perf ctype: Remove unused 'graph_line' variable > perf ui stdio: No need to use 'spaces' to left align > perf ctype: Remove now unused 'spaces' variable > perf string: Move 'dots' and 'graph_dotted_line' out of sane_ctype.h > tools x86 machine: Add missing util.h to pick up 'page_size' > perf kallsyms: Adopt hex2u64 from tools/perf/util/util.h > perf symbols: We need util.h in symbol-elf.c for zfree() > perf tools: Remove old baggage that is util/include/linux/ctype.h > perf tools: Add missing util.h to pick up 'page_size' variable > tools perf: Move from sane_ctype.h obtained from git to the Linux's original > perf tools: Use linux/ctype.h in more places > tools lib: Adopt skip_spaces() from the kernel sources > perf stat: Use recently introduced skip_spaces() > perf header: Use skip_spaces() in __write_cpudesc() > perf time-utils: Use skip_spaces() > perf probe: Use skip_spaces() for argv handling > perf strfilter: Use skip_spaces() > perf metricgroup: Use strsep() > perf report: Use skip_spaces() > perf tools: Ditch rtrim(), use skip_spaces() to get closer to the kernel > tools lib: Adopt strim() from the kernel > perf tools: Remove trim() implementation, use tools/lib's strim() > perf tools: Ditch rtrim(), use strim() from tools/lib > tools lib: Adopt strreplace() from the kernel > perf tools: Drop strxfrchar(), use strreplace() equivalent from kernel > tools lib: Move argv_{split,free} from tools/perf/util/ > > Kyle Meyer (1): > perf tools: Increase MAX_NR_CPUS and MAX_CACHES > > Luke Mujica (1): > perf jevents: Use nonlocal include statements in pmu-events.c > > Mao Han (1): > perf annotate: Add csky support > > Numfor Mbiziwo-Tiapo (1): > perf tools: Fix cache.h include directive > > tools/include/linux/ctype.h | 75 ++++++ > tools/include/linux/string.h | 11 +- > tools/lib/argv_split.c | 100 ++++++++ > tools/lib/ctype.c | 35 +++ > tools/lib/string.c | 55 +++++ > tools/lib/symbol/kallsyms.c | 14 +- > tools/lib/symbol/kallsyms.h | 2 + > tools/perf/MANIFEST | 2 + > tools/perf/arch/arm/util/cs-etm.c | 1 + > tools/perf/arch/csky/annotate/instructions.c | 48 ++++ > tools/perf/arch/s390/util/header.c | 2 +- > tools/perf/arch/x86/tests/intel-cqm.c | 1 + > tools/perf/arch/x86/util/intel-pt.c | 1 + > tools/perf/arch/x86/util/machine.c | 3 +- > tools/perf/builtin-kmem.c | 3 +- > tools/perf/builtin-report.c | 5 +- > tools/perf/builtin-sched.c | 3 +- > tools/perf/builtin-script.c | 14 +- > tools/perf/builtin-stat.c | 2 +- > tools/perf/builtin-top.c | 3 +- > tools/perf/builtin-trace.c | 2 +- > tools/perf/check-headers.sh | 2 + > tools/perf/perf.c | 1 + > tools/perf/perf.h | 2 +- > tools/perf/pmu-events/jevents.c | 4 +- > tools/perf/scripts/python/export-to-postgresql.py | 251 +++++++++++++++++++++ > tools/perf/scripts/python/export-to-sqlite.py | 239 ++++++++++++++++++++ > tools/perf/tests/builtin-test.c | 3 +- > tools/perf/tests/code-reading.c | 2 +- > tools/perf/ui/browser.c | 4 +- > tools/perf/ui/browsers/hists.c | 10 +- > tools/perf/ui/browsers/map.c | 2 +- > tools/perf/ui/gtk/hists.c | 5 +- > tools/perf/ui/progress.c | 2 +- > tools/perf/ui/stdio/hist.c | 16 +- > tools/perf/util/Build | 9 + > tools/perf/util/annotate.c | 20 +- > tools/perf/util/auxtrace.c | 2 +- > tools/perf/util/build-id.c | 2 +- > tools/perf/util/config.c | 2 +- > tools/perf/util/cpumap.c | 2 +- > tools/perf/util/ctype.c | 49 ---- > tools/perf/util/data-convert-bt.c | 2 +- > tools/perf/util/debug.c | 2 +- > tools/perf/util/demangle-java.c | 2 +- > tools/perf/util/dso.c | 3 +- > tools/perf/util/env.c | 2 +- > tools/perf/util/event.c | 6 +- > tools/perf/util/evsel.c | 3 +- > tools/perf/util/header.c | 15 +- > tools/perf/util/include/linux/ctype.h | 1 - > .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 24 +- > .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 1 + > tools/perf/util/intel-pt.c | 65 ++++-- > tools/perf/util/jitdump.c | 2 +- > tools/perf/util/machine.c | 3 +- > tools/perf/util/metricgroup.c | 52 +++-- > tools/perf/util/pmu.c | 5 +- > tools/perf/util/print_binary.c | 2 +- > tools/perf/util/probe-event.c | 2 +- > tools/perf/util/probe-finder.h | 2 +- > tools/perf/util/python-ext-sources | 3 +- > tools/perf/util/python.c | 1 + > tools/perf/util/sane_ctype.h | 52 ----- > .../util/scripting-engines/trace-event-python.c | 46 +++- > tools/perf/util/srcline.c | 3 +- > tools/perf/util/stat-display.c | 14 +- > tools/perf/util/stat-shadow.c | 23 +- > tools/perf/util/strfilter.c | 6 +- > tools/perf/util/string.c | 169 +------------- > tools/perf/util/string2.h | 15 +- > tools/perf/util/symbol-elf.c | 3 +- > tools/perf/util/symbol.c | 2 +- > tools/perf/util/thread-stack.c | 48 ++-- > tools/perf/util/thread_map.c | 3 +- > tools/perf/util/time-utils.c | 8 +- > tools/perf/util/trace-event-parse.c | 2 +- > tools/perf/util/util.c | 13 -- > tools/perf/util/util.h | 1 - > 79 files changed, 1167 insertions(+), 450 deletions(-) > create mode 100644 tools/include/linux/ctype.h > create mode 100644 tools/lib/argv_split.c > create mode 100644 tools/lib/ctype.c > create mode 100644 tools/perf/arch/csky/annotate/instructions.c > delete mode 100644 tools/perf/util/ctype.c > delete mode 100644 tools/perf/util/include/linux/ctype.h > delete mode 100644 tools/perf/util/sane_ctype.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-06-21 17:38 Arnaldo Carvalho de Melo 2019-06-22 6:28 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-06-21 17:38 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Florian Fainelli, John Garry, Laura Abbott, Leo Yan, Mathieu Poirier, Raphael Gault, Suzuki K Poulose, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 3ce5aceb5dee298b082adfa2baa0df5a447c1b0b: Merge tag 'perf-core-for-mingo-5.3-20190611' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-06-17 20:48:14 +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.3-20190621 for you to fetch changes up to 3469fa84c1631face938efc42b3f488a2c2504e0: tools build: Fix the zstd test in the test-all.c common case feature test (2019-06-18 18:44:24 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf trace: Arnaldo Carvalho de Melo: - Fix exclusion of not available syscall names from selector list. - Fixup pointer arithmetic when consuming augmented syscall args. Intel PT: Adrian Hunter: - Add support for decoding PEBS via PT packets. See: https://software.intel.com/en-us/articles/intel-sdm May 2019 version: Vol. 3B 18.5.5.2 PEBS output to Intel® Processor Trace for more details about it. ARM64: John Garry: - Fix uncore PMU alias list for ARM64 Raphael Gault: - Compile tests unconditionally. cs-etm: Mathieu Poirier: - Optimize option setup for CPU-wide sessions. build: Florian Fainelli: - Don't hardcode host include path for libslang, fixing up building with it in cross build environments. Arnaldo Carvalho de Melo: - Check if gettid() is available before providing helper, fixing the build when using the latest glibc version, where a helper for gettid() is finally present. - Fix building with libslang in systems where it is located in slang/slang.h. - Fix fast path test for zstd library. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (11): perf intel-pt: Add new packets for PEBS via PT perf intel-pt: Add Intel PT packet decoder test perf intel-pt: Add decoder support for PEBS via PT perf intel-pt: Prepare to synthesize PEBS samples perf intel-pt: Factor out common sample preparation for re-use perf intel-pt: Synthesize PEBS sample basic information perf intel-pt: Add gp registers to synthesized PEBS sample perf intel-pt: Add XMM registers to synthesized PEBS sample perf intel-pt: Add LBR information to synthesized PEBS sample perf intel-pt: Add memory information to synthesized PEBS sample perf intel-pt: Add callchain to synthesized PEBS sample Arnaldo Carvalho de Melo (10): tools build: Check if gettid() is available before providing helper perf trace: Fix exclusion of not available syscall names from selector list perf trace: Streamline validation of select syscall names list tools build feature tests: Add missing SPDX headers perf tests: Add missing SPDX headers perf trace: Fixup pointer arithmetic when consuming augmented syscall args perf evsel: Make perf_evsel__name() accept a NULL argument tools build: Add test to check if slang.h is in /usr/include/slang/ perf build: Handle slang being in /usr/include and in /usr/include/slang/ tools build: Fix the zstd test in the test-all.c common case feature test Florian Fainelli (1): perf tools: Don't hardcode host include path for libslang John Garry (1): perf pmu: Fix uncore PMU alias list for ARM64 Mathieu Poirier (1): perf: cs-etm: Optimize option setup for CPU-wide sessions Raphael Gault (1): perf tests arm64: Compile tests unconditionally tools/build/Makefile.feature | 3 +- tools/build/feature/Makefile | 10 +- tools/build/feature/test-all.c | 7 +- tools/build/feature/test-fortify-source.c | 1 + tools/build/feature/test-gettid.c | 11 + tools/build/feature/test-hello.c | 1 + tools/build/feature/test-libslang-include-subdir.c | 7 + tools/build/feature/test-setns.c | 1 + tools/perf/Makefile.config | 16 +- tools/perf/arch/arm/util/cs-etm.c | 20 +- tools/perf/arch/arm64/Build | 2 +- tools/perf/arch/arm64/tests/Build | 2 +- tools/perf/arch/x86/include/arch-tests.h | 1 + tools/perf/arch/x86/tests/Build | 2 +- tools/perf/arch/x86/tests/arch-tests.c | 4 + .../arch/x86/tests/intel-pt-pkt-decoder-test.c | 304 +++++++++++++++++++++ tools/perf/builtin-trace.c | 20 +- tools/perf/jvmti/jvmti_agent.c | 2 + tools/perf/tests/Build | 2 + tools/perf/tests/bp_account.c | 1 + tools/perf/tests/bpf-script-example.c | 1 + tools/perf/tests/bpf-script-test-kbuild.c | 1 + tools/perf/tests/bpf-script-test-prologue.c | 1 + tools/perf/tests/bpf-script-test-relocation.c | 1 + tools/perf/tests/bpf.c | 1 + tools/perf/tests/map_groups.c | 1 + tools/perf/tests/mem.c | 1 + tools/perf/tests/mem2node.c | 1 + tools/perf/tests/shell/lib/probe.sh | 1 + tools/perf/tests/shell/probe_vfs_getname.sh | 3 +- .../tests/shell/record+probe_libc_inet_pton.sh | 1 + .../tests/shell/record+script_probe_vfs_getname.sh | 1 + tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 + tools/perf/tests/shell/trace+probe_vfs_getname.sh | 1 + tools/perf/ui/libslang.h | 5 + tools/perf/util/evsel.c | 8 +- .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 114 +++++++- .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 137 ++++++++++ .../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 140 +++++++++- .../util/intel-pt-decoder/intel-pt-pkt-decoder.h | 21 +- tools/perf/util/intel-pt.c | 296 +++++++++++++++++++- tools/perf/util/pmu.c | 28 +- 42 files changed, 1115 insertions(+), 68 deletions(-) create mode 100644 tools/build/feature/test-gettid.c create mode 100644 tools/build/feature/test-libslang-include-subdir.c create mode 100644 tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.2.0-rc4.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 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1) 9 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 10 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), clang version 7.0.1 (Amazon Linux 2 7.0.1-1.amzn2.0.2) 11 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 13 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 14 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 15 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) 16 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190611 gcc-9-branch@272162 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:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 20 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 21 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 23 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 24 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) 25 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 26 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6), clang version 3.7.0 (tags/RELEASE_370/final) 27 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), clang version 3.8.1 (tags/RELEASE_381/final) 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 29 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 30 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 31 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 32 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 33 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) 34 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) 35 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 36 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 37 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) 38 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) 39 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 40 mageia:5 : Ok gcc (GCC) 4.9.2, clang version 3.5.2 (tags/RELEASE_352/final) 41 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0, clang version 3.9.1 (tags/RELEASE_391/final) 42 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) 43 manjaro:latest : Ok gcc (GCC) 8.3.0, clang version 8.0.0 (tags/RELEASE_800/final) 44 openmandriva:cooker : Ok gcc (GCC) 9.1.0 20190503 (OpenMandriva) 45 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.1 20190424 [gcc-7-branch revision 270538], clang version 5.0.1 (tags/RELEASE_501/final 312548) 46 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0, clang version 7.0.1 (tags/RELEASE_701/final 349238) 47 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 48 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190520 [gcc-9-branch revision 271396], clang version 7.0.1 (tags/RELEASE_701/final 349238) 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-36.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 51 ubuntu:12.04 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 52 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) 53 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) 54 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 59 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 60 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 61 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0 62 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0 63 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 64 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 65 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 66 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 67 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 68 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 69 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 70 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 71 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) 72 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 73 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 74 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 75 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 $ # uname -a Linux quaco 5.2.0-rc4+ #1 SMP Tue Jun 11 11:21:27 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 3469fa84c163 tools build: Fix the zstd test in the test-all.c common case feature test # perf version --build-options perf version 5.2.rc4.gd1d5628fa057 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_prefix_O: make install prefix=/tmp/krava make_install_prefix_slash_O: make install prefix=/tmp/krava/ - /home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC: make FEATURE_DUMP_COPY=/home/acme/git/perf/tools/perf/BUILD_TEST_FEATURE_DUMP_STATIC LDFLAGS='-static' feature-dump make_static_O: make LDFLAGS=-static make_with_clangllvm_O: make LIBCLANGLLVM=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_help_O: make help make_no_backtrace_O: make NO_BACKTRACE=1 make_install_bin_O: make install-bin make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_clean_all_O: make clean all make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1 make_debug_O: make DEBUG=1 make_no_libperl_O: make NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_no_slang_O: make NO_SLANG=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_util_map_o_O: make util/map.o make_util_pmu_bison_o_O: make util/pmu-bison.o make_cscope_O: make cscope make_no_libnuma_O: make NO_LIBNUMA=1 make_perf_o_O: make perf.o make_no_newt_O: make NO_NEWT=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_O: make install make_tags_O: make tags make_doc_O: make doc make_no_demangle_O: make NO_DEMANGLE=1 make_pure_O: make make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-06-21 17:38 Arnaldo Carvalho de Melo @ 2019-06-22 6:28 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-06-22 6:28 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Florian Fainelli, John Garry, Laura Abbott, Leo Yan, Mathieu Poirier, Raphael Gault, Suzuki K Poulose, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 3ce5aceb5dee298b082adfa2baa0df5a447c1b0b: > > Merge tag 'perf-core-for-mingo-5.3-20190611' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2019-06-17 20:48:14 +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.3-20190621 > > for you to fetch changes up to 3469fa84c1631face938efc42b3f488a2c2504e0: > > tools build: Fix the zstd test in the test-all.c common case feature test (2019-06-18 18:44:24 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf trace: > > Arnaldo Carvalho de Melo: > > - Fix exclusion of not available syscall names from selector list. > > - Fixup pointer arithmetic when consuming augmented syscall args. > > Intel PT: > > Adrian Hunter: > > - Add support for decoding PEBS via PT packets. See: > > https://software.intel.com/en-us/articles/intel-sdm > May 2019 version: Vol. 3B 18.5.5.2 PEBS output to Intel® Processor Trace > > for more details about it. > > ARM64: > > John Garry: > > - Fix uncore PMU alias list for ARM64 > > Raphael Gault: > > - Compile tests unconditionally. > > cs-etm: > > Mathieu Poirier: > > - Optimize option setup for CPU-wide sessions. > > build: > > Florian Fainelli: > > - Don't hardcode host include path for libslang, fixing up building with it > in cross build environments. > > Arnaldo Carvalho de Melo: > > - Check if gettid() is available before providing helper, fixing the build > when using the latest glibc version, where a helper for gettid() is finally > present. > > - Fix building with libslang in systems where it is located in slang/slang.h. > > - Fix fast path test for zstd library. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (11): > perf intel-pt: Add new packets for PEBS via PT > perf intel-pt: Add Intel PT packet decoder test > perf intel-pt: Add decoder support for PEBS via PT > perf intel-pt: Prepare to synthesize PEBS samples > perf intel-pt: Factor out common sample preparation for re-use > perf intel-pt: Synthesize PEBS sample basic information > perf intel-pt: Add gp registers to synthesized PEBS sample > perf intel-pt: Add XMM registers to synthesized PEBS sample > perf intel-pt: Add LBR information to synthesized PEBS sample > perf intel-pt: Add memory information to synthesized PEBS sample > perf intel-pt: Add callchain to synthesized PEBS sample > > Arnaldo Carvalho de Melo (10): > tools build: Check if gettid() is available before providing helper > perf trace: Fix exclusion of not available syscall names from selector list > perf trace: Streamline validation of select syscall names list > tools build feature tests: Add missing SPDX headers > perf tests: Add missing SPDX headers > perf trace: Fixup pointer arithmetic when consuming augmented syscall args > perf evsel: Make perf_evsel__name() accept a NULL argument > tools build: Add test to check if slang.h is in /usr/include/slang/ > perf build: Handle slang being in /usr/include and in /usr/include/slang/ > tools build: Fix the zstd test in the test-all.c common case feature test > > Florian Fainelli (1): > perf tools: Don't hardcode host include path for libslang > > John Garry (1): > perf pmu: Fix uncore PMU alias list for ARM64 > > Mathieu Poirier (1): > perf: cs-etm: Optimize option setup for CPU-wide sessions > > Raphael Gault (1): > perf tests arm64: Compile tests unconditionally > > tools/build/Makefile.feature | 3 +- > tools/build/feature/Makefile | 10 +- > tools/build/feature/test-all.c | 7 +- > tools/build/feature/test-fortify-source.c | 1 + > tools/build/feature/test-gettid.c | 11 + > tools/build/feature/test-hello.c | 1 + > tools/build/feature/test-libslang-include-subdir.c | 7 + > tools/build/feature/test-setns.c | 1 + > tools/perf/Makefile.config | 16 +- > tools/perf/arch/arm/util/cs-etm.c | 20 +- > tools/perf/arch/arm64/Build | 2 +- > tools/perf/arch/arm64/tests/Build | 2 +- > tools/perf/arch/x86/include/arch-tests.h | 1 + > tools/perf/arch/x86/tests/Build | 2 +- > tools/perf/arch/x86/tests/arch-tests.c | 4 + > .../arch/x86/tests/intel-pt-pkt-decoder-test.c | 304 +++++++++++++++++++++ > tools/perf/builtin-trace.c | 20 +- > tools/perf/jvmti/jvmti_agent.c | 2 + > tools/perf/tests/Build | 2 + > tools/perf/tests/bp_account.c | 1 + > tools/perf/tests/bpf-script-example.c | 1 + > tools/perf/tests/bpf-script-test-kbuild.c | 1 + > tools/perf/tests/bpf-script-test-prologue.c | 1 + > tools/perf/tests/bpf-script-test-relocation.c | 1 + > tools/perf/tests/bpf.c | 1 + > tools/perf/tests/map_groups.c | 1 + > tools/perf/tests/mem.c | 1 + > tools/perf/tests/mem2node.c | 1 + > tools/perf/tests/shell/lib/probe.sh | 1 + > tools/perf/tests/shell/probe_vfs_getname.sh | 3 +- > .../tests/shell/record+probe_libc_inet_pton.sh | 1 + > .../tests/shell/record+script_probe_vfs_getname.sh | 1 + > tools/perf/tests/shell/record+zstd_comp_decomp.sh | 2 + > tools/perf/tests/shell/trace+probe_vfs_getname.sh | 1 + > tools/perf/ui/libslang.h | 5 + > tools/perf/util/evsel.c | 8 +- > .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 114 +++++++- > .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 137 ++++++++++ > .../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 140 +++++++++- > .../util/intel-pt-decoder/intel-pt-pkt-decoder.h | 21 +- > tools/perf/util/intel-pt.c | 296 +++++++++++++++++++- > tools/perf/util/pmu.c | 28 +- > 42 files changed, 1115 insertions(+), 68 deletions(-) > create mode 100644 tools/build/feature/test-gettid.c > create mode 100644 tools/build/feature/test-libslang-include-subdir.c > create mode 100644 tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-06-11 18:57 Arnaldo Carvalho de Melo 2019-06-17 18:48 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-06-11 18:57 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov, Kan Liang, Leo Yan, Mathieu Poirier, Song Liu, Suzuki K Poulose, Thomas Richter, yuzhoujian, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, Best regards, Test results at the end of this message, as usual. - Arnaldo The following changes since commit 3384c78631dd722c2cdc5c57fbdd39fc1b5a9f2d: Merge branch 'x86/topology' into perf/core, to prepare for new patches (2019-06-03 11:58:45 +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.3-20190611 for you to fetch changes up to 04c41bcb862bbec1fb225243ecf07a3219593f81: perf trace: Skip unknown syscalls when expanding strace like syscall groups (2019-06-10 17:50:04 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf record: Alexey Budankov: - Allow mixing --user-regs with --call-graph=dwarf, making sure that the minimal set of registers for DWARF unwinding is present in the set of user registers requested to be present in each sample, while warning the user that this may make callchains unreliable if more that the minimal set of registers is needed to unwind. yuzhoujian: - Add support to collect callchains from kernel or user space only, IOW allow setting the perf_event_attr.exclude_callchain_{kernel,user} bits from the command line. perf trace: Arnaldo Carvalho de Melo: - Remove x86_64 specific syscall numbers from the augmented_raw_syscalls BPF in-kernel collector of augmented raw_syscalls:sys_{enter,exit} payloads, use instead the syscall numbers obtainer either by the arch specific syscalltbl generators or from audit-libs. - Allow 'perf trace' to ask for the number of bytes to collect for string arguments, for now ask for PATH_MAX, i.e. the whole pathnames, which ends up being just a way to speficy which syscall args are pathnames and thus should be read using bpf_probe_read_str(). - Skip unknown syscalls when expanding strace like syscall groups. This helps using the 'string' group of syscalls to work in arm64, where some of the syscalls present in x86_64 that deal with strings, for instance 'access', are deprecated and this should not be asked for tracing. Leo Yan: - Exit when failing to build eBPF program. perf config: Arnaldo Carvalho de Melo: - Bail out when a handler returns failure for a key-value pair. This helps with cases where processing a key-value pair is not just a matter of setting some tool specific knob, involving, for instance building a BPF program to then attach to the list of events 'perf trace' will use, e.g. augmented_raw_syscalls.c. perf.data: Kan Liang: - Read and store die ID information available in new Intel processors in CPUID.1F in the CPU topology written in the perf.data header. perf stat: Kan Liang: - Support per-die aggregation. Documentation: Arnaldo Carvalho de Melo: - Update perf.data documentation about the CPU_TOPOLOGY, MEM_TOPOLOGY, CLOCKID and DIR_FORMAT headers. Song Liu: - Add description of headers HEADER_BPF_PROG_INFO and HEADER_BPF_BTF. Leo Yan: - Update default value for llvm.clang-bpf-cmd-template in 'man perf-config'. JVMTI: Jiri Olsa: - Address gcc string overflow warning for strncpy() core: - Remove superfluous nthreads system_wide setup in perf_evsel__alloc_fd(). Intel PT: Adrian Hunter: - Add support for samples to contain IPC ratio, collecting cycles information from CYC packets, showing the IPC info periodically, because Intel PT does not update the cycle count on every branch or instruction, the incremental values will often be zero. When there are values, they will be the number of instructions and number of cycles since the last update, and thus represent the average IPC since the last IPC value. E.g.: # perf record --cpu 1 -m200000 -a -e intel_pt/cyc/u sleep 0.0001 rounding mmap pages size to 1024M (262144 pages) [ perf record: Woken up 0 times to write data ] [ perf record: Captured and wrote 2.208 MB perf.data ] # perf script --insn-trace --xed -F+ipc,-dso,-cpu,-tid # <SNIP + add line numbering to make sense of IPC counts e.g.: (18/3)> 1 cc1 63501.650479626: 7f5219ac27bf _int_free+0x3f jnz 0x7f5219ac2af0 IPC: 0.81 (36/44) 2 cc1 63501.650479626: 7f5219ac27c5 _int_free+0x45 cmp $0x1f, %rbp 3 cc1 63501.650479626: 7f5219ac27c9 _int_free+0x49 jbe 0x7f5219ac2b00 4 cc1 63501.650479626: 7f5219ac27cf _int_free+0x4f test $0x8, %al 5 cc1 63501.650479626: 7f5219ac27d1 _int_free+0x51 jnz 0x7f5219ac2b00 6 cc1 63501.650479626: 7f5219ac27d7 _int_free+0x57 movq 0x13c58a(%rip), %rcx 7 cc1 63501.650479626: 7f5219ac27de _int_free+0x5e mov %rdi, %r12 8 cc1 63501.650479626: 7f5219ac27e1 _int_free+0x61 movq %fs:(%rcx), %rax 9 cc1 63501.650479626: 7f5219ac27e5 _int_free+0x65 test %rax, %rax 10 cc1 63501.650479626: 7f5219ac27e8 _int_free+0x68 jz 0x7f5219ac2821 11 cc1 63501.650479626: 7f5219ac27ea _int_free+0x6a leaq -0x11(%rbp), %rdi 12 cc1 63501.650479626: 7f5219ac27ee _int_free+0x6e mov %rdi, %rsi 13 cc1 63501.650479626: 7f5219ac27f1 _int_free+0x71 shr $0x4, %rsi 14 cc1 63501.650479626: 7f5219ac27f5 _int_free+0x75 cmpq %rsi, 0x13caf4(%rip) 15 cc1 63501.650479626: 7f5219ac27fc _int_free+0x7c jbe 0x7f5219ac2821 16 cc1 63501.650479626: 7f5219ac2821 _int_free+0xa1 cmpq 0x13f138(%rip), %rbp 17 cc1 63501.650479626: 7f5219ac2828 _int_free+0xa8 jnbe 0x7f5219ac28d8 18 cc1 63501.650479626: 7f5219ac28d8 _int_free+0x158 testb $0x2, 0x8(%rbx) 19 cc1 63501.650479628: 7f5219ac28dc _int_free+0x15c jnz 0x7f5219ac2ab0 IPC: 6.00 (18/3) <SNIP> - Allow using time ranges with Intel PT, i.e. these features, already present but not optimially usable with Intel PT, should be now: Select the second 10% time slice: $ perf script --time 10%/2 Select from 0% to 10% time slice: $ perf script --time 0%-10% Select the first and second 10% time slices: $ perf script --time 10%/1,10%/2 Select from 0% to 10% and 30% to 40% slices: $ perf script --time 0%-10%,30%-40% cs-etm (ARM): Mathieu Poirier: - Add support for CPU-wide trace scenarios. s390: Thomas Richter: - Fix missing kvm module load for s390. - Fix OOM error in TUI mode on s390 - Support s390 diag event display when doing analysis on !s390 architectures. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (38): perf intel-pt: Factor out intel_pt_update_sample_time perf intel-pt: Accumulate cycle count from CYC packets perf tools: Add IPC information to perf_sample perf intel-pt: Add support for samples to contain IPC ratio perf script: Add output of IPC ratio perf intel-pt: Record when decoding PSB+ packets perf intel-pt: Re-factor TIP cases in intel_pt_walk_to_ip perf intel-pt: Accumulate cycle count from TSC/TMA/MTC packets perf intel-pt: Document IPC usage perf thread-stack: Accumulate IPC information perf db-export: Add brief documentation perf db-export: Export IPC information perf scripts python: export-to-sqlite.py: Export IPC information perf scripts python: export-to-postgresql.py: Export IPC information perf scripts python: exported-sql-viewer.py: Add IPC information to the Branch reports perf scripts python: exported-sql-viewer.py: Add CallGraphModelParams perf scripts python: exported-sql-viewer.py: Add IPC information to Call Graph Graph perf scripts python: exported-sql-viewer.py: Add IPC information to Call Tree perf scripts python: exported-sql-viewer.py: Select find text when find bar is activated perf auxtrace: Add perf time interval to itrace_synth_ops perf script: Set perf time interval in itrace_synth_ops perf report: Set perf time interval in itrace_synth_ops perf intel-pt: Add lookahead callback perf intel-pt: Factor out intel_pt_8b_tsc() perf intel-pt: Factor out intel_pt_reposition() perf intel-pt: Add reposition parameter to intel_pt_get_data() perf intel-pt: Add intel_pt_fast_forward() perf intel-pt: Factor out intel_pt_get_buffer() perf intel-pt: Add support for lookahead perf intel-pt: Add support for efficient time interval filtering perf time-utils: Treat time ranges consistently perf time-utils: Factor out set_percent_time() perf time-utils: Prevent percentage time range overlap perf time-utils: Fix --time documentation perf time-utils: Simplify perf_time__parse_for_ranges() error paths slightly perf time-utils: Make perf_time__parse_for_ranges() more logical perf tests: Add a test for time-utils perf time-utils: Add support for multiple explicit time intervals Alexey Budankov (1): perf record: Allow mixing --user-regs with --call-graph=dwarf Arnaldo Carvalho de Melo (13): perf data: Document memory topology header: HEADER_MEM_TOPOLOGY perf data: Document clockid header: HEADER_CLOCKID perf data: Document directory format header: HEADER_DIR_FORMAT perf augmented_raw_syscalls: Tell which args are filenames and how many bytes to copy perf augmented_raw_syscalls: Move the probe_read_str to a separate function perf augmented_raw_syscalls: Change helper to consider just the augmented_filename part perf augmented_raw_syscalls: Move reading filename to the loop perf trace: Consume the augmented_raw_syscalls payload perf trace: Associate more argument names with the filename beautifier perf config: Bail out when a handler returns failure for a key-value pair perf data: Fix perf.data documentation for HEADER_CPU_TOPOLOGY perf cs-etm: Remove duplicate GENMASK() define, use linux/bits.h instead perf trace: Skip unknown syscalls when expanding strace like syscall groups Jiri Olsa (2): perf jvmti: Address gcc string overflow warning for strncpy() perf evsel: Remove superfluous nthreads system_wide setup in alloc_fd() Kan Liang (5): perf cpumap: Retrieve die id information perf header: Add die information in CPU topology perf stat: Support per-die aggregation perf header: Rename "sibling cores" to "sibling sockets" perf tools: Apply new CPU topology sysfs attributes Leo Yan (3): perf symbols: Remove unused variable 'err' perf trace: Exit when failing to build eBPF program perf config: Update default value for llvm.clang-bpf-cmd-template Mathieu Poirier (18): perf cs-etm: Configure contextID tracing in CPU-wide mode perf cs-etm: Configure timestamp generation in CPU-wide mode perf cs-etm: Configure SWITCH_EVENTS in CPU-wide mode perf cs-etm: Add handling of itrace start events perf cs-etm: Add handling of switch-CPU-wide events perf cs-etm: Refactor error path in cs_etm_decoder__new() perf cs-etm: Move packet queue out of decoder structure perf cs-etm: Fix indentation in function cs_etm__process_decoder_queue() perf cs-etm: Introduce the concept of trace ID queues perf cs-etm: Get rid of unused cpu in struct cs_etm_queue perf cs-etm: Move thread to traceid_queue perf cs-etm: Move tid/pid to traceid_queue perf cs-etm: Use traceID aware memory callback API perf cs-etm: Add support for multiple traceID queues perf cs-etm: Linking PE contextID with perf thread mechanic perf cs-etm: Add notion of time to decoding code perf cs-etm: Add support for CPU-wide trace scenarios perf cs-etm: Properly set the value of 'old' and 'head' in snapshot mode Song Liu (1): perf data: Add description of header HEADER_BPF_PROG_INFO and HEADER_BPF_BTF Thomas Richter (3): perf test 6: Fix missing kvm module load for s390 perf report: Fix OOM error in TUI mode on s390 perf report: Support s390 diag event display on x86 yuzhoujian (1): perf record: Add support to collect callchains from kernel or user space only tools/perf/Documentation/db-export.txt | 41 + tools/perf/Documentation/intel-pt.txt | 30 + tools/perf/Documentation/perf-config.txt | 9 +- tools/perf/Documentation/perf-diff.txt | 14 +- tools/perf/Documentation/perf-record.txt | 11 + tools/perf/Documentation/perf-report.txt | 9 +- tools/perf/Documentation/perf-script.txt | 14 +- tools/perf/Documentation/perf-stat.txt | 10 + tools/perf/Documentation/perf.data-file-format.txt | 97 +- tools/perf/Makefile.config | 3 + tools/perf/arch/arm/util/cs-etm.c | 313 +++++- tools/perf/builtin-record.c | 4 + tools/perf/builtin-report.c | 8 +- tools/perf/builtin-script.c | 31 +- tools/perf/builtin-stat.c | 87 +- tools/perf/builtin-trace.c | 84 +- tools/perf/examples/bpf/augmented_raw_syscalls.c | 281 ++---- tools/perf/jvmti/libjvmti.c | 4 +- tools/perf/perf.h | 2 + tools/perf/scripts/python/export-to-postgresql.py | 36 +- tools/perf/scripts/python/export-to-sqlite.py | 36 +- tools/perf/scripts/python/exported-sql-viewer.py | 294 ++++-- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/parse-events.c | 27 + tools/perf/tests/tests.h | 1 + tools/perf/tests/time-utils-test.c | 251 +++++ tools/perf/util/annotate.c | 5 +- tools/perf/util/auxtrace.h | 34 + tools/perf/util/config.c | 8 +- tools/perf/util/cpumap.c | 64 +- tools/perf/util/cpumap.h | 10 +- tools/perf/util/cputopo.c | 84 +- tools/perf/util/cputopo.h | 2 + tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 268 +++-- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 39 +- tools/perf/util/cs-etm.c | 1026 +++++++++++++++----- tools/perf/util/cs-etm.h | 94 ++ tools/perf/util/env.c | 1 + tools/perf/util/env.h | 3 + tools/perf/util/event.h | 2 + tools/perf/util/evsel.c | 16 +- tools/perf/util/header.c | 96 +- .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 329 ++++++- .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 6 + tools/perf/util/intel-pt.c | 354 ++++++- tools/perf/util/perf_regs.h | 4 + tools/perf/util/s390-cpumsf.c | 96 +- .../util/scripting-engines/trace-event-python.c | 8 +- tools/perf/util/smt.c | 8 +- tools/perf/util/stat-display.c | 29 +- tools/perf/util/stat-shadow.c | 1 + tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 1 + tools/perf/util/symbol-elf.c | 3 +- tools/perf/util/thread-stack.c | 14 + tools/perf/util/thread-stack.h | 4 + tools/perf/util/time-utils.c | 132 ++- 58 files changed, 3581 insertions(+), 863 deletions(-) create mode 100644 tools/perf/Documentation/db-export.txt create mode 100644 tools/perf/tests/time-utils-test.c Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.2.0-rc3.tar.xz $ dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0 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:edge : Ok gcc (Alpine 8.3.0) 8.3.0, Alpine clang version 7.0.1 (tags/RELEASE_701/final) (based on LLVM 7.0.1) 8 amazonlinux:1 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2), clang version 3.6.2 (tags/RELEASE_362/final) 9 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) 10 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 11 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 13 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 14 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) 15 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.0.1 20190501 (prerelease) gcc-8-branch@270761, clang version 8.0.0 (tags/RELEASE_800/final) 16 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) 17 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, clang version 3.8.1-24 (tags/RELEASE_381/final) 18 debian:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0, clang version 7.0.1-8 (tags/RELEASE_701/final) 19 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 20 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 21 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 23 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 24 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 25 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 26 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 27 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 28 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1), clang version 3.9.1 (tags/RELEASE_391/final) 29 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2), clang version 4.0.1 (tags/RELEASE_401/final) 30 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6), clang version 5.0.2 (tags/RELEASE_502/final) 31 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2), clang version 6.0.1 (tags/RELEASE_601/final) 32 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) 33 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) 34 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 35 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 36 fedora:rawhide : Ok gcc (GCC) 9.0.1 20190418 (Red Hat 9.0.1-0.14), clang version 8.0.0 (Fedora 8.0.0-2.fc31) 37 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0 38 mageia:5 : Ok gcc (GCC) 4.9.2 39 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0 40 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.0 41 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0 42 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5, clang version 3.8.0 (tags/RELEASE_380/final 262553) 43 opensuse:tumbleweed : Ok gcc (SUSE Linux) 9.1.1 20190520 [gcc-9-branch revision 271396], clang version 7.0.1 (tags/RELEASE_701/final 349238) 44 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 45 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1), clang version 3.4.2 (tags/RELEASE_34/dot2-final) 46 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 47 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 48 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) 49 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 52 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 53 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 54 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0, clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) 56 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0 57 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0 58 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 59 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 60 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 61 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 62 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 63 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 64 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 65 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 66 ubuntu:18.10 : Ok gcc (Ubuntu 8.3.0-6ubuntu1~18.10) 8.3.0, clang version 7.0.0-3 (tags/RELEASE_700/final) 67 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0, clang version 8.0.0-3 (tags/RELEASE_800/final) 68 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 69 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 70 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 $ # uname -a Linux quaco 5.2.0-rc1+ #1 SMP Thu May 23 10:37:55 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 04c41bcb862b perf trace: Skip unknown syscalls when expanding strace like syscall groups # perf version --build-options perf version 5.2.rc3.g04c41bcb862b 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: x86 bp modify : Ok 66: probe libc's inet_pton & backtrace it with ping : Ok 67: Use vfs_getname probe to get syscall args filenames : Ok 68: Add vfs_getname probe to get syscall args filenames : Ok 69: Check open filename arg using perf trace + vfs_getname: Ok 70: 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_tags_O: make tags 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 make_doc_O: make doc make_install_prefix_O: make install prefix=/tmp/krava make_util_pmu_bison_o_O: make util/pmu-bison.o make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_slang_O: make NO_SLANG=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_newt_O: make NO_NEWT=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_help_O: make help make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_no_libelf_O: make NO_LIBELF=1 make_pure_O: make make_static_O: make LDFLAGS=-static make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_debug_O: make DEBUG=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_demangle_O: make NO_DEMANGLE=1 make_perf_o_O: make perf.o make_cscope_O: make cscope make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_util_map_o_O: make util/map.o make_no_libperl_O: make NO_LIBPERL=1 make_install_bin_O: make install-bin make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_gtk2_O: make NO_GTK2=1 make_clean_all_O: make clean all OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-06-11 18:57 Arnaldo Carvalho de Melo @ 2019-06-17 18:48 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-06-17 18:48 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Kan Liang, Leo Yan, Mathieu Poirier, Song Liu, Suzuki K Poulose, Thomas Richter, yuzhoujian, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > Best regards, > > Test results at the end of this message, as usual. > > - Arnaldo > > The following changes since commit 3384c78631dd722c2cdc5c57fbdd39fc1b5a9f2d: > > Merge branch 'x86/topology' into perf/core, to prepare for new patches (2019-06-03 11:58:45 +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.3-20190611 > > for you to fetch changes up to 04c41bcb862bbec1fb225243ecf07a3219593f81: > > perf trace: Skip unknown syscalls when expanding strace like syscall groups (2019-06-10 17:50:04 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf record: > > Alexey Budankov: > > - Allow mixing --user-regs with --call-graph=dwarf, making sure that > the minimal set of registers for DWARF unwinding is present in the > set of user registers requested to be present in each sample, while > warning the user that this may make callchains unreliable if more > that the minimal set of registers is needed to unwind. > > yuzhoujian: > > - Add support to collect callchains from kernel or user space only, > IOW allow setting the perf_event_attr.exclude_callchain_{kernel,user} > bits from the command line. > > perf trace: > > Arnaldo Carvalho de Melo: > > - Remove x86_64 specific syscall numbers from the augmented_raw_syscalls > BPF in-kernel collector of augmented raw_syscalls:sys_{enter,exit} > payloads, use instead the syscall numbers obtainer either by the > arch specific syscalltbl generators or from audit-libs. > > - Allow 'perf trace' to ask for the number of bytes to collect for > string arguments, for now ask for PATH_MAX, i.e. the whole > pathnames, which ends up being just a way to speficy which syscall > args are pathnames and thus should be read using bpf_probe_read_str(). > > - Skip unknown syscalls when expanding strace like syscall groups. > This helps using the 'string' group of syscalls to work in arm64, > where some of the syscalls present in x86_64 that deal with > strings, for instance 'access', are deprecated and this should not > be asked for tracing. > > Leo Yan: > > - Exit when failing to build eBPF program. > > perf config: > > Arnaldo Carvalho de Melo: > > - Bail out when a handler returns failure for a key-value pair. This > helps with cases where processing a key-value pair is not just a > matter of setting some tool specific knob, involving, for instance > building a BPF program to then attach to the list of events 'perf > trace' will use, e.g. augmented_raw_syscalls.c. > > perf.data: > > Kan Liang: > > - Read and store die ID information available in new Intel processors > in CPUID.1F in the CPU topology written in the perf.data header. > > perf stat: > > Kan Liang: > > - Support per-die aggregation. > > Documentation: > > Arnaldo Carvalho de Melo: > > - Update perf.data documentation about the CPU_TOPOLOGY, MEM_TOPOLOGY, > CLOCKID and DIR_FORMAT headers. > > Song Liu: > > - Add description of headers HEADER_BPF_PROG_INFO and HEADER_BPF_BTF. > > Leo Yan: > > - Update default value for llvm.clang-bpf-cmd-template in 'man perf-config'. > > JVMTI: > > Jiri Olsa: > > - Address gcc string overflow warning for strncpy() > > core: > > - Remove superfluous nthreads system_wide setup in perf_evsel__alloc_fd(). > > Intel PT: > > Adrian Hunter: > > - Add support for samples to contain IPC ratio, collecting cycles > information from CYC packets, showing the IPC info periodically, because > Intel PT does not update the cycle count on every branch or instruction, > the incremental values will often be zero. When there are values, they > will be the number of instructions and number of cycles since the last > update, and thus represent the average IPC since the last IPC value. > > E.g.: > > # perf record --cpu 1 -m200000 -a -e intel_pt/cyc/u sleep 0.0001 > rounding mmap pages size to 1024M (262144 pages) > [ perf record: Woken up 0 times to write data ] > [ perf record: Captured and wrote 2.208 MB perf.data ] > # perf script --insn-trace --xed -F+ipc,-dso,-cpu,-tid > # > <SNIP + add line numbering to make sense of IPC counts e.g.: (18/3)> > 1 cc1 63501.650479626: 7f5219ac27bf _int_free+0x3f jnz 0x7f5219ac2af0 IPC: 0.81 (36/44) > 2 cc1 63501.650479626: 7f5219ac27c5 _int_free+0x45 cmp $0x1f, %rbp > 3 cc1 63501.650479626: 7f5219ac27c9 _int_free+0x49 jbe 0x7f5219ac2b00 > 4 cc1 63501.650479626: 7f5219ac27cf _int_free+0x4f test $0x8, %al > 5 cc1 63501.650479626: 7f5219ac27d1 _int_free+0x51 jnz 0x7f5219ac2b00 > 6 cc1 63501.650479626: 7f5219ac27d7 _int_free+0x57 movq 0x13c58a(%rip), %rcx > 7 cc1 63501.650479626: 7f5219ac27de _int_free+0x5e mov %rdi, %r12 > 8 cc1 63501.650479626: 7f5219ac27e1 _int_free+0x61 movq %fs:(%rcx), %rax > 9 cc1 63501.650479626: 7f5219ac27e5 _int_free+0x65 test %rax, %rax > 10 cc1 63501.650479626: 7f5219ac27e8 _int_free+0x68 jz 0x7f5219ac2821 > 11 cc1 63501.650479626: 7f5219ac27ea _int_free+0x6a leaq -0x11(%rbp), %rdi > 12 cc1 63501.650479626: 7f5219ac27ee _int_free+0x6e mov %rdi, %rsi > 13 cc1 63501.650479626: 7f5219ac27f1 _int_free+0x71 shr $0x4, %rsi > 14 cc1 63501.650479626: 7f5219ac27f5 _int_free+0x75 cmpq %rsi, 0x13caf4(%rip) > 15 cc1 63501.650479626: 7f5219ac27fc _int_free+0x7c jbe 0x7f5219ac2821 > 16 cc1 63501.650479626: 7f5219ac2821 _int_free+0xa1 cmpq 0x13f138(%rip), %rbp > 17 cc1 63501.650479626: 7f5219ac2828 _int_free+0xa8 jnbe 0x7f5219ac28d8 > 18 cc1 63501.650479626: 7f5219ac28d8 _int_free+0x158 testb $0x2, 0x8(%rbx) > 19 cc1 63501.650479628: 7f5219ac28dc _int_free+0x15c jnz 0x7f5219ac2ab0 IPC: 6.00 (18/3) > <SNIP> > > - Allow using time ranges with Intel PT, i.e. these features, already > present but not optimially usable with Intel PT, should be now: > > Select the second 10% time slice: > > $ perf script --time 10%/2 > > Select from 0% to 10% time slice: > > $ perf script --time 0%-10% > > Select the first and second 10% time slices: > > $ perf script --time 10%/1,10%/2 > > Select from 0% to 10% and 30% to 40% slices: > > $ perf script --time 0%-10%,30%-40% > > cs-etm (ARM): > > Mathieu Poirier: > > - Add support for CPU-wide trace scenarios. > > s390: > > Thomas Richter: > > - Fix missing kvm module load for s390. > > - Fix OOM error in TUI mode on s390 > > - Support s390 diag event display when doing analysis on !s390 > architectures. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (38): > perf intel-pt: Factor out intel_pt_update_sample_time > perf intel-pt: Accumulate cycle count from CYC packets > perf tools: Add IPC information to perf_sample > perf intel-pt: Add support for samples to contain IPC ratio > perf script: Add output of IPC ratio > perf intel-pt: Record when decoding PSB+ packets > perf intel-pt: Re-factor TIP cases in intel_pt_walk_to_ip > perf intel-pt: Accumulate cycle count from TSC/TMA/MTC packets > perf intel-pt: Document IPC usage > perf thread-stack: Accumulate IPC information > perf db-export: Add brief documentation > perf db-export: Export IPC information > perf scripts python: export-to-sqlite.py: Export IPC information > perf scripts python: export-to-postgresql.py: Export IPC information > perf scripts python: exported-sql-viewer.py: Add IPC information to the Branch reports > perf scripts python: exported-sql-viewer.py: Add CallGraphModelParams > perf scripts python: exported-sql-viewer.py: Add IPC information to Call Graph Graph > perf scripts python: exported-sql-viewer.py: Add IPC information to Call Tree > perf scripts python: exported-sql-viewer.py: Select find text when find bar is activated > perf auxtrace: Add perf time interval to itrace_synth_ops > perf script: Set perf time interval in itrace_synth_ops > perf report: Set perf time interval in itrace_synth_ops > perf intel-pt: Add lookahead callback > perf intel-pt: Factor out intel_pt_8b_tsc() > perf intel-pt: Factor out intel_pt_reposition() > perf intel-pt: Add reposition parameter to intel_pt_get_data() > perf intel-pt: Add intel_pt_fast_forward() > perf intel-pt: Factor out intel_pt_get_buffer() > perf intel-pt: Add support for lookahead > perf intel-pt: Add support for efficient time interval filtering > perf time-utils: Treat time ranges consistently > perf time-utils: Factor out set_percent_time() > perf time-utils: Prevent percentage time range overlap > perf time-utils: Fix --time documentation > perf time-utils: Simplify perf_time__parse_for_ranges() error paths slightly > perf time-utils: Make perf_time__parse_for_ranges() more logical > perf tests: Add a test for time-utils > perf time-utils: Add support for multiple explicit time intervals > > Alexey Budankov (1): > perf record: Allow mixing --user-regs with --call-graph=dwarf > > Arnaldo Carvalho de Melo (13): > perf data: Document memory topology header: HEADER_MEM_TOPOLOGY > perf data: Document clockid header: HEADER_CLOCKID > perf data: Document directory format header: HEADER_DIR_FORMAT > perf augmented_raw_syscalls: Tell which args are filenames and how many bytes to copy > perf augmented_raw_syscalls: Move the probe_read_str to a separate function > perf augmented_raw_syscalls: Change helper to consider just the augmented_filename part > perf augmented_raw_syscalls: Move reading filename to the loop > perf trace: Consume the augmented_raw_syscalls payload > perf trace: Associate more argument names with the filename beautifier > perf config: Bail out when a handler returns failure for a key-value pair > perf data: Fix perf.data documentation for HEADER_CPU_TOPOLOGY > perf cs-etm: Remove duplicate GENMASK() define, use linux/bits.h instead > perf trace: Skip unknown syscalls when expanding strace like syscall groups > > Jiri Olsa (2): > perf jvmti: Address gcc string overflow warning for strncpy() > perf evsel: Remove superfluous nthreads system_wide setup in alloc_fd() > > Kan Liang (5): > perf cpumap: Retrieve die id information > perf header: Add die information in CPU topology > perf stat: Support per-die aggregation > perf header: Rename "sibling cores" to "sibling sockets" > perf tools: Apply new CPU topology sysfs attributes > > Leo Yan (3): > perf symbols: Remove unused variable 'err' > perf trace: Exit when failing to build eBPF program > perf config: Update default value for llvm.clang-bpf-cmd-template > > Mathieu Poirier (18): > perf cs-etm: Configure contextID tracing in CPU-wide mode > perf cs-etm: Configure timestamp generation in CPU-wide mode > perf cs-etm: Configure SWITCH_EVENTS in CPU-wide mode > perf cs-etm: Add handling of itrace start events > perf cs-etm: Add handling of switch-CPU-wide events > perf cs-etm: Refactor error path in cs_etm_decoder__new() > perf cs-etm: Move packet queue out of decoder structure > perf cs-etm: Fix indentation in function cs_etm__process_decoder_queue() > perf cs-etm: Introduce the concept of trace ID queues > perf cs-etm: Get rid of unused cpu in struct cs_etm_queue > perf cs-etm: Move thread to traceid_queue > perf cs-etm: Move tid/pid to traceid_queue > perf cs-etm: Use traceID aware memory callback API > perf cs-etm: Add support for multiple traceID queues > perf cs-etm: Linking PE contextID with perf thread mechanic > perf cs-etm: Add notion of time to decoding code > perf cs-etm: Add support for CPU-wide trace scenarios > perf cs-etm: Properly set the value of 'old' and 'head' in snapshot mode > > Song Liu (1): > perf data: Add description of header HEADER_BPF_PROG_INFO and HEADER_BPF_BTF > > Thomas Richter (3): > perf test 6: Fix missing kvm module load for s390 > perf report: Fix OOM error in TUI mode on s390 > perf report: Support s390 diag event display on x86 > > yuzhoujian (1): > perf record: Add support to collect callchains from kernel or user space only > > tools/perf/Documentation/db-export.txt | 41 + > tools/perf/Documentation/intel-pt.txt | 30 + > tools/perf/Documentation/perf-config.txt | 9 +- > tools/perf/Documentation/perf-diff.txt | 14 +- > tools/perf/Documentation/perf-record.txt | 11 + > tools/perf/Documentation/perf-report.txt | 9 +- > tools/perf/Documentation/perf-script.txt | 14 +- > tools/perf/Documentation/perf-stat.txt | 10 + > tools/perf/Documentation/perf.data-file-format.txt | 97 +- > tools/perf/Makefile.config | 3 + > tools/perf/arch/arm/util/cs-etm.c | 313 +++++- > tools/perf/builtin-record.c | 4 + > tools/perf/builtin-report.c | 8 +- > tools/perf/builtin-script.c | 31 +- > tools/perf/builtin-stat.c | 87 +- > tools/perf/builtin-trace.c | 84 +- > tools/perf/examples/bpf/augmented_raw_syscalls.c | 281 ++---- > tools/perf/jvmti/libjvmti.c | 4 +- > tools/perf/perf.h | 2 + > tools/perf/scripts/python/export-to-postgresql.py | 36 +- > tools/perf/scripts/python/export-to-sqlite.py | 36 +- > tools/perf/scripts/python/exported-sql-viewer.py | 294 ++++-- > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/parse-events.c | 27 + > tools/perf/tests/tests.h | 1 + > tools/perf/tests/time-utils-test.c | 251 +++++ > tools/perf/util/annotate.c | 5 +- > tools/perf/util/auxtrace.h | 34 + > tools/perf/util/config.c | 8 +- > tools/perf/util/cpumap.c | 64 +- > tools/perf/util/cpumap.h | 10 +- > tools/perf/util/cputopo.c | 84 +- > tools/perf/util/cputopo.h | 2 + > tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 268 +++-- > tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 39 +- > tools/perf/util/cs-etm.c | 1026 +++++++++++++++----- > tools/perf/util/cs-etm.h | 94 ++ > tools/perf/util/env.c | 1 + > tools/perf/util/env.h | 3 + > tools/perf/util/event.h | 2 + > tools/perf/util/evsel.c | 16 +- > tools/perf/util/header.c | 96 +- > .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 329 ++++++- > .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 6 + > tools/perf/util/intel-pt.c | 354 ++++++- > tools/perf/util/perf_regs.h | 4 + > tools/perf/util/s390-cpumsf.c | 96 +- > .../util/scripting-engines/trace-event-python.c | 8 +- > tools/perf/util/smt.c | 8 +- > tools/perf/util/stat-display.c | 29 +- > tools/perf/util/stat-shadow.c | 1 + > tools/perf/util/stat.c | 1 + > tools/perf/util/stat.h | 1 + > tools/perf/util/symbol-elf.c | 3 +- > tools/perf/util/thread-stack.c | 14 + > tools/perf/util/thread-stack.h | 4 + > tools/perf/util/time-utils.c | 132 ++- > 58 files changed, 3581 insertions(+), 863 deletions(-) > create mode 100644 tools/perf/Documentation/db-export.txt > create mode 100644 tools/perf/tests/time-utils-test.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-05-17 19:34 Arnaldo Carvalho de Melo 2019-05-18 8:27 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-05-17 19:34 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov, Andi Kleen, Colin King, Donald Yandt, Florian Fainelli, Guo Ren, Jin Yao, Kan Liang, Mao Han, Ravi Bangoria, Stanislav Kozina, Steven Rostedt, Thomas Richter, Tzvetomir Hi Ingo, Please consider pulling, I pulled tip/perf/urgent into tip/pref/core, IIRC was just a fast forward at that point, yeap, just did it again and it still is: $ git checkout -b t tip/perf/core Branch 't' set up to track remote branch 'perf/core' from 'tip'. Switched to a new branch 't' $ git merge tip/perf/urgent Updating d15d356887e7..c7a286577d75 Fast-forward <SNIP> IIRC Jiri needs this for a pile of patches he submitted and that I'll process next, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 6b89d4c1ae8596a8c9240f169ef108704de373f2: perf/x86/intel: Fix INTEL_FLAGS_EVENT_CONSTRAINT* masking (2019-05-10 08:04:17 +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.2-20190517 for you to fetch changes up to 4fc4d8dfa056dfd48afe73b9ea3b7570ceb80b9c: perf stat: Support 'percore' event qualifier (2019-05-16 14:17:24 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf.data: Alexey Budankov: - Streaming compression of perf ring buffer into PERF_RECORD_COMPRESSED user space records, resulting in ~3-5x perf.data file size reduction on variety of tested workloads what saves storage space on larger server systems where perf.data size can easily reach several tens or even hundreds of GiBs, especially when profiling with DWARF-based stacks and tracing of context switches. perf record: Arnaldo Carvalho de Melo - Improve -user-regs/intr-regs suggestions to overcome errors. perf annotate: Jin Yao: - Remove hist__account_cycles() from callback, speeding up branch processing (perf record -b). perf stat: - Add a 'percore' event qualifier, e.g.: -e cpu/event=0,umask=0x3,percore=1/, that sums up the event counts for both hardware threads in a core. We can already do this with --per-core, but it's often useful to do this together with other metrics that are collected per hardware thread. I.e. now its possible to do this per-event, and have it mixed with other events not aggregated by core. core libraries: Donald Yandt: - Check for errors when doing fgets(/proc/version). Jiri Olsa: - Speed up report for perf compiled with linbunwind. tools headers: Arnaldo Carvalho de Melo - Update memcpy_64.S, x86's kvm.h and pt_regs.h. arm64: Florian Fainelli: - Map Brahma-B53 CPUID to cortex-a53 events. - Add Cortex-A57 and Cortex-A72 events. csky: Mao Han: - Add DWARF register mappings for libdw, allowing --call-graph=dwarf to work on the C-SKY arch. x86: Andi Kleen/Kan Liang: - Add support for recording and printing XMM registers, available, for instance, on Icelake. Kan Liang: - Add uncore_upi (Intel's "Ultra Path Interconnect" events) JSON support. UPI replaced the Intel QuickPath Interconnect (QPI) in Xeon Skylake-SP. Intel PT: Adrian Hunter . Fix instructions sampling rate. . Timestamp fixes. . Improve exported-sql-viewer GUI, allowing, for instance, to copy'n'paste the trees, useful for e-mailing. Documentation: Thomas Richter: - Add description for 'perf --debug stderr=1', which redirects stderr to stdout. libtraceevent: Tzvetomir Stoyanov: - Add man pages for the various APIs. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (9): perf scripts python: exported-sql-viewer.py: Move view creation perf scripts python: exported-sql-viewer.py: Fix error when shrinking / enlarging font perf scripts python: exported-sql-viewer.py: Add tree level perf scripts python: exported-sql-viewer.py: Add copy to clipboard perf scripts python: exported-sql-viewer.py: Add context menu perf scripts python: exported-sql-viewer.py: Add 'About' dialog box perf intel-pt: Fix instructions sampling rate perf intel-pt: Fix improved sample timestamp perf intel-pt: Fix sample timestamp wrt non-taken branches Alexey Budankov (11): perf session: Define 'bytes_transferred' and 'bytes_compressed' metrics perf record: Implement COMPRESSED event record and its attributes perf mmap: Implement dedicated memory buffer for data compression perf tools: Introduce Zstd streaming based compression API perf record: Implement compression for serial trace streaming perf record: Implement compression for AIO trace streaming perf report: Add stub processing of compressed events for -D perf record: Implement -z,--compression_level[=<n>] option perf report: Implement perf.data record decompression perf inject: Enable COMPRESSED record decompression perf tests: Implement Zstd comp/decomp integration test Andi Kleen (1): perf tools x86: Add support for recording and printing XMM registers Arnaldo Carvalho de Melo (8): tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' tools arch uapi: Sync the x86 kvm.h copy tools x86 uapi asm: Sync the pt_regs.h copy with the kernel sources tools pci: Do not delete pcitest.sh in 'make clean' perf record: Fix suggestion to get list of registers usable with --user-regs and --intr-regs perf parse-regs: Improve error output when faced with unknown register name perf build tests: Add NO_LIBZSTD=1 to make_minimal perf test zstd: Fixup verbose mode output Colin Ian King (1): perf test: Fix spelling mistake "leadking" -> "leaking" Donald Yandt (1): perf machine: Null-terminate version char array upon fgets(/proc/version) error Florian Fainelli (3): perf vendor events arm64: Remove [[:xdigit:]] wildcard perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events Jin Yao (4): perf annotate: Remove hist__account_cycles() from callback perf tools: Add a 'percore' event qualifier perf stat: Factor out aggregate counts printing perf stat: Support 'percore' event qualifier Jiri Olsa (1): perf tools: Speed up report for perf compiled with linwunwind Kan Liang (4): perf vendor events intel: Add uncore_upi JSON support perf parse-regs: Split parse_regs perf parse-regs: Add generic support for arch__intr/user_reg_mask() perf regs x86: Add X86 specific arch__intr_reg_mask() Mao Han (1): csky: Add support for libdw Thomas Richter (1): perf docs: Add description for stderr Tzvetomir Stoyanov (27): tools lib traceevent: Remove hard coded install paths from pkg-config file tools lib traceevent: Introduce man pages tools lib traceevent: Add support for man pages with multiple names tools lib traceevent: Man pages for tep_handler related APIs tools lib traceevent: Man page for header_page APIs tools lib traceevent: Man page for get/set cpus APIs tools lib traceevent: Man page for file endian APIs tools lib traceevent: Man page for host endian APIs tools lib traceevent: Man page for page size APIs tools lib traceevent: Man page for tep_strerror() tools lib traceevent: Man pages for event handler APIs tools lib traceevent: Man pages for function related libtraceevent APIs tools lib traceevent: Man pages for registering print function tools lib traceevent: Man page for tep_read_number() tools lib traceevent: Man pages for event find APIs tools lib traceevent: Man page for list events APIs tools lib traceevent: Man pages for libtraceevent event get APIs tools lib traceevent: Man pages for find field APIs tools lib traceevent: Man pages for get field value APIs tools lib traceevent: Man pages for print field APIs tools lib traceevent: Man page for tep_read_number_field() tools lib traceevent: Man pages for event fields APIs tools lib traceevent: Man pages for event filter APIs tools lib traceevent: Man pages for parse event APIs tools lib traceevent: Man page for tep_parse_header_page() tools lib traceevent: Man pages for APIs used to extract common fields from a record tools lib traceevent: Man pages for trace sequences APIs Zenghui Yu (1): perf jevents: Remove unused variable tools/arch/csky/include/uapi/asm/perf_regs.h | 51 ++++ tools/arch/x86/include/uapi/asm/kvm.h | 1 + tools/arch/x86/include/uapi/asm/perf_regs.h | 23 +- tools/arch/x86/lib/memcpy_64.S | 3 +- tools/lib/traceevent/Documentation/Makefile | 207 +++++++++++++ tools/lib/traceevent/Documentation/asciidoc.conf | 120 ++++++++ .../Documentation/libtraceevent-commands.txt | 153 ++++++++++ .../Documentation/libtraceevent-cpus.txt | 77 +++++ .../Documentation/libtraceevent-endian_read.txt | 78 +++++ .../Documentation/libtraceevent-event_find.txt | 103 +++++++ .../Documentation/libtraceevent-event_get.txt | 99 ++++++ .../Documentation/libtraceevent-event_list.txt | 122 ++++++++ .../Documentation/libtraceevent-field_find.txt | 118 +++++++ .../Documentation/libtraceevent-field_get_val.txt | 122 ++++++++ .../Documentation/libtraceevent-field_print.txt | 126 ++++++++ .../Documentation/libtraceevent-field_read.txt | 81 +++++ .../Documentation/libtraceevent-fields.txt | 105 +++++++ .../Documentation/libtraceevent-file_endian.txt | 91 ++++++ .../Documentation/libtraceevent-filter.txt | 209 +++++++++++++ .../Documentation/libtraceevent-func_apis.txt | 183 +++++++++++ .../Documentation/libtraceevent-func_find.txt | 88 ++++++ .../Documentation/libtraceevent-handle.txt | 101 ++++++ .../Documentation/libtraceevent-header_page.txt | 102 +++++++ .../Documentation/libtraceevent-host_endian.txt | 104 +++++++ .../Documentation/libtraceevent-long_size.txt | 78 +++++ .../Documentation/libtraceevent-page_size.txt | 82 +++++ .../Documentation/libtraceevent-parse_event.txt | 90 ++++++ .../Documentation/libtraceevent-parse_head.txt | 82 +++++ .../Documentation/libtraceevent-record_parse.txt | 137 +++++++++ .../libtraceevent-reg_event_handler.txt | 156 ++++++++++ .../Documentation/libtraceevent-reg_print_func.txt | 155 ++++++++++ .../Documentation/libtraceevent-set_flag.txt | 104 +++++++ .../Documentation/libtraceevent-strerror.txt | 85 ++++++ .../Documentation/libtraceevent-tseq.txt | 158 ++++++++++ .../lib/traceevent/Documentation/libtraceevent.txt | 203 ++++++++++++ .../lib/traceevent/Documentation/manpage-1.72.xsl | 14 + .../lib/traceevent/Documentation/manpage-base.xsl | 35 +++ .../Documentation/manpage-bold-literal.xsl | 17 ++ .../traceevent/Documentation/manpage-normal.xsl | 13 + .../Documentation/manpage-suppress-sp.xsl | 21 ++ tools/lib/traceevent/Makefile | 46 ++- tools/lib/traceevent/libtraceevent.pc.template | 4 +- tools/pci/Makefile | 4 +- tools/perf/Documentation/perf-list.txt | 12 + tools/perf/Documentation/perf-record.txt | 8 +- tools/perf/Documentation/perf-stat.txt | 4 + tools/perf/Documentation/perf.data-file-format.txt | 24 ++ tools/perf/Documentation/perf.txt | 2 + tools/perf/Makefile.config | 6 +- tools/perf/arch/csky/Build | 1 + tools/perf/arch/csky/Makefile | 3 + tools/perf/arch/csky/include/perf_regs.h | 100 ++++++ tools/perf/arch/csky/util/Build | 2 + tools/perf/arch/csky/util/dwarf-regs.c | 49 +++ tools/perf/arch/csky/util/unwind-libdw.c | 77 +++++ tools/perf/arch/x86/include/perf_regs.h | 26 +- tools/perf/arch/x86/util/perf_regs.c | 44 +++ tools/perf/builtin-annotate.c | 4 +- tools/perf/builtin-inject.c | 4 + tools/perf/builtin-record.c | 229 ++++++++++++-- tools/perf/builtin-report.c | 16 +- tools/perf/builtin-stat.c | 21 ++ tools/perf/perf.h | 1 + .../arm64/arm/cortex-a57-a72/core-imp-def.json | 179 +++++++++++ tools/perf/pmu-events/arch/arm64/mapfile.csv | 5 +- tools/perf/pmu-events/jevents.c | 2 +- tools/perf/scripts/python/exported-sql-viewer.py | 340 ++++++++++++++++++++- tools/perf/tests/dso-data.c | 4 +- tools/perf/tests/make | 2 +- tools/perf/tests/shell/record+zstd_comp_decomp.sh | 34 +++ tools/perf/util/Build | 2 + tools/perf/util/annotate.c | 2 +- tools/perf/util/compress.h | 53 ++++ tools/perf/util/env.h | 11 + tools/perf/util/event.c | 1 + tools/perf/util/event.h | 7 + tools/perf/util/evlist.c | 8 +- tools/perf/util/evlist.h | 2 +- tools/perf/util/evsel.c | 2 + tools/perf/util/evsel.h | 3 + tools/perf/util/header.c | 53 ++++ tools/perf/util/header.h | 1 + .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 31 +- tools/perf/util/machine.c | 3 +- tools/perf/util/mmap.c | 102 ++----- tools/perf/util/mmap.h | 16 +- tools/perf/util/parse-events.c | 27 ++ tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 1 + tools/perf/util/parse-regs-options.c | 33 +- tools/perf/util/parse-regs-options.h | 3 +- tools/perf/util/perf_regs.c | 10 + tools/perf/util/perf_regs.h | 3 + tools/perf/util/session.c | 133 +++++++- tools/perf/util/session.h | 14 + tools/perf/util/stat-display.c | 107 +++++-- tools/perf/util/stat.c | 8 +- tools/perf/util/thread.c | 3 +- tools/perf/util/tool.h | 2 + tools/perf/util/unwind-libunwind-local.c | 6 - tools/perf/util/unwind-libunwind.c | 10 + tools/perf/util/zstd.c | 111 +++++++ 102 files changed, 5703 insertions(+), 216 deletions(-) create mode 100644 tools/arch/csky/include/uapi/asm/perf_regs.h create mode 100644 tools/lib/traceevent/Documentation/Makefile create mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt create mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt create mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl create mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl create mode 100644 tools/perf/arch/csky/Build create mode 100644 tools/perf/arch/csky/Makefile create mode 100644 tools/perf/arch/csky/include/perf_regs.h create mode 100644 tools/perf/arch/csky/util/Build create mode 100644 tools/perf/arch/csky/util/dwarf-regs.c create mode 100644 tools/perf/arch/csky/util/unwind-libdw.c create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json create mode 100755 tools/perf/tests/shell/record+zstd_comp_decomp.sh create mode 100644 tools/perf/util/zstd.c Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.1.0.tar.xz $ dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0 6 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0 7 alpine:edge : Ok gcc (Alpine 8.3.0) 8.3.0 8 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28) 9 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) 10 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 11 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 13 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 14 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) 15 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 9.0.1 20190501 (prerelease) gcc-8-branch@270761 16 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2 17 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 18 debian:experimental : Ok gcc (Debian 8.3.0-7) 8.3.0 19 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 20 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 21 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.3.0-7) 8.3.0 22 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.3.0-7) 8.3.0 23 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 24 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 25 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 26 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 27 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 28 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 29 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2) 30 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6) 31 fedora:28 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2) 32 fedora:29 : Ok gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2) 33 fedora:30 : Ok gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1) 34 fedora:30-x-ARC-glibc : Ok arc-linux-gcc (ARC HS GNU/Linux glibc toolchain 2019.03-rc1) 8.3.1 20190225 35 fedora:30-x-ARC-uClibc : Ok arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 36 fedora:rawhide : Ok gcc (GCC) 9.0.1 20190418 (Red Hat 9.0.1-0.14) 37 mageia:5 : Ok gcc (GCC) 4.9.2 38 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0 39 opensuse:15.0 : Ok gcc (SUSE Linux) 7.4.0 40 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0 41 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5 42 opensuse:tumbleweed : Ok gcc (SUSE Linux) 8.3.1 20190226 [gcc-8-branch revision 269204] 43 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 44 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) 45 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 46 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 47 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 48 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 49 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 50 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 51 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 52 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 53 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 54 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0 55 ubuntu:18.04 : Ok gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 56 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0 57 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04) 7.4.0 58 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 59 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 60 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 61 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 62 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 63 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 64 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 65 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 66 ubuntu:18.10 : Ok gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0 67 ubuntu:19.04 : Ok gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 68 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 69 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.3.0-6ubuntu1) 8.3.0 70 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 The getname_flags related tests failing at the end (tests 65, 66 and 67) are being investigated, getname_flags() seems to have become just a tail call from getname(), something in this are changed and we're not anymore being able to add a probe at a suitable place to collect the just copied from userspace pathname. # uname -a Linux quaco 5.1.0-rc7+ #1 SMP Thu May 2 09:47:59 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 4fc4d8dfa056 perf stat: Support 'percore' event qualifier # perf version --build-options perf version 5.1.g4fc4d8 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: x86 rdpmc : Ok 60: Convert perf time to TSC : Ok 61: DWARF unwind : Ok 62: x86 instruction decoder - new instructions : Ok 63: x86 bp modify : Ok 64: probe libc's inet_pton & backtrace it with ping : Ok 65: Use vfs_getname probe to get syscall args filenames : FAILED! 66: Add vfs_getname probe to get syscall args filenames : FAILED! 67: Check open filename arg using perf trace + vfs_getname: FAILED! 68: Zstd perf.data compression/decompression : Ok $ time make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_doc_O: make doc make_cscope_O: make cscope make_no_newt_O: make NO_NEWT=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_demangle_O: make NO_DEMANGLE=1 make_debug_O: make DEBUG=1 make_no_libelf_O: make NO_LIBELF=1 make_no_gtk2_O: make NO_GTK2=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_perf_o_O: make perf.o make_install_O: make install make_pure_O: make make_util_map_o_O: make util/map.o make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_static_O: make LDFLAGS=-static make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libaudit_O: make NO_LIBAUDIT=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libperl_O: make NO_LIBPERL=1 make_clean_all_O: make clean all make_util_pmu_bison_o_O: make util/pmu-bison.o make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_slang_O: make NO_SLANG=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 make_help_O: make help make_no_libbpf_O: make NO_LIBBPF=1 make_install_bin_O: make install-bin make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_tags_O: make tags OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-05-17 19:34 Arnaldo Carvalho de Melo @ 2019-05-18 8:27 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-05-18 8:27 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner, Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter, Alexey Budankov, Andi Kleen, Colin King, Donald Yandt, Florian Fainelli, Guo Ren, Jin Yao, Kan Liang, Mao Han, Ravi Bangoria, Stanislav Kozina, Steven Rostedt, Thomas Richter, Tzvetomir * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, I pulled tip/perf/urgent into > tip/pref/core, IIRC was just a fast forward at that point, yeap, just > did it again and it still is: > > $ git checkout -b t tip/perf/core > Branch 't' set up to track remote branch 'perf/core' from 'tip'. > Switched to a new branch 't' > $ git merge tip/perf/urgent > Updating d15d356887e7..c7a286577d75 > Fast-forward > <SNIP> > > IIRC Jiri needs this for a pile of patches he submitted and > that I'll process next, > > Best regards, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 6b89d4c1ae8596a8c9240f169ef108704de373f2: > > perf/x86/intel: Fix INTEL_FLAGS_EVENT_CONSTRAINT* masking (2019-05-10 08:04:17 +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.2-20190517 > > for you to fetch changes up to 4fc4d8dfa056dfd48afe73b9ea3b7570ceb80b9c: > > perf stat: Support 'percore' event qualifier (2019-05-16 14:17:24 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf.data: > > Alexey Budankov: > > - Streaming compression of perf ring buffer into PERF_RECORD_COMPRESSED > user space records, resulting in ~3-5x perf.data file size reduction > on variety of tested workloads what saves storage space on larger > server systems where perf.data size can easily reach several tens or > even hundreds of GiBs, especially when profiling with DWARF-based > stacks and tracing of context switches. > > perf record: > > Arnaldo Carvalho de Melo > > - Improve -user-regs/intr-regs suggestions to overcome errors. > > perf annotate: > > Jin Yao: > > - Remove hist__account_cycles() from callback, speeding up branch processing > (perf record -b). > > perf stat: > > - Add a 'percore' event qualifier, e.g.: -e cpu/event=0,umask=0x3,percore=1/, > that sums up the event counts for both hardware threads in a core. > > We can already do this with --per-core, but it's often useful to do > this together with other metrics that are collected per hardware thread. > > I.e. now its possible to do this per-event, and have it mixed with other > events not aggregated by core. > > core libraries: > > Donald Yandt: > > - Check for errors when doing fgets(/proc/version). > > Jiri Olsa: > > - Speed up report for perf compiled with linbunwind. > > tools headers: > > Arnaldo Carvalho de Melo > > - Update memcpy_64.S, x86's kvm.h and pt_regs.h. > > arm64: > > Florian Fainelli: > > - Map Brahma-B53 CPUID to cortex-a53 events. > > - Add Cortex-A57 and Cortex-A72 events. > > csky: > > Mao Han: > > - Add DWARF register mappings for libdw, allowing --call-graph=dwarf to work > on the C-SKY arch. > > x86: > > Andi Kleen/Kan Liang: > > - Add support for recording and printing XMM registers, available, for > instance, on Icelake. > > Kan Liang: > > - Add uncore_upi (Intel's "Ultra Path Interconnect" events) JSON support. > UPI replaced the Intel QuickPath Interconnect (QPI) in Xeon Skylake-SP. > > Intel PT: > > Adrian Hunter > > . Fix instructions sampling rate. > > . Timestamp fixes. > > . Improve exported-sql-viewer GUI, allowing, for instance, to copy'n'paste > the trees, useful for e-mailing. > > Documentation: > > Thomas Richter: > > - Add description for 'perf --debug stderr=1', which redirects stderr to stdout. > > libtraceevent: > > Tzvetomir Stoyanov: > > - Add man pages for the various APIs. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (9): > perf scripts python: exported-sql-viewer.py: Move view creation > perf scripts python: exported-sql-viewer.py: Fix error when shrinking / enlarging font > perf scripts python: exported-sql-viewer.py: Add tree level > perf scripts python: exported-sql-viewer.py: Add copy to clipboard > perf scripts python: exported-sql-viewer.py: Add context menu > perf scripts python: exported-sql-viewer.py: Add 'About' dialog box > perf intel-pt: Fix instructions sampling rate > perf intel-pt: Fix improved sample timestamp > perf intel-pt: Fix sample timestamp wrt non-taken branches > > Alexey Budankov (11): > perf session: Define 'bytes_transferred' and 'bytes_compressed' metrics > perf record: Implement COMPRESSED event record and its attributes > perf mmap: Implement dedicated memory buffer for data compression > perf tools: Introduce Zstd streaming based compression API > perf record: Implement compression for serial trace streaming > perf record: Implement compression for AIO trace streaming > perf report: Add stub processing of compressed events for -D > perf record: Implement -z,--compression_level[=<n>] option > perf report: Implement perf.data record decompression > perf inject: Enable COMPRESSED record decompression > perf tests: Implement Zstd comp/decomp integration test > > Andi Kleen (1): > perf tools x86: Add support for recording and printing XMM registers > > Arnaldo Carvalho de Melo (8): > tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' > tools arch uapi: Sync the x86 kvm.h copy > tools x86 uapi asm: Sync the pt_regs.h copy with the kernel sources > tools pci: Do not delete pcitest.sh in 'make clean' > perf record: Fix suggestion to get list of registers usable with --user-regs and --intr-regs > perf parse-regs: Improve error output when faced with unknown register name > perf build tests: Add NO_LIBZSTD=1 to make_minimal > perf test zstd: Fixup verbose mode output > > Colin Ian King (1): > perf test: Fix spelling mistake "leadking" -> "leaking" > > Donald Yandt (1): > perf machine: Null-terminate version char array upon fgets(/proc/version) error > > Florian Fainelli (3): > perf vendor events arm64: Remove [[:xdigit:]] wildcard > perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events > perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events > > Jin Yao (4): > perf annotate: Remove hist__account_cycles() from callback > perf tools: Add a 'percore' event qualifier > perf stat: Factor out aggregate counts printing > perf stat: Support 'percore' event qualifier > > Jiri Olsa (1): > perf tools: Speed up report for perf compiled with linwunwind > > Kan Liang (4): > perf vendor events intel: Add uncore_upi JSON support > perf parse-regs: Split parse_regs > perf parse-regs: Add generic support for arch__intr/user_reg_mask() > perf regs x86: Add X86 specific arch__intr_reg_mask() > > Mao Han (1): > csky: Add support for libdw > > Thomas Richter (1): > perf docs: Add description for stderr > > Tzvetomir Stoyanov (27): > tools lib traceevent: Remove hard coded install paths from pkg-config file > tools lib traceevent: Introduce man pages > tools lib traceevent: Add support for man pages with multiple names > tools lib traceevent: Man pages for tep_handler related APIs > tools lib traceevent: Man page for header_page APIs > tools lib traceevent: Man page for get/set cpus APIs > tools lib traceevent: Man page for file endian APIs > tools lib traceevent: Man page for host endian APIs > tools lib traceevent: Man page for page size APIs > tools lib traceevent: Man page for tep_strerror() > tools lib traceevent: Man pages for event handler APIs > tools lib traceevent: Man pages for function related libtraceevent APIs > tools lib traceevent: Man pages for registering print function > tools lib traceevent: Man page for tep_read_number() > tools lib traceevent: Man pages for event find APIs > tools lib traceevent: Man page for list events APIs > tools lib traceevent: Man pages for libtraceevent event get APIs > tools lib traceevent: Man pages for find field APIs > tools lib traceevent: Man pages for get field value APIs > tools lib traceevent: Man pages for print field APIs > tools lib traceevent: Man page for tep_read_number_field() > tools lib traceevent: Man pages for event fields APIs > tools lib traceevent: Man pages for event filter APIs > tools lib traceevent: Man pages for parse event APIs > tools lib traceevent: Man page for tep_parse_header_page() > tools lib traceevent: Man pages for APIs used to extract common fields from a record > tools lib traceevent: Man pages for trace sequences APIs > > Zenghui Yu (1): > perf jevents: Remove unused variable > > tools/arch/csky/include/uapi/asm/perf_regs.h | 51 ++++ > tools/arch/x86/include/uapi/asm/kvm.h | 1 + > tools/arch/x86/include/uapi/asm/perf_regs.h | 23 +- > tools/arch/x86/lib/memcpy_64.S | 3 +- > tools/lib/traceevent/Documentation/Makefile | 207 +++++++++++++ > tools/lib/traceevent/Documentation/asciidoc.conf | 120 ++++++++ > .../Documentation/libtraceevent-commands.txt | 153 ++++++++++ > .../Documentation/libtraceevent-cpus.txt | 77 +++++ > .../Documentation/libtraceevent-endian_read.txt | 78 +++++ > .../Documentation/libtraceevent-event_find.txt | 103 +++++++ > .../Documentation/libtraceevent-event_get.txt | 99 ++++++ > .../Documentation/libtraceevent-event_list.txt | 122 ++++++++ > .../Documentation/libtraceevent-field_find.txt | 118 +++++++ > .../Documentation/libtraceevent-field_get_val.txt | 122 ++++++++ > .../Documentation/libtraceevent-field_print.txt | 126 ++++++++ > .../Documentation/libtraceevent-field_read.txt | 81 +++++ > .../Documentation/libtraceevent-fields.txt | 105 +++++++ > .../Documentation/libtraceevent-file_endian.txt | 91 ++++++ > .../Documentation/libtraceevent-filter.txt | 209 +++++++++++++ > .../Documentation/libtraceevent-func_apis.txt | 183 +++++++++++ > .../Documentation/libtraceevent-func_find.txt | 88 ++++++ > .../Documentation/libtraceevent-handle.txt | 101 ++++++ > .../Documentation/libtraceevent-header_page.txt | 102 +++++++ > .../Documentation/libtraceevent-host_endian.txt | 104 +++++++ > .../Documentation/libtraceevent-long_size.txt | 78 +++++ > .../Documentation/libtraceevent-page_size.txt | 82 +++++ > .../Documentation/libtraceevent-parse_event.txt | 90 ++++++ > .../Documentation/libtraceevent-parse_head.txt | 82 +++++ > .../Documentation/libtraceevent-record_parse.txt | 137 +++++++++ > .../libtraceevent-reg_event_handler.txt | 156 ++++++++++ > .../Documentation/libtraceevent-reg_print_func.txt | 155 ++++++++++ > .../Documentation/libtraceevent-set_flag.txt | 104 +++++++ > .../Documentation/libtraceevent-strerror.txt | 85 ++++++ > .../Documentation/libtraceevent-tseq.txt | 158 ++++++++++ > .../lib/traceevent/Documentation/libtraceevent.txt | 203 ++++++++++++ > .../lib/traceevent/Documentation/manpage-1.72.xsl | 14 + > .../lib/traceevent/Documentation/manpage-base.xsl | 35 +++ > .../Documentation/manpage-bold-literal.xsl | 17 ++ > .../traceevent/Documentation/manpage-normal.xsl | 13 + > .../Documentation/manpage-suppress-sp.xsl | 21 ++ > tools/lib/traceevent/Makefile | 46 ++- > tools/lib/traceevent/libtraceevent.pc.template | 4 +- > tools/pci/Makefile | 4 +- > tools/perf/Documentation/perf-list.txt | 12 + > tools/perf/Documentation/perf-record.txt | 8 +- > tools/perf/Documentation/perf-stat.txt | 4 + > tools/perf/Documentation/perf.data-file-format.txt | 24 ++ > tools/perf/Documentation/perf.txt | 2 + > tools/perf/Makefile.config | 6 +- > tools/perf/arch/csky/Build | 1 + > tools/perf/arch/csky/Makefile | 3 + > tools/perf/arch/csky/include/perf_regs.h | 100 ++++++ > tools/perf/arch/csky/util/Build | 2 + > tools/perf/arch/csky/util/dwarf-regs.c | 49 +++ > tools/perf/arch/csky/util/unwind-libdw.c | 77 +++++ > tools/perf/arch/x86/include/perf_regs.h | 26 +- > tools/perf/arch/x86/util/perf_regs.c | 44 +++ > tools/perf/builtin-annotate.c | 4 +- > tools/perf/builtin-inject.c | 4 + > tools/perf/builtin-record.c | 229 ++++++++++++-- > tools/perf/builtin-report.c | 16 +- > tools/perf/builtin-stat.c | 21 ++ > tools/perf/perf.h | 1 + > .../arm64/arm/cortex-a57-a72/core-imp-def.json | 179 +++++++++++ > tools/perf/pmu-events/arch/arm64/mapfile.csv | 5 +- > tools/perf/pmu-events/jevents.c | 2 +- > tools/perf/scripts/python/exported-sql-viewer.py | 340 ++++++++++++++++++++- > tools/perf/tests/dso-data.c | 4 +- > tools/perf/tests/make | 2 +- > tools/perf/tests/shell/record+zstd_comp_decomp.sh | 34 +++ > tools/perf/util/Build | 2 + > tools/perf/util/annotate.c | 2 +- > tools/perf/util/compress.h | 53 ++++ > tools/perf/util/env.h | 11 + > tools/perf/util/event.c | 1 + > tools/perf/util/event.h | 7 + > tools/perf/util/evlist.c | 8 +- > tools/perf/util/evlist.h | 2 +- > tools/perf/util/evsel.c | 2 + > tools/perf/util/evsel.h | 3 + > tools/perf/util/header.c | 53 ++++ > tools/perf/util/header.h | 1 + > .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 31 +- > tools/perf/util/machine.c | 3 +- > tools/perf/util/mmap.c | 102 ++----- > tools/perf/util/mmap.h | 16 +- > tools/perf/util/parse-events.c | 27 ++ > tools/perf/util/parse-events.h | 1 + > tools/perf/util/parse-events.l | 1 + > tools/perf/util/parse-regs-options.c | 33 +- > tools/perf/util/parse-regs-options.h | 3 +- > tools/perf/util/perf_regs.c | 10 + > tools/perf/util/perf_regs.h | 3 + > tools/perf/util/session.c | 133 +++++++- > tools/perf/util/session.h | 14 + > tools/perf/util/stat-display.c | 107 +++++-- > tools/perf/util/stat.c | 8 +- > tools/perf/util/thread.c | 3 +- > tools/perf/util/tool.h | 2 + > tools/perf/util/unwind-libunwind-local.c | 6 - > tools/perf/util/unwind-libunwind.c | 10 + > tools/perf/util/zstd.c | 111 +++++++ > 102 files changed, 5703 insertions(+), 216 deletions(-) > create mode 100644 tools/arch/csky/include/uapi/asm/perf_regs.h > create mode 100644 tools/lib/traceevent/Documentation/Makefile > create mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt > create mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt > create mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl > create mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl > create mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl > create mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl > create mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl > create mode 100644 tools/perf/arch/csky/Build > create mode 100644 tools/perf/arch/csky/Makefile > create mode 100644 tools/perf/arch/csky/include/perf_regs.h > create mode 100644 tools/perf/arch/csky/util/Build > create mode 100644 tools/perf/arch/csky/util/dwarf-regs.c > create mode 100644 tools/perf/arch/csky/util/unwind-libdw.c > create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cortex-a57-a72/core-imp-def.json > create mode 100755 tools/perf/tests/shell/record+zstd_comp_decomp.sh > create mode 100644 tools/perf/util/zstd.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
* [GIT PULL] perf/core improvements and fixes @ 2019-02-25 21:19 Arnaldo Carvalho de Melo 2019-02-28 7:31 ` Ingo Molnar 0 siblings, 1 reply; 160+ messages in thread From: Arnaldo Carvalho de Melo @ 2019-02-25 21:19 UTC (permalink / raw) To: Ingo Molnar Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Mansour Alharthi, Mathieu Poirier, Seeteena Thoufeek, Tony Jones, Wei Li Hi Ingo, Please consider pulling, this is on top of my previous pull request, perf-core-for-mingo-5.1-20190220. - Arnaldo Test results at the end of this message, as usual. The following changes since commit b4409ae112caa6315f6ee678e953b9fc93e6919c: perf tools: Make rm_rf() remove single file (2019-02-20 17:09:28 -0300) 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.1-20190225 for you to fetch changes up to de667cce7f4f96b6e22da8fd9c065b961f355080: perf script python: Add Python3 support to syscall-counts-by-pid.py (2019-02-25 17:17:13 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: perf annotate: Wei Li: - Fix getting source line failure. perf script: Andi Kleen: - Handle missing fields with -F +... perf data: Jiri Olsa: - Prep work to support per-cpu files in a directory. Intel PT: Adrian Hunter: - Improve thread_stack__no_call_return() - Hide x86 retpolines in thread stacks. - exported SQL viewer refactorings, new 'top calls' report. Alexander Shishkin: - Copy parent's address filter offsets on clone. - Fix address filters for vmas with non-zero offset. Applies to ARM's CoreSight as well. python scripts: Tony Jones: - Python3 support for several 'perf script' python scripts. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Adrian Hunter (13): perf thread-stack: Improve thread_stack__no_call_return() perf thread-stack: Hide x86 retpolines perf scripts python: exported-sql-viewer.py: Fix missing shebang perf scripts python: exported-sql-viewer.py: Remove leftover debugging prints perf scripts python: exported-sql-viewer.py: Hide Call Graph option if no calls table perf scripts python: exported-sql-viewer.py: Move column headers perf scripts python: exported-sql-viewer.py: Factor out ReportDialogBase perf scripts python: exported-sql-viewer.py: Factor out ReportVars perf scripts python: exported-sql-viewer.py: Move report name into ReportVars perf scripts python: exported-sql-viewer.py: Create new dialog data item classes perf scripts python: exported-sql-viewer.py: Remove SQLTableDialogDataItem perf scripts python: exported-sql-viewer.py: Remove no selection error perf scripts python: exported-sql-viewer.py: Add top calls report Alexander Shishkin (2): perf: Copy parent's address filter offsets on clone perf, pt, coresight: Fix address filters for vmas with non-zero offset Andi Kleen (2): perf script: Handle missing fields with -F +.. perf tools: Add perf_exe() helper to find perf binary Jiri Olsa (9): perf data: Move size to struct perf_data_file perf data: Add global path holder perf tools: Add depth checking to rm_rf perf tools: Add pattern name checking to rm_rf perf tools: Add rm_rf_perf_data function perf data: Make check_backup work over directories perf data: Fail check_backup in case of error perf data: Add perf_data__(create_dir|close_dir) functions perf data: Add perf_data__open_dir_data function Tony Jones (10): perf script python: Add Python3 support to netdev-times.py perf script python: Add Python3 support to failed-syscalls-by-pid.py perf script python: Add Python3 support to mem-phys-addr.py perf script python: Add Python3 support to net_dropmonitor.py perf script python: Add Python3 support to powerpc-hcalls.py perf script python: Add Python3 support to sctop.py perf script python: Add Python3 support to stackcollapse.py perf script python: Add Python3 support to stat-cpi.py perf script python: Add Python3 support to syscall-counts.py perf script python: Add Python3 support to syscall-counts-by-pid.py Wei Li (1): perf annotate: Fix getting source line failure arch/x86/events/intel/pt.c | 9 +- drivers/hwtracing/coresight/coresight-etm-perf.c | 7 +- include/linux/perf_event.h | 7 +- kernel/events/core.c | 90 ++-- tools/perf/builtin-annotate.c | 4 +- tools/perf/builtin-buildid-cache.c | 4 +- tools/perf/builtin-buildid-list.c | 8 +- tools/perf/builtin-c2c.c | 4 +- tools/perf/builtin-diff.c | 12 +- tools/perf/builtin-evlist.c | 4 +- tools/perf/builtin-inject.c | 10 +- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-kvm.c | 8 +- tools/perf/builtin-lock.c | 8 +- tools/perf/builtin-mem.c | 8 +- tools/perf/builtin-record.c | 11 +- tools/perf/builtin-report.c | 6 +- tools/perf/builtin-sched.c | 16 +- tools/perf/builtin-script.c | 22 +- tools/perf/builtin-stat.c | 6 +- tools/perf/builtin-timechart.c | 8 +- tools/perf/builtin-trace.c | 8 +- tools/perf/scripts/python/exported-sql-viewer.py | 510 ++++++++++++++------- .../perf/scripts/python/failed-syscalls-by-pid.py | 21 +- tools/perf/scripts/python/mem-phys-addr.py | 24 +- tools/perf/scripts/python/net_dropmonitor.py | 10 +- tools/perf/scripts/python/netdev-times.py | 82 ++-- tools/perf/scripts/python/powerpc-hcalls.py | 18 +- tools/perf/scripts/python/sctop.py | 24 +- tools/perf/scripts/python/stackcollapse.py | 7 +- tools/perf/scripts/python/stat-cpi.py | 10 +- tools/perf/scripts/python/syscall-counts-by-pid.py | 22 +- tools/perf/scripts/python/syscall-counts.py | 18 +- tools/perf/util/annotate.c | 4 +- tools/perf/util/data-convert-bt.c | 4 +- tools/perf/util/data.c | 175 ++++++- tools/perf/util/data.h | 16 +- tools/perf/util/header.c | 12 +- tools/perf/util/thread-stack.c | 161 ++++++- tools/perf/util/util.c | 65 ++- tools/perf/util/util.h | 3 + 41 files changed, 1019 insertions(+), 429 deletions(-) Test results: The first ones are container based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. $ export PERF_TARBALL=http://192.168.124.1/perf/perf-5.0.0-rc5.tar.xz $ dm 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 5 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0 6 alpine:3.9 : Ok gcc (Alpine 8.2.0) 8.2.0 7 alpine:edge : Ok gcc (Alpine 8.2.0) 8.2.0 8 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28) 9 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) 10 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 11 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 12 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 13 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) 14 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) 15 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502 16 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2 17 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u2) 4.9.2 18 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 19 debian:experimental : Ok gcc (Debian 8.2.0-17) 8.2.1 20190204 20 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0 21 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0 22 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.2.0-16) 8.2.0 23 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 24 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) 25 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 26 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 27 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 28 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 29 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 30 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2) 31 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6) 32 fedora:28 : Ok gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6) 33 fedora:29 : Ok gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6) 34 fedora:30 : Ok gcc (GCC) 9.0.1 20190203 (Red Hat 9.0.1-0.3) 35 fedora:rawhide : Ok gcc (GCC) 9.0.0 20190119 (Red Hat 9.0.0-0.3) 36 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0 37 mageia:5 : Ok gcc (GCC) 4.9.2 38 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0 39 opensuse:13.2 : Ok gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] 40 opensuse:15.0 : Ok gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812] 41 opensuse:15.1 : Ok gcc (SUSE Linux) 7.4.0 42 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5 43 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5 44 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5 45 opensuse:tumbleweed : Ok gcc (SUSE Linux) 8.2.1 20190103 [gcc-8-branch revision 267549] 46 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1) 47 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) 48 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 49 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 50 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0 51 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 52 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 53 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 54 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 55 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 56 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 57 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 58 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0 59 ubuntu:18.04 : Ok gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 60 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0 61 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0 62 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 63 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 64 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 65 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 66 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 67 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 68 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 69 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 70 ubuntu:18.10 : Ok gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0 71 ubuntu:19.04 : Ok gcc (Ubuntu 8.2.0-20ubuntu1) 8.2.0 72 ubuntu:19.04-x-alpha : Ok alpha-linux-gnu-gcc (Ubuntu 8.2.0-20ubuntu1) 8.2.0 73 ubuntu:19.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 8.2.0-20ubuntu1) 8.2.0 74 ubuntu:19.04-x-hppa : Ok hppa-linux-gnu-gcc (Ubuntu 8.2.0-20ubuntu1) 8.2.0 $ # uname -a Linux quaco 5.0.0-rc7+ #20 SMP Mon Feb 25 16:16:50 -03 2019 x86_64 x86_64 x86_64 GNU/Linux # git log --oneline -1 de667cce7f4f perf script python: Add Python3 support to syscall-counts-by-pid.py # perf version --build-options perf version 5.0.rc5.gde667c 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 # 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 : $ make -C tools/perf build-test make: Entering directory '/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_tags_O: make tags make_help_O: make help make_install_bin_O: make install-bin make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_cscope_O: make cscope make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_prefix_O: make install prefix=/tmp/krava make_pure_O: make make_install_O: make install make_clean_all_O: make clean all make_no_gtk2_O: make NO_GTK2=1 make_doc_O: make doc make_no_newt_O: make NO_NEWT=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_perf_o_O: make perf.o make_no_libperl_O: make NO_LIBPERL=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_slang_O: make NO_SLANG=1 make_no_libbpf_O: make NO_LIBBPF=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_static_O: make LDFLAGS=-static make_util_map_o_O: make util/map.o make_debug_O: make DEBUG=1 OK make: Leaving directory '/home/acme/git/perf/tools/perf' $ ^ permalink raw reply [flat|nested] 160+ messages in thread
* Re: [GIT PULL] perf/core improvements and fixes 2019-02-25 21:19 Arnaldo Carvalho de Melo @ 2019-02-28 7:31 ` Ingo Molnar 0 siblings, 0 replies; 160+ messages in thread From: Ingo Molnar @ 2019-02-28 7:31 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Mansour Alharthi, Mathieu Poirier, Seeteena Thoufeek, Tony Jones, Wei Li * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, this is on top of my previous pull > request, perf-core-for-mingo-5.1-20190220. > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit b4409ae112caa6315f6ee678e953b9fc93e6919c: > > perf tools: Make rm_rf() remove single file (2019-02-20 17:09:28 -0300) > > 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.1-20190225 > > for you to fetch changes up to de667cce7f4f96b6e22da8fd9c065b961f355080: > > perf script python: Add Python3 support to syscall-counts-by-pid.py (2019-02-25 17:17:13 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > perf annotate: > > Wei Li: > > - Fix getting source line failure. > > perf script: > > Andi Kleen: > > - Handle missing fields with -F +... > > perf data: > > Jiri Olsa: > > - Prep work to support per-cpu files in a directory. > > Intel PT: > > Adrian Hunter: > > - Improve thread_stack__no_call_return() > > - Hide x86 retpolines in thread stacks. > > - exported SQL viewer refactorings, new 'top calls' report. > > Alexander Shishkin: > > - Copy parent's address filter offsets on clone. > > - Fix address filters for vmas with non-zero offset. Applies to > ARM's CoreSight as well. > > python scripts: > > Tony Jones: > > - Python3 support for several 'perf script' python scripts. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Adrian Hunter (13): > perf thread-stack: Improve thread_stack__no_call_return() > perf thread-stack: Hide x86 retpolines > perf scripts python: exported-sql-viewer.py: Fix missing shebang > perf scripts python: exported-sql-viewer.py: Remove leftover debugging prints > perf scripts python: exported-sql-viewer.py: Hide Call Graph option if no calls table > perf scripts python: exported-sql-viewer.py: Move column headers > perf scripts python: exported-sql-viewer.py: Factor out ReportDialogBase > perf scripts python: exported-sql-viewer.py: Factor out ReportVars > perf scripts python: exported-sql-viewer.py: Move report name into ReportVars > perf scripts python: exported-sql-viewer.py: Create new dialog data item classes > perf scripts python: exported-sql-viewer.py: Remove SQLTableDialogDataItem > perf scripts python: exported-sql-viewer.py: Remove no selection error > perf scripts python: exported-sql-viewer.py: Add top calls report > > Alexander Shishkin (2): > perf: Copy parent's address filter offsets on clone > perf, pt, coresight: Fix address filters for vmas with non-zero offset > > Andi Kleen (2): > perf script: Handle missing fields with -F +.. > perf tools: Add perf_exe() helper to find perf binary > > Jiri Olsa (9): > perf data: Move size to struct perf_data_file > perf data: Add global path holder > perf tools: Add depth checking to rm_rf > perf tools: Add pattern name checking to rm_rf > perf tools: Add rm_rf_perf_data function > perf data: Make check_backup work over directories > perf data: Fail check_backup in case of error > perf data: Add perf_data__(create_dir|close_dir) functions > perf data: Add perf_data__open_dir_data function > > Tony Jones (10): > perf script python: Add Python3 support to netdev-times.py > perf script python: Add Python3 support to failed-syscalls-by-pid.py > perf script python: Add Python3 support to mem-phys-addr.py > perf script python: Add Python3 support to net_dropmonitor.py > perf script python: Add Python3 support to powerpc-hcalls.py > perf script python: Add Python3 support to sctop.py > perf script python: Add Python3 support to stackcollapse.py > perf script python: Add Python3 support to stat-cpi.py > perf script python: Add Python3 support to syscall-counts.py > perf script python: Add Python3 support to syscall-counts-by-pid.py > > Wei Li (1): > perf annotate: Fix getting source line failure > > arch/x86/events/intel/pt.c | 9 +- > drivers/hwtracing/coresight/coresight-etm-perf.c | 7 +- > include/linux/perf_event.h | 7 +- > kernel/events/core.c | 90 ++-- > tools/perf/builtin-annotate.c | 4 +- > tools/perf/builtin-buildid-cache.c | 4 +- > tools/perf/builtin-buildid-list.c | 8 +- > tools/perf/builtin-c2c.c | 4 +- > tools/perf/builtin-diff.c | 12 +- > tools/perf/builtin-evlist.c | 4 +- > tools/perf/builtin-inject.c | 10 +- > tools/perf/builtin-kmem.c | 2 +- > tools/perf/builtin-kvm.c | 8 +- > tools/perf/builtin-lock.c | 8 +- > tools/perf/builtin-mem.c | 8 +- > tools/perf/builtin-record.c | 11 +- > tools/perf/builtin-report.c | 6 +- > tools/perf/builtin-sched.c | 16 +- > tools/perf/builtin-script.c | 22 +- > tools/perf/builtin-stat.c | 6 +- > tools/perf/builtin-timechart.c | 8 +- > tools/perf/builtin-trace.c | 8 +- > tools/perf/scripts/python/exported-sql-viewer.py | 510 ++++++++++++++------- > .../perf/scripts/python/failed-syscalls-by-pid.py | 21 +- > tools/perf/scripts/python/mem-phys-addr.py | 24 +- > tools/perf/scripts/python/net_dropmonitor.py | 10 +- > tools/perf/scripts/python/netdev-times.py | 82 ++-- > tools/perf/scripts/python/powerpc-hcalls.py | 18 +- > tools/perf/scripts/python/sctop.py | 24 +- > tools/perf/scripts/python/stackcollapse.py | 7 +- > tools/perf/scripts/python/stat-cpi.py | 10 +- > tools/perf/scripts/python/syscall-counts-by-pid.py | 22 +- > tools/perf/scripts/python/syscall-counts.py | 18 +- > tools/perf/util/annotate.c | 4 +- > tools/perf/util/data-convert-bt.c | 4 +- > tools/perf/util/data.c | 175 ++++++- > tools/perf/util/data.h | 16 +- > tools/perf/util/header.c | 12 +- > tools/perf/util/thread-stack.c | 161 ++++++- > tools/perf/util/util.c | 65 ++- > tools/perf/util/util.h | 3 + > 41 files changed, 1019 insertions(+), 429 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 160+ messages in thread
end of thread, other threads:[~2020-05-06 15:22 UTC | newest] Thread overview: 160+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 01/91] perf cgroup: Avoid needless closing of unopened fd Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 02/91] perf bench: Fix div-by-zero if runtime is zero Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 03/91] perf evlist: Remove duplicate headers Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 04/91] perf script: Avoid NULL dereference on symbol Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 05/91] perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 06/91] perf stat: Improve runtime stat " Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 07/91] perf test session topology: Fix data path Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 08/91] perf record: Add num-synthesize-threads option Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 09/91] perf bench: Add a multi-threaded synthesize benchmark Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 10/91] tools api: Add a lightweight buffered reading api Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 11/91] perf synthetic events: Remove use of sscanf from /proc reading Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 12/91] perf script: Remove extraneous newline in perf_sample__fprintf_regs() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 13/91] libtraceevent: Remove unneeded semicolon Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 14/91] perf c2c: " Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 15/91] perf tools: Remove unneeded semicolons Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 16/91] perf report: Fix warning assignment of 0/1 to bool variable Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 17/91] perf pmu: Fix function name in comment, its get_cpuid_str(), not get_cpustr() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 18/91] perf metricgroups: Enhance JSON/metric infrastructure to handle "?" Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 19/91] perf tests expr: Added test for runtime param in metric expression Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 20/91] perf tools: Enable Hz/hz prinitg for --metric-only option Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 21/91] perf vendor events power9: Add hv_24x7 socket/chip level metric events Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 22/91] perf tools: Move routines that probe for perf API features to separate file Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 23/91] perf record: Move sb_evlist to 'struct record' Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 24/91] perf top: Move sb_evlist to 'struct perf_top' Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 25/91] perf bpf: Decouple creating the evlist from adding the SB event Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 26/91] perf parse-events: Add parse_events_option() variant that creates evlist Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 27/91] perf evlist: Move the sideband thread routines to separate object Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 28/91] perf evlist: Allow reusing the side band thread for more purposes Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 29/91] libsubcmd: Introduce OPT_CALLBACK_SET() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 30/91] perf record: Introduce --switch-output-event Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 31/91] perf record: Move side band evlist setup to separate routine Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 32/91] libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 33/91] perf parse-events: Fix memory leaks found on parse_events Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 34/91] " Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 35/91] perf parse-events: Fix another memory leaks found on parse_events() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 36/91] libperf evlist: Fix a refcount leak Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 37/91] perf tools: Fix reading new topology attribute "core_cpus" Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 38/91] perf tools: Simplify checking if SMT is active Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 39/91] perf thread-stack: Add branch stack support Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 40/91] perf intel-pt: Consolidate thread-stack use condition Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 41/91] perf intel-pt: Change branch stack support to use thread-stacks Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 42/91] perf auxtrace: Add option to synthesize branch stack for regular events Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 43/91] perf evsel: Add support for synthesized branch stack sample type Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 44/91] perf thread-stack: Add thread_stack__br_sample_late() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 45/91] perf intel-pt: Add support for synthesizing branch stacks for regular events Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 46/91] perf intel-pt: Update documentation about itrace G and L options Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 47/91] perf intel-pt: Update documentation about using /proc/kcore Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 48/91] perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t' Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 49/91] perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 50/91] perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 51/91] perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 52/91] perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 53/91] perf evsel: Rename perf_evsel__exit() to evsel__exit() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 54/91] perf evsel: Rename perf_evsel__config*() to evsel__config*() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 55/91] perf evsel: Rename perf_evsel__calc_id_pos() to evsel__calc_id_pos() Arnaldo Carvalho de Melo 2020-05-06 15:21 ` [PATCH 56/91] perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 57/91] perf evsel: Rename *perf_evsel__*name() to *evsel__*name() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 58/91] perf evsel: Rename perf_evsel__group_desc() to evsel__group_desc() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 59/91] perf evsel: Rename *perf_evsel__*set_sample_*() to *evsel__*set_sample_*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 60/91] perf evsel: Rename perf_evsel__*filter*() to evsel__*filter*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 61/91] perf evsel: Rename perf_evsel__open_per_*() to evsel__open_per_*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 62/91] perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 63/91] perf mem2node: Avoid double free related to realloc Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 64/91] perf doc: Pass ASCIIDOC_EXTRA as an argument Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 65/91] tools feature: Add support for detecting libpfm4 Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 66/91] perf pmu: Add perf_pmu__find_by_type helper Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 67/91] perf evsel: Rename perf_evsel__is_*() to evsel__is*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 68/91] perf evsel: Ditch perf_evsel__cmp(), not used for quite a while Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 69/91] perf evsel: Rename *perf_evsel__read*() to *evsel__read() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 70/91] perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 71/91] perf evsel: Rename perf_evsel__{prev,next}() to evsel__{prev,next}() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 72/91] perf evsel: Rename perf_evsel__has*() to evsel__has*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 73/91] perf evsel: Rename perf_evsel__fallback() to evsel__fallback() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 74/91] perf evsel: Rename perf_evsel__group_idx() to evsel__group_idx() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 75/91] perf evsel: Rename perf_evsel__env() to evsel__env() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 76/91] perf evsel: Rename perf_evsel__store_ids() to evsel__store_id() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 77/91] perf stat: Rename perf_evsel__*() operating on 'struct evsel *' to evsel__*() Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 78/91] perf kmem: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 79/91] perf lock: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 80/91] perf sched: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 81/91] perf script: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 82/91] perf trace: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 83/91] perf annotate: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 84/91] perf inject: " Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 85/91] perf symbol: Fix kernel symbol address display Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 86/91] perf: cs-etm: Update to build with latest opencsd version Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 87/91] perf bench: Add kallsyms parsing Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 88/91] libsymbols kallsyms: Parse using io api Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 89/91] libsymbols kallsyms: Move hex2u64 out of header Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 90/91] perf cs-etm: Move definition of 'traceid_list' global variable from header file Arnaldo Carvalho de Melo 2020-05-06 15:22 ` [PATCH 91/91] perf flamegraph: Use /bin/bash for report and record scripts Arnaldo Carvalho de Melo -- strict thread matches above, loose matches on Subject: below -- 2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo 2020-04-22 12:09 ` Ingo Molnar 2020-04-23 21:28 ` Daniel Díaz 2020-04-24 13:07 ` Arnaldo Carvalho de Melo 2020-04-24 14:10 ` Andreas Gerstmayr 2020-05-04 19:07 ` Daniel Díaz 2020-05-05 16:37 ` Arnaldo Carvalho de Melo 2020-05-05 16:57 ` Daniel Díaz 2020-05-05 17:03 ` Arnaldo Carvalho de Melo 2020-03-25 12:41 Arnaldo Carvalho de Melo 2020-03-17 21:32 Arnaldo Carvalho de Melo 2020-03-19 14:03 ` Ingo Molnar 2020-03-19 14:07 ` Arnaldo Carvalho de Melo 2020-03-10 11:15 Arnaldo Carvalho de Melo 2020-01-16 13:48 Arnaldo Carvalho de Melo 2020-01-20 8:23 ` Ingo Molnar 2020-01-06 16:06 Arnaldo Carvalho de Melo 2020-01-10 17:50 ` Ingo Molnar 2020-01-28 19:10 ` pr-tracker-bot 2019-12-03 13:55 Arnaldo Carvalho de Melo 2019-12-04 7:51 ` Ingo Molnar 2019-11-28 13:40 Arnaldo Carvalho de Melo 2019-11-29 5:58 ` Ingo Molnar 2019-11-22 14:56 Arnaldo Carvalho de Melo 2019-11-23 8:07 ` Ingo Molnar 2019-11-19 11:32 Arnaldo Carvalho de Melo 2019-11-19 12:00 ` Ingo Molnar 2019-11-12 18:37 Arnaldo Carvalho de Melo 2019-11-15 7:35 ` Ingo Molnar 2019-11-07 18:59 Arnaldo Carvalho de Melo 2019-11-12 11:08 ` Ingo Molnar 2019-10-21 13:37 Arnaldo Carvalho de Melo 2019-10-21 23:16 ` Ingo Molnar 2019-10-11 20:04 Arnaldo Carvalho de Melo 2019-10-15 5:25 ` Ingo Molnar 2019-09-26 0:31 Arnaldo Carvalho de Melo 2019-09-26 5:55 ` Ingo Molnar 2019-09-20 14:25 Arnaldo Carvalho de Melo 2019-09-20 16:15 ` Ingo Molnar 2019-09-01 12:22 Arnaldo Carvalho de Melo 2019-09-02 7:14 ` Ingo Molnar 2019-08-29 14:38 Arnaldo Carvalho de Melo 2019-08-29 18:58 ` Ingo Molnar 2019-08-27 1:36 Arnaldo Carvalho de Melo 2019-08-27 8:24 ` Ingo Molnar 2019-08-22 21:00 Arnaldo Carvalho de Melo 2019-08-23 10:30 ` Ingo Molnar 2019-08-20 19:27 Arnaldo Carvalho de Melo 2019-08-20 19:39 ` Ingo Molnar 2019-08-20 19:44 ` Arnaldo Carvalho de Melo 2019-08-16 20:16 Arnaldo Carvalho de Melo 2019-08-14 18:40 Arnaldo Carvalho de Melo 2019-07-22 17:38 Arnaldo Carvalho de Melo 2019-07-15 21:11 Arnaldo Carvalho de Melo 2019-07-09 18:31 Arnaldo Carvalho de Melo 2019-07-13 9:13 ` Ingo Molnar 2019-07-03 3:27 Arnaldo Carvalho de Melo 2019-07-03 13:56 ` Ingo Molnar 2019-07-02 2:25 Arnaldo Carvalho de Melo 2019-07-03 13:55 ` Ingo Molnar 2019-06-21 17:38 Arnaldo Carvalho de Melo 2019-06-22 6:28 ` Ingo Molnar 2019-06-11 18:57 Arnaldo Carvalho de Melo 2019-06-17 18:48 ` Ingo Molnar 2019-05-17 19:34 Arnaldo Carvalho de Melo 2019-05-18 8:27 ` Ingo Molnar 2019-02-25 21:19 Arnaldo Carvalho de Melo 2019-02-28 7:31 ` Ingo Molnar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).