linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] perf/core improvements and fixes
@ 2020-04-20 11:52 Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 01/60] perf stat: Honour --timeout for forked workloads Arnaldo Carvalho de Melo
                   ` (60 more replies)
  0 siblings, 61 replies; 130+ 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] 130+ messages in thread

* [PATCH 01/60] perf stat: Honour --timeout for forked workloads
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 02/60] perf tools: Synthesize bpf_trampoline/dispatcher ksymbol event Arnaldo Carvalho de Melo
                   ` (59 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Konstantin Kharlamov,
	Adrian Hunter, Jiri Olsa, yuzhoujian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

When --timeout is used and a workload is specified to be started by
'perf stat', i.e.

  $ perf stat --timeout 1000 sleep 1h

The --timeout wasn't being honoured, i.e. the workload, 'sleep 1h' in
the above example, should be terminated after 1000ms, but it wasn't,
'perf stat' was waiting for it to finish.

Fix it by sending a SIGTERM when the timeout expires.

Now it works:

  # perf stat -e cycles --timeout 1234 sleep 1h
  sleep: Terminated

   Performance counter stats for 'sleep 1h':

           1,066,692      cycles

         1.234314838 seconds time elapsed

         0.000750000 seconds user
         0.000000000 seconds sys

  #

Fixes: f1f8ad52f8bf ("perf stat: Add support to print counts after a period of time")
Reported-by: Konstantin Kharlamov <hi-angel@yandex.ru>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207243
Tested-by: Konstantin Kharlamov <hi-angel@yandex.ru>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: yuzhoujian <yuzhoujian@didichuxing.com>
Link: https://lore.kernel.org/lkml/20200415153803.GB20324@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index ec053dc1e35c..9207b6c45475 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -686,8 +686,11 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
 					break;
 			}
 		}
-		if (child_pid != -1)
+		if (child_pid != -1) {
+			if (timeout)
+				kill(child_pid, SIGTERM);
 			wait4(child_pid, &status, 0, &stat_config.ru_data);
+		}
 
 		if (workload_exec_errno) {
 			const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg));
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 02/60] perf tools: Synthesize bpf_trampoline/dispatcher ksymbol event
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 01/60] perf stat: Honour --timeout for forked workloads Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 03/60] perf machine: Set ksymbol dso as loaded on arrival Arnaldo Carvalho de Melo
                   ` (58 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Song Liu, Alexei Starovoitov, Andrii Nakryiko,
	Björn Töpel, Daniel Borkmann, David S . Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
	Martin KaFai Lau, Yonghong Song, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Synthesize bpf images (trampolines/dispatchers) on start, as ksymbol
events from /proc/kallsyms. Having this perf can recognize samples from
those images and perf report and top shows them correctly.

The rest of the ksymbol handling is already in place from for the bpf
programs monitoring, so only the initial state was needed.

perf report output:

  # Overhead  Command     Shared Object                  Symbol

    12.37%  test_progs  [kernel.vmlinux]                 [k] entry_SYSCALL_64
    11.80%  test_progs  [kernel.vmlinux]                 [k] syscall_return_via_sysret
     9.63%  test_progs  bpf_prog_bcf7977d3b93787c_prog2  [k] bpf_prog_bcf7977d3b93787c_prog2
     6.90%  test_progs  bpf_trampoline_24456             [k] bpf_trampoline_24456
     6.36%  test_progs  [kernel.vmlinux]                 [k] memcpy_erms

Committer notes:

Use scnprintf() instead of strncpy() to overcome this on fedora:32,
rawhide and OpenMandriva Cooker:

    CC       /tmp/build/perf/util/bpf-event.o
  In file included from /usr/include/string.h:495,
                   from /git/linux/tools/lib/bpf/libbpf_common.h:12,
                   from /git/linux/tools/lib/bpf/bpf.h:31,
                   from util/bpf-event.c:4:
  In function 'strncpy',
      inlined from 'process_bpf_image' at util/bpf-event.c:323:2,
      inlined from 'kallsyms_process_symbol' at util/bpf-event.c:358:9:
  /usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 256 equals destination size [-Werror=stringop-truncation]
    106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Björn Töpel <bjorn.topel@intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200312195610.346362-14-jolsa@kernel.org/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/bpf-event.c | 93 +++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index a3207d900339..0cd41a862952 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -6,6 +6,9 @@
 #include <bpf/libbpf.h>
 #include <linux/btf.h>
 #include <linux/err.h>
+#include <linux/string.h>
+#include <internal/lib.h>
+#include <symbol/kallsyms.h>
 #include "bpf-event.h"
 #include "debug.h"
 #include "dso.h"
@@ -290,11 +293,82 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,
 	return err ? -1 : 0;
 }
 
+struct kallsyms_parse {
+	union perf_event	*event;
+	perf_event__handler_t	 process;
+	struct machine		*machine;
+	struct perf_tool	*tool;
+};
+
+static int
+process_bpf_image(char *name, u64 addr, struct kallsyms_parse *data)
+{
+	struct machine *machine = data->machine;
+	union perf_event *event = data->event;
+	struct perf_record_ksymbol *ksymbol;
+	int len;
+
+	ksymbol = &event->ksymbol;
+
+	*ksymbol = (struct perf_record_ksymbol) {
+		.header = {
+			.type = PERF_RECORD_KSYMBOL,
+			.size = offsetof(struct perf_record_ksymbol, name),
+		},
+		.addr      = addr,
+		.len       = page_size,
+		.ksym_type = PERF_RECORD_KSYMBOL_TYPE_BPF,
+		.flags     = 0,
+	};
+
+	len = scnprintf(ksymbol->name, KSYM_NAME_LEN, "%s", name);
+	ksymbol->header.size += PERF_ALIGN(len + 1, sizeof(u64));
+	memset((void *) event + event->header.size, 0, machine->id_hdr_size);
+	event->header.size += machine->id_hdr_size;
+
+	return perf_tool__process_synth_event(data->tool, event, machine,
+					      data->process);
+}
+
+static int
+kallsyms_process_symbol(void *data, const char *_name,
+			char type __maybe_unused, u64 start)
+{
+	char disp[KSYM_NAME_LEN];
+	char *module, *name;
+	unsigned long id;
+	int err = 0;
+
+	module = strchr(_name, '\t');
+	if (!module)
+		return 0;
+
+	/* We are going after [bpf] module ... */
+	if (strcmp(module + 1, "[bpf]"))
+		return 0;
+
+	name = memdup(_name, (module - _name) + 1);
+	if (!name)
+		return -ENOMEM;
+
+	name[module - _name] = 0;
+
+	/* .. and only for trampolines and dispatchers */
+	if ((sscanf(name, "bpf_trampoline_%lu", &id) == 1) ||
+	    (sscanf(name, "bpf_dispatcher_%s", disp) == 1))
+		err = process_bpf_image(name, start, data);
+
+	free(name);
+	return err;
+}
+
 int perf_event__synthesize_bpf_events(struct perf_session *session,
 				      perf_event__handler_t process,
 				      struct machine *machine,
 				      struct record_opts *opts)
 {
+	const char *kallsyms_filename = "/proc/kallsyms";
+	struct kallsyms_parse arg;
 	union perf_event *event;
 	__u32 id = 0;
 	int err;
@@ -303,6 +377,8 @@ int perf_event__synthesize_bpf_events(struct perf_session *session,
 	event = malloc(sizeof(event->bpf) + KSYM_NAME_LEN + machine->id_hdr_size);
 	if (!event)
 		return -1;
+
+	/* Synthesize all the bpf programs in system. */
 	while (true) {
 		err = bpf_prog_get_next_id(id, &id);
 		if (err) {
@@ -335,6 +411,23 @@ int perf_event__synthesize_bpf_events(struct perf_session *session,
 			break;
 		}
 	}
+
+	/* Synthesize all the bpf images - trampolines/dispatchers. */
+	if (symbol_conf.kallsyms_name != NULL)
+		kallsyms_filename = symbol_conf.kallsyms_name;
+
+	arg = (struct kallsyms_parse) {
+		.event   = event,
+		.process = process,
+		.machine = machine,
+		.tool    = session->tool,
+	};
+
+	if (kallsyms__parse(kallsyms_filename, &arg, kallsyms_process_symbol)) {
+		pr_err("%s: failed to synthesize bpf images: %s\n",
+		       __func__, strerror(errno));
+	}
+
 	free(event);
 	return err;
 }
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 03/60] perf machine: Set ksymbol dso as loaded on arrival
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 01/60] perf stat: Honour --timeout for forked workloads Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 02/60] perf tools: Synthesize bpf_trampoline/dispatcher ksymbol event Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 04/60] perf annotate: Add basic support for bpf_image Arnaldo Carvalho de Melo
                   ` (57 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Song Liu, Alexei Starovoitov, Andrii Nakryiko,
	Björn Töpel, Daniel Borkmann,
	David S . Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend, Martin KaFai Lau, Yonghong Song,
	Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

There's no special load action for ksymbol data on map__load/dso__load
action, where the kernel is getting loaded. It only gets confused with
kernel kallsyms/vmlinux load for bpf object, which fails and could mess
up with the map.

Disabling any further load of the map for ksymbol related dso/map.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Björn Töpel <bjorn.topel@intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200312195610.346362-15-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 97142e9671be..06aa4e4db63d 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -759,6 +759,7 @@ static int machine__process_ksymbol_register(struct machine *machine,
 		map->start = event->ksymbol.addr;
 		map->end = map->start + event->ksymbol.len;
 		maps__insert(&machine->kmaps, map);
+		dso__set_loaded(dso);
 	}
 
 	sym = symbol__new(map->map_ip(map, map->start),
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 04/60] perf annotate: Add basic support for bpf_image
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 03/60] perf machine: Set ksymbol dso as loaded on arrival Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 05/60] capabilities: Introduce CAP_PERFMON to kernel and user space Arnaldo Carvalho de Melo
                   ` (56 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Song Liu, Alexei Starovoitov, Andrii Nakryiko,
	Björn Töpel, Daniel Borkmann,
	David S . Miller, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend, Martin KaFai Lau, Yonghong Song,
	Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Add the DSO_BINARY_TYPE__BPF_IMAGE dso binary type to recognize BPF
images that carry trampoline or dispatcher.

Upcoming patches will add support to read the image data, store it
within the BPF feature in perf.data and display it for annotation
purposes.

Currently we only display following message:

  # ./perf annotate bpf_trampoline_24456 --stdio
   Percent |      Source code & Disassembly of . for cycles (504  ...
  --------------------------------------------------------------- ...
           :       to be implemented

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Björn Töpel <bjorn.topel@intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200312195610.346362-16-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 20 ++++++++++++++++++++
 tools/perf/util/dso.c      |  1 +
 tools/perf/util/dso.h      |  1 +
 tools/perf/util/machine.c  | 11 +++++++++++
 tools/perf/util/symbol.c   |  1 +
 5 files changed, 34 insertions(+)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index f1ea0d61eb5b..9760d58e979a 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1821,6 +1821,24 @@ static int symbol__disassemble_bpf(struct symbol *sym __maybe_unused,
 }
 #endif // defined(HAVE_LIBBFD_SUPPORT) && defined(HAVE_LIBBPF_SUPPORT)
 
+static int
+symbol__disassemble_bpf_image(struct symbol *sym,
+			      struct annotate_args *args)
+{
+	struct annotation *notes = symbol__annotation(sym);
+	struct disasm_line *dl;
+
+	args->offset = -1;
+	args->line = strdup("to be implemented");
+	args->line_nr = 0;
+	dl = disasm_line__new(args);
+	if (dl)
+		annotation_line__add(&dl->al, &notes->src->source);
+
+	free(args->line);
+	return 0;
+}
+
 /*
  * Possibly create a new version of line with tabs expanded. Returns the
  * existing or new line, storage is updated if a new line is allocated. If
@@ -1920,6 +1938,8 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
 
 	if (dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO) {
 		return symbol__disassemble_bpf(sym, args);
+	} else if (dso->binary_type == DSO_BINARY_TYPE__BPF_IMAGE) {
+		return symbol__disassemble_bpf_image(sym, args);
 	} else if (dso__is_kcore(dso)) {
 		kce.kcore_filename = symfs_filename;
 		kce.addr = map__rip_2objdump(map, sym->start);
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 91f21239608b..f338990e0fe6 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -191,6 +191,7 @@ int dso__read_binary_type_filename(const struct dso *dso,
 	case DSO_BINARY_TYPE__GUEST_KALLSYMS:
 	case DSO_BINARY_TYPE__JAVA_JIT:
 	case DSO_BINARY_TYPE__BPF_PROG_INFO:
+	case DSO_BINARY_TYPE__BPF_IMAGE:
 	case DSO_BINARY_TYPE__NOT_FOUND:
 		ret = -1;
 		break;
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 2db64b79617a..9553a1fd9e8a 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -40,6 +40,7 @@ enum dso_binary_type {
 	DSO_BINARY_TYPE__GUEST_KCORE,
 	DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO,
 	DSO_BINARY_TYPE__BPF_PROG_INFO,
+	DSO_BINARY_TYPE__BPF_IMAGE,
 	DSO_BINARY_TYPE__NOT_FOUND,
 };
 
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 06aa4e4db63d..09845eae9c03 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -736,6 +736,12 @@ int machine__process_switch_event(struct machine *machine __maybe_unused,
 	return 0;
 }
 
+static int is_bpf_image(const char *name)
+{
+	return strncmp(name, "bpf_trampoline_", sizeof("bpf_trampoline_") - 1) ||
+	       strncmp(name, "bpf_dispatcher_", sizeof("bpf_dispatcher_") - 1);
+}
+
 static int machine__process_ksymbol_register(struct machine *machine,
 					     union perf_event *event,
 					     struct perf_sample *sample __maybe_unused)
@@ -760,6 +766,11 @@ static int machine__process_ksymbol_register(struct machine *machine,
 		map->end = map->start + event->ksymbol.len;
 		maps__insert(&machine->kmaps, map);
 		dso__set_loaded(dso);
+
+		if (is_bpf_image(event->ksymbol.name)) {
+			dso->binary_type = DSO_BINARY_TYPE__BPF_IMAGE;
+			dso__set_long_name(dso, "", false);
+		}
 	}
 
 	sym = symbol__new(map->map_ip(map, map->start),
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 26bc6a0096ce..8f4300492dc7 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1544,6 +1544,7 @@ static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod,
 		return true;
 
 	case DSO_BINARY_TYPE__BPF_PROG_INFO:
+	case DSO_BINARY_TYPE__BPF_IMAGE:
 	case DSO_BINARY_TYPE__NOT_FOUND:
 	default:
 		return false;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 05/60] capabilities: Introduce CAP_PERFMON to kernel and user space
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 04/60] perf annotate: Add basic support for bpf_image Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 06/60] perf/core: Open access to the core for CAP_PERFMON privileged process Arnaldo Carvalho de Melo
                   ` (55 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris,
	Serge E . Hallyn, Song Liu, Stephen Smalley,
	Arnaldo Carvalho de Melo, Alexei Starovoitov, Andi Kleen,
	Igor Lubashev, Jiri Olsa, Peter Zijlstra, Stephane Eranian,
	intel-gfx, linux-doc, linux-man, linux-security-module, selinux

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Introduce the CAP_PERFMON capability designed to secure system
performance monitoring and observability operations so that CAP_PERFMON
can assist CAP_SYS_ADMIN capability in its governing role for
performance monitoring and observability subsystems.

CAP_PERFMON hardens system security and integrity during performance
monitoring and observability operations by decreasing attack surface that
is available to a CAP_SYS_ADMIN privileged process [2]. Providing the access
to system performance monitoring and observability operations under CAP_PERFMON
capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes
chances to misuse the credentials and makes the operation more secure.

Thus, CAP_PERFMON implements the principle of least privilege for
performance monitoring and observability operations (POSIX IEEE 1003.1e:
2.2.2.39 principle of least privilege: A security design principle that
  states that a process or program be granted only those privileges
(e.g., capabilities) necessary to accomplish its legitimate function,
and only for the time that such privileges are actually required)

CAP_PERFMON meets the demand to secure system performance monitoring and
observability operations for adoption in security sensitive, restricted,
multiuser production environments (e.g. HPC clusters, cloud and virtual compute
environments), where root or CAP_SYS_ADMIN credentials are not available to
mass users of a system, and securely unblocks applicability and scalability
of system performance monitoring and observability operations beyond root
and CAP_SYS_ADMIN use cases.

CAP_PERFMON takes over CAP_SYS_ADMIN credentials related to system performance
monitoring and observability operations and balances amount of CAP_SYS_ADMIN
credentials following the recommendations in the capabilities man page [1]
for CAP_SYS_ADMIN: "Note: this capability is overloaded; see Notes to kernel
developers, below." For backward compatibility reasons access to system
performance monitoring and observability subsystems of the kernel remains
open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN capability
usage for secure system performance monitoring and observability operations
is discouraged with respect to the designed CAP_PERFMON capability.

Although the software running under CAP_PERFMON can not ensure avoidance
of related hardware issues, the software can still mitigate these issues
following the official hardware issues mitigation procedure [2]. The bugs
in the software itself can be fixed following the standard kernel development
process [3] to maintain and harden security of system performance monitoring
and observability operations.

[1] http://man7.org/linux/man-pages/man7/capabilities.7.html
[2] https://www.kernel.org/doc/html/latest/process/embargoed-hardware-issues.html
[3] https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Serge E. Hallyn <serge@hallyn.com>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.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: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/5590d543-82c6-490a-6544-08e6a5517db0@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 include/linux/capability.h          | 4 ++++
 include/uapi/linux/capability.h     | 8 +++++++-
 security/selinux/include/classmap.h | 4 ++--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/include/linux/capability.h b/include/linux/capability.h
index ecce0f43c73a..027d7e4a853b 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -251,6 +251,10 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct
 extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
 extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
 extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
+static inline bool perfmon_capable(void)
+{
+	return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
+}
 
 /* audit system wants to get cap info from files as well */
 extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h
index 272dc69fa080..e58c9636741b 100644
--- a/include/uapi/linux/capability.h
+++ b/include/uapi/linux/capability.h
@@ -367,8 +367,14 @@ struct vfs_ns_cap_data {
 
 #define CAP_AUDIT_READ		37
 
+/*
+ * Allow system performance and observability privileged operations
+ * using perf_events, i915_perf and other kernel subsystems
+ */
+
+#define CAP_PERFMON		38
 
-#define CAP_LAST_CAP         CAP_AUDIT_READ
+#define CAP_LAST_CAP         CAP_PERFMON
 
 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
 
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
index 986f3ac14282..d233ab3f1533 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -27,9 +27,9 @@
 	    "audit_control", "setfcap"
 
 #define COMMON_CAP2_PERMS  "mac_override", "mac_admin", "syslog", \
-		"wake_alarm", "block_suspend", "audit_read"
+		"wake_alarm", "block_suspend", "audit_read", "perfmon"
 
-#if CAP_LAST_CAP > CAP_AUDIT_READ
+#if CAP_LAST_CAP > CAP_PERFMON
 #error New capability defined, please update COMMON_CAP2_PERMS.
 #endif
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 06/60] perf/core: Open access to the core for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 05/60] capabilities: Introduce CAP_PERFMON to kernel and user space Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 07/60] perf/core: open access to probes " Arnaldo Carvalho de Melo
                   ` (54 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris,
	Arnaldo Carvalho de Melo, Alexei Starovoitov, Andi Kleen,
	Igor Lubashev, Jiri Olsa, linux-man, Peter Zijlstra,
	Serge Hallyn, Song Liu, Stephane Eranian, intel-gfx, linux-doc,
	linux-security-module, selinux

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to monitoring of kernel code, CPUs, tracepoints and
namespaces data for a CAP_PERFMON privileged process. Providing the
access under CAP_PERFMON capability singly, without the rest of
CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials
and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons the access to perf_events subsystem
remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN
usage for secure perf_events monitoring is discouraged with respect to
CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: linux-man@vger.kernel.org
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/471acaef-bb8a-5ce2-923f-90606b78eef9@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 include/linux/perf_event.h | 6 +++---
 kernel/events/core.c       | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 9c3e7619c929..87e21681759c 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1305,7 +1305,7 @@ static inline int perf_is_paranoid(void)
 
 static inline int perf_allow_kernel(struct perf_event_attr *attr)
 {
-	if (sysctl_perf_event_paranoid > 1 && !capable(CAP_SYS_ADMIN))
+	if (sysctl_perf_event_paranoid > 1 && !perfmon_capable())
 		return -EACCES;
 
 	return security_perf_event_open(attr, PERF_SECURITY_KERNEL);
@@ -1313,7 +1313,7 @@ static inline int perf_allow_kernel(struct perf_event_attr *attr)
 
 static inline int perf_allow_cpu(struct perf_event_attr *attr)
 {
-	if (sysctl_perf_event_paranoid > 0 && !capable(CAP_SYS_ADMIN))
+	if (sysctl_perf_event_paranoid > 0 && !perfmon_capable())
 		return -EACCES;
 
 	return security_perf_event_open(attr, PERF_SECURITY_CPU);
@@ -1321,7 +1321,7 @@ static inline int perf_allow_cpu(struct perf_event_attr *attr)
 
 static inline int perf_allow_tracepoint(struct perf_event_attr *attr)
 {
-	if (sysctl_perf_event_paranoid > -1 && !capable(CAP_SYS_ADMIN))
+	if (sysctl_perf_event_paranoid > -1 && !perfmon_capable())
 		return -EPERM;
 
 	return security_perf_event_open(attr, PERF_SECURITY_TRACEPOINT);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index bc9b98a9af9a..74025b7b83a0 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -11504,7 +11504,7 @@ SYSCALL_DEFINE5(perf_event_open,
 	}
 
 	if (attr.namespaces) {
-		if (!capable(CAP_SYS_ADMIN))
+		if (!perfmon_capable())
 			return -EACCES;
 	}
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 07/60] perf/core: open access to probes for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 06/60] perf/core: Open access to the core for CAP_PERFMON privileged process Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 08/60] perf tools: Support CAP_PERFMON capability Arnaldo Carvalho de Melo
                   ` (53 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris,
	Arnaldo Carvalho de Melo, Alexei Starovoitov, Andi Kleen,
	Igor Lubashev, Jiri Olsa, Peter Zijlstra, Serge Hallyn, Song Liu,
	Stephane Eranian, intel-gfx, linux-doc, linux-security-module,
	selinux, linux-man

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to monitoring via kprobes and uprobes and eBPF tracing for
CAP_PERFMON privileged process. Providing the access under CAP_PERFMON
capability singly, without the rest of CAP_SYS_ADMIN credentials,
excludes chances to misuse the credentials and makes operation more
secure.

perf kprobes and uprobes are used by ftrace and eBPF. perf probe uses
ftrace to define new kprobe events, and those events are treated as
tracepoint events. eBPF defines new probes via perf_event_open interface
and then the probes are used in eBPF tracing.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to perf_events subsystem
remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN
usage for secure perf_events monitoring is discouraged with respect to
CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Cc: linux-man@vger.kernel.org
Link: http://lore.kernel.org/lkml/3c129d9a-ba8a-3483-ecc5-ad6c8e7c203f@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 74025b7b83a0..52951e9e8e1b 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9397,7 +9397,7 @@ static int perf_kprobe_event_init(struct perf_event *event)
 	if (event->attr.type != perf_kprobe.type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/*
@@ -9457,7 +9457,7 @@ static int perf_uprobe_event_init(struct perf_event *event)
 	if (event->attr.type != perf_uprobe.type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/*
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 08/60] perf tools: Support CAP_PERFMON capability
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 07/60] perf/core: open access to probes " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 09/60] drm/i915/perf: Open access for CAP_PERFMON privileged process Arnaldo Carvalho de Melo
                   ` (52 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris, Jiri Olsa,
	Arnaldo Carvalho de Melo, Alexei Starovoitov, Andi Kleen,
	Igor Lubashev, Peter Zijlstra, Serge Hallyn, Song Liu,
	Stephane Eranian, intel-gfx, linux-doc, linux-man,
	linux-security-module, selinux

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Extend error messages to mention CAP_PERFMON capability as an option to
substitute CAP_SYS_ADMIN capability for secure system performance
monitoring and observability operations. Make
perf_event_paranoid_check() and __cmd_ftrace() to be aware of
CAP_PERFMON capability.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to perf_events subsystem remains
open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
secure perf_events monitoring is discouraged with respect to CAP_PERFMON
capability.

Committer testing:

Using a libcap with this patch:

  diff --git a/libcap/include/uapi/linux/capability.h b/libcap/include/uapi/linux/capability.h
  index 78b2fd4c8a95..89b5b0279b60 100644
  --- a/libcap/include/uapi/linux/capability.h
  +++ b/libcap/include/uapi/linux/capability.h
  @@ -366,8 +366,9 @@ struct vfs_ns_cap_data {

   #define CAP_AUDIT_READ       37

  +#define CAP_PERFMON	     38

  -#define CAP_LAST_CAP         CAP_AUDIT_READ
  +#define CAP_LAST_CAP         CAP_PERFMON

   #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)

Note that using '38' in place of 'cap_perfmon' works to some degree with
an old libcap, its only when cap_get_flag() is called that libcap
performs an error check based on the maximum value known for
capabilities that it will fail.

This makes determining the default of perf_event_attr.exclude_kernel to
fail, as it can't determine if CAP_PERFMON is in place.

Using 'perf top -e cycles' avoids the default check and sets
perf_event_attr.exclude_kernel to 1.

As root, with a libcap supporting CAP_PERFMON:

  # groupadd perf_users
  # adduser perf -g perf_users
  # mkdir ~perf/bin
  # cp ~acme/bin/perf ~perf/bin/
  # chgrp perf_users ~perf/bin/perf
  # setcap "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" ~perf/bin/perf
  # getcap ~perf/bin/perf
  /home/perf/bin/perf = cap_sys_ptrace,cap_syslog,cap_perfmon+ep
  # ls -la ~perf/bin/perf
  -rwxr-xr-x. 1 root perf_users 16968552 Apr  9 13:10 /home/perf/bin/perf

As the 'perf' user in the 'perf_users' group:

  $ perf top -a --stdio
  Error:
  Failed to mmap with 1 (Operation not permitted)
  $

Either add the cap_ipc_lock capability to the perf binary or reduce the
ring buffer size to some smaller value:

  $ perf top -m10 -a --stdio
  rounding mmap pages size to 64K (16 pages)
  Error:
  Failed to mmap with 1 (Operation not permitted)
  $ perf top -m4 -a --stdio
  Error:
  Failed to mmap with 1 (Operation not permitted)
  $ perf top -m2 -a --stdio
   PerfTop: 762 irqs/sec  kernel:49.7%  exact: 100.0% lost: 0/0 drop: 0/0 [4000Hz cycles], (all, 4 CPUs)
  ------------------------------------------------------------------------------------------------------

     9.83%  perf                [.] __symbols__insert
     8.58%  perf                [.] rb_next
     5.91%  [kernel]            [k] module_get_kallsym
     5.66%  [kernel]            [k] kallsyms_expand_symbol.constprop.0
     3.98%  libc-2.29.so        [.] __GI_____strtoull_l_internal
     3.66%  perf                [.] rb_insert_color
     2.34%  [kernel]            [k] vsnprintf
     2.30%  [kernel]            [k] string_nocheck
     2.16%  libc-2.29.so        [.] _IO_getdelim
     2.15%  [kernel]            [k] number
     2.13%  [kernel]            [k] format_decode
     1.58%  libc-2.29.so        [.] _IO_feof
     1.52%  libc-2.29.so        [.] __strcmp_avx2
     1.50%  perf                [.] rb_set_parent_color
     1.47%  libc-2.29.so        [.] __libc_calloc
     1.24%  [kernel]            [k] do_syscall_64
     1.17%  [kernel]            [k] __x86_indirect_thunk_rax

  $ perf record -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.552 MB perf.data (74 samples) ]
  $ perf evlist
  cycles
  $ perf evlist -v
  cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CPU|PERIOD, 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
  $ perf report | head -20
  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 74  of event 'cycles'
  # Event count (approx.): 15694834
  #
  # Overhead  Command          Shared Object               Symbol
  # ........  ...............  ..........................  ......................................
  #
      19.62%  perf             [kernel.vmlinux]            [k] strnlen_user
      13.88%  swapper          [kernel.vmlinux]            [k] intel_idle
      13.83%  ksoftirqd/0      [kernel.vmlinux]            [k] pfifo_fast_dequeue
      13.51%  swapper          [kernel.vmlinux]            [k] kmem_cache_free
       6.31%  gnome-shell      [kernel.vmlinux]            [k] kmem_cache_free
       5.66%  kworker/u8:3+ix  [kernel.vmlinux]            [k] delay_tsc
       4.42%  perf             [kernel.vmlinux]            [k] __set_cpus_allowed_ptr
       3.45%  kworker/2:1-eve  [kernel.vmlinux]            [k] shmem_truncate_range
       2.29%  gnome-shell      libgobject-2.0.so.0.6000.7  [.] g_closure_ref
  $

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.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: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/a66d5648-2b8e-577e-e1f2-1d56c017ab5e@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-ftrace.c |  5 +++--
 tools/perf/design.txt       |  3 ++-
 tools/perf/util/cap.h       |  4 ++++
 tools/perf/util/evsel.c     | 10 +++++-----
 tools/perf/util/util.c      |  1 +
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index d5adc417a4ca..55eda54240fb 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -284,10 +284,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
 		.events = POLLIN,
 	};
 
-	if (!perf_cap__capable(CAP_SYS_ADMIN)) {
+	if (!(perf_cap__capable(CAP_PERFMON) ||
+	      perf_cap__capable(CAP_SYS_ADMIN))) {
 		pr_err("ftrace only works for %s!\n",
 #ifdef HAVE_LIBCAP_SUPPORT
-		"users with the SYS_ADMIN capability"
+		"users with the CAP_PERFMON or CAP_SYS_ADMIN capability"
 #else
 		"root"
 #endif
diff --git a/tools/perf/design.txt b/tools/perf/design.txt
index 0453ba26cdbd..a42fab308ff6 100644
--- a/tools/perf/design.txt
+++ b/tools/perf/design.txt
@@ -258,7 +258,8 @@ gets schedule to. Per task counters can be created by any user, for
 their own tasks.
 
 A 'pid == -1' and 'cpu == x' counter is a per CPU counter that counts
-all events on CPU-x. Per CPU counters need CAP_SYS_ADMIN privilege.
+all events on CPU-x. Per CPU counters need CAP_PERFMON or CAP_SYS_ADMIN
+privilege.
 
 The 'flags' parameter is currently unused and must be zero.
 
diff --git a/tools/perf/util/cap.h b/tools/perf/util/cap.h
index 051dc590ceee..ae52878c0b2e 100644
--- a/tools/perf/util/cap.h
+++ b/tools/perf/util/cap.h
@@ -29,4 +29,8 @@ static inline bool perf_cap__capable(int cap __maybe_unused)
 #define CAP_SYSLOG	34
 #endif
 
+#ifndef CAP_PERFMON
+#define CAP_PERFMON	38
+#endif
+
 #endif /* __PERF_CAP_H */
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index eb880efbce16..d23db6755f51 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2523,14 +2523,14 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target,
 		 "You may not have permission to collect %sstats.\n\n"
 		 "Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n"
 		 "which controls use of the performance events system by\n"
-		 "unprivileged users (without CAP_SYS_ADMIN).\n\n"
+		 "unprivileged users (without CAP_PERFMON or CAP_SYS_ADMIN).\n\n"
 		 "The current value is %d:\n\n"
 		 "  -1: Allow use of (almost) all events by all users\n"
 		 "      Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK\n"
-		 ">= 0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN\n"
-		 "      Disallow raw tracepoint access by users without CAP_SYS_ADMIN\n"
-		 ">= 1: Disallow CPU event access by users without CAP_SYS_ADMIN\n"
-		 ">= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN\n\n"
+		 ">= 0: Disallow ftrace function tracepoint by users without CAP_PERFMON or CAP_SYS_ADMIN\n"
+		 "      Disallow raw tracepoint access by users without CAP_SYS_PERFMON or CAP_SYS_ADMIN\n"
+		 ">= 1: Disallow CPU event access by users without CAP_PERFMON or CAP_SYS_ADMIN\n"
+		 ">= 2: Disallow kernel profiling by users without CAP_PERFMON or CAP_SYS_ADMIN\n\n"
 		 "To make this setting permanent, edit /etc/sysctl.conf too, e.g.:\n\n"
 		 "	kernel.perf_event_paranoid = -1\n" ,
 				 target->system_wide ? "system-wide " : "",
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index d707c9624dd9..37a9492edb3e 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -290,6 +290,7 @@ int perf_event_paranoid(void)
 bool perf_event_paranoid_check(int max_level)
 {
 	return perf_cap__capable(CAP_SYS_ADMIN) ||
+			perf_cap__capable(CAP_PERFMON) ||
 			perf_event_paranoid() <= max_level;
 }
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 09/60] drm/i915/perf: Open access for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 08/60] perf tools: Support CAP_PERFMON capability Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 10/60] trace/bpf_trace: " Arnaldo Carvalho de Melo
                   ` (51 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris,
	Lionel Landwerlin, Alexei Starovoitov, Andi Kleen, Igor Lubashev,
	Jiri Olsa, Peter Zijlstra, Serge Hallyn, Song Liu,
	Stephane Eranian, intel-gfx, linux-doc, linux-man,
	linux-security-module, selinux, Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to i915_perf monitoring for CAP_PERFMON privileged process.
Providing the access under CAP_PERFMON capability singly, without the
rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the
credentials and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to i915_events subsystem remains
open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
secure i915_events monitoring is discouraged with respect to CAP_PERFMON
capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/e3e3292f-f765-ea98-e59c-fbe2db93fd34@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 551be589d6f4..5fb174931231 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -3433,10 +3433,10 @@ i915_perf_open_ioctl_locked(struct i915_perf *perf,
 	/* Similar to perf's kernel.perf_paranoid_cpu sysctl option
 	 * we check a dev.i915.perf_stream_paranoid sysctl option
 	 * to determine if it's ok to access system wide OA counters
-	 * without CAP_SYS_ADMIN privileges.
+	 * without CAP_PERFMON or CAP_SYS_ADMIN privileges.
 	 */
 	if (privileged_op &&
-	    i915_perf_stream_paranoid && !capable(CAP_SYS_ADMIN)) {
+	    i915_perf_stream_paranoid && !perfmon_capable()) {
 		DRM_DEBUG("Insufficient privileges to open i915 perf stream\n");
 		ret = -EACCES;
 		goto err_ctx;
@@ -3629,9 +3629,8 @@ static int read_properties_unlocked(struct i915_perf *perf,
 			} else
 				oa_freq_hz = 0;
 
-			if (oa_freq_hz > i915_oa_max_sample_rate &&
-			    !capable(CAP_SYS_ADMIN)) {
-				DRM_DEBUG("OA exponent would exceed the max sampling frequency (sysctl dev.i915.oa_max_sample_rate) %uHz without root privileges\n",
+			if (oa_freq_hz > i915_oa_max_sample_rate && !perfmon_capable()) {
+				DRM_DEBUG("OA exponent would exceed the max sampling frequency (sysctl dev.i915.oa_max_sample_rate) %uHz without CAP_PERFMON or CAP_SYS_ADMIN privileges\n",
 					  i915_oa_max_sample_rate);
 				return -EACCES;
 			}
@@ -4052,7 +4051,7 @@ int i915_perf_add_config_ioctl(struct drm_device *dev, void *data,
 		return -EINVAL;
 	}
 
-	if (i915_perf_stream_paranoid && !capable(CAP_SYS_ADMIN)) {
+	if (i915_perf_stream_paranoid && !perfmon_capable()) {
 		DRM_DEBUG("Insufficient privileges to add i915 OA config\n");
 		return -EACCES;
 	}
@@ -4199,7 +4198,7 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
 		return -ENOTSUPP;
 	}
 
-	if (i915_perf_stream_paranoid && !capable(CAP_SYS_ADMIN)) {
+	if (i915_perf_stream_paranoid && !perfmon_capable()) {
 		DRM_DEBUG("Insufficient privileges to remove i915 OA config\n");
 		return -EACCES;
 	}
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 10/60] trace/bpf_trace: Open access for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 09/60] drm/i915/perf: Open access for CAP_PERFMON privileged process Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 11/60] powerpc/perf: open " Arnaldo Carvalho de Melo
                   ` (50 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris, Song Liu,
	Alexei Starovoitov, Andi Kleen, Igor Lubashev, Jiri Olsa,
	Peter Zijlstra, Serge Hallyn, Stephane Eranian, intel-gfx,
	linux-doc, linux-man, linux-security-module, selinux,
	Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to bpf_trace monitoring for CAP_PERFMON privileged process.
Providing the access under CAP_PERFMON capability singly, without the
rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the
credentials and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to bpf_trace monitoring
remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN
usage for secure bpf_trace monitoring is discouraged with respect to
CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/c0a0ae47-8b6e-ff3e-416b-3cd1faaf71c0@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 kernel/trace/bpf_trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index ca1796747a77..d7d88007dc6d 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1468,7 +1468,7 @@ int perf_event_query_prog_array(struct perf_event *event, void __user *info)
 	u32 *ids, prog_cnt, ids_len;
 	int ret;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EPERM;
 	if (event->attr.type != PERF_TYPE_TRACEPOINT)
 		return -EINVAL;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 11/60] powerpc/perf: open access for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 10/60] trace/bpf_trace: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 12/60] parisc/perf: " Arnaldo Carvalho de Melo
                   ` (49 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris, Anju T Sudhakar,
	Alexei Starovoitov, Andi Kleen, Igor Lubashev, Jiri Olsa,
	Peter Zijlstra, Serge Hallyn, Song Liu, Stephane Eranian,
	intel-gfx, linux-doc, linux-man, linux-security-module, selinux,
	Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to monitoring for CAP_PERFMON privileged process.  Providing
the access under CAP_PERFMON capability singly, without the rest of
CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials
and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to the monitoring remains open
for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
secure monitoring is discouraged with respect to CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/ac98cd9f-b59e-673c-c70d-180b3e7695d2@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 arch/powerpc/perf/imc-pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index eb82dda884e5..0edcfd0b491d 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -976,7 +976,7 @@ static int thread_imc_event_init(struct perf_event *event)
 	if (event->attr.type != event->pmu->type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/* Sampling not supported */
@@ -1412,7 +1412,7 @@ static int trace_imc_event_init(struct perf_event *event)
 	if (event->attr.type != event->pmu->type)
 		return -ENOENT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	/* Return if this is a couting event */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 12/60] parisc/perf: open access for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 11/60] powerpc/perf: open " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 13/60] drivers/perf: Open " Arnaldo Carvalho de Melo
                   ` (48 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris, Helge Deller,
	Alexei Starovoitov, Andi Kleen, Igor Lubashev, Jiri Olsa,
	Peter Zijlstra, Serge Hallyn, Song Liu, Stephane Eranian,
	intel-gfx, linux-doc, linux-man, linux-security-module, selinux,
	Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to monitoring for CAP_PERFMON privileged process.  Providing
the access under CAP_PERFMON capability singly, without the rest of
CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials
and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to the monitoring remains open
for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
secure monitoring is discouraged with respect to CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Helge Deller <deller@gmx.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/8cc98809-d35b-de0f-de02-4cf554f3cf62@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 arch/parisc/kernel/perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index e1a8fee3ad49..d46b6709ec56 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -300,7 +300,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf,
 	else
 		return -EFAULT;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EACCES;
 
 	if (count != sizeof(uint32_t))
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 13/60] drivers/perf: Open access for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 12/60] parisc/perf: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 14/60] drivers/oprofile: " Arnaldo Carvalho de Melo
                   ` (47 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris, Will Deacon,
	Alexei Starovoitov, Andi Kleen, Igor Lubashev, Jiri Olsa,
	Peter Zijlstra, Serge Hallyn, Song Liu, Stephane Eranian,
	intel-gfx, linux-doc, linux-man, linux-security-module, selinux,
	Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to monitoring for CAP_PERFMON privileged process.  Providing
the access under CAP_PERFMON capability singly, without the rest of
CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials
and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to the monitoring remains open
for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
secure monitoring is discouraged with respect to CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Acked-by: Will Deacon <will@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/4ec1d6f7-548c-8d1c-f84a-cebeb9674e4e@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 drivers/perf/arm_spe_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index b72c04852599..0e0961a2b405 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -274,7 +274,7 @@ static u64 arm_spe_event_to_pmscr(struct perf_event *event)
 	if (!attr->exclude_kernel)
 		reg |= BIT(SYS_PMSCR_EL1_E1SPE_SHIFT);
 
-	if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && capable(CAP_SYS_ADMIN))
+	if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && perfmon_capable())
 		reg |= BIT(SYS_PMSCR_EL1_CX_SHIFT);
 
 	return reg;
@@ -700,7 +700,7 @@ static int arm_spe_pmu_event_init(struct perf_event *event)
 		return -EOPNOTSUPP;
 
 	reg = arm_spe_event_to_pmscr(event);
-	if (!capable(CAP_SYS_ADMIN) &&
+	if (!perfmon_capable() &&
 	    (reg & (BIT(SYS_PMSCR_EL1_PA_SHIFT) |
 		    BIT(SYS_PMSCR_EL1_CX_SHIFT) |
 		    BIT(SYS_PMSCR_EL1_PCT_SHIFT))))
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 14/60] drivers/oprofile: Open access for CAP_PERFMON privileged process
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 13/60] drivers/perf: Open " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 15/60] doc/admin-guide: Update perf-security.rst with CAP_PERFMON information Arnaldo Carvalho de Melo
                   ` (46 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, James Morris,
	Alexei Starovoitov, Andi Kleen, Igor Lubashev, Jiri Olsa,
	Peter Zijlstra, Serge Hallyn, Song Liu, Stephane Eranian,
	intel-gfx, linux-doc, linux-man, linux-security-module, selinux,
	Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Open access to monitoring for CAP_PERFMON privileged process.  Providing
the access under CAP_PERFMON capability singly, without the rest of
CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials
and makes operation more secure.

CAP_PERFMON implements the principle of least privilege for performance
monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
principle of least privilege: A security design principle that states
that a process or program be granted only those privileges (e.g.,
capabilities) necessary to accomplish its legitimate function, and only
for the time that such privileges are actually required)

