All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexis Berlemont, Andi Kleen, David Ahern,
	Hanjun Guo, Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Taeung Song, Wang Nan, linux-perf-users,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:

  Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +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-4.12-20170324

for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:

  perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)

- Collapse identically named PMU events in 'perf stat', allow
  not merging it via --no-merge (Andi Kleen)

Fixes:

- Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
  disassembly output to not ditch line:number lines needed by
  'perf annotate --print-lines' logic (Taeung Song)

Infrastructure:

- SDT (Statically Defined Tracing)/uprobes_events arguments improvements
  (Alexis Berlemont, Ravi Bangoria)

- Improvements for the handling of JSON described vendor events,
  including having an expression parser to calculate metrics
  from multiple vendor events (Andi Kleen)

- Update Intel JSON vendor event files (Andi Kleen)

- Restore error reporting in 'perf probe -d' when none of the events
  requested to be deleted exist. (Kefeng Wang)

- Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
  (Ravi Bangoria)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Alexis Berlemont (2):
      perf sdt: Add scanning of sdt probes arguments
      perf probe: Add sdt probes arguments into the uprobe cmd string

Andi Kleen (13):
      perf stat: Factor out callback for collecting event values
      perf stat: Collapse identically named events
      perf stat: Handle partially bad results with merging
      perf tools: Factor out PMU matching in parser
      perf pmu: Expand PMU events by prefix match
      perf pmu: Special case uncore_ prefix
      perf tools: Add a simple expression parser for JSON
      perf vendor events intel: Update Intel uncore JSON event files
      perf pmu: Support MetricExpr header in JSON event list
      perf stat: Output JSON MetricExpr metric
      perf list: Support printing MetricExpr with --debug
      perf pmu: Add support for MetricName JSON attribute
      perf list: Move extra details printing to new option

Arnaldo Carvalho de Melo (1):
      perf annotate: Add comment clarifying how the source code line is parsed

Kefeng Wang (1):
      perf probe: Return errno when not hitting any event

Ravi Bangoria (2):
      perf probe: Change MAX_CMDLEN
      perf sdt x86: Add renaming logic for rNN and other registers

Taeung Song (1):
      perf annotate: More exactly grep -v of the objdump command

 tools/perf/Documentation/perf-list.txt             |   4 +
 tools/perf/Documentation/perf-stat.txt             |   3 +
 tools/perf/arch/x86/util/perf_regs.c               | 103 +++++++++++
 tools/perf/builtin-list.c                          |  14 +-
 tools/perf/builtin-probe.c                         |   6 +-
 tools/perf/builtin-stat.c                          | 146 ++++++++++++---
 .../arch/x86/broadwellde/uncore-cache.json         |  28 +--
 .../arch/x86/broadwellde/uncore-memory.json        |  26 ++-
 .../arch/x86/broadwellde/uncore-power.json         |  26 ++-
 .../arch/x86/broadwellx/uncore-cache.json          |  28 +--
 .../arch/x86/broadwellx/uncore-interconnect.json   |   6 +-
 .../arch/x86/broadwellx/uncore-memory.json         |  21 ++-
 .../arch/x86/broadwellx/uncore-power.json          |  26 ++-
 .../pmu-events/arch/x86/haswellx/uncore-cache.json |  28 +--
 .../arch/x86/haswellx/uncore-interconnect.json     |   6 +-
 .../arch/x86/haswellx/uncore-memory.json           |  21 ++-
 .../pmu-events/arch/x86/haswellx/uncore-power.json |  26 ++-
 .../pmu-events/arch/x86/ivytown/uncore-cache.json  |  22 +--
 .../arch/x86/ivytown/uncore-interconnect.json      |  12 +-
 .../pmu-events/arch/x86/ivytown/uncore-memory.json |  19 +-
 .../pmu-events/arch/x86/ivytown/uncore-power.json  |  53 ++++--
 .../pmu-events/arch/x86/jaketown/uncore-cache.json |  13 +-
 .../arch/x86/jaketown/uncore-interconnect.json     |  12 +-
 .../arch/x86/jaketown/uncore-memory.json           |  21 ++-
 .../pmu-events/arch/x86/jaketown/uncore-power.json |  53 ++++--
 tools/perf/pmu-events/jevents.c                    |  26 ++-
 tools/perf/pmu-events/jevents.h                    |   3 +-
 tools/perf/pmu-events/pmu-events.h                 |   2 +
 tools/perf/tests/Build                             |   1 +
 tools/perf/tests/builtin-test.c                    |   4 +
 tools/perf/tests/expr.c                            |  56 ++++++
 tools/perf/tests/tests.h                           |   1 +
 tools/perf/util/Build                              |   6 +
 tools/perf/util/annotate.c                         |   8 +-
 tools/perf/util/evsel.c                            |   4 +
 tools/perf/util/evsel.h                            |   5 +
 tools/perf/util/expr.h                             |  25 +++
 tools/perf/util/expr.y                             | 173 ++++++++++++++++++
 tools/perf/util/parse-events.c                     |  78 +++++++-
 tools/perf/util/parse-events.h                     |  10 +-
 tools/perf/util/parse-events.y                     |  73 ++++----
 tools/perf/util/perf_regs.c                        |   6 +
 tools/perf/util/perf_regs.h                        |   6 +
 tools/perf/util/pmu.c                              |  32 +++-
 tools/perf/util/pmu.h                              |   6 +-
 tools/perf/util/probe-event.c                      |   1 -
 tools/perf/util/probe-file.c                       | 173 +++++++++++++++++-
 tools/perf/util/stat-shadow.c                      | 197 +++++++++++++++++++++
 tools/perf/util/stat.h                             |   2 +
 tools/perf/util/symbol-elf.c                       |  25 ++-
 tools/perf/util/symbol.h                           |   1 +
 51 files changed, 1370 insertions(+), 277 deletions(-)
 create mode 100644 tools/perf/tests/expr.c
 create mode 100644 tools/perf/util/expr.h
 create mode 100644 tools/perf/util/expr.y

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

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.

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:edge: Ok
   4 android-ndk:r12b-arm: Ok
   5 archlinux:latest: Ok
   6 centos:5: Ok
   7 centos:6: Ok
   8 centos:7: Ok
   9 debian:7: Ok
  10 debian:8: Ok
  11 debian:experimental: Ok
  12 debian:experimental-x-arm64: Ok
  13 debian:experimental-x-mips: Ok
  14 debian:experimental-x-mips64: Ok
  15 debian:experimental-x-mipsel: Ok
  16 fedora:20: Ok
  17 fedora:21: Ok
  18 fedora:22: Ok
  19 fedora:23: Ok
  20 fedora:24: Ok
  21 fedora:24-x-ARC-uClibc: Ok
  22 fedora:25: Ok
  23 fedora:rawhide: Ok
  24 mageia:5: Ok
  25 opensuse:13.2: Ok
  26 opensuse:42.1: Ok
  27 opensuse:tumbleweed: Ok
  28 ubuntu:12.04.5: Ok
  29 ubuntu:14.04.4: Ok
  30 ubuntu:14.04.4-x-linaro-arm64: Ok
  31 ubuntu:15.10: Ok
  32 ubuntu:16.04: Ok
  33 ubuntu:16.04-x-arm: Ok
  34 ubuntu:16.04-x-arm64: Ok
  35 ubuntu:16.04-x-powerpc: Ok
  36 ubuntu:16.04-x-powerpc64: Ok
  37 ubuntu:16.04-x-s390: Ok
  38 ubuntu:16.10: Ok
  39 ubuntu:17.04: Ok
  #

  # uname -a
  Linux felicio.ghostprotocols.net 4.11.0-rc3+ #1 SMP Thu Mar 23 14:32:00 BRT 2017 x86_64 x86_64 x86_64 GNU/Linux
  # Has peterz's fix for 'perf test tsc'
  # 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: Parse event definition strings             : Ok
   6: Simple expression parser                   : Ok
   7: PERF_RECORD_* events & perf_sample fields  : Ok
   8: Parse perf pmu format                      : Ok
   9: DSO data read                              : Ok
  10: DSO data cache                             : Ok
  11: DSO data reopen                            : Ok
  12: Roundtrip evsel->name                      : Ok
  13: Parse sched tracepoints fields             : Ok
  14: syscalls:sys_enter_openat event fields     : Ok
  15: Setup struct perf_event_attr               : Ok
  16: Match and link multiple hists              : Ok
  17: 'import perf' in python                    : Ok
  18: Breakpoint overflow signal handler         : Ok
  19: Breakpoint overflow sampling               : Ok
  20: Number of exit events of a simple workload : Ok
  21: Software clock events period values        : Ok
  22: Object code reading                        : Ok
  23: Sample parsing                             : Ok
  24: Use a dummy software event to keep tracking: Ok
  25: Parse with no sample_id_all bit set        : Ok
  26: Filter hist entries                        : Ok
  27: Lookup mmap thread                         : Ok
  28: Share thread mg                            : Ok
  29: Sort output of hist entries                : Ok
  30: Cumulate child hist entries                : Ok
  31: Track with sched_switch                    : Ok
  32: Filter fds with revents mask in a fdarray  : Ok
  33: Add fd to a fdarray, making it autogrow    : Ok
  34: kmod_path__parse                           : Ok
  35: Thread map                                 : Ok
  36: LLVM search and compile                    :
  36.1: Basic BPF llvm compile                    : Ok
  36.2: kbuild searching                          : Ok
  36.3: Compile source for BPF prologue generation: Ok
  36.4: Compile source for BPF relocation         : Ok
  37: Session topology                           : Ok
  38: BPF filter                                 :
  38.1: Basic BPF filtering                      : Ok
  38.2: BPF pinning                              : Ok
  38.3: BPF prologue generation                  : Ok
  38.4: BPF relocation checker                   : Ok
  39: Synthesize thread map                      : Ok
  40: Remove thread map                          : Ok
  41: Synthesize cpu map                         : Ok
  42: Synthesize stat config                     : Ok
  43: Synthesize stat                            : Ok
  44: Synthesize stat round                      : Ok
  45: Synthesize attr update                     : Ok
  46: Event times                                : Ok
  47: Read backward ring buffer                  : Ok
  48: Print cpu map                              : Ok
  49: Probe SDT events                           : Ok
  50: is_printable_array                         : Ok
  51: Print bitmap                               : Ok
  52: perf hooks                                 : Ok
  53: builtin clang support                      : Skip (not compiled in)
  54: unit_number__scnprintf                     : Ok
  55: x86 rdpmc                                  : Ok
  56: Convert perf time to TSC                   : Ok
  57: DWARF unwind                               : Ok
  58: x86 instruction decoder - new instructions : Ok
  59: Intel cqm nmi context read                 : Skip
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
                make_install_O: make install 
            make_install_bin_O: make install-bin 
         make_with_clangllvm_O: make LIBCLANGLLVM=1 
                   make_pure_O: make 
           make_no_libbionic_O: make NO_LIBBIONIC=1 
           make_no_backtrace_O: make NO_BACKTRACE=1 
                make_no_newt_O: make NO_NEWT=1 
                  make_debug_O: make DEBUG=1 
                    make_doc_O: make doc 
               make_no_slang_O: make NO_SLANG=1 
                 make_static_O: make LDFLAGS=-static 
                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_no_libbpf_O: make NO_LIBBPF=1 
       make_util_pmu_bison_o_O: make util/pmu-bison.o 
                 make_perf_o_O: make perf.o 
             make_no_libnuma_O: make NO_LIBNUMA=1 
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 
            make_no_demangle_O: make NO_DEMANGLE=1 
            make_no_auxtrace_O: make NO_AUXTRACE=1 
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 
                   make_help_O: make help 
             make_util_map_o_O: make util/map.o 
             make_no_libperl_O: make NO_LIBPERL=1 
                make_no_gtk2_O: make NO_GTK2=1 
         make_install_prefix_O: make install prefix=/tmp/krava 
              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_no_libpython_O: make NO_LIBPYTHON=1 
            make_no_libaudit_O: make NO_LIBAUDIT=1 
                   make_tags_O: make tags 
        make_with_babeltrace_O: make LIBBABELTRACE=1 
              make_no_libelf_O: make NO_LIBELF=1 
   make_install_prefix_slash_O: make install prefix=/tmp/krava/ 
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexis Berlemont, Andi Kleen, David Ahern,
	Hanjun Guo, Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:

  Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +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-4.12-20170324

for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:

  perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)

- Collapse identically named PMU events in 'perf stat', allow
  not merging it via --no-merge (Andi Kleen)

Fixes:

- Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
  disassembly output to not ditch line:number lines needed by
  'perf annotate --print-lines' logic (Taeung Song)

Infrastructure:

- SDT (Statically Defined Tracing)/uprobes_events arguments improvements
  (Alexis Berlemont, Ravi Bangoria)

- Improvements for the handling of JSON described vendor events,
  including having an expression parser to calculate metrics
  from multiple vendor events (Andi Kleen)

- Update Intel JSON vendor event files (Andi Kleen)

- Restore error reporting in 'perf probe -d' when none of the events
  requested to be deleted exist. (Kefeng Wang)

- Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
  (Ravi Bangoria)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Alexis Berlemont (2):
      perf sdt: Add scanning of sdt probes arguments
      perf probe: Add sdt probes arguments into the uprobe cmd string

Andi Kleen (13):
      perf stat: Factor out callback for collecting event values
      perf stat: Collapse identically named events
      perf stat: Handle partially bad results with merging
      perf tools: Factor out PMU matching in parser
      perf pmu: Expand PMU events by prefix match
      perf pmu: Special case uncore_ prefix
      perf tools: Add a simple expression parser for JSON
      perf vendor events intel: Update Intel uncore JSON event files
      perf pmu: Support MetricExpr header in JSON event list
      perf stat: Output JSON MetricExpr metric
      perf list: Support printing MetricExpr with --debug
      perf pmu: Add support for MetricName JSON attribute
      perf list: Move extra details printing to new option

Arnaldo Carvalho de Melo (1):
      perf annotate: Add comment clarifying how the source code line is parsed

Kefeng Wang (1):
      perf probe: Return errno when not hitting any event

Ravi Bangoria (2):
      perf probe: Change MAX_CMDLEN
      perf sdt x86: Add renaming logic for rNN and other registers

Taeung Song (1):
      perf annotate: More exactly grep -v of the objdump command

 tools/perf/Documentation/perf-list.txt             |   4 +
 tools/perf/Documentation/perf-stat.txt             |   3 +
 tools/perf/arch/x86/util/perf_regs.c               | 103 +++++++++++
 tools/perf/builtin-list.c                          |  14 +-
 tools/perf/builtin-probe.c                         |   6 +-
 tools/perf/builtin-stat.c                          | 146 ++++++++++++---
 .../arch/x86/broadwellde/uncore-cache.json         |  28 +--
 .../arch/x86/broadwellde/uncore-memory.json        |  26 ++-
 .../arch/x86/broadwellde/uncore-power.json         |  26 ++-
 .../arch/x86/broadwellx/uncore-cache.json          |  28 +--
 .../arch/x86/broadwellx/uncore-interconnect.json   |   6 +-
 .../arch/x86/broadwellx/uncore-memory.json         |  21 ++-
 .../arch/x86/broadwellx/uncore-power.json          |  26 ++-
 .../pmu-events/arch/x86/haswellx/uncore-cache.json |  28 +--
 .../arch/x86/haswellx/uncore-interconnect.json     |   6 +-
 .../arch/x86/haswellx/uncore-memory.json           |  21 ++-
 .../pmu-events/arch/x86/haswellx/uncore-power.json |  26 ++-
 .../pmu-events/arch/x86/ivytown/uncore-cache.json  |  22 +--
 .../arch/x86/ivytown/uncore-interconnect.json      |  12 +-
 .../pmu-events/arch/x86/ivytown/uncore-memory.json |  19 +-
 .../pmu-events/arch/x86/ivytown/uncore-power.json  |  53 ++++--
 .../pmu-events/arch/x86/jaketown/uncore-cache.json |  13 +-
 .../arch/x86/jaketown/uncore-interconnect.json     |  12 +-
 .../arch/x86/jaketown/uncore-memory.json           |  21 ++-
 .../pmu-events/arch/x86/jaketown/uncore-power.json |  53 ++++--
 tools/perf/pmu-events/jevents.c                    |  26 ++-
 tools/perf/pmu-events/jevents.h                    |   3 +-
 tools/perf/pmu-events/pmu-events.h                 |   2 +
 tools/perf/tests/Build                             |   1 +
 tools/perf/tests/builtin-test.c                    |   4 +
 tools/perf/tests/expr.c                            |  56 ++++++
 tools/perf/tests/tests.h                           |   1 +
 tools/perf/util/Build                              |   6 +
 tools/perf/util/annotate.c                         |   8 +-
 tools/perf/util/evsel.c                            |   4 +
 tools/perf/util/evsel.h                            |   5 +
 tools/perf/util/expr.h                             |  25 +++
 tools/perf/util/expr.y                             | 173 ++++++++++++++++++
 tools/perf/util/parse-events.c                     |  78 +++++++-
 tools/perf/util/parse-events.h                     |  10 +-
 tools/perf/util/parse-events.y                     |  73 ++++----
 tools/perf/util/perf_regs.c                        |   6 +
 tools/perf/util/perf_regs.h                        |   6 +
 tools/perf/util/pmu.c                              |  32 +++-
 tools/perf/util/pmu.h                              |   6 +-
 tools/perf/util/probe-event.c                      |   1 -
 tools/perf/util/probe-file.c                       | 173 +++++++++++++++++-
 tools/perf/util/stat-shadow.c                      | 197 +++++++++++++++++++++
 tools/perf/util/stat.h                             |   2 +
 tools/perf/util/symbol-elf.c                       |  25 ++-
 tools/perf/util/symbol.h                           |   1 +
 51 files changed, 1370 insertions(+), 277 deletions(-)
 create mode 100644 tools/perf/tests/expr.c
 create mode 100644 tools/perf/util/expr.h
 create mode 100644 tools/perf/util/expr.y

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

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.

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:edge: Ok
   4 android-ndk:r12b-arm: Ok
   5 archlinux:latest: Ok
   6 centos:5: Ok
   7 centos:6: Ok
   8 centos:7: Ok
   9 debian:7: Ok
  10 debian:8: Ok
  11 debian:experimental: Ok
  12 debian:experimental-x-arm64: Ok
  13 debian:experimental-x-mips: Ok
  14 debian:experimental-x-mips64: Ok
  15 debian:experimental-x-mipsel: Ok
  16 fedora:20: Ok
  17 fedora:21: Ok
  18 fedora:22: Ok
  19 fedora:23: Ok
  20 fedora:24: Ok
  21 fedora:24-x-ARC-uClibc: Ok
  22 fedora:25: Ok
  23 fedora:rawhide: Ok
  24 mageia:5: Ok
  25 opensuse:13.2: Ok
  26 opensuse:42.1: Ok
  27 opensuse:tumbleweed: Ok
  28 ubuntu:12.04.5: Ok
  29 ubuntu:14.04.4: Ok
  30 ubuntu:14.04.4-x-linaro-arm64: Ok
  31 ubuntu:15.10: Ok
  32 ubuntu:16.04: Ok
  33 ubuntu:16.04-x-arm: Ok
  34 ubuntu:16.04-x-arm64: Ok
  35 ubuntu:16.04-x-powerpc: Ok
  36 ubuntu:16.04-x-powerpc64: Ok
  37 ubuntu:16.04-x-s390: Ok
  38 ubuntu:16.10: Ok
  39 ubuntu:17.04: Ok
  #

  # uname -a
  Linux felicio.ghostprotocols.net 4.11.0-rc3+ #1 SMP Thu Mar 23 14:32:00 BRT 2017 x86_64 x86_64 x86_64 GNU/Linux
  # Has peterz's fix for 'perf test tsc'
  # 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: Parse event definition strings             : Ok
   6: Simple expression parser                   : Ok
   7: PERF_RECORD_* events & perf_sample fields  : Ok
   8: Parse perf pmu format                      : Ok
   9: DSO data read                              : Ok
  10: DSO data cache                             : Ok
  11: DSO data reopen                            : Ok
  12: Roundtrip evsel->name                      : Ok
  13: Parse sched tracepoints fields             : Ok
  14: syscalls:sys_enter_openat event fields     : Ok
  15: Setup struct perf_event_attr               : Ok
  16: Match and link multiple hists              : Ok
  17: 'import perf' in python                    : Ok
  18: Breakpoint overflow signal handler         : Ok
  19: Breakpoint overflow sampling               : Ok
  20: Number of exit events of a simple workload : Ok
  21: Software clock events period values        : Ok
  22: Object code reading                        : Ok
  23: Sample parsing                             : Ok
  24: Use a dummy software event to keep tracking: Ok
  25: Parse with no sample_id_all bit set        : Ok
  26: Filter hist entries                        : Ok
  27: Lookup mmap thread                         : Ok
  28: Share thread mg                            : Ok
  29: Sort output of hist entries                : Ok
  30: Cumulate child hist entries                : Ok
  31: Track with sched_switch                    : Ok
  32: Filter fds with revents mask in a fdarray  : Ok
  33: Add fd to a fdarray, making it autogrow    : Ok
  34: kmod_path__parse                           : Ok
  35: Thread map                                 : Ok
  36: LLVM search and compile                    :
  36.1: Basic BPF llvm compile                    : Ok
  36.2: kbuild searching                          : Ok
  36.3: Compile source for BPF prologue generation: Ok
  36.4: Compile source for BPF relocation         : Ok
  37: Session topology                           : Ok
  38: BPF filter                                 :
  38.1: Basic BPF filtering                      : Ok
  38.2: BPF pinning                              : Ok
  38.3: BPF prologue generation                  : Ok
  38.4: BPF relocation checker                   : Ok
  39: Synthesize thread map                      : Ok
  40: Remove thread map                          : Ok
  41: Synthesize cpu map                         : Ok
  42: Synthesize stat config                     : Ok
  43: Synthesize stat                            : Ok
  44: Synthesize stat round                      : Ok
  45: Synthesize attr update                     : Ok
  46: Event times                                : Ok
  47: Read backward ring buffer                  : Ok
  48: Print cpu map                              : Ok
  49: Probe SDT events                           : Ok
  50: is_printable_array                         : Ok
  51: Print bitmap                               : Ok
  52: perf hooks                                 : Ok
  53: builtin clang support                      : Skip (not compiled in)
  54: unit_number__scnprintf                     : Ok
  55: x86 rdpmc                                  : Ok
  56: Convert perf time to TSC                   : Ok
  57: DWARF unwind                               : Ok
  58: x86 instruction decoder - new instructions : Ok
  59: Intel cqm nmi context read                 : Skip
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
                make_install_O: make install 
            make_install_bin_O: make install-bin 
         make_with_clangllvm_O: make LIBCLANGLLVM=1 
                   make_pure_O: make 
           make_no_libbionic_O: make NO_LIBBIONIC=1 
           make_no_backtrace_O: make NO_BACKTRACE=1 
                make_no_newt_O: make NO_NEWT=1 
                  make_debug_O: make DEBUG=1 
                    make_doc_O: make doc 
               make_no_slang_O: make NO_SLANG=1 
                 make_static_O: make LDFLAGS=-static 
                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_no_libbpf_O: make NO_LIBBPF=1 
       make_util_pmu_bison_o_O: make util/pmu-bison.o 
                 make_perf_o_O: make perf.o 
             make_no_libnuma_O: make NO_LIBNUMA=1 
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 
            make_no_demangle_O: make NO_DEMANGLE=1 
            make_no_auxtrace_O: make NO_AUXTRACE=1 
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 
                   make_help_O: make help 
             make_util_map_o_O: make util/map.o 
             make_no_libperl_O: make NO_LIBPERL=1 
                make_no_gtk2_O: make NO_GTK2=1 
         make_install_prefix_O: make install prefix=/tmp/krava 
              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_no_libpython_O: make NO_LIBPYTHON=1 
            make_no_libaudit_O: make NO_LIBAUDIT=1 
                   make_tags_O: make tags 
        make_with_babeltrace_O: make LIBBABELTRACE=1 
              make_no_libelf_O: make NO_LIBELF=1 
   make_install_prefix_slash_O: make install prefix=/tmp/krava/ 
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $

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

* [PATCH 01/20] perf probe: Change MAX_CMDLEN
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Ravi Bangoria, Alexander Shishkin,
	Alexis Berlemont, Madhavan Srinivasan, Michael Ellerman,
	Naveen N . Rao, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

There are many SDT markers in powerpc whose uprobe definition goes
beyond current MAX_CMDLEN, especially when target filename is long and
sdt marker has long list of arguments. For example, definition of sdt
marker

  method__compile__end: 8@17 8@9 8@10 -4@8 8@7 -4@6 8@5 -4@4 1@37(28)

from file

  /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-2.b14.fc22.ppc64/jre/lib/ppc64/server/libjvm.so

is

  p:sdt_hotspot/method__compile__end /usr/lib/jvm/java-1.8.0-openjdk-\
    1.8.0.91-2.b14.fc22.ppc64/jre/lib/ppc64/server/libjvm.so:0x4c4e00\
    arg1=%gpr17:u64 arg2=%gpr9:u64 arg3=%gpr10:u64 arg4=%gpr8:s32\
    arg5=%gpr7:u64 arg6=%gpr6:s32 arg7=%gpr5:u64 arg8=%gpr4:s32\
    arg9=+37(%gpr28):u8

'perf probe' fails with segfault for such markers. As the uprobe_events
file accepts definitions up to 4094 characters(4096 - 2 (\n\0)),
increase value of MAX_CMDLEN match that.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170207054547.3690-1-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 1 -
 tools/perf/util/probe-file.c  | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 6740d6812691..e4b889444447 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -47,7 +47,6 @@
 #include "probe-file.h"
 #include "session.h"
 
-#define MAX_CMDLEN 256
 #define PERFPROBE_GROUP "probe"
 
 bool probe_event_dry_run;	/* Dry run flag */
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 1542cd0d6799..c3c287125be5 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -28,7 +28,8 @@
 #include "probe-file.h"
 #include "session.h"
 
-#define MAX_CMDLEN 256
+/* 4096 - 2 ('\n' + '\0') */
+#define MAX_CMDLEN 4094
 
 static void print_open_warning(int err, bool uprobe)
 {
-- 
2.9.3

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

* [PATCH 02/20] perf probe: Return errno when not hitting any event
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  (?)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Kefeng Wang, Hanjun Guo, Jiri Olsa, Peter Zijlstra,
	Wang Nan, Arnaldo Carvalho de Melo

From: Kefeng Wang <wangkefeng.wang@huawei.com>

On old perf, when using 'perf probe -d' to delete an inexistent event,
it returns errno, eg,

  -bash-4.3# perf probe -d xxx  || echo $?
  Info: Event "*:xxx" does not exist.
    Error: Failed to delete events.
  255

But now perf_del_probe_events() will always set ret = 0, different from
previous del_perf_probe_events(). After this, it returns errno again,
eg,

  -bash-4.3# ./perf probe -d xxx  || echo $?
  "xxx" does not hit any event.
    Error: Failed to delete events.
  254

And it is more appropriate to return -ENOENT instead of -EPERM.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: dddc7ee32fa1 ("perf probe: Fix an error when deleting probes successfully")
Link: http://lkml.kernel.org/r/1489738592-61011-1-git-send-email-wangkefeng.wang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-probe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 1fcebc31a508..51cdc230f6ca 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -442,9 +442,9 @@ static int perf_del_probe_events(struct strfilter *filter)
 	}
 
 	if (ret == -ENOENT && ret2 == -ENOENT)
-		pr_debug("\"%s\" does not hit any event.\n", str);
-		/* Note that this is silently ignored */
-	ret = 0;
+		pr_warning("\"%s\" does not hit any event.\n", str);
+	else
+		ret = 0;
 
 error:
 	if (kfd >= 0)
-- 
2.9.3

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

* [PATCH 03/20] perf sdt: Add scanning of sdt probes arguments
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Alexis Berlemont, Alexander Shishkin, Hemant Kumar,
	Peter Zijlstra, Ravi Bangoria, Arnaldo Carvalho de Melo

From: Alexis Berlemont <alexis.berlemont@gmail.com>

During a "perf buildid-cache --add" command, the section ".note.stapsdt"
of the "added" binary is scanned in order to list the available SDT
markers available in a binary. The parts containing the probes arguments
were left unscanned.