For backward compatibility reasons access to the monitoring remains open
for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
secure monitoring is discouraged with respect to CAP_PERFMON capability.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: James Morris <jamorris@linux.microsoft.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/691f1096-b15f-9b12-50a0-c2b93918149e@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 drivers/oprofile/event_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
index 12ea4a4ad607..6c9edc8bbc95 100644
--- a/drivers/oprofile/event_buffer.c
+++ b/drivers/oprofile/event_buffer.c
@@ -113,7 +113,7 @@ static int event_buffer_open(struct inode *inode, struct file *file)
 {
 	int err = -EPERM;
 
-	if (!capable(CAP_SYS_ADMIN))
+	if (!perfmon_capable())
 		return -EPERM;
 
 	if (test_and_set_bit_lock(0, &buffer_opened))
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 15/60] doc/admin-guide: Update perf-security.rst with CAP_PERFMON information
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 14/60] drivers/oprofile: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 16/60] doc/admin-guide: update kernel.rst " Arnaldo Carvalho de Melo
                   ` (45 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, Arnaldo Carvalho de Melo,
	Alexei Starovoitov, Andi Kleen, Igor Lubashev, James Morris,
	Jiri Olsa, Peter Zijlstra, Serge Hallyn, Song Liu,
	Stephane Eranian, intel-gfx, linux-doc, linux-man,
	linux-security-module, selinux

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Update perf-security.rst documentation file with the information
related to usage of CAP_PERFMON capability to secure performance
monitoring and observability operations in system.

Committer notes:

While testing 'perf top' under cap_perfmon I noticed that it needs
some more capability and Alexey pointed out cap_ipc_lock, as needed by
this kernel chunk:

  kernel/events/core.c: 6101
       if ((locked > lock_limit) && perf_is_paranoid() &&
               !capable(CAP_IPC_LOCK)) {
               ret = -EPERM;
               goto unlock;
       }

So I added it to the documentation, and also mentioned that if the
libcap version doesn't yet supports 'cap_perfmon', its numeric value can
be used instead, i.e. if:

	# setcap "cap_perfmon,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf

Fails, try:

	# setcap "38,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf

I also added a paragraph stating that using an unpatched libcap will
fail the check for CAP_PERFMON, as it checks the cap number against a
maximum to see if it is valid, which makes it use as the default the
'cycles:u' event, even tho a cap_perfmon capable perf binary can get
kernel samples, to workaround that just use, e.g.:

  # perf top -e cycles
  # perf record -e cycles

And it will sample kernel and user modes.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: James Morris <jmorris@namei.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/17278551-9399-9ebe-d665-8827016a217d@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 Documentation/admin-guide/perf-security.rst | 86 +++++++++++++++------
 1 file changed, 61 insertions(+), 25 deletions(-)

diff --git a/Documentation/admin-guide/perf-security.rst b/Documentation/admin-guide/perf-security.rst
index 72effa7c23b9..1307b5274a0f 100644
--- a/Documentation/admin-guide/perf-security.rst
+++ b/Documentation/admin-guide/perf-security.rst
@@ -1,6 +1,6 @@
 .. _perf_security:
 
-Perf Events and tool security
+Perf events and tool security
 =============================
 
 Overview
@@ -42,11 +42,11 @@ categories:
 Data that belong to the fourth category can potentially contain
 sensitive process data. If PMUs in some monitoring modes capture values
 of execution context registers or data from process memory then access
-to such monitoring capabilities requires to be ordered and secured
-properly. So, perf_events/Perf performance monitoring is the subject for
-security access control management [5]_ .
+to such monitoring modes requires to be ordered and secured properly.
+So, perf_events performance monitoring and observability operations are
+the subject for security access control management [5]_ .
 
-perf_events/Perf access control
+perf_events access control
 -------------------------------
 
 To perform security checks, the Linux implementation splits processes
@@ -66,11 +66,25 @@ into distinct units, known as capabilities [6]_ , which can be
 independently enabled and disabled on per-thread basis for processes and
 files of unprivileged users.
 
-Unprivileged processes with enabled CAP_SYS_ADMIN capability are treated
+Unprivileged processes with enabled CAP_PERFMON capability are treated
 as privileged processes with respect to perf_events performance
-monitoring and bypass *scope* permissions checks in the kernel.
-
-Unprivileged processes using perf_events system call API is also subject
+monitoring and observability operations, thus, bypass *scope* permissions
+checks in the kernel. CAP_PERFMON implements the principle of least
+privilege [13]_ (POSIX 1003.1e: 2.2.2.39) for performance monitoring and
+observability operations in the kernel and provides a secure approach to
+perfomance monitoring and observability in the system.
+
+For backward compatibility reasons the access to perf_events monitoring and
+observability operations is also open for CAP_SYS_ADMIN privileged
+processes but CAP_SYS_ADMIN usage for secure monitoring and observability
+use cases is discouraged with respect to the CAP_PERFMON capability.
+If system audit records [14]_ for a process using perf_events system call
+API contain denial records of acquiring both CAP_PERFMON and CAP_SYS_ADMIN
+capabilities then providing the process with CAP_PERFMON capability singly
+is recommended as the preferred secure approach to resolve double access
+denial logging related to usage of performance monitoring and observability.
+
+Unprivileged processes using perf_events system call are also subject
 for PTRACE_MODE_READ_REALCREDS ptrace access mode check [7]_ , whose
 outcome determines whether monitoring is permitted. So unprivileged
 processes provided with CAP_SYS_PTRACE capability are effectively
@@ -82,14 +96,14 @@ performance analysis of monitored processes or a system. For example,
 CAP_SYSLOG capability permits reading kernel space memory addresses from
 /proc/kallsyms file.
 
-perf_events/Perf privileged users
+Privileged Perf users groups
 ---------------------------------
 
 Mechanisms of capabilities, privileged capability-dumb files [6]_ and
-file system ACLs [10]_ can be used to create a dedicated group of
-perf_events/Perf privileged users who are permitted to execute
-performance monitoring without scope limits. The following steps can be
-taken to create such a group of privileged Perf users.
+file system ACLs [10]_ can be used to create dedicated groups of
+privileged Perf users who are permitted to execute performance monitoring
+and observability without scope limits. The following steps can be
+taken to create such groups of privileged Perf users.
 
 1. Create perf_users group of privileged Perf users, assign perf_users
    group to Perf tool executable and limit access to the executable for
@@ -108,30 +122,51 @@ taken to create such a group of privileged Perf users.
    -rwxr-x---  2 root perf_users  11M Oct 19 15:12 perf
 
 2. Assign the required capabilities to the Perf tool executable file and
-   enable members of perf_users group with performance monitoring
+   enable members of perf_users group with monitoring and observability
    privileges [6]_ :
 
 ::
 
-   # setcap "cap_sys_admin,cap_sys_ptrace,cap_syslog=ep" perf
-   # setcap -v "cap_sys_admin,cap_sys_ptrace,cap_syslog=ep" perf
+   # setcap "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" perf
+   # setcap -v "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" perf
    perf: OK
    # getcap perf
-   perf = cap_sys_ptrace,cap_sys_admin,cap_syslog+ep
+   perf = cap_sys_ptrace,cap_syslog,cap_perfmon+ep
+
+If the libcap installed doesn't yet support "cap_perfmon", use "38" instead,
+i.e.:
+
+::
+
+   # setcap "38,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf
+
+Note that you may need to have 'cap_ipc_lock' in the mix for tools such as
+'perf top', alternatively use 'perf top -m N', to reduce the memory that
+it uses for the perf ring buffer, see the memory allocation section below.
+
+Using a libcap without support for CAP_PERFMON will make cap_get_flag(caps, 38,
+CAP_EFFECTIVE, &val) fail, which will lead the default event to be 'cycles:u',
+so as a workaround explicitly ask for the 'cycles' event, i.e.:
+
+::
+
+  # perf top -e cycles
+
+To get kernel and user samples with a perf binary with just CAP_PERFMON.
 
 As a result, members of perf_users group are capable of conducting
-performance monitoring by using functionality of the configured Perf
-tool executable that, when executes, passes perf_events subsystem scope
-checks.
+performance monitoring and observability by using functionality of the
+configured Perf tool executable that, when executes, passes perf_events
+subsystem scope checks.
 
 This specific access control management is only available to superuser
 or root running processes with CAP_SETPCAP, CAP_SETFCAP [6]_
 capabilities.
 
-perf_events/Perf unprivileged users
+Unprivileged users
 -----------------------------------
 
-perf_events/Perf *scope* and *access* control for unprivileged processes
+perf_events *scope* and *access* control for unprivileged processes
 is governed by perf_event_paranoid [2]_ setting:
 
 -1:
@@ -166,7 +201,7 @@ is governed by perf_event_paranoid [2]_ setting:
      perf_event_mlock_kb locking limit is imposed but ignored for
      unprivileged processes with CAP_IPC_LOCK capability.
 
-perf_events/Perf resource control
+Resource control
 ---------------------------------
 
 Open file descriptors
@@ -227,4 +262,5 @@ Bibliography
 .. [10] `<http://man7.org/linux/man-pages/man5/acl.5.html>`_
 .. [11] `<http://man7.org/linux/man-pages/man2/getrlimit.2.html>`_
 .. [12] `<http://man7.org/linux/man-pages/man5/limits.conf.5.html>`_
-
+.. [13] `<https://sites.google.com/site/fullycapable>`_
+.. [14] `<http://man7.org/linux/man-pages/man8/auditd.8.html>`_
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 16/60] doc/admin-guide: update kernel.rst with CAP_PERFMON information
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 15/60] doc/admin-guide: Update perf-security.rst with CAP_PERFMON information Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 17/60] perf script: Simplify auxiliary event printing functions Arnaldo Carvalho de Melo
                   ` (44 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexey Budankov, Alexei Starovoitov,
	Andi Kleen, Igor Lubashev, James Morris, Jiri Olsa,
	Peter Zijlstra, Serge Hallyn, Song Liu, Stephane Eranian,
	intel-gfx, linux-doc, linux-man, linux-security-module, selinux,
	Arnaldo Carvalho de Melo

From: Alexey Budankov <alexey.budankov@linux.intel.com>

Update the kernel.rst documentation file with the information related to
usage of CAP_PERFMON capability to secure performance monitoring and
observability operations in system.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Igor Lubashev <ilubashe@akamai.com>
Cc: James Morris <jmorris@namei.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org
Cc: linux-man@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: selinux@vger.kernel.org
Link: http://lore.kernel.org/lkml/84c32383-14a2-fa35-16b6-f9e59bd37240@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 Documentation/admin-guide/sysctl/kernel.rst | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 39c95c0e13d3..7e4c28dfc9ca 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -730,7 +730,13 @@ perf_event_paranoid
 ===================
 
 Controls use of the performance events system by unprivileged
-users (without CAP_SYS_ADMIN).  The default value is 2.
+users (without CAP_PERFMON).  The default value is 2.
+
+For backward compatibility reasons access to system performance
+monitoring and observability remains open for CAP_SYS_ADMIN
+privileged processes but CAP_SYS_ADMIN usage for secure system
+performance monitoring and observability operations is discouraged
+with respect to CAP_PERFMON use cases.
 
 ===  ==================================================================
  -1  Allow use of (almost) all events by all users.
@@ -739,13 +745,13 @@ users (without CAP_SYS_ADMIN).  The default value is 2.
      ``CAP_IPC_LOCK``.
 
 >=0  Disallow ftrace function tracepoint by users without
-     ``CAP_SYS_ADMIN``.
+     ``CAP_PERFMON``.
 
-     Disallow raw tracepoint access by users without ``CAP_SYS_ADMIN``.
+     Disallow raw tracepoint access by users without ``CAP_PERFMON``.
 
->=1  Disallow CPU event access by users without ``CAP_SYS_ADMIN``.
+>=1  Disallow CPU event access by users without ``CAP_PERFMON``.
 
->=2  Disallow kernel profiling by users without ``CAP_SYS_ADMIN``.
+>=2  Disallow kernel profiling by users without ``CAP_PERFMON``.
 ===  ==================================================================
 
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 17/60] perf script: Simplify auxiliary event printing functions
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 16/60] doc/admin-guide: update kernel.rst " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 18/60] perf bench: Add event synthesis benchmark Arnaldo Carvalho de Melo
                   ` (43 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

This simplifies the print functions for the following perf script
options:

	--show-task-events
	--show-namespace-events
	--show-cgroup-events
	--show-mmap-events
	--show-switch-events
	--show-lost-events
	--show-bpf-events

Example:
	# perf record --switch-events -a -e cycles -c 10000 sleep 1
 Before:
	# perf script --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events > out-before.txt
 After:
	# perf script --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events > out-after.txt
	# diff -s out-before.txt out-after.txt
	Files out-before.txt and out-after.tx are identical

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200402141548.21283-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c | 304 ++++++++----------------------------
 1 file changed, 66 insertions(+), 238 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 1f57a7ecdf3d..8bf3ba280312 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2040,7 +2040,7 @@ static int cleanup_scripting(void)
 
 static bool filter_cpu(struct perf_sample *sample)
 {
-	if (cpu_list)
+	if (cpu_list && sample->cpu != (u32)-1)
 		return !test_bit(sample->cpu, cpu_bitmap);
 	return false;
 }
@@ -2138,41 +2138,59 @@ static int process_attr(struct perf_tool *tool, union perf_event *event,
 	return err;
 }
 
-static int process_comm_event(struct perf_tool *tool,
-			      union perf_event *event,
-			      struct perf_sample *sample,
-			      struct machine *machine)
+static int print_event_with_time(struct perf_tool *tool,
+				 union perf_event *event,
+				 struct perf_sample *sample,
+				 struct machine *machine,
+				 pid_t pid, pid_t tid, u64 timestamp)
 {
-	struct thread *thread;
 	struct perf_script *script = container_of(tool, struct perf_script, tool);
 	struct perf_session *session = script->session;
 	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-	int ret = -1;
+	struct thread *thread = NULL;
 
-	thread = machine__findnew_thread(machine, event->comm.pid, event->comm.tid);
-	if (thread == NULL) {
-		pr_debug("problem processing COMM event, skipping it.\n");
-		return -1;
+	if (evsel && !evsel->core.attr.sample_id_all) {
+		sample->cpu = 0;
+		sample->time = timestamp;
+		sample->pid = pid;
+		sample->tid = tid;
 	}
 
-	if (perf_event__process_comm(tool, event, sample, machine) < 0)
-		goto out;
+	if (filter_cpu(sample))
+		return 0;
 
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = 0;
-		sample->tid = event->comm.tid;
-		sample->pid = event->comm.pid;
-	}
-	if (!filter_cpu(sample)) {
+	if (tid != -1)
+		thread = machine__findnew_thread(machine, pid, tid);
+
+	if (thread && evsel) {
 		perf_sample__fprintf_start(sample, thread, evsel,
-				   PERF_RECORD_COMM, stdout);
-		perf_event__fprintf(event, stdout);
+					   event->header.type, stdout);
 	}
-	ret = 0;
-out:
+
+	perf_event__fprintf(event, stdout);
+
 	thread__put(thread);
-	return ret;
+
+	return 0;
+}
+
+static int print_event(struct perf_tool *tool, union perf_event *event,
+		       struct perf_sample *sample, struct machine *machine,
+		       pid_t pid, pid_t tid)
+{
+	return print_event_with_time(tool, event, sample, machine, pid, tid, 0);
+}
+
+static int process_comm_event(struct perf_tool *tool,
+			      union perf_event *event,
+			      struct perf_sample *sample,
+			      struct machine *machine)
+{
+	if (perf_event__process_comm(tool, event, sample, machine) < 0)
+		return -1;
+
+	return print_event(tool, event, sample, machine, event->comm.pid,
+			   event->comm.tid);
 }
 
 static int process_namespaces_event(struct perf_tool *tool,
@@ -2180,37 +2198,11 @@ static int process_namespaces_event(struct perf_tool *tool,
 				    struct perf_sample *sample,
 				    struct machine *machine)
 {
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-	int ret = -1;
-
-	thread = machine__findnew_thread(machine, event->namespaces.pid,
-					 event->namespaces.tid);
-	if (thread == NULL) {
-		pr_debug("problem processing NAMESPACES event, skipping it.\n");
-		return -1;
-	}
-
 	if (perf_event__process_namespaces(tool, event, sample, machine) < 0)
-		goto out;
+		return -1;
 
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = 0;
-		sample->tid = event->namespaces.tid;
-		sample->pid = event->namespaces.pid;
-	}
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_NAMESPACES, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	ret = 0;
-out:
-	thread__put(thread);
-	return ret;
+	return print_event(tool, event, sample, machine, event->namespaces.pid,
+			   event->namespaces.tid);
 }
 
 static int process_cgroup_event(struct perf_tool *tool,
@@ -2218,34 +2210,11 @@ static int process_cgroup_event(struct perf_tool *tool,
 				struct perf_sample *sample,
 				struct machine *machine)
 {
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-	int ret = -1;
-
-	thread = machine__findnew_thread(machine, sample->pid, sample->tid);
-	if (thread == NULL) {
-		pr_debug("problem processing CGROUP event, skipping it.\n");
-		return -1;
-	}
-
 	if (perf_event__process_cgroup(tool, event, sample, machine) < 0)
-		goto out;
+		return -1;
 
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = 0;
-	}
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_CGROUP, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	ret = 0;
-out:
-	thread__put(thread);
-	return ret;
+	return print_event(tool, event, sample, machine, sample->pid,
+			    sample->tid);
 }
 
 static int process_fork_event(struct perf_tool *tool,
@@ -2253,69 +2222,24 @@ static int process_fork_event(struct perf_tool *tool,
 			      struct perf_sample *sample,
 			      struct machine *machine)
 {
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-
 	if (perf_event__process_fork(tool, event, sample, machine) < 0)
 		return -1;
 
-	thread = machine__findnew_thread(machine, event->fork.pid, event->fork.tid);
-	if (thread == NULL) {
-		pr_debug("problem processing FORK event, skipping it.\n");
-		return -1;
-	}
-
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = event->fork.time;
-		sample->tid = event->fork.tid;
-		sample->pid = event->fork.pid;
-	}
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_FORK, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	thread__put(thread);
-
-	return 0;
+	return print_event_with_time(tool, event, sample, machine,
+				     event->fork.pid, event->fork.tid,
+				     event->fork.time);
 }
 static int process_exit_event(struct perf_tool *tool,
 			      union perf_event *event,
 			      struct perf_sample *sample,
 			      struct machine *machine)
 {
-	int err = 0;
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-
-	thread = machine__findnew_thread(machine, event->fork.pid, event->fork.tid);
-	if (thread == NULL) {
-		pr_debug("problem processing EXIT event, skipping it.\n");
+	/* Print before 'exit' deletes anything */
+	if (print_event_with_time(tool, event, sample, machine, event->fork.pid,
+				  event->fork.tid, event->fork.time))
 		return -1;
-	}
-
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = 0;
-		sample->tid = event->fork.tid;
-		sample->pid = event->fork.pid;
-	}
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_EXIT, stdout);
-		perf_event__fprintf(event, stdout);
-	}
 