The whole section is now parsed; the probe arguments are extracted for
later use.

Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20161214000732.1710-2-alexis.berlemont@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol-elf.c | 25 +++++++++++++++++++++++--
 tools/perf/util/symbol.h     |  1 +
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 4e59ddeb4eda..0e660dba58ad 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1828,7 +1828,7 @@ void kcore_extract__delete(struct kcore_extract *kce)
 static int populate_sdt_note(Elf **elf, const char *data, size_t len,
 			     struct list_head *sdt_notes)
 {
-	const char *provider, *name;
+	const char *provider, *name, *args;
 	struct sdt_note *tmp = NULL;
 	GElf_Ehdr ehdr;
 	GElf_Addr base_off = 0;
@@ -1887,6 +1887,25 @@ static int populate_sdt_note(Elf **elf, const char *data, size_t len,
 		goto out_free_prov;
 	}
 
+	args = memchr(name, '\0', data + len - name);
+
+	/*
+	 * There is no argument if:
+	 * - We reached the end of the note;
+	 * - There is not enough room to hold a potential string;
+	 * - The argument string is empty or just contains ':'.
+	 */
+	if (args == NULL || data + len - args < 2 ||
+		args[1] == ':' || args[1] == '\0')
+		tmp->args = NULL;
+	else {
+		tmp->args = strdup(++args);
+		if (!tmp->args) {
+			ret = -ENOMEM;
+			goto out_free_name;
+		}
+	}
+
 	if (gelf_getclass(*elf) == ELFCLASS32) {
 		memcpy(&tmp->addr, &buf, 3 * sizeof(Elf32_Addr));
 		tmp->bit32 = true;
@@ -1898,7 +1917,7 @@ static int populate_sdt_note(Elf **elf, const char *data, size_t len,
 	if (!gelf_getehdr(*elf, &ehdr)) {
 		pr_debug("%s : cannot get elf header.\n", __func__);
 		ret = -EBADF;
-		goto out_free_name;
+		goto out_free_args;
 	}
 
 	/* Adjust the prelink effect :
@@ -1923,6 +1942,8 @@ static int populate_sdt_note(Elf **elf, const char *data, size_t len,
 	list_add_tail(&tmp->note_list, sdt_notes);
 	return 0;
 
+out_free_args:
+	free(tmp->args);
 out_free_name:
 	free(tmp->name);
 out_free_prov:
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 6c358b7ed336..9222c7e702f3 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -351,6 +351,7 @@ int arch__choose_best_symbol(struct symbol *syma, struct symbol *symb);
 struct sdt_note {
 	char *name;			/* name of the note*/
 	char *provider;			/* provider name */
+	char *args;
 	bool bit32;			/* whether the location is 32 bits? */
 	union {				/* location, base and semaphore addrs */
 		Elf64_Addr a64[3];
-- 
2.9.3

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

* [PATCH 04/20] perf probe: Add sdt probes arguments into the uprobe cmd string
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Alexis Berlemont, Alexander Shishkin, Hemant Kumar,
	Peter Zijlstra, Ravi Bangoria, Arnaldo Carvalho de Melo

From: Alexis Berlemont <alexis.berlemont@gmail.com>

An sdt probe can be associated with arguments but they were not passed
to the user probe tracing interface (uprobe_events); this patch adapts
the sdt argument descriptors according to the uprobe input format.

As the uprobe parser does not support scaled address mode, perf will
skip arguments which cannot be adapted to the uprobe format.

Here are the results:

  $ perf buildid-cache -v --add test_sdt
  $ perf probe -x test_sdt sdt_libfoo:table_frob
  $ perf probe -x test_sdt sdt_libfoo:table_diddle
  $ perf record -e sdt_libfoo:table_frob -e sdt_libfoo:table_diddle test_sdt
  $ perf script
  test_sdt  ...   666.255678:   sdt_libfoo:table_frob: (4004d7) arg0=0 arg1=0
  test_sdt  ...   666.255683: sdt_libfoo:table_diddle: (40051a) arg0=0 arg1=0
  test_sdt  ...   666.255686:   sdt_libfoo:table_frob: (4004d7) arg0=1 arg1=2
  test_sdt  ...   666.255689: sdt_libfoo:table_diddle: (40051a) arg0=3 arg1=4
  test_sdt  ...   666.255692:   sdt_libfoo:table_frob: (4004d7) arg0=2 arg1=4
  test_sdt  ...   666.255694: sdt_libfoo:table_diddle: (40051a) arg0=6 arg1=8

Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20161214000732.1710-3-alexis.berlemont@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/perf_regs.c |  83 +++++++++++++++++
 tools/perf/util/perf_regs.c          |   6 ++
 tools/perf/util/perf_regs.h          |   6 ++
 tools/perf/util/probe-file.c         | 170 ++++++++++++++++++++++++++++++++++-
 4 files changed, 261 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c
index c5db14f36cc7..09a7f556dc7c 100644
--- a/tools/perf/arch/x86/util/perf_regs.c
+++ b/tools/perf/arch/x86/util/perf_regs.c
@@ -1,4 +1,7 @@
+#include <string.h>
+
 #include "../../perf.h"
+#include "../../util/util.h"
 #include "../../util/perf_regs.h"
 
 const struct sample_reg sample_reg_masks[] = {
@@ -26,3 +29,83 @@ const struct sample_reg sample_reg_masks[] = {
 #endif
 	SMPL_REG_END
 };
+
+struct sdt_name_reg {
+	const char *sdt_name;
+	const char *uprobe_name;
+};
+#define SDT_NAME_REG(n, m) {.sdt_name = "%" #n, .uprobe_name = "%" #m}
+#define SDT_NAME_REG_END {.sdt_name = NULL, .uprobe_name = NULL}
+
+static const struct sdt_name_reg sdt_reg_renamings[] = {
+	SDT_NAME_REG(eax, ax),
+	SDT_NAME_REG(rax, ax),
+	SDT_NAME_REG(ebx, bx),
+	SDT_NAME_REG(rbx, bx),
+	SDT_NAME_REG(ecx, cx),
+	SDT_NAME_REG(rcx, cx),
+	SDT_NAME_REG(edx, dx),
+	SDT_NAME_REG(rdx, dx),
+	SDT_NAME_REG(esi, si),
+	SDT_NAME_REG(rsi, si),
+	SDT_NAME_REG(edi, di),
+	SDT_NAME_REG(rdi, di),
+	SDT_NAME_REG(ebp, bp),
+	SDT_NAME_REG(rbp, bp),
+	SDT_NAME_REG_END,
+};
+
+int sdt_rename_register(char **pdesc, char *old_name)
+{
+	const struct sdt_name_reg *rnames = sdt_reg_renamings;
+	char *new_desc, *old_desc = *pdesc;
+	size_t prefix_len, sdt_len, uprobe_len, old_desc_len, offset;
+	int ret = -1;
+
+	while (ret != 0 && rnames->sdt_name != NULL) {
+		sdt_len = strlen(rnames->sdt_name);
+		ret = strncmp(old_name, rnames->sdt_name, sdt_len);
+		rnames += !!ret;
+	}
+
+	if (rnames->sdt_name == NULL)
+		return 0;
+
+	sdt_len = strlen(rnames->sdt_name);
+	uprobe_len = strlen(rnames->uprobe_name);
+	old_desc_len = strlen(old_desc) + 1;
+
+	new_desc = zalloc(old_desc_len + uprobe_len - sdt_len);
+	if (new_desc == NULL)
+		return -1;
+
+	/* Copy the chars before the register name (at least '%') */
+	prefix_len = old_name - old_desc;
+	memcpy(new_desc, old_desc, prefix_len);
+
+	/* Copy the new register name */
+	memcpy(new_desc + prefix_len, rnames->uprobe_name, uprobe_len);
+
+	/* Copy the chars after the register name (if need be) */
+	offset = prefix_len + sdt_len;
+	if (offset < old_desc_len) {
+		/*
+		 * The orginal register name can be suffixed by 'b',
+		 * 'w' or 'd' to indicate its size; so, we need to
+		 * skip this char if we met one.
+		 */
+		char sfx = old_desc[offset];
+
+		if (sfx == 'b' || sfx == 'w'  || sfx == 'd')
+			offset++;
+	}
+
+	if (offset < old_desc_len)
+		memcpy(new_desc + prefix_len + uprobe_len,
+			old_desc + offset, old_desc_len - offset);
+
+	free(old_desc);
+	*pdesc = new_desc;
+
+	return 0;
+}
diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
index c4023f22f287..a37e5934aa2a 100644
--- a/tools/perf/util/perf_regs.c
+++ b/tools/perf/util/perf_regs.c
@@ -6,6 +6,12 @@ const struct sample_reg __weak sample_reg_masks[] = {
 	SMPL_REG_END
 };
 
+int __weak sdt_rename_register(char **pdesc __maybe_unused,
+			char *old_name __maybe_unused)
+{
+	return 0;
+}
+
 #ifdef HAVE_PERF_REGS_SUPPORT
 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
 {
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h
index 679d6e493962..7544a157e159 100644
--- a/tools/perf/util/perf_regs.h
+++ b/tools/perf/util/perf_regs.h
@@ -15,6 +15,12 @@ struct sample_reg {
 
 extern const struct sample_reg sample_reg_masks[];
 
+/*
+ * The table sdt_reg_renamings is used for adjusting gcc/gas-generated
+ * registers before filling the uprobe tracer interface.
+ */
+int sdt_rename_register(char **pdesc, char *old_name);
+
 #ifdef HAVE_PERF_REGS_SUPPORT
 #include <perf_regs.h>
 
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index c3c287125be5..d741634cbfc0 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -27,6 +27,7 @@
 #include "probe-event.h"
 #include "probe-file.h"
 #include "session.h"
+#include "perf_regs.h"
 
 /* 4096 - 2 ('\n' + '\0') */
 #define MAX_CMDLEN 4094
@@ -688,6 +689,166 @@ static unsigned long long sdt_note__get_addr(struct sdt_note *note)
 		 : (unsigned long long)note->addr.a64[0];
 }
 
+static const char * const type_to_suffix[] = {
+	":s64", "", "", "", ":s32", "", ":s16", ":s8",
+	"", ":u8", ":u16", "", ":u32", "", "", "", ":u64"
+};
+
+static int synthesize_sdt_probe_arg(struct strbuf *buf, int i, const char *arg)
+{
+	char *tmp, *desc = strdup(arg);
+	const char *prefix = "", *suffix = "";
+	int ret = -1;
+
+	if (desc == NULL) {
+		pr_debug4("Allocation error\n");
+		return ret;
+	}
+
+	tmp = strchr(desc, '@');
+	if (tmp) {
+		long type_idx;
+		/*
+		 * Isolate the string number and convert it into a
+		 * binary value; this will be an index to get suffix
+		 * of the uprobe name (defining the type)
+		 */
+		tmp[0] = '\0';
+		type_idx = strtol(desc, NULL, 10);
+		/* Check that the conversion went OK */
+		if (type_idx == LONG_MIN || type_idx == LONG_MAX) {
+			pr_debug4("Failed to parse sdt type\n");
+			goto error;
+		}
+		/* Check that the converted value is OK */
+		if (type_idx < -8 || type_idx > 8) {
+			pr_debug4("Failed to get a valid sdt type\n");
+			goto error;
+		}
+		suffix = type_to_suffix[type_idx + 8];
+		/* Get rid of the sdt prefix which is now useless */
+		tmp++;
+		memmove(desc, tmp, strlen(tmp) + 1);
+	}
+
+	/*
+	 * The uprobe tracer format does not support all the
+	 * addressing modes (notably: in x86 the scaled mode); so, we
+	 * detect ',' characters, if there is just one, there is no
+	 * use converting the sdt arg into a uprobe one.
+	 */
+	if (strchr(desc, ',')) {
+		pr_debug4("Skipping unsupported SDT argument; %s\n", desc);
+		goto out;
+	}
+
+	/*
+	 * If the argument addressing mode is indirect, we must check
+	 * a few things...
+	 */
+	tmp = strchr(desc, '(');
+	if (tmp) {
+		int j;
+
+		/*
+		 * ...if the addressing mode is indirect with a
+		 * positive offset (ex.: "1608(%ax)"), we need to add
+		 * a '+' prefix so as to be compliant with uprobe
+		 * format.
+		 */
+		if (desc[0] != '+' && desc[0] != '-')
+			prefix = "+";
+
+		/*
+		 * ...or if the addressing mode is indirect with a symbol
+		 * as offset, the argument will not be supported by
+		 * the uprobe tracer format; so, let's skip this one.
+		 */
+		for (j = 0; j < tmp - desc; j++) {
+			if (desc[j] != '+' && desc[j] != '-' &&
+				!isdigit(desc[j])) {
+				pr_debug4("Skipping unsupported SDT argument; "
+					"%s\n", desc);
+				goto out;
+			}
+		}
+	}
+
+	/*
+	 * The uprobe tracer format does not support constants; if we
+	 * find one in the current argument, let's skip the argument.
+	 */
+	if (strchr(desc, '$')) {
+		pr_debug4("Skipping unsupported SDT argument; %s\n", desc);
+		goto out;
+	}
+
+	/*
+	 * The uprobe parser does not support all gas register names;
+	 * so, we have to replace them (ex. for x86_64: %rax -> %ax);
+	 * the loop below looks for the register names (starting with
+	 * a '%' and tries to perform the needed renamings.
+	 */
+	tmp = strchr(desc, '%');
+	while (tmp) {
+		size_t offset = tmp - desc;
+
+		ret = sdt_rename_register(&desc, desc + offset);
+		if (ret < 0)
+			goto error;
+
+		/*
+		 * The desc pointer might have changed; so, let's not
+		 * try to reuse tmp for next lookup
+		 */
+		tmp = strchr(desc + offset + 1, '%');
+	}
+
+	if (strbuf_addf(buf, " arg%d=%s%s%s", i + 1, prefix, desc, suffix) < 0)
+		goto error;
+
+out:
+	ret = 0;
+error:
+	free(desc);
+	return ret;
+}
+
+static char *synthesize_sdt_probe_command(struct sdt_note *note,
+					const char *pathname,
+					const char *sdtgrp)
+{
+	struct strbuf buf;
+	char *ret = NULL, **args;
+	int i, args_count;
+
+	if (strbuf_init(&buf, 32) < 0)
+		return NULL;
+
+	if (strbuf_addf(&buf, "p:%s/%s %s:0x%llx",
+				sdtgrp, note->name, pathname,
+				sdt_note__get_addr(note)) < 0)
+		goto error;
+
+	if (!note->args)
+		goto out;
+
+	if (note->args) {
+		args = argv_split(note->args, &args_count);
+
+		for (i = 0; i < args_count; ++i) {
+			if (synthesize_sdt_probe_arg(&buf, i, args[i]) < 0)
+				goto error;
+		}
+	}
+
+out:
+	ret = strbuf_detach(&buf, NULL);
+error:
+	strbuf_release(&buf);
+	return ret;
+}
+
 int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
 {
 	struct probe_cache_entry *entry = NULL;
@@ -724,11 +885,12 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
 			entry->pev.group = strdup(sdtgrp);
 			list_add_tail(&entry->node, &pcache->entries);
 		}
-		ret = asprintf(&buf, "p:%s/%s %s:0x%llx",
-				sdtgrp, note->name, pathname,
-				sdt_note__get_addr(note));
-		if (ret < 0)
+		buf = synthesize_sdt_probe_command(note, pathname, sdtgrp);
+		if (!buf) {
+			ret = -ENOMEM;
 			break;
+		}
+
 		strlist__add(entry->tevlist, buf);
 		free(buf);
 		entry = NULL;
-- 
2.9.3

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

* [PATCH 05/20] perf sdt x86: Add renaming logic for rNN and other registers
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Ravi Bangoria, Alexander Shishkin,
	Alexis Berlemont, Madhavan Srinivasan, Michael Ellerman,
	Naveen N . Rao, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

'perf probe' is failing for sdt markers whose arguments has rNN (with
postfix b/w/d), %rsp, %esp, %sil etc. registers. Add renaming logic for
these registers.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170202111143.14319-3-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/perf_regs.c | 44 ++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c
index 09a7f556dc7c..d8a8dcf761f7 100644
--- a/tools/perf/arch/x86/util/perf_regs.c
+++ b/tools/perf/arch/x86/util/perf_regs.c
@@ -48,10 +48,42 @@ static const struct sdt_name_reg sdt_reg_renamings[] = {
 	SDT_NAME_REG(rdx, dx),
 	SDT_NAME_REG(esi, si),
 	SDT_NAME_REG(rsi, si),
+	SDT_NAME_REG(sil, si),
 	SDT_NAME_REG(edi, di),
 	SDT_NAME_REG(rdi, di),
+	SDT_NAME_REG(dil, di),
 	SDT_NAME_REG(ebp, bp),
 	SDT_NAME_REG(rbp, bp),
+	SDT_NAME_REG(bpl, bp),
+	SDT_NAME_REG(rsp, sp),
+	SDT_NAME_REG(esp, sp),
+	SDT_NAME_REG(spl, sp),
+
+	/* rNN registers */
+	SDT_NAME_REG(r8b,  r8),
+	SDT_NAME_REG(r8w,  r8),
+	SDT_NAME_REG(r8d,  r8),
+	SDT_NAME_REG(r9b,  r9),
+	SDT_NAME_REG(r9w,  r9),
+	SDT_NAME_REG(r9d,  r9),
+	SDT_NAME_REG(r10b, r10),
+	SDT_NAME_REG(r10w, r10),
+	SDT_NAME_REG(r10d, r10),
+	SDT_NAME_REG(r11b, r11),
+	SDT_NAME_REG(r11w, r11),
+	SDT_NAME_REG(r11d, r11),
+	SDT_NAME_REG(r12b, r12),
+	SDT_NAME_REG(r12w, r12),
+	SDT_NAME_REG(r12d, r12),
+	SDT_NAME_REG(r13b, r13),
+	SDT_NAME_REG(r13w, r13),
+	SDT_NAME_REG(r13d, r13),
+	SDT_NAME_REG(r14b, r14),
+	SDT_NAME_REG(r14w, r14),
+	SDT_NAME_REG(r14d, r14),
+	SDT_NAME_REG(r15b, r15),
+	SDT_NAME_REG(r15w, r15),
+	SDT_NAME_REG(r15d, r15),
 	SDT_NAME_REG_END,
 };
 
@@ -88,18 +120,6 @@ int sdt_rename_register(char **pdesc, char *old_name)
 
 	/* Copy the chars after the register name (if need be) */
 	offset = prefix_len + sdt_len;
-	if (offset < old_desc_len) {
-		/*
-		 * The orginal register name can be suffixed by 'b',
-		 * 'w' or 'd' to indicate its size; so, we need to
-		 * skip this char if we met one.
-		 */
-		char sfx = old_desc[offset];
-
-		if (sfx == 'b' || sfx == 'w'  || sfx == 'd')
-			offset++;
-	}
-
 	if (offset < old_desc_len)
 		memcpy(new_desc + prefix_len + uprobe_len,
 			old_desc + offset, old_desc_len - offset);
-- 
2.9.3

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

* [PATCH 06/20] perf annotate: More exactly grep -v of the objdump command
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Taeung Song, Jiri Olsa, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo

From: Taeung Song <treeze.taeung@gmail.com>

The 'grep -v "filename"' applied to the objdump command output cause a
side effect eliminating filename:linenr of output of 'objdump -l' if the
object file name and source file name are the same, fix it.

E.g. the output of the following objdump command in symbol__disassemble():

    $ objdump -l -d -S -C /home/taeung/hello --start-address=...

    /home/taeung/hello:     file format elf64-x86-64

    Disassembly of section .text:

    0000000000400526 <main>:
    main():
    /home/taeung/hello.c:4

    void main()
    {
      400526:	55                   	push   %rbp
      400527:	48 89 e5             	mov    %rsp,%rbp
    /home/taeung/hello.c:5
    ...

But it uses grep -v "filename" e.g. "/home/taeung/hello" in the objdump
command to remove the first line containing file name and file format
("/home/taeung/hello:     file format elf64-x86-64"):

Before:

    $ objdump -l -d -S -C /home/taeung/hello | grep /home/taeung/hello

But this causes a side effect, removing filename:linenr too, because the
object file and source file have the same name e.g. "/home/taueng/hello",
"/home/taeung/hello.c"

So more do a better match by using grep -v as below to correctly remove
that first line:

    "/home/taeung/hello:     file format elf64-x86-64"

After:

    $ objdump -l -d -S -C /home/taeung/hello | grep /home/taeung/hello:

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1489978617-31396-5-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 273f21fa32b5..4d325cdcb732 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1435,7 +1435,7 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
 	snprintf(command, sizeof(command),
 		 "%s %s%s --start-address=0x%016" PRIx64
 		 " --stop-address=0x%016" PRIx64
-		 " -l -d %s %s -C %s 2>/dev/null|grep -v %s|expand",
+		 " -l -d %s %s -C %s 2>/dev/null|grep -v %s:|expand",
 		 objdump_path ? objdump_path : "objdump",
 		 disassembler_style ? "-M " : "",
 		 disassembler_style ? disassembler_style : "",
-- 
2.9.3

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

* [PATCH 07/20] perf annotate: Add comment clarifying how the source code line is parsed
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Jiri Olsa, Namhyung Kim, Taeung Song, Wang Nan

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

The source code line number (lineno) needs to be kept in accross calls
to symbol__parse_objdump_line() when parsing the output of 'objdump -l
-dS', so that it can associate it with the instructions till the next
line.

See disasm_line__new() and struct disasm_line::line_nr.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-7hpx8f8ybdpiujceysaj229w@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4d325cdcb732..22cd1dbe724b 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1482,6 +1482,12 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
 
 	nline = 0;
 	while (!feof(file)) {
+		/*
+		 * The source code line number (lineno) needs to be kept in
+		 * accross calls to symbol__parse_objdump_line(), so that it
+		 * can associate it with the instructions till the next one.
+		 * See disasm_line__new() and struct disasm_line::line_nr.
+		 */
 		if (symbol__parse_objdump_line(sym, map, arch, file, privsize,
 			    &lineno) < 0)
 			break;
-- 
2.9.3

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

* [PATCH 08/20] perf stat: Factor out callback for collecting event values
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

To be used in next patch to support automatic summing of alias events.

v2: Move check for bad results to next patch
v3: Remove trivial addition.
v4: Use perf_evsel__cpus instead of evsel->cpus

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-2-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 103 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 80 insertions(+), 23 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index f53f449d864d..5c13a0f40adc 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1182,11 +1182,46 @@ static void aggr_update_shadow(void)
 	}
 }
 
+static void collect_data(struct perf_evsel *counter,
+			    void (*cb)(struct perf_evsel *counter, void *data,
+				       bool first),
+			    void *data)
+{
+	cb(counter, data, true);
+}
+
+struct aggr_data {
+	u64 ena, run, val;
+	int id;
+	int nr;
+	int cpu;
+};
+
+static void aggr_cb(struct perf_evsel *counter, void *data, bool first)
+{
+	struct aggr_data *ad = data;
+	int cpu, s2;
+
+	for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
+		struct perf_counts_values *counts;
+
+		s2 = aggr_get_id(perf_evsel__cpus(counter), cpu);
+		if (s2 != ad->id)
+			continue;
+		if (first)
+			ad->nr++;
+		counts = perf_counts(counter->counts, cpu, 0);
+		ad->val += counts->val;
+		ad->ena += counts->ena;
+		ad->run += counts->run;
+	}
+}
+
 static void print_aggr(char *prefix)
 {
 	FILE *output = stat_config.output;
 	struct perf_evsel *counter;
-	int cpu, s, s2, id, nr;
+	int s, id, nr;
 	double uval;
 	u64 ena, run, val;
 	bool first;
@@ -1201,23 +1236,20 @@ static void print_aggr(char *prefix)
 	 * Without each counter has its own line.
 	 */
 	for (s = 0; s < aggr_map->nr; s++) {
+		struct aggr_data ad;
 		if (prefix && metric_only)
 			fprintf(output, "%s", prefix);
 
-		id = aggr_map->map[s];
+		ad.id = id = aggr_map->map[s];
 		first = true;
 		evlist__for_each_entry(evsel_list, counter) {
-			val = ena = run = 0;
-			nr = 0;
-			for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
-				s2 = aggr_get_id(perf_evsel__cpus(counter), cpu);
-				if (s2 != id)
-					continue;
-				val += perf_counts(counter->counts, cpu, 0)->val;
-				ena += perf_counts(counter->counts, cpu, 0)->ena;
-				run += perf_counts(counter->counts, cpu, 0)->run;
-				nr++;
-			}
+			ad.val = ad.ena = ad.run = 0;
+			ad.nr = 0;
+			collect_data(counter, aggr_cb, &ad);
+			nr = ad.nr;
+			ena = ad.ena;
+			run = ad.run;
+			val = ad.val;
 			if (first && metric_only) {
 				first = false;
 				aggr_printout(counter, id, nr);
@@ -1261,6 +1293,21 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
 	}
 }
 
+struct caggr_data {
+	double avg, avg_enabled, avg_running;
+};
+
+static void counter_aggr_cb(struct perf_evsel *counter, void *data,
+			    bool first __maybe_unused)
+{
+	struct caggr_data *cd = data;
+	struct perf_stat_evsel *ps = counter->priv;
+
+	cd->avg += avg_stats(&ps->res_stats[0]);
+	cd->avg_enabled += avg_stats(&ps->res_stats[1]);
+	cd->avg_running += avg_stats(&ps->res_stats[2]);
+}
+
 /*
  * Print out the results of a single counter:
  * aggregated counts in system-wide mode
@@ -1268,23 +1315,30 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
 static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
 {
 	FILE *output = stat_config.output;
-	struct perf_stat_evsel *ps = counter->priv;
-	double avg = avg_stats(&ps->res_stats[0]);
 	double uval;
-	double avg_enabled, avg_running;
+	struct caggr_data cd = { .avg = 0.0 };
 
-	avg_enabled = avg_stats(&ps->res_stats[1]);
-	avg_running = avg_stats(&ps->res_stats[2]);
+	collect_data(counter, counter_aggr_cb, &cd);
 
 	if (prefix && !metric_only)
 		fprintf(output, "%s", prefix);
 
-	uval = avg * counter->scale;
-	printout(-1, 0, counter, uval, prefix, avg_running, avg_enabled, avg);
+	uval = cd.avg * counter->scale;
+	printout(-1, 0, counter, uval, prefix, cd.avg_running, cd.avg_enabled, cd.avg);
 	if (!metric_only)
 		fprintf(output, "\n");
 }
 
+static void counter_cb(struct perf_evsel *counter, void *data,
+		       bool first __maybe_unused)
+{
+	struct aggr_data *ad = data;
+
+	ad->val += perf_counts(counter->counts, ad->cpu, 0)->val;
+	ad->ena += perf_counts(counter->counts, ad->cpu, 0)->ena;
+	ad->run += perf_counts(counter->counts, ad->cpu, 0)->run;
+}
+
 /*
  * Print out the results of a single counter:
  * does not use aggregated count in system-wide
@@ -1297,9 +1351,12 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
 	int cpu;
 
 	for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
-		val = perf_counts(counter->counts, cpu, 0)->val;
-		ena = perf_counts(counter->counts, cpu, 0)->ena;
-		run = perf_counts(counter->counts, cpu, 0)->run;
+		struct aggr_data ad = { .cpu = cpu };
+
+		collect_data(counter, counter_cb, &ad);
+		val = ad.val;
+		ena = ad.ena;
+		run = ad.run;
 
 		if (prefix)
 			fprintf(output, "%s", prefix);
-- 
2.9.3

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

* [PATCH 09/20] perf stat: Collapse identically named events
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

The uncore PMU has a lot of duplicated PMUs for different subsystems.
When expanding an uncore alias we usually end up with a large
number of identically named aliases, which makes perf stat
output difficult to read.

Automatically sum them up in perf stat, unless --no-merge is specified.

This can be default because only the uncores generally have duplicated
aliases. Other PMUs have unique names.

Before:

  % perf stat --no-merge -a -e unc_c_llc_lookup.any sleep 1

  Performance counter stats for 'system wide':

           694,976 Bytes unc_c_llc_lookup.any
           706,304 Bytes unc_c_llc_lookup.any
           956,608 Bytes unc_c_llc_lookup.any
           782,720 Bytes unc_c_llc_lookup.any
           605,696 Bytes unc_c_llc_lookup.any
           442,816 Bytes unc_c_llc_lookup.any
           659,328 Bytes unc_c_llc_lookup.any
           509,312 Bytes unc_c_llc_lookup.any
           263,936 Bytes unc_c_llc_lookup.any
           592,448 Bytes unc_c_llc_lookup.any
           672,448 Bytes unc_c_llc_lookup.any
           608,640 Bytes unc_c_llc_lookup.any
           641,024 Bytes unc_c_llc_lookup.any
           856,896 Bytes unc_c_llc_lookup.any
           808,832 Bytes unc_c_llc_lookup.any
           684,864 Bytes unc_c_llc_lookup.any
           710,464 Bytes unc_c_llc_lookup.any
           538,304 Bytes unc_c_llc_lookup.any

       1.002577660 seconds time elapsed

After:

  % perf stat -a -e unc_c_llc_lookup.any sleep 1

  Performance counter stats for 'system wide':

         2,685,120 Bytes unc_c_llc_lookup.any

       1.002648032 seconds time elapsed

v2: Split collect_aliases. Rename alias flag.
v3: Make sure unsupported/not counted is always printed.
v4: Factor out callback change into separate patch.
v5: Move check for bad results here
    Move merged check into collect_data

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-3-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-stat.txt |  3 +++
 tools/perf/builtin-stat.c              | 38 ++++++++++++++++++++++++++++++----
 tools/perf/util/evsel.h                |  1 +
 3 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index 978548138624..bd0e4417f2be 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -236,6 +236,9 @@ To interpret the results it is usually needed to know on which
 CPUs the workload runs on. If needed the CPUs can be forced using
 taskset.
 
+--no-merge::
+Do not merge results from same PMUs.
+
 EXAMPLES
 --------
 
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 5c13a0f40adc..a4da10a506dd 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -140,6 +140,7 @@ static unsigned int		unit_width			= 4; /* strlen("unit") */
 static bool			forever				= false;
 static bool			metric_only			= false;
 static bool			force_metric_only		= false;
+static bool			no_merge			= false;
 static struct timespec		ref_time;
 static struct cpu_map		*aggr_map;
 static aggr_get_id_t		aggr_get_id;
@@ -1182,12 +1183,37 @@ static void aggr_update_shadow(void)
 	}
 }
 
-static void collect_data(struct perf_evsel *counter,
+static void collect_all_aliases(struct perf_evsel *counter,
 			    void (*cb)(struct perf_evsel *counter, void *data,
 				       bool first),
 			    void *data)
 {
+	struct perf_evsel *alias;
+
+	alias = list_prepare_entry(counter, &(evsel_list->entries), node);
+	list_for_each_entry_continue (alias, &evsel_list->entries, node) {
+		if (strcmp(perf_evsel__name(alias), perf_evsel__name(counter)) ||
+		    alias->scale != counter->scale ||
+		    alias->cgrp != counter->cgrp ||
+		    strcmp(alias->unit, counter->unit) ||
+		    nsec_counter(alias) != nsec_counter(counter))
+			break;
+		alias->merged_stat = true;
+		cb(alias, data, false);
+	}
+}
+
+static bool collect_data(struct perf_evsel *counter,
+			    void (*cb)(struct perf_evsel *counter, void *data,
+				       bool first),
+			    void *data)
+{
+	if (counter->merged_stat)
+		return false;
 	cb(counter, data, true);
+	if (!no_merge)
+		collect_all_aliases(counter, cb, data);
+	return true;
 }
 
 struct aggr_data {
@@ -1245,7 +1271,8 @@ static void print_aggr(char *prefix)
 		evlist__for_each_entry(evsel_list, counter) {
 			ad.val = ad.ena = ad.run = 0;
 			ad.nr = 0;
-			collect_data(counter, aggr_cb, &ad);
+			if (!collect_data(counter, aggr_cb, &ad))
+				continue;
 			nr = ad.nr;
 			ena = ad.ena;
 			run = ad.run;
@@ -1318,7 +1345,8 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
 	double uval;
 	struct caggr_data cd = { .avg = 0.0 };
 
-	collect_data(counter, counter_aggr_cb, &cd);
+	if (!collect_data(counter, counter_aggr_cb, &cd))
+		return;
 
 	if (prefix && !metric_only)
 		fprintf(output, "%s", prefix);
@@ -1353,7 +1381,8 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
 	for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
 		struct aggr_data ad = { .cpu = cpu };
 
-		collect_data(counter, counter_cb, &ad);
+		if (!collect_data(counter, counter_cb, &ad))
+			return;
 		val = ad.val;
 		ena = ad.ena;
 		run = ad.run;
@@ -1701,6 +1730,7 @@ static const struct option stat_options[] = {
 		    "list of cpus to monitor in system-wide"),
 	OPT_SET_UINT('A', "no-aggr", &stat_config.aggr_mode,
 		    "disable CPU count aggregation", AGGR_NONE),
+	OPT_BOOLEAN(0, "no-merge", &no_merge, "Do not merge identical named events"),
 	OPT_STRING('x', "field-separator", &csv_sep, "separator",
 		   "print counts with custom separator"),
 	OPT_CALLBACK('G', "cgroup", &evsel_list, "name",
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 06ef6f29efa1..bd2e9b112d49 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -131,6 +131,7 @@ struct perf_evsel {
 	bool			cmdline_group_boundary;
 	struct list_head	config_terms;
 	int			bpf_fd;
+	bool			merged_stat;
 };
 
 union u64_swap {
-- 
2.9.3

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

* [PATCH 10/20] perf stat: Handle partially bad results with merging
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

When any result that is being merged is bad, mark them all bad to give
consistent output in interval mode.

No before/after, because the issue was only found in theoretical review
and it is hard to reproduce

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-4-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index a4da10a506dd..cd7dc3b648ca 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1237,6 +1237,16 @@ static void aggr_cb(struct perf_evsel *counter, void *data, bool first)
 		if (first)
 			ad->nr++;
 		counts = perf_counts(counter->counts, cpu, 0);
+		/*
+		 * When any result is bad, make them all to give
+		 * consistent output in interval mode.
+		 */
+		if (counts->ena == 0 || counts->run == 0 ||
+		    counter->counts->scaled == -1) {
+			ad->ena = 0;
+			ad->run = 0;
+			break;
+		}
 		ad->val += counts->val;
 		ad->ena += counts->ena;
 		ad->run += counts->run;
-- 
2.9.3

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

* [PATCH 11/20] perf tools: Factor out PMU matching in parser
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Factor out the PMU name matching in the event parser into a separate
function, to use the same code for other grammar rules later.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-5-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c | 46 ++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/parse-events.h |  5 +++++
 tools/perf/util/parse-events.y | 30 +--------------------------
 3 files changed, 52 insertions(+), 29 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 54355d3caf09..c3edb373ed86 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1260,6 +1260,52 @@ int parse_events_add_pmu(struct parse_events_evlist *data,
 	return evsel ? 0 : -ENOMEM;
 }
 
+int parse_events_multi_pmu_add(struct parse_events_evlist *data,
+			       char *str, struct list_head **listp)
+{
+	struct list_head *head;
+	struct parse_events_term *term;
+	struct list_head *list;
+	struct perf_pmu *pmu = NULL;
+	int ok = 0;
+
+	*listp = NULL;
+	/* Add it for all PMUs that support the alias */
+	list = malloc(sizeof(struct list_head));
+	if (!list)
+		return -1;
+	INIT_LIST_HEAD(list);
+	while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+		struct perf_pmu_alias *alias;
+
+		list_for_each_entry(alias, &pmu->aliases, list) {
+			if (!strcasecmp(alias->name, str)) {
+				head = malloc(sizeof(struct list_head));
+				if (!head)
+					return -1;
+				INIT_LIST_HEAD(head);
+				if (parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
+							   str, 1, false, &str, NULL) < 0)
+					return -1;
+				list_add_tail(&term->list, head);
+
+				if (!parse_events_add_pmu(data, list,
+						  pmu->name, head)) {
+					pr_debug("%s -> %s/%s/\n", str,
+						 pmu->name, alias->str);
+					ok++;
+				}
+
+				parse_events_terms__delete(head);
+			}
+		}
+	}
+	if (!ok)
+		return -1;
+	*listp = list;
+	return 0;
+}
+
 int parse_events__modifier_group(struct list_head *list,
 				 char *event_mod)
 {
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 8c72b0ff7fcb..deca9ce965a7 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -167,6 +167,11 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx,
 int parse_events_add_pmu(struct parse_events_evlist *data,
 			 struct list_head *list, char *name,
 			 struct list_head *head_config);
+
+int parse_events_multi_pmu_add(struct parse_events_evlist *data,
+			       char *str,
+			       struct list_head **listp);
+
 enum perf_pmu_event_symbol_type
 perf_pmu__parse_check(const char *name);
 void parse_events__set_leader(char *name, struct list_head *list);
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 30f018ea1370..36af02f95243 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -236,37 +236,9 @@ PE_NAME opt_event_config
 |
 PE_KERNEL_PMU_EVENT sep_dc
 {
-	struct parse_events_evlist *data = _data;
-	struct list_head *head;
-	struct parse_events_term *term;
 	struct list_head *list;
-	struct perf_pmu *pmu = NULL;
-	int ok = 0;
 
-	/* Add it for all PMUs that support the alias */
-	ALLOC_LIST(list);
-	while ((pmu = perf_pmu__scan(pmu)) != NULL) {
-		struct perf_pmu_alias *alias;
-
-		list_for_each_entry(alias, &pmu->aliases, list) {
-			if (!strcasecmp(alias->name, $1)) {
-				ALLOC_LIST(head);
-				ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
-					$1, 1, false, &@1, NULL));
-				list_add_tail(&term->list, head);
-
-				if (!parse_events_add_pmu(data, list,
-						  pmu->name, head)) {
-					pr_debug("%s -> %s/%s/\n", $1,
-						 pmu->name, alias->str);
-					ok++;
-				}
-
-				parse_events_terms__delete(head);
-			}
-		}
-	}
-	if (!ok)
+	if (parse_events_multi_pmu_add(_data, $1, &list) < 0)
 		YYABORT;
 	$$ = list;
 }
-- 
2.9.3

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

* [PATCH 12/20] perf pmu: Expand PMU events by prefix match
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

When the user specifies a pmu directly, expand it automatically with a
prefix match for all available PMUs, similar as we do for the normal
aliases now.

This allows to specify attributes for duplicated boxes quickly.  For
example uncore_cbox_{0,6}/.../ can be now specified as uncore_cbox/.../
and it gets automatically expanded for all boxes.

This generally makes it more concise to write uncore specifications, and
also avoids the need to know the exact topology of the system.

Before:

  % perf stat -a -e uncore_cbox_0/event=0x35,umask=0x1,filter_opc=0x19C/,\
  uncore_cbox_1/event=0x35,umask=0x1,filter_opc=0x19C/,\
  uncore_cbox_2/event=0x35,umask=0x1,filter_opc=0x19C/,\
  uncore_cbox_3/event=0x35,umask=0x1,filter_opc=0x19C/,\
  uncore_cbox_4/event=0x35,umask=0x1,filter_opc=0x19C/,\
  uncore_cbox_5/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1

After:

  % perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1

v2: Handle all bison rules. Move multi add code to separate function.
    Handle uncore_ prefix correctly.
v3: Move parse_events_multi_pmu_add to separate patch. Move uncore
    prefix check to separate patch.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-6-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c | 25 +++++++++++++++++++++++++
 tools/perf/util/parse-events.h |  3 +++
 tools/perf/util/parse-events.y | 40 ++++++++++++++++++++++++++--------------
 3 files changed, 54 insertions(+), 14 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index c3edb373ed86..e594c974c93e 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2462,6 +2462,31 @@ int parse_events_term__clone(struct parse_events_term **new,
 	return new_term(new, &temp, term->val.str, term->val.num);
 }
 
+int parse_events_copy_term_list(struct list_head *old,
+				 struct list_head **new)
+{
+	struct parse_events_term *term, *n;
+	int ret;
+
+	if (!old) {
+		*new = NULL;
+		return 0;
+	}
+
+	*new = malloc(sizeof(struct list_head));
+	if (!*new)
+		return -ENOMEM;
+	INIT_LIST_HEAD(*new);
+
+	list_for_each_entry (term, old, list) {
+		ret = parse_events_term__clone(&n, term);
+		if (ret)
+			return ret;
+		list_add_tail(&n->list, *new);
+	}
+	return 0;
+}
+
 void parse_events_terms__purge(struct list_head *terms)
 {
 	struct parse_events_term *term, *h;
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index deca9ce965a7..f38086b8dbea 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -172,6 +172,9 @@ int parse_events_multi_pmu_add(struct parse_events_evlist *data,
 			       char *str,
 			       struct list_head **listp);
 
+int parse_events_copy_term_list(struct list_head *old,
+				 struct list_head **new);
+
 enum perf_pmu_event_symbol_type
 perf_pmu__parse_check(const char *name);
 void parse_events__set_leader(char *name, struct list_head *list);
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 36af02f95243..20935b17753d 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -226,11 +226,32 @@ event_pmu:
 PE_NAME opt_event_config
 {
 	struct parse_events_evlist *data = _data;
-	struct list_head *list;
+	struct list_head *list, *orig_terms, *terms;
+
+	if (parse_events_copy_term_list($2, &orig_terms))
+		YYABORT;
 
 	ALLOC_LIST(list);
-	ABORT_ON(parse_events_add_pmu(data, list, $1, $2));
+	if (parse_events_add_pmu(data, list, $1, $2)) {
+		struct perf_pmu *pmu = NULL;
+		int ok = 0;
+
+		while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+			char *name = pmu->name;
+
+			if (!strncmp($1, name, strlen($1))) {
+				if (parse_events_copy_term_list(orig_terms, &terms))
+					YYABORT;
+				if (!parse_events_add_pmu(data, list, pmu->name, terms))
+					ok++;
+				parse_events_terms__delete(terms);
+			}
+		}
+		if (!ok)
+			YYABORT;
+	}
 	parse_events_terms__delete($2);
+	parse_events_terms__delete(orig_terms);
 	$$ = list;
 }
 |
@@ -245,21 +266,12 @@ PE_KERNEL_PMU_EVENT sep_dc
 |
 PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc
 {
-	struct parse_events_evlist *data = _data;
-	struct list_head *head;
-	struct parse_events_term *term;
 	struct list_head *list;
 	char pmu_name[128];
-	snprintf(&pmu_name, 128, "%s-%s", $1, $3);
 
-	ALLOC_LIST(head);
-	ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
-					&pmu_name, 1, false, &@1, NULL));
-	list_add_tail(&term->list, head);
-
-	ALLOC_LIST(list);
-	ABORT_ON(parse_events_add_pmu(data, list, "cpu", head));
-	parse_events_terms__delete(head);
+	snprintf(&pmu_name, 128, "%s-%s", $1, $3);
+	if (parse_events_multi_pmu_add(_data, pmu_name, &list) < 0)
+		YYABORT;
 	$$ = list;
 }
 
-- 
2.9.3

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

* [PATCH 13/20] perf pmu: Special case uncore_ prefix
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Special case uncore_ prefix in PMU match, to allow for shorter event
uncore specifications.

Before:

  perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1

After

  perf stat -a -e cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1

Committer tests:

   # perf list uncore

  List of pre-defined events (to be used in -e):

    uncore_cbox_0/clockticks/                       [Kernel PMU event]
    uncore_cbox_1/clockticks/                       [Kernel PMU event]
    uncore_imc/data_reads/                          [Kernel PMU event]
    uncore_imc/data_writes/                         [Kernel PMU event]

  # perf stat -a -e cbox_0/clockticks/ sleep 1

   Performance counter stats for 'system wide':

  281,474,976,653,084      cbox_0/clockticks/

       1.000870129 seconds time elapsed

  #

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/r/20170320201711.14142-7-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 20935b17753d..04fd8c9af9f9 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -239,6 +239,9 @@ PE_NAME opt_event_config
 		while ((pmu = perf_pmu__scan(pmu)) != NULL) {
 			char *name = pmu->name;
 
+			if (!strncmp(name, "uncore_", 7) &&
+			    strncmp($1, "uncore_", 7))
+				name += 7;
 			if (!strncmp($1, name, strlen($1))) {
 				if (parse_events_copy_term_list(orig_terms, &terms))
 					YYABORT;
-- 
2.9.3

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

* [PATCH 14/20] perf tools: Add a simple expression parser for JSON
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Add a simple expression parser good enough to parse JSON relation
expressions. The parser is implemented using bison.

This is just intended as an simple parser for internal usage in the
event lists, not the beginning of a "perf scripting language"

v2: Use expr__ prefix instead of expr_
    Support multiple free variables for parser

Committer note:

The v2 patch had:

  %define api.pure full

In expr.y, that is a feature introduced in bison 2.7, to have reentrant
parsers, not using global variables, which would make tools/perf stop
building with the bison version shipped in older distros, so Andi
realised that the other parsers (e.g. parse-events.y) were using:

  %pure-parser

Which is present in older versions of bison and fits the bill.

I added:

  CFLAGS_expr-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w

To finally make it build, copying what was there for pmu-bison.o,
another parser.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-8-andi@firstfloor.org
[ stdlib.h is needed in tests/expr.c for free() fixing build in systems such as ubuntu:16.04-x-s390 ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/Build          |   1 +
 tools/perf/tests/builtin-test.c |   4 +
 tools/perf/tests/expr.c         |  56 +++++++++++++
 tools/perf/tests/tests.h        |   1 +
 tools/perf/util/Build           |   6 ++
 tools/perf/util/expr.h          |  25 ++++++
 tools/perf/util/expr.y          | 173 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 266 insertions(+)
 create mode 100644 tools/perf/tests/expr.c
 create mode 100644 tools/perf/util/expr.h
 create mode 100644 tools/perf/util/expr.y

diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index 1cb3d9b540e9..af58ebc243ef 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -38,6 +38,7 @@ perf-y += cpumap.o
 perf-y += stat.o
 perf-y += event_update.o
 perf-y += event-times.o
+perf-y += expr.o
 perf-y += backward-ring-buffer.o
 perf-y += sdt.o
 perf-y += is_printable_array.o
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 83c4669cbc5b..86822969e8a8 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -44,6 +44,10 @@ static struct test generic_tests[] = {
 		.func = test__parse_events,
 	},
 	{
+		.desc = "Simple expression parser",
+		.func = test__expr,
+	},
+	{
 		.desc = "PERF_RECORD_* events & perf_sample fields",
 		.func = test__PERF_RECORD,
 	},
diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
new file mode 100644
index 000000000000..6c6a3749aaf6
--- /dev/null
+++ b/tools/perf/tests/expr.c
@@ -0,0 +1,56 @@
+#include "util/debug.h"
+#include "util/expr.h"
+#include "tests.h"
+#include <stdlib.h>
+
+static int test(struct parse_ctx *ctx, const char *e, double val2)
+{
+	double val;
+
+	if (expr__parse(&val, ctx, &e))
+		TEST_ASSERT_VAL("parse test failed", 0);
+	TEST_ASSERT_VAL("unexpected value", val == val2);
+	return 0;
+}
+
+int test__expr(int subtest __maybe_unused)
+{
+	const char *p;
+	const char **other;
+	double val;
+	int ret;
+	struct parse_ctx ctx;
+	int num_other;
+
+	expr__ctx_init(&ctx);
+	expr__add_id(&ctx, "FOO", 1);
+	expr__add_id(&ctx, "BAR", 2);
+
+	ret = test(&ctx, "1+1", 2);
+	ret |= test(&ctx, "FOO+BAR", 3);
+	ret |= test(&ctx, "(BAR/2)%2", 1);
+	ret |= test(&ctx, "1 - -4",  5);
+	ret |= test(&ctx, "(FOO-1)*2 + (BAR/2)%2 - -4",  5);
+
+	if (ret)
+		return ret;
+
+	p = "FOO/0";
+	ret = expr__parse(&val, &ctx, &p);
+	TEST_ASSERT_VAL("division by zero", ret == 1);
+
+	p = "BAR/";
+	ret = expr__parse(&val, &ctx, &p);
+	TEST_ASSERT_VAL("missing operand", ret == 1);
+
+	TEST_ASSERT_VAL("find other",
+			expr__find_other("FOO + BAR + BAZ + BOZO", "FOO", &other, &num_other) == 0);
+	TEST_ASSERT_VAL("find other", num_other == 3);
+	TEST_ASSERT_VAL("find other", !strcmp(other[0], "BAR"));
+	TEST_ASSERT_VAL("find other", !strcmp(other[1], "BAZ"));
+	TEST_ASSERT_VAL("find other", !strcmp(other[2], "BOZO"));
+	TEST_ASSERT_VAL("find other", other[3] == NULL);
+	free((void *)other);
+
+	return 0;
+}
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 1fa9b9d83aa5..631859629403 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -62,6 +62,7 @@ int test__sample_parsing(int subtest);
 int test__keep_tracking(int subtest);
 int test__parse_no_sample_id_all(int subtest);
 int test__dwarf_unwind(int subtest);
+int test__expr(int subtest);
 int test__hists_filter(int subtest);
 int test__mmap_thread_lookup(int subtest);
 int test__thread_mg_share(int subtest);
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index fb4f42f1bb38..2ae92da613dd 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -90,6 +90,7 @@ libperf-y += mem-events.o
 libperf-y += vsprintf.o
 libperf-y += drv_configs.o
 libperf-y += time-utils.o
+libperf-y += expr-bison.o
 
 libperf-$(CONFIG_LIBBPF) += bpf-loader.o
 libperf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
@@ -142,6 +143,10 @@ $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $@ -p parse_events_
 
+$(OUTPUT)util/expr-bison.c: util/expr.y
+	$(call rule_mkdir)
+	$(Q)$(call echo-cmd,bison)$(BISON) -v util/expr.y -d $(PARSER_DEBUG_BISON) -o $@ -p expr__
+
 $(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
@@ -154,6 +159,7 @@ CFLAGS_parse-events-flex.o  += -w
 CFLAGS_pmu-flex.o           += -w
 CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
 CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_expr-bison.o         += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
 $(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
new file mode 100644
index 000000000000..9c2760a1a96e
--- /dev/null
+++ b/tools/perf/util/expr.h
@@ -0,0 +1,25 @@
+#ifndef PARSE_CTX_H
+#define PARSE_CTX_H 1
+
+#define EXPR_MAX_OTHER 8
+#define MAX_PARSE_ID EXPR_MAX_OTHER
+
+struct parse_id {
+	const char *name;
+	double val;
+};
+
+struct parse_ctx {
+	int num_ids;
+	struct 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);
+#ifndef IN_EXPR_Y
+int expr__parse(double *final_val, struct parse_ctx *ctx, const char **pp);
+#endif
+int expr__find_other(const char *p, const char *one, const char ***other,
+		int *num_other);
+
+#endif
diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
new file mode 100644
index 000000000000..954556bea36e
--- /dev/null
+++ b/tools/perf/util/expr.y
@@ -0,0 +1,173 @@
+/* Simple expression parser */
+%{
+#include "util.h"
+#include "util/debug.h"
+#define IN_EXPR_Y 1
+#include "expr.h"
+#include <string.h>
+
+#define MAXIDLEN 256
+%}
+
+%pure-parser
+%parse-param { double *final_val }
+%parse-param { struct parse_ctx *ctx }
+%parse-param { const char **pp }
+%lex-param { const char **pp }
+
+%union {
+	double num;
+	char id[MAXIDLEN+1];
+}
+
+%token <num> NUMBER
+%token <id> ID
+%left '|'
+%left '^'
+%left '&'
+%left '-' '+'
+%left '*' '/' '%'
+%left NEG NOT
+%type <num> expr
+
+%{
+static int expr__lex(YYSTYPE *res, const char **pp);
+
+static void expr__error(double *final_val __maybe_unused,
+		       struct parse_ctx *ctx __maybe_unused,
+		       const char **pp __maybe_unused,
+		       const char *s)
+{
+	pr_debug("%s\n", s);
+}
+
+static int lookup_id(struct parse_ctx *ctx, char *id, double *val)
+{
+	int i;
+
+	for (i = 0; i < ctx->num_ids; i++) {
+		if (!strcasecmp(ctx->ids[i].name, id)) {
+			*val = ctx->ids[i].val;
+			return 0;
+		}
+	}
+	return -1;
+}
+
+%}
+%%
+
+all_expr: expr			{ *final_val = $1; }
+	;
+
+expr:	  NUMBER
+	| ID			{ if (lookup_id(ctx, $1, &$$) < 0) {
+					pr_debug("%s not found", $1);
+					YYABORT;
+				  }
+				}
+	| expr '+' expr		{ $$ = $1 + $3; }
+	| expr '-' expr		{ $$ = $1 - $3; }
+	| expr '*' expr		{ $$ = $1 * $3; }
+	| expr '/' expr		{ if ($3 == 0) YYABORT; $$ = $1 / $3; }
+	| expr '%' expr		{ if ((long)$3 == 0) YYABORT; $$ = (long)$1 % (long)$3; }
+	| '-' expr %prec NEG	{ $$ = -$2; }
+	| '(' expr ')'		{ $$ = $2; }
+	;
+
+%%
+
+static int expr__symbol(YYSTYPE *res, const char *p, const char **pp)
+{
+	char *dst = res->id;
+	const char *s = p;
+
+	while (isalnum(*p) || *p == '_' || *p == '.') {
+		if (p - s >= MAXIDLEN)
+			return -1;
+		*dst++ = *p++;
+	}
+	*dst = 0;
+	*pp = p;
+	return ID;
+}
+
+static int expr__lex(YYSTYPE *res, const char **pp)
+{
+	int tok;
+	const char *s;
+	const char *p = *pp;
+
+	while (isspace(*p))
+		p++;
+	s = p;
+	switch (*p++) {
+	case 'a' ... 'z':
+	case 'A' ... 'Z':
+		return expr__symbol(res, p - 1, pp);
+	case '0' ... '9': case '.':
+		res->num = strtod(s, (char **)&p);
+		tok = NUMBER;
+		break;
+	default:
+		tok = *s;
+		break;
+	}
+	*pp = p;
+	return tok;
+}
+
+/* Caller must make sure id is allocated */
+void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
+{
+	int idx;
+	assert(ctx->num_ids < MAX_PARSE_ID);
+	idx = ctx->num_ids++;
+	ctx->ids[idx].name = name;
+	ctx->ids[idx].val = val;
+}
+
+void expr__ctx_init(struct parse_ctx *ctx)
+{
+	ctx->num_ids = 0;
+}
+
+int expr__find_other(const char *p, const char *one, const char ***other,
+		     int *num_otherp)
+{
+	const char *orig = p;
+	int err = -1;
+	int num_other;
+
+	*other = malloc((EXPR_MAX_OTHER + 1) * sizeof(char *));
+	if (!*other)
+		return -1;
+
+	num_other = 0;
+	for (;;) {
+		YYSTYPE val;
+		int tok = expr__lex(&val, &p);
+		if (tok == 0) {
+			err = 0;
+			break;
+		}
+		if (tok == ID && strcasecmp(one, val.id)) {
+			if (num_other >= EXPR_MAX_OTHER - 1) {
+				pr_debug("Too many extra events in %s\n", orig);
+				break;
+			}
+			(*other)[num_other] = strdup(val.id);
+			if (!(*other)[num_other])
+				return -1;
+			num_other++;
+		}
+	}
+	(*other)[num_other] = NULL;
+	*num_otherp = num_other;
+	if (err) {
+		*num_otherp = 0;
+		free(*other);
+		*other = NULL;
+	}
+	return err;
+}
-- 
2.9.3

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

* [PATCH 15/20] perf vendor events intel: Update Intel uncore JSON event files
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

- Add MetricName to describe Metric
- Remove redundant "derived from" in descriptions
- Rename UNC_M_CAS_COUNT to LLC_MISSES.READ

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-9-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../arch/x86/broadwellde/uncore-cache.json         | 28 ++++++------
 .../arch/x86/broadwellde/uncore-memory.json        | 26 +++++------
 .../arch/x86/broadwellde/uncore-power.json         | 26 +++++++----
 .../arch/x86/broadwellx/uncore-cache.json          | 28 ++++++------
 .../arch/x86/broadwellx/uncore-interconnect.json   |  6 +--
 .../arch/x86/broadwellx/uncore-memory.json         | 21 +++++----
 .../arch/x86/broadwellx/uncore-power.json          | 26 +++++++----
 .../pmu-events/arch/x86/haswellx/uncore-cache.json | 28 ++++++------
 .../arch/x86/haswellx/uncore-interconnect.json     |  6 +--
 .../arch/x86/haswellx/uncore-memory.json           | 21 +++++----
 .../pmu-events/arch/x86/haswellx/uncore-power.json | 26 +++++++----
 .../pmu-events/arch/x86/ivytown/uncore-cache.json  | 22 ++++-----
 .../arch/x86/ivytown/uncore-interconnect.json      | 12 +++--
 .../pmu-events/arch/x86/ivytown/uncore-memory.json | 19 ++++----
 .../pmu-events/arch/x86/ivytown/uncore-power.json  | 53 ++++++++++++++++------
 .../pmu-events/arch/x86/jaketown/uncore-cache.json | 13 +++---
 .../arch/x86/jaketown/uncore-interconnect.json     | 12 +++--
 .../arch/x86/jaketown/uncore-memory.json           | 21 +++++----
 .../pmu-events/arch/x86/jaketown/uncore-power.json | 53 ++++++++++++++++------
 19 files changed, 267 insertions(+), 180 deletions(-)

diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json
index 076459c51d4e..58ed6d33d1f4 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json
@@ -1,13 +1,13 @@
 [
     {
-        "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
+        "BriefDescription": "Uncore cache clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_C_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
+        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch)",
         "Counter": "0,1,2,3",
         "EventCode": "0x34",
         "EventName": "UNC_C_LLC_LOOKUP.ANY",
@@ -18,7 +18,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
+        "BriefDescription": "M line evictions from LLC (writebacks to memory)",
         "Counter": "0,1,2,3",
         "EventCode": "0x37",
         "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
@@ -212,7 +212,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
+        "BriefDescription": "read requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS",
@@ -221,7 +221,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
+        "BriefDescription": "read requests to local home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS_LOCAL",
@@ -230,7 +230,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
+        "BriefDescription": "read requests to remote home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS_REMOTE",
@@ -239,7 +239,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
+        "BriefDescription": "write requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES",
@@ -248,7 +248,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
+        "BriefDescription": "write requests to local home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
@@ -257,7 +257,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
+        "BriefDescription": "write requests to remote home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
@@ -266,7 +266,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
+        "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously)",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
@@ -275,7 +275,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
+        "BriefDescription": "M line forwarded from remote cache along with writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
@@ -285,7 +285,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
+        "BriefDescription": "M line forwarded from remote cache with no writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
@@ -295,7 +295,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
+        "BriefDescription": "Shared line response from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPS",
@@ -305,7 +305,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
+        "BriefDescription": "Shared line forwarded from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json
index d17dc235f734..fa09e12018ce 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json
@@ -3,7 +3,7 @@
         "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.RD",
+        "EventName": "LLC_MISSES.MEM_READ",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0x3",
@@ -13,48 +13,44 @@
         "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.WR",
+        "EventName": "LLC_MISSES.MEM_WRITE",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0xC",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory controller clock ticks. Derived from unc_m_clockticks",
-        "Counter": "0,1,2,3",
-        "EventName": "UNC_M_CLOCKTICKS",
-        "PerPkg": "1",
-        "Unit": "iMC"
-    },
-    {
-        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
+        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x85",
         "EventName": "UNC_M_POWER_CHANNEL_PPD",
         "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_channel_ppd %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
+        "BriefDescription": "Cycles all ranks are in critical thermal throttle",
         "Counter": "0,1,2,3",
         "EventCode": "0x86",
         "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
         "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_critical_throttle_cycles %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
+        "BriefDescription": "Cycles Memory is in self refresh power mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x43",
         "EventName": "UNC_M_POWER_SELF_REFRESH",
         "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_self_refresh %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
+        "BriefDescription": "Pre-charges due to page misses",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
@@ -63,7 +59,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
+        "BriefDescription": "Pre-charge for reads",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.RD",
@@ -72,7 +68,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
+        "BriefDescription": "Pre-charge for writes",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.WR",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json
index b44d43088bbb..dd1b95655d1d 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json
@@ -1,83 +1,91 @@
 [
     {
-        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
+        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_P_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C0 and C1. Derived from unc_p_power_state_occupancy.cores_c0",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
         "Filter": "occ_sel=1",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c0 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
         "Filter": "occ_sel=2",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c3 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events ",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
         "Filter": "occ_sel=3",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c6 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
+        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip",
         "Counter": "0,1,2,3",
         "EventCode": "0xA",
         "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
         "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "prochot_external_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
+        "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
         "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_limit_thermal_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
+        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x6",
         "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_os_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
+        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x5",
         "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_power_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
+        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x74",
         "EventName": "UNC_P_FREQ_TRANS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_trans_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     }
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json
index 076459c51d4e..58ed6d33d1f4 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json
@@ -1,13 +1,13 @@
 [
     {
-        "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
+        "BriefDescription": "Uncore cache clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_C_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
+        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch)",
         "Counter": "0,1,2,3",
         "EventCode": "0x34",
         "EventName": "UNC_C_LLC_LOOKUP.ANY",
@@ -18,7 +18,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
+        "BriefDescription": "M line evictions from LLC (writebacks to memory)",
         "Counter": "0,1,2,3",
         "EventCode": "0x37",
         "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
@@ -212,7 +212,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
+        "BriefDescription": "read requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS",
@@ -221,7 +221,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
+        "BriefDescription": "read requests to local home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS_LOCAL",
@@ -230,7 +230,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
+        "BriefDescription": "read requests to remote home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS_REMOTE",
@@ -239,7 +239,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
+        "BriefDescription": "write requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES",
@@ -248,7 +248,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
+        "BriefDescription": "write requests to local home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
@@ -257,7 +257,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
+        "BriefDescription": "write requests to remote home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
@@ -266,7 +266,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
+        "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously)",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
@@ -275,7 +275,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
+        "BriefDescription": "M line forwarded from remote cache along with writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
@@ -285,7 +285,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
+        "BriefDescription": "M line forwarded from remote cache with no writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
@@ -295,7 +295,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
+        "BriefDescription": "Shared line response from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPS",
@@ -305,7 +305,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
+        "BriefDescription": "Shared line forwarded from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json
index 39387f7909b2..824961318c1e 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json
@@ -1,6 +1,6 @@
 [
     {
-        "BriefDescription": "QPI clock ticks. Derived from unc_q_clockticks",
+        "BriefDescription": "QPI clock ticks",
         "Counter": "0,1,2,3",
         "EventCode": "0x14",
         "EventName": "UNC_Q_CLOCKTICKS",
@@ -10,7 +10,7 @@
     {
         "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
         "Counter": "0,1,2,3",
-        "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
+        "EventName": "QPI_DATA_BANDWIDTH_TX",
         "PerPkg": "1",
         "ScaleUnit": "8Bytes",
         "UMask": "0x2",
@@ -19,7 +19,7 @@
     {
         "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
         "Counter": "0,1,2,3",
-        "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
+        "EventName": "QPI_CTL_BANDWIDTH_TX",
         "PerPkg": "1",
         "ScaleUnit": "8Bytes",
         "UMask": "0x4",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json
index d17dc235f734..66eed399724c 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json
@@ -3,7 +3,7 @@
         "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.RD",
+        "EventName": "LLC_MISSES.MEM_READ",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0x3",
@@ -13,48 +13,51 @@
         "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.WR",
+        "EventName": "LLC_MISSES.MEM_WRITE",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0xC",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory controller clock ticks. Derived from unc_m_clockticks",
+        "BriefDescription": "Memory controller clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_M_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
+        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x85",
         "EventName": "UNC_M_POWER_CHANNEL_PPD",
         "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_channel_ppd %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
+        "BriefDescription": "Cycles all ranks are in critical thermal throttle",
         "Counter": "0,1,2,3",
         "EventCode": "0x86",
         "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
         "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_critical_throttle_cycles %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
+        "BriefDescription": "Cycles Memory is in self refresh power mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x43",
         "EventName": "UNC_M_POWER_SELF_REFRESH",
         "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_self_refresh %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
+        "BriefDescription": "Pre-charges due to page misses",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
@@ -63,7 +66,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
+        "BriefDescription": "Pre-charge for reads",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.RD",
@@ -72,7 +75,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
+        "BriefDescription": "Pre-charge for writes",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.WR",
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json
index b44d43088bbb..dd1b95655d1d 100644
--- a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json
@@ -1,83 +1,91 @@
 [
     {
-        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
+        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_P_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C0 and C1. Derived from unc_p_power_state_occupancy.cores_c0",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
         "Filter": "occ_sel=1",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c0 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
         "Filter": "occ_sel=2",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c3 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events ",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
         "Filter": "occ_sel=3",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c6 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
+        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip",
         "Counter": "0,1,2,3",
         "EventCode": "0xA",
         "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
         "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "prochot_external_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
+        "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
         "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_limit_thermal_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
+        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x6",
         "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_os_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
+        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x5",
         "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_power_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
+        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x74",
         "EventName": "UNC_P_FREQ_TRANS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_trans_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     }
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
index 076459c51d4e..58ed6d33d1f4 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
@@ -1,13 +1,13 @@
 [
     {
-        "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
+        "BriefDescription": "Uncore cache clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_C_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
+        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch)",
         "Counter": "0,1,2,3",
         "EventCode": "0x34",
         "EventName": "UNC_C_LLC_LOOKUP.ANY",
@@ -18,7 +18,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
+        "BriefDescription": "M line evictions from LLC (writebacks to memory)",
         "Counter": "0,1,2,3",
         "EventCode": "0x37",
         "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
@@ -212,7 +212,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
+        "BriefDescription": "read requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS",
@@ -221,7 +221,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
+        "BriefDescription": "read requests to local home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS_LOCAL",
@@ -230,7 +230,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
+        "BriefDescription": "read requests to remote home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS_REMOTE",
@@ -239,7 +239,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
+        "BriefDescription": "write requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES",
@@ -248,7 +248,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
+        "BriefDescription": "write requests to local home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
@@ -257,7 +257,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
+        "BriefDescription": "write requests to remote home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
@@ -266,7 +266,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
+        "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously)",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
@@ -275,7 +275,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
+        "BriefDescription": "M line forwarded from remote cache along with writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
@@ -285,7 +285,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
+        "BriefDescription": "M line forwarded from remote cache with no writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
@@ -295,7 +295,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
+        "BriefDescription": "Shared line response from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPS",
@@ -305,7 +305,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
+        "BriefDescription": "Shared line forwarded from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
index 39387f7909b2..824961318c1e 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
@@ -1,6 +1,6 @@
 [
     {
-        "BriefDescription": "QPI clock ticks. Derived from unc_q_clockticks",
+        "BriefDescription": "QPI clock ticks",
         "Counter": "0,1,2,3",
         "EventCode": "0x14",
         "EventName": "UNC_Q_CLOCKTICKS",
@@ -10,7 +10,7 @@
     {
         "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
         "Counter": "0,1,2,3",
-        "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
+        "EventName": "QPI_DATA_BANDWIDTH_TX",
         "PerPkg": "1",
         "ScaleUnit": "8Bytes",
         "UMask": "0x2",
@@ -19,7 +19,7 @@
     {
         "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
         "Counter": "0,1,2,3",
-        "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
+        "EventName": "QPI_CTL_BANDWIDTH_TX",
         "PerPkg": "1",
         "ScaleUnit": "8Bytes",
         "UMask": "0x4",
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
index d17dc235f734..66eed399724c 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
@@ -3,7 +3,7 @@
         "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.RD",
+        "EventName": "LLC_MISSES.MEM_READ",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0x3",
@@ -13,48 +13,51 @@
         "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.WR",
+        "EventName": "LLC_MISSES.MEM_WRITE",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0xC",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory controller clock ticks. Derived from unc_m_clockticks",
+        "BriefDescription": "Memory controller clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_M_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
+        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x85",
         "EventName": "UNC_M_POWER_CHANNEL_PPD",
         "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_channel_ppd %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
+        "BriefDescription": "Cycles all ranks are in critical thermal throttle",
         "Counter": "0,1,2,3",
         "EventCode": "0x86",
         "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
         "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_critical_throttle_cycles %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
+        "BriefDescription": "Cycles Memory is in self refresh power mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x43",
         "EventName": "UNC_M_POWER_SELF_REFRESH",
         "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_self_refresh %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
+        "BriefDescription": "Pre-charges due to page misses",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
@@ -63,7 +66,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
+        "BriefDescription": "Pre-charge for reads",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.RD",
@@ -72,7 +75,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
+        "BriefDescription": "Pre-charge for writes",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.WR",
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
index b44d43088bbb..dd1b95655d1d 100644
--- a/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
@@ -1,83 +1,91 @@
 [
     {
-        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
+        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_P_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C0 and C1. Derived from unc_p_power_state_occupancy.cores_c0",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
         "Filter": "occ_sel=1",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c0 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
         "Filter": "occ_sel=2",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c3 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events ",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
         "Filter": "occ_sel=3",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c6 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
+        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip",
         "Counter": "0,1,2,3",
         "EventCode": "0xA",
         "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
         "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "prochot_external_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
+        "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
         "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_limit_thermal_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
+        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x6",
         "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_os_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
+        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x5",
         "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_power_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
+        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x74",
         "EventName": "UNC_P_FREQ_TRANS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_trans_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     }
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json
index 2efdc6772e0b..267410594833 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json
@@ -1,13 +1,13 @@
 [
     {
-        "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
+        "BriefDescription": "Uncore cache clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_C_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
+        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch)",
         "Counter": "0,1",
         "EventCode": "0x34",
         "EventName": "UNC_C_LLC_LOOKUP.ANY",
@@ -18,7 +18,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
+        "BriefDescription": "M line evictions from LLC (writebacks to memory)",
         "Counter": "0,1",
         "EventCode": "0x37",
         "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
@@ -237,7 +237,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "Occupancy for all LLC misses that are addressed to local memory. Derived from unc_c_tor_occupancy.miss_local",
+        "BriefDescription": "Occupancy for all LLC misses that are addressed to local memory",
         "EventCode": "0x36",
         "EventName": "UNC_C_TOR_OCCUPANCY.MISS_LOCAL",
         "PerPkg": "1",
@@ -254,7 +254,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "Occupancy for all LLC misses that are addressed to remote memory. Derived from unc_c_tor_occupancy.miss_remote",
+        "BriefDescription": "Occupancy for all LLC misses that are addressed to remote memory",
         "EventCode": "0x36",
         "EventName": "UNC_C_TOR_OCCUPANCY.MISS_REMOTE",
         "PerPkg": "1",
@@ -262,7 +262,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "Read requests to home agent. Derived from unc_h_requests.reads",
+        "BriefDescription": "Read requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS",
@@ -271,7 +271,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Write requests to home agent. Derived from unc_h_requests.writes",
+        "BriefDescription": "Write requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES",
@@ -280,7 +280,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
+        "BriefDescription": "M line forwarded from remote cache along with writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
@@ -290,7 +290,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
+        "BriefDescription": "M line forwarded from remote cache with no writeback to memory",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
@@ -300,7 +300,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
+        "BriefDescription": "Shared line response from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPS",
@@ -310,7 +310,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
+        "BriefDescription": "Shared line forwarded from remote cache",
         "Counter": "0,1,2,3",
         "EventCode": "0x21",
         "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json
index d7e2fda1d695..b798a860bc81 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json
@@ -1,6 +1,6 @@
 [
     {
-        "BriefDescription": "QPI clock ticks. Use to get percentages for QPI cycles events. Derived from unc_q_clockticks",
+        "BriefDescription": "QPI clock ticks. Use to get percentages for QPI cycles events",
         "Counter": "0,1,2,3",
         "EventCode": "0x14",
         "EventName": "UNC_Q_CLOCKTICKS",
@@ -8,25 +8,27 @@
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Cycles where receiving QPI link is in half-width mode. Derived from unc_q_rxl0p_power_cycles",
+        "BriefDescription": "Cycles where receiving QPI link is in half-width mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x10",
         "EventName": "UNC_Q_RxL0P_POWER_CYCLES",
         "MetricExpr": "(UNC_Q_RxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
+        "MetricName": "rxl0p_power_cycles %",
         "PerPkg": "1",
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Cycles where transmitting QPI link is in half-width mode. Derived from unc_q_txl0p_power_cycles",
+        "BriefDescription": "Cycles where transmitting QPI link is in half-width mode",
         "Counter": "0,1,2,3",
         "EventCode": "0xd",
         "EventName": "UNC_Q_TxL0P_POWER_CYCLES",
         "MetricExpr": "(UNC_Q_TxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
+        "MetricName": "txl0p_power_cycles %",
         "PerPkg": "1",
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
+        "BriefDescription": "Number of data flits transmitted ",
         "Counter": "0,1,2,3",
         "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
         "PerPkg": "1",
@@ -35,7 +37,7 @@
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
+        "BriefDescription": "Number of non data (control) flits transmitted ",
         "Counter": "0,1,2,3",
         "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
         "PerPkg": "1",
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json
index ac4ad4d6357b..df4b43294fa0 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json
@@ -1,6 +1,6 @@
 [
     {
-        "BriefDescription": "Memory page activates for reads and writes. Derived from unc_m_act_count.rd",
+        "BriefDescription": "Memory page activates for reads and writes",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_M_ACT_COUNT.RD",
@@ -13,7 +13,7 @@
         "BriefDescription": "Read requests to memory controller. Derived from unc_m_cas_count.rd",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.RD",
+        "EventName": "LLC_MISSES.MEM_READ",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0x3",
@@ -23,48 +23,51 @@
         "BriefDescription": "Write requests to memory controller. Derived from unc_m_cas_count.wr",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.WR",
+        "EventName": "LLC_MISSES.MEM_WRITE",
         "PerPkg": "1",
         "ScaleUnit": "64Bytes",
         "UMask": "0xC",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory controller clock ticks. Use to generate percentages for memory controller CYCLES events. Derived from unc_m_clockticks",
+        "BriefDescription": "Memory controller clock ticks. Use to generate percentages for memory controller CYCLES events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_M_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
+        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x85",
         "EventName": "UNC_M_POWER_CHANNEL_PPD",
         "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_channel_ppd %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
+        "BriefDescription": "Cycles all ranks are in critical thermal throttle",
         "Counter": "0,1,2,3",
         "EventCode": "0x86",
         "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
         "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_critical_throttle_cycles %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
+        "BriefDescription": "Cycles Memory is in self refresh power mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x43",
         "EventName": "UNC_M_POWER_SELF_REFRESH",
         "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_self_refresh %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory page conflicts. Derived from unc_m_pre_count.page_miss",
+        "BriefDescription": "Memory page conflicts",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json
index dc2586db0dfc..d40498f2cb1e 100644
--- a/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json
@@ -1,44 +1,48 @@
 [
     {
-        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
+        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_P_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band0=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band0_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band0=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xb",
         "EventName": "UNC_P_FREQ_BAND0_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band0_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band1=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band1_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band1=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xc",
         "EventName": "UNC_P_FREQ_BAND1_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band1_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band2=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band2_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band2=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xd",
         "EventName": "UNC_P_FREQ_BAND2_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band2_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band3_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xe",
         "EventName": "UNC_P_FREQ_BAND3_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band3_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -49,6 +53,7 @@
         "EventName": "UNC_P_FREQ_BAND0_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band0_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -59,6 +64,7 @@
         "EventName": "UNC_P_FREQ_BAND1_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band1_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -69,6 +75,7 @@
         "EventName": "UNC_P_FREQ_BAND2_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band2_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -79,90 +86,100 @@
         "EventName": "UNC_P_FREQ_BAND3_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band3_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in the chosen C-State.  It can be used by itself to get the average number of cores in that C-state with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c0",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
         "Filter": "occ_sel=1",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c0 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in the chosen C-State.  It can be used by itself to get the average number of cores in that C-state with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c3",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
         "Filter": "occ_sel=2",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c3 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in the chosen C-State.  It can be used by itself to get the average number of cores in that C-state with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c6",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events ",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
         "Filter": "occ_sel=3",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c6 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip. Derived from unc_p_prochot_external_cycles",
+        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip",
         "Counter": "0,1,2,3",
         "EventCode": "0xa",
         "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
         "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "prochot_external_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when thermal conditions are the upper limit on frequency.  This is related to the THERMAL_THROTTLE CYCLES_ABOVE_TEMP event, which always counts cycles when we are above the thermal temperature.  This event (STRONGEST_UPPER_LIMIT) is sampled at the output of the algorithm that determines the actual frequency, while THERMAL_THROTTLE looks at the input. Derived from unc_p_freq_max_limit_thermal_cycles",
+        "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
         "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_limit_thermal_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency. Derived from unc_p_freq_max_os_cycles",
+        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x6",
         "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_os_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency. Derived from unc_p_freq_max_power_cycles",
+        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x5",
         "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_power_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency. Derived from unc_p_freq_max_current_cycles",
+        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x7",
         "EventName": "UNC_P_FREQ_MAX_CURRENT_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_CURRENT_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_current_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when the system is changing frequency.  This can not be filtered by thread ID.  One can also use it with the occupancy counter that monitors number of threads in C0 to estimate the performance impact that frequency transitions had on the system. Derived from unc_p_freq_trans_cycles",
+        "BriefDescription": "Cycles spent changing Frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x60",
         "EventName": "UNC_P_FREQ_TRANS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_trans_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -173,6 +190,7 @@
         "EventName": "UNC_P_FREQ_GE_1200MHZ_CYCLES",
         "Filter": "filter_band0=1200",
         "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_1200mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -183,6 +201,7 @@
         "EventName": "UNC_P_FREQ_GE_2000MHZ_CYCLES",
         "Filter": "filter_band1=2000",
         "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_2000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -193,6 +212,7 @@
         "EventName": "UNC_P_FREQ_GE_3000MHZ_CYCLES",
         "Filter": "filter_band2=3000",
         "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_3000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -203,6 +223,7 @@
         "EventName": "UNC_P_FREQ_GE_4000MHZ_CYCLES",
         "Filter": "filter_band3=4000",
         "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_4000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -213,6 +234,7 @@
         "EventName": "UNC_P_FREQ_GE_1200MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band0=1200",
         "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_1200mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -223,6 +245,7 @@
         "EventName": "UNC_P_FREQ_GE_2000MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band1=2000",
         "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_2000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -233,6 +256,7 @@
         "EventName": "UNC_P_FREQ_GE_3000MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band2=4000",
         "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_3000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -243,6 +267,7 @@
         "EventName": "UNC_P_FREQ_GE_4000MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band3=4000",
         "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_4000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     }
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json
index 2f23cf0129e7..3fa61d962607 100644
--- a/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json
@@ -1,13 +1,13 @@
 [
     {
-        "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
+        "BriefDescription": "Uncore cache clock ticks",
         "Counter": "0,1,2,3",
         "EventName": "UNC_C_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
+        "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch)",
         "Counter": "0,1",
         "EventCode": "0x34",
         "EventName": "UNC_C_LLC_LOOKUP.ANY",
@@ -18,7 +18,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
+        "BriefDescription": "M line evictions from LLC (writebacks to memory)",
         "Counter": "0,1",
         "EventCode": "0x37",
         "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
@@ -171,11 +171,12 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "Occupancy counter for all LLC misses; we divide this by UNC_C_CLOCKTICKS to get average Q depth. Derived from unc_c_tor_occupancy.miss_all",
+        "BriefDescription": "Occupancy counter for all LLC misses; we divide this by UNC_C_CLOCKTICKS to get average Q depth",
         "EventCode": "0x36",
         "EventName": "UNC_C_TOR_OCCUPANCY.MISS_ALL",
         "Filter": "filter_opc=0x182",
         "MetricExpr": "(UNC_C_TOR_OCCUPANCY.MISS_ALL / UNC_C_CLOCKTICKS) * 100.",
+        "MetricName": "tor_occupancy.miss_all %",
         "PerPkg": "1",
         "UMask": "0xa",
         "Unit": "CBO"
@@ -189,7 +190,7 @@
         "Unit": "CBO"
     },
     {
-        "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
+        "BriefDescription": "read requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.READS",
@@ -198,7 +199,7 @@
         "Unit": "HA"
     },
     {
-        "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
+        "BriefDescription": "write requests to home agent",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_H_REQUESTS.WRITES",
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json
index 63351876eb57..1b53c0e609e3 100644
--- a/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json
@@ -1,6 +1,6 @@
 [
     {
-        "BriefDescription": "QPI clock ticks. Used to get percentages of QPI cycles events. Derived from unc_q_clockticks",
+        "BriefDescription": "QPI clock ticks. Used to get percentages of QPI cycles events",
         "Counter": "0,1,2,3",
         "EventCode": "0x14",
         "EventName": "UNC_Q_CLOCKTICKS",
@@ -8,25 +8,27 @@
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Cycles where receiving QPI link is in half-width mode. Derived from unc_q_rxl0p_power_cycles",
+        "BriefDescription": "Cycles where receiving QPI link is in half-width mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x10",
         "EventName": "UNC_Q_RxL0P_POWER_CYCLES",
         "MetricExpr": "(UNC_Q_RxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
+        "MetricName": "rxl0p_power_cycles %",
         "PerPkg": "1",
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Cycles where transmitting QPI link is in half-width mode. Derived from unc_q_txl0p_power_cycles",
+        "BriefDescription": "Cycles where transmitting QPI link is in half-width mode",
         "Counter": "0,1,2,3",
         "EventCode": "0xd",
         "EventName": "UNC_Q_TxL0P_POWER_CYCLES",
         "MetricExpr": "(UNC_Q_TxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
+        "MetricName": "txl0p_power_cycles %",
         "PerPkg": "1",
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
+        "BriefDescription": "Number of data flits transmitted ",
         "Counter": "0,1,2,3",
         "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
         "PerPkg": "1",
@@ -35,7 +37,7 @@
         "Unit": "QPI LL"
     },
     {
-        "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
+        "BriefDescription": "Number of non data (control) flits transmitted ",
         "Counter": "0,1,2,3",
         "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
         "PerPkg": "1",
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json
index e2cf6daa7b37..8551cebeba23 100644
--- a/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json
@@ -1,6 +1,6 @@
 [
     {
-        "BriefDescription": "Memory page activates. Derived from unc_m_act_count",
+        "BriefDescription": "Memory page activates",
         "Counter": "0,1,2,3",
         "EventCode": "0x1",
         "EventName": "UNC_M_ACT_COUNT",
@@ -11,7 +11,7 @@
         "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.RD",
+        "EventName": "LLC_MISSES.MEM_READ",
         "PerPkg": "1",
         "UMask": "0x3",
         "Unit": "iMC"
@@ -20,47 +20,50 @@
         "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
-        "EventName": "UNC_M_CAS_COUNT.WR",
+        "EventName": "LLC_MISSES.MEM_WRITE",
         "PerPkg": "1",
         "UMask": "0xc",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory controller clock ticks. Used to get percentages of memory controller cycles events. Derived from unc_m_clockticks",
+        "BriefDescription": "Memory controller clock ticks. Used to get percentages of memory controller cycles events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_M_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
+        "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x85",
         "EventName": "UNC_M_POWER_CHANNEL_PPD",
         "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_channel_ppd %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
+        "BriefDescription": "Cycles all ranks are in critical thermal throttle",
         "Counter": "0,1,2,3",
         "EventCode": "0x86",
         "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
         "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_critical_throttle_cycles %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
+        "BriefDescription": "Cycles Memory is in self refresh power mode",
         "Counter": "0,1,2,3",
         "EventCode": "0x43",
         "EventName": "UNC_M_POWER_SELF_REFRESH",
         "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
+        "MetricName": "power_self_refresh %",
         "PerPkg": "1",
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Memory page conflicts. Derived from unc_m_pre_count.page_miss",
+        "BriefDescription": "Memory page conflicts",
         "Counter": "0,1,2,3",
         "EventCode": "0x2",
         "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
@@ -69,7 +72,7 @@
         "Unit": "iMC"
     },
     {
-        "BriefDescription": "Occupancy counter for memory read queue. Derived from unc_m_rpq_occupancy",
+        "BriefDescription": "Occupancy counter for memory read queue",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_M_RPQ_OCCUPANCY",
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json
index bbe36d547386..16034bfd06dd 100644
--- a/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json
@@ -1,44 +1,48 @@
 [
     {
-        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
+        "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events",
         "Counter": "0,1,2,3",
         "EventName": "UNC_P_CLOCKTICKS",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band0=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band0_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band0=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xb",
         "EventName": "UNC_P_FREQ_BAND0_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band0_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band1=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band1_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band1=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xc",
         "EventName": "UNC_P_FREQ_BAND1_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band1_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band2=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band2_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band2=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xd",
         "EventName": "UNC_P_FREQ_BAND2_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band2_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band3_cycles",
+        "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter.  (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0xe",
         "EventName": "UNC_P_FREQ_BAND3_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band3_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -49,6 +53,7 @@
         "EventName": "UNC_P_FREQ_BAND0_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band0_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -59,6 +64,7 @@
         "EventName": "UNC_P_FREQ_BAND1_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band1_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -69,6 +75,7 @@
         "EventName": "UNC_P_FREQ_BAND2_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band2_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -79,89 +86,99 @@
         "EventName": "UNC_P_FREQ_BAND3_TRANSITIONS",
         "Filter": "edge=1",
         "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_band3_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c0",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
         "Filter": "occ_sel=1",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c0 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c3",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
         "Filter": "occ_sel=2",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c3 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events . Derived from unc_p_power_state_occupancy.cores_c6",
+        "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6.  It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events ",
         "Counter": "0,1,2,3",
         "EventCode": "0x80",
         "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
         "Filter": "occ_sel=3",
         "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "power_state_occupancy.cores_c6 %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip. Derived from unc_p_prochot_external_cycles",
+        "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode.  This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip",
         "Counter": "0,1,2,3",
         "EventCode": "0xa",
         "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
         "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "prochot_external_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency. Derived from unc_p_freq_max_limit_thermal_cycles",
+        "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x4",
         "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_limit_thermal_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency. Derived from unc_p_freq_max_os_cycles",
+        "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x6",
         "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_os_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency. Derived from unc_p_freq_max_power_cycles",
+        "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x5",
         "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_power_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency. Derived from unc_p_freq_max_current_cycles",
+        "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency",
         "Counter": "0,1,2,3",
         "EventCode": "0x7",
         "EventName": "UNC_P_FREQ_MAX_CURRENT_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_MAX_CURRENT_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_max_current_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
     {
-        "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
+        "BriefDescription": "Cycles spent changing Frequency",
         "Counter": "0,1,2,3",
         "EventName": "UNC_P_FREQ_TRANS_CYCLES",
         "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_trans_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -172,6 +189,7 @@
         "EventName": "UNC_P_FREQ_GE_1200MHZ_CYCLES",
         "Filter": "filter_band0=1200",
         "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_1200mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -182,6 +200,7 @@
         "EventName": "UNC_P_FREQ_GE_2000MHZ_CYCLES",
         "Filter": "filter_band1=2000",
         "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_2000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -192,6 +211,7 @@
         "EventName": "UNC_P_FREQ_GE_3000MHZ_CYCLES",
         "Filter": "filter_band2=3000",
         "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_3000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -202,6 +222,7 @@
         "EventName": "UNC_P_FREQ_GE_4000MHZ_CYCLES",
         "Filter": "filter_band3=4000",
         "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_4000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -212,6 +233,7 @@
         "EventName": "UNC_P_FREQ_GE_1200MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band0=1200",
         "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_1200mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -222,6 +244,7 @@
         "EventName": "UNC_P_FREQ_GE_2000MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band1=2000",
         "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_2000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -232,6 +255,7 @@
         "EventName": "UNC_P_FREQ_GE_3000MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band2=4000",
         "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_3000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     },
@@ -242,6 +266,7 @@
         "EventName": "UNC_P_FREQ_GE_4000MHZ_TRANSITIONS",
         "Filter": "edge=1,filter_band3=4000",
         "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+        "MetricName": "freq_ge_4000mhz_cycles %",
         "PerPkg": "1",
         "Unit": "PCU"
     }
-- 
2.9.3

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

* [PATCH 16/20] perf pmu: Support MetricExpr header in JSON event list
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Add support for parsing the MetricExpr header in the JSON event lists
and storing them in the alias structure.

Used in the next patch.

v2: Change DividedBy to MetricExpr
v3: Really catch all uses of DividedBy

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-10-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/pmu-events/jevents.c    | 18 ++++++++++++++----
 tools/perf/pmu-events/jevents.h    |  2 +-
 tools/perf/pmu-events/pmu-events.h |  1 +
 tools/perf/util/pmu.c              |  9 ++++++---
 tools/perf/util/pmu.h              |  1 +
 5 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index eed09346a72a..0735dc2a167a 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -291,7 +291,8 @@ static void print_events_table_prefix(FILE *fp, const char *tblname)
 
 static int print_events_table_entry(void *data, char *name, char *event,
 				    char *desc, char *long_desc,
-				    char *pmu, char *unit, char *perpkg)
+				    char *pmu, char *unit, char *perpkg,
+				    char *metric_expr)
 {
 	struct perf_entry_data *pd = data;
 	FILE *outfp = pd->outfp;
@@ -315,6 +316,8 @@ static int print_events_table_entry(void *data, char *name, char *event,
 		fprintf(outfp, "\t.unit = \"%s\",\n", unit);
 	if (perpkg)
 		fprintf(outfp, "\t.perpkg = \"%s\",\n", perpkg);
+	if (metric_expr)
+		fprintf(outfp, "\t.metric_expr = \"%s\",\n", metric_expr);
 	fprintf(outfp, "},\n");
 
 	return 0;
@@ -362,7 +365,8 @@ static char *real_event(const char *name, char *event)
 int json_events(const char *fn,
 	  int (*func)(void *data, char *name, char *event, char *desc,
 		      char *long_desc,
-		      char *pmu, char *unit, char *perpkg),
+		      char *pmu, char *unit, char *perpkg,
+		      char *metric_expr),
 	  void *data)
 {
 	int err = -EIO;
@@ -388,6 +392,7 @@ int json_events(const char *fn,
 		char *filter = NULL;
 		char *perpkg = NULL;
 		char *unit = NULL;
+		char *metric_expr = NULL;
 		unsigned long long eventcode = 0;
 		struct msrmap *msr = NULL;
 		jsmntok_t *msrval = NULL;
@@ -398,6 +403,7 @@ int json_events(const char *fn,
 		for (j = 0; j < obj->size; j += 2) {
 			jsmntok_t *field, *val;
 			int nz;
+			char *s;
 
 			field = tok + j;
 			EXPECT(field->type == JSMN_STRING, tok + j,
@@ -444,7 +450,6 @@ int json_events(const char *fn,
 					NULL);
 			} else if (json_streq(map, field, "Unit")) {
 				const char *ppmu;
-				char *s;
 
 				ppmu = field_to_perf(unit_to_pmu, map, val);
 				if (ppmu) {
@@ -464,6 +469,10 @@ int json_events(const char *fn,
 				addfield(map, &unit, "", "", val);
 			} else if (json_streq(map, field, "PerPkg")) {
 				addfield(map, &perpkg, "", "", val);
+			} else if (json_streq(map, field, "MetricExpr")) {
+				addfield(map, &metric_expr, "", "", val);
+				for (s = metric_expr; *s; s++)
+					*s = tolower(*s);
 			}
 			/* ignore unknown fields */
 		}
@@ -488,7 +497,7 @@ int json_events(const char *fn,
 		fixname(name);
 
 		err = func(data, name, real_event(name, event), desc, long_desc,
-				pmu, unit, perpkg);
+				pmu, unit, perpkg, metric_expr);
 		free(event);
 		free(desc);
 		free(name);
@@ -498,6 +507,7 @@ int json_events(const char *fn,
 		free(filter);
 		free(perpkg);
 		free(unit);
+		free(metric_expr);
 		if (err)
 			break;
 		tok += j;
diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h
index 71e13de31092..57e111bf2168 100644
--- a/tools/perf/pmu-events/jevents.h
+++ b/tools/perf/pmu-events/jevents.h
@@ -5,7 +5,7 @@ int json_events(const char *fn,
 		int (*func)(void *data, char *name, char *event, char *desc,
 				char *long_desc,
 				char *pmu,
-				char *unit, char *perpkg),
+				char *unit, char *perpkg, char *metric_expr),
 		void *data);
 char *get_cpu_str(void);
 
diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
index c669a3cdb9f0..d046e3a4ce46 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -13,6 +13,7 @@ struct pmu_event {
 	const char *pmu;
 	const char *unit;
 	const char *perpkg;
+	const char *metric_expr;
 };
 
 /*
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 12f84dd2ac5d..c0d487b3b925 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -231,7 +231,8 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias,
 static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
 				 char *desc, char *val,
 				 char *long_desc, char *topic,
-				 char *unit, char *perpkg)
+				 char *unit, char *perpkg,
+				 char *metric_expr)
 {
 	struct perf_pmu_alias *alias;
 	int ret;
@@ -265,6 +266,7 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
 		perf_pmu__parse_snapshot(alias, dir, name);
 	}
 
+	alias->metric_expr = metric_expr ? strdup(metric_expr) : NULL;
 	alias->desc = desc ? strdup(desc) : NULL;
 	alias->long_desc = long_desc ? strdup(long_desc) :
 				desc ? strdup(desc) : NULL;
@@ -294,7 +296,7 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI
 	buf[ret] = 0;
 
 	return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL,
-				     NULL);
+				     NULL, NULL);
 }
 
 static inline bool pmu_alias_info_file(char *name)
@@ -564,7 +566,8 @@ static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
 		__perf_pmu__new_alias(head, NULL, (char *)pe->name,
 				(char *)pe->desc, (char *)pe->event,
 				(char *)pe->long_desc, (char *)pe->topic,
-				(char *)pe->unit, (char *)pe->perpkg);
+				(char *)pe->unit, (char *)pe->perpkg,
+				(char *)pe->metric_expr);
 	}
 
 out:
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 00852ddc7741..3dccb15f29e9 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -50,6 +50,7 @@ struct perf_pmu_alias {
 	double scale;
 	bool per_pkg;
 	bool snapshot;
+	char *metric_expr;
 };
 
 struct perf_pmu *perf_pmu__find(const char *name);
-- 
2.9.3

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

* [PATCH 17/20] perf stat: Output JSON MetricExpr metric
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Add generic infrastructure to perf stat to output ratios for
"MetricExpr" entries in the event lists. Many events are more useful as
ratios than in raw form, typically some count in relation to total
ticks.

Transfer the MetricExpr information from the alias to the evsel.

We mark the events that need to be collected for MetricExpr, and also
link the events using them with a pointer. The code is careful to always
prefer the right event in the same group to minimize multiplexing
errors. At the moment only a single relation is supported.

Then add a rblist to the stat shadow code that remembers stats based on
the cpu and context.

Then finally update and retrieve and print these values similarly to the
existing hardcoded perf metrics. We use the simple expression parser
added earlier to evaluate the expression.

Normally we just output the result without further commentary, but for
--metric-only this would lead to empty columns. So for this case use the
original event as description.

There is no attempt to automatically add the MetricExpr event, if it is
missing, however we suggest it to the user, because the user tool
doesn't have enough information to reliably construct a group that is
guaranteed to schedule. So we leave that to the user.

  % perf stat -a -I 1000 -e '{unc_p_clockticks,unc_p_freq_max_os_cycles}'
       1.000147889        800,085,181      unc_p_clockticks
       1.000147889         93,126,241      unc_p_freq_max_os_cycles  #     11.6
       2.000448381        800,218,217      unc_p_clockticks
       2.000448381        142,516,095      unc_p_freq_max_os_cycles  #     17.8
       3.000639852        800,243,057      unc_p_clockticks
       3.000639852        162,292,689      unc_p_freq_max_os_cycles  #     20.3

  % perf stat -a -I 1000 -e '{unc_p_clockticks,unc_p_freq_max_os_cycles}' --metric-only
  #    time         freq_max_os_cycles %
       1.000127077      0.9
       2.000301436      0.7
       3.000456379      0.0

v2: Change from DivideBy to MetricExpr
v3: Use expr__ prefix.  Support more than one other event.
v4: Update description
v5: Only print warning message once for multiple PMUs.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-11-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c      |   3 +
 tools/perf/util/evsel.c        |   3 +
 tools/perf/util/evsel.h        |   3 +
 tools/perf/util/parse-events.c |   1 +
 tools/perf/util/pmu.c          |   2 +
 tools/perf/util/pmu.h          |   1 +
 tools/perf/util/stat-shadow.c  | 195 +++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/stat.h         |   2 +
 8 files changed, 210 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index cd7dc3b648ca..01b589e3c3a6 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1145,6 +1145,7 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval,
 	out.print_metric = pm;
 	out.new_line = nl;
 	out.ctx = &os;
+	out.force_header = false;
 
 	if (csv_output && !metric_only) {
 		print_noise(counter, noise);
@@ -1480,6 +1481,7 @@ static void print_metric_headers(const char *prefix, bool no_indent)
 		out.ctx = &os;
 		out.print_metric = print_metric_header;
 		out.new_line = new_line_metric;
+		out.force_header = true;
 		os.evsel = counter;
 		perf_stat__print_shadow_stats(counter, 0,
 					      0,
@@ -2498,6 +2500,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
 	argc = parse_options_subcommand(argc, argv, stat_options, stat_subcommands,
 					(const char **) stat_usage,
 					PARSE_OPT_STOP_AT_NON_OPTION);
+	perf_stat__collect_metric_expr(evsel_list);
 	perf_stat__init_shadow_stats();
 
 	if (csv_sep) {
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 175dc2305aa8..ef2a31f6dd06 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -236,6 +236,9 @@ void perf_evsel__init(struct perf_evsel *evsel,
 	evsel->sample_size = __perf_evsel__sample_size(attr->sample_type);
 	perf_evsel__calc_id_pos(evsel);
 	evsel->cmdline_group_boundary = false;
+	evsel->metric_expr   = NULL;
+	evsel->metric_events = NULL;
+	evsel->collect_stat  = false;
 }
 
 struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index bd2e9b112d49..8f1f61826fdf 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -132,6 +132,9 @@ struct perf_evsel {
 	struct list_head	config_terms;
 	int			bpf_fd;
 	bool			merged_stat;
+	const char *		metric_expr;
+	struct perf_evsel	**metric_events;
+	bool			collect_stat;
 };
 
 union u64_swap {
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e594c974c93e..91b8e83e307d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1255,6 +1255,7 @@ int parse_events_add_pmu(struct parse_events_evlist *data,
 		evsel->scale = info.scale;
 		evsel->per_pkg = info.per_pkg;
 		evsel->snapshot = info.snapshot;
+		evsel->metric_expr = info.metric_expr;
 	}
 
 	return evsel ? 0 : -ENOMEM;
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index c0d487b3b925..0f1133aa3253 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -994,6 +994,7 @@ int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms,
 	info->unit     = NULL;
 	info->scale    = 0.0;
 	info->snapshot = false;
+	info->metric_expr = NULL;
 
 	list_for_each_entry_safe(term, h, head_terms, list) {
 		alias = pmu_find_alias(pmu, term);
@@ -1009,6 +1010,7 @@ int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms,
 
 		if (alias->per_pkg)
 			info->per_pkg = true;
+		info->metric_expr = alias->metric_expr;
 
 		list_del(&term->list);
 		free(term);
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 3dccb15f29e9..27f078ccc594 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -31,6 +31,7 @@ struct perf_pmu {
 
 struct perf_pmu_info {
 	const char *unit;
+	const char *metric_expr;
 	double scale;
 	bool per_pkg;
 	bool snapshot;
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 8a2bbd2a4d82..c323cce97d98 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -3,6 +3,9 @@
 #include "stat.h"
 #include "color.h"
 #include "pmu.h"
+#include "rblist.h"
+#include "evlist.h"
+#include "expr.h"
 
 enum {
 	CTX_BIT_USER	= 1 << 0,
@@ -41,13 +44,73 @@ static struct stats runtime_topdown_slots_issued[NUM_CTX][MAX_NR_CPUS];
 static struct stats runtime_topdown_slots_retired[NUM_CTX][MAX_NR_CPUS];
 static struct stats runtime_topdown_fetch_bubbles[NUM_CTX][MAX_NR_CPUS];
 static struct stats runtime_topdown_recovery_bubbles[NUM_CTX][MAX_NR_CPUS];
+static struct rblist runtime_saved_values;
 static bool have_frontend_stalled;
 
 struct stats walltime_nsecs_stats;
 
+struct saved_value {
+	struct rb_node rb_node;
+	struct perf_evsel *evsel;
+	int cpu;
+	int ctx;
+	struct stats stats;
+};
+
+static int saved_value_cmp(struct rb_node *rb_node, const void *entry)
+{
+	struct saved_value *a = container_of(rb_node,
+					     struct saved_value,
+					     rb_node);
+	const struct saved_value *b = entry;
+
+	if (a->ctx != b->ctx)
+		return a->ctx - b->ctx;
+	if (a->cpu != b->cpu)
+		return a->cpu - b->cpu;
+	return a->evsel - b->evsel;
+}
+
+static struct rb_node *saved_value_new(struct rblist *rblist __maybe_unused,
+				     const void *entry)
+{
+	struct saved_value *nd = malloc(sizeof(struct saved_value));
+
+	if (!nd)
+		return NULL;
+	memcpy(nd, entry, sizeof(struct saved_value));
+	return &nd->rb_node;
+}
+
+static struct saved_value *saved_value_lookup(struct perf_evsel *evsel,
+					      int cpu, int ctx,
+					      bool create)
+{
+	struct rb_node *nd;
+	struct saved_value dm = {
+		.cpu = cpu,
+		.ctx = ctx,
+		.evsel = evsel,
+	};
+	nd = rblist__find(&runtime_saved_values, &dm);
+	if (nd)
+		return container_of(nd, struct saved_value, rb_node);
+	if (create) {
+		rblist__add_node(&runtime_saved_values, &dm);
+		nd = rblist__find(&runtime_saved_values, &dm);
+		if (nd)
+			return container_of(nd, struct saved_value, rb_node);
+	}
+	return NULL;
+}
+
 void perf_stat__init_shadow_stats(void)
 {
 	have_frontend_stalled = pmu_have_event("cpu", "stalled-cycles-frontend");
+	rblist__init(&runtime_saved_values);
+	runtime_saved_values.node_cmp = saved_value_cmp;
+	runtime_saved_values.node_new = saved_value_new;
+	/* No delete for now */
 }
 
 static int evsel_context(struct perf_evsel *evsel)
@@ -70,6 +133,8 @@ static int evsel_context(struct perf_evsel *evsel)
 
 void perf_stat__reset_shadow_stats(void)
 {
+	struct rb_node *pos, *next;
+
 	memset(runtime_nsecs_stats, 0, sizeof(runtime_nsecs_stats));
 	memset(runtime_cycles_stats, 0, sizeof(runtime_cycles_stats));
 	memset(runtime_stalled_cycles_front_stats, 0, sizeof(runtime_stalled_cycles_front_stats));
@@ -92,6 +157,15 @@ void perf_stat__reset_shadow_stats(void)
 	memset(runtime_topdown_slots_issued, 0, sizeof(runtime_topdown_slots_issued));
 	memset(runtime_topdown_fetch_bubbles, 0, sizeof(runtime_topdown_fetch_bubbles));
 	memset(runtime_topdown_recovery_bubbles, 0, sizeof(runtime_topdown_recovery_bubbles));
+
+	next = rb_first(&runtime_saved_values.entries);
+	while (next) {
+		pos = next;
+		next = rb_next(pos);
+		memset(&container_of(pos, struct saved_value, rb_node)->stats,
+		       0,
+		       sizeof(struct stats));
+	}
 }
 
 /*
@@ -143,6 +217,12 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count,
 		update_stats(&runtime_dtlb_cache_stats[ctx][cpu], count[0]);
 	else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB))
 		update_stats(&runtime_itlb_cache_stats[ctx][cpu], count[0]);
+
+	if (counter->collect_stat) {
+		struct saved_value *v = saved_value_lookup(counter, cpu, ctx,
+							   true);
+		update_stats(&v->stats, count[0]);
+	}
 }
 
 /* used for get_ratio_color() */
@@ -172,6 +252,95 @@ static const char *get_ratio_color(enum grc_type type, double ratio)
 	return color;
 }
 
+static struct perf_evsel *perf_stat__find_event(struct perf_evlist *evsel_list,
+						const char *name)
+{
+	struct perf_evsel *c2;
+
+	evlist__for_each_entry (evsel_list, c2) {
+		if (!strcasecmp(c2->name, name))
+			return c2;
+	}
+	return NULL;
+}
+
+/* Mark MetricExpr target events and link events using them to them. */
+void perf_stat__collect_metric_expr(struct perf_evlist *evsel_list)
+{
+	struct perf_evsel *counter, *leader, **metric_events, *oc;
+	bool found;
+	const char **metric_names;
+	int i;
+	int num_metric_names;
+
+	evlist__for_each_entry(evsel_list, counter) {
+		bool invalid = false;
+
+		leader = counter->leader;
+		if (!counter->metric_expr)
+			continue;
+		metric_events = counter->metric_events;
+		if (!metric_events) {
+			if (expr__find_other(counter->metric_expr, counter->name,
+						&metric_names, &num_metric_names) < 0)
+				continue;
+
+			metric_events = calloc(sizeof(struct perf_evsel *),
+					       num_metric_names + 1);
+			if (!metric_events)
+				return;
+			counter->metric_events = metric_events;
+		}
+
+		for (i = 0; i < num_metric_names; i++) {
+			found = false;
+			if (leader) {
+				/* Search in group */
+				for_each_group_member (oc, leader) {
+					if (!strcasecmp(oc->name, metric_names[i])) {
+						found = true;
+						break;
+					}
+				}
+			}
+			if (!found) {
+				/* Search ignoring groups */
+				oc = perf_stat__find_event(evsel_list, metric_names[i]);
+			}
+			if (!oc) {
+				/* Deduping one is good enough to handle duplicated PMUs. */
+				static char *printed;
+
+				/*
+				 * Adding events automatically would be difficult, because
+				 * it would risk creating groups that are not schedulable.
+				 * perf stat doesn't understand all the scheduling constraints
+				 * of events. So we ask the user instead to add the missing
+				 * events.
+				 */
+				if (!printed || strcasecmp(printed, metric_names[i])) {
+					fprintf(stderr,
+						"Add %s event to groups to get metric expression for %s\n",
+						metric_names[i],
+						counter->name);
+					printed = strdup(metric_names[i]);
+				}
+				invalid = true;
+				continue;
+			}
+			metric_events[i] = oc;
+			oc->collect_stat = true;
+		}
+		metric_events[i] = NULL;
+		free(metric_names);
+		if (invalid) {
+			free(metric_events);
+			counter->metric_events = NULL;
+			counter->metric_expr = NULL;
+		}
+	}
+}
+
 static void print_stalled_cycles_frontend(int cpu,
 					  struct perf_evsel *evsel, double avg,
 					  struct perf_stat_output_ctx *out)
@@ -614,6 +783,32 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
 					be_bound * 100.);
 		else
 			print_metric(ctxp, NULL, NULL, name, 0);
+	} else if (evsel->metric_expr) {
+		struct parse_ctx pctx;
+		int i;
+
+		expr__ctx_init(&pctx);
+		expr__add_id(&pctx, evsel->name, avg);
+		for (i = 0; evsel->metric_events[i]; i++) {
+			struct saved_value *v;
+
+			v = saved_value_lookup(evsel->metric_events[i], cpu, ctx, false);
+			if (!v)
+				break;
+			expr__add_id(&pctx, evsel->metric_events[i]->name,
+					     avg_stats(&v->stats));
+		}
+		if (!evsel->metric_events[i]) {
+			const char *p = evsel->metric_expr;
+
+			if (expr__parse(&ratio, &pctx, &p) == 0)
+				print_metric(ctxp, NULL, "%8.1f",
+					out->force_header ? evsel->name : "",
+					ratio);
+			else
+				print_metric(ctxp, NULL, NULL, "", 0);
+		} else
+			print_metric(ctxp, NULL, NULL, "", 0);
 	} else if (runtime_nsecs_stats[cpu].n != 0) {
 		char unit = 'M';
 		char unit_buf[10];
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index c29bb94c48a4..0a65ae23f495 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -85,11 +85,13 @@ struct perf_stat_output_ctx {
 	void *ctx;
 	print_metric_t print_metric;
 	new_line_t new_line;
+	bool force_header;
 };
 
 void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
 				   double avg, int cpu,
 				   struct perf_stat_output_ctx *out);
+void perf_stat__collect_metric_expr(struct perf_evlist *);
 
 int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw);
 void perf_evlist__free_stats(struct perf_evlist *evlist);
-- 
2.9.3

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

* [PATCH 18/20] perf list: Support printing MetricExpr with --debug
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Output the metric expr in perf list when --debug is specified, so that
the user can check the formula.

Before:

  % perf list
    ...
    unc_m_power_channel_ppd
         [Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit:
          uncore_imc]
          uncore_imc_2/event=0x85/

After:

  % perf list --debug
    ...
    unc_m_power_channel_ppd
         [Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd. Unit:
          uncore_imc]
          Perf: uncore_imc_2/event=0x85/ MetricExpr: (unc_m_power_channel_ppd / unc_m_clockticks) * 100.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-12-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/pmu.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 0f1133aa3253..f819ad162b7c 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1105,6 +1105,7 @@ struct sevent {
 	char *topic;
 	char *str;
 	char *pmu;
+	char *metric_expr;
 };
 
 static int cmp_sevent(const void *a, const void *b)
@@ -1203,6 +1204,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
 			aliases[j].topic = alias->topic;
 			aliases[j].str = alias->str;
 			aliases[j].pmu = pmu->name;
+			aliases[j].metric_expr = alias->metric_expr;
 			j++;
 		}
 		if (pmu->selectable &&
@@ -1237,8 +1239,12 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
 			printf("%*s", 8, "[");
 			wordwrap(aliases[j].desc, 8, columns, 0);
 			printf("]\n");
-			if (verbose > 0)
-				printf("%*s%s/%s/\n", 8, "", aliases[j].pmu, aliases[j].str);
+			if (verbose > 0) {
+				printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str);
+				if (aliases[j].metric_expr)
+					printf(" MetricExpr: %s", aliases[j].metric_expr);
+				putchar('\n');
+			}
 		} else
 			printf("  %-50s [Kernel PMU event]\n", aliases[j].name);
 		printed++;
-- 
2.9.3

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

* [PATCH 19/20] perf pmu: Add support for MetricName JSON attribute
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Add support for a new JSON event attribute to name MetricExpr for better
output in perf stat.

If the event has no MetricName it uses the normal event name instead to
describe the metric.

Before

  % perf stat -a -I 1000 -e '{unc_p_clockticks,unc_p_freq_max_os_cycles}' --metric-only
           time unc_p_freq_max_os_cycles
     1.000149775     15.7
     2.000344807     19.3
     3.000502544     16.7
     4.000640656      6.6
     5.000779955      9.9

After

  % perf stat -a -I 1000 -e '{unc_p_clockticks,unc_p_freq_max_os_cycles}' --metric-only
           time freq_max_os_cycles %
     1.000149775     15.7
     2.000344807     19.3
     3.000502544     16.7
     4.000640656      6.6
     5.000779955      9.9

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170320201711.14142-13-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/pmu-events/jevents.c    | 14 +++++++++++---
 tools/perf/pmu-events/jevents.h    |  3 ++-
 tools/perf/pmu-events/pmu-events.h |  1 +
 tools/perf/util/evsel.c            |  1 +
 tools/perf/util/evsel.h            |  1 +
 tools/perf/util/parse-events.c     |  1 +
 tools/perf/util/pmu.c              | 15 ++++++++++++---
 tools/perf/util/pmu.h              |  2 ++
 tools/perf/util/stat-shadow.c      |  4 +++-
 9 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 0735dc2a167a..81f2ef3b15cf 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -292,7 +292,8 @@ static void print_events_table_prefix(FILE *fp, const char *tblname)
 static int print_events_table_entry(void *data, char *name, char *event,
 				    char *desc, char *long_desc,
 				    char *pmu, char *unit, char *perpkg,
-				    char *metric_expr)
+				    char *metric_expr,
+				    char *metric_name)
 {
 	struct perf_entry_data *pd = data;
 	FILE *outfp = pd->outfp;
@@ -318,6 +319,8 @@ static int print_events_table_entry(void *data, char *name, char *event,
 		fprintf(outfp, "\t.perpkg = \"%s\",\n", perpkg);
 	if (metric_expr)
 		fprintf(outfp, "\t.metric_expr = \"%s\",\n", metric_expr);
+	if (metric_name)
+		fprintf(outfp, "\t.metric_name = \"%s\",\n", metric_name);
 	fprintf(outfp, "},\n");
 
 	return 0;
@@ -366,7 +369,8 @@ int json_events(const char *fn,
 	  int (*func)(void *data, char *name, char *event, char *desc,
 		      char *long_desc,
 		      char *pmu, char *unit, char *perpkg,
-		      char *metric_expr),
+		      char *metric_expr,
+		      char *metric_name),
 	  void *data)
 {
 	int err = -EIO;
@@ -393,6 +397,7 @@ int json_events(const char *fn,
 		char *perpkg = NULL;
 		char *unit = NULL;
 		char *metric_expr = NULL;
+		char *metric_name = NULL;
 		unsigned long long eventcode = 0;
 		struct msrmap *msr = NULL;
 		jsmntok_t *msrval = NULL;
@@ -469,6 +474,8 @@ int json_events(const char *fn,
 				addfield(map, &unit, "", "", val);
 			} else if (json_streq(map, field, "PerPkg")) {
 				addfield(map, &perpkg, "", "", val);
+			} else if (json_streq(map, field, "MetricName")) {
+				addfield(map, &metric_name, "", "", val);
 			} else if (json_streq(map, field, "MetricExpr")) {
 				addfield(map, &metric_expr, "", "", val);
 				for (s = metric_expr; *s; s++)
@@ -497,7 +504,7 @@ int json_events(const char *fn,
 		fixname(name);
 
 		err = func(data, name, real_event(name, event), desc, long_desc,
-				pmu, unit, perpkg, metric_expr);
+				pmu, unit, perpkg, metric_expr, metric_name);
 		free(event);
 		free(desc);
 		free(name);
@@ -508,6 +515,7 @@ int json_events(const char *fn,
 		free(perpkg);
 		free(unit);
 		free(metric_expr);
+		free(metric_name);
 		if (err)
 			break;
 		tok += j;
diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h
index 57e111bf2168..611fac01913d 100644
--- a/tools/perf/pmu-events/jevents.h
+++ b/tools/perf/pmu-events/jevents.h
@@ -5,7 +5,8 @@ int json_events(const char *fn,
 		int (*func)(void *data, char *name, char *event, char *desc,
 				char *long_desc,
 				char *pmu,
-				char *unit, char *perpkg, char *metric_expr),
+				char *unit, char *perpkg, char *metric_expr,
+				char *metric_name),
 		void *data);
 char *get_cpu_str(void);
 
diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
index d046e3a4ce46..569eab3688dd 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -14,6 +14,7 @@ struct pmu_event {
 	const char *unit;
 	const char *perpkg;
 	const char *metric_expr;
+	const char *metric_name;
 };
 
 /*
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ef2a31f6dd06..9dc7e2d6e48a 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -237,6 +237,7 @@ void perf_evsel__init(struct perf_evsel *evsel,
 	perf_evsel__calc_id_pos(evsel);
 	evsel->cmdline_group_boundary = false;
 	evsel->metric_expr   = NULL;
+	evsel->metric_name   = NULL;
 	evsel->metric_events = NULL;
 	evsel->collect_stat  = false;
 }
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 8f1f61826fdf..d101695c482c 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -133,6 +133,7 @@ struct perf_evsel {
 	int			bpf_fd;
 	bool			merged_stat;
 	const char *		metric_expr;
+	const char *		metric_name;
 	struct perf_evsel	**metric_events;
 	bool			collect_stat;
 };
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 91b8e83e307d..119eb0b65876 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1256,6 +1256,7 @@ int parse_events_add_pmu(struct parse_events_evlist *data,
 		evsel->per_pkg = info.per_pkg;
 		evsel->snapshot = info.snapshot;
 		evsel->metric_expr = info.metric_expr;
+		evsel->metric_name = info.metric_name;
 	}
 
 	return evsel ? 0 : -ENOMEM;
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index f819ad162b7c..bcf752fa345b 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -232,7 +232,8 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
 				 char *desc, char *val,
 				 char *long_desc, char *topic,
 				 char *unit, char *perpkg,
-				 char *metric_expr)
+				 char *metric_expr,
+				 char *metric_name)
 {
 	struct perf_pmu_alias *alias;
 	int ret;
@@ -267,6 +268,7 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
 	}
 
 	alias->metric_expr = metric_expr ? strdup(metric_expr) : NULL;
+	alias->metric_name = metric_name ? strdup(metric_name): NULL;
 	alias->desc = desc ? strdup(desc) : NULL;
 	alias->long_desc = long_desc ? strdup(long_desc) :
 				desc ? strdup(desc) : NULL;
@@ -296,7 +298,7 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI
 	buf[ret] = 0;
 
 	return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL,
-				     NULL, NULL);
+				     NULL, NULL, NULL);
 }
 
 static inline bool pmu_alias_info_file(char *name)
@@ -567,7 +569,8 @@ static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
 				(char *)pe->desc, (char *)pe->event,
 				(char *)pe->long_desc, (char *)pe->topic,
 				(char *)pe->unit, (char *)pe->perpkg,
-				(char *)pe->metric_expr);
+				(char *)pe->metric_expr,
+				(char *)pe->metric_name);
 	}
 
 out:
@@ -995,6 +998,7 @@ int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms,
 	info->scale    = 0.0;
 	info->snapshot = false;
 	info->metric_expr = NULL;
+	info->metric_name = NULL;
 
 	list_for_each_entry_safe(term, h, head_terms, list) {
 		alias = pmu_find_alias(pmu, term);
@@ -1011,6 +1015,7 @@ int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms,
 		if (alias->per_pkg)
 			info->per_pkg = true;
 		info->metric_expr = alias->metric_expr;
+		info->metric_name = alias->metric_name;
 
 		list_del(&term->list);
 		free(term);
@@ -1106,6 +1111,7 @@ struct sevent {
 	char *str;
 	char *pmu;
 	char *metric_expr;
+	char *metric_name;
 };
 
 static int cmp_sevent(const void *a, const void *b)
@@ -1205,6 +1211,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
 			aliases[j].str = alias->str;
 			aliases[j].pmu = pmu->name;
 			aliases[j].metric_expr = alias->metric_expr;
+			aliases[j].metric_name = alias->metric_name;
 			j++;
 		}
 		if (pmu->selectable &&
@@ -1241,6 +1248,8 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
 			printf("]\n");
 			if (verbose > 0) {
 				printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str);
+				if (aliases[j].metric_name)
+					printf(" MetricName: %s", aliases[j].metric_name);
 				if (aliases[j].metric_expr)
 					printf(" MetricExpr: %s", aliases[j].metric_expr);
 				putchar('\n');
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 27f078ccc594..3d4b703f5d89 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -32,6 +32,7 @@ struct perf_pmu {
 struct perf_pmu_info {
 	const char *unit;
 	const char *metric_expr;
+	const char *metric_name;
 	double scale;
 	bool per_pkg;
 	bool snapshot;
@@ -52,6 +53,7 @@ struct perf_pmu_alias {
 	bool per_pkg;
 	bool snapshot;
 	char *metric_expr;
+	char *metric_name;
 };
 
 struct perf_pmu *perf_pmu__find(const char *name);
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index c323cce97d98..ac10cc675d39 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -803,7 +803,9 @@ void perf_stat__print_shadow_stats(struct perf_evsel *evsel,
 
 			if (expr__parse(&ratio, &pctx, &p) == 0)
 				print_metric(ctxp, NULL, "%8.1f",
-					out->force_header ? evsel->name : "",
+					evsel->metric_name ?
+					evsel->metric_name :
+					out->force_header ?  evsel->name : "",
 					ratio);
 			else
 				print_metric(ctxp, NULL, NULL, "", 0);
-- 
2.9.3

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

* [PATCH 20/20] perf list: Move extra details printing to new option
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
                   ` (19 preceding siblings ...)
  (?)
@ 2017-03-24 14:57 ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

Move the printing of perf expressions and internal events to a new
clearer --details flag, instead of lumping it together with other debug
options in --debug. This makes it clearer to use.

Before

  perf list --debug
  ...
  unc_m_power_critical_throttle_cycles
         [Cycles all ranks are in critical thermal throttle. Unit: uncore_imc]
          uncore_imc_2/event=0x86/  MetricName: power_critical_throttle_cycles % MetricExpr: (unc_m_power_critical_throttle_cycles / unc_m_clockticks) * 100.

after

  perf list --details
  ...
  unc_m_power_critical_throttle_cycles
         [Cycles all ranks are in critical thermal throttle. Unit: uncore_imc]
          uncore_imc_2/event=0x86/  MetricName: power_critical_throttle_cycles % MetricExpr: (unc_m_power_critical_throttle_cycles / unc_m_clockticks) * 100.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/r/20170320201711.14142-14-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-list.txt |  4 ++++
 tools/perf/builtin-list.c              | 14 ++++++++++----
 tools/perf/util/parse-events.c         |  5 +++--
 tools/perf/util/parse-events.h         |  2 +-
 tools/perf/util/pmu.c                  |  4 ++--
 tools/perf/util/pmu.h                  |  2 +-
 6 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
index 41857cce5e86..143d98df2df9 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -24,6 +24,10 @@ Don't print descriptions.
 --long-desc::
 Print longer event descriptions.
 
+--details::
+Print how named events are resolved internally into perf events, and also
+any extra expressions computed by perf stat.
+
 
 [[EVENT_MODIFIERS]]
 EVENT MODIFIERS
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 3b9d98b5feef..be9195e95c78 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -18,6 +18,7 @@
 #include <subcmd/parse-options.h>
 
 static bool desc_flag = true;
+static bool details_flag;
 
 int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 {
@@ -30,6 +31,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 			    "Print extra event descriptions. --no-desc to not print."),
 		OPT_BOOLEAN('v', "long-desc", &long_desc_flag,
 			    "Print longer event descriptions."),
+		OPT_BOOLEAN(0, "details", &details_flag,
+			    "Print information on the perf event names and expressions used internally by events."),
 		OPT_INCR(0, "debug", &verbose,
 			     "Enable debugging output"),
 		OPT_END()
@@ -50,7 +53,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 		printf("\nList of pre-defined events (to be used in -e):\n\n");
 
 	if (argc == 0) {
-		print_events(NULL, raw_dump, !desc_flag, long_desc_flag);
+		print_events(NULL, raw_dump, !desc_flag, long_desc_flag,
+				details_flag);
 		return 0;
 	}
 
@@ -72,7 +76,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 			print_hwcache_events(NULL, raw_dump);
 		else if (strcmp(argv[i], "pmu") == 0)
 			print_pmu_events(NULL, raw_dump, !desc_flag,
-						long_desc_flag);
+						long_desc_flag, details_flag);
 		else if (strcmp(argv[i], "sdt") == 0)
 			print_sdt_events(NULL, NULL, raw_dump);
 		else if ((sep = strchr(argv[i], ':')) != NULL) {
@@ -80,7 +84,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 
 			if (sep == NULL) {
 				print_events(argv[i], raw_dump, !desc_flag,
-							long_desc_flag);
+							long_desc_flag,
+							details_flag);
 				continue;
 			}
 			sep_idx = sep - argv[i];
@@ -103,7 +108,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 					    event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump);
 			print_hwcache_events(s, raw_dump);
 			print_pmu_events(s, raw_dump, !desc_flag,
-						long_desc_flag);
+						long_desc_flag,
+						details_flag);
 			print_tracepoint_events(NULL, s, raw_dump);
 			print_sdt_events(NULL, s, raw_dump);
 			free(s);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 119eb0b65876..6b498aea9fde 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2325,7 +2325,7 @@ void print_symbol_events(const char *event_glob, unsigned type,
  * Print the help text for the event symbols:
  */
 void print_events(const char *event_glob, bool name_only, bool quiet_flag,
-			bool long_desc)
+			bool long_desc, bool details_flag)
 {
 	print_symbol_events(event_glob, PERF_TYPE_HARDWARE,
 			    event_symbols_hw, PERF_COUNT_HW_MAX, name_only);
@@ -2335,7 +2335,8 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag,
 
 	print_hwcache_events(event_glob, name_only);
 
-	print_pmu_events(event_glob, name_only, quiet_flag, long_desc);
+	print_pmu_events(event_glob, name_only, quiet_flag, long_desc,
+			details_flag);
 
 	if (event_glob != NULL)
 		return;
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index f38086b8dbea..a235f4d6d5e5 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -184,7 +184,7 @@ void parse_events_evlist_error(struct parse_events_evlist *data,
 			       int idx, const char *str);
 
 void print_events(const char *event_glob, bool name_only, bool quiet,
-		  bool long_desc);
+		  bool long_desc, bool details_flag);
 
 struct event_symbol {
 	const char	*symbol;
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index bcf752fa345b..362051ea7f3d 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1154,7 +1154,7 @@ static void wordwrap(char *s, int start, int max, int corr)
 }
 
 void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
-			bool long_desc)
+			bool long_desc, bool details_flag)
 {
 	struct perf_pmu *pmu;
 	struct perf_pmu_alias *alias;
@@ -1246,7 +1246,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
 			printf("%*s", 8, "[");
 			wordwrap(aliases[j].desc, 8, columns, 0);
 			printf("]\n");
-			if (verbose > 0) {
+			if (details_flag) {
 				printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str);
 				if (aliases[j].metric_name)
 					printf(" MetricName: %s", aliases[j].metric_name);
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 3d4b703f5d89..ea7f450dc609 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -80,7 +80,7 @@ int perf_pmu__format_parse(char *dir, struct list_head *head);
 struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
 
 void print_pmu_events(const char *event_glob, bool name_only, bool quiet,
-		      bool long_desc);
+		      bool long_desc, bool details_flag);
 bool pmu_have_event(const char *pname, const char *name);
 
 int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt,
-- 
2.9.3

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2017-03-24 14:57 ` Arnaldo Carvalho de Melo
@ 2017-03-24 18:39   ` Ingo Molnar
  -1 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2017-03-24 18:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexis Berlemont, Andi Kleen, David Ahern, Hanjun Guo,
	Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Taeung Song, Wang Nan, linux-perf-users,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:
> 
>   Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +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-4.12-20170324
> 
> for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:
> 
>   perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)
> 
> - Collapse identically named PMU events in 'perf stat', allow
>   not merging it via --no-merge (Andi Kleen)
> 
> Fixes:
> 
> - Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
>   disassembly output to not ditch line:number lines needed by
>   'perf annotate --print-lines' logic (Taeung Song)
> 
> Infrastructure:
> 
> - SDT (Statically Defined Tracing)/uprobes_events arguments improvements
>   (Alexis Berlemont, Ravi Bangoria)
> 
> - Improvements for the handling of JSON described vendor events,
>   including having an expression parser to calculate metrics
>   from multiple vendor events (Andi Kleen)
> 
> - Update Intel JSON vendor event files (Andi Kleen)
> 
> - Restore error reporting in 'perf probe -d' when none of the events
>   requested to be deleted exist. (Kefeng Wang)
> 
> - Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
>   (Ravi Bangoria)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Alexis Berlemont (2):
>       perf sdt: Add scanning of sdt probes arguments
>       perf probe: Add sdt probes arguments into the uprobe cmd string
> 
> Andi Kleen (13):
>       perf stat: Factor out callback for collecting event values
>       perf stat: Collapse identically named events
>       perf stat: Handle partially bad results with merging
>       perf tools: Factor out PMU matching in parser
>       perf pmu: Expand PMU events by prefix match
>       perf pmu: Special case uncore_ prefix
>       perf tools: Add a simple expression parser for JSON
>       perf vendor events intel: Update Intel uncore JSON event files
>       perf pmu: Support MetricExpr header in JSON event list
>       perf stat: Output JSON MetricExpr metric
>       perf list: Support printing MetricExpr with --debug
>       perf pmu: Add support for MetricName JSON attribute
>       perf list: Move extra details printing to new option
> 
> Arnaldo Carvalho de Melo (1):
>       perf annotate: Add comment clarifying how the source code line is parsed
> 
> Kefeng Wang (1):
>       perf probe: Return errno when not hitting any event
> 
> Ravi Bangoria (2):
>       perf probe: Change MAX_CMDLEN
>       perf sdt x86: Add renaming logic for rNN and other registers
> 
> Taeung Song (1):
>       perf annotate: More exactly grep -v of the objdump command
> 
>  tools/perf/Documentation/perf-list.txt             |   4 +
>  tools/perf/Documentation/perf-stat.txt             |   3 +
>  tools/perf/arch/x86/util/perf_regs.c               | 103 +++++++++++
>  tools/perf/builtin-list.c                          |  14 +-
>  tools/perf/builtin-probe.c                         |   6 +-
>  tools/perf/builtin-stat.c                          | 146 ++++++++++++---
>  .../arch/x86/broadwellde/uncore-cache.json         |  28 +--
>  .../arch/x86/broadwellde/uncore-memory.json        |  26 ++-
>  .../arch/x86/broadwellde/uncore-power.json         |  26 ++-
>  .../arch/x86/broadwellx/uncore-cache.json          |  28 +--
>  .../arch/x86/broadwellx/uncore-interconnect.json   |   6 +-
>  .../arch/x86/broadwellx/uncore-memory.json         |  21 ++-
>  .../arch/x86/broadwellx/uncore-power.json          |  26 ++-
>  .../pmu-events/arch/x86/haswellx/uncore-cache.json |  28 +--
>  .../arch/x86/haswellx/uncore-interconnect.json     |   6 +-
>  .../arch/x86/haswellx/uncore-memory.json           |  21 ++-
>  .../pmu-events/arch/x86/haswellx/uncore-power.json |  26 ++-
>  .../pmu-events/arch/x86/ivytown/uncore-cache.json  |  22 +--
>  .../arch/x86/ivytown/uncore-interconnect.json      |  12 +-
>  .../pmu-events/arch/x86/ivytown/uncore-memory.json |  19 +-
>  .../pmu-events/arch/x86/ivytown/uncore-power.json  |  53 ++++--
>  .../pmu-events/arch/x86/jaketown/uncore-cache.json |  13 +-
>  .../arch/x86/jaketown/uncore-interconnect.json     |  12 +-
>  .../arch/x86/jaketown/uncore-memory.json           |  21 ++-
>  .../pmu-events/arch/x86/jaketown/uncore-power.json |  53 ++++--
>  tools/perf/pmu-events/jevents.c                    |  26 ++-
>  tools/perf/pmu-events/jevents.h                    |   3 +-
>  tools/perf/pmu-events/pmu-events.h                 |   2 +
>  tools/perf/tests/Build                             |   1 +
>  tools/perf/tests/builtin-test.c                    |   4 +
>  tools/perf/tests/expr.c                            |  56 ++++++
>  tools/perf/tests/tests.h                           |   1 +
>  tools/perf/util/Build                              |   6 +
>  tools/perf/util/annotate.c                         |   8 +-
>  tools/perf/util/evsel.c                            |   4 +
>  tools/perf/util/evsel.h                            |   5 +
>  tools/perf/util/expr.h                             |  25 +++
>  tools/perf/util/expr.y                             | 173 ++++++++++++++++++
>  tools/perf/util/parse-events.c                     |  78 +++++++-
>  tools/perf/util/parse-events.h                     |  10 +-
>  tools/perf/util/parse-events.y                     |  73 ++++----
>  tools/perf/util/perf_regs.c                        |   6 +
>  tools/perf/util/perf_regs.h                        |   6 +
>  tools/perf/util/pmu.c                              |  32 +++-
>  tools/perf/util/pmu.h                              |   6 +-
>  tools/perf/util/probe-event.c                      |   1 -
>  tools/perf/util/probe-file.c                       | 173 +++++++++++++++++-
>  tools/perf/util/stat-shadow.c                      | 197 +++++++++++++++++++++
>  tools/perf/util/stat.h                             |   2 +
>  tools/perf/util/symbol-elf.c                       |  25 ++-
>  tools/perf/util/symbol.h                           |   1 +
>  51 files changed, 1370 insertions(+), 277 deletions(-)
>  create mode 100644 tools/perf/tests/expr.c
>  create mode 100644 tools/perf/util/expr.h
>  create mode 100644 tools/perf/util/expr.y

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-24 18:39   ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2017-03-24 18:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexis Berlemont, Andi Kleen, David Ahern, Hanjun Guo,
	Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Taeung Song


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:
> 
>   Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +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-4.12-20170324
> 
> for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:
> 
>   perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)
> 
> - Collapse identically named PMU events in 'perf stat', allow
>   not merging it via --no-merge (Andi Kleen)
> 
> Fixes:
> 
> - Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
>   disassembly output to not ditch line:number lines needed by
>   'perf annotate --print-lines' logic (Taeung Song)
> 
> Infrastructure:
> 
> - SDT (Statically Defined Tracing)/uprobes_events arguments improvements
>   (Alexis Berlemont, Ravi Bangoria)
> 
> - Improvements for the handling of JSON described vendor events,
>   including having an expression parser to calculate metrics
>   from multiple vendor events (Andi Kleen)
> 
> - Update Intel JSON vendor event files (Andi Kleen)
> 
> - Restore error reporting in 'perf probe -d' when none of the events
>   requested to be deleted exist. (Kefeng Wang)
> 
> - Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
>   (Ravi Bangoria)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Alexis Berlemont (2):
>       perf sdt: Add scanning of sdt probes arguments
>       perf probe: Add sdt probes arguments into the uprobe cmd string
> 
> Andi Kleen (13):
>       perf stat: Factor out callback for collecting event values
>       perf stat: Collapse identically named events
>       perf stat: Handle partially bad results with merging
>       perf tools: Factor out PMU matching in parser
>       perf pmu: Expand PMU events by prefix match
>       perf pmu: Special case uncore_ prefix
>       perf tools: Add a simple expression parser for JSON
>       perf vendor events intel: Update Intel uncore JSON event files
>       perf pmu: Support MetricExpr header in JSON event list
>       perf stat: Output JSON MetricExpr metric
>       perf list: Support printing MetricExpr with --debug
>       perf pmu: Add support for MetricName JSON attribute
>       perf list: Move extra details printing to new option
> 
> Arnaldo Carvalho de Melo (1):
>       perf annotate: Add comment clarifying how the source code line is parsed
> 
> Kefeng Wang (1):
>       perf probe: Return errno when not hitting any event
> 
> Ravi Bangoria (2):
>       perf probe: Change MAX_CMDLEN
>       perf sdt x86: Add renaming logic for rNN and other registers
> 
> Taeung Song (1):
>       perf annotate: More exactly grep -v of the objdump command
> 
>  tools/perf/Documentation/perf-list.txt             |   4 +
>  tools/perf/Documentation/perf-stat.txt             |   3 +
>  tools/perf/arch/x86/util/perf_regs.c               | 103 +++++++++++
>  tools/perf/builtin-list.c                          |  14 +-
>  tools/perf/builtin-probe.c                         |   6 +-
>  tools/perf/builtin-stat.c                          | 146 ++++++++++++---
>  .../arch/x86/broadwellde/uncore-cache.json         |  28 +--
>  .../arch/x86/broadwellde/uncore-memory.json        |  26 ++-
>  .../arch/x86/broadwellde/uncore-power.json         |  26 ++-
>  .../arch/x86/broadwellx/uncore-cache.json          |  28 +--
>  .../arch/x86/broadwellx/uncore-interconnect.json   |   6 +-
>  .../arch/x86/broadwellx/uncore-memory.json         |  21 ++-
>  .../arch/x86/broadwellx/uncore-power.json          |  26 ++-
>  .../pmu-events/arch/x86/haswellx/uncore-cache.json |  28 +--
>  .../arch/x86/haswellx/uncore-interconnect.json     |   6 +-
>  .../arch/x86/haswellx/uncore-memory.json           |  21 ++-
>  .../pmu-events/arch/x86/haswellx/uncore-power.json |  26 ++-
>  .../pmu-events/arch/x86/ivytown/uncore-cache.json  |  22 +--
>  .../arch/x86/ivytown/uncore-interconnect.json      |  12 +-
>  .../pmu-events/arch/x86/ivytown/uncore-memory.json |  19 +-
>  .../pmu-events/arch/x86/ivytown/uncore-power.json  |  53 ++++--
>  .../pmu-events/arch/x86/jaketown/uncore-cache.json |  13 +-
>  .../arch/x86/jaketown/uncore-interconnect.json     |  12 +-
>  .../arch/x86/jaketown/uncore-memory.json           |  21 ++-
>  .../pmu-events/arch/x86/jaketown/uncore-power.json |  53 ++++--
>  tools/perf/pmu-events/jevents.c                    |  26 ++-
>  tools/perf/pmu-events/jevents.h                    |   3 +-
>  tools/perf/pmu-events/pmu-events.h                 |   2 +
>  tools/perf/tests/Build                             |   1 +
>  tools/perf/tests/builtin-test.c                    |   4 +
>  tools/perf/tests/expr.c                            |  56 ++++++
>  tools/perf/tests/tests.h                           |   1 +
>  tools/perf/util/Build                              |   6 +
>  tools/perf/util/annotate.c                         |   8 +-
>  tools/perf/util/evsel.c                            |   4 +
>  tools/perf/util/evsel.h                            |   5 +
>  tools/perf/util/expr.h                             |  25 +++
>  tools/perf/util/expr.y                             | 173 ++++++++++++++++++
>  tools/perf/util/parse-events.c                     |  78 +++++++-
>  tools/perf/util/parse-events.h                     |  10 +-
>  tools/perf/util/parse-events.y                     |  73 ++++----
>  tools/perf/util/perf_regs.c                        |   6 +
>  tools/perf/util/perf_regs.h                        |   6 +
>  tools/perf/util/pmu.c                              |  32 +++-
>  tools/perf/util/pmu.h                              |   6 +-
>  tools/perf/util/probe-event.c                      |   1 -
>  tools/perf/util/probe-file.c                       | 173 +++++++++++++++++-
>  tools/perf/util/stat-shadow.c                      | 197 +++++++++++++++++++++
>  tools/perf/util/stat.h                             |   2 +
>  tools/perf/util/symbol-elf.c                       |  25 ++-
>  tools/perf/util/symbol.h                           |   1 +
>  51 files changed, 1370 insertions(+), 277 deletions(-)
>  create mode 100644 tools/perf/tests/expr.c
>  create mode 100644 tools/perf/util/expr.h
>  create mode 100644 tools/perf/util/expr.y

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2017-03-28  1:38 Arnaldo Carvalho de Melo
@ 2017-03-28  5:45 ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2017-03-28  5:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	David Ahern, Jiri Olsa, Kan Liang, Masami Hiramatsu,
	Milian Wolff, Namhyung Kim, Peter Zijlstra, Ravi Bangoria,
	Sukadev Bhattiprolu, Taeung Song, Tommi Rantala, Wang Nan,
	Yao Jin, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92:
> 
>   Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +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-4.12-20170327
> 
> for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de:
> 
>   perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Handle inline functions in callchains (Jin Yao)
> 
> - Enable sorting by srcline as key (Milian Wolff)
> 
> Fixes:
> 
> - Fix no_size logic in addr_filter__resolve_kernel_syms() in the
>   auxtrace code (Adrian Hunter)
> 
> - Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo)
> 
> - Fix divide by zero when calculating percent for an event in a group in
>   the annotate by source line code (Taeung Song)
> 
> - build-id files now aren't anymore symlinks, their parent directories
>   are, so readlink the later (Taeung Song)
> 
> - Assorted fixes for null termination problems, mostly related to
>   readlink, detected by valgrind (Tommi Rantala)
> 
> Infrastructure:
> 
> - Make vfs_getname probe point logic in 'perf trace' more robust
>   wrt length of pathname (Arnaldo Carvalho de Melo)
> 
> - Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo)
> 
> - Show 'perf list sdt' option in man page (Ravi Bangoria)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (1):
>       perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()
> 
> Arnaldo Carvalho de Melo (4):
>       perf trace: Check for vfs_getname.pathname length
>       perf trace: Fix up error path indentation
>       perf trace: Fixup thread refcounting
>       perf tools: Remove unused 'prefix' from builtin functions
> 
> Jin Yao (5):
>       perf report: Refactor common code in srcline.c
>       perf report: Find the inline stack for a given address
>       perf report: Introduce --inline option
>       perf report: Show inline stack for stdio mode
>       perf report: Show inline stack for browser mode
> 
> Milian Wolff (1):
>       perf report: Enable sorting by srcline as key
> 
> Ravi Bangoria (1):
>       perf list sdt: Show option in man page
> 
> Taeung Song (2):
>       perf annotate: Fix a bug following symbolic link of a build-id file
>       perf annotate: Fix a bug of division by zero when calculating percent
> 
> Tommi Rantala (6):
>       perf buildid: Do not update SDT cache with null filename
>       perf buildid: Do not assume that readlink() returns a null terminated string
>       perf tests: Do not assume that readlink() returns a null terminated string
>       perf utils: use sizeof(buf) - 1 in readlink() call
>       perf utils: Null terminate buf in read_ftrace_printk()
>       perf utils: Readlink /proc/self/exe to find the perf binary
> 
>  tools/perf/Documentation/perf-list.txt   |   4 +-
>  tools/perf/Documentation/perf-report.txt |   5 +
>  tools/perf/bench/bench.h                 |  20 +--
>  tools/perf/bench/futex-hash.c            |   3 +-
>  tools/perf/bench/futex-lock-pi.c         |   3 +-
>  tools/perf/bench/futex-requeue.c         |   3 +-
>  tools/perf/bench/futex-wake-parallel.c   |   3 +-
>  tools/perf/bench/futex-wake.c            |   3 +-
>  tools/perf/bench/mem-functions.c         |   4 +-
>  tools/perf/bench/numa.c                  |   2 +-
>  tools/perf/bench/sched-messaging.c       |   3 +-
>  tools/perf/bench/sched-pipe.c            |   2 +-
>  tools/perf/builtin-annotate.c            |   2 +-
>  tools/perf/builtin-bench.c               |  12 +-
>  tools/perf/builtin-buildid-cache.c       |   3 +-
>  tools/perf/builtin-buildid-list.c        |   3 +-
>  tools/perf/builtin-c2c.c                 |   4 +-
>  tools/perf/builtin-config.c              |   2 +-
>  tools/perf/builtin-data.c                |   9 +-
>  tools/perf/builtin-diff.c                |   2 +-
>  tools/perf/builtin-evlist.c              |   2 +-
>  tools/perf/builtin-ftrace.c              |   2 +-
>  tools/perf/builtin-help.c                |   2 +-
>  tools/perf/builtin-inject.c              |   2 +-
>  tools/perf/builtin-kallsyms.c            |   2 +-
>  tools/perf/builtin-kmem.c                |   4 +-
>  tools/perf/builtin-kvm.c                 |  16 +-
>  tools/perf/builtin-list.c                |   2 +-
>  tools/perf/builtin-lock.c                |   6 +-
>  tools/perf/builtin-mem.c                 |   6 +-
>  tools/perf/builtin-probe.c               |   6 +-
>  tools/perf/builtin-record.c              |   2 +-
>  tools/perf/builtin-report.c              |   4 +-
>  tools/perf/builtin-sched.c               |   6 +-
>  tools/perf/builtin-script.c              |   4 +-
>  tools/perf/builtin-stat.c                |   2 +-
>  tools/perf/builtin-timechart.c           |   7 +-
>  tools/perf/builtin-top.c                 |   2 +-
>  tools/perf/builtin-trace.c               |  25 ++--
>  tools/perf/builtin-version.c             |   3 +-
>  tools/perf/builtin.h                     |  58 ++++----
>  tools/perf/perf.c                        |  11 +-
>  tools/perf/tests/builtin-test.c          |   2 +-
>  tools/perf/tests/sdt.c                   |   2 +-
>  tools/perf/ui/browsers/hists.c           | 181 ++++++++++++++++++++++-
>  tools/perf/ui/stdio/hist.c               |  86 ++++++++++-
>  tools/perf/util/annotate.c               |  23 ++-
>  tools/perf/util/auxtrace.c               |   4 +-
>  tools/perf/util/build-id.c               |   8 +-
>  tools/perf/util/callchain.c              |  52 ++++++-
>  tools/perf/util/callchain.h              |   3 +-
>  tools/perf/util/header.c                 |   8 +-
>  tools/perf/util/hist.c                   |   5 +
>  tools/perf/util/map.c                    |   3 +-
>  tools/perf/util/sort.c                   |  16 +-
>  tools/perf/util/sort.h                   |   1 +
>  tools/perf/util/srcline.c                | 246 +++++++++++++++++++++++++++----
>  tools/perf/util/symbol-elf.c             |   5 +
>  tools/perf/util/symbol-minimal.c         |   7 +
>  tools/perf/util/symbol.h                 |   5 +-
>  tools/perf/util/trace-event-read.c       |   4 +-
>  tools/perf/util/util.h                   |  20 ++-
>  62 files changed, 739 insertions(+), 208 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-28  1:38 Arnaldo Carvalho de Melo
  2017-03-28  5:45 ` Ingo Molnar
  0 siblings, 1 reply; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-28  1:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, David Ahern, Jiri Olsa,
	Kan Liang, Masami Hiramatsu, Milian Wolff, Namhyung Kim,
	Peter Zijlstra, Ravi Bangoria, Sukadev Bhattiprolu, Taeung Song,
	Tommi Rantala, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92:

  Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +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-4.12-20170327

for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de:

  perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

New features:

- Handle inline functions in callchains (Jin Yao)

- Enable sorting by srcline as key (Milian Wolff)

Fixes:

- Fix no_size logic in addr_filter__resolve_kernel_syms() in the
  auxtrace code (Adrian Hunter)

- Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo)

- Fix divide by zero when calculating percent for an event in a group in
  the annotate by source line code (Taeung Song)

- build-id files now aren't anymore symlinks, their parent directories
  are, so readlink the later (Taeung Song)

- Assorted fixes for null termination problems, mostly related to
  readlink, detected by valgrind (Tommi Rantala)

Infrastructure:

- Make vfs_getname probe point logic in 'perf trace' more robust
  wrt length of pathname (Arnaldo Carvalho de Melo)

- Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo)

- Show 'perf list sdt' option in man page (Ravi Bangoria)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (1):
      perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()

Arnaldo Carvalho de Melo (4):
      perf trace: Check for vfs_getname.pathname length
      perf trace: Fix up error path indentation
      perf trace: Fixup thread refcounting
      perf tools: Remove unused 'prefix' from builtin functions

Jin Yao (5):
      perf report: Refactor common code in srcline.c
      perf report: Find the inline stack for a given address
      perf report: Introduce --inline option
      perf report: Show inline stack for stdio mode
      perf report: Show inline stack for browser mode

Milian Wolff (1):
      perf report: Enable sorting by srcline as key

Ravi Bangoria (1):
      perf list sdt: Show option in man page

Taeung Song (2):
      perf annotate: Fix a bug following symbolic link of a build-id file
      perf annotate: Fix a bug of division by zero when calculating percent

Tommi Rantala (6):
      perf buildid: Do not update SDT cache with null filename
      perf buildid: Do not assume that readlink() returns a null terminated string
      perf tests: Do not assume that readlink() returns a null terminated string
      perf utils: use sizeof(buf) - 1 in readlink() call
      perf utils: Null terminate buf in read_ftrace_printk()
      perf utils: Readlink /proc/self/exe to find the perf binary

 tools/perf/Documentation/perf-list.txt   |   4 +-
 tools/perf/Documentation/perf-report.txt |   5 +
 tools/perf/bench/bench.h                 |  20 +--
 tools/perf/bench/futex-hash.c            |   3 +-
 tools/perf/bench/futex-lock-pi.c         |   3 +-
 tools/perf/bench/futex-requeue.c         |   3 +-
 tools/perf/bench/futex-wake-parallel.c   |   3 +-
 tools/perf/bench/futex-wake.c            |   3 +-
 tools/perf/bench/mem-functions.c         |   4 +-
 tools/perf/bench/numa.c                  |   2 +-
 tools/perf/bench/sched-messaging.c       |   3 +-
 tools/perf/bench/sched-pipe.c            |   2 +-
 tools/perf/builtin-annotate.c            |   2 +-
 tools/perf/builtin-bench.c               |  12 +-
 tools/perf/builtin-buildid-cache.c       |   3 +-
 tools/perf/builtin-buildid-list.c        |   3 +-
 tools/perf/builtin-c2c.c                 |   4 +-
 tools/perf/builtin-config.c              |   2 +-
 tools/perf/builtin-data.c                |   9 +-
 tools/perf/builtin-diff.c                |   2 +-
 tools/perf/builtin-evlist.c              |   2 +-
 tools/perf/builtin-ftrace.c              |   2 +-
 tools/perf/builtin-help.c                |   2 +-
 tools/perf/builtin-inject.c              |   2 +-
 tools/perf/builtin-kallsyms.c            |   2 +-
 tools/perf/builtin-kmem.c                |   4 +-
 tools/perf/builtin-kvm.c                 |  16 +-
 tools/perf/builtin-list.c                |   2 +-
 tools/perf/builtin-lock.c                |   6 +-
 tools/perf/builtin-mem.c                 |   6 +-
 tools/perf/builtin-probe.c               |   6 +-
 tools/perf/builtin-record.c              |   2 +-
 tools/perf/builtin-report.c              |   4 +-
 tools/perf/builtin-sched.c               |   6 +-
 tools/perf/builtin-script.c              |   4 +-
 tools/perf/builtin-stat.c                |   2 +-
 tools/perf/builtin-timechart.c           |   7 +-
 tools/perf/builtin-top.c                 |   2 +-
 tools/perf/builtin-trace.c               |  25 ++--
 tools/perf/builtin-version.c             |   3 +-
 tools/perf/builtin.h                     |  58 ++++----
 tools/perf/perf.c                        |  11 +-
 tools/perf/tests/builtin-test.c          |   2 +-
 tools/perf/tests/sdt.c                   |   2 +-
 tools/perf/ui/browsers/hists.c           | 181 ++++++++++++++++++++++-
 tools/perf/ui/stdio/hist.c               |  86 ++++++++++-
 tools/perf/util/annotate.c               |  23 ++-
 tools/perf/util/auxtrace.c               |   4 +-
 tools/perf/util/build-id.c               |   8 +-
 tools/perf/util/callchain.c              |  52 ++++++-
 tools/perf/util/callchain.h              |   3 +-
 tools/perf/util/header.c                 |   8 +-
 tools/perf/util/hist.c                   |   5 +
 tools/perf/util/map.c                    |   3 +-
 tools/perf/util/sort.c                   |  16 +-
 tools/perf/util/sort.h                   |   1 +
 tools/perf/util/srcline.c                | 246 +++++++++++++++++++++++++++----
 tools/perf/util/symbol-elf.c             |   5 +
 tools/perf/util/symbol-minimal.c         |   7 +
 tools/perf/util/symbol.h                 |   5 +-
 tools/perf/util/trace-event-read.c       |   4 +-
 tools/perf/util/util.h                   |  20 ++-
 62 files changed, 739 insertions(+), 208 deletions(-)

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

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.

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:edge: Ok
   4 android-ndk:r12b-arm: Ok
   5 archlinux:latest: Ok
   6 centos:5: Ok
   7 centos:6: Ok
   8 centos:7: Ok
   9 debian:7: Ok
  10 debian:8: Ok
  11 debian:9: Ok
  12 debian:experimental: Ok
  13 debian:experimental-x-arm64: Ok
  14 debian:experimental-x-mips: Ok
  15 debian:experimental-x-mips64: Ok
  16 debian:experimental-x-mipsel: Ok
  17 fedora:20: Ok
  18 fedora:21: Ok
  19 fedora:22: Ok
  20 fedora:23: Ok
  21 fedora:24: Ok
  22 fedora:24-x-ARC-uClibc: Ok
  23 fedora:25: Ok
  24 fedora:rawhide: Ok
  25 mageia:5: Ok
  26 opensuse:13.2: Ok
  27 opensuse:42.1: Ok
  28 opensuse:tumbleweed: Ok
  29 ubuntu:12.04.5: Ok
  30 ubuntu:14.04.4: Ok
  31 ubuntu:14.04.4-x-linaro-arm64: Ok
  32 ubuntu:15.10: Ok
  33 ubuntu:16.04: Ok
  34 ubuntu:16.04-x-arm: Ok
  35 ubuntu:16.04-x-arm64: Ok
  36 ubuntu:16.04-x-powerpc: Ok
  37 ubuntu:16.04-x-powerpc64: Ok
  38 ubuntu:16.04-x-s390: Ok
  39 ubuntu:16.10: Ok
  40 ubuntu:17.04: Ok
  # 
  # uname -a
  Linux jouet 4.11.0-rc2+ #5 SMP Mon Mar 20 18:12:29 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
  # This kernel lacks the fix by peterz for 'perf test tsc'
  #
  # 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: Parse event definition strings             : Ok
   6: Simple expression parser                   : Ok
   7: PERF_RECORD_* events & perf_sample fields  : Ok
   8: Parse perf pmu format                      : Ok
   9: DSO data read                              : Ok
  10: DSO data cache                             : Ok
  11: DSO data reopen                            : Ok
  12: Roundtrip evsel->name                      : Ok
  13: Parse sched tracepoints fields             : Ok
  14: syscalls:sys_enter_openat event fields     : Ok
  15: Setup struct perf_event_attr               : Ok
  16: Match and link multiple hists              : Ok
  17: 'import perf' in python                    : Ok
  18: Breakpoint overflow signal handler         : Ok
  19: Breakpoint overflow sampling               : Ok
  20: Number of exit events of a simple workload : Ok
  21: Software clock events period values        : Ok
  22: Object code reading                        : Ok
  23: Sample parsing                             : Ok
  24: Use a dummy software event to keep tracking: Ok
  25: Parse with no sample_id_all bit set        : Ok
  26: Filter hist entries                        : Ok
  27: Lookup mmap thread                         : Ok
  28: Share thread mg                            : Ok
  29: Sort output of hist entries                : Ok
  30: Cumulate child hist entries                : Ok
  31: Track with sched_switch                    : Ok
  32: Filter fds with revents mask in a fdarray  : Ok
  33: Add fd to a fdarray, making it autogrow    : Ok
  34: kmod_path__parse                           : Ok
  35: Thread map                                 : Ok
  36: LLVM search and compile                    :
  36.1: Basic BPF llvm compile                    : Ok
  36.2: kbuild searching                          : Ok
  36.3: Compile source for BPF prologue generation: Ok
  36.4: Compile source for BPF relocation         : Ok
  37: Session topology                           : Ok
  38: BPF filter                                 :
  38.1: Basic BPF filtering                      : Ok
  38.2: BPF pinning                              : Ok
  38.3: BPF prologue generation                  : Ok
  38.4: BPF relocation checker                   : Ok
  39: Synthesize thread map                      : Ok
  40: Remove thread map                          : Ok
  41: Synthesize cpu map                         : Ok
  42: Synthesize stat config                     : Ok
  43: Synthesize stat                            : Ok
  44: Synthesize stat round                      : Ok
  45: Synthesize attr update                     : Ok
  46: Event times                                : Ok
  47: Read backward ring buffer                  : Ok
  48: Print cpu map                              : Ok
  49: Probe SDT events                           : Ok
  50: is_printable_array                         : Ok
  51: Print bitmap                               : Ok
  52: perf hooks                                 : Ok
  53: builtin clang support                      : Skip (not compiled in)
  54: unit_number__scnprintf                     : Ok
  55: x86 rdpmc                                  : Ok
  56: Convert perf time to TSC                   : FAILED!
  57: DWARF unwind                               : Ok
  58: x86 instruction decoder - new instructions : Ok
  59: Intel cqm nmi context read                 : Skip
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
              make_clean_all_O: make clean all 
       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_no_libaudit_O: make NO_LIBAUDIT=1 
         make_with_clangllvm_O: make LIBCLANGLLVM=1 
                   make_tags_O: make tags 
               make_no_slang_O: make NO_SLANG=1 
   make_install_prefix_slash_O: make install prefix=/tmp/krava/ 
                   make_pure_O: make 
         make_install_prefix_O: make install prefix=/tmp/krava 
            make_no_demangle_O: make NO_DEMANGLE=1 
                    make_doc_O: make doc 
                make_no_gtk2_O: make NO_GTK2=1 
                   make_help_O: make help 
                 make_static_O: make LDFLAGS=-static 
           make_no_libunwind_O: make NO_LIBUNWIND=1 
             make_util_map_o_O: make util/map.o 
           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_debug_O: make DEBUG=1 
             make_no_scripts_O: make NO_LIBPYTHON=1 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 
            make_no_auxtrace_O: make NO_AUXTRACE=1 
             make_no_libperl_O: make NO_LIBPERL=1 
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 
              make_no_libbpf_O: make NO_LIBBPF=1 
                make_no_newt_O: make NO_NEWT=1 
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 
             make_no_libnuma_O: make NO_LIBNUMA=1 
        make_with_babeltrace_O: make LIBBABELTRACE=1 
            make_install_bin_O: make install-bin 
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2016-12-05 21:37 Arnaldo Carvalho de Melo
@ 2016-12-06  8:17 ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2016-12-06  8:17 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov,
	Chris Riyder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer,
	Kim Phillips, linuxppc-dev, Markus Trippelsdorf,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao,
	Peter Foley, Peter Zijlstra, Ravi Bangoria, Taeung Song,
	Wang Nan, Zefan Li, pi3orama, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4:
> 
>   Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08: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-20161205
> 
> for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9:
> 
>   perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Fixes:
> 
> - Do not show a bogus target address in 'perf annotate' for targetless powerpc
>   jump instructions such as 'bctr' (Ravi Bangoria)
> 
> - tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa)
> 
> - Fix building objtool with clang (Peter Foley)
> 
> Infrastructure:
> 
> - Support linking perf with clang and LLVM libraries, initially statically, but
>   this limitation will be lifted and shared libraries, when available, will
>   be preferred to the static build, that should, as with other features, be
>   enabled explicitly (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Jiri Olsa (7):
>       tools build: Make fixdep parsing wait for last target
>       tools build: Make the .cmd file more readable
>       tools build: Move tabs to spaces where suitable
>       perf tools: Move install-gtk target into rules area
>       perf tools: Move python/perf.so target into rules area
>       perf tools: Cleanup build directory before each test
>       perf tools: Add non config targets
> 
> Peter Foley (1):
>       tools build: Fix objtool build with clang
> 
> Ravi Bangoria (1):
>       perf annotate: Show raw form for jump instruction with indirect target
> 
> Wang Nan (11):
>       perf tools: Pass context to perf hook functions
>       perf llvm: Extract helpers in llvm-utils.c
>       tools build: Add feature detection for LLVM
>       tools build: Add feature detection for clang
>       perf build: Add clang and llvm compile and linking support
>       perf clang: Add builtin clang support ant test case
>       perf clang: Use real file system for #include
>       perf clang: Allow passing CFLAGS to builtin clang
>       perf clang: Update test case to use real BPF script
>       perf clang: Support compile IR to BPF object and add testcase
>       perf clang: Compile BPF script using builtin clang support
> 
>  tools/build/Build.include          |  20 ++--
>  tools/build/Makefile.feature       | 138 +++++++++++++-------------
>  tools/build/feature/Makefile       | 120 +++++++++++++----------
>  tools/build/feature/test-clang.cpp |  21 ++++
>  tools/build/feature/test-llvm.cpp  |   8 ++
>  tools/build/fixdep.c               |   5 +-
>  tools/perf/Makefile.config         |  62 +++++++++---
>  tools/perf/Makefile.perf           |  56 +++++++----
>  tools/perf/tests/Build             |   1 +
>  tools/perf/tests/builtin-test.c    |   9 ++
>  tools/perf/tests/clang.c           |  46 +++++++++
>  tools/perf/tests/llvm.h            |   7 ++
>  tools/perf/tests/make              |   4 +-
>  tools/perf/tests/perf-hooks.c      |  14 ++-
>  tools/perf/tests/tests.h           |   3 +
>  tools/perf/util/Build              |   2 +
>  tools/perf/util/annotate.c         |   3 +
>  tools/perf/util/bpf-loader.c       |  19 +++-
>  tools/perf/util/c++/Build          |   2 +
>  tools/perf/util/c++/clang-c.h      |  43 ++++++++
>  tools/perf/util/c++/clang-test.cpp |  62 ++++++++++++
>  tools/perf/util/c++/clang.cpp      | 195 +++++++++++++++++++++++++++++++++++++
>  tools/perf/util/c++/clang.h        |  26 +++++
>  tools/perf/util/llvm-utils.c       |  76 +++++++++++----
>  tools/perf/util/llvm-utils.h       |   6 ++
>  tools/perf/util/perf-hooks.c       |  10 +-
>  tools/perf/util/perf-hooks.h       |   6 +-
>  tools/perf/util/util-cxx.h         |  26 +++++
>  28 files changed, 795 insertions(+), 195 deletions(-)
>  create mode 100644 tools/build/feature/test-clang.cpp
>  create mode 100644 tools/build/feature/test-llvm.cpp
>  create mode 100644 tools/perf/tests/clang.c
>  create mode 100644 tools/perf/util/c++/Build
>  create mode 100644 tools/perf/util/c++/clang-c.h
>  create mode 100644 tools/perf/util/c++/clang-test.cpp
>  create mode 100644 tools/perf/util/c++/clang.cpp
>  create mode 100644 tools/perf/util/c++/clang.h
>  create mode 100644 tools/perf/util/util-cxx.h
> 
>   # uname -a
>   Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>   # 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: Parse event definition strings             : Ok
>    6: PERF_RECORD_* events & perf_sample fields  : Ok
>    7: Parse perf pmu format                      : Ok
>    8: DSO data read                              : Ok
>    9: DSO data cache                             : Ok
>   10: DSO data reopen                            : Ok
>   11: Roundtrip evsel->name                      : Ok
>   12: Parse sched tracepoints fields             : Ok
>   13: syscalls:sys_enter_openat event fields     : Ok
>   14: Setup struct perf_event_attr               : Ok
>   15: Match and link multiple hists              : Ok
>   16: 'import perf' in python                    : Ok
>   17: Breakpoint overflow signal handler         : Ok
>   18: Breakpoint overflow sampling               : Ok
>   19: Number of exit events of a simple workload : Ok
>   20: Software clock events period values        : Ok
>   21: Object code reading                        : Ok
>   22: Sample parsing                             : Ok
>   23: Use a dummy software event to keep tracking: Ok
>   24: Parse with no sample_id_all bit set        : Ok
>   25: Filter hist entries                        : Ok
>   26: Lookup mmap thread                         : Ok
>   27: Share thread mg                            : Ok
>   28: Sort output of hist entries                : Ok
>   29: Cumulate child hist entries                : Ok
>   30: Track with sched_switch                    : Ok
>   31: Filter fds with revents mask in a fdarray  : Ok
>   32: Add fd to a fdarray, making it autogrow    : Ok
>   33: kmod_path__parse                           : Ok
>   34: Thread map                                 : Ok
>   35: LLVM search and compile                    :
>   35.1: Basic BPF llvm compile                    : Ok
>   35.2: kbuild searching                          : Ok
>   35.3: Compile source for BPF prologue generation: Ok
>   35.4: Compile source for BPF relocation         : Ok
>   36: Session topology                           : Ok
>   37: BPF filter                                 :
>   37.1: Basic BPF filtering                      : Ok
>   37.2: BPF prologue generation                  : Ok
>   37.3: BPF relocation checker                   : Ok
>   38: Synthesize thread map                      : Ok
>   39: Synthesize cpu map                         : Ok
>   40: Synthesize stat config                     : Ok
>   41: Synthesize stat                            : Ok
>   42: Synthesize stat round                      : Ok
>   43: Synthesize attr update                     : Ok
>   44: Event times                                : Ok
>   45: Read backward ring buffer                  : Ok
>   46: Print cpu map                              : Ok
>   47: Probe SDT events                           : Ok
>   48: is_printable_array                         : Ok
>   49: Print bitmap                               : Ok
>   50: perf hooks                                 : Ok
>   51: builtin clang support                      : Skip (not compiled in)
>   52: x86 rdpmc                                  : Ok
>   53: Convert perf time to TSC                   : Ok
>   54: DWARF unwind                               : Ok
>   55: x86 instruction decoder - new instructions : Ok
>   56: Intel cqm nmi context read                 : Skip
>   # 
>   # time dm
>    1 alpine:3.4: Ok
>    2 android-ndk:r12b-arm: Ok
>    3 archlinux:latest: Ok
>    4 centos:5: Ok
>    5 centos:6: Ok
>    6 centos:7: Ok
>    7 debian:7: Ok
>    8 debian:8: Ok
>    9 debian:experimental: Ok
>   10 fedora:20: Ok
>   11 fedora:21: Ok
>   12 fedora:22: Ok
>   13 fedora:23: Ok
>   14 fedora:24: Ok
>   15 fedora:24-x-ARC-uClibc: Ok
>   16 fedora:25: Ok
>   17 fedora:rawhide: Ok
>   18 mageia:5: Ok
>   19 opensuse:13.2: Ok
>   20 opensuse:42.1: Ok
>   21 opensuse:tumbleweed: Ok
>   22 ubuntu:12.04.5: Ok
>   23 ubuntu:14.04.4-x-linaro-arm64: Ok
>   24 ubuntu:16.04: Ok
>   25 ubuntu:16.04-x-arm: Ok
>   26 ubuntu:16.04-x-arm64: Ok
>   27 ubuntu:16.04-x-powerpc: Ok
>   28 ubuntu:16.04-x-powerpc64: Ok
>   29 ubuntu:16.04-x-powerpc64el: Ok
>   30 ubuntu:16.04-x-s390: Ok
>   31 ubuntu:16.10: Ok
>   #
>   $ make -C tools/perf build-test
>   make: Entering directory '/home/acme/git/linux/tools/perf'
>   - tarpkg: ./tests/perf-targz-src-pkg .
>            make_no_backtrace_O: make NO_BACKTRACE=1
>                 make_no_gtk2_O: make NO_GTK2=1
>                  make_static_O: make LDFLAGS=-static
>              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_perf_o_O: make perf.o
>                make_no_slang_O: make NO_SLANG=1
>          make_install_prefix_O: make install prefix=/tmp/krava
>            make_no_libpython_O: make NO_LIBPYTHON=1
>                 make_no_newt_O: make NO_NEWT=1
>                   make_debug_O: make DEBUG=1
>                    make_tags_O: make tags
>            make_no_libbionic_O: make NO_LIBBIONIC=1
>                    make_help_O: make help
>                 make_install_O: make install
>            make_no_libunwind_O: make NO_LIBUNWIND=1
>                    make_pure_O: make
>                 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_no_libperl_O: make NO_LIBPERL=1
>               make_no_libbpf_O: make NO_LIBBPF=1
>   make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
>                     make_doc_O: make doc
>             make_no_libaudit_O: make NO_LIBAUDIT=1
>               make_clean_all_O: make clean all
>         make_with_babeltrace_O: make LIBBABELTRACE=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_demangle_O: make NO_DEMANGLE=1
>               make_no_libelf_O: make NO_LIBELF=1
>             make_no_auxtrace_O: make NO_AUXTRACE=1
>        make_util_pmu_bison_o_O: make util/pmu-bison.o
>    make_install_prefix_slash_O: make install prefix=/tmp/krava/
>          make_with_clangllvm_O: make LIBCLANGLLVM=1
>   OK
>   make: Leaving directory '/home/acme/git/linux/tools/perf'
>   $

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2016-12-05 21:37 Arnaldo Carvalho de Melo
  2016-12-06  8:17 ` Ingo Molnar
  0 siblings, 1 reply; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin,
	Alexei Starovoitov, Chris Riyder, David Ahern, He Kuang,
	Jiri Olsa, Joe Stringer, Kim Phillips, linuxppc-dev,
	Markus Trippelsdorf, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Foley, Peter Zijlstra,
	Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, pi3orama,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4:

  Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08: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-20161205

for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9:

  perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

Fixes:

- Do not show a bogus target address in 'perf annotate' for targetless powerpc
  jump instructions such as 'bctr' (Ravi Bangoria)

- tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa)

- Fix building objtool with clang (Peter Foley)

Infrastructure:

- Support linking perf with clang and LLVM libraries, initially statically, but
  this limitation will be lifted and shared libraries, when available, will
  be preferred to the static build, that should, as with other features, be
  enabled explicitly (Wang Nan)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Jiri Olsa (7):
      tools build: Make fixdep parsing wait for last target
      tools build: Make the .cmd file more readable
      tools build: Move tabs to spaces where suitable
      perf tools: Move install-gtk target into rules area
      perf tools: Move python/perf.so target into rules area
      perf tools: Cleanup build directory before each test
      perf tools: Add non config targets

Peter Foley (1):
      tools build: Fix objtool build with clang

Ravi Bangoria (1):
      perf annotate: Show raw form for jump instruction with indirect target

Wang Nan (11):
      perf tools: Pass context to perf hook functions
      perf llvm: Extract helpers in llvm-utils.c
      tools build: Add feature detection for LLVM
      tools build: Add feature detection for clang
      perf build: Add clang and llvm compile and linking support
      perf clang: Add builtin clang support ant test case
      perf clang: Use real file system for #include
      perf clang: Allow passing CFLAGS to builtin clang
      perf clang: Update test case to use real BPF script
      perf clang: Support compile IR to BPF object and add testcase
      perf clang: Compile BPF script using builtin clang support

 tools/build/Build.include          |  20 ++--
 tools/build/Makefile.feature       | 138 +++++++++++++-------------
 tools/build/feature/Makefile       | 120 +++++++++++++----------
 tools/build/feature/test-clang.cpp |  21 ++++
 tools/build/feature/test-llvm.cpp  |   8 ++
 tools/build/fixdep.c               |   5 +-
 tools/perf/Makefile.config         |  62 +++++++++---
 tools/perf/Makefile.perf           |  56 +++++++----
 tools/perf/tests/Build             |   1 +
 tools/perf/tests/builtin-test.c    |   9 ++
 tools/perf/tests/clang.c           |  46 +++++++++
 tools/perf/tests/llvm.h            |   7 ++
 tools/perf/tests/make              |   4 +-
 tools/perf/tests/perf-hooks.c      |  14 ++-
 tools/perf/tests/tests.h           |   3 +
 tools/perf/util/Build              |   2 +
 tools/perf/util/annotate.c         |   3 +
 tools/perf/util/bpf-loader.c       |  19 +++-
 tools/perf/util/c++/Build          |   2 +
 tools/perf/util/c++/clang-c.h      |  43 ++++++++
 tools/perf/util/c++/clang-test.cpp |  62 ++++++++++++
 tools/perf/util/c++/clang.cpp      | 195 +++++++++++++++++++++++++++++++++++++
 tools/perf/util/c++/clang.h        |  26 +++++
 tools/perf/util/llvm-utils.c       |  76 +++++++++++----
 tools/perf/util/llvm-utils.h       |   6 ++
 tools/perf/util/perf-hooks.c       |  10 +-
 tools/perf/util/perf-hooks.h       |   6 +-
 tools/perf/util/util-cxx.h         |  26 +++++
 28 files changed, 795 insertions(+), 195 deletions(-)
 create mode 100644 tools/build/feature/test-clang.cpp
 create mode 100644 tools/build/feature/test-llvm.cpp
 create mode 100644 tools/perf/tests/clang.c
 create mode 100644 tools/perf/util/c++/Build
 create mode 100644 tools/perf/util/c++/clang-c.h
 create mode 100644 tools/perf/util/c++/clang-test.cpp
 create mode 100644 tools/perf/util/c++/clang.cpp
 create mode 100644 tools/perf/util/c++/clang.h
 create mode 100644 tools/perf/util/util-cxx.h

  # uname -a
  Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  # 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: Parse event definition strings             : Ok
   6: PERF_RECORD_* events & perf_sample fields  : Ok
   7: Parse perf pmu format                      : Ok
   8: DSO data read                              : Ok
   9: DSO data cache                             : Ok
  10: DSO data reopen                            : Ok
  11: Roundtrip evsel->name                      : Ok
  12: Parse sched tracepoints fields             : Ok
  13: syscalls:sys_enter_openat event fields     : Ok
  14: Setup struct perf_event_attr               : Ok
  15: Match and link multiple hists              : Ok
  16: 'import perf' in python                    : Ok
  17: Breakpoint overflow signal handler         : Ok
  18: Breakpoint overflow sampling               : Ok
  19: Number of exit events of a simple workload : Ok
  20: Software clock events period values        : Ok
  21: Object code reading                        : Ok
  22: Sample parsing                             : Ok
  23: Use a dummy software event to keep tracking: Ok
  24: Parse with no sample_id_all bit set        : Ok
  25: Filter hist entries                        : Ok
  26: Lookup mmap thread                         : Ok
  27: Share thread mg                            : Ok
  28: Sort output of hist entries                : Ok
  29: Cumulate child hist entries                : Ok
  30: Track with sched_switch                    : Ok
  31: Filter fds with revents mask in a fdarray  : Ok
  32: Add fd to a fdarray, making it autogrow    : Ok
  33: kmod_path__parse                           : Ok
  34: Thread map                                 : Ok
  35: LLVM search and compile                    :
  35.1: Basic BPF llvm compile                    : Ok
  35.2: kbuild searching                          : Ok
  35.3: Compile source for BPF prologue generation: Ok
  35.4: Compile source for BPF relocation         : Ok
  36: Session topology                           : Ok
  37: BPF filter                                 :
  37.1: Basic BPF filtering                      : Ok
  37.2: BPF prologue generation                  : Ok
  37.3: BPF relocation checker                   : Ok
  38: Synthesize thread map                      : Ok
  39: Synthesize cpu map                         : Ok
  40: Synthesize stat config                     : Ok
  41: Synthesize stat                            : Ok
  42: Synthesize stat round                      : Ok
  43: Synthesize attr update                     : Ok
  44: Event times                                : Ok
  45: Read backward ring buffer                  : Ok
  46: Print cpu map                              : Ok
  47: Probe SDT events                           : Ok
  48: is_printable_array                         : Ok
  49: Print bitmap                               : Ok
  50: perf hooks                                 : Ok
  51: builtin clang support                      : Skip (not compiled in)
  52: x86 rdpmc                                  : Ok
  53: Convert perf time to TSC                   : Ok
  54: DWARF unwind                               : Ok
  55: x86 instruction decoder - new instructions : Ok
  56: Intel cqm nmi context read                 : Skip
  # 
  # time dm
   1 alpine:3.4: Ok
   2 android-ndk:r12b-arm: Ok
   3 archlinux:latest: Ok
   4 centos:5: Ok
   5 centos:6: Ok
   6 centos:7: Ok
   7 debian:7: Ok
   8 debian:8: Ok
   9 debian:experimental: Ok
  10 fedora:20: Ok
  11 fedora:21: Ok
  12 fedora:22: Ok
  13 fedora:23: Ok
  14 fedora:24: Ok
  15 fedora:24-x-ARC-uClibc: Ok
  16 fedora:25: Ok
  17 fedora:rawhide: Ok
  18 mageia:5: Ok
  19 opensuse:13.2: Ok
  20 opensuse:42.1: Ok
  21 opensuse:tumbleweed: Ok
  22 ubuntu:12.04.5: Ok
  23 ubuntu:14.04.4-x-linaro-arm64: Ok
  24 ubuntu:16.04: Ok
  25 ubuntu:16.04-x-arm: Ok
  26 ubuntu:16.04-x-arm64: Ok
  27 ubuntu:16.04-x-powerpc: Ok
  28 ubuntu:16.04-x-powerpc64: Ok
  29 ubuntu:16.04-x-powerpc64el: Ok
  30 ubuntu:16.04-x-s390: Ok
  31 ubuntu:16.10: Ok
  #
  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
           make_no_backtrace_O: make NO_BACKTRACE=1
                make_no_gtk2_O: make NO_GTK2=1
                 make_static_O: make LDFLAGS=-static
             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_perf_o_O: make perf.o
               make_no_slang_O: make NO_SLANG=1
         make_install_prefix_O: make install prefix=/tmp/krava
           make_no_libpython_O: make NO_LIBPYTHON=1
                make_no_newt_O: make NO_NEWT=1
                  make_debug_O: make DEBUG=1
                   make_tags_O: make tags
           make_no_libbionic_O: make NO_LIBBIONIC=1
                   make_help_O: make help
                make_install_O: make install
           make_no_libunwind_O: make NO_LIBUNWIND=1
                   make_pure_O: make
                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_no_libperl_O: make NO_LIBPERL=1
              make_no_libbpf_O: make NO_LIBBPF=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
                    make_doc_O: make doc
            make_no_libaudit_O: make NO_LIBAUDIT=1
              make_clean_all_O: make clean all
        make_with_babeltrace_O: make LIBBABELTRACE=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_demangle_O: make NO_DEMANGLE=1
              make_no_libelf_O: make NO_LIBELF=1
            make_no_auxtrace_O: make NO_AUXTRACE=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
         make_with_clangllvm_O: make LIBCLANGLLVM=1
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-10 14:03   ` Arnaldo Carvalho de Melo
@ 2015-03-10 14:37     ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2015-03-10 14:37 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Peter Zijlstra, Stephane Eranian,
	Suzuki K . Poulose, Thomas Gleixner


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

> Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu:
> > So I got this error today:
> > 
> >   ┌─Warning:───────────────────────────┐
> >   │The vmlinux file can't be used.     │
> >   │Kernel samples will not be resolved.│
> >   │                                    │
> >   │                                    │
> >   │Press any key...                    │
> >   └────────────────────────────────────┘
> > 
> > ... and sadly perf is being passive-aggressive again: being negative 
> > but refusing to say why! :-)
> 
> > Is there a way to figure out why it did not like the vmlinux?
> 
> I'll check and improve the message.
> 
> But you must've noticed that perf is going to a therapist, aka 
> improving error messages... ;-)

Absolutely! ;-)

Also, on the positive side, today I was able to build and run perf on 
ancient user-space: a Fedora Core 6 installation, with very few hacks 
(see the attached hacks).

The HAVE_NEW_FLAX hack results in a non-working -e option.

Thanks,

	Ingo

Index: tip/tools/perf/util/parse-events.c
===================================================================
--- tip.orig/tools/perf/util/parse-events.c
+++ tip/tools/perf/util/parse-events.c
@@ -968,6 +968,13 @@ perf_pmu__parse_check(const char *name)
 	return r ? r->type : PMU_EVENT_SYMBOL_ERR;
 }
 
+#ifndef HAVE_NEW_FLEX
+static int parse_events_lex_init_extra(int start_token __maybe_unused, void **scanner __maybe_unused)
+{
+	return -1;
+}
+#endif
+
 static int parse_events__scanner(const char *str, void *data, int start_token)
 {
 	YY_BUFFER_STATE buffer;
Index: tip/tools/perf/util/symbol-elf.c
===================================================================
--- tip.orig/tools/perf/util/symbol-elf.c
+++ tip/tools/perf/util/symbol-elf.c
@@ -53,6 +53,13 @@ static int elf_getphdrnum(Elf *elf, size
 }
 #endif
 
+#ifndef HAVE_ELF_GETPHDRNUM
+static int elf_getphdrnum (Elf *__elf __maybe_unused, size_t *__dst __maybe_unused)
+{
+	return 1;
+}
+#endif
+
 #ifndef NT_GNU_BUILD_ID
 #define NT_GNU_BUILD_ID 3
 #endif

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-10 10:03 ` Ingo Molnar
@ 2015-03-10 14:03   ` Arnaldo Carvalho de Melo
  2015-03-10 14:37     ` Ingo Molnar
  0 siblings, 1 reply; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-10 14:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Peter Zijlstra, Stephane Eranian,
	Suzuki K . Poulose, Thomas Gleixner

Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu:
> So I got this error today:
> 
>   ┌─Warning:───────────────────────────┐
>   │The vmlinux file can't be used.     │
>   │Kernel samples will not be resolved.│
>   │                                    │
>   │                                    │
>   │Press any key...                    │
>   └────────────────────────────────────┘
> 
> ... and sadly perf is being passive-aggressive again: being negative 
> but refusing to say why! :-)

> Is there a way to figure out why it did not like the vmlinux?

I'll check and improve the message.

But you must've noticed that perf is going to a therapist, aka improving
error messages... ;-)

- Arnaldo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-03  3:25 Arnaldo Carvalho de Melo
  2015-03-03  6:20 ` Ingo Molnar
@ 2015-03-10 10:03 ` Ingo Molnar
  2015-03-10 14:03   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 43+ messages in thread
From: Ingo Molnar @ 2015-03-10 10:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
	David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
	H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
	Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
	Arnaldo Carvalho de Melo


So I got this error today:


                                                                  ┌─Warning:───────────────────────────┐
                                                                  │The vmlinux file can't be used.     │
                                                                  │Kernel samples will not be resolved.│
                                                                  │                                    │
                                                                  │                                    │
                                                                  │Press any key...                    │
                                                                  └────────────────────────────────────┘

... and sadly perf is being passive-aggressive again: being negative 
but refusing to say why! :-)

Is there a way to figure out why it did not like the vmlinux?

Thanks,

	Ingo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-03  3:25 Arnaldo Carvalho de Melo
@ 2015-03-03  6:20 ` Ingo Molnar
  2015-03-10 10:03 ` Ingo Molnar
  1 sibling, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2015-03-03  6:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
	David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
	H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
	Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	This one has the thread reference counting, that I tested using 'perf probe':
> 
>   perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid'
>   perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid'
>   perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid'
>   perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top
> 
> 	with that I checked and in the end the refcount reaches zero and
> thread__delete is called, as expected, using 'perf script', looking at the
> callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to
> work.
> 
> 	David, Namhyung, please holler if you find something fishy with this
> thread refcnt stuff, as it is something that is related to previous/current
> work by you guys,
> 
> 	Ah, I also merged perf/urgent so that it is buildable in more systems.o
> 
> 	There is also the revert for that is_power_of_2 "simplification" in perf_mmap,
> that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry
> about that one, should have caught that :-\
> 
> 	Please consider pulling,
> 
> - Arnaldo
> The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301:
> 
>   Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -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
> 
> for you to fetch changes up to ae536acfacb65a4a9858c32b12361e09f84f4157:
> 
>   perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)
> 
> - 'perf record' Documentation fixes (Namhyung Kim)
> 
> - Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)
> 
> Infrastructure:
> 
> - Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)
> 
> - Reference count struct thread (Arnaldo Carvalho de Melo)
> 
> - No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)
> 
> - Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter)
> 
> - Only include tsc file for x86 (David Ahern)
> 
> - Compare JOBS to 0 after grep (David Ahern)
> 
> - Improve feature detection messages (Ingo Molnar)
> 
> - Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)
> 
> - Remove bias offset to find probe point by address (Masami Hiramatsu)
> 
> - Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (1):
>       perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test
> 
> Arnaldo Carvalho de Melo (3):
>       perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads
>       perf tools: Reference count struct thread
>       perf sched: No need to keep the session around
> 
> David Ahern (2):
>       perf tools: Only include tsc file for x86
>       perf tools: Compare JOBS to 0 after grep
> 
> Ingo Molnar (7):
>       perf tools: Add PERF-FEATURES to the .gitignore file
>       perf tools: Remove annoying extra message from the features build
>       perf tools: Improve Python feature detection messages
>       perf tools: Improve libperl detection message
>       perf tools: Improve libbfd detection message
>       perf tools: Improve feature test debuggability
>       perf tools: Improve 'libbabel' feature check failure message
> 
> Kan Liang (1):
>       Revert "perf: Remove the extra validity check on nr_pages"
> 
> Masami Hiramatsu (2):
>       perf probe: Warn if given uprobe event accesses memory on older kernel
>       perf probe: Remove bias offset to find probe point by address
> 
> Namhyung Kim (3):
>       perf tools: Fix build error on ARCH=i386/x86_64/sparc64
>       perf record: Get rid of -l option from Documentation
>       perf record: Document --group option
> 
> Suzuki K. Poulose (1):
>       perf stat: Report unsupported events properly
> 
>  kernel/events/core.c                               |  2 +-
>  tools/perf/.gitignore                              |  1 +
>  tools/perf/Documentation/perf-record.txt           | 12 ++++--
>  tools/perf/Makefile                                |  2 +-
>  tools/perf/builtin-sched.c                         | 26 +++++--------
>  tools/perf/builtin-stat.c                          |  5 ++-
>  tools/perf/builtin-trace.c                         |  7 +++-
>  tools/perf/config/Makefile                         | 17 ++++-----
>  tools/perf/config/Makefile.arch                    | 27 +++----------
>  tools/perf/config/feature-checks/Makefile          | 16 ++++----
>  .../test-pthread-attr-setaffinity-np.c             |  4 +-
>  tools/perf/config/utilities.mak                    |  3 +-
>  tools/perf/ui/browsers/hists.c                     |  6 +--
>  tools/perf/util/Build                              |  2 +-
>  tools/perf/util/build-id.c                         |  5 ++-
>  tools/perf/util/event.c                            | 34 ++++++++++++-----
>  tools/perf/util/hist.c                             |  2 +
>  tools/perf/util/hist.h                             |  2 +-
>  tools/perf/util/machine.c                          | 44 +++++++++++-----------
>  tools/perf/util/machine.h                          |  1 -
>  tools/perf/util/probe-event.c                      | 23 +++++++++++
>  tools/perf/util/probe-finder.c                     |  5 +--
>  tools/perf/util/session.c                          |  6 ---
>  tools/perf/util/thread.c                           | 14 +++++++
>  tools/perf/util/thread.h                           | 13 +++++++
>  25 files changed, 164 insertions(+), 115 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2015-03-03  3:25 Arnaldo Carvalho de Melo
  2015-03-03  6:20 ` Ingo Molnar
  2015-03-10 10:03 ` Ingo Molnar
  0 siblings, 2 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-03  3:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Peter Zijlstra, Stephane Eranian,
	Suzuki K . Poulose, Thomas Gleixner, Arnaldo Carvalho de Melo

Hi Ingo,

	This one has the thread reference counting, that I tested using 'perf probe':

  perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid'
  perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid'
  perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid'
  perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top

	with that I checked and in the end the refcount reaches zero and
thread__delete is called, as expected, using 'perf script', looking at the
callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to
work.

	David, Namhyung, please holler if you find something fishy with this
thread refcnt stuff, as it is something that is related to previous/current
work by you guys,

	Ah, I also merged perf/urgent so that it is buildable in more systems.o

	There is also the revert for that is_power_of_2 "simplification" in perf_mmap,
that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry
about that one, should have caught that :-\

	Please consider pulling,

- Arnaldo
The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301:

  Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -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

for you to fetch changes up to ae536acfacb65a4a9858c32b12361e09f84f4157:

  perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)

- 'perf record' Documentation fixes (Namhyung Kim)

- Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)

Infrastructure:

- Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)

- Reference count struct thread (Arnaldo Carvalho de Melo)

- No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)

- Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter)

- Only include tsc file for x86 (David Ahern)

- Compare JOBS to 0 after grep (David Ahern)

- Improve feature detection messages (Ingo Molnar)

- Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)

- Remove bias offset to find probe point by address (Masami Hiramatsu)

- Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (1):
      perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test

Arnaldo Carvalho de Melo (3):
      perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads
      perf tools: Reference count struct thread
      perf sched: No need to keep the session around

David Ahern (2):
      perf tools: Only include tsc file for x86
      perf tools: Compare JOBS to 0 after grep

Ingo Molnar (7):
      perf tools: Add PERF-FEATURES to the .gitignore file
      perf tools: Remove annoying extra message from the features build
      perf tools: Improve Python feature detection messages
      perf tools: Improve libperl detection message
      perf tools: Improve libbfd detection message
      perf tools: Improve feature test debuggability
      perf tools: Improve 'libbabel' feature check failure message

Kan Liang (1):
      Revert "perf: Remove the extra validity check on nr_pages"

Masami Hiramatsu (2):
      perf probe: Warn if given uprobe event accesses memory on older kernel
      perf probe: Remove bias offset to find probe point by address

Namhyung Kim (3):
      perf tools: Fix build error on ARCH=i386/x86_64/sparc64
      perf record: Get rid of -l option from Documentation
      perf record: Document --group option

Suzuki K. Poulose (1):
      perf stat: Report unsupported events properly

 kernel/events/core.c                               |  2 +-
 tools/perf/.gitignore                              |  1 +
 tools/perf/Documentation/perf-record.txt           | 12 ++++--
 tools/perf/Makefile                                |  2 +-
 tools/perf/builtin-sched.c                         | 26 +++++--------
 tools/perf/builtin-stat.c                          |  5 ++-
 tools/perf/builtin-trace.c                         |  7 +++-
 tools/perf/config/Makefile                         | 17 ++++-----
 tools/perf/config/Makefile.arch                    | 27 +++----------
 tools/perf/config/feature-checks/Makefile          | 16 ++++----
 .../test-pthread-attr-setaffinity-np.c             |  4 +-
 tools/perf/config/utilities.mak                    |  3 +-
 tools/perf/ui/browsers/hists.c                     |  6 +--
 tools/perf/util/Build                              |  2 +-
 tools/perf/util/build-id.c                         |  5 ++-
 tools/perf/util/event.c                            | 34 ++++++++++++-----
 tools/perf/util/hist.c                             |  2 +
 tools/perf/util/hist.h                             |  2 +-
 tools/perf/util/machine.c                          | 44 +++++++++++-----------
 tools/perf/util/machine.h                          |  1 -
 tools/perf/util/probe-event.c                      | 23 +++++++++++
 tools/perf/util/probe-finder.c                     |  5 +--
 tools/perf/util/session.c                          |  6 ---
 tools/perf/util/thread.c                           | 14 +++++++
 tools/perf/util/thread.h                           | 13 +++++++
 25 files changed, 164 insertions(+), 115 deletions(-)

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2014-09-17 21:24 ` Arnaldo Carvalho de Melo
@ 2014-09-19  5:15   ` Ingo Molnar
  -1 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2014-09-19  5:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Yarygin, Anton Blanchard,
	Avi Kivity, Chanho Park, Christian Borntraeger, Corey Ashford,
	David Ahern, david lerner, Don Zickus, Frederic Weisbecker,
	Jean Pihet, Jiri Olsa, John Spencer, Kyle McMartin,
	linux-perf-users, Masami Hiramatsu, Michael Ellerman,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:
> 
>   perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +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
> 
> for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:
> 
>   perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> o Add +field argument support for --sort option (Jiri Olsa)
> 
> o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)
> 
> o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)
> 
> o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)
> 
> o Disable kernel symbol demangling by default (Avi Kivity)
> 
> Infrastructure:
> 
> o More intel PT prep work, from Adrian Hunter, including:
> 
>   - Let a user specify a PMU event without any config terms
>   - Add perf-with-kcore script
>   - Let default config be defined for a PMU
>   - Add perf_pmu__scan_file()
> 
> o "perf kvm stat report" improvements by Alexander Yarygin:
>   o  Save pid string in opts.target.pid
>   o  Enable the target.system_wide flag
>   o  Unify the title bar output
> 
> o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)
> 
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
> 
> o Fix build on ARM (Stephane Eranian)
> 
> o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)
> 
> o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)
> 
> o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)
> 
> Chanho Park (1):
>   perf tools: define _DEFAULT_SOURCE for glibc_2.20
> 
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
> 
> o Fix GNU-only grep usage in Makefile (John Spencer)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (4):
>       perf tools: Let a user specify a PMU event without any config terms
>       perf tools: Add perf-with-kcore script
>       perf tools: Let default config be defined for a PMU
>       perf tools: Add perf_pmu__scan_file()
> 
> Alexander Yarygin (3):
>       perf kvm stat report: Save pid string in opts.target.pid
>       perf kvm stat report: Enable the target.system_wide flag
>       perf kvm stat report: Unify the title bar output
> 
> Anton Blanchard (3):
>       perf tools powerpc: Fix build issue when DWARF support is disabled
>       perf symbols: Ignore stripped vmlinux and fallback to kallsyms
>       perf symbols: Add path to Ubuntu kernel debuginfo file
> 
> Arnaldo Carvalho de Melo (2):
>       perf tools: Don't include sys/poll.h directly
>       perf record: Use ring buffer consume method to look like other tools
> 
> Avi Kivity (1):
>       perf tools: Disable kernel symbol demangling by default
> 
> Chanho Park (1):
>       perf tools: define _DEFAULT_SOURCE for glibc_2.20
> 
> Jiri Olsa (2):
>       perf tools: Add +field argument support for --sort option
>       perf tools: Allow to specify lib compile variable for spec usage
> 
> John Spencer (1):
>       perf tools: Fix GNU-only grep usage in Makefile
> 
> Masami Hiramatsu (2):
>       perf probe: Do not access kallsyms when analyzing user binaries
>       perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name
> 
> Stephane Eranian (1):
>       perf tool: fix compilation for ARM
> 
>  tools/perf/.gitignore                       |   1 +
>  tools/perf/Documentation/perf-probe.txt     |   3 +
>  tools/perf/Documentation/perf-report.txt    |   3 +
>  tools/perf/Documentation/perf-top.txt       |   3 +
>  tools/perf/Makefile.perf                    |   5 +-
>  tools/perf/arch/arm/tests/dwarf-unwind.c    |   1 +
>  tools/perf/arch/arm/util/unwind-libunwind.c |   1 +
>  tools/perf/arch/powerpc/Makefile            |   2 +-
>  tools/perf/bench/sched-messaging.c          |   2 +-
>  tools/perf/builtin-kvm.c                    |  23 +--
>  tools/perf/builtin-probe.c                  |   5 +-
>  tools/perf/builtin-record.c                 |   8 +-
>  tools/perf/builtin-report.c                 |   2 +
>  tools/perf/builtin-top.c                    |   4 +-
>  tools/perf/config/Makefile                  |  12 +-
>  tools/perf/config/utilities.mak             |   2 +-
>  tools/perf/perf-with-kcore.sh               | 259 ++++++++++++++++++++++++++++
>  tools/perf/tests/pmu.c                      |   2 +-
>  tools/perf/util/kvm-stat.h                  |   1 -
>  tools/perf/util/parse-events.c              |  13 +-
>  tools/perf/util/parse-events.y              |  10 ++
>  tools/perf/util/pmu.c                       |  79 +++++++--
>  tools/perf/util/pmu.h                       |  12 +-
>  tools/perf/util/probe-event.c               |   9 +-
>  tools/perf/util/probe-event.h               |   3 +-
>  tools/perf/util/probe-finder.c              |  16 +-
>  tools/perf/util/sort.c                      |  37 +++-
>  tools/perf/util/symbol-elf.c                |  15 +-
>  tools/perf/util/symbol.c                    |   9 +-
>  tools/perf/util/symbol.h                    |   1 +
>  tools/perf/util/util.h                      |   4 +-
>  31 files changed, 487 insertions(+), 60 deletions(-)
>  create mode 100644 tools/perf/perf-with-kcore.sh

Pulled into tip:perf/core, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
@ 2014-09-19  5:15   ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2014-09-19  5:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Yarygin, Anton Blanchard,
	Avi Kivity, Chanho Park, Christian Borntraeger, Corey Ashford,
	David Ahern, david lerner, Don Zickus, Frederic Weisbecker,
	Jean Pihet, Jiri Olsa, John Spencer, Kyle McMartin,
	linux-perf-users, Masami Hiramatsu, Michael Ellerman,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:
> 
>   perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +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
> 
> for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:
> 
>   perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> o Add +field argument support for --sort option (Jiri Olsa)
> 
> o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)
> 
> o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)
> 
> o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)
> 
> o Disable kernel symbol demangling by default (Avi Kivity)
> 
> Infrastructure:
> 
> o More intel PT prep work, from Adrian Hunter, including:
> 
>   - Let a user specify a PMU event without any config terms
>   - Add perf-with-kcore script
>   - Let default config be defined for a PMU
>   - Add perf_pmu__scan_file()
> 
> o "perf kvm stat report" improvements by Alexander Yarygin:
>   o  Save pid string in opts.target.pid
>   o  Enable the target.system_wide flag
>   o  Unify the title bar output
> 
> o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)
> 
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
> 
> o Fix build on ARM (Stephane Eranian)
> 
> o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)
> 
> o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)
> 
> o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)
> 
> Chanho Park (1):
>   perf tools: define _DEFAULT_SOURCE for glibc_2.20
> 
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
> 
> o Fix GNU-only grep usage in Makefile (John Spencer)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (4):
>       perf tools: Let a user specify a PMU event without any config terms
>       perf tools: Add perf-with-kcore script
>       perf tools: Let default config be defined for a PMU
>       perf tools: Add perf_pmu__scan_file()
> 
> Alexander Yarygin (3):
>       perf kvm stat report: Save pid string in opts.target.pid
>       perf kvm stat report: Enable the target.system_wide flag
>       perf kvm stat report: Unify the title bar output
> 
> Anton Blanchard (3):
>       perf tools powerpc: Fix build issue when DWARF support is disabled
>       perf symbols: Ignore stripped vmlinux and fallback to kallsyms
>       perf symbols: Add path to Ubuntu kernel debuginfo file
> 
> Arnaldo Carvalho de Melo (2):
>       perf tools: Don't include sys/poll.h directly
>       perf record: Use ring buffer consume method to look like other tools
> 
> Avi Kivity (1):
>       perf tools: Disable kernel symbol demangling by default
> 
> Chanho Park (1):
>       perf tools: define _DEFAULT_SOURCE for glibc_2.20
> 
> Jiri Olsa (2):
>       perf tools: Add +field argument support for --sort option
>       perf tools: Allow to specify lib compile variable for spec usage
> 
> John Spencer (1):
>       perf tools: Fix GNU-only grep usage in Makefile
> 
> Masami Hiramatsu (2):
>       perf probe: Do not access kallsyms when analyzing user binaries
>       perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name
> 
> Stephane Eranian (1):
>       perf tool: fix compilation for ARM
> 
>  tools/perf/.gitignore                       |   1 +
>  tools/perf/Documentation/perf-probe.txt     |   3 +
>  tools/perf/Documentation/perf-report.txt    |   3 +
>  tools/perf/Documentation/perf-top.txt       |   3 +
>  tools/perf/Makefile.perf                    |   5 +-
>  tools/perf/arch/arm/tests/dwarf-unwind.c    |   1 +
>  tools/perf/arch/arm/util/unwind-libunwind.c |   1 +
>  tools/perf/arch/powerpc/Makefile            |   2 +-
>  tools/perf/bench/sched-messaging.c          |   2 +-
>  tools/perf/builtin-kvm.c                    |  23 +--
>  tools/perf/builtin-probe.c                  |   5 +-
>  tools/perf/builtin-record.c                 |   8 +-
>  tools/perf/builtin-report.c                 |   2 +
>  tools/perf/builtin-top.c                    |   4 +-
>  tools/perf/config/Makefile                  |  12 +-
>  tools/perf/config/utilities.mak             |   2 +-
>  tools/perf/perf-with-kcore.sh               | 259 ++++++++++++++++++++++++++++
>  tools/perf/tests/pmu.c                      |   2 +-
>  tools/perf/util/kvm-stat.h                  |   1 -
>  tools/perf/util/parse-events.c              |  13 +-
>  tools/perf/util/parse-events.y              |  10 ++
>  tools/perf/util/pmu.c                       |  79 +++++++--
>  tools/perf/util/pmu.h                       |  12 +-
>  tools/perf/util/probe-event.c               |   9 +-
>  tools/perf/util/probe-event.h               |   3 +-
>  tools/perf/util/probe-finder.c              |  16 +-
>  tools/perf/util/sort.c                      |  37 +++-
>  tools/perf/util/symbol-elf.c                |  15 +-
>  tools/perf/util/symbol.c                    |   9 +-
>  tools/perf/util/symbol.h                    |   1 +
>  tools/perf/util/util.h                      |   4 +-
>  31 files changed, 487 insertions(+), 60 deletions(-)
>  create mode 100644 tools/perf/perf-with-kcore.sh

Pulled into tip:perf/core, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Yarygin, Anton Blanchard, Avi Kivity, Chanho Park,
	Christian Borntraeger, Corey Ashford, David Ahern, david lerner,
	Don Zickus, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	John Spencer, Kyle McMartin, linux-perf-users, Masami Hiramatsu,
	Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:

  perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +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

for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:

  perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

o Add +field argument support for --sort option (Jiri Olsa)

o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)

o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)

o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)

o Disable kernel symbol demangling by default (Avi Kivity)

Infrastructure:

o More intel PT prep work, from Adrian Hunter, including:

  - Let a user specify a PMU event without any config terms
  - Add perf-with-kcore script
  - Let default config be defined for a PMU
  - Add perf_pmu__scan_file()

o "perf kvm stat report" improvements by Alexander Yarygin:
  o  Save pid string in opts.target.pid
  o  Enable the target.system_wide flag
  o  Unify the title bar output

o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)

o Allow to specify lib compile variable for spec usage (Jiri Olsa)

o Fix build on ARM (Stephane Eranian)

o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)

o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)

o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)