-	if (perf_event__process_exit(tool, event, sample, machine) < 0)
-		err = -1;
-
-	thread__put(thread);
-	return err;
+	return perf_event__process_exit(tool, event, sample, machine);
 }
 
 static int process_mmap_event(struct perf_tool *tool,
@@ -2323,33 +2247,11 @@ static int process_mmap_event(struct perf_tool *tool,
 			      struct perf_sample *sample,
 			      struct machine *machine)
 {
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-
 	if (perf_event__process_mmap(tool, event, sample, machine) < 0)
 		return -1;
 
-	thread = machine__findnew_thread(machine, event->mmap.pid, event->mmap.tid);
-	if (thread == NULL) {
-		pr_debug("problem processing MMAP event, skipping it.\n");
-		return -1;
-	}
-
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = 0;
-		sample->tid = event->mmap.tid;
-		sample->pid = event->mmap.pid;
-	}
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_MMAP, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	thread__put(thread);
-	return 0;
+	return print_event(tool, event, sample, machine, event->mmap.pid,
+			   event->mmap.tid);
 }
 
 static int process_mmap2_event(struct perf_tool *tool,
@@ -2357,33 +2259,11 @@ static int process_mmap2_event(struct perf_tool *tool,
 			      struct perf_sample *sample,
 			      struct machine *machine)
 {
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-
 	if (perf_event__process_mmap2(tool, event, sample, machine) < 0)
 		return -1;
 
-	thread = machine__findnew_thread(machine, event->mmap2.pid, event->mmap2.tid);
-	if (thread == NULL) {
-		pr_debug("problem processing MMAP2 event, skipping it.\n");
-		return -1;
-	}
-
-	if (!evsel->core.attr.sample_id_all) {
-		sample->cpu = 0;
-		sample->time = 0;
-		sample->tid = event->mmap2.tid;
-		sample->pid = event->mmap2.pid;
-	}
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_MMAP2, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	thread__put(thread);
-	return 0;
+	return print_event(tool, event, sample, machine, event->mmap2.pid,
+			   event->mmap2.tid);
 }
 
 static int process_switch_event(struct perf_tool *tool,
@@ -2391,10 +2271,7 @@ static int process_switch_event(struct perf_tool *tool,
 				struct perf_sample *sample,
 				struct machine *machine)
 {
-	struct thread *thread;
 	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
 
 	if (perf_event__process_switch(tool, event, sample, machine) < 0)
 		return -1;
@@ -2405,20 +2282,8 @@ static int process_switch_event(struct perf_tool *tool,
 	if (!script->show_switch_events)
 		return 0;
 
-	thread = machine__findnew_thread(machine, sample->pid,
-					 sample->tid);
-	if (thread == NULL) {
-		pr_debug("problem processing SWITCH event, skipping it.\n");
-		return -1;
-	}
-
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_SWITCH, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	thread__put(thread);
-	return 0;
+	return print_event(tool, event, sample, machine, sample->pid,
+			   sample->tid);
 }
 
 static int
@@ -2427,23 +2292,8 @@ process_lost_event(struct perf_tool *tool,
 		   struct perf_sample *sample,
 		   struct machine *machine)
 {
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-	struct thread *thread;
-
-	thread = machine__findnew_thread(machine, sample->pid,
-					 sample->tid);
-	if (thread == NULL)
-		return -1;
-
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   PERF_RECORD_LOST, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-	thread__put(thread);
-	return 0;
+	return print_event(tool, event, sample, machine, sample->pid,
+			   sample->tid);
 }
 
 static int
@@ -2462,33 +2312,11 @@ process_bpf_events(struct perf_tool *tool __maybe_unused,
 		   struct perf_sample *sample,
 		   struct machine *machine)
 {
-	struct thread *thread;
-	struct perf_script *script = container_of(tool, struct perf_script, tool);
-	struct perf_session *session = script->session;
-	struct evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
-
 	if (machine__process_ksymbol(machine, event, sample) < 0)
 		return -1;
 
-	if (!evsel->core.attr.sample_id_all) {
-		perf_event__fprintf(event, stdout);
-		return 0;
-	}
-
-	thread = machine__findnew_thread(machine, sample->pid, sample->tid);
-	if (thread == NULL) {
-		pr_debug("problem processing MMAP event, skipping it.\n");
-		return -1;
-	}
-
-	if (!filter_cpu(sample)) {
-		perf_sample__fprintf_start(sample, thread, evsel,
-					   event->header.type, stdout);
-		perf_event__fprintf(event, stdout);
-	}
-
-	thread__put(thread);
-	return 0;
+	return print_event(tool, event, sample, machine, sample->pid,
+			   sample->tid);
 }
 
 static void sig_handler(int sig __maybe_unused)
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 18/60] perf bench: Add event synthesis benchmark
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 17/60] perf script: Simplify auxiliary event printing functions Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 19/60] tools api fs: Make xxx__mountpoint() more scalable Arnaldo Carvalho de Melo
                   ` (42 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, 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>

Event synthesis may occur at the start or end (tail) of a perf command.
In system-wide mode it can scan every process in /proc, which may add
seconds of latency before event recording. Add a new benchmark that
times how long event synthesis takes with and without data synthesis.

An example execution looks like:

 $ perf bench internals synthesize
 # Running 'internals/synthesize' benchmark:
 Average synthesis took: 168.253800 usec
 Average data synthesis took: 208.104700 usec

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
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: Kan Liang <kan.liang@linux.intel.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
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/20200402154357.107873-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-bench.txt |   8 ++
 tools/perf/bench/Build                  |   2 +-
 tools/perf/bench/bench.h                |   2 +-
 tools/perf/bench/synthesize.c           | 101 ++++++++++++++++++++++++
 tools/perf/builtin-bench.c              |   6 ++
 5 files changed, 117 insertions(+), 2 deletions(-)
 create mode 100644 tools/perf/bench/synthesize.c

diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
index 0921a3c67381..bad16512c48d 100644
--- a/tools/perf/Documentation/perf-bench.txt
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -61,6 +61,9 @@ SUBSYSTEM
 'epoll'::
 	Eventpoll (epoll) stressing benchmarks.
 
+'internals'::
+	Benchmark internal perf functionality.
+
 'all'::
 	All benchmark subsystems.
 
@@ -214,6 +217,11 @@ Suite for evaluating concurrent epoll_wait calls.
 *ctl*::
 Suite for evaluating multiple epoll_ctl calls.
 
+SUITES FOR 'internals'
+~~~~~~~~~~~~~~~~~~~~~~
+*synthesize*::
+Suite for evaluating perf's event synthesis performance.
+
 SEE ALSO
 --------
 linkperf:perf[1]
diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build
index e4e321b6f883..042827385c87 100644
--- a/tools/perf/bench/Build
+++ b/tools/perf/bench/Build
@@ -6,9 +6,9 @@ perf-y += futex-wake.o
 perf-y += futex-wake-parallel.o
 perf-y += futex-requeue.o
 perf-y += futex-lock-pi.o
-
 perf-y += epoll-wait.o
 perf-y += epoll-ctl.o
+perf-y += synthesize.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 4aa6de1aa67d..4d669c803237 100644
--- a/tools/perf/bench/bench.h
+++ b/tools/perf/bench/bench.h
@@ -41,9 +41,9 @@ int bench_futex_wake_parallel(int argc, const char **argv);
 int bench_futex_requeue(int argc, const char **argv);
 /* pi futexes */
 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);
 
 #define BENCH_FORMAT_DEFAULT_STR	"default"
 #define BENCH_FORMAT_DEFAULT		0
diff --git a/tools/perf/bench/synthesize.c b/tools/perf/bench/synthesize.c
new file mode 100644
index 000000000000..6291257bc9c9
--- /dev/null
+++ b/tools/perf/bench/synthesize.c
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Benchmark synthesis of perf events such as at the start of a 'perf
+ * record'. Synthesis is done on the current process and the 'dummy' event
+ * handlers are invoked that support dump_trace but otherwise do nothing.
+ *
+ * Copyright 2019 Google LLC.
+ */
+#include <stdio.h>
+#include "bench.h"
+#include "../util/debug.h"
+#include "../util/session.h"
+#include "../util/synthetic-events.h"
+#include "../util/target.h"
+#include "../util/thread_map.h"
+#include "../util/tool.h"
+#include <linux/err.h>
+#include <linux/time64.h>
+#include <subcmd/parse-options.h>
+
+static unsigned int iterations = 10000;
+
+static const struct option options[] = {
+	OPT_UINTEGER('i', "iterations", &iterations,
+		"Number of iterations used to compute average"),
+	OPT_END()
+};
+
+static const char *const usage[] = {
+	"perf bench internals synthesize <options>",
+	NULL
+};
+
+
+static int do_synthesize(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;
+	int err;
+
+	gettimeofday(&start, NULL);
+	for (i = 0; i < iterations; i++) {
+		err = machine__synthesize_threads(&session->machines.host,
+						target, threads, 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;
+	average = (double)runtime_us/(double)iterations;
+	printf("Average %ssynthesis took: %f usec\n",
+		data_mmap ? "data " : "", average);
+	return 0;
+}
+
+int bench_synthesize(int argc, const char **argv)
+{
+	struct perf_tool tool;
+	struct perf_session *session;
+	struct target target = {
+		.pid = "self",
+	};
+	struct perf_thread_map *threads;
+	int err;
+
+	argc = parse_options(argc, argv, options, usage, 0);
+
+	session = perf_session__new(NULL, false, NULL);
+	if (IS_ERR(session)) {
+		pr_err("Session creation failed.\n");
+		return PTR_ERR(session);
+	}
+	threads = thread_map__new_by_pid(getpid());
+	if (!threads) {
+		pr_err("Thread map creation failed.\n");
+		err = -ENOMEM;
+		goto err_out;
+	}
+	perf_tool__fill_defaults(&tool);
+
+	err = do_synthesize(session, threads, &target, false);
+	if (err)
+		goto err_out;
+
+	err = do_synthesize(session, threads, &target, true);
+
+err_out:
+	if (threads)
+		perf_thread_map__put(threads);
+
+	perf_session__delete(session);
+	return err;
+}
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index c06fe21c8613..11c79a8d85d6 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -76,6 +76,11 @@ static struct bench epoll_benchmarks[] = {
 };
 #endif // HAVE_EVENTFD
 
+static struct bench internals_benchmarks[] = {
+	{ "synthesize", "Benchmark perf event synthesis",	bench_synthesize	},
+	{ NULL,		NULL,					NULL			}
+};
+
 struct collection {
 	const char	*name;
 	const char	*summary;
@@ -92,6 +97,7 @@ static struct collection collections[] = {
 #ifdef HAVE_EVENTFD
 	{"epoll",       "Epoll stressing benchmarks",                   epoll_benchmarks        },
 #endif
+	{ "internals",	"Perf-internals benchmarks",			internals_benchmarks	},
 	{ "all",	"All benchmarks",				NULL			},
 	{ NULL,		NULL,						NULL			}
 };
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 19/60] tools api fs: Make xxx__mountpoint() more scalable
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 18/60] perf bench: Add event synthesis benchmark Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 20/60] perf synthetic-events: save 4kb from 2 stack frames Arnaldo Carvalho de Melo
                   ` (41 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Stephane Eranian, Ian Rogers, Jiri Olsa,
	Alexander Shishkin, Andrey Zhizhikin, Kan Liang, Kefeng Wang,
	Mark Rutland, Peter Zijlstra, Petr Mladek,
	Arnaldo Carvalho de Melo

From: Stephane Eranian <eranian@google.com>

The xxx_mountpoint() interface provided by fs.c finds mount points for
common pseudo filesystems. The first time xxx_mountpoint() is invoked,
it scans the mount table (/proc/mounts) looking for a match. If found,
it is cached. The price to scan /proc/mounts is paid once if the mount
is found.

When the mount point is not found, subsequent calls to xxx_mountpoint()
scan /proc/mounts over and over again.  There is no caching.

This causes a scaling issue in perf record with hugeltbfs__mountpoint().
The function is called for each process found in
synthesize__mmap_events().  If the machine has thousands of processes
and if the /proc/mounts has many entries this could cause major overhead
in perf record. We have observed multi-second slowdowns on some
configurations.

As an example on a laptop:

Before:

  $ sudo umount /dev/hugepages
  $ strace -e trace=openat -o /tmp/tt perf record -a ls
  $ fgrep mounts /tmp/tt
  285

After:

  $ sudo umount /dev/hugepages
  $ strace -e trace=openat -o /tmp/tt perf record -a ls
  $ fgrep mounts /tmp/tt
  1

One could argue that the non-caching in case the moint point is not
found is intentional. That way subsequent calls may discover a moint
point if the sysadmin mounts the filesystem. But the same argument could
be made against caching the mount point. It could be unmounted causing
errors.  It all depends on the intent of the interface. This patch
assumes it is expected to scan /proc/mounts once. The patch documents
the caching behavior in the fs.h header file.

An alternative would be to just fix perf record. But it would solve the
problem with hugetlbs__mountpoint() but there could be similar issues
(possibly down the line) with other xxx_mountpoint() calls in perf or
other tools.

Signed-off-by: Stephane Eranian <eranian@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
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: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lore.kernel.org/lkml/20200402154357.107873-3-irogers@google.com
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/api/fs/fs.c | 17 +++++++++++++++++
 tools/lib/api/fs/fs.h | 12 ++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c
index 027b18f7ed8c..82f53d81a7a7 100644
--- a/tools/lib/api/fs/fs.c
+++ b/tools/lib/api/fs/fs.c
@@ -90,6 +90,7 @@ struct fs {
 	const char * const	*mounts;
 	char			 path[PATH_MAX];
 	bool			 found;
+	bool			 checked;
 	long			 magic;
 };
 
@@ -111,31 +112,37 @@ static struct fs fs__entries[] = {
 		.name	= "sysfs",
 		.mounts	= sysfs__fs_known_mountpoints,
 		.magic	= SYSFS_MAGIC,
+		.checked = false,
 	},
 	[FS__PROCFS] = {
 		.name	= "proc",
 		.mounts	= procfs__known_mountpoints,
 		.magic	= PROC_SUPER_MAGIC,
+		.checked = false,
 	},
 	[FS__DEBUGFS] = {
 		.name	= "debugfs",
 		.mounts	= debugfs__known_mountpoints,
 		.magic	= DEBUGFS_MAGIC,
+		.checked = false,
 	},
 	[FS__TRACEFS] = {
 		.name	= "tracefs",
 		.mounts	= tracefs__known_mountpoints,
 		.magic	= TRACEFS_MAGIC,
+		.checked = false,
 	},
 	[FS__HUGETLBFS] = {
 		.name	= "hugetlbfs",
 		.mounts = hugetlbfs__known_mountpoints,
 		.magic	= HUGETLBFS_MAGIC,
+		.checked = false,
 	},
 	[FS__BPF_FS] = {
 		.name	= "bpf",
 		.mounts = bpf_fs__known_mountpoints,
 		.magic	= BPF_FS_MAGIC,
+		.checked = false,
 	},
 };
 
@@ -158,6 +165,7 @@ static bool fs__read_mounts(struct fs *fs)
 	}
 
 	fclose(fp);
+	fs->checked = true;
 	return fs->found = found;
 }
 
@@ -220,6 +228,7 @@ static bool fs__env_override(struct fs *fs)
 		return false;
 
 	fs->found = true;
+	fs->checked = true;
 	strncpy(fs->path, override_path, sizeof(fs->path) - 1);
 	fs->path[sizeof(fs->path) - 1] = '\0';
 	return true;
@@ -246,6 +255,14 @@ static const char *fs__mountpoint(int idx)
 	if (fs->found)
 		return (const char *)fs->path;
 
+	/* the mount point was already checked for the mount point
+	 * but and did not exist, so return NULL to avoid scanning again.
+	 * This makes the found and not found paths cost equivalent
+	 * in case of multiple calls.
+	 */
+	if (fs->checked)
+		return NULL;
+
 	return fs__get_mountpoint(fs);
 }
 
diff --git a/tools/lib/api/fs/fs.h b/tools/lib/api/fs/fs.h
index 936edb95e1f3..aa222ca30311 100644
--- a/tools/lib/api/fs/fs.h
+++ b/tools/lib/api/fs/fs.h
@@ -18,6 +18,18 @@
 	const char *name##__mount(void);	\
 	bool name##__configured(void);		\
 
+/*
+ * The xxxx__mountpoint() entry points find the first match mount point for each
+ * filesystems listed below, where xxxx is the filesystem type.
+ *
+ * The interface is as follows:
+ *
+ * - If a mount point is found on first call, it is cached and used for all
+ *   subsequent calls.
+ *
+ * - If a mount point is not found, NULL is returned on first call and all
+ *   subsequent calls.
+ */
 FS(sysfs)
 FS(procfs)
 FS(debugfs)
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 20/60] perf synthetic-events: save 4kb from 2 stack frames
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 19/60] tools api fs: Make xxx__mountpoint() more scalable Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 21/60] perf expr: Add expr_ prefix for parse_ctx and parse_id Arnaldo Carvalho de Melo
                   ` (40 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Ian Rogers, Alexander Shishkin,
	Andrey Zhizhikin, Jiri Olsa, Kan Liang, Kefeng Wang,
	Mark Rutland, Peter Zijlstra, Petr Mladek, Stephane Eranian,
	Arnaldo Carvalho de Melo

From: Ian Rogers <irogers@google.com>

Reuse an existing char buffer to avoid two PATH_MAX sized char buffers.

Reduces stack frame sizes by 4kb.

perf_event__synthesize_mmap_events before 'sub $0x45b8,%rsp' after
'sub $0x35b8,%rsp'.

perf_event__get_comm_ids before 'sub $0x2028,%rsp' after
'sub $0x1028,%rsp'.

The performance impact of this change is negligible.

Signed-off-by: Ian Rogers <irogers@google.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: Namhyung Kim <namhyung@kernel.org>
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/20200402154357.107873-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/synthetic-events.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
index a661b122d9d8..9d4aa951eaa6 100644
--- a/tools/perf/util/synthetic-events.c
+++ b/tools/perf/util/synthetic-events.c
@@ -71,7 +71,6 @@ int perf_tool__process_synth_event(struct perf_tool *tool,
 static int perf_event__get_comm_ids(pid_t pid, char *comm, size_t len,
 				    pid_t *tgid, pid_t *ppid)
 {
-	char filename[PATH_MAX];
 	char bf[4096];
 	int fd;
 	size_t size = 0;
@@ -81,11 +80,11 @@ static int perf_event__get_comm_ids(pid_t pid, char *comm, size_t len,
 	*tgid = -1;
 	*ppid = -1;
 
-	snprintf(filename, sizeof(filename), "/proc/%d/status", pid);
+	snprintf(bf, sizeof(bf), "/proc/%d/status", pid);
 
-	fd = open(filename, O_RDONLY);
+	fd = open(bf, O_RDONLY);
 	if (fd < 0) {
-		pr_debug("couldn't open %s\n", filename);
+		pr_debug("couldn't open %s\n", bf);
 		return -1;
 	}
 
@@ -281,9 +280,9 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
 				       struct machine *machine,
 				       bool mmap_data)
 {
-	char filename[PATH_MAX];
 	FILE *fp;
 	unsigned long long t;
+	char bf[BUFSIZ];
 	bool truncation = false;
 	unsigned long long timeout = proc_map_timeout * 1000000ULL;
 	int rc = 0;
@@ -293,15 +292,15 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
 	if (machine__is_default_guest(machine))
 		return 0;
 
-	snprintf(filename, sizeof(filename), "%s/proc/%d/task/%d/maps",
-		 machine->root_dir, pid, pid);
+	snprintf(bf, sizeof(bf), "%s/proc/%d/task/%d/maps",
+		machine->root_dir, pid, pid);
 
-	fp = fopen(filename, "r");
+	fp = fopen(bf, "r");
 	if (fp == NULL) {
 		/*
 		 * We raced with a task exiting - just return:
 		 */
-		pr_debug("couldn't open %s\n", filename);
+		pr_debug("couldn't open %s\n", bf);
 		return -1;
 	}
 
@@ -309,7 +308,6 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
 	t = rdclock();
 
 	while (1) {
-		char bf[BUFSIZ];
 		char prot[5];
 		char execname[PATH_MAX];
 		char anonstr[] = "//anon";
@@ -321,10 +319,10 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
 			break;
 
 		if ((rdclock() - t) > timeout) {
-			pr_warning("Reading %s time out. "
+			pr_warning("Reading %s/proc/%d/task/%d/maps time out. "
 				   "You may want to increase "
 				   "the time limit by --proc-map-timeout\n",
-				   filename);
+				   machine->root_dir, pid, pid);
 			truncation = true;
 			goto out;
 		}
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 21/60] perf expr: Add expr_ prefix for parse_ctx and parse_id
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (19 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 20/60] perf synthetic-events: save 4kb from 2 stack frames Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 22/60] perf expr: Add expr_scanner_ctx object Arnaldo Carvalho de Melo
                   ` (39 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexander Shishkin, Andi Kleen,
	Anju T Sudhakar, Benjamin Herrenschmidt, Greg Kroah-Hartman,
	Jin Yao, Joe Mario, Kajol Jain, Kan Liang, Madhavan Srinivasan,
	Mamatha Inamdar, Mark Rutland, Michael Ellerman, Michael Petlan,
	Paul Mackerras, Peter Zijlstra, Ravi Bangoria,
	Sukadev Bhattiprolu, linuxppc-dev, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Adding expr_ prefix for parse_ctx and parse_id, to straighten out the
expr* namespace.

There's no functional change.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
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: Kajol Jain <kjain@linux.ibm.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-2-kjain@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/expr.c       |  4 ++--
 tools/perf/util/expr.c        | 10 +++++-----
 tools/perf/util/expr.h        | 12 ++++++------
 tools/perf/util/expr.y        |  6 +++---
 tools/perf/util/stat-shadow.c |  2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
index 28313e59d6f6..ea10fc4412c4 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <linux/zalloc.h>
 
-static int test(struct parse_ctx *ctx, const char *e, double val2)
+static int test(struct expr_parse_ctx *ctx, const char *e, double val2)
 {
 	double val;
 
@@ -22,7 +22,7 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
 	const char **other;
 	double val;
 	int i, ret;
-	struct parse_ctx ctx;
+	struct expr_parse_ctx ctx;
 	int num_other;
 
 	expr__ctx_init(&ctx);
diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
index fd192ddf93c1..c8ccc548a585 100644
--- a/tools/perf/util/expr.c
+++ b/tools/perf/util/expr.c
@@ -11,7 +11,7 @@ extern int expr_debug;
 #endif
 
 /* Caller must make sure id is allocated */
-void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
+void expr__add_id(struct expr_parse_ctx *ctx, const char *name, double val)
 {
 	int idx;
 
@@ -21,13 +21,13 @@ void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
 	ctx->ids[idx].val = val;
 }
 
-void expr__ctx_init(struct parse_ctx *ctx)
+void expr__ctx_init(struct expr_parse_ctx *ctx)
 {
 	ctx->num_ids = 0;
 }
 
 static int
-__expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
+__expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr,
 	      int start)
 {
 	YY_BUFFER_STATE buffer;
@@ -52,7 +52,7 @@ __expr__parse(double *val, struct parse_ctx *ctx, const char *expr,
 	return ret;
 }
 
-int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr)
+int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr)
 {
 	return __expr__parse(final_val, ctx, expr, EXPR_PARSE) ? -1 : 0;
 }