Chanho Park (1):
  perf tools: define _DEFAULT_SOURCE for glibc_2.20

o Allow to specify lib compile variable for spec usage (Jiri Olsa)

o Fix GNU-only grep usage in Makefile (John Spencer)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (4):
      perf tools: Let a user specify a PMU event without any config terms
      perf tools: Add perf-with-kcore script
      perf tools: Let default config be defined for a PMU
      perf tools: Add perf_pmu__scan_file()

Alexander Yarygin (3):
      perf kvm stat report: Save pid string in opts.target.pid
      perf kvm stat report: Enable the target.system_wide flag
      perf kvm stat report: Unify the title bar output

Anton Blanchard (3):
      perf tools powerpc: Fix build issue when DWARF support is disabled
      perf symbols: Ignore stripped vmlinux and fallback to kallsyms
      perf symbols: Add path to Ubuntu kernel debuginfo file

Arnaldo Carvalho de Melo (2):
      perf tools: Don't include sys/poll.h directly
      perf record: Use ring buffer consume method to look like other tools

Avi Kivity (1):
      perf tools: Disable kernel symbol demangling by default

Chanho Park (1):
      perf tools: define _DEFAULT_SOURCE for glibc_2.20

Jiri Olsa (2):
      perf tools: Add +field argument support for --sort option
      perf tools: Allow to specify lib compile variable for spec usage

John Spencer (1):
      perf tools: Fix GNU-only grep usage in Makefile

Masami Hiramatsu (2):
      perf probe: Do not access kallsyms when analyzing user binaries
      perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name

Stephane Eranian (1):
      perf tool: fix compilation for ARM

 tools/perf/.gitignore                       |   1 +
 tools/perf/Documentation/perf-probe.txt     |   3 +
 tools/perf/Documentation/perf-report.txt    |   3 +
 tools/perf/Documentation/perf-top.txt       |   3 +
 tools/perf/Makefile.perf                    |   5 +-
 tools/perf/arch/arm/tests/dwarf-unwind.c    |   1 +
 tools/perf/arch/arm/util/unwind-libunwind.c |   1 +
 tools/perf/arch/powerpc/Makefile            |   2 +-
 tools/perf/bench/sched-messaging.c          |   2 +-
 tools/perf/builtin-kvm.c                    |  23 +--
 tools/perf/builtin-probe.c                  |   5 +-
 tools/perf/builtin-record.c                 |   8 +-
 tools/perf/builtin-report.c                 |   2 +
 tools/perf/builtin-top.c                    |   4 +-
 tools/perf/config/Makefile                  |  12 +-
 tools/perf/config/utilities.mak             |   2 +-
 tools/perf/perf-with-kcore.sh               | 259 ++++++++++++++++++++++++++++
 tools/perf/tests/pmu.c                      |   2 +-
 tools/perf/util/kvm-stat.h                  |   1 -
 tools/perf/util/parse-events.c              |  13 +-
 tools/perf/util/parse-events.y              |  10 ++
 tools/perf/util/pmu.c                       |  79 +++++++--
 tools/perf/util/pmu.h                       |  12 +-
 tools/perf/util/probe-event.c               |   9 +-
 tools/perf/util/probe-event.h               |   3 +-
 tools/perf/util/probe-finder.c              |  16 +-
 tools/perf/util/sort.c                      |  37 +++-
 tools/perf/util/symbol-elf.c                |  15 +-
 tools/perf/util/symbol.c                    |   9 +-
 tools/perf/util/symbol.h                    |   1 +
 tools/perf/util/util.h                      |   4 +-
 31 files changed, 487 insertions(+), 60 deletions(-)
 create mode 100644 tools/perf/perf-with-kcore.sh

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Yarygin, Anton Blanchard, Avi Kivity, Chanho Park,
	Christian Borntraeger, Corey Ashford, David Ahern, david lerner,
	Don Zickus, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	John Spencer, Kyle McMartin, linux-perf-users, Masami Hiramatsu,
	Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:

  perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +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