@@ -75,7 +75,7 @@ int expr__find_other(const char *expr, const char *one, const char ***other,
 		     int *num_other)
 {
 	int err, i = 0, j = 0;
-	struct parse_ctx ctx;
+	struct expr_parse_ctx ctx;
 
 	expr__ctx_init(&ctx);
 	err = __expr__parse(NULL, &ctx, expr, EXPR_OTHER);
diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
index 9377538f4097..b9e53f2b5844 100644
--- a/tools/perf/util/expr.h
+++ b/tools/perf/util/expr.h
@@ -5,19 +5,19 @@
 #define EXPR_MAX_OTHER 20
 #define MAX_PARSE_ID EXPR_MAX_OTHER
 
-struct parse_id {
+struct expr_parse_id {
 	const char *name;
 	double val;
 };
 
-struct parse_ctx {
+struct expr_parse_ctx {
 	int num_ids;
-	struct parse_id ids[MAX_PARSE_ID];
+	struct expr_parse_id ids[MAX_PARSE_ID];
 };
 
-void expr__ctx_init(struct parse_ctx *ctx);
-void expr__add_id(struct parse_ctx *ctx, const char *id, double val);
-int expr__parse(double *final_val, struct parse_ctx *ctx, const char *expr);
+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__find_other(const char *expr, const char *one, const char ***other,
 		int *num_other);
 
diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
index 4720cbe79357..cd17486c1c5d 100644
--- a/tools/perf/util/expr.y
+++ b/tools/perf/util/expr.y
@@ -15,7 +15,7 @@
 %define api.pure full
 
 %parse-param { double *final_val }
-%parse-param { struct parse_ctx *ctx }
+%parse-param { struct expr_parse_ctx *ctx }
 %parse-param {void *scanner}
 %lex-param {void* scanner}
 
@@ -39,14 +39,14 @@
 
 %{
 static void expr_error(double *final_val __maybe_unused,
-		       struct parse_ctx *ctx __maybe_unused,
+		       struct expr_parse_ctx *ctx __maybe_unused,
 		       void *scanner,
 		       const char *s)
 {
 	pr_debug("%s\n", s);
 }
 
-static int lookup_id(struct parse_ctx *ctx, char *id, double *val)
+static int lookup_id(struct expr_parse_ctx *ctx, char *id, double *val)
 {
 	int i;
 
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 03ecb8cd0eec..1ad5c5be7e97 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -729,7 +729,7 @@ static void generic_metric(struct perf_stat_config *config,
 			   struct runtime_stat *st)
 {
 	print_metric_t print_metric = out->print_metric;
-	struct parse_ctx pctx;
+	struct expr_parse_ctx pctx;
 	double ratio, scale;
 	int i;
 	void *ctxp = out->ctx;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 22/60] perf expr: Add expr_scanner_ctx object
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (20 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 21/60] perf expr: Add expr_ prefix for parse_ctx and parse_id Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 23/60] perf metrictroup: Split the metricgroup__add_metric function Arnaldo Carvalho de Melo
                   ` (38 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Alexander Shishkin, Andi Kleen,
	Anju T Sudhakar, Benjamin Herrenschmidt, Greg Kroah-Hartman,
	Jin Yao, Joe Mario, Kajol Jain, Kan Liang, Madhavan Srinivasan,
	Mamatha Inamdar, Mark Rutland, Michael Ellerman, Michael Petlan,
	Paul Mackerras, Peter Zijlstra, Ravi Bangoria,
	Sukadev Bhattiprolu, linuxppc-dev, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Add the expr_scanner_ctx object to hold user data for the expr scanner.
Currently it holds only start_token, Kajol Jain will use it to hold 24x7
runtime param.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
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: Kajol Jain <kjain@linux.ibm.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-3-kjain@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/expr.c |  6 ++++--
 tools/perf/util/expr.h |  4 ++++
 tools/perf/util/expr.l | 10 +++++-----
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
index c8ccc548a585..c3382d58cf40 100644
--- a/tools/perf/util/expr.c
+++ b/tools/perf/util/expr.c
@@ -3,7 +3,6 @@
 #include <assert.h>
 #include "expr.h"
 #include "expr-bison.h"
-#define YY_EXTRA_TYPE int
 #include "expr-flex.h"
 
 #ifdef PARSER_DEBUG
@@ -30,11 +29,14 @@ static int
 __expr__parse(double *val, struct expr_parse_ctx *ctx, const char *expr,
 	      int start)
 {
+	struct expr_scanner_ctx scanner_ctx = {
+		.start_token = start,
+	};
 	YY_BUFFER_STATE buffer;
 	void *scanner;
 	int ret;
 
-	ret = expr_lex_init_extra(start, &scanner);
+	ret = expr_lex_init_extra(&scanner_ctx, &scanner);
 	if (ret)
 		return ret;
 
diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
index b9e53f2b5844..0938ad166ece 100644
--- a/tools/perf/util/expr.h
+++ b/tools/perf/util/expr.h
@@ -15,6 +15,10 @@ struct expr_parse_ctx {
 	struct expr_parse_id ids[MAX_PARSE_ID];
 };
 
+struct expr_scanner_ctx {
+	int start_token;
+};
+
 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);
diff --git a/tools/perf/util/expr.l b/tools/perf/util/expr.l
index eaad29243c23..2582c2464938 100644
--- a/tools/perf/util/expr.l
+++ b/tools/perf/util/expr.l
@@ -76,13 +76,13 @@ sym		[0-9a-zA-Z_\.:@]+
 symbol		{spec}*{sym}*{spec}*{sym}*
 
 %%
-	{
-		int start_token;
+	struct expr_scanner_ctx *sctx = expr_get_extra(yyscanner);
 
-		start_token = expr_get_extra(yyscanner);
+	{
+		int start_token = sctx->start_token;
 
-		if (start_token) {
-			expr_set_extra(NULL, yyscanner);
+		if (sctx->start_token) {
+			sctx->start_token = 0;
 			return start_token;
 		}
 	}
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 23/60] perf metrictroup: Split the metricgroup__add_metric function
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (21 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 22/60] perf expr: Add expr_scanner_ctx object Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 24/60] perf script: Add flamegraph.py script Arnaldo Carvalho de Melo
                   ` (37 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, 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, Paul Mackerras, Peter Zijlstra,
	Ravi Bangoria, Sukadev Bhattiprolu, linuxppc-dev,
	Arnaldo Carvalho de Melo

From: Kajol Jain <kjain@linux.ibm.com>

This patch refactors metricgroup__add_metric function where some part of
it move to function metricgroup__add_metric_param.  No logic change.

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-4-kjain@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/metricgroup.c | 60 ++++++++++++++++++++---------------
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 926449a7cdbf..7ad81c8177ea 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -485,6 +485,39 @@ static bool metricgroup__has_constraint(struct pmu_event *pe)
 	return false;
 }
 
+static int __metricgroup__add_metric(struct strbuf *events,
+			struct list_head *group_list, struct pmu_event *pe)
+{
+
+	const char **ids;
+	int idnum;
+	struct egroup *eg;
+
+	if (expr__find_other(pe->metric_expr, NULL, &ids, &idnum) < 0)
+		return -EINVAL;
+
+	if (events->len > 0)
+		strbuf_addf(events, ",");
+
+	if (metricgroup__has_constraint(pe))
+		metricgroup__add_metric_non_group(events, ids, idnum);
+	else
+		metricgroup__add_metric_weak_group(events, ids, idnum);
+
+	eg = malloc(sizeof(*eg));
+	if (!eg)
+		return -ENOMEM;
+
+	eg->ids = ids;
+	eg->idnum = idnum;
+	eg->metric_name = pe->metric_name;
+	eg->metric_expr = pe->metric_expr;
+	eg->metric_unit = pe->unit;
+	list_add_tail(&eg->nd, group_list);
+
+	return 0;
+}
+
 static int metricgroup__add_metric(const char *metric, struct strbuf *events,
 				   struct list_head *group_list)
 {
@@ -504,35 +537,12 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,
 			continue;
 		if (match_metric(pe->metric_group, metric) ||
 		    match_metric(pe->metric_name, metric)) {
-			const char **ids;
-			int idnum;
-			struct egroup *eg;
 
 			pr_debug("metric expr %s for %s\n", pe->metric_expr, pe->metric_name);
 
-			if (expr__find_other(pe->metric_expr,
-					     NULL, &ids, &idnum) < 0)
-				continue;
-			if (events->len > 0)
-				strbuf_addf(events, ",");
-
-			if (metricgroup__has_constraint(pe))
-				metricgroup__add_metric_non_group(events, ids, idnum);
-			else
-				metricgroup__add_metric_weak_group(events, ids, idnum);
-
-			eg = malloc(sizeof(struct egroup));
-			if (!eg) {
-				ret = -ENOMEM;
+			ret = __metricgroup__add_metric(events,	group_list, pe);
+			if (ret == -ENOMEM)
 				break;
-			}
-			eg->ids = ids;
-			eg->idnum = idnum;
-			eg->metric_name = pe->metric_name;
-			eg->metric_expr = pe->metric_expr;
-			eg->metric_unit = pe->unit;
-			list_add_tail(&eg->nd, group_list);
-			ret = 0;
 		}
 	}
 	return ret;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 24/60] perf script: Add flamegraph.py script
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (22 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 23/60] perf metrictroup: Split the metricgroup__add_metric function Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 25/60] perf auxtrace: Add ->evsel_is_auxtrace() callback Arnaldo Carvalho de Melo
                   ` (36 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Andreas Gerstmayr, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Mark Rutland, Peter Zijlstra,
	Brendan Gregg, Martin Spier

From: Andreas Gerstmayr <agerstmayr@redhat.com>

This script works in tandem with d3-flame-graph to generate flame graphs
from perf. It supports two output formats: JSON and HTML (the default).
The HTML format will look for a standalone d3-flame-graph template file
in /usr/share/d3-flame-graph/d3-flamegraph-base.html and fill in the
collected stacks.

Usage:

    perf record -a -g -F 99 sleep 60
    perf script report flamegraph

Combined:

    perf script flamegraph -a -F 99 sleep 60

Committer testing:

Tested both with "PYTHON=python3" and with the default, that uses
python2-devel:

Complete set of instructions:

  $ mkdir /tmp/build/perf
  $ make PYTHON=python3 -C tools/perf O=/tmp/build/perf install-bin
  $ export PATH=~/bin:$PATH
  $ perf record -a -g -F 99 sleep 60
  $ perf script report flamegraph

Now go and open the generated flamegraph.html file in a browser.

At first this required building with PYTHON=python3, but after I
reported this Andreas was kind enough to send a patch making it work
with both python and python3.

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.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: Brendan Gregg <bgregg@netflix.com>
Cc: Martin Spier <mspier@netflix.com>
Link: http://lore.kernel.org/lkml/20200320151355.66302-1-agerstmayr@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../perf/scripts/python/bin/flamegraph-record |   2 +
 .../perf/scripts/python/bin/flamegraph-report |   3 +
 tools/perf/scripts/python/flamegraph.py       | 124 ++++++++++++++++++
 3 files changed, 129 insertions(+)
 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

diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record
new file mode 100755
index 000000000000..725d66e71570
--- /dev/null
+++ b/tools/perf/scripts/python/bin/flamegraph-record
@@ -0,0 +1,2 @@
+#!/usr/bin/sh
+perf record -g "$@"
diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report
new file mode 100755
index 000000000000..b1a79afd903b
--- /dev/null
+++ b/tools/perf/scripts/python/bin/flamegraph-report
@@ -0,0 +1,3 @@
+#!/usr/bin/sh
+# description: create flame graphs
+perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@"
diff --git a/tools/perf/scripts/python/flamegraph.py b/tools/perf/scripts/python/flamegraph.py
new file mode 100755
index 000000000000..61f3be9add6b
--- /dev/null
+++ b/tools/perf/scripts/python/flamegraph.py
@@ -0,0 +1,124 @@
+# flamegraph.py - create flame graphs from perf samples
+# SPDX-License-Identifier: GPL-2.0
+#
+# Usage:
+#
+#     perf record -a -g -F 99 sleep 60
+#     perf script report flamegraph
+#
+# Combined:
+#
+#     perf script flamegraph -a -F 99 sleep 60
+#
+# Written by Andreas Gerstmayr <agerstmayr@redhat.com>
+# Flame Graphs invented by Brendan Gregg <bgregg@netflix.com>
+# Works in tandem with d3-flame-graph by Martin Spier <mspier@netflix.com>
+
+from __future__ import print_function
+import sys
+import os
+import argparse
+import json
+
+
+class Node:
+    def __init__(self, name, libtype=""):
+        self.name = name
+        self.libtype = libtype
+        self.value = 0
+        self.children = []
+
+    def toJSON(self):
+        return {
+            "n": self.name,
+            "l": self.libtype,
+            "v": self.value,
+            "c": self.children
+        }
+
+
+class FlameGraphCLI:
+    def __init__(self, args):
+        self.args = args
+        self.stack = Node("root")
+
+        if self.args.format == "html" and \
+                not os.path.isfile(self.args.template):
+            print("Flame Graph template {} does not exist. Please install "
+                  "the js-d3-flame-graph (RPM) or libjs-d3-flame-graph (deb) "
+                  "package, specify an existing flame graph template "
+                  "(--template PATH) or another output format "
+                  "(--format FORMAT).".format(self.args.template),
+                  file=sys.stderr)
+            sys.exit(1)
+
+    def find_or_create_node(self, node, name, dso):
+        libtype = "kernel" if dso == "[kernel.kallsyms]" else ""
+        if name is None:
+            name = "[unknown]"
+
+        for child in node.children:
+            if child.name == name and child.libtype == libtype:
+                return child
+
+        child = Node(name, libtype)
+        node.children.append(child)
+        return child
+
+    def process_event(self, event):
+        node = self.find_or_create_node(self.stack, event["comm"], None)
+        if "callchain" in event:
+            for entry in reversed(event['callchain']):
+                node = self.find_or_create_node(
+                    node, entry.get("sym", {}).get("name"), event.get("dso"))
+        else:
+            node = self.find_or_create_node(
+                node, entry.get("symbol"), event.get("dso"))
+        node.value += 1
+
+    def trace_end(self):
+        json_str = json.dumps(self.stack, default=lambda x: x.toJSON())
+
+        if self.args.format == "html":
+            try:
+                with open(self.args.template) as f:
+                    output_str = f.read().replace("/** @flamegraph_json **/",
+                                                  json_str)
+            except IOError as e:
+                print("Error reading template file: {}".format(e), file=sys.stderr)
+                sys.exit(1)
+            output_fn = self.args.output or "flamegraph.html"
+        else:
+            output_str = json_str
+            output_fn = self.args.output or "stacks.json"
+
+        if output_fn == "-":
+            sys.stdout.write(output_str)
+        else:
+            print("dumping data to {}".format(output_fn))
+            try:
+                with open(output_fn, "w") as out:
+                    out.write(output_str)
+            except IOError as e:
+                print("Error writing output file: {}".format(e), file=sys.stderr)
+                sys.exit(1)
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(description="Create flame graphs.")
+    parser.add_argument("-f", "--format",
+                        default="html", choices=["json", "html"],
+                        help="output file format")
+    parser.add_argument("-o", "--output",
+                        help="output file name")
+    parser.add_argument("--template",
+                        default="/usr/share/d3-flame-graph/d3-flamegraph-base.html",
+                        help="path to flamegraph HTML template")
+    parser.add_argument("-i", "--input",
+                        help=argparse.SUPPRESS)
+
+    args = parser.parse_args()
+    cli = FlameGraphCLI(args)
+
+    process_event = cli.process_event
+    trace_end = cli.trace_end
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 25/60] perf auxtrace: Add ->evsel_is_auxtrace() callback
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (23 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 24/60] perf script: Add flamegraph.py script Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 26/60] perf intel-pt: Implement " Arnaldo Carvalho de Melo
                   ` (35 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Kim Phillips, Mathieu Poirier, Thomas Richter,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Add ->evsel_is_auxtrace() callback to identify if a selected event
is an AUX area event.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kim Phillips <kim.phillips@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20200401101613.6201-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/auxtrace.c |  9 +++++++++
 tools/perf/util/auxtrace.h | 12 ++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 3571ce72ca28..2c4ad6838766 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -2577,3 +2577,12 @@ void auxtrace__free(struct perf_session *session)
 
 	return session->auxtrace->free(session);
 }
+
+bool auxtrace__evsel_is_auxtrace(struct perf_session *session,
+				 struct evsel *evsel)
+{
+	if (!session->auxtrace || !session->auxtrace->evsel_is_auxtrace)
+		return false;
+
+	return session->auxtrace->evsel_is_auxtrace(session, evsel);
+}
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index e58ef160b599..db65aae5c2ea 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -21,6 +21,7 @@
 union perf_event;
 struct perf_session;
 struct evlist;
+struct evsel;
 struct perf_tool;
 struct mmap;
 struct perf_sample;
@@ -166,6 +167,8 @@ struct auxtrace {
 			    struct perf_tool *tool);
 	void (*free_events)(struct perf_session *session);
 	void (*free)(struct perf_session *session);
+	bool (*evsel_is_auxtrace)(struct perf_session *session,
+				  struct evsel *evsel);
 };
 
 /**
@@ -584,6 +587,8 @@ void auxtrace__dump_auxtrace_sample(struct perf_session *session,
 int auxtrace__flush_events(struct perf_session *session, struct perf_tool *tool);
 void auxtrace__free_events(struct perf_session *session);
 void auxtrace__free(struct perf_session *session);
+bool auxtrace__evsel_is_auxtrace(struct perf_session *session,
+				 struct evsel *evsel);
 
 #define ITRACE_HELP \
 "				i:	    		synthesize instructions events\n"		\
@@ -749,6 +754,13 @@ void auxtrace_index__free(struct list_head *head __maybe_unused)
 {
 }
 
+static inline
+bool auxtrace__evsel_is_auxtrace(struct perf_session *session __maybe_unused,
+				 struct evsel *evsel __maybe_unused)
+{
+	return false;
+}
+
 static inline
 int auxtrace_parse_filters(struct evlist *evlist __maybe_unused)
 {
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 26/60] perf intel-pt: Implement ->evsel_is_auxtrace() callback
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (24 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 25/60] perf auxtrace: Add ->evsel_is_auxtrace() callback Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 27/60] perf intel-bts: " Arnaldo Carvalho de Melo
                   ` (34 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Implement ->evsel_is_auxtrace() callback.

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/20200401101613.6201-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 23c8289c2472..db25c77d82f3 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2715,6 +2715,15 @@ static void intel_pt_free(struct perf_session *session)
 	free(pt);
 }
 
+static bool intel_pt_evsel_is_auxtrace(struct perf_session *session,
+				       struct evsel *evsel)
+{
+	struct intel_pt *pt = container_of(session->auxtrace, struct intel_pt,
+					   auxtrace);
+
+	return evsel->core.attr.type == pt->pmu_type;
+}
+
 static int intel_pt_process_auxtrace_event(struct perf_session *session,
 					   union perf_event *event,
 					   struct perf_tool *tool __maybe_unused)
@@ -3310,6 +3319,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	pt->auxtrace.flush_events = intel_pt_flush;
 	pt->auxtrace.free_events = intel_pt_free_events;
 	pt->auxtrace.free = intel_pt_free;
+	pt->auxtrace.evsel_is_auxtrace = intel_pt_evsel_is_auxtrace;
 	session->auxtrace = &pt->auxtrace;
 
 	if (dump_trace)
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 27/60] perf intel-bts: Implement ->evsel_is_auxtrace() callback
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (25 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 26/60] perf intel-pt: Implement " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 28/60] perf arm-spe: " Arnaldo Carvalho de Melo
                   ` (33 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Implement ->evsel_is_auxtrace() callback.

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/20200401101613.6201-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-bts.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c
index 34cb380d19a3..059e1c805ed0 100644
--- a/tools/perf/util/intel-bts.c
+++ b/tools/perf/util/intel-bts.c
@@ -728,6 +728,15 @@ static void intel_bts_free(struct perf_session *session)
 	free(bts);
 }
 
+static bool intel_bts_evsel_is_auxtrace(struct perf_session *session,
+					struct evsel *evsel)
+{
+	struct intel_bts *bts = container_of(session->auxtrace, struct intel_bts,
+					     auxtrace);
+
+	return evsel->core.attr.type == bts->pmu_type;
+}
+
 struct intel_bts_synth {
 	struct perf_tool dummy_tool;
 	struct perf_session *session;
@@ -883,6 +892,7 @@ int intel_bts_process_auxtrace_info(union perf_event *event,
 	bts->auxtrace.flush_events = intel_bts_flush;
 	bts->auxtrace.free_events = intel_bts_free_events;
 	bts->auxtrace.free = intel_bts_free;
+	bts->auxtrace.evsel_is_auxtrace = intel_bts_evsel_is_auxtrace;
 	session->auxtrace = &bts->auxtrace;
 
 	intel_bts_print_info(&auxtrace_info->priv[0], INTEL_BTS_PMU_TYPE,
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 28/60] perf arm-spe: Implement ->evsel_is_auxtrace() callback
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (26 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 27/60] perf intel-bts: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 29/60] perf cs-etm: " Arnaldo Carvalho de Melo
                   ` (32 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Leo Yan, Andi Kleen, Jiri Olsa,
	Kim Phillips, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Implement ->evsel_is_auxtrace() callback.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kim Phillips <kim.phillips@arm.com>
Link: http://lore.kernel.org/lkml/20200401101613.6201-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/arm-spe.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index 53be12b23ff4..875a0dd540e5 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -176,6 +176,14 @@ static void arm_spe_free(struct perf_session *session)
 	free(spe);
 }
 
+static bool arm_spe_evsel_is_auxtrace(struct perf_session *session,
+				      struct evsel *evsel)
+{
+	struct arm_spe *spe = container_of(session->auxtrace, struct arm_spe, auxtrace);
+
+	return evsel->core.attr.type == spe->pmu_type;
+}
+
 static const char * const arm_spe_info_fmts[] = {
 	[ARM_SPE_PMU_TYPE]		= "  PMU Type           %"PRId64"\n",
 };
@@ -218,6 +226,7 @@ int arm_spe_process_auxtrace_info(union perf_event *event,
 	spe->auxtrace.flush_events = arm_spe_flush;
 	spe->auxtrace.free_events = arm_spe_free_events;
 	spe->auxtrace.free = arm_spe_free;
+	spe->auxtrace.evsel_is_auxtrace = arm_spe_evsel_is_auxtrace;
 	session->auxtrace = &spe->auxtrace;
 
 	arm_spe_print_info(&auxtrace_info->priv[0]);
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 29/60] perf cs-etm: Implement ->evsel_is_auxtrace() callback
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (27 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 28/60] perf arm-spe: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 30/60] perf s390-cpumsf: " Arnaldo Carvalho de Melo
                   ` (31 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Mathieu Poirier, Andi Kleen,
	Jiri Olsa, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Implement ->evsel_is_auxtrace() callback.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200401101613.6201-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/cs-etm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 62d2f9b9ce1b..3c802fde4954 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -631,6 +631,16 @@ static void cs_etm__free(struct perf_session *session)
 	zfree(&aux);
 }
 
+static bool cs_etm__evsel_is_auxtrace(struct perf_session *session,
+				      struct evsel *evsel)
+{
+	struct cs_etm_auxtrace *aux = container_of(session->auxtrace,
+						   struct cs_etm_auxtrace,
+						   auxtrace);
+
+	return evsel->core.attr.type == aux->pmu_type;
+}
+
 static u8 cs_etm__cpu_mode(struct cs_etm_queue *etmq, u64 address)
 {
 	struct machine *machine;
@@ -2618,6 +2628,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
 	etm->auxtrace.flush_events = cs_etm__flush_events;
 	etm->auxtrace.free_events = cs_etm__free_events;
 	etm->auxtrace.free = cs_etm__free;
+	etm->auxtrace.evsel_is_auxtrace = cs_etm__evsel_is_auxtrace;
 	session->auxtrace = &etm->auxtrace;
 
 	etm->unknown_thread = thread__new(999999999, 999999999);
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 30/60] perf s390-cpumsf: Implement ->evsel_is_auxtrace() callback
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (28 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 29/60] perf cs-etm: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 31/60] perf auxtrace: For reporting purposes, un-group AUX area event Arnaldo Carvalho de Melo
                   ` (30 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Thomas Richter, Andi Kleen,
	Jiri Olsa, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Implement ->evsel_is_auxtrace() callback.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200401101613.6201-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/s390-cpumcf-kernel.h | 1 +
 tools/perf/util/s390-cpumsf.c        | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/tools/perf/util/s390-cpumcf-kernel.h b/tools/perf/util/s390-cpumcf-kernel.h
index d4356030b504..f55ca07f3ca1 100644
--- a/tools/perf/util/s390-cpumcf-kernel.h
+++ b/tools/perf/util/s390-cpumcf-kernel.h
@@ -11,6 +11,7 @@
 
 #define	S390_CPUMCF_DIAG_DEF	0xfeef	/* Counter diagnostic entry ID */
 #define	PERF_EVENT_CPUM_CF_DIAG	0xBC000	/* Event: Counter sets */
+#define PERF_EVENT_CPUM_SF_DIAG	0xBD000 /* Event: Combined-sampling */
 
 struct cf_ctrset_entry {	/* CPU-M CF counter set entry (8 byte) */
 	unsigned int def:16;	/* 0-15  Data Entry Format */
diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c
index 6785cd87aa4d..d7779e48652f 100644
--- a/tools/perf/util/s390-cpumsf.c
+++ b/tools/perf/util/s390-cpumsf.c
@@ -1047,6 +1047,14 @@ static void s390_cpumsf_free(struct perf_session *session)
 	free(sf);
 }
 
+static bool
+s390_cpumsf_evsel_is_auxtrace(struct perf_session *session __maybe_unused,
+			      struct evsel *evsel)
+{
+	return evsel->core.attr.type == PERF_TYPE_RAW &&
+	       evsel->core.attr.config == PERF_EVENT_CPUM_SF_DIAG;
+}
+
 static int s390_cpumsf_get_type(const char *cpuid)
 {
 	int ret, family = 0;
@@ -1142,6 +1150,7 @@ int s390_cpumsf_process_auxtrace_info(union perf_event *event,
 	sf->auxtrace.flush_events = s390_cpumsf_flush;
 	sf->auxtrace.free_events = s390_cpumsf_free_events;
 	sf->auxtrace.free = s390_cpumsf_free;
+	sf->auxtrace.evsel_is_auxtrace = s390_cpumsf_evsel_is_auxtrace;
 	session->auxtrace = &sf->auxtrace;
 
 	if (dump_trace)
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 31/60] perf auxtrace: For reporting purposes, un-group AUX area event
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (29 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 30/60] perf s390-cpumsf: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 32/60] perf auxtrace: Add an option to synthesize callchains for regular events Arnaldo Carvalho de Melo
                   ` (29 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

An AUX area event must be the group leader when recording traces in
sample mode, but that does not produce the expected results from
'perf report' because it expects the leader to provide samples.

Rather than teach 'perf report' about AUX area sampling, un-group the
AUX area event during processing, making the 2nd event the leader.

Example:

 $ perf record -e '{intel_pt//u,branch-misses:u}' -c 1 uname
 Linux
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.080 MB perf.data ]

 Before:

 $ perf report

 Samples: 800  of events 'anon group { intel_pt//u, branch-misses:u }', Event count (approx.): 800
        Children              Self  Command  Shared Object     Symbol
     0.00%  47.50%     0.00%  47.50%  uname    libc-2.28.so      [.] _dl_addr
     0.00%  16.38%     0.00%  16.38%  uname    ld-2.28.so        [.] __GI___tunables_init
     0.00%  54.75%     0.00%   4.75%  uname    ld-2.28.so        [.] dl_main
     0.00%   3.12%     0.00%   3.12%  uname    ld-2.28.so        [.] _dl_map_object_from_fd
     0.00%   2.38%     0.00%   2.38%  uname    ld-2.28.so        [.] strcmp
     0.00%   2.25%     0.00%   2.25%  uname    ld-2.28.so        [.] _dl_check_map_versions
     0.00%   2.00%     0.00%   2.00%  uname    ld-2.28.so        [.] _dl_important_hwcaps
     0.00%   2.00%     0.00%   2.00%  uname    ld-2.28.so        [.] _dl_map_object_deps
     0.00%  51.50%     0.00%   1.50%  uname    ld-2.28.so        [.] _dl_sysdep_start
     0.00%   1.25%     0.00%   1.25%  uname    ld-2.28.so        [.] _dl_load_cache_lookup
     0.00%  51.12%     0.00%   1.12%  uname    ld-2.28.so        [.] _dl_start
     0.00%  50.88%     0.00%   1.12%  uname    ld-2.28.so        [.] do_lookup_x
     0.00%  50.62%     0.00%   1.00%  uname    ld-2.28.so        [.] _dl_lookup_symbol_x
     0.00%   1.00%     0.00%   1.00%  uname    ld-2.28.so        [.] _dl_map_object
     0.00%   1.00%     0.00%   1.00%  uname    ld-2.28.so        [.] _dl_next_ld_env_entry
     0.00%   0.88%     0.00%   0.88%  uname    ld-2.28.so        [.] _dl_cache_libcmp
     0.00%   0.88%     0.00%   0.88%  uname    ld-2.28.so        [.] _dl_new_object
     0.00%  50.88%     0.00%   0.88%  uname    ld-2.28.so        [.] _dl_relocate_object
     0.00%   0.62%     0.00%   0.62%  uname    ld-2.28.so        [.] _dl_init_paths
     0.00%   0.62%     0.00%   0.62%  uname    ld-2.28.so        [.] _dl_name_match_p
     0.00%   0.50%     0.00%   0.50%  uname    ld-2.28.so        [.] get_common_indeces.constprop.1
     0.00%   0.50%     0.00%   0.50%  uname    ld-2.28.so        [.] memmove
     0.00%   0.50%     0.00%   0.50%  uname    ld-2.28.so        [.] memset
     0.00%   0.50%     0.00%   0.50%  uname    ld-2.28.so        [.] open_verify.constprop.11
     0.00%   0.38%     0.00%   0.38%  uname    ld-2.28.so        [.] _dl_check_all_versions
     0.00%   0.38%     0.00%   0.38%  uname    ld-2.28.so        [.] _dl_find_dso_for_object
     0.00%   0.38%     0.00%   0.38%  uname    ld-2.28.so        [.] init_tls
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] __tunable_get_val
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] _dl_add_to_namespace_list
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] _dl_determine_tlsoffset
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] _dl_discover_osversion
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] calloc@plt
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] malloc
     0.00%   0.25%     0.00%   0.25%  uname    ld-2.28.so        [.] malloc@plt
     0.00%   0.25%     0.00%   0.25%  uname    libc-2.28.so      [.] _nl_load_locale_from_archive
     0.00%   0.25%     0.00%   0.25%  uname    [unknown]         [k] 0xffffffffa3a00010
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] __libc_scratch_buffer_set_array_size
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] _dl_allocate_tls_storage
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] _dl_catch_exception
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] _dl_setup_hash
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] _dl_sort_maps
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] _dl_sysdep_read_whole_file
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] access
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] calloc
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] mmap64
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] openaux
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] rtld_lock_default_lock_recursive
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] rtld_lock_default_unlock_recursive
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] strchr
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] strlen
     0.00%   0.12%     0.00%   0.12%  uname    ld-2.28.so        [.] 0x0000000000001080
     0.00%   0.12%     0.00%   0.12%  uname    libc-2.28.so      [.] __strchrnul_avx2
     0.00%   0.12%     0.00%   0.12%  uname    libc-2.28.so      [.] _nl_normalize_codeset
     0.00%   0.12%     0.00%   0.12%  uname    libc-2.28.so      [.] malloc
     0.00%   0.12%     0.00%   0.12%  uname    [unknown]         [k] 0xffffffffa3a011f0
     0.00%  50.00%     0.00%   0.00%  uname    ld-2.28.so        [.] _dl_start_user
     0.00%  50.00%     0.00%   0.00%  uname    [unknown]         [.] 0000000000000000

 After:

 Samples: 800  of event 'branch-misses:u', Event count (approx.): 800
  Children      Self  Command  Shared Object     Symbol
    54.75%     4.75%  uname    ld-2.28.so        [.] dl_main
    51.50%     1.50%  uname    ld-2.28.so        [.] _dl_sysdep_start
    51.12%     1.12%  uname    ld-2.28.so        [.] _dl_start
    50.88%     0.88%  uname    ld-2.28.so        [.] _dl_relocate_object
    50.88%     1.12%  uname    ld-2.28.so        [.] do_lookup_x
    50.62%     1.00%  uname    ld-2.28.so        [.] _dl_lookup_symbol_x
    50.00%     0.00%  uname    ld-2.28.so        [.] _dl_start_user
    50.00%     0.00%  uname    [unknown]         [.] 0000000000000000
    47.50%    47.50%  uname    libc-2.28.so      [.] _dl_addr
    16.38%    16.38%  uname    ld-2.28.so        [.] __GI___tunables_init
     3.12%     3.12%  uname    ld-2.28.so        [.] _dl_map_object_from_fd
     2.38%     2.38%  uname    ld-2.28.so        [.] strcmp
     2.25%     2.25%  uname    ld-2.28.so        [.] _dl_check_map_versions
     2.00%     2.00%  uname    ld-2.28.so        [.] _dl_important_hwcaps
     2.00%     2.00%  uname    ld-2.28.so        [.] _dl_map_object_deps
     1.25%     1.25%  uname    ld-2.28.so        [.] _dl_load_cache_lookup
     1.00%     1.00%  uname    ld-2.28.so        [.] _dl_map_object
     1.00%     1.00%  uname    ld-2.28.so        [.] _dl_next_ld_env_entry
     0.88%     0.88%  uname    ld-2.28.so        [.] _dl_cache_libcmp
     0.88%     0.88%  uname    ld-2.28.so        [.] _dl_new_object
     0.62%     0.62%  uname    ld-2.28.so        [.] _dl_init_paths
     0.62%     0.62%  uname    ld-2.28.so        [.] _dl_name_match_p
     0.50%     0.50%  uname    ld-2.28.so        [.] get_common_indeces.constprop.1
     0.50%     0.50%  uname    ld-2.28.so        [.] memmove
     0.50%     0.50%  uname    ld-2.28.so        [.] memset
     0.50%     0.50%  uname    ld-2.28.so        [.] open_verify.constprop.11
     0.38%     0.38%  uname    ld-2.28.so        [.] _dl_check_all_versions
     0.38%     0.38%  uname    ld-2.28.so        [.] _dl_find_dso_for_object
     0.38%     0.38%  uname    ld-2.28.so        [.] init_tls
     0.25%     0.25%  uname    ld-2.28.so        [.] __tunable_get_val
     0.25%     0.25%  uname    ld-2.28.so        [.] _dl_add_to_namespace_list
     0.25%     0.25%  uname    ld-2.28.so        [.] _dl_determine_tlsoffset
     0.25%     0.25%  uname    ld-2.28.so        [.] _dl_discover_osversion
     0.25%     0.25%  uname    ld-2.28.so        [.] calloc@plt
     0.25%     0.25%  uname    ld-2.28.so        [.] malloc
     0.25%     0.25%  uname    ld-2.28.so        [.] malloc@plt
     0.25%     0.25%  uname    libc-2.28.so      [.] _nl_load_locale_from_archive
     0.25%     0.25%  uname    [unknown]         [k] 0xffffffffa3a00010
     0.12%     0.12%  uname    ld-2.28.so        [.] __libc_scratch_buffer_set_array_size
     0.12%     0.12%  uname    ld-2.28.so        [.] _dl_allocate_tls_storage
     0.12%     0.12%  uname    ld-2.28.so        [.] _dl_catch_exception
     0.12%     0.12%  uname    ld-2.28.so        [.] _dl_setup_hash
     0.12%     0.12%  uname    ld-2.28.so        [.] _dl_sort_maps
     0.12%     0.12%  uname    ld-2.28.so        [.] _dl_sysdep_read_whole_file
     0.12%     0.12%  uname    ld-2.28.so        [.] access
     0.12%     0.12%  uname    ld-2.28.so        [.] calloc
     0.12%     0.12%  uname    ld-2.28.so        [.] mmap64
     0.12%     0.12%  uname    ld-2.28.so        [.] openaux
     0.12%     0.12%  uname    ld-2.28.so        [.] rtld_lock_default_lock_recursive
     0.12%     0.12%  uname    ld-2.28.so        [.] rtld_lock_default_unlock_recursive
     0.12%     0.12%  uname    ld-2.28.so        [.] strchr
     0.12%     0.12%  uname    ld-2.28.so        [.] strlen
     0.12%     0.12%  uname    ld-2.28.so        [.] 0x0000000000001080
     0.12%     0.12%  uname    libc-2.28.so      [.] __strchrnul_avx2
     0.12%     0.12%  uname    libc-2.28.so      [.] _nl_normalize_codeset
     0.12%     0.12%  uname    libc-2.28.so      [.] malloc
     0.12%     0.12%  uname    [unknown]         [k] 0xffffffffa3a011f0

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/20200401101613.6201-8-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/auxtrace.c | 60 ++++++++++++++++++++++++++++++++++----
 1 file changed, 55 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 2c4ad6838766..b60bae8e395c 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -1234,29 +1234,79 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,
 	return err;
 }
 
+static void unleader_evsel(struct evlist *evlist, struct evsel *leader)
+{
+	struct evsel *new_leader = NULL;
+	struct evsel *evsel;
+
+	/* Find new leader for the group */
+	evlist__for_each_entry(evlist, evsel) {
+		if (evsel->leader != leader || evsel == leader)
+			continue;
+		if (!new_leader)
+			new_leader = evsel;
+		evsel->leader = new_leader;
+	}
+
+	/* Update group information */
+	if (new_leader) {
+		zfree(&new_leader->group_name);
+		new_leader->group_name = leader->group_name;
+		leader->group_name = NULL;
+
+		new_leader->core.nr_members = leader->core.nr_members - 1;
+		leader->core.nr_members = 1;
+	}
+}
+
+static void unleader_auxtrace(struct perf_session *session)
+{
+	struct evsel *evsel;
+
+	evlist__for_each_entry(session->evlist, evsel) {
+		if (auxtrace__evsel_is_auxtrace(session, evsel) &&
+		    perf_evsel__is_group_leader(evsel)) {
+			unleader_evsel(session->evlist, evsel);
+		}
+	}
+}
+
 int perf_event__process_auxtrace_info(struct perf_session *session,
 				      union perf_event *event)
 {
 	enum auxtrace_type type = event->auxtrace_info.type;
+	int err;
 
 	if (dump_trace)
 		fprintf(stdout, " type: %u\n", type);
 
 	switch (type) {
 	case PERF_AUXTRACE_INTEL_PT:
-		return intel_pt_process_auxtrace_info(event, session);
+		err = intel_pt_process_auxtrace_info(event, session);
+		break;
 	case PERF_AUXTRACE_INTEL_BTS:
-		return intel_bts_process_auxtrace_info(event, session);
+		err = intel_bts_process_auxtrace_info(event, session);
+		break;
 	case PERF_AUXTRACE_ARM_SPE:
-		return arm_spe_process_auxtrace_info(event, session);
+		err = arm_spe_process_auxtrace_info(event, session);
+		break;
 	case PERF_AUXTRACE_CS_ETM:
-		return cs_etm__process_auxtrace_info(event, session);
+		err = cs_etm__process_auxtrace_info(event, session);
+		break;
 	case PERF_AUXTRACE_S390_CPUMSF:
-		return s390_cpumsf_process_auxtrace_info(event, session);
+		err = s390_cpumsf_process_auxtrace_info(event, session);
+		break;
 	case PERF_AUXTRACE_UNKNOWN:
 	default:
 		return -EINVAL;
 	}
+
+	if (err)
+		return err;
+
+	unleader_auxtrace(session);
+
+	return 0;
 }
 
 s64 perf_event__process_auxtrace(struct perf_session *session,
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 32/60] perf auxtrace: Add an option to synthesize callchains for regular events
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (30 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 31/60] perf auxtrace: For reporting purposes, un-group AUX area event Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 33/60] perf thread-stack: Add thread_stack__sample_late() Arnaldo Carvalho de Melo
                   ` (28 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Currently, callchains can be synthesized only for synthesized events. Add
an itrace option to synthesize callchains 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/20200401101613.6201-9-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/itrace.txt | 1 +
 tools/perf/builtin-report.c         | 3 ++-
 tools/perf/builtin-script.c         | 2 +-
 tools/perf/util/auxtrace.c          | 6 +++++-
 tools/perf/util/auxtrace.h          | 2 ++
 tools/perf/util/s390-cpumsf.c       | 2 +-
 6 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Documentation/itrace.txt b/tools/perf/Documentation/itrace.txt
index 82ff7dad40c2..671e154ede03 100644
--- a/tools/perf/Documentation/itrace.txt
+++ b/tools/perf/Documentation/itrace.txt
@@ -10,6 +10,7 @@
 		e	synthesize 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)
 		s       skip initial number of events
 
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 26d8fc27e427..c0cebd53ecf9 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -339,6 +339,7 @@ static int report__setup_sample_type(struct report *rep)
 	bool is_pipe = perf_data__is_pipe(session->data);
 
 	if (session->itrace_synth_opts->callchain ||
+	    session->itrace_synth_opts->add_callchain ||
 	    (!is_pipe &&
 	     perf_header__has_feat(&session->header, HEADER_AUXTRACE) &&
 	     !session->itrace_synth_opts->set))
@@ -1332,7 +1333,7 @@ int cmd_report(int argc, const char **argv)
 	if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
 		callchain_param.order = ORDER_CALLER;
 
-	if (itrace_synth_opts.callchain &&
+	if ((itrace_synth_opts.callchain || itrace_synth_opts.add_callchain) &&
 	    (int)itrace_synth_opts.callchain_sz > report.max_stack)
 		report.max_stack = itrace_synth_opts.callchain_sz;
 
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 8bf3ba280312..06b511c0a539 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -3537,7 +3537,7 @@ int cmd_script(int argc, const char **argv)
 		return -1;
 	}
 
-	if (itrace_synth_opts.callchain &&
+	if ((itrace_synth_opts.callchain || itrace_synth_opts.add_callchain) &&
 	    itrace_synth_opts.callchain_sz > scripting_max_stack)
 		scripting_max_stack = itrace_synth_opts.callchain_sz;
 
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index b60bae8e395c..809a09e75c55 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -1462,8 +1462,12 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
 			synth_opts->branches = true;
 			synth_opts->returns = true;
 			break;
+		case 'G':
 		case 'g':
-			synth_opts->callchain = true;
+			if (p[-1] == 'G')
+				synth_opts->add_callchain = true;
+			else
+				synth_opts->callchain = true;
 			synth_opts->callchain_sz =
 					PERF_ITRACE_DEFAULT_CALLCHAIN_SZ;
 			while (*p == ' ' || *p == ',')
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index db65aae5c2ea..dd8a4ff8209e 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -74,6 +74,7 @@ enum itrace_period_type {
  * @calls: limit branch samples to calls (can be combined with @returns)
  * @returns: limit branch samples to returns (can be combined with @calls)
  * @callchain: add callchain to 'instructions' events
+ * @add_callchain: add callchain to existing event records
  * @thread_stack: feed branches to the thread_stack
  * @last_branch: add branch context to 'instruction' events
  * @callchain_sz: maximum callchain size
@@ -101,6 +102,7 @@ struct itrace_synth_opts {
 	bool			calls;
 	bool			returns;
 	bool			callchain;
+	bool			add_callchain;
 	bool			thread_stack;
 	bool			last_branch;
 	unsigned int		callchain_sz;
diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c
index d7779e48652f..38a942881d1a 100644
--- a/tools/perf/util/s390-cpumsf.c
+++ b/tools/perf/util/s390-cpumsf.c
@@ -1079,7 +1079,7 @@ 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->last_branch || itops->add_callchain;
 	if (!ison)
 		return true;
 	pr_err("Unsupported --itrace options specified\n");
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 33/60] perf thread-stack: Add thread_stack__sample_late()
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (31 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 32/60] perf auxtrace: Add an option to synthesize callchains for regular events Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 34/60] perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set Arnaldo Carvalho de Melo
                   ` (27 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, 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 call chain 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/20200401101613.6201-10-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/thread-stack.c | 57 ++++++++++++++++++++++++++++++++++
 tools/perf/util/thread-stack.h |  3 ++
 2 files changed, 60 insertions(+)

diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c
index 0885967d5bc3..83f6c83f5617 100644
--- a/tools/perf/util/thread-stack.c
+++ b/tools/perf/util/thread-stack.c
@@ -497,6 +497,63 @@ void thread_stack__sample(struct thread *thread, int cpu,
 	chain->nr = i;
 }
 
+/*
+ * Hardware sample records, created some time after the event occurred, need to
+ * have subsequent addresses removed from the call chain.
+ */
+void thread_stack__sample_late(struct thread *thread, int cpu,
+			       struct ip_callchain *chain, size_t sz,
+			       u64 sample_ip, u64 kernel_start)
+{
+	struct thread_stack *ts = thread__stack(thread, cpu);
+	u64 sample_context = callchain_context(sample_ip, kernel_start);
+	u64 last_context, context, ip;
+	size_t nr = 0, j;
+
+	if (sz < 2) {
+		chain->nr = 0;
+		return;
+	}
+
+	if (!ts)
+		goto out;
+
+	/*
+	 * When tracing kernel space, kernel addresses occur at the top of the
+	 * call chain after the event occurred but before tracing stopped.
+	 * Skip them.
+	 */
+	for (j = 1; j <= ts->cnt; j++) {
+		ip = ts->stack[ts->cnt - j].ret_addr;
+		context = callchain_context(ip, kernel_start);
+		if (context == PERF_CONTEXT_USER ||
+		    (context == sample_context && ip == sample_ip))
+			break;
+	}
+
+	last_context = sample_ip; /* Use sample_ip as an invalid context */
+
+	for (; nr < sz && j <= ts->cnt; nr++, j++) {
+		ip = ts->stack[ts->cnt - j].ret_addr;
+		context = callchain_context(ip, kernel_start);
+		if (context != last_context) {
+			if (nr >= sz - 1)
+				break;
+			chain->ips[nr++] = context;
+			last_context = context;
+		}
+		chain->ips[nr] = ip;
+	}
+out:
+	if (nr) {
+		chain->nr = nr;
+	} else {
+		chain->ips[0] = sample_context;
+		chain->ips[1] = sample_ip;
+		chain->nr = 2;
+	}
+}
+
 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 e1ec5a58f1b2..8962ddc4e1ab 100644
--- a/tools/perf/util/thread-stack.h
+++ b/tools/perf/util/thread-stack.h
@@ -85,6 +85,9 @@ int thread_stack__event(struct thread *thread, int cpu, u32 flags, u64 from_ip,
 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);
 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] 130+ messages in thread

* [PATCH 34/60] perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (32 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 33/60] perf thread-stack: Add thread_stack__sample_late() Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 35/60] perf evsel: Add support for synthesized sample type Arnaldo Carvalho de Melo
                   ` (26 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Using 'type' variable for checking for callchains is equivalent to using
evsel__has_callchain(evsel) and is how the other PERF_SAMPLE_ bits are checked
in this function, so use it to be consistent.

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/20200401101613.6201-11-adrian.hunter@intel.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d23db6755f51..f320adaf1326 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2136,7 +2136,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event,
 		}
 	}
 
-	if (evsel__has_callchain(evsel)) {
+	if (type & PERF_SAMPLE_CALLCHAIN) {
 		const u64 max_callchain_nr = UINT64_MAX / sizeof(u64);
 
 		OVERFLOW_CHECK_u64(array);
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 35/60] perf evsel: Add support for synthesized sample type
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (33 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 34/60] perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 36/60] perf intel-pt: Add support for synthesizing callchains for regular events Arnaldo Carvalho de Melo
                   ` (25 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

For reporting purposes, an evsel sample can have a callchain synthesized
from AUX area data. Add support for keeping track of synthesized sample
types. Note, the recorded sample_type cannot be changed because it is
needed to continue to parse 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/20200401101613.6201-11-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 53187c501ee8..e64ed4202cab 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -104,6 +104,14 @@ struct evsel {
 		perf_evsel__sb_cb_t	*cb;
 		void			*data;
 	} side_band;
+	/*
+	 * For reporting purposes, an evsel sample can have a callchain
+	 * synthesized from AUX area data. Keep track of synthesized sample
+	 * types here. Note, the recorded sample_type cannot be changed because
+	 * it is needed to continue to parse events.
+	 * See also evsel__has_callchain().
+	 */
+	__u64			synth_sample_type;
 };
 
 struct perf_missing_features {
@@ -398,7 +406,12 @@ static inline bool perf_evsel__has_branch_hw_idx(const struct evsel *evsel)
 
 static inline bool evsel__has_callchain(const struct evsel *evsel)
 {
-	return (evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0;
+	/*
+	 * For reporting purposes, an evsel sample can have a recorded callchain
+	 * or a callchain synthesized from AUX area data.
+	 */
+	return evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN ||
+	       evsel->synth_sample_type & PERF_SAMPLE_CALLCHAIN;
 }
 
 struct perf_env *perf_evsel__env(struct evsel *evsel);
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 36/60] perf intel-pt: Add support for synthesizing callchains for regular events
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (34 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 35/60] perf evsel: Add support for synthesized sample type Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 37/60] perf evsel: Move and globalize perf_evsel__find_pmu() and perf_evsel__is_aux_event() Arnaldo Carvalho de Melo
                   ` (24 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Arnaldo Carvalho de Melo,
	Andi Kleen, Jiri Olsa

From: Adrian Hunter <adrian.hunter@intel.com>

Currently, callchains can be synthesized only for synthesized events.
Support also synthesizing callchains for regular events.

Example:

 # perf record --kcore --aux-sample -e '{intel_pt//,cycles}' -c 10000 uname
 Linux
 [ perf record: Woken up 3 times to write data ]
 [ perf record: Captured and wrote 0.532 MB perf.data ]
 # perf script --itrace=Ge | head -20
 uname  4864 2419025.358181:      10000     cycles:
        ffffffffbba56965 apparmor_bprm_committing_creds+0x35 ([kernel.kallsyms])
        ffffffffbc400cd5 __indirect_thunk_start+0x5 ([kernel.kallsyms])
        ffffffffbba07422 security_bprm_committing_creds+0x22 ([kernel.kallsyms])
        ffffffffbb89805d install_exec_creds+0xd ([kernel.kallsyms])
        ffffffffbb90d9ac load_elf_binary+0x3ac ([kernel.kallsyms])

 uname  4864 2419025.358185:      10000     cycles:
        ffffffffbba56db0 apparmor_bprm_committed_creds+0x20 ([kernel.kallsyms])
        ffffffffbc400cd5 __indirect_thunk_start+0x5 ([kernel.kallsyms])
        ffffffffbba07452 security_bprm_committed_creds+0x22 ([kernel.kallsyms])
        ffffffffbb89809a install_exec_creds+0x4a ([kernel.kallsyms])
        ffffffffbb90d9ac load_elf_binary+0x3ac ([kernel.kallsyms])

 uname  4864 2419025.358189:      10000     cycles:
        ffffffffbb86fdf6 vma_adjust_trans_huge+0x6 ([kernel.kallsyms])
        ffffffffbb821660 __vma_adjust+0x160 ([kernel.kallsyms])
        ffffffffbb897be7 shift_arg_pages+0x97 ([kernel.kallsyms])
        ffffffffbb897ed9 setup_arg_pages+0x1e9 ([kernel.kallsyms])
        ffffffffbb90d9f2 load_elf_binary+0x3f2 ([kernel.kallsyms])

Committer testing:

  # perf record --kcore --aux-sample -e '{intel_pt//,cycles}' -c 10000 uname
  Linux
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.233 MB perf.data ]
  #

Then, before this patch:

  # perf script --itrace=Ge | head -20
     uname 28642 168664.856384: 10000 cycles: ffffffff9810aeaa commit_creds+0x2a ([kernel.kallsyms])
     uname 28642 168664.856388: 10000 cycles: ffffffff982a24f1 mprotect_fixup+0x151 ([kernel.kallsyms])
     uname 28642 168664.856392: 10000 cycles: ffffffff982a385b move_page_tables+0xbcb ([kernel.kallsyms])
     uname 28642 168664.856396: 10000 cycles: ffffffff982fd4ec __mod_memcg_state+0x1c ([kernel.kallsyms])
     uname 28642 168664.856400: 10000 cycles: ffffffff9829fddd do_mmap+0xfd ([kernel.kallsyms])
     uname 28642 168664.856404: 10000 cycles: ffffffff9829c879 __vma_adjust+0x479 ([kernel.kallsyms])
     uname 28642 168664.856408: 10000 cycles: ffffffff98238e94 __perf_addr_filters_adjust+0x34 ([kernel.kallsyms])
     uname 28642 168664.856412: 10000 cycles: ffffffff98a38e0b down_write+0x1b ([kernel.kallsyms])
     uname 28642 168664.856416: 10000 cycles: ffffffff983006a0 memcg_kmem_get_cache+0x0 ([kernel.kallsyms])
     uname 28642 168664.856421: 10000 cycles: ffffffff98396eaf load_elf_binary+0x92f ([kernel.kallsyms])
     uname 28642 168664.856425: 10000 cycles: ffffffff982e0222 kfree+0x62 ([kernel.kallsyms])
     uname 28642 168664.856428: 10000 cycles: ffffffff9846dfd4 file_has_perm+0x54 ([kernel.kallsyms])
     uname 28642 168664.856433: 10000 cycles: ffffffff98288911 vma_interval_tree_insert+0x51 ([kernel.kallsyms])
     uname 28642 168664.856437: 10000 cycles: ffffffff9823e577 perf_event_mmap_output+0x27 ([kernel.kallsyms])
     uname 28642 168664.856441: 10000 cycles: ffffffff98a26fa0 xas_load+0x40 ([kernel.kallsyms])
     uname 28642 168664.856445: 10000 cycles: ffffffff98004f30 arch_setup_additional_pages+0x0 ([kernel.kallsyms])
     uname 28642 168664.856448: 10000 cycles: ffffffff98a297c0 copy_user_generic_unrolled+0xa0 ([kernel.kallsyms])
     uname 28642 168664.856452: 10000 cycles: ffffffff9853a87a strnlen_user+0x10a ([kernel.kallsyms])
     uname 28642 168664.856456: 10000 cycles: ffffffff986638a7 randomize_page+0x27 ([kernel.kallsyms])
     uname 28642 168664.856460: 10000 cycles: ffffffff98a3b645 _raw_spin_lock+0x5 ([kernel.kallsyms])

  #

And after:

  # perf script --itrace=Ge | head -20
  uname 28642 168664.856384:      10000     cycles:
  	ffffffff9810aeaa commit_creds+0x2a ([kernel.kallsyms])
  	ffffffff9831fe87 install_exec_creds+0x17 ([kernel.kallsyms])
  	ffffffff983968d9 load_elf_binary+0x359 ([kernel.kallsyms])
  	ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms])
  	ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms])

  uname 28642 168664.856388:      10000     cycles:
  	ffffffff982a24f1 mprotect_fixup+0x151 ([kernel.kallsyms])
  	ffffffff9831fa83 setup_arg_pages+0x123 ([kernel.kallsyms])
  	ffffffff9839691f load_elf_binary+0x39f ([kernel.kallsyms])
  	ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms])
  	ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms])

  uname 28642 168664.856392:      10000     cycles:
  	ffffffff982a385b move_page_tables+0xbcb ([kernel.kallsyms])
  	ffffffff9831f889 shift_arg_pages+0xa9 ([kernel.kallsyms])
  	ffffffff9831fb4f setup_arg_pages+0x1ef ([kernel.kallsyms])
  	ffffffff9839691f load_elf_binary+0x39f ([kernel.kallsyms])
  	ffffffff98e00c45 __x86_indirect_thunk_rax+0x5 ([kernel.kallsyms])
  #

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200401101613.6201-12-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 68 ++++++++++++++++++++++++++++++++++----
 1 file changed, 61 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index db25c77d82f3..a659b4a1b3f2 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -124,6 +124,8 @@ struct intel_pt {
 
 	struct range *time_ranges;
 	unsigned int range_cnt;
+
+	struct ip_callchain *chain;
 };
 
 enum switch_state {
@@ -868,6 +870,45 @@ static u64 intel_pt_ns_to_ticks(const struct intel_pt *pt, u64 ns)
 		pt->tc.time_mult;
 }
 