for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:

  perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

o Add +field argument support for --sort option (Jiri Olsa)

o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)

o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)

o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)

o Disable kernel symbol demangling by default (Avi Kivity)

Infrastructure:

o More intel PT prep work, from Adrian Hunter, including:

  - Let a user specify a PMU event without any config terms
  - Add perf-with-kcore script
  - Let default config be defined for a PMU
  - Add perf_pmu__scan_file()

o "perf kvm stat report" improvements by Alexander Yarygin:
  o  Save pid string in opts.target.pid
  o  Enable the target.system_wide flag
  o  Unify the title bar output

o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)

o Allow to specify lib compile variable for spec usage (Jiri Olsa)

o Fix build on ARM (Stephane Eranian)

o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)

o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)

o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)

Chanho Park (1):
  perf tools: define _DEFAULT_SOURCE for glibc_2.20

o Allow to specify lib compile variable for spec usage (Jiri Olsa)

o Fix GNU-only grep usage in Makefile (John Spencer)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (4):
      perf tools: Let a user specify a PMU event without any config terms
      perf tools: Add perf-with-kcore script
      perf tools: Let default config be defined for a PMU
      perf tools: Add perf_pmu__scan_file()

Alexander Yarygin (3):
      perf kvm stat report: Save pid string in opts.target.pid
      perf kvm stat report: Enable the target.system_wide flag
      perf kvm stat report: Unify the title bar output