+static struct ip_callchain *intel_pt_alloc_chain(struct intel_pt *pt)
+{
+	size_t sz = sizeof(struct ip_callchain);
+
+	/* Add 1 to callchain_sz for callchain context */
+	sz += (pt->synth_opts.callchain_sz + 1) * sizeof(u64);
+	return zalloc(sz);
+}
+
+static int intel_pt_callchain_init(struct intel_pt *pt)
+{
+	struct evsel *evsel;
+
+	evlist__for_each_entry(pt->session->evlist, evsel) {
+		if (!(evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN))
+			evsel->synth_sample_type |= PERF_SAMPLE_CALLCHAIN;
+	}
+
+	pt->chain = intel_pt_alloc_chain(pt);
+	if (!pt->chain)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void intel_pt_add_callchain(struct intel_pt *pt,
+				   struct perf_sample *sample)
+{
+	struct thread *thread = machine__findnew_thread(pt->machine,
+							sample->pid,
+							sample->tid);
+
+	thread_stack__sample_late(thread, sample->cpu, pt->chain,
+				  pt->synth_opts.callchain_sz + 1, sample->ip,
+				  pt->kernel_start);
+
+	sample->callchain = pt->chain;
+}
+
 static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt,
 						   unsigned int queue_nr)
 {
@@ -880,11 +921,7 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt,
 		return NULL;
 
 	if (pt->synth_opts.callchain) {
-		size_t sz = sizeof(struct ip_callchain);
-
-		/* Add 1 to callchain_sz for callchain context */
-		sz += (pt->synth_opts.callchain_sz + 1) * sizeof(u64);
-		ptq->chain = zalloc(sz);
+		ptq->chain = intel_pt_alloc_chain(pt);
 		if (!ptq->chain)
 			goto out_free;
 	}
@@ -1992,7 +2029,8 @@ 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.thread_stack)
+	if (pt->synth_opts.callchain || pt->synth_opts.add_callchain ||
+	    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);
@@ -2639,6 +2677,11 @@ static int intel_pt_process_event(struct perf_session *session,
 	if (err)
 		return err;
 
+	if (event->header.type == PERF_RECORD_SAMPLE) {
+		if (pt->synth_opts.add_callchain && !sample->callchain)
+			intel_pt_add_callchain(pt, sample);
+	}
+
 	if (event->header.type == PERF_RECORD_AUX &&
 	    (event->aux.flags & PERF_AUX_FLAG_TRUNCATED) &&
 	    pt->synth_opts.errors) {
@@ -2710,6 +2753,7 @@ static void intel_pt_free(struct perf_session *session)
 	session->auxtrace = NULL;
 	thread__put(pt->unknown_thread);
 	addr_filters__exit(&pt->filts);
+	zfree(&pt->chain);
 	zfree(&pt->filter);
 	zfree(&pt->time_ranges);
 	free(pt);
@@ -3348,6 +3392,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 		    !session->itrace_synth_opts->inject) {
 			pt->synth_opts.branches = false;
 			pt->synth_opts.callchain = true;
+			pt->synth_opts.add_callchain = true;
 		}
 		pt->synth_opts.thread_stack =
 				session->itrace_synth_opts->thread_stack;
@@ -3380,14 +3425,22 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 		pt->branches_filter |= PERF_IP_FLAG_RETURN |
 				       PERF_IP_FLAG_TRACE_BEGIN;
 
-	if (pt->synth_opts.callchain && !symbol_conf.use_callchain) {
+	if ((pt->synth_opts.callchain || pt->synth_opts.add_callchain) &&
+	    !symbol_conf.use_callchain) {
 		symbol_conf.use_callchain = true;
 		if (callchain_register_param(&callchain_param) < 0) {
 			symbol_conf.use_callchain = false;
 			pt->synth_opts.callchain = false;
+			pt->synth_opts.add_callchain = false;
 		}
 	}
 
+	if (pt->synth_opts.add_callchain) {
+		err = intel_pt_callchain_init(pt);
+		if (err)
+			goto err_delete_thread;
+	}
+
 	err = intel_pt_synth_events(pt, session);
 	if (err)
 		goto err_delete_thread;
@@ -3410,6 +3463,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	return 0;
 
 err_delete_thread:
+	zfree(&pt->chain);
 	thread__zput(pt->unknown_thread);
 err_free_queues:
 	intel_pt_log_disable();
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 37/60] perf evsel: Move and globalize perf_evsel__find_pmu() and perf_evsel__is_aux_event()
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (35 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 36/60] perf intel-pt: Add support for synthesizing callchains for regular events Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 38/60] perf evlist: Move leader-sampling configuration Arnaldo Carvalho de Melo
                   ` (23 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Move and globalize 2 functions from the auxtrace specific sources so
that they can be reused.

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/20200401101613.6201-13-adrian.hunter@intel.com
[ Move to pmu.c, as moving to evsel.h breaks the python binding ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/auxtrace.c | 19 -------------------
 tools/perf/util/evsel.h    |  3 +++
 tools/perf/util/pmu.c      | 20 ++++++++++++++++++++
 3 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 809a09e75c55..33ad33378a90 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -58,25 +58,6 @@
 #include "symbol/kallsyms.h"
 #include <internal/lib.h>
 
-static struct perf_pmu *perf_evsel__find_pmu(struct evsel *evsel)
-{
-	struct perf_pmu *pmu = NULL;
-
-	while ((pmu = perf_pmu__scan(pmu)) != NULL) {
-		if (pmu->type == evsel->core.attr.type)
-			break;
-	}
-
-	return pmu;
-}
-
-static bool perf_evsel__is_aux_event(struct evsel *evsel)
-{
-	struct perf_pmu *pmu = perf_evsel__find_pmu(evsel);
-
-	return pmu && pmu->auxtrace;
-}
-
 /*
  * Make a group from 'leader' to 'last', requiring that the events were not
  * already grouped to a different leader.
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index e64ed4202cab..a463bc65b001 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -158,6 +158,9 @@ 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);
+bool perf_evsel__is_aux_event(struct evsel *evsel);
+
 struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx);
 
 static inline struct evsel *evsel__new(struct perf_event_attr *attr)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index ef6a63f3d386..bc912a84b5e9 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -18,6 +18,7 @@
 #include <regex.h>
 #include <perf/cpumap.h>
 #include "debug.h"
+#include "evsel.h"
 #include "pmu.h"
 #include "parse-events.h"
 #include "header.h"
@@ -884,6 +885,25 @@ 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 *pmu = NULL;
+
+	while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+		if (pmu->type == evsel->core.attr.type)
+			break;
+	}
+
+	return pmu;
+}
+
+bool perf_evsel__is_aux_event(struct evsel *evsel)
+{
+	struct perf_pmu *pmu = perf_evsel__find_pmu(evsel);
+
+	return pmu && pmu->auxtrace;
+}
+
 struct perf_pmu *perf_pmu__find(const char *name)
 {
 	struct perf_pmu *pmu;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 38/60] perf evlist: Move leader-sampling configuration
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (36 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 37/60] perf evsel: Move and globalize perf_evsel__find_pmu() and perf_evsel__is_aux_event() Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 39/60] perf evsel: Rearrange perf_evsel__config_leader_sampling() Arnaldo Carvalho de Melo
                   ` (22 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Move leader-sampling configuration in preparation for adding support for
leader sampling with AUX area events.

Committer notes:

It only makes sense when configuring an evsel that is part of an evlist,
so the only case where it is called outside perf_evlist__config(), in
some 'perf test' entry, is safe, and even there we should just use
perf_evlist__config(), but since in that case we have just one evsel in
the evlist, it is equivalent.

Also fixed up this problem:

  util/record.c: In function ‘perf_evlist__config’:
  util/record.c:223:3: error: too many arguments to function ‘perf_evsel__config_leader_sampling’
    223 |   perf_evsel__config_leader_sampling(evsel, evlist);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  util/record.c:170:13: note: declared here
    170 | static void perf_evsel__config_leader_sampling(struct evsel *evsel)
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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/20200401101613.6201-14-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c  | 19 -------------------
 tools/perf/util/record.c | 29 +++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f320adaf1326..8300e8c7aea8 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1002,25 +1002,6 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts,
 		}
 	}
 
-	/*
-	 * Disable sampling for all group members other
-	 * than leader in case leader 'leads' the sampling.
-	 */
-	if ((leader != evsel) && leader->sample_read) {
-		attr->freq           = 0;
-		attr->sample_freq    = 0;
-		attr->sample_period  = 0;
-		attr->write_backward = 0;
-
-		/*
-		 * We don't get sample for slave events, we make them
-		 * when delivering group leader sample. Set the slave
-		 * event to follow the master sample_type to ease up
-		 * report.
-		 */
-		attr->sample_type = leader->core.attr.sample_type;
-	}
-
 	if (opts->no_samples)
 		attr->sample_freq = 0;
 
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
index 7def66168503..8870ae451cac 100644
--- a/tools/perf/util/record.c
+++ b/tools/perf/util/record.c
@@ -167,6 +167,31 @@ bool perf_can_aux_sample(void)
 	return true;
 }
 
+static void perf_evsel__config_leader_sampling(struct evsel *evsel)
+{
+	struct perf_event_attr *attr = &evsel->core.attr;
+	struct evsel *leader = evsel->leader;
+
+	/*
+	 * Disable sampling for all group members other
+	 * than leader in case leader 'leads' the sampling.
+	 */
+	if (leader != evsel && leader->sample_read) {
+		attr->freq           = 0;
+		attr->sample_freq    = 0;
+		attr->sample_period  = 0;
+		attr->write_backward = 0;
+
+		/*
+		 * We don't get sample for slave events, we make them
+		 * when delivering group leader sample. Set the slave
+		 * event to follow the master sample_type to ease up
+		 * report.
+		 */
+		attr->sample_type = leader->core.attr.sample_type;
+	}
+}
+
 void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
 			 struct callchain_param *callchain)
 {
@@ -193,6 +218,10 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
 			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);
+
 	if (opts->full_auxtrace) {
 		/*
 		 * Need to be able to synthesize and parse selected events with
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 39/60] perf evsel: Rearrange perf_evsel__config_leader_sampling()
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (37 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 38/60] perf evlist: Move leader-sampling configuration Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 40/60] perf evlist: Allow multiple read formats Arnaldo Carvalho de Melo
                   ` (21 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

In preparation for adding support for leader sampling with AUX area 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/20200401101613.6201-15-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/record.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
index 8870ae451cac..32aeeb8a8d00 100644
--- a/tools/perf/util/record.c
+++ b/tools/perf/util/record.c
@@ -172,24 +172,24 @@ static void perf_evsel__config_leader_sampling(struct evsel *evsel)
 	struct perf_event_attr *attr = &evsel->core.attr;
 	struct evsel *leader = evsel->leader;
 
+	if (leader == evsel || !leader->sample_read)
+		return;
+
 	/*
 	 * Disable sampling for all group members other
 	 * than leader in case leader 'leads' the sampling.
 	 */
-	if (leader != evsel && leader->sample_read) {
-		attr->freq           = 0;
-		attr->sample_freq    = 0;
-		attr->sample_period  = 0;
-		attr->write_backward = 0;
+	attr->freq           = 0;
+	attr->sample_freq    = 0;
+	attr->sample_period  = 0;
+	attr->write_backward = 0;
 
-		/*
-		 * We don't get sample for slave events, we make them
-		 * when delivering group leader sample. Set the slave
-		 * event to follow the master sample_type to ease up
-		 * report.
-		 */
-		attr->sample_type = leader->core.attr.sample_type;
-	}
+	/*
+	 * We don't get a sample for slave events, we make them when delivering
+	 * the group leader sample. Set the slave event to follow the master
+	 * sample_type to ease up reporting.
+	 */
+	attr->sample_type = leader->core.attr.sample_type;
 }
 
 void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 40/60] perf evlist: Allow multiple read formats
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (38 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 39/60] perf evsel: Rearrange perf_evsel__config_leader_sampling() Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 41/60] perf tools: Add support for leader-sampling with AUX area events Arnaldo Carvalho de Melo
                   ` (20 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Tools find the correct evsel, and therefore read format, using the event
ID, so it isn't necessary for all read formats to be the same. In the
case of leader-sampling of AUX area events, dummy tracking events will
have a different read format, so relax the validation to become a debug
message only.

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/20200401101613.6201-16-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evlist.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 1548237b6558..82d9f9bb8975 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1131,8 +1131,10 @@ bool perf_evlist__valid_read_format(struct evlist *evlist)
 	u64 sample_type = first->core.attr.sample_type;
 
 	evlist__for_each_entry(evlist, pos) {
-		if (read_format != pos->core.attr.read_format)
-			return false;
+		if (read_format != pos->core.attr.read_format) {
+			pr_debug("Read format differs %#" PRIx64 " vs %#" PRIx64 "\n",
+				 read_format, (u64)pos->core.attr.read_format);
+		}
 	}
 
 	/* PERF_SAMPLE_READ imples PERF_FORMAT_ID. */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 41/60] perf tools: Add support for leader-sampling with AUX area events
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (39 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 40/60] perf evlist: Allow multiple read formats Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 42/60] perf stat: Force error in fallback on :k events Arnaldo Carvalho de Melo
                   ` (19 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Adrian Hunter, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

When AUX area events are used in sampling mode, they must be the group
leader, but the group leader is also used for leader-sampling. However,
it is not desirable to use an AUX area event as the leader for
leader-sampling, because it doesn't have any samples of its own. To support
leader-sampling with AUX area events, use the 2nd event of the group as the
"leader" for the purposes of leader-sampling.

Example:

 # perf record --kcore --aux-sample -e '{intel_pt//,cycles,instructions}:S' -c 10000 uname
 [ perf record: Woken up 3 times to write data ]
 [ perf record: Captured and wrote 0.786 MB perf.data ]
 # perf report
 Samples: 380  of events 'anon group { cycles, instructions }', Event count (approx.): 3026164
           Children              Self  Command  Shared Object      Symbol
 +   38.76%  42.65%     0.00%   0.00%  uname    [kernel.kallsyms]  [k] __x86_indirect_thunk_rax
 +   35.82%  31.33%     0.00%   0.00%  uname    ld-2.28.so         [.] _dl_start_user
 +   34.29%  29.74%     0.55%   0.47%  uname    ld-2.28.so         [.] _dl_start
 +   33.73%  28.62%     1.60%   0.97%  uname    ld-2.28.so         [.] dl_main
 +   33.19%  29.04%     0.52%   0.32%  uname    ld-2.28.so         [.] _dl_sysdep_start
 +   27.83%  33.74%     0.00%   0.00%  uname    [kernel.kallsyms]  [k] do_syscall_64
 +   26.76%  33.29%     0.00%   0.00%  uname    [kernel.kallsyms]  [k] entry_SYSCALL_64_after_hwframe
 +   23.78%  20.33%     5.97%   5.25%  uname    [kernel.kallsyms]  [k] page_fault
 +   23.18%  24.60%     0.00%   0.00%  uname    libc-2.28.so       [.] __libc_start_main
 +   22.64%  24.37%     0.00%   0.00%  uname    uname              [.] _start
 +   21.04%  23.27%     0.00%   0.00%  uname    uname              [.] main
 +   19.48%  18.08%     3.72%   3.64%  uname    ld-2.28.so         [.] _dl_relocate_object
 +   19.47%  21.81%     0.00%   0.00%  uname    libc-2.28.so       [.] setlocale
 +   19.44%  21.56%     0.52%   0.61%  uname    libc-2.28.so       [.] _nl_find_locale
 +   17.87%  19.66%     0.00%   0.00%  uname    libc-2.28.so       [.] _nl_load_locale_from_archive
 +   15.71%  13.73%     0.53%   0.52%  uname    [kernel.kallsyms]  [k] do_page_fault
 +   15.18%  13.21%     1.03%   0.68%  uname    [kernel.kallsyms]  [k] handle_mm_fault
 +   14.15%  12.53%     1.01%   1.12%  uname    [kernel.kallsyms]  [k] __handle_mm_fault
 +   12.03%   9.67%     0.54%   0.32%  uname    ld-2.28.so         [.] _dl_map_object
 +   10.55%   8.48%     0.00%   0.00%  uname    ld-2.28.so         [.] openaux
 +   10.55%  20.20%     0.52%   0.61%  uname    libc-2.28.so       [.] __run_exit_handlers

Comnmitter notes:

Fixed up this problem:

  util/record.c: In function ‘perf_evlist__config’:
  util/record.c:256:3: error: too few arguments to function ‘perf_evsel__config_leader_sampling’
    256 |   perf_evsel__config_leader_sampling(evsel);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  util/record.c:190:13: note: declared here
    190 | static void perf_evsel__config_leader_sampling(struct evsel *evsel,
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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/20200401101613.6201-17-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-list.txt |  3 ++
 tools/perf/util/record.c               | 45 ++++++++++++++++++++++----
 2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
index 6345db33c533..cb23667531ab 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -258,6 +258,9 @@ Normally all events in an event group sample, but with :S only
 the first event (the leader) samples, and it only reads the values of the
 other events in the group.
 
+However, in the case AUX area events (e.g. Intel PT or CoreSight), the AUX
+area event must be the leader, so then the second event samples, not the first.
+
 OPTIONS
 -------
 
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
index 32aeeb8a8d00..6d3e3df6e2a1 100644
--- a/tools/perf/util/record.c
+++ b/tools/perf/util/record.c
@@ -167,17 +167,46 @@ bool perf_can_aux_sample(void)
 	return true;
 }
 
-static void perf_evsel__config_leader_sampling(struct evsel *evsel)
+/*
+ * 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
+ * is the next event.
+ */
+static struct evsel *perf_evsel__read_sampler(struct evsel *evsel,
+					      struct evlist *evlist)
+{
+	struct evsel *leader = evsel->leader;
+
+	if (perf_evsel__is_aux_event(leader)) {
+		evlist__for_each_entry(evlist, evsel) {
+			if (evsel->leader == leader && evsel != evsel->leader)
+				return evsel;
+		}
+	}
+
+	return leader;
+}
+
+static void perf_evsel__config_leader_sampling(struct evsel *evsel,
+					       struct evlist *evlist)
 {
 	struct perf_event_attr *attr = &evsel->core.attr;
 	struct evsel *leader = evsel->leader;
+	struct evsel *read_sampler;
+
+	if (!leader->sample_read)
+		return;
+
+	read_sampler = perf_evsel__read_sampler(evsel, evlist);
 
-	if (leader == evsel || !leader->sample_read)
+	if (evsel == read_sampler)
 		return;
 
 	/*
-	 * Disable sampling for all group members other
-	 * than leader in case leader 'leads' the sampling.
+	 * Disable sampling for all group members other than the leader in
+	 * case the leader 'leads' the sampling, except when the leader is an
+	 * AUX area event, in which case the 2nd event in the group is the one
+	 * that 'leads' the sampling.
 	 */
 	attr->freq           = 0;
 	attr->sample_freq    = 0;
@@ -188,8 +217,12 @@ static void perf_evsel__config_leader_sampling(struct evsel *evsel)
 	 * We don't get a sample for slave events, we make them when delivering
 	 * the group leader sample. Set the slave event to follow the master
 	 * sample_type to ease up reporting.
+	 * An AUX area event also has sample_type requirements, so also include
+	 * the sample type bits from the leader's sample_type to cover that
+	 * case.
 	 */
-	attr->sample_type = leader->core.attr.sample_type;
+	attr->sample_type = read_sampler->core.attr.sample_type |
+			    leader->core.attr.sample_type;
 }
 
 void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
@@ -220,7 +253,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
 
 	/* Configure leader sampling here now that the sample type is known */
 	evlist__for_each_entry(evlist, evsel)
-		perf_evsel__config_leader_sampling(evsel);
+		perf_evsel__config_leader_sampling(evsel, evlist);
 
 	if (opts->full_auxtrace) {
 		/*
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 42/60] perf stat: Force error in fallback on :k events
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (40 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 41/60] perf tools: Add support for leader-sampling with AUX area events Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:52 ` [PATCH 43/60] tools lib traceevent: Take care of return value of asprintf Arnaldo Carvalho de Melo
                   ` (18 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, Stephane Eranian, Ian Rogers, Jiri Olsa,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Mark Rutland,
	Peter Zijlstra

From: Stephane Eranian <eranian@google.com>

When it is not possible for a non-privilege perf command to monitor at
the kernel level (:k), the fallback code forces a :u. That works if the
event was previously monitoring both levels.  But if the event was
already constrained to kernel only, then it does not make sense to
restrict it to user only.

Given the code works by exclusion, a kernel only event would have:

  attr->exclude_user = 1

The fallback code would add:

  attr->exclude_kernel = 1

In the end the end would not monitor in either the user level or kernel
level. In other words, it would count nothing.

An event programmed to monitor kernel only cannot be switched to user
only without seriously warning the user.

This patch forces an error in this case to make it clear the request
cannot really be satisfied.

Behavior with paranoid 1:

  $ sudo bash -c "echo 1 > /proc/sys/kernel/perf_event_paranoid"
  $ perf stat -e cycles:k sleep 1

   Performance counter stats for 'sleep 1':

           1,520,413      cycles:k

         1.002361664 seconds time elapsed

         0.002480000 seconds user
         0.000000000 seconds sys

Old behavior with paranoid 2:

  $ sudo bash -c "echo 2 > /proc/sys/kernel/perf_event_paranoid"
  $ perf stat -e cycles:k sleep 1
   Performance counter stats for 'sleep 1':

                   0      cycles:ku

         1.002358127 seconds time elapsed

         0.002384000 seconds user
         0.000000000 seconds sys

New behavior with paranoid 2:

  $ sudo bash -c "echo 2 > /proc/sys/kernel/perf_event_paranoid"
  $ perf stat -e cycles:k sleep 1
  Error:
  You may not have permission to collect stats.

  Consider tweaking /proc/sys/kernel/perf_event_paranoid,
  which controls use of the performance events system by
  unprivileged users (without CAP_PERFMON or CAP_SYS_ADMIN).

  The current value is 2:

    -1: Allow use of (almost) all events by all users
        Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
  >= 0: Disallow ftrace function tracepoint by users without CAP_PERFMON or CAP_SYS_ADMIN
        Disallow raw tracepoint access by users without CAP_SYS_PERFMON or CAP_SYS_ADMIN
  >= 1: Disallow CPU event access by users without CAP_PERFMON or CAP_SYS_ADMIN
  >= 2: Disallow kernel profiling by users without CAP_PERFMON or CAP_SYS_ADMIN

  To make this setting permanent, edit /etc/sysctl.conf too, e.g.:

          kernel.perf_event_paranoid = -1

v2 of this patch addresses the review feedback from jolsa@redhat.com.

Signed-off-by: Stephane Eranian <eranian@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.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>
Link: http://lore.kernel.org/lkml/20200414161550.225588-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 8300e8c7aea8..6a571d322bb2 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2427,6 +2427,10 @@ bool perf_evsel__fallback(struct evsel *evsel, int err,
 		char *new_name;
 		const char *sep = ":";
 
+		/* If event has exclude user then don't exclude kernel. */
+		if (evsel->core.attr.exclude_user)
+			return false;
+
 		/* Is there already the separator in the name. */
 		if (strchr(name, '/') ||
 		    strchr(name, ':'))
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 43/60] tools lib traceevent: Take care of return value of asprintf
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (41 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 42/60] perf stat: Force error in fallback on :k events Arnaldo Carvalho de Melo
@ 2020-04-20 11:52 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 44/60] perf pmu: Add support for PMU capabilities Arnaldo Carvalho de Melo
                   ` (17 subsequent siblings)
  60 siblings, 0 replies; 130+ 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, He Zhe, Steven Rostedt, Tzvetomir Stoyanov,
	hewenliang4, Arnaldo Carvalho de Melo

From: He Zhe <zhe.he@windriver.com>

According to the API, if memory allocation wasn't possible, or some
other error occurs, asprintf will return -1, and the contents of strp
below are undefined.

  int asprintf(char **strp, const char *fmt, ...);

This patch takes care of return value of asprintf to make it less error
prone and prevent the following build warning.

  ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: He Zhe <zhe.he@windriver.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: hewenliang4@huawei.com
Link: http://lore.kernel.org/lkml/1582163930-233692-1-git-send-email-zhe.he@windriver.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/parse-filter.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 20eed719542e..c271aeeb227d 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1958,7 +1958,8 @@ static char *op_to_str(struct tep_event_filter *filter, struct tep_filter_arg *a
 				default:
 					break;
 				}
-				asprintf(&str, val ? "TRUE" : "FALSE");
+				if (asprintf(&str, val ? "TRUE" : "FALSE") < 0)
+					str = NULL;
 				break;
 			}
 		}
@@ -1976,7 +1977,8 @@ static char *op_to_str(struct tep_event_filter *filter, struct tep_filter_arg *a
 			break;
 		}
 
-		asprintf(&str, "(%s) %s (%s)", left, op, right);
+		if (asprintf(&str, "(%s) %s (%s)", left, op, right) < 0)
+			str = NULL;
 		break;
 
 	case TEP_FILTER_OP_NOT:
@@ -1992,10 +1994,12 @@ static char *op_to_str(struct tep_event_filter *filter, struct tep_filter_arg *a
 			right_val = 0;
 		if (right_val >= 0) {
 			/* just return the opposite */
-			asprintf(&str, right_val ? "FALSE" : "TRUE");
+			if (asprintf(&str, right_val ? "FALSE" : "TRUE") < 0)
+				str = NULL;
 			break;
 		}
-		asprintf(&str, "%s(%s)", op, right);
+		if (asprintf(&str, "%s(%s)", op, right) < 0)
+			str = NULL;
 		break;
 
 	default:
@@ -2011,7 +2015,8 @@ static char *val_to_str(struct tep_event_filter *filter, struct tep_filter_arg *
 {
 	char *str = NULL;
 
-	asprintf(&str, "%lld", arg->value.val);
+	if (asprintf(&str, "%lld", arg->value.val) < 0)
+		str = NULL;
 
 	return str;
 }
@@ -2069,7 +2074,8 @@ static char *exp_to_str(struct tep_event_filter *filter, struct tep_filter_arg *
 		break;
 	}
 
-	asprintf(&str, "%s %s %s", lstr, op, rstr);
+	if (asprintf(&str, "%s %s %s", lstr, op, rstr) < 0)
+		str = NULL;
 out:
 	free(lstr);
 	free(rstr);
@@ -2113,7 +2119,8 @@ static char *num_to_str(struct tep_event_filter *filter, struct tep_filter_arg *
 		if (!op)
 			op = "<=";
 
-		asprintf(&str, "%s %s %s", lstr, op, rstr);
+		if (asprintf(&str, "%s %s %s", lstr, op, rstr) < 0)
+			str = NULL;
 		break;
 
 	default:
@@ -2148,8 +2155,9 @@ static char *str_to_str(struct tep_event_filter *filter, struct tep_filter_arg *
 		if (!op)
 			op = "!~";
 
-		asprintf(&str, "%s %s \"%s\"",
-			 arg->str.field->name, op, arg->str.val);
+		if (asprintf(&str, "%s %s \"%s\"",
+			 arg->str.field->name, op, arg->str.val) < 0)
+			str = NULL;
 		break;
 
 	default:
@@ -2165,7 +2173,8 @@ static char *arg_to_str(struct tep_event_filter *filter, struct tep_filter_arg *
 
 	switch (arg->type) {
 	case TEP_FILTER_ARG_BOOLEAN:
-		asprintf(&str, arg->boolean.value ? "TRUE" : "FALSE");
+		if (asprintf(&str, arg->boolean.value ? "TRUE" : "FALSE") < 0)
+			str = NULL;
 		return str;
 
 	case TEP_FILTER_ARG_OP:
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 44/60] perf pmu: Add support for PMU capabilities
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (42 preceding siblings ...)
  2020-04-20 11:52 ` [PATCH 43/60] tools lib traceevent: Take care of return value of asprintf Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 45/60] perf doc: allow ASCIIDOC_EXTRA to be an argument Arnaldo Carvalho de Melo
                   ` (16 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

The PMU capabilities information, which is located at
/sys/bus/event_source/devices/<dev>/caps, is required by perf tool.  For
example, the max LBR information is required to stitch LBR call stack.

Add perf_pmu__caps_parse() to parse the PMU capabilities information.
The information is stored in a list.

The following patch will store the capabilities information in perf
header.

Committer notes:

Here's an example of such directories and its files in an i5 7th gen
machine:

  [root@seventh ~]# ls -lad /sys/bus/event_source/devices/*/caps
  drwxr-xr-x. 2 root root 0 Apr 14 13:33 /sys/bus/event_source/devices/cpu/caps
  drwxr-xr-x. 2 root root 0 Apr 14 13:33 /sys/bus/event_source/devices/intel_pt/caps
  [root@seventh ~]# ls -la /sys/bus/event_source/devices/intel_pt/caps
  total 0
  drwxr-xr-x. 2 root root    0 Apr 14 13:33 .
  drwxr-xr-x. 5 root root    0 Apr 14 13:12 ..
  -r--r--r--. 1 root root 4096 Apr 16 13:10 cr3_filtering
  -r--r--r--. 1 root root 4096 Apr 16 11:42 cycle_thresholds
  -r--r--r--. 1 root root 4096 Apr 16 13:10 ip_filtering
  -r--r--r--. 1 root root 4096 Apr 16 13:10 max_subleaf
  -r--r--r--. 1 root root 4096 Apr 14 13:33 mtc
  -r--r--r--. 1 root root 4096 Apr 14 13:33 mtc_periods
  -r--r--r--. 1 root root 4096 Apr 16 13:10 num_address_ranges
  -r--r--r--. 1 root root 4096 Apr 16 13:10 output_subsys
  -r--r--r--. 1 root root 4096 Apr 16 13:10 payloads_lip
  -r--r--r--. 1 root root 4096 Apr 16 13:10 power_event_trace
  -r--r--r--. 1 root root 4096 Apr 14 13:33 psb_cyc
  -r--r--r--. 1 root root 4096 Apr 14 13:33 psb_periods
  -r--r--r--. 1 root root 4096 Apr 16 13:10 ptwrite
  -r--r--r--. 1 root root 4096 Apr 16 13:10 single_range_output
  -r--r--r--. 1 root root 4096 Apr 16 12:03 topa_multiple_entries
  -r--r--r--. 1 root root 4096 Apr 16 13:10 topa_output
  [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/topa_output
  1
  [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/topa_multiple_entries
  1
  [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/mtc
  1
  [root@seventh ~]# cat /sys/bus/event_source/devices/intel_pt/caps/power_event_trace
  0
  [root@seventh ~]#

  [root@seventh ~]# ls -la /sys/bus/event_source/devices/cpu/caps/
  total 0
  drwxr-xr-x. 2 root root    0 Apr 14 13:33 .
  drwxr-xr-x. 6 root root    0 Apr 14 13:12 ..
  -r--r--r--. 1 root root 4096 Apr 16 13:10 branches
  -r--r--r--. 1 root root 4096 Apr 14 13:33 max_precise
  -r--r--r--. 1 root root 4096 Apr 16 13:10 pmu_name
  [root@seventh ~]# cat /sys/bus/event_source/devices/cpu/caps/max_precise
  3
  [root@seventh ~]# cat /sys/bus/event_source/devices/cpu/caps/branches
  32
  [root@seventh ~]# cat /sys/bus/event_source/devices/cpu/caps/pmu_name
  skylake
  [root@seventh ~]#

Wow, first time I've heard about
/sys/bus/event_source/devices/cpu/caps/max_precise, I think I'll use it!
:-)

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-2-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/pmu.c | 82 +++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/pmu.h |  9 +++++
 2 files changed, 91 insertions(+)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index bc912a84b5e9..d9f89ed18dea 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -850,6 +850,7 @@ static struct perf_pmu *pmu_lookup(const char *name)
 
 	INIT_LIST_HEAD(&pmu->format);
 	INIT_LIST_HEAD(&pmu->aliases);
+	INIT_LIST_HEAD(&pmu->caps);
 	list_splice(&format, &pmu->format);
 	list_splice(&aliases, &pmu->aliases);
 	list_add_tail(&pmu->list, &pmus);
@@ -1594,3 +1595,84 @@ int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt,
 	va_end(args);
 	return ret;
 }
+
+static int perf_pmu__new_caps(struct list_head *list, char *name, char *value)
+{
+	struct perf_pmu_caps *caps = zalloc(sizeof(*caps));
+
+	if (!caps)
+		return -ENOMEM;
+
+	caps->name = strdup(name);
+	if (!caps->name)
+		goto free_caps;
+	caps->value = strndup(value, strlen(value) - 1);
+	if (!caps->value)
+		goto free_name;
+	list_add_tail(&caps->list, list);
+	return 0;
+
+free_name:
+	zfree(caps->name);
+free_caps:
+	free(caps);
+
+	return -ENOMEM;
+}
+
+/*
+ * Reading/parsing the given pmu capabilities, which should be located at:
+ * /sys/bus/event_source/devices/<dev>/caps as sysfs group attributes.
+ * Return the number of capabilities
+ */
+int perf_pmu__caps_parse(struct perf_pmu *pmu)
+{
+	struct stat st;
+	char caps_path[PATH_MAX];
+	const char *sysfs = sysfs__mountpoint();
+	DIR *caps_dir;
+	struct dirent *evt_ent;
+	int nr_caps = 0;
+
+	if (!sysfs)
+		return -1;
+
+	snprintf(caps_path, PATH_MAX,
+		 "%s" EVENT_SOURCE_DEVICE_PATH "%s/caps", sysfs, pmu->name);
+
+	if (stat(caps_path, &st) < 0)
+		return 0;	/* no error if caps does not exist */
+
+	caps_dir = opendir(caps_path);
+	if (!caps_dir)
+		return -EINVAL;
+
+	while ((evt_ent = readdir(caps_dir)) != NULL) {
+		char path[PATH_MAX + NAME_MAX + 1];
+		char *name = evt_ent->d_name;
+		char value[128];
+		FILE *file;
+
+		if (!strcmp(name, ".") || !strcmp(name, ".."))
+			continue;
+
+		snprintf(path, sizeof(path), "%s/%s", caps_path, name);
+
+		file = fopen(path, "r");
+		if (!file)
+			continue;
+
+		if (!fgets(value, sizeof(value), file) ||
+		    (perf_pmu__new_caps(&pmu->caps, name, value) < 0)) {
+			fclose(file);
+			continue;
+		}
+
+		nr_caps++;
+		fclose(file);
+	}
+
+	closedir(caps_dir);
+
+	return nr_caps;
+}
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 5fb3f16828df..1edd214b75a5 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -22,6 +22,12 @@ enum {
 
 struct perf_event_attr;
 
+struct perf_pmu_caps {
+	char *name;
+	char *value;
+	struct list_head list;
+};
+
 struct perf_pmu {
 	char *name;
 	__u32 type;
@@ -33,6 +39,7 @@ struct perf_pmu {
 	struct perf_cpu_map *cpus;
 	struct list_head format;  /* HEAD struct perf_pmu_format -> list */
 	struct list_head aliases; /* HEAD struct perf_pmu_alias -> list */
+	struct list_head caps;    /* HEAD struct perf_pmu_caps -> list */
 	struct list_head list;    /* ELEM */
 };
 
@@ -107,4 +114,6 @@ bool pmu_uncore_alias_match(const char *pmu_name, const char *name);
 
 int perf_pmu__convert_scale(const char *scale, char **end, double *sval);
 
+int perf_pmu__caps_parse(struct perf_pmu *pmu);
+
 #endif /* __PMU_H */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 45/60] perf doc: allow ASCIIDOC_EXTRA to be an argument
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (43 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 44/60] perf pmu: Add support for PMU capabilities Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 46/60] perf parser: Add support to specify rXXX event with pmu Arnaldo Carvalho de Melo
                   ` (15 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 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,
	Alexei Starovoitov, Alexey Budankov, Andi Kleen, Andrii Nakryiko,
	Daniel Borkmann, Florian Fainelli, Greg Kroah-Hartman,
	Igor Lubashev, Jin Yao, Jiri Olsa, Jiwei Sun, John Garry,
	Kan Liang, Leo Yan, Mark Rutland, Martin KaFai Lau,
	Peter Zijlstra, Stephane Eranian, Yonghong Song, bpf, netdev,
	yuzhoujian, Arnaldo Carvalho de Melo

From: Ian Rogers <irogers@google.com>

This will allow parent makefiles to pass values to asciidoc.

Signed-off-by: Ian Rogers <irogers@google.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: Jiri Olsa <jolsa@redhat.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/20200416162058.201954-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index 31824d5269cc..6e54979c2124 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -48,7 +48,7 @@ man5dir=$(mandir)/man5
 man7dir=$(mandir)/man7
 
 ASCIIDOC=asciidoc
-ASCIIDOC_EXTRA = --unsafe -f asciidoc.conf
+ASCIIDOC_EXTRA += --unsafe -f asciidoc.conf
 ASCIIDOC_HTML = xhtml11
 MANPAGE_XSL = manpage-normal.xsl
 XMLTO_EXTRA =
@@ -59,7 +59,7 @@ HTML_REF = origin/html
 
 ifdef USE_ASCIIDOCTOR
 ASCIIDOC = asciidoctor
-ASCIIDOC_EXTRA = -a compat-mode
+ASCIIDOC_EXTRA += -a compat-mode
 ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
 ASCIIDOC_EXTRA += -a mansource="perf" -a manmanual="perf Manual"
 ASCIIDOC_HTML = xhtml5
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 46/60] perf parser: Add support to specify rXXX event with pmu
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (44 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 45/60] perf doc: allow ASCIIDOC_EXTRA to be an argument Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 47/60] perf header: Support CPU PMU capabilities Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Jiri Olsa, Thomas Richter,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Michael Petlan,
	Peter Zijlstra, Sumanth Korikkar, Vasily Gorbik

From: Jiri Olsa <jolsa@redhat.com>

The current rXXXX event specification creates event under PERF_TYPE_RAW
pmu type. This change allows to use rXXXX within pmu syntax, so it's
type is used via the following syntax:

  -e 'cpu/r3c/'
  -e 'cpum_cf/r0/'

The XXXX number goes directly to perf_event_attr::config the same way as
in '-e rXXXX' event. The perf_event_attr::type is filled with pmu type.

Committer testing:

So, lets see what goes in perf_event_attr::config for, say, the
'instructions' PERF_TYPE_HARDWARE (0) event, first we should look at how
to encode this event as a PERF_TYPE_RAW event for this specific CPU, an
AMD Ryzen 5:

  # cat /sys/devices/cpu/events/instructions
  event=0xc0
  #

Then try with it _and_ the instruction, just to see that they are close
enough:

  # perf stat -e rc0,instructions sleep 1

   Performance counter stats for 'sleep 1':

             919,794      rc0
             919,898      instructions

         1.000754579 seconds time elapsed

         0.000715000 seconds user
         0.000000000 seconds sys
  #

Now we should try, before this patch, the PMU event encoding:

  # perf stat -e cpu/rc0/ sleep 1
  event syntax error: 'cpu/rc0/'
                           \___ unknown term

  valid terms: event,edge,inv,umask,cmask,config,config1,config2,name,period,percore
  #

Now with this patch, the three ways of specifying the 'instructions' CPU
counter are accepted:

  # perf stat -e cpu/rc0/,rc0,instructions sleep 1

   Performance counter stats for 'sleep 1':

             892,948      cpu/rc0/
             893,052      rc0
             893,156      instructions

         1.000931819 seconds time elapsed

         0.000916000 seconds user
         0.000000000 seconds sys

  #

Requested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20200416221405.437788-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-list.txt |  5 +++++
 tools/perf/tests/parse-events.c        | 17 ++++++++++++++++-
 tools/perf/util/parse-events.l         |  1 +
 tools/perf/util/parse-events.y         |  9 +++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
index cb23667531ab..376a50b3452d 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -115,6 +115,11 @@ raw encoding of 0x1A8 can be used:
  perf stat -e r1a8 -a sleep 1
  perf record -e r1a8 ...
 
+It's also possible to use pmu syntax:
+
+ perf record -e r1a8 -a sleep 1
+ perf record -e cpu/r1a8/ ...
+
 You should refer to the processor specific documentation for getting these
 details. Some of them are referenced in the SEE ALSO section below.
 
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 091c3aeccc27..902bd9d591a0 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1356,6 +1356,16 @@ static int test__checkevent_complex_name(struct evlist *evlist)
 	return 0;
 }
 
+static int test__checkevent_raw_pmu(struct evlist *evlist)
+{
+	struct evsel *evsel = evlist__first(evlist);
+
+	TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
+	TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
+	TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config);
+	return 0;
+}
+
 static int test__sym_event_slash(struct evlist *evlist)
 {
 	struct evsel *evsel = evlist__first(evlist);
@@ -1750,7 +1760,12 @@ static struct evlist_test test__events_pmu[] = {
 		.name  = "cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2/ukp",
 		.check = test__checkevent_complex_name,
 		.id    = 3,
-	}
+	},
+	{
+		.name  = "software/r1a/",
+		.check = test__checkevent_raw_pmu,
+		.id    = 4,
+	},
 };
 
 struct terms_test {
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index baa48f28d57d..c589fc42f058 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -286,6 +286,7 @@ no-overwrite		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NOOVERWRITE); }
 percore			{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_PERCORE); }
 aux-output		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT); }
 aux-sample-size		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE); }
+r{num_raw_hex}		{ return raw(yyscanner); }
 ,			{ return ','; }
 "/"			{ BEGIN(INITIAL); return '/'; }
 {name_minus}		{ return str(yyscanner, PE_NAME); }
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 94f8bcd83582..e879eb257874 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -706,6 +706,15 @@ event_term
 }
 
 event_term:
+PE_RAW
+{
+	struct parse_events_term *term;
+
+	ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_CONFIG,
+					NULL, $1, false, &@1, NULL));
+	$$ = term;
+}
+|
 PE_NAME '=' PE_NAME
 {
 	struct parse_events_term *term;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 47/60] perf header: Support CPU PMU capabilities
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (45 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 46/60] perf parser: Add support to specify rXXX event with pmu Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 48/60] perf machine: Remove the indent in resolve_lbr_callchain_sample Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov,
	Mathieu Poirier, Michael Ellerman, Pavel Gerasimov,
	Peter Zijlstra, Ravi Bangoria, Stephane Eranian,
	Vitaly Slobodskoy

From: Kan Liang <kan.liang@linux.intel.com>

To stitch LBR call stack, the max LBR information is required. So the
CPU PMU capabilities information has to be stored in perf header.

Add a new feature HEADER_CPU_PMU_CAPS for CPU PMU capabilities.
Retrieve all CPU PMU capabilities, not just max LBR information.

Add variable max_branches to facilitate future usage.

Committer testing:

  # ls -la /sys/devices/cpu/caps/
  total 0
  drwxr-xr-x. 2 root root    0 Apr 17 10:53 .
  drwxr-xr-x. 6 root root    0 Apr 17 07:02 ..
  -r--r--r--. 1 root root 4096 Apr 17 10:53 max_precise
  #
  # cat /sys/devices/cpu/caps/max_precise
  0
  # perf record sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.033 MB perf.data (7 samples) ]
  #
  # perf report --header-only | egrep 'cpu(desc|.*capabilities)'
  # cpudesc : AMD Ryzen 5 3600X 6-Core Processor
  # cpu pmu capabilities: max_precise=0
  #

And then on an Intel machine:

  $ ls -la /sys/devices/cpu/caps/
  total 0
  drwxr-xr-x. 2 root root    0 Apr 17 10:51 .
  drwxr-xr-x. 6 root root    0 Apr 17 10:04 ..
  -r--r--r--. 1 root root 4096 Apr 17 11:37 branches
  -r--r--r--. 1 root root 4096 Apr 17 10:51 max_precise
  -r--r--r--. 1 root root 4096 Apr 17 11:37 pmu_name
  $ cat /sys/devices/cpu/caps/max_precise
  3
  $ cat /sys/devices/cpu/caps/branches
  32
  $ cat /sys/devices/cpu/caps/pmu_name
  skylake
  $ perf record sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.001 MB perf.data (8 samples) ]
  $ perf report --header-only | egrep 'cpu(desc|.*capabilities)'
  # cpudesc : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  # cpu pmu capabilities: branches=32, max_precise=3, pmu_name=skylake
  $

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-3-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../Documentation/perf.data-file-format.txt   |  16 +++
 tools/perf/util/env.h                         |   3 +
 tools/perf/util/header.c                      | 108 ++++++++++++++++++
 tools/perf/util/header.h                      |   1 +
 4 files changed, 128 insertions(+)

diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt
index b0152e1095c5..b6472e463284 100644
--- a/tools/perf/Documentation/perf.data-file-format.txt
+++ b/tools/perf/Documentation/perf.data-file-format.txt
@@ -373,6 +373,22 @@ struct {
 Indicates that trace contains records of PERF_RECORD_COMPRESSED type
 that have perf_events records in compressed form.
 
+	HEADER_CPU_PMU_CAPS = 28,
+
+	A list of cpu PMU capabilities. The format of data is as below.
+
+struct {
+	u32 nr_cpu_pmu_caps;
+	{
+		char	name[];
+		char	value[];
+	} [nr_cpu_pmu_caps]
+};
+
+
+Example:
+ cpu pmu capabilities: branches=32, max_precise=3, pmu_name=icelake
+
 	other bits are reserved and should ignored for now
 	HEADER_FEAT_BITS	= 256,
 
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index 7632075a8792..1ab2682d5d2b 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -48,6 +48,7 @@ struct perf_env {
 	char			*cpuid;
 	unsigned long long	total_mem;
 	unsigned int		msr_pmu_type;
+	unsigned int		max_branches;
 
 	int			nr_cmdline;
 	int			nr_sibling_cores;
@@ -57,12 +58,14 @@ struct perf_env {
 	int			nr_memory_nodes;
 	int			nr_pmu_mappings;
 	int			nr_groups;
+	int			nr_cpu_pmu_caps;
 	char			*cmdline;
 	const char		**cmdline_argv;
 	char			*sibling_cores;
 	char			*sibling_dies;
 	char			*sibling_threads;
 	char			*pmu_mappings;
+	char			*cpu_pmu_caps;
 	struct cpu_topology_map	*cpu;
 	struct cpu_cache_level	*caches;
 	int			 caches_cnt;
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index acbd046bf95c..28e82da04b7a 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1395,6 +1395,38 @@ static int write_compressed(struct feat_fd *ff __maybe_unused,
 	return do_write(ff, &(ff->ph->env.comp_mmap_len), sizeof(ff->ph->env.comp_mmap_len));
 }
 
+static int write_cpu_pmu_caps(struct feat_fd *ff,
+			      struct evlist *evlist __maybe_unused)
+{
+	struct perf_pmu *cpu_pmu = perf_pmu__find("cpu");
+	struct perf_pmu_caps *caps = NULL;
+	int nr_caps;
+	int ret;
+
+	if (!cpu_pmu)
+		return -ENOENT;
+
+	nr_caps = perf_pmu__caps_parse(cpu_pmu);
+	if (nr_caps < 0)
+		return nr_caps;
+
+	ret = do_write(ff, &nr_caps, sizeof(nr_caps));
+	if (ret < 0)
+		return ret;
+
+	list_for_each_entry(caps, &cpu_pmu->caps, list) {
+		ret = do_write_string(ff, caps->name);
+		if (ret < 0)
+			return ret;
+
+		ret = do_write_string(ff, caps->value);
+		if (ret < 0)
+			return ret;
+	}
+
+	return ret;
+}
+
 static void print_hostname(struct feat_fd *ff, FILE *fp)
 {
 	fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname);
@@ -1809,6 +1841,27 @@ static void print_compressed(struct feat_fd *ff, FILE *fp)
 		ff->ph->env.comp_level, ff->ph->env.comp_ratio);
 }
 
+static void print_cpu_pmu_caps(struct feat_fd *ff, FILE *fp)
+{
+	const char *delimiter = "# cpu pmu capabilities: ";
+	u32 nr_caps = ff->ph->env.nr_cpu_pmu_caps;
+	char *str;
+
+	if (!nr_caps) {
+		fprintf(fp, "# cpu pmu capabilities: not available\n");
+		return;
+	}
+
+	str = ff->ph->env.cpu_pmu_caps;
+	while (nr_caps--) {
+		fprintf(fp, "%s%s", delimiter, str);
+		delimiter = ", ";
+		str += strlen(str) + 1;
+	}
+
+	fprintf(fp, "\n");
+}
+
 static void print_pmu_mappings(struct feat_fd *ff, FILE *fp)
 {
 	const char *delimiter = "# pmu mappings: ";
@@ -2846,6 +2899,60 @@ static int process_compressed(struct feat_fd *ff,
 	return 0;
 }
 
+static int process_cpu_pmu_caps(struct feat_fd *ff,
+				void *data __maybe_unused)
+{
+	char *name, *value;
+	struct strbuf sb;
+	u32 nr_caps;
+
+	if (do_read_u32(ff, &nr_caps))
+		return -1;
+
+	if (!nr_caps) {
+		pr_debug("cpu pmu capabilities not available\n");
+		return 0;
+	}
+
+	ff->ph->env.nr_cpu_pmu_caps = nr_caps;
+
+	if (strbuf_init(&sb, 128) < 0)
+		return -1;
+
+	while (nr_caps--) {
+		name = do_read_string(ff);
+		if (!name)
+			goto error;
+
+		value = do_read_string(ff);
+		if (!value)
+			goto free_name;
+
+		if (strbuf_addf(&sb, "%s=%s", name, value) < 0)
+			goto free_value;
+
+		/* include a NULL character at the end */
+		if (strbuf_add(&sb, "", 1) < 0)
+			goto free_value;
+
+		if (!strcmp(name, "branches"))
+			ff->ph->env.max_branches = atoi(value);
+
+		free(value);
+		free(name);
+	}
+	ff->ph->env.cpu_pmu_caps = strbuf_detach(&sb, NULL);
+	return 0;
+
+free_value:
+	free(value);
+free_name:
+	free(name);
+error:
+	strbuf_release(&sb);
+	return -1;
+}
+
 #define FEAT_OPR(n, func, __full_only) \
 	[HEADER_##n] = {					\
 		.name	    = __stringify(n),			\
@@ -2903,6 +3010,7 @@ const struct perf_header_feature_ops feat_ops[HEADER_LAST_FEATURE] = {
 	FEAT_OPR(BPF_PROG_INFO, bpf_prog_info,  false),
 	FEAT_OPR(BPF_BTF,       bpf_btf,        false),
 	FEAT_OPR(COMPRESSED,	compressed,	false),
+	FEAT_OPR(CPU_PMU_CAPS,	cpu_pmu_caps,	false),
 };
 
 struct header_print_data {
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 840f95cee349..650bd1c7a99b 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -43,6 +43,7 @@ enum {
 	HEADER_BPF_PROG_INFO,
 	HEADER_BPF_BTF,
 	HEADER_COMPRESSED,
+	HEADER_CPU_PMU_CAPS,
 	HEADER_LAST_FEATURE,
 	HEADER_FEAT_BITS	= 256,
 };
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 48/60] perf machine: Remove the indent in resolve_lbr_callchain_sample
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (46 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 47/60] perf header: Support CPU PMU capabilities Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 49/60] perf machine: Refine the function for LBR call stack reconstruction Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

The indent is unnecessary in resolve_lbr_callchain_sample.  Removing it
will make the following patch simpler.

Current code path for resolve_lbr_callchain_sample()

        /* LBR only affects the user callchain */
        if (i != chain_nr) {
                body of the function
                ....
                return 1;
        }

        return 0;

With the patch,

        /* LBR only affects the user callchain */
        if (i == chain_nr)
                return 0;

        body of the function
        ...
        return 1;

No functional changes.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-6-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 123 +++++++++++++++++++-------------------
 1 file changed, 63 insertions(+), 60 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 09845eae9c03..be1bd9277471 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2208,6 +2208,12 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	int chain_nr = min(max_stack, (int)chain->nr), i;
 	u8 cpumode = PERF_RECORD_MISC_USER;
 	u64 ip, branch_from = 0;
+	struct branch_stack *lbr_stack;
+	struct branch_entry *entries;
+	int lbr_nr, j, k;
+	bool branch;
+	struct branch_flags *flags;
+	int mix_chain_nr;
 
 	for (i = 0; i < chain_nr; i++) {
 		if (chain->ips[i] == PERF_CONTEXT_USER)
@@ -2215,71 +2221,68 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	}
 
 	/* LBR only affects the user callchain */
-	if (i != chain_nr) {
-		struct branch_stack *lbr_stack = sample->branch_stack;
-		struct branch_entry *entries = perf_sample__branch_entries(sample);
-		int lbr_nr = lbr_stack->nr, j, k;
-		bool branch;
-		struct branch_flags *flags;
-		/*
-		 * LBR callstack can only get user call chain.
-		 * The mix_chain_nr is kernel call chain
-		 * number plus LBR user call chain number.
-		 * i is kernel call chain number,
-		 * 1 is PERF_CONTEXT_USER,
-		 * lbr_nr + 1 is the user call chain number.
-		 * For details, please refer to the comments
-		 * in callchain__printf
-		 */
-		int mix_chain_nr = i + 1 + lbr_nr + 1;
-
-		for (j = 0; j < mix_chain_nr; j++) {
-			int err;
-			branch = false;
-			flags = NULL;
+	if (i == chain_nr)
+		return 0;
 
-			if (callchain_param.order == ORDER_CALLEE) {
-				if (j < i + 1)
-					ip = chain->ips[j];
-				else if (j > i + 1) {
-					k = j - i - 2;
-					ip = entries[k].from;
-					branch = true;
-					flags = &entries[k].flags;
-				} else {
-					ip = entries[0].to;
-					branch = true;
-					flags = &entries[0].flags;
-					branch_from = entries[0].from;
-				}
+	lbr_stack = sample->branch_stack;
+	entries = perf_sample__branch_entries(sample);
+	lbr_nr = lbr_stack->nr;
+	/*
+	 * LBR callstack can only get user call chain.
+	 * The mix_chain_nr is kernel call chain
+	 * number plus LBR user call chain number.
+	 * i is kernel call chain number,
+	 * 1 is PERF_CONTEXT_USER,
+	 * lbr_nr + 1 is the user call chain number.
+	 * For details, please refer to the comments
+	 * in callchain__printf
+	 */
+	mix_chain_nr = i + 1 + lbr_nr + 1;
+
+	for (j = 0; j < mix_chain_nr; j++) {
+		int err;
+
+		branch = false;
+		flags = NULL;
+
+		if (callchain_param.order == ORDER_CALLEE) {
+			if (j < i + 1)
+				ip = chain->ips[j];
+			else if (j > i + 1) {
+				k = j - i - 2;
+				ip = entries[k].from;
+				branch = true;
+				flags = &entries[k].flags;
 			} else {
-				if (j < lbr_nr) {
-					k = lbr_nr - j - 1;
-					ip = entries[k].from;
-					branch = true;
-					flags = &entries[k].flags;
-				}
-				else if (j > lbr_nr)
-					ip = chain->ips[i + 1 - (j - lbr_nr)];
-				else {
-					ip = entries[0].to;
-					branch = true;
-					flags = &entries[0].flags;
-					branch_from = entries[0].from;
-				}
+				ip = entries[0].to;
+				branch = true;
+				flags = &entries[0].flags;
+				branch_from = entries[0].from;
+			}
+		} else {
+			if (j < lbr_nr) {
+				k = lbr_nr - j - 1;
+				ip = entries[k].from;
+				branch = true;
+				flags = &entries[k].flags;
+			} else if (j > lbr_nr)
+				ip = chain->ips[i + 1 - (j - lbr_nr)];
+			else {
+				ip = entries[0].to;
+				branch = true;
+				flags = &entries[0].flags;
+				branch_from = entries[0].from;
 			}
-
-			err = add_callchain_ip(thread, cursor, parent,
-					       root_al, &cpumode, ip,
-					       branch, flags, NULL,
-					       branch_from);
-			if (err)
-				return (err < 0) ? err : 0;
 		}
-		return 1;
-	}
 
-	return 0;
+		err = add_callchain_ip(thread, cursor, parent,
+				       root_al, &cpumode, ip,
+				       branch, flags, NULL,
+				       branch_from);
+		if (err)
+			return (err < 0) ? err : 0;
+	}
+	return 1;
 }
 
 static int find_prev_cpumode(struct ip_callchain *chain, struct thread *thread,
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 49/60] perf machine: Refine the function for LBR call stack reconstruction
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (47 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 48/60] perf machine: Remove the indent in resolve_lbr_callchain_sample Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 50/60] perf machine: Factor out lbr_callchain_add_kernel_ip() Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

LBR only collect the user call stack. To reconstruct a call stack, both
kernel call stack and user call stack are required. The function
resolve_lbr_callchain_sample() mix the kernel call stack and user call
stack.

Now, with the help of HW idx, perf tool can reconstruct a more complete
call stack by adding some user call stack from previous sample. However,
current implementation is hard to be extended to support it.

Current code path for resolve_lbr_callchain_sample()

  for (j = 0; j < mix_chain_nr; j++) {
       if (ORDER_CALLEE) {
             if (kernel callchain)
                  Fill callchain info
             else if (LBR callchain)
                  Fill callchain info
       } else {
             if (LBR callchain)
                  Fill callchain info
             else if (kernel callchain)
                  Fill callchain info
       }
       add_callchain_ip();
  }

With the patch,

  if (ORDER_CALLEE) {
       for (j = 0; j < NUM of kernel callchain) {
             Fill callchain info
             add_callchain_ip();
       }
       for (; j < mix_chain_nr) {
             Fill callchain info
             add_callchain_ip();
       }
  } else {
       for (; j < NUM of LBR callchain) {
             Fill callchain info
             add_callchain_ip();
       }
       for (j = 0; j < mix_chain_nr) {
             Fill callchain info
             add_callchain_ip();
       }
  }

No functional changes.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-7-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 111 ++++++++++++++++++++++++++------------
 1 file changed, 76 insertions(+), 35 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index be1bd9277471..0da540e6f803 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2214,6 +2214,7 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	bool branch;
 	struct branch_flags *flags;
 	int mix_chain_nr;
+	int err;
 
 	for (i = 0; i < chain_nr; i++) {
 		if (chain->ips[i] == PERF_CONTEXT_USER)
@@ -2239,50 +2240,90 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	 */
 	mix_chain_nr = i + 1 + lbr_nr + 1;
 
-	for (j = 0; j < mix_chain_nr; j++) {
-		int err;
-
-		branch = false;
-		flags = NULL;
-
-		if (callchain_param.order == ORDER_CALLEE) {
-			if (j < i + 1)
-				ip = chain->ips[j];
-			else if (j > i + 1) {
-				k = j - i - 2;
-				ip = entries[k].from;
-				branch = true;
-				flags = &entries[k].flags;
-			} else {
-				ip = entries[0].to;
-				branch = true;
-				flags = &entries[0].flags;
-				branch_from = entries[0].from;
-			}
-		} else {
-			if (j < lbr_nr) {
-				k = lbr_nr - j - 1;
-				ip = entries[k].from;
-				branch = true;
-				flags = &entries[k].flags;
-			} else if (j > lbr_nr)
-				ip = chain->ips[i + 1 - (j - lbr_nr)];
-			else {
-				ip = entries[0].to;
-				branch = true;
-				flags = &entries[0].flags;
-				branch_from = entries[0].from;
-			}
+	if (callchain_param.order == ORDER_CALLEE) {
+		/* Add kernel ip */
+		for (j = 0; j < i + 1; j++) {
+			ip = chain->ips[j];
+			branch = false;
+			flags = NULL;
+			err = add_callchain_ip(thread, cursor, parent,
+					       root_al, &cpumode, ip,
+					       branch, flags, NULL,
+					       branch_from);
+			if (err)
+				goto error;
 		}
+		/* Add LBR ip from first entries.to */
+		ip = entries[0].to;
+		branch = true;
+		flags = &entries[0].flags;
+		branch_from = entries[0].from;
+		err = add_callchain_ip(thread, cursor, parent,
+				       root_al, &cpumode, ip,
+				       branch, flags, NULL,
+				       branch_from);
+		if (err)
+			goto error;
 
+		/* Add LBR ip from entries.from one by one. */
+		for (j = i + 2; j < mix_chain_nr; j++) {
+			k = j - i - 2;
+			ip = entries[k].from;
+			branch = true;
+			flags = &entries[k].flags;
+
+			err = add_callchain_ip(thread, cursor, parent,
+					       root_al, &cpumode, ip,
+					       branch, flags, NULL,
+					       branch_from);
+			if (err)
+				goto error;
+		}
+	} else {
+		/* Add LBR ip from entries.from one by one. */
+		for (j = 0; j < lbr_nr; j++) {
+			k = lbr_nr - j - 1;
+			ip = entries[k].from;
+			branch = true;
+			flags = &entries[k].flags;
+
+			err = add_callchain_ip(thread, cursor, parent,
+					       root_al, &cpumode, ip,
+					       branch, flags, NULL,
+					       branch_from);
+			if (err)
+				goto error;
+		}
+
+		/* Add LBR ip from first entries.to */
+		ip = entries[0].to;
+		branch = true;
+		flags = &entries[0].flags;
+		branch_from = entries[0].from;
 		err = add_callchain_ip(thread, cursor, parent,
 				       root_al, &cpumode, ip,
 				       branch, flags, NULL,
 				       branch_from);
 		if (err)
-			return (err < 0) ? err : 0;
+			goto error;
+
+		/* Add kernel ip */
+		for (j = lbr_nr + 1; j < mix_chain_nr; j++) {
+			ip = chain->ips[i + 1 - (j - lbr_nr)];
+			branch = false;
+			flags = NULL;
+			err = add_callchain_ip(thread, cursor, parent,
+					       root_al, &cpumode, ip,
+					       branch, flags, NULL,
+					       branch_from);
+			if (err)
+				goto error;
+		}
 	}
 	return 1;
+
+error:
+	return (err < 0) ? err : 0;
 }
 
 static int find_prev_cpumode(struct ip_callchain *chain, struct thread *thread,
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 50/60] perf machine: Factor out lbr_callchain_add_kernel_ip()
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (48 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 49/60] perf machine: Refine the function for LBR call stack reconstruction Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 51/60] perf machine: Factor out lbr_callchain_add_lbr_ip() Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

Both caller and callee needs to add kernel ip to callchain.  Factor out
lbr_callchain_add_kernel_ip() to improve code readability.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-8-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 67 ++++++++++++++++++++++++++-------------
 1 file changed, 45 insertions(+), 22 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 0da540e6f803..a7f75fd43b0f 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2190,6 +2190,40 @@ static int remove_loops(struct branch_entry *l, int nr,
 	return nr;
 }
 
+static int lbr_callchain_add_kernel_ip(struct thread *thread,
+				       struct callchain_cursor *cursor,
+				       struct perf_sample *sample,
+				       struct symbol **parent,
+				       struct addr_location *root_al,
+				       u64 branch_from,
+				       bool callee, int end)
+{
+	struct ip_callchain *chain = sample->callchain;
+	u8 cpumode = PERF_RECORD_MISC_USER;
+	int err, i;
+
+	if (callee) {
+		for (i = 0; i < end + 1; i++) {
+			err = add_callchain_ip(thread, cursor, parent,
+					       root_al, &cpumode, chain->ips[i],
+					       false, NULL, NULL, branch_from);
+			if (err)
+				return err;
+		}
+		return 0;
+	}
+
+	for (i = end; i >= 0; i--) {
+		err = add_callchain_ip(thread, cursor, parent,
+				       root_al, &cpumode, chain->ips[i],
+				       false, NULL, NULL, branch_from);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
 /*
  * Recolve LBR callstack chain sample
  * Return:
@@ -2242,17 +2276,12 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 
 	if (callchain_param.order == ORDER_CALLEE) {
 		/* Add kernel ip */
-		for (j = 0; j < i + 1; j++) {
-			ip = chain->ips[j];
-			branch = false;
-			flags = NULL;
-			err = add_callchain_ip(thread, cursor, parent,
-					       root_al, &cpumode, ip,
-					       branch, flags, NULL,
-					       branch_from);
-			if (err)
-				goto error;
-		}
+		err = lbr_callchain_add_kernel_ip(thread, cursor, sample,
+						  parent, root_al, branch_from,
+						  true, i);
+		if (err)
+			goto error;
+
 		/* Add LBR ip from first entries.to */
 		ip = entries[0].to;
 		branch = true;
@@ -2308,17 +2337,11 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 			goto error;
 
 		/* Add kernel ip */
-		for (j = lbr_nr + 1; j < mix_chain_nr; j++) {
-			ip = chain->ips[i + 1 - (j - lbr_nr)];
-			branch = false;
-			flags = NULL;
-			err = add_callchain_ip(thread, cursor, parent,
-					       root_al, &cpumode, ip,
-					       branch, flags, NULL,
-					       branch_from);
-			if (err)
-				goto error;
-		}
+		err = lbr_callchain_add_kernel_ip(thread, cursor, sample,
+						  parent, root_al, branch_from,
+						  false, i);
+		if (err)
+			goto error;
 	}
 	return 1;
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 51/60] perf machine: Factor out lbr_callchain_add_lbr_ip()
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (49 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 50/60] perf machine: Factor out lbr_callchain_add_kernel_ip() Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 52/60] perf thread: Add a knob for LBR stitch approach Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

Both caller and callee needs to add ip from LBR to callchain.
Factor out lbr_callchain_add_lbr_ip() to improve code readability.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-9-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 143 +++++++++++++++++++-------------------
 1 file changed, 73 insertions(+), 70 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index a7f75fd43b0f..f9d69fce584a 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2224,6 +2224,74 @@ static int lbr_callchain_add_kernel_ip(struct thread *thread,
 	return 0;
 }
 
+static int lbr_callchain_add_lbr_ip(struct thread *thread,
+				    struct callchain_cursor *cursor,
+				    struct perf_sample *sample,
+				    struct symbol **parent,
+				    struct addr_location *root_al,
+				    u64 *branch_from,
+				    bool callee)
+{
+	struct branch_stack *lbr_stack = sample->branch_stack;
+	struct branch_entry *entries = perf_sample__branch_entries(sample);
+	u8 cpumode = PERF_RECORD_MISC_USER;
+	int lbr_nr = lbr_stack->nr;
+	struct branch_flags *flags;
+	int err, i;
+	u64 ip;
+
+	if (callee) {
+		/* Add LBR ip from first entries.to */
+		ip = entries[0].to;
+		flags = &entries[0].flags;
+		*branch_from = entries[0].from;
+		err = add_callchain_ip(thread, cursor, parent,
+				       root_al, &cpumode, ip,
+				       true, flags, NULL,
+				       *branch_from);
+		if (err)
+			return err;
+
+		/* Add LBR ip from entries.from one by one. */
+		for (i = 0; i < lbr_nr; i++) {
+			ip = entries[i].from;
+			flags = &entries[i].flags;
+			err = add_callchain_ip(thread, cursor, parent,
+					       root_al, &cpumode, ip,
+					       true, flags, NULL,
+					       *branch_from);
+			if (err)
+				return err;
+		}
+		return 0;
+	}
+
+	/* Add LBR ip from entries.from one by one. */
+	for (i = lbr_nr - 1; i >= 0; i--) {
+		ip = entries[i].from;
+		flags = &entries[i].flags;
+		err = add_callchain_ip(thread, cursor, parent,
+				       root_al, &cpumode, ip,
+				       true, flags, NULL,
+				       *branch_from);
+		if (err)
+			return err;
+	}
+
+	/* Add LBR ip from first entries.to */
+	ip = entries[0].to;
+	flags = &entries[0].flags;
+	*branch_from = entries[0].from;
+	err = add_callchain_ip(thread, cursor, parent,
+			       root_al, &cpumode, ip,
+			       true, flags, NULL,
+			       *branch_from);
+	if (err)
+		return err;
+
+	return 0;
+}
+
 /*
  * Recolve LBR callstack chain sample
  * Return:
@@ -2240,14 +2308,7 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 {
 	struct ip_callchain *chain = sample->callchain;
 	int chain_nr = min(max_stack, (int)chain->nr), i;
-	u8 cpumode = PERF_RECORD_MISC_USER;
-	u64 ip, branch_from = 0;
-	struct branch_stack *lbr_stack;
-	struct branch_entry *entries;
-	int lbr_nr, j, k;
-	bool branch;
-	struct branch_flags *flags;
-	int mix_chain_nr;
+	u64 branch_from = 0;
 	int err;
 
 	for (i = 0; i < chain_nr; i++) {
@@ -2259,21 +2320,6 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	if (i == chain_nr)
 		return 0;
 
-	lbr_stack = sample->branch_stack;
-	entries = perf_sample__branch_entries(sample);
-	lbr_nr = lbr_stack->nr;
-	/*
-	 * LBR callstack can only get user call chain.
-	 * The mix_chain_nr is kernel call chain
-	 * number plus LBR user call chain number.
-	 * i is kernel call chain number,
-	 * 1 is PERF_CONTEXT_USER,
-	 * lbr_nr + 1 is the user call chain number.
-	 * For details, please refer to the comments
-	 * in callchain__printf
-	 */
-	mix_chain_nr = i + 1 + lbr_nr + 1;
-
 	if (callchain_param.order == ORDER_CALLEE) {
 		/* Add kernel ip */
 		err = lbr_callchain_add_kernel_ip(thread, cursor, sample,
@@ -2282,57 +2328,14 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 		if (err)
 			goto error;
 
-		/* Add LBR ip from first entries.to */
-		ip = entries[0].to;
-		branch = true;
-		flags = &entries[0].flags;
-		branch_from = entries[0].from;
-		err = add_callchain_ip(thread, cursor, parent,
-				       root_al, &cpumode, ip,
-				       branch, flags, NULL,
-				       branch_from);
+		err = lbr_callchain_add_lbr_ip(thread, cursor, sample, parent,
+					       root_al, &branch_from, true);
 		if (err)
 			goto error;
 
-		/* Add LBR ip from entries.from one by one. */
-		for (j = i + 2; j < mix_chain_nr; j++) {
-			k = j - i - 2;
-			ip = entries[k].from;
-			branch = true;
-			flags = &entries[k].flags;
-
-			err = add_callchain_ip(thread, cursor, parent,
-					       root_al, &cpumode, ip,
-					       branch, flags, NULL,
-					       branch_from);
-			if (err)
-				goto error;
-		}
 	} else {
-		/* Add LBR ip from entries.from one by one. */
-		for (j = 0; j < lbr_nr; j++) {
-			k = lbr_nr - j - 1;
-			ip = entries[k].from;
-			branch = true;
-			flags = &entries[k].flags;
-
-			err = add_callchain_ip(thread, cursor, parent,
-					       root_al, &cpumode, ip,
-					       branch, flags, NULL,
-					       branch_from);
-			if (err)
-				goto error;
-		}
-
-		/* Add LBR ip from first entries.to */
-		ip = entries[0].to;
-		branch = true;
-		flags = &entries[0].flags;
-		branch_from = entries[0].from;
-		err = add_callchain_ip(thread, cursor, parent,
-				       root_al, &cpumode, ip,
-				       branch, flags, NULL,
-				       branch_from);
+		err = lbr_callchain_add_lbr_ip(thread, cursor, sample, parent,
+					       root_al, &branch_from, false);
 		if (err)
 			goto error;
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 52/60] perf thread: Add a knob for LBR stitch approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (50 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 51/60] perf machine: Factor out lbr_callchain_add_lbr_ip() Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 53/60] perf thread: Save previous sample for LBR stitching approach Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

The LBR stitch approach should be disabled by default. Because

- The stitching approach base on LBR call stack technology. The known
  limitations of LBR call stack technology still apply to the approach,
  e.g. Exception handing such as setjmp/longjmp will have calls/returns
  not match.

- This approach is not foolproof. There can be cases where it creates
  incorrect call stacks from incorrect matches. There is no attempt to
  validate any matches in another way.

The 'lbr_stitch_enable' is used to indicate whether enable LBR stitch
approach, which is disabled by default. The following patch will
introduce a new option for each tools to enable the LBR stitch
approach.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-10-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/thread.c | 1 +
 tools/perf/util/thread.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 28b719388028..1f080db23615 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -47,6 +47,7 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 		thread->tid = tid;
 		thread->ppid = -1;
 		thread->cpu = -1;
+		thread->lbr_stitch_enable = false;
 		INIT_LIST_HEAD(&thread->namespaces_list);
 		INIT_LIST_HEAD(&thread->comm_list);
 		init_rwsem(&thread->namespaces_lock);
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 20b96b5d1f15..95294050cff2 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -46,6 +46,9 @@ struct thread {
 	struct srccode_state	srccode_state;
 	bool			filter;
 	int			filter_entry_depth;
+
+	/* LBR call stack stitch */
+	bool			lbr_stitch_enable;
 };
 
 struct machine;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 53/60] perf thread: Save previous sample for LBR stitching approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (51 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 52/60] perf thread: Add a knob for LBR stitch approach Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 54/60] perf callchain: Save previous cursor nodes " Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