Anton Blanchard (3):
      perf tools powerpc: Fix build issue when DWARF support is disabled
      perf symbols: Ignore stripped vmlinux and fallback to kallsyms
      perf symbols: Add path to Ubuntu kernel debuginfo file

Arnaldo Carvalho de Melo (2):
      perf tools: Don't include sys/poll.h directly
      perf record: Use ring buffer consume method to look like other tools

Avi Kivity (1):
      perf tools: Disable kernel symbol demangling by default

Chanho Park (1):
      perf tools: define _DEFAULT_SOURCE for glibc_2.20

Jiri Olsa (2):
      perf tools: Add +field argument support for --sort option
      perf tools: Allow to specify lib compile variable for spec usage

John Spencer (1):
      perf tools: Fix GNU-only grep usage in Makefile

Masami Hiramatsu (2):
      perf probe: Do not access kallsyms when analyzing user binaries
      perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name

Stephane Eranian (1):
      perf tool: fix compilation for ARM

 tools/perf/.gitignore                       |   1 +
 tools/perf/Documentation/perf-probe.txt     |   3 +
 tools/perf/Documentation/perf-report.txt    |   3 +
 tools/perf/Documentation/perf-top.txt       |   3 +
 tools/perf/Makefile.perf                    |   5 +-
 tools/perf/arch/arm/tests/dwarf-unwind.c    |   1 +
 tools/perf/arch/arm/util/unwind-libunwind.c |   1 +
 tools/perf/arch/powerpc/Makefile            |   2 +-
 tools/perf/bench/sched-messaging.c          |   2 +-
 tools/perf/builtin-kvm.c                    |  23 +--
 tools/perf/builtin-probe.c                  |   5 +-
 tools/perf/builtin-record.c                 |   8 +-
 tools/perf/builtin-report.c                 |   2 +
 tools/perf/builtin-top.c                    |   4 +-
 tools/perf/config/Makefile                  |  12 +-
 tools/perf/config/utilities.mak             |   2 +-
 tools/perf/perf-with-kcore.sh               | 259 ++++++++++++++++++++++++++++
 tools/perf/tests/pmu.c                      |   2 +-
 tools/perf/util/kvm-stat.h                  |   1 -
 tools/perf/util/parse-events.c              |  13 +-
 tools/perf/util/parse-events.y              |  10 ++
 tools/perf/util/pmu.c                       |  79 +++++++--
 tools/perf/util/pmu.h                       |  12 +-
 tools/perf/util/probe-event.c               |   9 +-
 tools/perf/util/probe-event.h               |   3 +-
 tools/perf/util/probe-finder.c              |  16 +-
 tools/perf/util/sort.c                      |  37 +++-
 tools/perf/util/symbol-elf.c                |  15 +-
 tools/perf/util/symbol.c                    |   9 +-
 tools/perf/util/symbol.h                    |   1 +
 tools/perf/util/util.h                      |   4 +-
 31 files changed, 487 insertions(+), 60 deletions(-)
 create mode 100644 tools/perf/perf-with-kcore.sh

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2013-12-13 15:11 Arnaldo Carvalho de Melo
@ 2013-12-16 13:54 ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2013-12-16 13:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian,
	Steven Rostedt, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> Regards,