To retrieve the overwritten LBRs from previous sample for LBR stitching
approach, perf has to save the previous sample.

Only allocate the struct lbr_stitch once, when LBR stitching approach is
enabled and kernel supports hw_idx.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-11-kan.liang@linux.intel.com
[ Use zalloc()/zfree() for thread->lbr_stitch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 23 +++++++++++++++++++++++
 tools/perf/util/thread.c  |  1 +
 tools/perf/util/thread.h  | 12 ++++++++++++
 3 files changed, 36 insertions(+)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index f9d69fce584a..a54ca09a1d00 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2292,6 +2292,21 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 	return 0;
 }
 
+static bool alloc_lbr_stitch(struct thread *thread)
+{
+	if (thread->lbr_stitch)
+		return true;
+
+	thread->lbr_stitch = zalloc(sizeof(*thread->lbr_stitch));
+	if (!thread->lbr_stitch)
+		goto err;
+
+err:
+	pr_warning("Failed to allocate space for stitched LBRs. Disable LBR stitch\n");
+	thread->lbr_stitch_enable = false;
+	return false;
+}
+
 /*
  * Recolve LBR callstack chain sample
  * Return:
@@ -2308,6 +2323,7 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 {
 	struct ip_callchain *chain = sample->callchain;
 	int chain_nr = min(max_stack, (int)chain->nr), i;
+	struct lbr_stitch *lbr_stitch;
 	u64 branch_from = 0;
 	int err;
 
@@ -2320,6 +2336,13 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	if (i == chain_nr)
 		return 0;
 
+	if (thread->lbr_stitch_enable && !sample->no_hw_idx &&
+	    alloc_lbr_stitch(thread)) {
+		lbr_stitch = thread->lbr_stitch;
+
+		memcpy(&lbr_stitch->prev_sample, sample, sizeof(*sample));
+	}
+
 	if (callchain_param.order == ORDER_CALLEE) {
 		/* Add kernel ip */
 		err = lbr_callchain_add_kernel_ip(thread, cursor, sample,
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 1f080db23615..8d0da260c84c 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -111,6 +111,7 @@ void thread__delete(struct thread *thread)
 
 	exit_rwsem(&thread->namespaces_lock);
 	exit_rwsem(&thread->comm_lock);
+	thread__free_stitch_list(thread);
 	free(thread);
 }
 
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 95294050cff2..34eb61cee6a4 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -5,6 +5,7 @@
 #include <linux/refcount.h>
 #include <linux/rbtree.h>
 #include <linux/list.h>
+#include <linux/zalloc.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -13,6 +14,7 @@
 #include <strlist.h>
 #include <intlist.h>
 #include "rwsem.h"
+#include "event.h"
 
 struct addr_location;
 struct map;
@@ -20,6 +22,10 @@ struct perf_record_namespaces;
 struct thread_stack;
 struct unwind_libunwind_ops;
 
+struct lbr_stitch {
+	struct perf_sample		prev_sample;
+};
+
 struct thread {
 	union {
 		struct rb_node	 rb_node;
@@ -49,6 +55,7 @@ struct thread {
 
 	/* LBR call stack stitch */
 	bool			lbr_stitch_enable;
+	struct lbr_stitch	*lbr_stitch;
 };
 
 struct machine;
@@ -145,4 +152,9 @@ static inline bool thread__is_filtered(struct thread *thread)
 	return false;
 }
 
+static inline void thread__free_stitch_list(struct thread *thread)
+{
+	zfree(&thread->lbr_stitch);
+}
+
 #endif	/* __PERF_THREAD_H */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 54/60] perf callchain: Save previous cursor nodes for LBR stitching approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (52 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 53/60] perf thread: Save previous sample for LBR stitching approach Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 55/60] perf callchain: Stitch LBR call stack Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

The cursor nodes which generates from sample are eventually added into
callchain. To avoid generating cursor nodes from previous samples again,
the previous cursor nodes are also saved for LBR stitching approach.

Some option, e.g. hide-unresolved, may hide some LBRs.  Add a variable
'valid' in struct callchain_cursor_node to indicate this case. The LBR
stitching approach will only append the valid cursor nodes from previous
samples later.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-12-kan.liang@linux.intel.com
[ Use zfree() instead of open coded equivalent, and use it when freeing members of structs ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/callchain.h |  3 ++
 tools/perf/util/machine.c   | 76 +++++++++++++++++++++++++++++++++++--
 tools/perf/util/thread.h    |  8 ++++
 3 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 706bb7bbe1e1..cb33cd42ff43 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -143,6 +143,9 @@ struct callchain_cursor_node {
 	u64				ip;
 	struct map_symbol		ms;
 	const char			*srcline;
+	/* Indicate valid cursor node for LBR stitch */
+	bool				valid;
+
 	bool				branch;
 	struct branch_flags		branch_flags;
 	u64				branch_from;
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index a54ca09a1d00..737dee723a57 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2224,6 +2224,31 @@ static int lbr_callchain_add_kernel_ip(struct thread *thread,
 	return 0;
 }
 
+static void save_lbr_cursor_node(struct thread *thread,
+				 struct callchain_cursor *cursor,
+				 int idx)
+{
+	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
+
+	if (!lbr_stitch)
+		return;
+
+	if (cursor->pos == cursor->nr) {
+		lbr_stitch->prev_lbr_cursor[idx].valid = false;
+		return;
+	}
+
+	if (!cursor->curr)
+		cursor->curr = cursor->first;
+	else
+		cursor->curr = cursor->curr->next;
+	memcpy(&lbr_stitch->prev_lbr_cursor[idx], cursor->curr,
+	       sizeof(struct callchain_cursor_node));
+
+	lbr_stitch->prev_lbr_cursor[idx].valid = true;
+	cursor->pos++;
+}
+
 static int lbr_callchain_add_lbr_ip(struct thread *thread,
 				    struct callchain_cursor *cursor,
 				    struct perf_sample *sample,
@@ -2240,6 +2265,21 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 	int err, i;
 	u64 ip;
 
+	/*
+	 * The curr and pos are not used in writing session. They are cleared
+	 * in callchain_cursor_commit() when the writing session is closed.
+	 * Using curr and pos to track the current cursor node.
+	 */
+	if (thread->lbr_stitch) {
+		cursor->curr = NULL;
+		cursor->pos = cursor->nr;
+		if (cursor->nr) {
+			cursor->curr = cursor->first;
+			for (i = 0; i < (int)(cursor->nr - 1); i++)
+				cursor->curr = cursor->curr->next;
+		}
+	}
+
 	if (callee) {
 		/* Add LBR ip from first entries.to */
 		ip = entries[0].to;
@@ -2252,6 +2292,20 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 		if (err)
 			return err;
 
+		/*
+		 * The number of cursor node increases.
+		 * Move the current cursor node.
+		 * But does not need to save current cursor node for entry 0.
+		 * It's impossible to stitch the whole LBRs of previous sample.
+		 */
+		if (thread->lbr_stitch && (cursor->pos != cursor->nr)) {
+			if (!cursor->curr)
+				cursor->curr = cursor->first;
+			else
+				cursor->curr = cursor->curr->next;
+			cursor->pos++;
+		}
+
 		/* Add LBR ip from entries.from one by one. */
 		for (i = 0; i < lbr_nr; i++) {
 			ip = entries[i].from;
@@ -2262,6 +2316,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 					       *branch_from);
 			if (err)
 				return err;
+			save_lbr_cursor_node(thread, cursor, i);
 		}
 		return 0;
 	}
@@ -2276,6 +2331,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 				       *branch_from);
 		if (err)
 			return err;
+		save_lbr_cursor_node(thread, cursor, i);
 	}
 
 	/* Add LBR ip from first entries.to */
@@ -2292,7 +2348,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 	return 0;
 }
 
-static bool alloc_lbr_stitch(struct thread *thread)
+static bool alloc_lbr_stitch(struct thread *thread, unsigned int max_lbr)
 {
 	if (thread->lbr_stitch)
 		return true;
@@ -2301,6 +2357,14 @@ static bool alloc_lbr_stitch(struct thread *thread)
 	if (!thread->lbr_stitch)
 		goto err;
 
+	thread->lbr_stitch->prev_lbr_cursor = calloc(max_lbr + 1, sizeof(struct callchain_cursor_node));
+	if (!thread->lbr_stitch->prev_lbr_cursor)
+		goto free_lbr_stitch;
+
+	return true;
+
+free_lbr_stitch:
+	zfree(&thread->lbr_stitch);
 err:
 	pr_warning("Failed to allocate space for stitched LBRs. Disable LBR stitch\n");
 	thread->lbr_stitch_enable = false;
@@ -2319,7 +2383,8 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 					struct perf_sample *sample,
 					struct symbol **parent,
 					struct addr_location *root_al,
-					int max_stack)
+					int max_stack,
+					unsigned int max_lbr)
 {
 	struct ip_callchain *chain = sample->callchain;
 	int chain_nr = min(max_stack, (int)chain->nr), i;
@@ -2337,7 +2402,7 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 		return 0;
 
 	if (thread->lbr_stitch_enable && !sample->no_hw_idx &&
-	    alloc_lbr_stitch(thread)) {
+	    (max_lbr > 0) && alloc_lbr_stitch(thread, max_lbr)) {
 		lbr_stitch = thread->lbr_stitch;
 
 		memcpy(&lbr_stitch->prev_sample, sample, sizeof(*sample));
@@ -2417,8 +2482,11 @@ static int thread__resolve_callchain_sample(struct thread *thread,
 		chain_nr = chain->nr;
 
 	if (perf_evsel__has_branch_callstack(evsel)) {
+		struct perf_env *env = perf_evsel__env(evsel);
+
 		err = resolve_lbr_callchain_sample(thread, cursor, sample, parent,
-						   root_al, max_stack);
+						   root_al, max_stack,
+						   !env ? 0 : env->max_branches);
 		if (err)
 			return (err < 0) ? err : 0;
 	}
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 34eb61cee6a4..8456174a52c5 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -15,6 +15,7 @@
 #include <intlist.h>
 #include "rwsem.h"
 #include "event.h"
+#include "callchain.h"
 
 struct addr_location;
 struct map;
@@ -24,6 +25,7 @@ struct unwind_libunwind_ops;
 
 struct lbr_stitch {
 	struct perf_sample		prev_sample;
+	struct callchain_cursor_node	*prev_lbr_cursor;
 };
 
 struct thread {
@@ -154,6 +156,12 @@ static inline bool thread__is_filtered(struct thread *thread)
 
 static inline void thread__free_stitch_list(struct thread *thread)
 {
+	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
+
+	if (!lbr_stitch)
+		return;
+
+	zfree(&lbr_stitch->prev_lbr_cursor);
 	zfree(&thread->lbr_stitch);
 }
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 55/60] perf callchain: Stitch LBR call stack
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (53 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 54/60] perf callchain: Save previous cursor nodes " Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 56/60] perf report: Add option to enable the LBR stitching approach Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

In LBR call stack mode, the depth of reconstructed LBR call stack limits
to the number of LBR registers.

  For example, on skylake, the depth of reconstructed LBR call stack is
  always <= 32.

  # To display the perf.data header info, please use
  # --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 6K of event 'cycles'
  # Event count (approx.): 6487119731
  #
  # Children      Self  Command          Shared Object       Symbol
  # ........  ........  ...............  ..................
  # ................................

    99.97%    99.97%  tchain_edit      tchain_edit        [.] f43
            |
             --99.64%--f11
                       f12
                       f13
                       f14
                       f15
                       f16
                       f17
                       f18
                       f19
                       f20
                       f21
                       f22
                       f23
                       f24
                       f25
                       f26
                       f27
                       f28
                       f29
                       f30
                       f31
                       f32
                       f33
                       f34
                       f35
                       f36
                       f37
                       f38
                       f39
                       f40
                       f41
                       f42
                       f43

For a call stack which is deeper than LBR limit, HW will overwrite the
LBR register with oldest branch. Only partial call stacks can be
reconstructed.

However, the overwritten LBRs may still be retrieved from previous
sample. At that moment, HW hasn't overwritten the LBR registers yet.
Perf tools can stitch those overwritten LBRs on current call stacks to
get a more complete call stack.

To determine if LBRs can be stitched, perf tools need to compare current
sample with previous sample.

- They should have identical LBR records (Same from, to and flags
  values, and the same physical index of LBR registers).

- The searching starts from the base-of-stack of current sample.

Once perf determines to stitch the previous LBRs, the corresponding LBR
cursor nodes will be copied to 'lists'.  The 'lists' is to track the LBR
cursor nodes which are going to be stitched.

When the stitching is over, the nodes will not be freed immediately.
They will be moved to 'free_lists'. Next stitching may reuse the space.
Both 'lists' and 'free_lists' will be freed when all samples are
processed.

Committer notes:

Fix the intel-pt.c initialization of the union with 'struct
branch_flags', that breaks the build with its unnamed union on older gcc
versions.

Uninline thread__free_stitch_list(), as it grew big and started dragging
includes to thread.h, so move it to thread.c where what it needs in
terms of headers are already there.

This fixes the build in several systems such as debian:experimental when
cross building to the MIPS32 architecture, i.e. in the other cases what
was needed was being included by sheer luck.

  In file included from builtin-sched.c:11:
  util/thread.h: In function 'thread__free_stitch_list':
  util/thread.h:169:3: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
    169 |   free(pos);
        |   ^~~~
  util/thread.h:169:3: error: incompatible implicit declaration of built-in function 'free' [-Werror]
  util/thread.h:19:1: note: include '<stdlib.h>' or provide a declaration of 'free'
     18 | #include "callchain.h"
    +++ |+#include <stdlib.h>
     19 |
  util/thread.h:174:3: error: incompatible implicit declaration of built-in function 'free' [-Werror]
    174 |   free(pos);
        |   ^~~~
  util/thread.h:174:3: note: include '<stdlib.h>' or provide a declaration of 'free'

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-13-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/branch.h    |  19 +++--
 tools/perf/util/callchain.h |   5 ++
 tools/perf/util/intel-pt.c  |  17 +++--
 tools/perf/util/machine.c   | 139 +++++++++++++++++++++++++++++++++++-
 tools/perf/util/thread.c    |  22 ++++++
 tools/perf/util/thread.h    |  14 +---
 6 files changed, 188 insertions(+), 28 deletions(-)

diff --git a/tools/perf/util/branch.h b/tools/perf/util/branch.h
index 154a05cd03af..4d3f02fa223d 100644
--- a/tools/perf/util/branch.h
+++ b/tools/perf/util/branch.h
@@ -15,13 +15,18 @@
 #include "event.h"
 
 struct branch_flags {
-	u64 mispred:1;
-	u64 predicted:1;
-	u64 in_tx:1;
-	u64 abort:1;
-	u64 cycles:16;
-	u64 type:4;
-	u64 reserved:40;
+	union {
+		u64 value;
+		struct {
+			u64 mispred:1;
+			u64 predicted:1;
+			u64 in_tx:1;
+			u64 abort:1;
+			u64 cycles:16;
+			u64 type:4;
+			u64 reserved:40;
+		};
+	};
 };
 
 struct branch_info {
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index cb33cd42ff43..8f668ee29f25 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -154,6 +154,11 @@ struct callchain_cursor_node {
 	struct callchain_cursor_node	*next;
 };
 
+struct stitch_list {
+	struct list_head		node;
+	struct callchain_cursor_node	cursor;
+};
+
 struct callchain_cursor {
 	u64				nr;
 	struct callchain_cursor_node	*first;
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index a659b4a1b3f2..4be7634dccf5 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1717,15 +1717,14 @@ static u64 intel_pt_lbr_flags(u64 info)
 	union {
 		struct branch_flags flags;
 		u64 result;
-	} u = {
-		.flags = {
-			.mispred	= !!(info & LBR_INFO_MISPRED),
-			.predicted	= !(info & LBR_INFO_MISPRED),
-			.in_tx		= !!(info & LBR_INFO_IN_TX),
-			.abort		= !!(info & LBR_INFO_ABORT),
-			.cycles		= info & LBR_INFO_CYCLES,
-		}
-	};
+	} u;
+
+	u.result	  = 0;
+	u.flags.mispred	  = !!(info & LBR_INFO_MISPRED);
+	u.flags.predicted = !(info & LBR_INFO_MISPRED);
+	u.flags.in_tx	  = !!(info & LBR_INFO_IN_TX);
+	u.flags.abort	  = !!(info & LBR_INFO_ABORT);
+	u.flags.cycles	  = info & LBR_INFO_CYCLES;
 
 	return u.result;
 }
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 737dee723a57..5ac32cabe4e6 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2348,6 +2348,119 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
 	return 0;
 }
 
+static int lbr_callchain_add_stitched_lbr_ip(struct thread *thread,
+					     struct callchain_cursor *cursor)
+{
+	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
+	struct callchain_cursor_node *cnode;
+	struct stitch_list *stitch_node;
+	int err;
+
+	list_for_each_entry(stitch_node, &lbr_stitch->lists, node) {
+		cnode = &stitch_node->cursor;
+
+		err = callchain_cursor_append(cursor, cnode->ip,
+					      &cnode->ms,
+					      cnode->branch,
+					      &cnode->branch_flags,
+					      cnode->nr_loop_iter,
+					      cnode->iter_cycles,
+					      cnode->branch_from,
+					      cnode->srcline);
+		if (err)
+			return err;
+	}
+	return 0;
+}
+
+static struct stitch_list *get_stitch_node(struct thread *thread)
+{
+	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
+	struct stitch_list *stitch_node;
+
+	if (!list_empty(&lbr_stitch->free_lists)) {
+		stitch_node = list_first_entry(&lbr_stitch->free_lists,
+					       struct stitch_list, node);
+		list_del(&stitch_node->node);
+
+		return stitch_node;
+	}
+
+	return malloc(sizeof(struct stitch_list));
+}
+
+static bool has_stitched_lbr(struct thread *thread,
+			     struct perf_sample *cur,
+			     struct perf_sample *prev,
+			     unsigned int max_lbr,
+			     bool callee)
+{
+	struct branch_stack *cur_stack = cur->branch_stack;
+	struct branch_entry *cur_entries = perf_sample__branch_entries(cur);
+	struct branch_stack *prev_stack = prev->branch_stack;
+	struct branch_entry *prev_entries = perf_sample__branch_entries(prev);
+	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
+	int i, j, nr_identical_branches = 0;
+	struct stitch_list *stitch_node;
+	u64 cur_base, distance;
+
+	if (!cur_stack || !prev_stack)
+		return false;
+
+	/* Find the physical index of the base-of-stack for current sample. */
+	cur_base = max_lbr - cur_stack->nr + cur_stack->hw_idx + 1;
+
+	distance = (prev_stack->hw_idx > cur_base) ? (prev_stack->hw_idx - cur_base) :
+						     (max_lbr + prev_stack->hw_idx - cur_base);
+	/* Previous sample has shorter stack. Nothing can be stitched. */
+	if (distance + 1 > prev_stack->nr)
+		return false;
+
+	/*
+	 * Check if there are identical LBRs between two samples.
+	 * Identicall LBRs must have same from, to and flags values. Also,
+	 * they have to be saved in the same LBR registers (same physical
+	 * index).
+	 *
+	 * Starts from the base-of-stack of current sample.
+	 */
+	for (i = distance, j = cur_stack->nr - 1; (i >= 0) && (j >= 0); i--, j--) {
+		if ((prev_entries[i].from != cur_entries[j].from) ||
+		    (prev_entries[i].to != cur_entries[j].to) ||
+		    (prev_entries[i].flags.value != cur_entries[j].flags.value))
+			break;
+		nr_identical_branches++;
+	}
+
+	if (!nr_identical_branches)
+		return false;
+
+	/*
+	 * Save the LBRs between the base-of-stack of previous sample
+	 * and the base-of-stack of current sample into lbr_stitch->lists.
+	 * These LBRs will be stitched later.
+	 */
+	for (i = prev_stack->nr - 1; i > (int)distance; i--) {
+
+		if (!lbr_stitch->prev_lbr_cursor[i].valid)
+			continue;
+
+		stitch_node = get_stitch_node(thread);
+		if (!stitch_node)
+			return false;
+
+		memcpy(&stitch_node->cursor, &lbr_stitch->prev_lbr_cursor[i],
+		       sizeof(struct callchain_cursor_node));
+
+		if (callee)
+			list_add(&stitch_node->node, &lbr_stitch->lists);
+		else
+			list_add_tail(&stitch_node->node, &lbr_stitch->lists);
+	}
+
+	return true;
+}
+
 static bool alloc_lbr_stitch(struct thread *thread, unsigned int max_lbr)
 {
 	if (thread->lbr_stitch)
@@ -2361,6 +2474,9 @@ static bool alloc_lbr_stitch(struct thread *thread, unsigned int max_lbr)
 	if (!thread->lbr_stitch->prev_lbr_cursor)
 		goto free_lbr_stitch;
 
+	INIT_LIST_HEAD(&thread->lbr_stitch->lists);
+	INIT_LIST_HEAD(&thread->lbr_stitch->free_lists);
+
 	return true;
 
 free_lbr_stitch:
@@ -2386,9 +2502,11 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 					int max_stack,
 					unsigned int max_lbr)
 {
+	bool callee = (callchain_param.order == ORDER_CALLEE);
 	struct ip_callchain *chain = sample->callchain;
 	int chain_nr = min(max_stack, (int)chain->nr), i;
 	struct lbr_stitch *lbr_stitch;
+	bool stitched_lbr = false;
 	u64 branch_from = 0;
 	int err;
 
@@ -2405,10 +2523,18 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 	    (max_lbr > 0) && alloc_lbr_stitch(thread, max_lbr)) {
 		lbr_stitch = thread->lbr_stitch;
 
+		stitched_lbr = has_stitched_lbr(thread, sample,
+						&lbr_stitch->prev_sample,
+						max_lbr, callee);
+
+		if (!stitched_lbr && !list_empty(&lbr_stitch->lists)) {
+			list_replace_init(&lbr_stitch->lists,
+					  &lbr_stitch->free_lists);
+		}
 		memcpy(&lbr_stitch->prev_sample, sample, sizeof(*sample));
 	}
 
-	if (callchain_param.order == ORDER_CALLEE) {
+	if (callee) {
 		/* Add kernel ip */
 		err = lbr_callchain_add_kernel_ip(thread, cursor, sample,
 						  parent, root_al, branch_from,
@@ -2421,7 +2547,18 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
 		if (err)
 			goto error;
 
+		if (stitched_lbr) {
+			err = lbr_callchain_add_stitched_lbr_ip(thread, cursor);
+			if (err)
+				goto error;
+		}
+
 	} else {
+		if (stitched_lbr) {
+			err = lbr_callchain_add_stitched_lbr_ip(thread, cursor);
+			if (err)
+				goto error;
+		}
 		err = lbr_callchain_add_lbr_ip(thread, cursor, sample, parent,
 					       root_al, &branch_from, false);
 		if (err)
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 8d0da260c84c..665e5c0618ed 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -454,3 +454,25 @@ int thread__memcpy(struct thread *thread, struct machine *machine,
 
        return dso__data_read_offset(al.map->dso, machine, offset, buf, len);
 }
+
+void thread__free_stitch_list(struct thread *thread)
+{
+	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
+	struct stitch_list *pos, *tmp;
+
+	if (!lbr_stitch)
+		return;
+
+	list_for_each_entry_safe(pos, tmp, &lbr_stitch->lists, node) {
+		list_del_init(&pos->node);
+		free(pos);
+	}
+
+	list_for_each_entry_safe(pos, tmp, &lbr_stitch->free_lists, node) {
+		list_del_init(&pos->node);
+		free(pos);
+	}
+
+	zfree(&lbr_stitch->prev_lbr_cursor);
+	zfree(&thread->lbr_stitch);
+}
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 8456174a52c5..b066fb30d203 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -5,7 +5,6 @@
 #include <linux/refcount.h>
 #include <linux/rbtree.h>
 #include <linux/list.h>
-#include <linux/zalloc.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -24,6 +23,8 @@ struct thread_stack;
 struct unwind_libunwind_ops;
 
 struct lbr_stitch {
+	struct list_head		lists;
+	struct list_head		free_lists;
 	struct perf_sample		prev_sample;
 	struct callchain_cursor_node	*prev_lbr_cursor;
 };
@@ -154,15 +155,6 @@ static inline bool thread__is_filtered(struct thread *thread)
 	return false;
 }
 
-static inline void thread__free_stitch_list(struct thread *thread)
-{
-	struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
-
-	if (!lbr_stitch)
-		return;
-
-	zfree(&lbr_stitch->prev_lbr_cursor);
-	zfree(&thread->lbr_stitch);
-}
+void thread__free_stitch_list(struct thread *thread);
 
 #endif	/* __PERF_THREAD_H */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 56/60] perf report: Add option to enable the LBR stitching approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (54 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 55/60] perf callchain: Stitch LBR call stack Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 57/60] perf script: " Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov,
	Mathieu Poirier, Michael Ellerman, Pavel Gerasimov,
	Peter Zijlstra, Ravi Bangoria, Stephane Eranian,
	Vitaly Slobodskoy

From: Kan Liang <kan.liang@linux.intel.com>

With the LBR stitching approach, the reconstructed LBR call stack can
break the HW limitation. However, it may reconstruct invalid call stacks
in some cases, e.g. exception handing such as setjmp/longjmp.  Also, it
may impact the processing time especially when the number of samples
with stitched LBRs are huge.

Add an option to enable the approach.

  # To display the perf.data header info, please use
  # --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 6K of event 'cycles'
  # Event count (approx.): 6492797701
  #
  # Children      Self  Command          Shared Object       Symbol
  # ........  ........  ...............  ..................
  # .................................
  #
    99.99%    99.99%  tchain_edit      tchain_edit        [.] f43
            |
            ---main
               f1
               f2
               f3
               f4
               f5
               f6
               f7
               f8
               f9
               f10
               f11
               f12
               f13
               f14
               f15
               f16
               f17
               f18
               f19
               f20
               f21
               f22
               f23
               f24
               f25
               f26
               f27
               f28
               f29
               f30
               f31
               |
                --99.65%--f32
                          f33
                          f34
                          f35
                          f36
                          f37
                          f38
                          f39
                          f40
                          f41
                          f42
                          f43

Committer testing:

  $ perf record --call-graph lbr /wb/tchain_edit
  [ perf record: Woken up 23 times to write data ]
  [ perf record: Captured and wrote 5.578 MB perf.data (6839 samples) ]
  $ perf report --header-only | egrep 'cpu(desc|.*capabilities)'
  # cpudesc : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  # cpu pmu capabilities: branches=32, max_precise=3, pmu_name=skylake
  $

Before:

  $ perf report --no-children --stdio
  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 6K of event 'cycles:u'
  # Event count (approx.): 6459523879
  #
  # Overhead  Command      Shared Object     Symbol
  # ........  ...........  ................  .......................
  #
      99.95%  tchain_edit  tchain_edit       [.] f43
              |
               --99.92%--f43
                         f42
                         f41
                         f40
                         f39
                         f38
                         f37
                         f36
                         f35
                         f34
                         f33
                         f32
                         f31
                         f30
                         f29
                         f28
                         f27
                         f26
                         f25
                         f24
                         f23
                         f22
                         f21
                         f20
                         f19
                         f18
                         f17
                         f16
                         f15
                         f14
                         f13
                         f12
                         f11

       0.03%  tchain_edit  tchain_edit       [.] f42
       0.01%  tchain_edit  tchain_edit       [.] f41
       0.00%  tchain_edit  tchain_edit       [.] f31
       0.00%  tchain_edit  ld-2.29.so        [.] _dl_relocate_object
       0.00%  tchain_edit  ld-2.29.so        [.] memmove
       0.00%  tchain_edit  [unknown]         [k] 0xffffffff93a00b17

After:

  $ perf report --stitch-lbr --no-children --stdio
  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 6K of event 'cycles:u'
  # Event count (approx.): 6459496645
  #
  # Overhead  Command      Shared Object     Symbol
  # ........  ...........  ................  ........................
  #
      99.97%  tchain_edit  tchain_edit       [.] f43
              |
               --99.93%--f43
                         f42
                         f41
                         f40
                         f39
                         f38
                         f37
                         f36
                         f35
                         f34
                         f33
                         f32
                         f31
                         f30
                         f29
                         f28
                         f27
                         f26
                         f25
                         f24
                         f23
                         f22
                         f21
                         f20
                         f19
                         f18
                         f17
                         f16
                         f15
                         f14
                         f13
                         f12
                         f11
                         f10
                         f9
                         f8
                         f7
                         f6
                         f5
                         f4
                         f3
                         f2
                         f1
                         main
                         __libc_start_main

       0.02%  tchain_edit  [unknown]         [k] 0xffffffff93a00b17
       0.01%  tchain_edit  tchain_edit       [.] f31
       0.00%  tchain_edit  ld-2.29.so        [.] _dl_important_hwcaps

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-14-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-report.txt | 11 +++++++++++
 tools/perf/builtin-report.c              | 12 ++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index f569b9ea4002..d068103690cc 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -488,6 +488,17 @@ include::itrace.txt[]
 	This option extends the perf report to show reference callgraphs,
 	which collected by reference event, in no callgraph event.
 
+--stitch-lbr::
+	Show callgraph with stitched LBRs, which may have more complete
+	callgraph. The perf.data file must have been obtained using
+	perf record --call-graph lbr.
+	Disabled by default. In common cases with call stack overflows,
+	it can recreate better call stacks than the default lbr call stack
+	output. But this approach is not full proof. There can be cases
+	where it creates incorrect call stacks from incorrect matches.
+	The known limitations include exception handing such as
+	setjmp/longjmp will have calls/returns not match.
+
 --socket-filter::
 	Only report the samples on the processor socket that match with this filter
 
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c0cebd53ecf9..0c32767b1c56 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -84,6 +84,7 @@ struct report {
 	bool			header_only;
 	bool			nonany_branch_mode;
 	bool			group_set;
+	bool			stitch_lbr;
 	int			max_stack;
 	struct perf_read_values	show_threads_values;
 	struct annotation_options annotation_opts;
@@ -267,6 +268,9 @@ static int process_sample_event(struct perf_tool *tool,
 		return -1;
 	}
 
+	if (rep->stitch_lbr)
+		al.thread->lbr_stitch_enable = true;
+
 	if (symbol_conf.hide_unresolved && al.sym == NULL)
 		goto out_put;
 
@@ -408,6 +412,12 @@ static int report__setup_sample_type(struct report *rep)
 			callchain_param.record_mode = CALLCHAIN_FP;
 	}
 
+	if (rep->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) {
+		ui__warning("Can't find LBR callchain. Switch off --stitch-lbr.\n"
+			    "Please apply --call-graph lbr when recording.\n");
+		rep->stitch_lbr = false;
+	}
+
 	/* ??? handle more cases than just ANY? */
 	if (!(perf_evlist__combined_branch_type(session->evlist) &
 				PERF_SAMPLE_BRANCH_ANY))
@@ -1258,6 +1268,8 @@ int cmd_report(int argc, const char **argv)
 			"Show full source file name path for source lines"),
 	OPT_BOOLEAN(0, "show-ref-call-graph", &symbol_conf.show_ref_callgraph,
 		    "Show callgraph from reference event"),
+	OPT_BOOLEAN(0, "stitch-lbr", &report.stitch_lbr,
+		    "Enable LBR callgraph stitching approach"),
 	OPT_INTEGER(0, "socket-filter", &report.socket_filter,
 		    "only show processor socket that match with this filter"),
 	OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace,
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 57/60] perf script: Add option to enable the LBR stitching approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (55 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 56/60] perf report: Add option to enable the LBR stitching approach Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 58/60] perf top: " Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov,
	Mathieu Poirier, Michael Ellerman, Pavel Gerasimov,
	Peter Zijlstra, Ravi Bangoria, Stephane Eranian,
	Vitaly Slobodskoy

From: Kan Liang <kan.liang@linux.intel.com>

With the LBR stitching approach, the reconstructed LBR call stack can
break the HW limitation. However, it may reconstruct invalid call stacks
in some cases, e.g. exception handing such as setjmp/longjmp.  Also, it
may impact the processing time especially when the number of samples
with stitched LBRs are huge.

Add an option to enable the approach.

Committer testing:

Using the same perf.data as with the latest cset committer testing
section:

  $ perf script --stitch-lbr
  <SNIP>
  tchain_edit 11131 15164.984292:     437491 cycles:u:
                    401106 f43+0x0 (/wb/tchain_edit)
                    40114c f42+0x18 (/wb/tchain_edit)
                    401172 f41+0xe (/wb/tchain_edit)
                    401194 f40+0x0 (/wb/tchain_edit)
                    40119b f39+0x0 (/wb/tchain_edit)
                    4011a2 f38+0x0 (/wb/tchain_edit)
                    4011a9 f37+0x0 (/wb/tchain_edit)
                    4011b0 f36+0x0 (/wb/tchain_edit)
                    4011b7 f35+0x0 (/wb/tchain_edit)
                    4011be f34+0x0 (/wb/tchain_edit)
                    4011c5 f33+0x0 (/wb/tchain_edit)
                    4011cc f32+0x0 (/wb/tchain_edit)
                    401207 f31+0x34 (/wb/tchain_edit)
                    401212 f30+0x0 (/wb/tchain_edit)
                    401219 f29+0x0 (/wb/tchain_edit)
                    401220 f28+0x0 (/wb/tchain_edit)
                    401227 f27+0x0 (/wb/tchain_edit)
                    40122e f26+0x0 (/wb/tchain_edit)
                    401235 f25+0x0 (/wb/tchain_edit)
                    40123c f24+0x0 (/wb/tchain_edit)
                    401243 f23+0x0 (/wb/tchain_edit)
                    40124a f22+0x0 (/wb/tchain_edit)
                    401251 f21+0x0 (/wb/tchain_edit)
                    401258 f20+0x0 (/wb/tchain_edit)
                    40125f f19+0x0 (/wb/tchain_edit)
                    401266 f18+0x0 (/wb/tchain_edit)
                    40126d f17+0x0 (/wb/tchain_edit)
                    401274 f16+0x0 (/wb/tchain_edit)
                    40127b f15+0x0 (/wb/tchain_edit)
                    401282 f14+0x0 (/wb/tchain_edit)
                    401289 f13+0x0 (/wb/tchain_edit)
                    401290 f12+0x0 (/wb/tchain_edit)
                    401297 f11+0x0 (/wb/tchain_edit)
                    40129e f10+0x0 (/wb/tchain_edit)
                    4012a5 f9+0x0 (/wb/tchain_edit)
                    4012ac f8+0x0 (/wb/tchain_edit)
                    4012b3 f7+0x0 (/wb/tchain_edit)
                    4012ba f6+0x0 (/wb/tchain_edit)
                    4012c1 f5+0x0 (/wb/tchain_edit)
                    4012c8 f4+0x0 (/wb/tchain_edit)
                    4012cf f3+0x0 (/wb/tchain_edit)
                    4012d6 f2+0x0 (/wb/tchain_edit)
                    4012dd f1+0x0 (/wb/tchain_edit)
                    4012e4 main+0x0 (/wb/tchain_edit)
              7f41a5016f41 __libc_start_main+0xf1 (/usr/lib64/libc-2.29.so)
  <SNIP>
  $

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-15-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-script.txt | 11 +++++++++++
 tools/perf/builtin-script.c              | 12 ++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 963487e82edc..372dfd110e6d 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -440,6 +440,17 @@ include::itrace.txt[]
 --show-on-off-events::
 	Show the --switch-on/off events too.
 
+--stitch-lbr::
+	Show callgraph with stitched LBRs, which may have more complete
+	callgraph. The perf.data file must have been obtained using
+	perf record --call-graph lbr.
+	Disabled by default. In common cases with call stack overflows,
+	it can recreate better call stacks than the default lbr call stack
+	output. But this approach is not full proof. There can be cases
+	where it creates incorrect call stacks from incorrect matches.
+	The known limitations include exception handing such as
+	setjmp/longjmp will have calls/returns not match.
+
 SEE ALSO
 --------
 linkperf:perf-record[1], linkperf:perf-script-perl[1],
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 06b511c0a539..a2236542900d 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1697,6 +1697,7 @@ struct perf_script {
 	bool			show_cgroup_events;
 	bool			allocated;
 	bool			per_event_dump;
+	bool			stitch_lbr;
 	struct evswitch		evswitch;
 	struct perf_cpu_map	*cpus;
 	struct perf_thread_map *threads;
@@ -1923,6 +1924,9 @@ static void process_event(struct perf_script *script,
 	if (PRINT_FIELD(IP)) {
 		struct callchain_cursor *cursor = NULL;
 
+		if (script->stitch_lbr)
+			al->thread->lbr_stitch_enable = true;
+
 		if (symbol_conf.use_callchain && sample->callchain &&
 		    thread__resolve_callchain(al->thread, &callchain_cursor, evsel,
 					      sample, NULL, NULL, scripting_max_stack) == 0)
@@ -3170,6 +3174,12 @@ static void script__setup_sample_type(struct perf_script *script)
 		else
 			callchain_param.record_mode = CALLCHAIN_FP;
 	}
+
+	if (script->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) {
+		pr_warning("Can't find LBR callchain. Switch off --stitch-lbr.\n"
+			   "Please apply --call-graph lbr when recording.\n");
+		script->stitch_lbr = false;
+	}
 }
 
 static int process_stat_round_event(struct perf_session *session,
@@ -3481,6 +3491,8 @@ int cmd_script(int argc, const char **argv)
 		   "file", "file saving guest os /proc/kallsyms"),
 	OPT_STRING(0, "guestmodules", &symbol_conf.default_guest_modules,
 		   "file", "file saving guest os /proc/modules"),
+	OPT_BOOLEAN('\0', "stitch-lbr", &script.stitch_lbr,
+		    "Enable LBR callgraph stitching approach"),
 	OPTS_EVSWITCH(&script.evswitch),
 	OPT_END()
 	};
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 58/60] perf top: Add option to enable the LBR stitching approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (56 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 57/60] perf script: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 59/60] perf c2c: " Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Arnaldo Carvalho de Melo, Adrian Hunter, Alexey Budankov,
	Mathieu Poirier, Michael Ellerman, Pavel Gerasimov,
	Peter Zijlstra, Ravi Bangoria, Stephane Eranian,
	Vitaly Slobodskoy

From: Kan Liang <kan.liang@linux.intel.com>

With the LBR stitching approach, the reconstructed LBR call stack
can break the HW limitation. However, it may reconstruct invalid call
stacks in some cases, e.g. exception handing such as setjmp/longjmp.
Also, it may impact the processing time especially when the number of
samples with stitched LBRs are huge.

Add an option to enable the approach.
The option must be used with --call-graph lbr.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-16-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-top.txt |  9 +++++++++
 tools/perf/builtin-top.c              | 11 +++++++++++
 tools/perf/util/top.h                 |  1 +
 3 files changed, 21 insertions(+)

diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index 487737a725e9..20227dabc208 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -319,6 +319,15 @@ Default is to monitor all CPUS.
 	go straight to the histogram browser, just like 'perf top' with no events
 	explicitely specified does.
 
+--stitch-lbr::
+	Show callgraph with stitched LBRs, which may have more complete
+	callgraph. The option must be used with --call-graph lbr recording.
+	Disabled by default. In common cases with call stack overflows,
+	it can recreate better call stacks than the default lbr call stack
+	output. But this approach is not full proof. There can be cases
+	where it creates incorrect call stacks from incorrect matches.
+	The known limitations include exception handing such as
+	setjmp/longjmp will have calls/returns not match.
 
 INTERACTIVE PROMPTING KEYS
 --------------------------
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 289cf83e658a..6b067a5ba1d5 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -33,6 +33,7 @@
 #include "util/map.h"
 #include "util/mmap.h"
 #include "util/session.h"
+#include "util/thread.h"
 #include "util/symbol.h"
 #include "util/synthetic-events.h"
 #include "util/top.h"
@@ -775,6 +776,9 @@ static void perf_event__process_sample(struct perf_tool *tool,
 	if (machine__resolve(machine, &al, sample) < 0)
 		return;
 
+	if (top->stitch_lbr)
+		al.thread->lbr_stitch_enable = true;
+
 	if (!machine->kptr_restrict_warned &&
 	    symbol_conf.kptr_restrict &&
 	    al.cpumode == PERF_RECORD_MISC_KERNEL) {
@@ -1571,6 +1575,8 @@ int cmd_top(int argc, const char **argv)
 		    "Sort the output by the event at the index n in group. "
 		    "If n is invalid, sort by the first event. "
 		    "WARNING: should be used on grouped events."),
+	OPT_BOOLEAN(0, "stitch-lbr", &top.stitch_lbr,
+		    "Enable LBR callgraph stitching approach"),
 	OPTS_EVSWITCH(&top.evswitch),
 	OPT_END()
 	};
@@ -1640,6 +1646,11 @@ int cmd_top(int argc, const char **argv)
 		}
 	}
 
+	if (top.stitch_lbr && !(callchain_param.record_mode == CALLCHAIN_LBR)) {
+		pr_err("Error: --stitch-lbr must be used with --call-graph lbr\n");
+		goto out_delete_evlist;
+	}
+
 	if (opts->branch_stack && callchain_param.enabled)
 		symbol_conf.show_branchflag_count = true;
 
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index f117d4f4821e..45dc84ddff37 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -36,6 +36,7 @@ struct perf_top {
 	bool		   use_tui, use_stdio;
 	bool		   vmlinux_warned;
 	bool		   dump_symtab;
+	bool		   stitch_lbr;
 	struct hist_entry  *sym_filter_entry;
 	struct evsel 	   *sym_evsel;
 	struct perf_session *session;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 59/60] perf c2c: Add option to enable the LBR stitching approach
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (57 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 58/60] perf top: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-20 11:53 ` [PATCH 60/60] perf hist: Add fast path for duplicate entries check Arnaldo Carvalho de Melo
  2020-04-22 12:09 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Andi Kleen, Jiri Olsa,
	Adrian Hunter, Alexey Budankov, Mathieu Poirier,
	Michael Ellerman, Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria,
	Stephane Eranian, Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

With the LBR stitching approach, the reconstructed LBR call stack can
break the HW limitation. However, it may reconstruct invalid call stacks
in some cases, e.g. exception handing such as setjmp/longjmp.  Also, it
may impact the processing time especially when the number of samples
with stitched LBRs are huge.

Add an option to enable the approach.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-17-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-c2c.txt | 11 +++++++++++
 tools/perf/builtin-c2c.c              | 12 ++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
index e6150f21267d..2133eb320cb0 100644
--- a/tools/perf/Documentation/perf-c2c.txt
+++ b/tools/perf/Documentation/perf-c2c.txt
@@ -111,6 +111,17 @@ REPORT OPTIONS
 --display::
 	Switch to HITM type (rmt, lcl) to display and sort on. Total HITMs as default.
 
+--stitch-lbr::
+	Show callgraph with stitched LBRs, which may have more complete
+	callgraph. The perf.data file must have been obtained using
+	perf c2c record --call-graph lbr.
+	Disabled by default. In common cases with call stack overflows,
+	it can recreate better call stacks than the default lbr call stack
+	output. But this approach is not full proof. There can be cases
+	where it creates incorrect call stacks from incorrect matches.
+	The known limitations include exception handing such as
+	setjmp/longjmp will have calls/returns not match.
+
 C2C RECORD
 ----------
 The perf c2c record command setup options related to HITM cacheline analysis
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 246ac0b4d54f..0d544c4fb4be 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -95,6 +95,7 @@ struct perf_c2c {
 	bool			 use_stdio;
 	bool			 stats_only;
 	bool			 symbol_full;
+	bool			 stitch_lbr;
 
 	/* HITM shared clines stats */
 	struct c2c_stats	hitm_stats;
@@ -273,6 +274,9 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
 		return -1;
 	}
 
+	if (c2c.stitch_lbr)
+		al.thread->lbr_stitch_enable = true;
+
 	ret = sample__resolve_callchain(sample, &callchain_cursor, NULL,
 					evsel, &al, sysctl_perf_event_max_stack);
 	if (ret)
@@ -2601,6 +2605,12 @@ static int setup_callchain(struct evlist *evlist)
 		}
 	}
 
+	if (c2c.stitch_lbr && (mode != CALLCHAIN_LBR)) {
+		ui__warning("Can't find LBR callchain. Switch off --stitch-lbr.\n"
+			    "Please apply --call-graph lbr when recording.\n");
+		c2c.stitch_lbr = false;
+	}
+
 	callchain_param.record_mode = mode;
 	callchain_param.min_percent = 0;
 	return 0;
@@ -2752,6 +2762,8 @@ static int perf_c2c__report(int argc, const char **argv)
 	OPT_STRING('c', "coalesce", &coalesce, "coalesce fields",
 		   "coalesce fields: pid,tid,iaddr,dso"),
 	OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
+	OPT_BOOLEAN(0, "stitch-lbr", &c2c.stitch_lbr,
+		    "Enable LBR callgraph stitching approach"),
 	OPT_PARENT(c2c_options),
 	OPT_END()
 	};
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ messages in thread

* [PATCH 60/60] perf hist: Add fast path for duplicate entries check
  2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (58 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 59/60] perf c2c: " Arnaldo Carvalho de Melo
@ 2020-04-20 11:53 ` Arnaldo Carvalho de Melo
  2020-04-22 12:09 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar
  60 siblings, 0 replies; 130+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-04-20 11:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: Jiri Olsa, Namhyung Kim, Clark Williams, linux-kernel,
	linux-perf-users, Kan Liang, Jiri Olsa, Adrian Hunter,
	Alexey Budankov, Andi Kleen, Mathieu Poirier, Michael Ellerman,
	Pavel Gerasimov, Peter Zijlstra, Ravi Bangoria, Stephane Eranian,
	Vitaly Slobodskoy, Arnaldo Carvalho de Melo

From: Kan Liang <kan.liang@linux.intel.com>

Perf checks the duplicate entries in a callchain before adding an entry.
However the check is very slow especially with deeper call stack.
Almost ~50% elapsed time of perf report is spent on the check when the
call stack is always depth of 32.

The hist_entry__cmp() is used to compare the new entry with the old
entries. It will go through all the available sorts in the sort_list,
and call the specific cmp of each sort, which is very slow.

Actually, for most cases, there are no duplicate entries in callchain.
The symbols are usually different. It's much faster to do a quick check
for symbols first. Only do the full cmp when the symbols are exactly the
same.

The quick check is only to check symbols, not dso. Export
_sort__sym_cmp.

  $ perf record --call-graph lbr ./tchain_edit_64

  Without the patch
  $time perf report --stdio
  real    0m21.142s
  user    0m21.110s
  sys     0m0.033s

  With the patch
  $time perf report --stdio
  real    0m10.977s
  user    0m10.948s
  sys     0m0.027s

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-18-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 23 +++++++++++++++++++++++
 tools/perf/util/sort.c |  2 +-
 tools/perf/util/sort.h |  2 ++
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 283a69ff6a3d..c2550dbe7dc3 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1070,6 +1070,20 @@ iter_next_cumulative_entry(struct hist_entry_iter *iter,
 	return fill_callchain_info(al, node, iter->hide_unresolved);
 }
 
+static bool
+hist_entry__fast__sym_diff(struct hist_entry *left,
+			   struct hist_entry *right)
+{
+	struct symbol *sym_l = left->ms.sym;
+	struct symbol *sym_r = right->ms.sym;
+
+	if (!sym_l && !sym_r)
+		return left->ip != right->ip;
+
+	return !!_sort__sym_cmp(sym_l, sym_r);
+}
+
+
 static int
 iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
 			       struct addr_location *al)
@@ -1096,6 +1110,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
 	};
 	int i;
 	struct callchain_cursor cursor;
+	bool fast = hists__has(he_tmp.hists, sym);
 
 	callchain_cursor_snapshot(&cursor, &callchain_cursor);
 
@@ -1106,6 +1121,14 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
 	 * It's possible that it has cycles or recursive calls.
 	 */
 	for (i = 0; i < iter->curr; i++) {
+		/*
+		 * For most cases, there are no duplicate entries in callchain.
+		 * The symbols are usually different. Do a quick check for
+		 * symbols first.
+		 */
+		if (fast && hist_entry__fast__sym_diff(he_cache[i], &he_tmp))
+			continue;
+
 		if (hist_entry__cmp(he_cache[i], &he_tmp) == 0) {
 			/* to avoid calling callback function */
 			iter->he = NULL;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index f14cc728c358..dc15ddc18b7d 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -237,7 +237,7 @@ static int64_t _sort__addr_cmp(u64 left_ip, u64 right_ip)
 	return (int64_t)(right_ip - left_ip);
 }
 
-static int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r)
+int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r)
 {
 	if (!sym_l || !sym_r)
 		return cmp_null(sym_l, sym_r);
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index cfa6ac6f7d06..66d39c4cfe2b 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -311,5 +311,7 @@ int64_t
 sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right);
 int64_t
 sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right);
+int64_t
+_sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r);
 char *hist_entry__srcline(struct hist_entry *he);
 #endif	/* __PERF_SORT_H */
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 130+ 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
                   ` (59 preceding siblings ...)
  2020-04-20 11:53 ` [PATCH 60/60] perf hist: Add fast path for duplicate entries check Arnaldo Carvalho de Melo
@ 2020-04-22 12:09 ` Ingo Molnar
  2020-04-23 21:28   ` Daniel Díaz
  60 siblings, 1 reply; 130+ 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] 130+ messages in thread

* Re: [GIT PULL] perf/core improvements and fixes
  2020-04-22 12:09 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar
@ 2020-04-23 21:28   ` Daniel Díaz
  2020-04-24 13:07     ` Arnaldo Carvalho de Melo
  2020-05-08 13:04     ` [tip: perf/core] perf flamegraph: Use /bin/bash for report and record scripts tip-bot2 for Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 130+ 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] 130+ 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
  2020-05-08 13:04     ` [tip: perf/core] perf flamegraph: Use /bin/bash for report and record scripts tip-bot2 for Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ messages in thread

* [tip: perf/core] perf flamegraph: Use /bin/bash for report and record scripts
  2020-04-23 21:28   ` Daniel Díaz
  2020-04-24 13:07     ` Arnaldo Carvalho de Melo
@ 2020-05-08 13:04     ` tip-bot2 for Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 130+ messages in thread
From: tip-bot2 for Arnaldo Carvalho de Melo @ 2020-05-08 13:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: daniel.diaz, Andreas Gerstmayr, Adrian Hunter, Jiri Olsa,
	lkft-triage, Namhyung Kim, Arnaldo Carvalho de Melo, x86, LKML

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     19ce2321739da5fc27f6a5ed1e1cb15e384ad030
Gitweb:        https://git.kernel.org/tip/19ce2321739da5fc27f6a5ed1e1cb15e384ad030
Author:        Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate:    Tue, 05 May 2020 13:33:12 -03:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Tue, 05 May 2020 16:35:32 -03:00

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/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 725d66e..7df5a19 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 b1a79af..53c5dc9 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2020-05-06 15:21 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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, Thomas Richter, Tommi Rantala, Kate Carcia,
	Zou Wei, 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 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2020-03-25 12:41 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2020-03-10 11:15 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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] 130+ 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; 130+ messages in thread
From: pr-tracker-bot @ 2020-01-28 19:10 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2019-08-16 20:16 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2019-08-14 18:40 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2019-07-22 17:38 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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] 130+ messages in thread

* [GIT PULL] perf/core improvements and fixes
@ 2019-07-15 21:11 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ 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; 130+ 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 Stoyanov, Zenghui Yu,
	Arnaldo Carvalho de Melo


* 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] 130+ 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; 130+ 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 Stoyanov, Zenghui Yu, Arnaldo Carvalho de Melo

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] 130+ 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; 130+ 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] 130+ 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; 130+ 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] 130+ messages in thread

end of thread, other threads:[~2020-05-08 13:12 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 11:52 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 01/60] perf stat: Honour --timeout for forked workloads Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 02/60] perf tools: Synthesize bpf_trampoline/dispatcher ksymbol event Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 03/60] perf machine: Set ksymbol dso as loaded on arrival Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 04/60] perf annotate: Add basic support for bpf_image Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 05/60] capabilities: Introduce CAP_PERFMON to kernel and user space Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 06/60] perf/core: Open access to the core for CAP_PERFMON privileged process Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 07/60] perf/core: open access to probes " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 08/60] perf tools: Support CAP_PERFMON capability Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 09/60] drm/i915/perf: Open access for CAP_PERFMON privileged process Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 10/60] trace/bpf_trace: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 11/60] powerpc/perf: open " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 12/60] parisc/perf: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 13/60] drivers/perf: Open " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 14/60] drivers/oprofile: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 15/60] doc/admin-guide: Update perf-security.rst with CAP_PERFMON information Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 16/60] doc/admin-guide: update kernel.rst " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 17/60] perf script: Simplify auxiliary event printing functions Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 18/60] perf bench: Add event synthesis benchmark Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 19/60] tools api fs: Make xxx__mountpoint() more scalable Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 20/60] perf synthetic-events: save 4kb from 2 stack frames Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 21/60] perf expr: Add expr_ prefix for parse_ctx and parse_id Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 22/60] perf expr: Add expr_scanner_ctx object Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 23/60] perf metrictroup: Split the metricgroup__add_metric function Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 24/60] perf script: Add flamegraph.py script Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 25/60] perf auxtrace: Add ->evsel_is_auxtrace() callback Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 26/60] perf intel-pt: Implement " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 27/60] perf intel-bts: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 28/60] perf arm-spe: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 29/60] perf cs-etm: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 30/60] perf s390-cpumsf: " Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 31/60] perf auxtrace: For reporting purposes, un-group AUX area event Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 32/60] perf auxtrace: Add an option to synthesize callchains for regular events Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 33/60] perf thread-stack: Add thread_stack__sample_late() Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 34/60] perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 35/60] perf evsel: Add support for synthesized sample type Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 36/60] perf intel-pt: Add support for synthesizing callchains for regular events Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 37/60] perf evsel: Move and globalize perf_evsel__find_pmu() and perf_evsel__is_aux_event() Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 38/60] perf evlist: Move leader-sampling configuration Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 39/60] perf evsel: Rearrange perf_evsel__config_leader_sampling() Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 40/60] perf evlist: Allow multiple read formats Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 41/60] perf tools: Add support for leader-sampling with AUX area events Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 42/60] perf stat: Force error in fallback on :k events Arnaldo Carvalho de Melo
2020-04-20 11:52 ` [PATCH 43/60] tools lib traceevent: Take care of return value of asprintf Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 44/60] perf pmu: Add support for PMU capabilities Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 45/60] perf doc: allow ASCIIDOC_EXTRA to be an argument Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 46/60] perf parser: Add support to specify rXXX event with pmu Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 47/60] perf header: Support CPU PMU capabilities Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 48/60] perf machine: Remove the indent in resolve_lbr_callchain_sample Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 49/60] perf machine: Refine the function for LBR call stack reconstruction Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 50/60] perf machine: Factor out lbr_callchain_add_kernel_ip() Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 51/60] perf machine: Factor out lbr_callchain_add_lbr_ip() Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 52/60] perf thread: Add a knob for LBR stitch approach Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 53/60] perf thread: Save previous sample for LBR stitching approach Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 54/60] perf callchain: Save previous cursor nodes " Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 55/60] perf callchain: Stitch LBR call stack Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 56/60] perf report: Add option to enable the LBR stitching approach Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 57/60] perf script: " Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 58/60] perf top: " Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 59/60] perf c2c: " Arnaldo Carvalho de Melo
2020-04-20 11:53 ` [PATCH 60/60] perf hist: Add fast path for duplicate entries check Arnaldo Carvalho de Melo
2020-04-22 12:09 ` [GIT PULL] perf/core improvements and fixes 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-05-08 13:04     ` [tip: perf/core] perf flamegraph: Use /bin/bash for report and record scripts tip-bot2 for Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2020-05-06 15:21 [GIT PULL] perf/core improvements and fixes 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).