> 
> - Arnaldo
> 
> The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63:
> 
>   perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c:
> 
>   tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Fixes:
> 
> . Fix inverted error verification bug in thread__fork, from David Ahern.
> 
> New features:
> 
> . Shell completion for 'perf kvm', from Ramkumar Ramachandra.
> 
> Refactorings:
> 
> . Get rid of panic() like calls in libtraceevent, from Namyung Kim.
> 
> . Start carving out symbol parsing routines from perf, just moving routines to
>   topic files in tools/lib/symbol/, tools that want to use it need to integrate
>   it directly, i.e. no tools/lib/symbol/Makefile is provided.
> 
> . Assorted refactoring patches, moving code around and adding
>   utility evlist methods that will be used in the IPT patchset,
>   from Adrian Hunter.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (5):
>       perf tools: Add perf_event_paranoid()
>       perf header: Allow header->data_offset to be predetermined
>       perf evlist: Add can_select_event() method
>       perf tools: Move mem_bswap32/64 to util.c
>       perf evlist: Add perf_evlist__to_front()
> 
> Arnaldo Carvalho de Melo (1):
>       tools lib symbol: Start carving out symbol parsing routines from perf
> 
> David Ahern (1):
>       perf tools: Fix inverted error verification bug in thread__fork
> 
> Namhyung Kim (12):
>       tools lib traceevent: Get rid of malloc_or_die() in show_error()
>       tools lib traceevent: Get rid of die in add_filter_type()
>       tools lib traceevent: Get rid of malloc_or_die() allocate_arg()
>       tools lib traceevent: Get rid of malloc_or_die() in read_token()
>       tools lib traceevent: Get rid of malloc_or_die() in find_event()
>       tools lib traceevent: Get rid of die() in add_right()
>       tools lib traceevent: Make add_left() return pevent_errno
>       tools lib traceevent: Get rid of die() in reparent_op_arg()
>       tools lib traceevent: Refactor create_arg_item()
>       tools lib traceevent: Refactor process_filter()
>       tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno
>       tools lib traceevent: Refactor pevent_filter_match() to get rid of die()
> 
> Ramkumar Ramachandra (1):
>       perf completion: Complete 'perf kvm'
> 
>  tools/lib/symbol/kallsyms.c         |  58 +++++
>  tools/lib/symbol/kallsyms.h         |  24 ++
>  tools/lib/traceevent/event-parse.h  |  43 ++-
>  tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++--------------
>  tools/perf/MANIFEST                 |   2 +
>  tools/perf/Makefile.perf            |   5 +
>  tools/perf/perf-completion.sh       |   4 +
>  tools/perf/util/event.c             |   1 +
>  tools/perf/util/evlist.c            |  20 +-
>  tools/perf/util/evlist.h            |   5 +
>  tools/perf/util/header.c            |   3 +-
>  tools/perf/util/machine.c           |   1 +
>  tools/perf/util/record.c            |  37 +++
>  tools/perf/util/session.c           |  21 --
>  tools/perf/util/session.h           |   2 -
>  tools/perf/util/symbol-elf.c        |   1 +
>  tools/perf/util/symbol.c            |  69 +----
>  tools/perf/util/symbol.h            |   3 -
>  tools/perf/util/thread.c            |   2 +-
>  tools/perf/util/util.c              |  41 +++
>  tools/perf/util/util.h              |   4 +
>  21 files changed, 550 insertions(+), 303 deletions(-)
>  create mode 100644 tools/lib/symbol/kallsyms.c
>  create mode 100644 tools/lib/symbol/kallsyms.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2013-12-13 15:11 Arnaldo Carvalho de Melo
  2013-12-16 13:54 ` Ingo Molnar
  0 siblings, 1 reply; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-13 15:11 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian,
	Steven Rostedt, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

Hi Ingo,

	Please consider pulling,

Regards,

- Arnaldo

The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63:

  perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c:

  tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

Fixes:

. Fix inverted error verification bug in thread__fork, from David Ahern.

New features:

. Shell completion for 'perf kvm', from Ramkumar Ramachandra.

Refactorings:

. Get rid of panic() like calls in libtraceevent, from Namyung Kim.

. Start carving out symbol parsing routines from perf, just moving routines to
  topic files in tools/lib/symbol/, tools that want to use it need to integrate
  it directly, i.e. no tools/lib/symbol/Makefile is provided.

. Assorted refactoring patches, moving code around and adding
  utility evlist methods that will be used in the IPT patchset,
  from Adrian Hunter.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (5):
      perf tools: Add perf_event_paranoid()
      perf header: Allow header->data_offset to be predetermined
      perf evlist: Add can_select_event() method
      perf tools: Move mem_bswap32/64 to util.c
      perf evlist: Add perf_evlist__to_front()

Arnaldo Carvalho de Melo (1):
      tools lib symbol: Start carving out symbol parsing routines from perf

David Ahern (1):
      perf tools: Fix inverted error verification bug in thread__fork

Namhyung Kim (12):
      tools lib traceevent: Get rid of malloc_or_die() in show_error()
      tools lib traceevent: Get rid of die in add_filter_type()
      tools lib traceevent: Get rid of malloc_or_die() allocate_arg()
      tools lib traceevent: Get rid of malloc_or_die() in read_token()
      tools lib traceevent: Get rid of malloc_or_die() in find_event()
      tools lib traceevent: Get rid of die() in add_right()
      tools lib traceevent: Make add_left() return pevent_errno
      tools lib traceevent: Get rid of die() in reparent_op_arg()
      tools lib traceevent: Refactor create_arg_item()
      tools lib traceevent: Refactor process_filter()
      tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno
      tools lib traceevent: Refactor pevent_filter_match() to get rid of die()

Ramkumar Ramachandra (1):
      perf completion: Complete 'perf kvm'

 tools/lib/symbol/kallsyms.c         |  58 +++++
 tools/lib/symbol/kallsyms.h         |  24 ++
 tools/lib/traceevent/event-parse.h  |  43 ++-
 tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++--------------
 tools/perf/MANIFEST                 |   2 +
 tools/perf/Makefile.perf            |   5 +
 tools/perf/perf-completion.sh       |   4 +
 tools/perf/util/event.c             |   1 +
 tools/perf/util/evlist.c            |  20 +-
 tools/perf/util/evlist.h            |   5 +
 tools/perf/util/header.c            |   3 +-
 tools/perf/util/machine.c           |   1 +
 tools/perf/util/record.c            |  37 +++
 tools/perf/util/session.c           |  21 --
 tools/perf/util/session.h           |   2 -
 tools/perf/util/symbol-elf.c        |   1 +
 tools/perf/util/symbol.c            |  69 +----
 tools/perf/util/symbol.h            |   3 -
 tools/perf/util/thread.c            |   2 +-
 tools/perf/util/util.c              |  41 +++
 tools/perf/util/util.h              |   4 +
 21 files changed, 550 insertions(+), 303 deletions(-)
 create mode 100644 tools/lib/symbol/kallsyms.c
 create mode 100644 tools/lib/symbol/kallsyms.h

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2012-09-11 23:52 Arnaldo Carvalho de Melo
@ 2012-09-13 15:15 ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2012-09-13 15:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David Ahern, Frederic Weisbecker, Irina Tirdea,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Pekka Enberg, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, arnaldo.melo, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> Best Regards,
> 
> - Arnaldo
> 
> The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99:
> 
>   perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes
> 
> . Remove die()/exit() calls from several tools.
> 
> . Add missing perf_regs.h file to MANIFEST
> 
> . Clean up and improve 'perf sched' performance by elliminating lots of
>   needless calls to libtraceevent.
> 
> . More patches to make perf build on Android, from Irina Tirdea
> 
> . Resolve vdso callchains, from Jiri Olsa
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (9):
>       perf test: Remove die() calls
>       perf sched: Remove die() calls
>       perf kmem: Remove die() calls
>       perf tools: Add missing perf_regs.h file to MANIFEST
>       perf sched: Remove unused thread parameter
>       perf sched: Use perf_tool as ancestor
>       perf evsel: Introduce perf_evsel__{str,int}val methods
>       perf sched: Use perf_evsel__{int,str}val
>       perf sched: Don't read all tracepoint variables in advance
> 
> Irina Tirdea (5):
>       perf tools: include wrapper for magic.h
>       perf tools: Update types definitions for Android
>       perf tools: include __WORDSIZE definition
>       perf tools: fix ALIGN redefinition in system headers
>       perf tools: Use __maybe_used for unused variables
> 
> Jiri Olsa (4):
>       perf tools: Do backtrace post unwind only if we regs and stack were captured
>       perf tools: Add memdup function
>       perf symbols: Make dsos__find function globally available
>       perf tools: Back [vdso] DSO with real data
> 
>  tools/lib/traceevent/event-parse.c                 |    8 +-
>  tools/lib/traceevent/event-parse.h                 |    4 +-
>  tools/perf/MANIFEST                                |    1 +
>  tools/perf/Makefile                                |    3 +
>  tools/perf/bench/bench.h                           |    3 +-
>  tools/perf/bench/mem-memcpy.c                      |    2 +-
>  tools/perf/bench/mem-memset.c                      |    2 +-
>  tools/perf/bench/sched-messaging.c                 |    2 +-
>  tools/perf/bench/sched-pipe.c                      |    6 +-
>  tools/perf/builtin-annotate.c                      |    2 +-
>  tools/perf/builtin-bench.c                         |    2 +-
>  tools/perf/builtin-buildid-cache.c                 |   10 +-
>  tools/perf/builtin-buildid-list.c                  |    3 +-
>  tools/perf/builtin-diff.c                          |    4 +-
>  tools/perf/builtin-evlist.c                        |    2 +-
>  tools/perf/builtin-help.c                          |    2 +-
>  tools/perf/builtin-inject.c                        |   24 +-
>  tools/perf/builtin-kmem.c                          |  130 +-
>  tools/perf/builtin-kvm.c                           |    2 +-
>  tools/perf/builtin-list.c                          |    2 +-
>  tools/perf/builtin-lock.c                          |    4 +-
>  tools/perf/builtin-probe.c                         |   24 +-
>  tools/perf/builtin-record.c                        |   10 +-
>  tools/perf/builtin-report.c                        |   11 +-
>  tools/perf/builtin-sched.c                         | 1446 +++++++++-----------
>  tools/perf/builtin-script.c                        |   29 +-
>  tools/perf/builtin-stat.c                          |   40 +-
>  tools/perf/builtin-test.c                          |   23 +-
>  tools/perf/builtin-timechart.c                     |   30 +-
>  tools/perf/builtin-top.c                           |    7 +-
>  tools/perf/ui/browser.c                            |    7 +-
>  tools/perf/ui/browsers/annotate.c                  |    6 +-
>  tools/perf/ui/gtk/browser.c                        |    5 +-
>  tools/perf/ui/gtk/setup.c                          |    2 +-
>  tools/perf/ui/gtk/util.c                           |    4 +-
>  tools/perf/ui/helpline.c                           |    2 +-
>  tools/perf/ui/helpline.h                           |    8 +-
>  tools/perf/ui/hist.c                               |   21 +-
>  tools/perf/ui/tui/setup.c                          |    4 +-
>  tools/perf/util/alias.c                            |    3 +-
>  tools/perf/util/annotate.c                         |    6 +-
>  tools/perf/util/annotate.h                         |   13 +-
>  tools/perf/util/build-id.c                         |   11 +-
>  tools/perf/util/cache.h                            |    6 +-
>  tools/perf/util/callchain.c                        |    6 +-
>  tools/perf/util/cgroup.c                           |    4 +-
>  tools/perf/util/config.c                           |    6 +-
>  tools/perf/util/debug.h                            |    9 +-
>  tools/perf/util/event.c                            |   29 +-
>  tools/perf/util/event.h                            |    2 +-
>  tools/perf/util/evsel.c                            |   35 +
>  tools/perf/util/evsel.h                            |    7 +
>  tools/perf/util/header.c                           |  177 ++-
>  tools/perf/util/header.h                           |    2 +-
>  tools/perf/util/help.c                             |    3 +-
>  tools/perf/util/hist.c                             |    2 +-
>  tools/perf/util/hist.h                             |   32 +-
>  tools/perf/util/include/linux/bitops.h             |    4 +
>  tools/perf/util/include/linux/compiler.h           |    8 +-
>  tools/perf/util/include/linux/kernel.h             |   13 +-
>  tools/perf/util/include/linux/magic.h              |   12 +
>  tools/perf/util/include/linux/string.h             |    2 +
>  tools/perf/util/include/linux/types.h              |    8 +
>  tools/perf/util/intlist.c                          |    4 +-
>  tools/perf/util/map.c                              |   12 +-
>  tools/perf/util/map.h                              |    2 +-
>  tools/perf/util/parse-events-test.c                |    6 +-
>  tools/perf/util/parse-events.c                     |    7 +-
>  tools/perf/util/parse-events.l                     |    2 +-
>  tools/perf/util/parse-events.y                     |    4 +-
>  tools/perf/util/parse-options.c                    |    3 +-
>  tools/perf/util/perf_regs.h                        |    2 +-
>  tools/perf/util/pmu.y                              |    6 +-
>  tools/perf/util/probe-event.c                      |   21 +-
>  tools/perf/util/probe-finder.c                     |    4 +-
>  tools/perf/util/python.c                           |    8 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |    8 +-
>  .../util/scripting-engines/trace-event-python.c    |   10 +-
>  tools/perf/util/session.c                          |   61 +-
>  tools/perf/util/sort.c                             |   14 +-
>  tools/perf/util/string.c                           |   18 +-
>  tools/perf/util/symbol-minimal.c                   |   28 +-
>  tools/perf/util/symbol.c                           |    6 +-
>  tools/perf/util/symbol.h                           |    8 +-
>  tools/perf/util/trace-event-parse.c                |    4 +-
>  tools/perf/util/trace-event-scripting.c            |   33 +-
>  tools/perf/util/unwind.c                           |   36 +-
>  tools/perf/util/unwind.h                           |   11 +-
>  tools/perf/util/util.h                             |    2 +-
>  tools/perf/util/vdso.c                             |  111 ++
>  tools/perf/util/vdso.h                             |   18 +
>  tools/perf/util/wrapper.c                          |    3 +-
>  92 files changed, 1518 insertions(+), 1231 deletions(-)
>  create mode 100644 tools/perf/util/include/linux/magic.h
>  create mode 100644 tools/perf/util/vdso.c
>  create mode 100644 tools/perf/util/vdso.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2012-09-11 23:52 Arnaldo Carvalho de Melo
  2012-09-13 15:15 ` Ingo Molnar
  0 siblings, 1 reply; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-09-11 23:52 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt, arnaldo.melo,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

Best Regards,

- Arnaldo

The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99:

  perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300)

----------------------------------------------------------------
perf/core improvements and fixes

. Remove die()/exit() calls from several tools.

. Add missing perf_regs.h file to MANIFEST

. Clean up and improve 'perf sched' performance by elliminating lots of
  needless calls to libtraceevent.

. More patches to make perf build on Android, from Irina Tirdea

. Resolve vdso callchains, from Jiri Olsa

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (9):
      perf test: Remove die() calls
      perf sched: Remove die() calls
      perf kmem: Remove die() calls
      perf tools: Add missing perf_regs.h file to MANIFEST
      perf sched: Remove unused thread parameter
      perf sched: Use perf_tool as ancestor
      perf evsel: Introduce perf_evsel__{str,int}val methods
      perf sched: Use perf_evsel__{int,str}val
      perf sched: Don't read all tracepoint variables in advance

Irina Tirdea (5):
      perf tools: include wrapper for magic.h
      perf tools: Update types definitions for Android
      perf tools: include __WORDSIZE definition
      perf tools: fix ALIGN redefinition in system headers
      perf tools: Use __maybe_used for unused variables

Jiri Olsa (4):
      perf tools: Do backtrace post unwind only if we regs and stack were captured
      perf tools: Add memdup function
      perf symbols: Make dsos__find function globally available
      perf tools: Back [vdso] DSO with real data

 tools/lib/traceevent/event-parse.c                 |    8 +-
 tools/lib/traceevent/event-parse.h                 |    4 +-
 tools/perf/MANIFEST                                |    1 +
 tools/perf/Makefile                                |    3 +
 tools/perf/bench/bench.h                           |    3 +-
 tools/perf/bench/mem-memcpy.c                      |    2 +-
 tools/perf/bench/mem-memset.c                      |    2 +-
 tools/perf/bench/sched-messaging.c                 |    2 +-
 tools/perf/bench/sched-pipe.c                      |    6 +-
 tools/perf/builtin-annotate.c                      |    2 +-
 tools/perf/builtin-bench.c                         |    2 +-
 tools/perf/builtin-buildid-cache.c                 |   10 +-
 tools/perf/builtin-buildid-list.c                  |    3 +-
 tools/perf/builtin-diff.c                          |    4 +-
 tools/perf/builtin-evlist.c                        |    2 +-
 tools/perf/builtin-help.c                          |    2 +-
 tools/perf/builtin-inject.c                        |   24 +-
 tools/perf/builtin-kmem.c                          |  130 +-
 tools/perf/builtin-kvm.c                           |    2 +-
 tools/perf/builtin-list.c                          |    2 +-
 tools/perf/builtin-lock.c                          |    4 +-
 tools/perf/builtin-probe.c                         |   24 +-
 tools/perf/builtin-record.c                        |   10 +-
 tools/perf/builtin-report.c                        |   11 +-
 tools/perf/builtin-sched.c                         | 1446 +++++++++-----------
 tools/perf/builtin-script.c                        |   29 +-
 tools/perf/builtin-stat.c                          |   40 +-
 tools/perf/builtin-test.c                          |   23 +-
 tools/perf/builtin-timechart.c                     |   30 +-
 tools/perf/builtin-top.c                           |    7 +-
 tools/perf/ui/browser.c                            |    7 +-
 tools/perf/ui/browsers/annotate.c                  |    6 +-
 tools/perf/ui/gtk/browser.c                        |    5 +-
 tools/perf/ui/gtk/setup.c                          |    2 +-
 tools/perf/ui/gtk/util.c                           |    4 +-
 tools/perf/ui/helpline.c                           |    2 +-
 tools/perf/ui/helpline.h                           |    8 +-
 tools/perf/ui/hist.c                               |   21 +-
 tools/perf/ui/tui/setup.c                          |    4 +-
 tools/perf/util/alias.c                            |    3 +-
 tools/perf/util/annotate.c                         |    6 +-
 tools/perf/util/annotate.h                         |   13 +-
 tools/perf/util/build-id.c                         |   11 +-
 tools/perf/util/cache.h                            |    6 +-
 tools/perf/util/callchain.c                        |    6 +-
 tools/perf/util/cgroup.c                           |    4 +-
 tools/perf/util/config.c                           |    6 +-
 tools/perf/util/debug.h                            |    9 +-
 tools/perf/util/event.c                            |   29 +-
 tools/perf/util/event.h                            |    2 +-
 tools/perf/util/evsel.c                            |   35 +
 tools/perf/util/evsel.h                            |    7 +
 tools/perf/util/header.c                           |  177 ++-
 tools/perf/util/header.h                           |    2 +-
 tools/perf/util/help.c                             |    3 +-
 tools/perf/util/hist.c                             |    2 +-
 tools/perf/util/hist.h                             |   32 +-
 tools/perf/util/include/linux/bitops.h             |    4 +
 tools/perf/util/include/linux/compiler.h           |    8 +-
 tools/perf/util/include/linux/kernel.h             |   13 +-
 tools/perf/util/include/linux/magic.h              |   12 +
 tools/perf/util/include/linux/string.h             |    2 +
 tools/perf/util/include/linux/types.h              |    8 +
 tools/perf/util/intlist.c                          |    4 +-
 tools/perf/util/map.c                              |   12 +-
 tools/perf/util/map.h                              |    2 +-
 tools/perf/util/parse-events-test.c                |    6 +-
 tools/perf/util/parse-events.c                     |    7 +-
 tools/perf/util/parse-events.l                     |    2 +-
 tools/perf/util/parse-events.y                     |    4 +-
 tools/perf/util/parse-options.c                    |    3 +-
 tools/perf/util/perf_regs.h                        |    2 +-
 tools/perf/util/pmu.y                              |    6 +-
 tools/perf/util/probe-event.c                      |   21 +-
 tools/perf/util/probe-finder.c                     |    4 +-
 tools/perf/util/python.c                           |    8 +-
 .../perf/util/scripting-engines/trace-event-perl.c |    8 +-
 .../util/scripting-engines/trace-event-python.c    |   10 +-
 tools/perf/util/session.c                          |   61 +-
 tools/perf/util/sort.c                             |   14 +-
 tools/perf/util/string.c                           |   18 +-
 tools/perf/util/symbol-minimal.c                   |   28 +-
 tools/perf/util/symbol.c                           |    6 +-
 tools/perf/util/symbol.h                           |    8 +-
 tools/perf/util/trace-event-parse.c                |    4 +-
 tools/perf/util/trace-event-scripting.c            |   33 +-
 tools/perf/util/unwind.c                           |   36 +-
 tools/perf/util/unwind.h                           |   11 +-
 tools/perf/util/util.h                             |    2 +-
 tools/perf/util/vdso.c                             |  111 ++
 tools/perf/util/vdso.h                             |   18 +
 tools/perf/util/wrapper.c                          |    3 +-
 92 files changed, 1518 insertions(+), 1231 deletions(-)
 create mode 100644 tools/perf/util/include/linux/magic.h
 create mode 100644 tools/perf/util/vdso.c
 create mode 100644 tools/perf/util/vdso.h

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2012-07-05 15:44 Arnaldo Carvalho de Melo
@ 2012-07-06  8:22 ` Ingo Molnar
  0 siblings, 0 replies; 43+ messages in thread
From: Ingo Molnar @ 2012-07-06  8:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Borislav Petkov, Corey Ashford, David Ahern,
	Frederic Weisbecker, Jiri Olsa, Johannes Berg, Namhyung Kim,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Huewe,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt, Ulrich Drepper,
	Wolfgang Mauerer, arnaldo.melo, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling, this one contains my first 
> merge, a pull request by Namhyung, please check if everything 
> is OK,
> 
> Thanks,
> 
> - Arnaldo
> 
> The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3:
> 
>   perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83:
> 
>   Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300)
> 
> ----------------------------------------------------------------
> 
> perf/core improvements and fixes:
> 
> . Preparatory patches to use hw events in PMU syntax, from Jiri Olsa
> 
> . Remaining backport of trace-cmd's libparseevent, from Namhyung Kim
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core
> 
> Jiri Olsa (4):
>       perf test: Use ARRAY_SIZE in parse events tests
>       perf tools: Add empty rule for new line in event syntax parsing
>       perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
>       perf tools: Split event symbols arrays to hw and sw parts
> 
> Namhyung Kim (10):
>       tools lib traceevent: Fix printk_cmp()
>       tools lib traceevent: Introduce extend_token()
>       tools lib traceevent: Handle strdup failure cases
>       tools lib traceevent: Handle realloc() failure path
>       tools lib traceevent: Pass string type argument to args
>       tools lib traceevent: Do not call add_event() again if allocation failed
>       tools lib traceevent: Fix some comments
>       tools lib traceevent: Check result of malloc() during reading token
>       tools lib traceevent: Check return value of arg_to_str()
>       tools lib traceevent: Cleanup realloc use
> 
> Peter Huewe (1):
>       tools lib traceevent: Add missing break in make_bprint_args
> 
> Steven Rostedt (4):
>       tools lib traceevent: Let filtering numbers by string use function names
>       tools lib traceevent: Add support for "%.*s" in bprintk events
>       tools lib traceevent: Add support to show migrate disable counter
>       tools lib traceevent: Fix %pM print format arg handling
> 
> Wolfgang Mauerer (1):
>       tools lib traceevent: Fix trace_printk for long integers
> 
>  tools/lib/traceevent/event-parse.c  |  287 +++++++++++++++++++++++------------
>  tools/lib/traceevent/parse-filter.c |   86 +++++++----
>  tools/perf/util/parse-events-test.c |   29 ++--
>  tools/perf/util/parse-events.c      |  174 ++++++++++++++-------
>  tools/perf/util/parse-events.l      |    3 +-
>  tools/perf/util/parse-events.y      |   15 +-
>  6 files changed, 391 insertions(+), 203 deletions(-)

Pulled, thanks a lot Arnaldo! The commits from Namhyung Kim are 
looking good as well.

Thanks,

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2012-07-05 15:44 Arnaldo Carvalho de Melo
  2012-07-06  8:22 ` Ingo Molnar
  0 siblings, 1 reply; 43+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-07-05 15:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Borislav Petkov,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa,
	Johannes Berg, Namhyung Kim, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Peter Huewe, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, Ulrich Drepper, Wolfgang Mauerer, arnaldo.melo,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, this one contains my first merge, a pull
request by Namhyung, please check if everything is OK,

Thanks,

- Arnaldo

The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3:

  perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83:

  Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300)

----------------------------------------------------------------

perf/core improvements and fixes:

. Preparatory patches to use hw events in PMU syntax, from Jiri Olsa

. Remaining backport of trace-cmd's libparseevent, from Namhyung Kim

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core

Jiri Olsa (4):
      perf test: Use ARRAY_SIZE in parse events tests
      perf tools: Add empty rule for new line in event syntax parsing
      perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
      perf tools: Split event symbols arrays to hw and sw parts

Namhyung Kim (10):
      tools lib traceevent: Fix printk_cmp()
      tools lib traceevent: Introduce extend_token()
      tools lib traceevent: Handle strdup failure cases
      tools lib traceevent: Handle realloc() failure path
      tools lib traceevent: Pass string type argument to args
      tools lib traceevent: Do not call add_event() again if allocation failed
      tools lib traceevent: Fix some comments
      tools lib traceevent: Check result of malloc() during reading token
      tools lib traceevent: Check return value of arg_to_str()
      tools lib traceevent: Cleanup realloc use

Peter Huewe (1):
      tools lib traceevent: Add missing break in make_bprint_args

Steven Rostedt (4):
      tools lib traceevent: Let filtering numbers by string use function names
      tools lib traceevent: Add support for "%.*s" in bprintk events
      tools lib traceevent: Add support to show migrate disable counter
      tools lib traceevent: Fix %pM print format arg handling

Wolfgang Mauerer (1):
      tools lib traceevent: Fix trace_printk for long integers

 tools/lib/traceevent/event-parse.c  |  287 +++++++++++++++++++++++------------
 tools/lib/traceevent/parse-filter.c |   86 +++++++----
 tools/perf/util/parse-events-test.c |   29 ++--
 tools/perf/util/parse-events.c      |  174 ++++++++++++++-------
 tools/perf/util/parse-events.l      |    3 +-
 tools/perf/util/parse-events.y      |   15 +-
 6 files changed, 391 insertions(+), 203 deletions(-)

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

end of thread, other threads:[~2017-03-28  5:46 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24 14:57 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-03-24 14:57 ` Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 01/20] perf probe: Change MAX_CMDLEN Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 02/20] perf probe: Return errno when not hitting any event Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 03/20] perf sdt: Add scanning of sdt probes arguments Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 04/20] perf probe: Add sdt probes arguments into the uprobe cmd string Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 05/20] perf sdt x86: Add renaming logic for rNN and other registers Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 06/20] perf annotate: More exactly grep -v of the objdump command Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 07/20] perf annotate: Add comment clarifying how the source code line is parsed Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 08/20] perf stat: Factor out callback for collecting event values Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 09/20] perf stat: Collapse identically named events Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 10/20] perf stat: Handle partially bad results with merging Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 11/20] perf tools: Factor out PMU matching in parser Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 12/20] perf pmu: Expand PMU events by prefix match Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 13/20] perf pmu: Special case uncore_ prefix Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 14/20] perf tools: Add a simple expression parser for JSON Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 15/20] perf vendor events intel: Update Intel uncore JSON event files Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 16/20] perf pmu: Support MetricExpr header in JSON event list Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 17/20] perf stat: Output JSON MetricExpr metric Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 18/20] perf list: Support printing MetricExpr with --debug Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 19/20] perf pmu: Add support for MetricName JSON attribute Arnaldo Carvalho de Melo
2017-03-24 14:57 ` [PATCH 20/20] perf list: Move extra details printing to new option Arnaldo Carvalho de Melo
2017-03-24 18:39 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
2017-03-24 18:39   ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2017-03-28  1:38 Arnaldo Carvalho de Melo
2017-03-28  5:45 ` Ingo Molnar
2016-12-05 21:37 Arnaldo Carvalho de Melo
2016-12-06  8:17 ` Ingo Molnar
2015-03-03  3:25 Arnaldo Carvalho de Melo
2015-03-03  6:20 ` Ingo Molnar
2015-03-10 10:03 ` Ingo Molnar
2015-03-10 14:03   ` Arnaldo Carvalho de Melo
2015-03-10 14:37     ` Ingo Molnar
2014-09-17 21:24 Arnaldo Carvalho de Melo
2014-09-17 21:24 ` Arnaldo Carvalho de Melo
2014-09-19  5:15 ` Ingo Molnar
2014-09-19  5:15   ` Ingo Molnar
2013-12-13 15:11 Arnaldo Carvalho de Melo
2013-12-16 13:54 ` Ingo Molnar
2012-09-11 23:52 Arnaldo Carvalho de Melo
2012-09-13 15:15 ` Ingo Molnar
2012-07-05 15:44 Arnaldo Carvalho de Melo
2012-07-06  8:22 ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.