Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578103 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2017-02-10 02:50 +0100 |
| Last post | 2017-02-10 09:20 +0100 |
| Articles | 20 on this page of 35 — 3 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/32] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 02:50 +0100
[PATCH 17/32] perf vendor events intel: Add uncore events for Haswell Server processor Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 26/32] tools strfilter: Use __fallthrough Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 27/32] perf top: Use __fallthrough Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 21/32] perf vendor events intel: Add uncore events for Xeon Phi (Knights Landing) Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 28/32] perf thread_map: Correctly size buffer used with dirent->dt_name Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 15/32] tools lib traceevent: Robustify do_generate_dynamic_list_file Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 25/32] tools string: Use __fallthrough in perf_atoll() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 10/32] perf probe: Add option --symfs Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:10 +0100
[PATCH 04/32] perf jevents: Add support for parsing uncore json files Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:40 +0100
[PATCH 06/32] perf pmu: Support event aliases for non cpu// pmus Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:40 +0100
[PATCH 07/32] perf list: Add debug support for outputing alias string Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:40 +0100
[PATCH 08/32] perf sdt: Show proper hint when event not yet in place via 'perf probe' Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:40 +0100
[PATCH 01/32] perf tools arm64: Add support for generating bpf prologue Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:40 +0100
[PATCH 24/32] tools include: Add a __fallthrough statement Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
Re: [PATCH 24/32] tools include: Add a __fallthrough statement Joe Perches <joe@perches.com> - 2017-02-10 04:10 +0100
Re: [PATCH 24/32] tools include: Add a __fallthrough statement Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 15:50 +0100
[PATCH] compiler/compiler-gcc: Add __fallthrough Joe Perches <joe@perches.com> - 2017-02-10 19:00 +0100
Re: [PATCH] compiler/compiler-gcc: Add __fallthrough Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 19:20 +0100
Re: [PATCH] compiler/compiler-gcc: Add __fallthrough Joe Perches <joe@perches.com> - 2017-02-10 20:00 +0100
[PATCH 03/32] perf jevents: Parse eventcode as number Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 05/32] perf pmu: Support per pmu json aliases Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 32/32] perf intel-pt: Use __fallthrough Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 20/32] perf vendor events intel: Add uncore events for Sandy Bridge Server Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 11/32] perf tools: Only increase index if perf_evsel__new_idx() succeeds Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 12/32] perf tools: Add missing check for failure in a zalloc() call Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 13/32] perf tools: Use zfree() instead of ad hoc equivalent Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 14/32] perf tools: Use zfree() to avoid keeping dangling pointers Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 02/32] perf bpf: Add missing newline in debug messages Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 22/32] perf vendor events intel: Add uncore events for Broadwell DE Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 29/32] perf header: Fix handling of PERF_EVENT_UPDATE__SCALE Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 18/32] perf vendor events intel: Add uncore events for Broadwell Server Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 03:50 +0100
[PATCH 30/32] perf bench numa: Avoid possible truncation when using snprintf() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 04:10 +0100
[PATCH 19/32] perf vendor events intel: Add uncore events for IvyBridge Server Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-10 04:50 +0100
Re: [GIT PULL 00/32] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2017-02-10 09:20 +0100
Page 1 of 2 [1] 2 Next page →
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 02:50 +0100 |
| Subject | [GIT PULL 00/32] perf/core improvements and fixes |
| Message-ID | <t98vv-5lK-3@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit 53e74a112ce5c1c9b6a6923bdd6612133625d579:
Merge tag 'perf-urgent-for-mingo-4.10-20170203' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2017-02-03 20:42:30 +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.11-20170209
for you to fetch changes up to 7ea6856d6f5629d742edc23b8b76e6263371ef45:
perf intel-pt: Use __fallthrough (2017-02-09 16:32:03 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Add support for parsing Intel uncore vendor event files and add uncore
vendor events for the Intel server processors (Haswell, Broadwell,
IvyBridge), Xeon Phi (Knights Landing) and Broadwell DE (Andi Kleen)
- Support --symfs in 'perf probe' (Uwe Kleine-König)
- Add support for generating bpf prologue on the aarch64 architecture (He Kuang)
- Show proper hint when SDT event not yet in place via 'perf probe' (Ravi Bangoria)
- Take into account symfs setting when reading file build ID (Victor Kamensky)
Infrastructure:
- Map gcc7's '__attribute__ ((fallthrough))', that warns when code
associated to case blocks in switches continue into the next case entry,
to '__falltrough' and use it where warned by gcc, tested on Fedora Rawhide
(Arnaldo Carvalho de Melo)
- Fix buffer sizes used with snprintf that could lead to truncation,
another warning introduced in gcc7 (Arnaldo Carvalho de Melo)
- Robustify do_generate_dynamic_list_file in libtraceevent (David Carrillo-Cisneros)
- Use zfree() in more places (Taeung Song)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Andi Kleen (11):
perf jevents: Parse eventcode as number
perf jevents: Add support for parsing uncore json files
perf pmu: Support per pmu json aliases
perf pmu: Support event aliases for non cpu// pmus
perf list: Add debug support for outputing alias string
perf vendor events intel: Add uncore events for Haswell Server processor
perf vendor events intel: Add uncore events for Broadwell Server
perf vendor events intel: Add uncore events for IvyBridge Server
perf vendor events intel: Add uncore events for Sandy Bridge Server
perf vendor events intel: Add uncore events for Xeon Phi (Knights Landing)
perf vendor events intel: Add uncore events for Broadwell DE
Arnaldo Carvalho de Melo (11):
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
perf tools: Fix include of linux/mman.h
tools include: Add a __fallthrough statement
tools string: Use __fallthrough in perf_atoll()
tools strfilter: Use __fallthrough
perf top: Use __fallthrough
perf thread_map: Correctly size buffer used with dirent->dt_name
perf header: Fix handling of PERF_EVENT_UPDATE__SCALE
perf bench numa: Avoid possible truncation when using snprintf()
perf tests: Avoid possible truncation with dirent->d_name + snprintf
perf intel-pt: Use __fallthrough
David Carrillo-Cisneros (1):
tools lib traceevent: Robustify do_generate_dynamic_list_file
He Kuang (2):
perf tools arm64: Add support for generating bpf prologue
perf bpf: Add missing newline in debug messages
Mickaël Salaün (1):
tools lib bpf: Add missing header to the library
Ravi Bangoria (1):
perf sdt: Show proper hint when event not yet in place via 'perf probe'
Taeung Song (4):
perf tools: Only increase index if perf_evsel__new_idx() succeeds
perf tools: Add missing check for failure in a zalloc() call
perf tools: Use zfree() instead of ad hoc equivalent
perf tools: Use zfree() to avoid keeping dangling pointers
Uwe Kleine-König (1):
perf probe: Add option --symfs
Victor Kamensky (1):
perf symbols: Take into account symfs setting when reading file build ID
Makefile | 6 +-
arch/x86/events/Makefile | 13 +-
arch/x86/events/amd/Makefile | 7 +
arch/x86/events/amd/uncore.c | 204 ++++++++-----
arch/x86/events/intel/pt.c | 6 +
include/linux/kprobes.h | 30 +-
include/linux/perf_event.h | 2 +-
kernel/events/core.c | 223 ++++++++------
kernel/extable.c | 9 +-
kernel/kprobes.c | 73 +++--
tools/arch/arm/include/uapi/asm/kvm.h | 9 +
tools/arch/powerpc/include/uapi/asm/kvm.h | 5 +
tools/arch/x86/include/asm/cpufeatures.h | 11 +
tools/arch/x86/include/uapi/asm/vmx.h | 5 +
tools/build/Makefile.build | 10 +
tools/include/linux/compiler.h | 9 +
tools/lib/api/fs/fs.c | 16 +
tools/lib/api/fs/fs.h | 1 +
tools/lib/api/fs/tracing_path.c | 32 +-
tools/lib/bpf/bpf.h | 1 +
tools/lib/bpf/libbpf.c | 264 +++++++++++++++--
tools/lib/bpf/libbpf.h | 19 +-
tools/lib/subcmd/parse-options.h | 19 +-
tools/lib/traceevent/Makefile | 14 +-
tools/perf/Build | 5 +-
tools/perf/Documentation/perf-c2c.txt | 2 +-
tools/perf/Documentation/perf-ftrace.txt | 36 +++
tools/perf/Documentation/perf-kallsyms.txt | 24 ++
tools/perf/Documentation/perf-record.txt | 14 +-
tools/perf/Documentation/perf-sched.txt | 2 +
tools/perf/Documentation/perf-script.txt | 4 +-
tools/perf/Documentation/perf-trace.txt | 8 +-
tools/perf/Makefile.config | 6 +-
tools/perf/Makefile.perf | 1 +
tools/perf/arch/arm64/Makefile | 1 +
tools/perf/arch/arm64/include/dwarf-regs-table.h | 12 +-
tools/perf/arch/arm64/util/dwarf-regs.c | 15 +-
tools/perf/bench/numa.c | 6 +-
tools/perf/builtin-c2c.c | 3 +-
tools/perf/builtin-ftrace.c | 265 +++++++++++++++++
tools/perf/builtin-help.c | 8 +-
tools/perf/builtin-kallsyms.c | 67 +++++
tools/perf/builtin-kmem.c | 8 +-
tools/perf/builtin-list.c | 3 +
tools/perf/builtin-probe.c | 2 +
tools/perf/builtin-record.c | 158 +++++++++-
tools/perf/builtin-report.c | 4 +-
tools/perf/builtin-sched.c | 130 ++++++++-
tools/perf/builtin-script.c | 3 +-
tools/perf/builtin-top.c | 6 +-
tools/perf/builtin-trace.c | 120 ++++++--
tools/perf/builtin.h | 2 +
tools/perf/command-list.txt | 2 +
tools/perf/perf.c | 20 +-
.../arch/x86/broadwellde/uncore-cache.json | 317 ++++++++++++++++++++
.../arch/x86/broadwellde/uncore-memory.json | 83 ++++++
.../arch/x86/broadwellde/uncore-power.json | 84 ++++++
.../arch/x86/broadwellx/uncore-cache.json | 317 ++++++++++++++++++++
.../arch/x86/broadwellx/uncore-interconnect.json | 28 ++
.../arch/x86/broadwellx/uncore-memory.json | 83 ++++++
.../arch/x86/broadwellx/uncore-power.json | 84 ++++++
.../pmu-events/arch/x86/haswellx/uncore-cache.json | 317 ++++++++++++++++++++
.../arch/x86/haswellx/uncore-interconnect.json | 28 ++
.../arch/x86/haswellx/uncore-memory.json | 83 ++++++
.../pmu-events/arch/x86/haswellx/uncore-power.json | 84 ++++++
.../pmu-events/arch/x86/ivytown/uncore-cache.json | 322 +++++++++++++++++++++
.../arch/x86/ivytown/uncore-interconnect.json | 46 +++
.../pmu-events/arch/x86/ivytown/uncore-memory.json | 75 +++++
.../pmu-events/arch/x86/ivytown/uncore-power.json | 249 ++++++++++++++++
.../pmu-events/arch/x86/jaketown/uncore-cache.json | 209 +++++++++++++
.../arch/x86/jaketown/uncore-interconnect.json | 46 +++
.../arch/x86/jaketown/uncore-memory.json | 79 +++++
.../pmu-events/arch/x86/jaketown/uncore-power.json | 248 ++++++++++++++++
.../arch/x86/knightslanding/uncore-memory.json | 42 +++
tools/perf/pmu-events/jevents.c | 84 +++++-
tools/perf/pmu-events/jevents.h | 4 +-
tools/perf/pmu-events/pmu-events.h | 3 +
tools/perf/tests/Build | 1 +
tools/perf/tests/bpf.c | 42 ++-
tools/perf/tests/builtin-test.c | 4 +
tools/perf/tests/llvm.c | 2 +-
tools/perf/tests/parse-events.c | 8 +-
tools/perf/tests/tests.h | 1 +
tools/perf/tests/unit_number__scnprintf.c | 37 +++
tools/perf/ui/browsers/hists.c | 60 ++--
tools/perf/ui/setup.c | 1 +
tools/perf/util/Build | 1 +
tools/perf/util/bpf-loader.c | 4 +-
tools/perf/util/callchain.c | 16 +-
tools/perf/util/config.c | 23 +-
tools/perf/util/data-convert-bt.c | 7 +-
tools/perf/util/dso.c | 48 ++-
tools/perf/util/event.c | 2 +-
tools/perf/util/evlist.c | 12 +-
tools/perf/util/evlist.h | 2 +
tools/perf/util/header.c | 7 +-
tools/perf/util/hist.c | 4 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 5 +
.../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 2 +
tools/perf/util/intel-pt.c | 4 +-
tools/perf/util/llvm-utils.c | 4 +-
tools/perf/util/machine.c | 19 ++
tools/perf/util/machine.h | 1 +
tools/perf/util/parse-events.c | 69 +++--
tools/perf/util/parse-events.y | 35 ++-
tools/perf/util/pmu.c | 109 ++++---
tools/perf/util/pmu.h | 1 +
tools/perf/util/probe-event.c | 11 +-
.../perf/util/scripting-engines/trace-event-perl.c | 6 +-
tools/perf/util/session.c | 2 +-
tools/perf/util/strfilter.c | 1 +
tools/perf/util/string.c | 2 +
tools/perf/util/symbol.c | 6 +-
tools/perf/util/thread_map.c | 2 +-
tools/perf/util/trace-event-info.c | 71 +++--
tools/perf/util/trace-event-parse.c | 17 ++
tools/perf/util/trace-event-read.c | 77 ++++-
tools/perf/util/trace-event.h | 1 +
tools/perf/util/unwind-libunwind-local.c | 54 +++-
tools/perf/util/util.c | 15 +-
tools/perf/util/util.h | 3 +-
tools/scripts/Makefile.include | 12 +-
122 files changed, 5101 insertions(+), 550 deletions(-)
create mode 100644 arch/x86/events/amd/Makefile
create mode 100644 tools/perf/Documentation/perf-ftrace.txt
create mode 100644 tools/perf/Documentation/perf-kallsyms.txt
create mode 100644 tools/perf/builtin-ftrace.c
create mode 100644 tools/perf/builtin-kallsyms.c
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json
create mode 100644 tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
create mode 100644 tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json
create mode 100644 tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json
create mode 100644 tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json
create mode 100644 tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json
create mode 100644 tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json
create mode 100644 tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json
create mode 100644 tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json
create mode 100644 tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json
create mode 100644 tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json
create mode 100644 tools/perf/tests/unit_number__scnprintf.c
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.
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 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 debian:experimental-x-arm64: Ok
11 debian:experimental-x-mips: Ok
12 debian:experimental-x-mips64: Ok
13 debian:experimental-x-mipsel: Ok
14 fedora:20: Ok
15 fedora:21: Ok
16 fedora:22: Ok
17 fedora:23: Ok
18 fedora:24: Ok
19 fedora:24-x-ARC-uClibc: Ok
20 fedora:25: Ok
21 fedora:rawhide: Ok
22 mageia:5: Ok
23 opensuse:13.2: Ok
24 opensuse:42.1: Ok
25 opensuse:tumbleweed: Ok
26 ubuntu:12.04.5: Ok
27 ubuntu:14.04.4-x-linaro-arm64: Ok
28 ubuntu:15.10: Ok
29 ubuntu:16.04: Ok
30 ubuntu:16.04-x-arm: Ok
31 ubuntu:16.04-x-arm64: Ok
32 ubuntu:16.04-x-powerpc: Ok
33 ubuntu:16.04-x-powerpc64: Ok
34 ubuntu:16.04-x-powerpc64el: Ok
35 ubuntu:16.04-x-s390: Ok
36 ubuntu:16.10: Ok
# 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 pinning : Ok
37.3: BPF prologue generation : Ok
37.4: BPF relocation checker : Ok
38: Synthesize thread map : Ok
39: Remove thread map : Ok
40: Synthesize cpu map : Ok
41: Synthesize stat config : Ok
42: Synthesize stat : Ok
43: Synthesize stat round : Ok
44: Synthesize attr update : Ok
45: Event times : Ok
46: Read backward ring buffer : Ok
47: Print cpu map : Ok
48: Probe SDT events : Ok
49: is_printable_array : Ok
50: Print bitmap : Ok
51: perf hooks : Ok
52: builtin clang support : Skip (not compiled in)
53: unit_number__scnprintf : Ok
54: x86 rdpmc : Ok
55: Convert perf time to TSC : Ok
56: DWARF unwind : Ok
57: x86 instruction decoder - new instructions : Ok
58: 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_no_libperl_O: make NO_LIBPERL=1
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
make_perf_o_O: make perf.o
make_pure_O: make
make_install_prefix_O: make install prefix=/tmp/krava
make_no_libunwind_O: make NO_LIBUNWIND=1
make_static_O: make LDFLAGS=-static
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_help_O: make help
make_doc_O: make doc
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_tags_O: make tags
make_debug_O: make DEBUG=1
make_install_bin_O: make install-bin
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libbpf_O: make NO_LIBBPF=1
make_util_map_o_O: make util/map.o
make_no_libelf_O: make NO_LIBELF=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_gtk2_O: make NO_GTK2=1
make_clean_all_O: make clean all
make_no_newt_O: make NO_NEWT=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_install_O: make install
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_demangle_O: make NO_DEMANGLE=1
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_slang_O: make NO_SLANG=1
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 17/32] perf vendor events intel: Add uncore events for Haswell Server processor |
| Message-ID | <t98OR-5HM-3@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Andi Kleen <ak@linux.intel.com>
This is not a full uncore event list, but a short list of useful and
understandable metrics.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/n/tip-c0cix4eprbldfrx5zf60suvh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
.../pmu-events/arch/x86/haswellx/uncore-cache.json | 317 +++++++++++++++++++++
.../arch/x86/haswellx/uncore-interconnect.json | 28 ++
.../arch/x86/haswellx/uncore-memory.json | 83 ++++++
.../pmu-events/arch/x86/haswellx/uncore-power.json | 84 ++++++
4 files changed, 512 insertions(+)
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
create mode 100644 tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
new file mode 100644
index 000000000000..076459c51d4e
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
@@ -0,0 +1,317 @@
+[
+ {
+ "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
+ "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",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x34",
+ "EventName": "UNC_C_LLC_LOOKUP.ANY",
+ "Filter": "filter_state=0x1",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x11",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x37",
+ "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "LLC misses - demand and prefetch data reads - excludes LLC prefetches. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.DATA_READ",
+ "Filter": "filter_opc=0x182",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "LLC misses - Uncacheable reads (from cpu) . Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.UNCACHEABLE",
+ "Filter": "filter_opc=0x187",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "MMIO reads. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.MMIO_READ",
+ "Filter": "filter_opc=0x187,filter_nc=1",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "MMIO writes. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.MMIO_WRITE",
+ "Filter": "filter_opc=0x18f,filter_nc=1",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "LLC prefetch misses for RFO. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.RFO_LLC_PREFETCH",
+ "Filter": "filter_opc=0x190",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "LLC prefetch misses for code reads. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.CODE_LLC_PREFETCH",
+ "Filter": "filter_opc=0x191",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "LLC prefetch misses for data reads. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.DATA_LLC_PREFETCH",
+ "Filter": "filter_opc=0x192",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "LLC misses for PCIe read current. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.PCIE_READ",
+ "Filter": "filter_opc=0x19e",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "ItoM write misses (as part of fast string memcpy stores) + PCIe full line writes. Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.PCIE_WRITE",
+ "Filter": "filter_opc=0x1c8",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "PCIe write misses (full cache line). Derived from unc_c_tor_inserts.miss_opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_MISSES.PCIE_NON_SNOOP_WRITE",
+ "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "PCIe writes (partial cache line). Derived from unc_c_tor_inserts.opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE",
+ "Filter": "filter_opc=0x180,filter_tid=0x3e",
+ "PerPkg": "1",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "L2 demand and L2 prefetch code references to LLC. Derived from unc_c_tor_inserts.opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_REFERENCES.CODE_LLC_PREFETCH",
+ "Filter": "filter_opc=0x181",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "Streaming stores (full cache line). Derived from unc_c_tor_inserts.opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_REFERENCES.STREAMING_FULL",
+ "Filter": "filter_opc=0x18c",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "Streaming stores (partial cache line). Derived from unc_c_tor_inserts.opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_REFERENCES.STREAMING_PARTIAL",
+ "Filter": "filter_opc=0x18d",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "PCIe read current. Derived from unc_c_tor_inserts.opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_REFERENCES.PCIE_READ",
+ "Filter": "filter_opc=0x19e",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "PCIe write references (full cache line). Derived from unc_c_tor_inserts.opcode",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x35",
+ "EventName": "LLC_REFERENCES.PCIE_WRITE",
+ "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x1",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "Occupancy counter for LLC data reads (demand and L2 prefetch). Derived from unc_c_tor_occupancy.miss_opcode",
+ "EventCode": "0x36",
+ "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ",
+ "Filter": "filter_opc=0x182",
+ "PerPkg": "1",
+ "UMask": "0x3",
+ "Unit": "CBO"
+ },
+ {
+ "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x1",
+ "EventName": "UNC_H_REQUESTS.READS",
+ "PerPkg": "1",
+ "UMask": "0x3",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x1",
+ "EventName": "UNC_H_REQUESTS.READS_LOCAL",
+ "PerPkg": "1",
+ "UMask": "0x1",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x1",
+ "EventName": "UNC_H_REQUESTS.READS_REMOTE",
+ "PerPkg": "1",
+ "UMask": "0x2",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x1",
+ "EventName": "UNC_H_REQUESTS.WRITES",
+ "PerPkg": "1",
+ "UMask": "0xC",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x1",
+ "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
+ "PerPkg": "1",
+ "UMask": "0x4",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x1",
+ "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
+ "PerPkg": "1",
+ "UMask": "0x8",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x21",
+ "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
+ "PerPkg": "1",
+ "UMask": "0x40",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x21",
+ "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x20",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x21",
+ "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x4",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x21",
+ "EventName": "UNC_H_SNOOP_RESP.RSPS",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x2",
+ "Unit": "HA"
+ },
+ {
+ "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x21",
+ "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x8",
+ "Unit": "HA"
+ }
+]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
new file mode 100644
index 000000000000..39387f7909b2
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
@@ -0,0 +1,28 @@
+[
+ {
+ "BriefDescription": "QPI clock ticks. Derived from unc_q_clockticks",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x14",
+ "EventName": "UNC_Q_CLOCKTICKS",
+ "PerPkg": "1",
+ "Unit": "QPI LL"
+ },
+ {
+ "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",
+ "PerPkg": "1",
+ "ScaleUnit": "8Bytes",
+ "UMask": "0x2",
+ "Unit": "QPI LL"
+ },
+ {
+ "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",
+ "PerPkg": "1",
+ "ScaleUnit": "8Bytes",
+ "UMask": "0x4",
+ "Unit": "QPI LL"
+ }
+]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
new file mode 100644
index 000000000000..d17dc235f734
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
@@ -0,0 +1,83 @@
+[
+ {
+ "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",
+ "PerPkg": "1",
+ "ScaleUnit": "64Bytes",
+ "UMask": "0x3",
+ "Unit": "iMC"
+ },
+ {
+ "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",
+ "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",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x85",
+ "EventName": "UNC_M_POWER_CHANNEL_PPD",
+ "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
+ "PerPkg": "1",
+ "Unit": "iMC"
+ },
+ {
+ "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "iMC"
+ },
+ {
+ "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x43",
+ "EventName": "UNC_M_POWER_SELF_REFRESH",
+ "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
+ "PerPkg": "1",
+ "Unit": "iMC"
+ },
+ {
+ "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x2",
+ "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
+ "PerPkg": "1",
+ "UMask": "0x1",
+ "Unit": "iMC"
+ },
+ {
+ "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x2",
+ "EventName": "UNC_M_PRE_COUNT.RD",
+ "PerPkg": "1",
+ "UMask": "0x4",
+ "Unit": "iMC"
+ },
+ {
+ "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x2",
+ "EventName": "UNC_M_PRE_COUNT.WR",
+ "PerPkg": "1",
+ "UMask": "0x8",
+ "Unit": "iMC"
+ }
+]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
new file mode 100644
index 000000000000..b44d43088bbb
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
@@ -0,0 +1,84 @@
+[
+ {
+ "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
+ "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",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
+ "Counter": "0,1,2,3",
+ "EventCode": "0xA",
+ "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
+ "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
+ "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.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ },
+ {
+ "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x74",
+ "EventName": "UNC_P_FREQ_TRANS_CYCLES",
+ "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
+ "PerPkg": "1",
+ "Unit": "PCU"
+ }
+]
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 26/32] tools strfilter: Use __fallthrough |
| Message-ID | <t98OR-5HM-9@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
The implicit fall through case label here is intended, so let us inform
that to gcc >= 7:
util/strfilter.c: In function 'strfilter_node__sprint':
util/strfilter.c:270:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (len < 0)
^
util/strfilter.c:272:2: note: here
case '!':
^~~~
cc1: all warnings being treated as errors
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: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-z2dpywg7u8fim000hjfbpyfm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/strfilter.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/strfilter.c b/tools/perf/util/strfilter.c
index bcae659b6546..efb53772e0ec 100644
--- a/tools/perf/util/strfilter.c
+++ b/tools/perf/util/strfilter.c
@@ -269,6 +269,7 @@ static int strfilter_node__sprint(struct strfilter_node *node, char *buf)
len = strfilter_node__sprint_pt(node->l, buf);
if (len < 0)
return len;
+ __fallthrough;
case '!':
if (buf) {
*(buf + len++) = *node->p;
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 27/32] perf top: Use __fallthrough |
| Message-ID | <t98OR-5HM-13@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
The implicit fall through case label here is intended, so let us inform
that to gcc >= 7:
CC /tmp/build/perf/builtin-top.o
builtin-top.c: In function 'display_thread':
builtin-top.c:644:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (errno == EINTR)
^
builtin-top.c:647:3: note: here
default:
^~~~~~~
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: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-lmcfnnyx9ic0m6j0aud98p4e@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-top.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 20aef9815cd8..d90927f31ff6 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -643,7 +643,7 @@ static void *display_thread(void *arg)
case -1:
if (errno == EINTR)
continue;
- /* Fall trhu */
+ __fallthrough;
default:
c = getc(stdin);
tcsetattr(0, TCSAFLUSH, &save);
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 21/32] perf vendor events intel: Add uncore events for Xeon Phi (Knights Landing) |
| Message-ID | <t98OR-5HM-15@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Andi Kleen <ak@linux.intel.com>
Add metrics for memory and MCDRAM. Minimal metrics only for now.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/n/tip-c0cix4eprbldfrx5zf60suvh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
.../arch/x86/knightslanding/uncore-memory.json | 42 ++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json
diff --git a/tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json b/tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json
new file mode 100644
index 000000000000..e3bcd86c4f56
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json
@@ -0,0 +1,42 @@
+[
+ {
+ "BriefDescription": "ddr bandwidth read (CPU traffic only) (MB/sec). ",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x03",
+ "EventName": "UNC_M_CAS_COUNT.RD",
+ "PerPkg": "1",
+ "ScaleUnit": "6.4e-05MiB",
+ "UMask": "0x01",
+ "Unit": "imc"
+ },
+ {
+ "BriefDescription": "ddr bandwidth write (CPU traffic only) (MB/sec). ",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x03",
+ "EventName": "UNC_M_CAS_COUNT.WR",
+ "PerPkg": "1",
+ "ScaleUnit": "6.4e-05MiB",
+ "UMask": "0x02",
+ "Unit": "imc"
+ },
+ {
+ "BriefDescription": "mcdram bandwidth read (CPU traffic only) (MB/sec). ",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x01",
+ "EventName": "UNC_E_RPQ_INSERTS",
+ "PerPkg": "1",
+ "ScaleUnit": "6.4e-05MiB",
+ "UMask": "0x01",
+ "Unit": "edc_eclk"
+ },
+ {
+ "BriefDescription": "mcdram bandwidth write (CPU traffic only) (MB/sec). ",
+ "Counter": "0,1,2,3",
+ "EventCode": "0x02",
+ "EventName": "UNC_E_WPQ_INSERTS",
+ "PerPkg": "1",
+ "ScaleUnit": "6.4e-05MiB",
+ "UMask": "0x01",
+ "Unit": "edc_eclk"
+ }
+]
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 28/32] perf thread_map: Correctly size buffer used with dirent->dt_name |
| Message-ID | <t98OS-5HM-17@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
The size of dirent->dt_name is NAME_MAX + 1, but the size for the 'path'
buffer is hard coded at 256, which may truncate it because we also
prepend "/proc/", so that all that into account and thank gcc 7 for this
warning:
/git/linux/tools/perf/util/thread_map.c: In function 'thread_map__new_by_uid':
/git/linux/tools/perf/util/thread_map.c:119:39: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 250 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "/proc/%s", dirent->d_name);
^~
In file included from /usr/include/stdio.h:939:0,
from /git/linux/tools/perf/util/thread_map.c:5:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 7 and 262 bytes into a destination of size 256
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-csy0r8zrvz5efccgd4k12c82@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/thread_map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index f9eab200fd75..7c3fcc538a70 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -93,7 +93,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
{
DIR *proc;
int max_threads = 32, items, i;
- char path[256];
+ char path[NAME_MAX + 1 + 6];
struct dirent *dirent, **namelist = NULL;
struct thread_map *threads = thread_map__alloc(max_threads);
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 15/32] tools lib traceevent: Robustify do_generate_dynamic_list_file |
| Message-ID | <t98OS-5HM-19@gated-at.bofh.it> |
| In reply to | #1578103 |
From: David Carrillo-Cisneros <davidcc@google.com>
The dynamic-list-file used to export dynamic symbols introduced in
commit e3d09ec8126f ("tools lib traceevent: Export dynamic symbols
used by traceevent plugins")
is generated without any sort of error checking.
I experienced problems due to an old version of nm (v 0.158) that outputs
in a format distinct from the assumed by the script.
Robustify the built of dynamic symbol list by enforcing that the second
column of $(NM) -u <files> is either "U" (Undefined), "W" or "w" (undefined
weak), which are the possible outputs from non-ancient $(NM) versions.
Print an error if format is unexpected.
v2: Accept "W" and "w" symbol options.
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michal Marek <mmarek@suse.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170208052840.112182-1-davidcc@google.com
[ Use STRING1 = STRING1 instead of == to make this work on Ubuntu systems ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/Makefile | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 2616c66e10c1..47076b15eebe 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -257,10 +257,16 @@ define do_install_plugins
endef
define do_generate_dynamic_list_file
- (echo '{'; \
- $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u; \
- echo '};'; \
- ) > $2
+ symbol_type=`$(NM) -u -D $1 | awk 'NF>1 {print $$1}' | \
+ xargs echo "U W w" | tr ' ' '\n' | sort -u | xargs echo`;\
+ if [ "$$symbol_type" = "U W w" ];then \
+ (echo '{'; \
+ $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
+ echo '};'; \
+ ) > $2; \
+ else \
+ (echo Either missing one of [$1] or bad version of $(NM)) 1>&2;\
+ fi
endef
install_lib: all_cmd install_plugins
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 25/32] tools string: Use __fallthrough in perf_atoll() |
| Message-ID | <t98OS-5HM-27@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
The implicit fall through case label here is intended, so let us inform
that to gcc >= 7:
CC /tmp/build/perf/util/string.o
util/string.c: In function 'perf_atoll':
util/string.c:22:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (*p)
^
util/string.c:24:3: note: here
case '\0':
^~~~
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: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-0ophb30v9apkk6o95el0rqlq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/string.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index d8dfaf64b32e..bddca519dd58 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -21,6 +21,8 @@ s64 perf_atoll(const char *str)
case 'b': case 'B':
if (*p)
goto out_err;
+
+ __fallthrough;
case '\0':
return length;
default:
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:10 +0100 |
| Subject | [PATCH 10/32] perf probe: Add option --symfs |
| Message-ID | <t98OS-5HM-23@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> perf probe makes use of debug symbols, so add --symfs as the other commands have. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: kernel@pengutronix.de Link: http://lkml.kernel.org/r/1469094512-13440-2-git-send-email-u.kleine-koenig@pengutronix.de Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-probe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index f87996b0cb29..1fcebc31a508 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -552,6 +552,8 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, "Enable kernel symbol demangling"), OPT_BOOLEAN(0, "cache", &probe_conf.cache, "Manipulate probe cache"), + OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", + "Look for files with symbols relative to this directory"), OPT_END() }; int ret; -- 2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:40 +0100 |
| Subject | [PATCH 04/32] perf jevents: Add support for parsing uncore json files |
| Message-ID | <t99hT-5Ry-3@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Andi Kleen <ak@linux.intel.com>
Handle the "Unit" field, which is needed to find the right PMU for an
event. We call it "pmu" and convert it to the perf pmu name with an
uncore prefix.
Handle the "ExtSel" field, which just extends the event mask with an
additional bit.
Handle the "Filter" field which adds parameters to the main event
to configure filtering.
Handle the "Unit" field which declares the unit the values should be
scaled too (similar to what the kernel exports)
Set up the "perpkg" field for uncore events so that perf knows they are
per package (similar to what the kernel exports)
Then output the fields into the pmu-events data structures which are
compiled into perf.
Filter out zero fields, except for the event itself.
v2: Fix compilation. Add uncore_ prefix at pre-processing time.
Move eventcode change to separate patch.
v3: Remove extra __maybe_unused
v4: dont duplicate aliases for cpu pmu events
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170128020345.19007-3-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/pmu-events/jevents.c | 74 +++++++++++++++++++++++++++++++++++---
tools/perf/pmu-events/jevents.h | 4 ++-
tools/perf/pmu-events/pmu-events.h | 3 ++
tools/perf/util/pmu.c | 30 +++++++++++-----
4 files changed, 98 insertions(+), 13 deletions(-)
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 551377bf8428..eed09346a72a 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -188,6 +188,27 @@ static struct msrmap *lookup_msr(char *map, jsmntok_t *val)
return NULL;
}
+static struct map {
+ const char *json;
+ const char *perf;
+} unit_to_pmu[] = {
+ { "CBO", "uncore_cbox" },
+ { "QPI LL", "uncore_qpi" },
+ { "SBO", "uncore_sbox" },
+ {}
+};
+
+static const char *field_to_perf(struct map *table, char *map, jsmntok_t *val)
+{
+ int i;
+
+ for (i = 0; table[i].json; i++) {
+ if (json_streq(map, val, table[i].json))
+ return table[i].perf;
+ }
+ return NULL;
+}
+
#define EXPECT(e, t, m) do { if (!(e)) { \
jsmntok_t *loc = (t); \
if (!(t)->start && (t) > tokens) \
@@ -269,7 +290,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 *desc, char *long_desc,
+ char *pmu, char *unit, char *perpkg)
{
struct perf_entry_data *pd = data;
FILE *outfp = pd->outfp;
@@ -287,7 +309,12 @@ static int print_events_table_entry(void *data, char *name, char *event,
fprintf(outfp, "\t.topic = \"%s\",\n", topic);
if (long_desc && long_desc[0])
fprintf(outfp, "\t.long_desc = \"%s\",\n", long_desc);
-
+ if (pmu)
+ fprintf(outfp, "\t.pmu = \"%s\",\n", pmu);
+ if (unit)
+ fprintf(outfp, "\t.unit = \"%s\",\n", unit);
+ if (perpkg)
+ fprintf(outfp, "\t.perpkg = \"%s\",\n", perpkg);
fprintf(outfp, "},\n");
return 0;
@@ -334,7 +361,8 @@ static char *real_event(const char *name, char *event)
/* Call func with each event in the json file */
int json_events(const char *fn,
int (*func)(void *data, char *name, char *event, char *desc,
- char *long_desc),
+ char *long_desc,
+ char *pmu, char *unit, char *perpkg),
void *data)
{
int err = -EIO;
@@ -356,6 +384,10 @@ int json_events(const char *fn,
char *event = NULL, *desc = NULL, *name = NULL;
char *long_desc = NULL;
char *extra_desc = NULL;
+ char *pmu = NULL;
+ char *filter = NULL;
+ char *perpkg = NULL;
+ char *unit = NULL;
unsigned long long eventcode = 0;
struct msrmap *msr = NULL;
jsmntok_t *msrval = NULL;
@@ -382,6 +414,11 @@ int json_events(const char *fn,
addfield(map, &code, "", "", val);
eventcode |= strtoul(code, NULL, 0);
free(code);
+ } else if (json_streq(map, field, "ExtSel")) {
+ char *code = NULL;
+ addfield(map, &code, "", "", val);
+ eventcode |= strtoul(code, NULL, 0) << 21;
+ free(code);
} else if (json_streq(map, field, "EventName")) {
addfield(map, &name, "", "", val);
} else if (json_streq(map, field, "BriefDescription")) {
@@ -405,6 +442,28 @@ int json_events(const char *fn,
addfield(map, &extra_desc, ". ",
" Supports address when precise",
NULL);
+ } else if (json_streq(map, field, "Unit")) {
+ const char *ppmu;
+ char *s;
+
+ ppmu = field_to_perf(unit_to_pmu, map, val);
+ if (ppmu) {
+ pmu = strdup(ppmu);
+ } else {
+ if (!pmu)
+ pmu = strdup("uncore_");
+ addfield(map, &pmu, "", "", val);
+ for (s = pmu; *s; s++)
+ *s = tolower(*s);
+ }
+ addfield(map, &desc, ". ", "Unit: ", NULL);
+ addfield(map, &desc, "", pmu, NULL);
+ } else if (json_streq(map, field, "Filter")) {
+ addfield(map, &filter, "", "", val);
+ } else if (json_streq(map, field, "ScaleUnit")) {
+ addfield(map, &unit, "", "", val);
+ } else if (json_streq(map, field, "PerPkg")) {
+ addfield(map, &perpkg, "", "", val);
}
/* ignore unknown fields */
}
@@ -422,16 +481,23 @@ int json_events(const char *fn,
addfield(map, &desc, " ", extra_desc, NULL);
if (long_desc && extra_desc)
addfield(map, &long_desc, " ", extra_desc, NULL);
+ if (filter)
+ addfield(map, &event, ",", filter, NULL);
if (msr != NULL)
addfield(map, &event, ",", msr->pname, msrval);
fixname(name);
- err = func(data, name, real_event(name, event), desc, long_desc);
+ err = func(data, name, real_event(name, event), desc, long_desc,
+ pmu, unit, perpkg);
free(event);
free(desc);
free(name);
free(long_desc);
free(extra_desc);
+ free(pmu);
+ free(filter);
+ free(perpkg);
+ free(unit);
if (err)
break;
tok += j;
diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h
index b0eb2744b498..71e13de31092 100644
--- a/tools/perf/pmu-events/jevents.h
+++ b/tools/perf/pmu-events/jevents.h
@@ -3,7 +3,9 @@
int json_events(const char *fn,
int (*func)(void *data, char *name, char *event, char *desc,
- char *long_desc),
+ char *long_desc,
+ char *pmu,
+ char *unit, char *perpkg),
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 2eaef595d8a0..c669a3cdb9f0 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -10,6 +10,9 @@ struct pmu_event {
const char *desc;
const char *topic;
const char *long_desc;
+ const char *pmu;
+ const char *unit;
+ const char *perpkg;
};
/*
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 78b16100567d..6dc3cc050105 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -229,11 +229,13 @@ 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 *desc, char *val,
+ char *long_desc, char *topic,
+ char *unit, char *perpkg)
{
struct perf_pmu_alias *alias;
int ret;
+ int num;
alias = malloc(sizeof(*alias));
if (!alias)
@@ -267,7 +269,12 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
alias->long_desc = long_desc ? strdup(long_desc) :
desc ? strdup(desc) : NULL;
alias->topic = topic ? strdup(topic) : NULL;
-
+ if (unit) {
+ if (convert_scale(unit, &unit, &alias->scale) < 0)
+ return -1;
+ snprintf(alias->unit, sizeof(alias->unit), "%s", unit);
+ }
+ alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1;
list_add_tail(&alias->list, list);
return 0;
@@ -284,7 +291,8 @@ 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);
+ return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL,
+ NULL);
}
static inline bool pmu_alias_info_file(char *name)
@@ -504,7 +512,7 @@ char * __weak get_cpuid_str(void)
* to the current running CPU. Then, add all PMU events from that table
* as aliases.
*/
-static void pmu_add_cpu_aliases(struct list_head *head)
+static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
{
int i;
struct pmu_events_map *map;
@@ -540,14 +548,21 @@ static void pmu_add_cpu_aliases(struct list_head *head)
*/
i = 0;
while (1) {
+ const char *pname;
+
pe = &map->table[i++];
if (!pe->name)
break;
+ pname = pe->pmu ? pe->pmu : "cpu";
+ if (strncmp(pname, name, strlen(pname)))
+ continue;
+
/* need type casts to override 'const' */
__perf_pmu__new_alias(head, NULL, (char *)pe->name,
(char *)pe->desc, (char *)pe->event,
- (char *)pe->long_desc, (char *)pe->topic);
+ (char *)pe->long_desc, (char *)pe->topic,
+ (char *)pe->unit, (char *)pe->perpkg);
}
out:
@@ -578,8 +593,7 @@ static struct perf_pmu *pmu_lookup(const char *name)
if (pmu_aliases(name, &aliases))
return NULL;
- if (!strcmp(name, "cpu"))
- pmu_add_cpu_aliases(&aliases);
+ pmu_add_cpu_aliases(&aliases, name);
if (pmu_type(name, &type))
return NULL;
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:40 +0100 |
| Subject | [PATCH 06/32] perf pmu: Support event aliases for non cpu// pmus |
| Message-ID | <t99hU-5Ry-11@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Andi Kleen <ak@linux.intel.com>
The code for handling pmu aliases without specifying the PMU hardcoded
only supported the cpu PMU.
This patch extends it to work for all PMUs. We always duplicate the
event for all PMUs that have an matching alias. This allows to
automatically expand an alias for all instances of a PMU (so for example
you can monitor all cache boxes with a single event)
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170128020345.19007-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.y | 32 ++++++++++++++++++++++-------
2 files changed, 51 insertions(+), 27 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 3c876b8ba4de..6dbcba7f0969 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1504,35 +1504,41 @@ static void perf_pmu__parse_init(void)
struct perf_pmu_alias *alias;
int len = 0;
- pmu = perf_pmu__find("cpu");
- if ((pmu == NULL) || list_empty(&pmu->aliases)) {
+ pmu = NULL;
+ while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+ list_for_each_entry(alias, &pmu->aliases, list) {
+ if (strchr(alias->name, '-'))
+ len++;
+ len++;
+ }
+ }
+
+ if (len == 0) {
perf_pmu_events_list_num = -1;
return;
}
- list_for_each_entry(alias, &pmu->aliases, list) {
- if (strchr(alias->name, '-'))
- len++;
- len++;
- }
perf_pmu_events_list = malloc(sizeof(struct perf_pmu_event_symbol) * len);
if (!perf_pmu_events_list)
return;
perf_pmu_events_list_num = len;
len = 0;
- list_for_each_entry(alias, &pmu->aliases, list) {
- struct perf_pmu_event_symbol *p = perf_pmu_events_list + len;
- char *tmp = strchr(alias->name, '-');
-
- if (tmp != NULL) {
- SET_SYMBOL(strndup(alias->name, tmp - alias->name),
- PMU_EVENT_SYMBOL_PREFIX);
- p++;
- SET_SYMBOL(strdup(++tmp), PMU_EVENT_SYMBOL_SUFFIX);
- len += 2;
- } else {
- SET_SYMBOL(strdup(alias->name), PMU_EVENT_SYMBOL);
- len++;
+ pmu = NULL;
+ while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+ list_for_each_entry(alias, &pmu->aliases, list) {
+ struct perf_pmu_event_symbol *p = perf_pmu_events_list + len;
+ char *tmp = strchr(alias->name, '-');
+
+ if (tmp != NULL) {
+ SET_SYMBOL(strndup(alias->name, tmp - alias->name),
+ PMU_EVENT_SYMBOL_PREFIX);
+ p++;
+ SET_SYMBOL(strdup(++tmp), PMU_EVENT_SYMBOL_SUFFIX);
+ len += 2;
+ } else {
+ SET_SYMBOL(strdup(alias->name), PMU_EVENT_SYMBOL);
+ len++;
+ }
}
}
qsort(perf_pmu_events_list, len,
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 879115f93edc..f3b5ec901600 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -12,6 +12,7 @@
#include <linux/list.h>
#include <linux/types.h>
#include "util.h"
+#include "pmu.h"
#include "parse-events.h"
#include "parse-events-bison.h"
@@ -236,15 +237,32 @@ PE_KERNEL_PMU_EVENT sep_dc
struct list_head *head;
struct parse_events_term *term;
struct list_head *list;
+ struct perf_pmu *pmu = NULL;
+ int ok = 0;
- ALLOC_LIST(head);
- ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
- $1, 1, &@1, NULL));
- list_add_tail(&term->list, head);
-
+ /* Add it for all PMUs that support the alias */
ALLOC_LIST(list);
- ABORT_ON(parse_events_add_pmu(data, list, "cpu", head));
- parse_events_terms__delete(head);
+ 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, &@1, NULL));
+ list_add_tail(&term->list, head);
+
+ if (!parse_events_add_pmu(data, list,
+ pmu->name, head)) {
+ ok++;
+ }
+
+ parse_events_terms__delete(head);
+ }
+ }
+ }
+ if (!ok)
+ YYABORT;
$$ = list;
}
|
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:40 +0100 |
| Subject | [PATCH 07/32] perf list: Add debug support for outputing alias string |
| Message-ID | <t99hU-5Ry-15@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Andi Kleen <ak@linux.intel.com>
For debugging and testing it is useful to see the converted alias
string. Add support to perf stat/record and perf list to print the alias
conversion. The text string is saved in the alias structure. For perf
stat/record it is folded into the normal -v. For perf list -v was taken,
so we use --debug.
Before:
% perf list
...
cache:
l1d.replacement
[L1D data line replacements]
l1d_pend_miss.fb_full
[Cycles a demand request was blocked due to Fill Buffers inavailability]
After
% perf list --debug
...
cache:
l1d.replacement
[L1D data line replacements]
cpu/umask=0x1,period=2000003,event=0x51/
l1d_pend_miss.fb_full
[Cycles a demand request was blocked due to Fill Buffers inavailability]
cpu/umask=0x2,period=2000003,cmask=1,event=0x48/
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170128020345.19007-6-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-list.c | 3 +++
tools/perf/util/parse-events.y | 3 +++
tools/perf/util/pmu.c | 8 ++++++++
tools/perf/util/pmu.h | 1 +
4 files changed, 15 insertions(+)
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index ba9322ff858b..3b9d98b5feef 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -14,6 +14,7 @@
#include "util/parse-events.h"
#include "util/cache.h"
#include "util/pmu.h"
+#include "util/debug.h"
#include <subcmd/parse-options.h>
static bool desc_flag = true;
@@ -29,6 +30,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_INCR(0, "debug", &verbose,
+ "Enable debugging output"),
OPT_END()
};
const char * const list_usage[] = {
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index f3b5ec901600..3a5196380609 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -13,6 +13,7 @@
#include <linux/types.h>
#include "util.h"
#include "pmu.h"
+#include "debug.h"
#include "parse-events.h"
#include "parse-events-bison.h"
@@ -254,6 +255,8 @@ PE_KERNEL_PMU_EVENT sep_dc
if (!parse_events_add_pmu(data, list,
pmu->name, head)) {
+ pr_debug("%s -> %s/%s/\n", $1,
+ pmu->name, alias->str);
ok++;
}
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 8e9d00fd418e..82a654dec666 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -275,6 +275,8 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
snprintf(alias->unit, sizeof(alias->unit), "%s", unit);
}
alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1;
+ alias->str = strdup(val);
+
list_add_tail(&alias->list, list);
return 0;
@@ -1087,6 +1089,8 @@ struct sevent {
char *name;
char *desc;
char *topic;
+ char *str;
+ char *pmu;
};
static int cmp_sevent(const void *a, const void *b)
@@ -1183,6 +1187,8 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
aliases[j].desc = long_desc ? alias->long_desc :
alias->desc;
aliases[j].topic = alias->topic;
+ aliases[j].str = alias->str;
+ aliases[j].pmu = pmu->name;
j++;
}
if (pmu->selectable &&
@@ -1217,6 +1223,8 @@ 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)
+ printf("%*s%s/%s/\n", 8, "", aliases[j].pmu, aliases[j].str);
} else
printf(" %-50s [Kernel PMU event]\n", aliases[j].name);
printed++;
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 25712034c815..00852ddc7741 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -43,6 +43,7 @@ struct perf_pmu_alias {
char *desc;
char *long_desc;
char *topic;
+ char *str;
struct list_head terms; /* HEAD struct parse_events_term -> list */
struct list_head list; /* ELEM */
char unit[UNIT_MAX_LEN+1];
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:40 +0100 |
| Subject | [PATCH 08/32] perf sdt: Show proper hint when event not yet in place via 'perf probe' |
| Message-ID | <t99hU-5Ry-17@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
All events from 'perf list', except SDT events, can be directly recorded
with 'perf record'. But, the flow is little different for SDT events.
Probe points for SDT event needs to be created using 'perf probe' before
recording it using 'perf record'.
Perf shows misleading hint when a user tries to record SDT event without
first creating a probe point. Show proper hint there.
Before patch:
$ perf record -a -e sdt_glib:idle__add
event syntax error: 'sdt_glib:idle__add'
\___ unknown tracepoint
Error: File /sys/kernel/debug/tracing/events/sdt_glib/idle__add not found.
Hint: Perhaps this kernel misses some CONFIG_ setting to enable this feature?.
...
After patch:
$ perf record -a -e sdt_glib:idle__add
event syntax error: 'sdt_glib:idle__add'
\___ unknown tracepoint
Error: File /sys/kernel/debug/tracing/events/sdt_glib/idle__add not found.
Hint: SDT event cannot be directly recorded on.
Please first use 'perf probe sdt_glib:idle__add' before recording it.
...
$ perf probe sdt_glib:idle__add
Added new event:
sdt_glib:idle__add (on %idle__add in /usr/lib64/libglib-2.0.so.0.5000.2)
You can now use it in all perf tools, such as:
perf record -e sdt_glib:idle__add -aR sleep 1
$ perf record -a -e sdt_glib:idle__add
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.175 MB perf.data ]
Suggested-and-Acked-by: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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/20170203102642.17258-1-ravi.bangoria@linux.vnet.ibm.com
[ s/Please use/Please first use/ and break the Hint line in two ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/api/fs/tracing_path.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c
index 251b7c342a87..3e606b9c443e 100644
--- a/tools/lib/api/fs/tracing_path.c
+++ b/tools/lib/api/fs/tracing_path.c
@@ -86,9 +86,13 @@ void put_tracing_file(char *file)
free(file);
}
-static int strerror_open(int err, char *buf, size_t size, const char *filename)
+int tracing_path__strerror_open_tp(int err, char *buf, size_t size,
+ const char *sys, const char *name)
{
char sbuf[128];
+ char filename[PATH_MAX];
+
+ snprintf(filename, PATH_MAX, "%s/%s", sys, name ?: "*");
switch (err) {
case ENOENT:
@@ -99,10 +103,19 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
* - jirka
*/
if (debugfs__configured() || tracefs__configured()) {
- snprintf(buf, size,
- "Error:\tFile %s/%s not found.\n"
- "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
- tracing_events_path, filename);
+ /* sdt markers */
+ if (!strncmp(filename, "sdt_", 4)) {
+ snprintf(buf, size,
+ "Error:\tFile %s/%s not found.\n"
+ "Hint:\tSDT event cannot be directly recorded on.\n"
+ "\tPlease first use 'perf probe %s:%s' before recording it.\n",
+ tracing_events_path, filename, sys, name);
+ } else {
+ snprintf(buf, size,
+ "Error:\tFile %s/%s not found.\n"
+ "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
+ tracing_events_path, filename);
+ }
break;
}
snprintf(buf, size, "%s",
@@ -125,12 +138,3 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
return 0;
}
-
-int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
-{
- char path[PATH_MAX];
-
- snprintf(path, PATH_MAX, "%s/%s", sys, name ?: "*");
-
- return strerror_open(err, buf, size, path);
-}
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:40 +0100 |
| Subject | [PATCH 01/32] perf tools arm64: Add support for generating bpf prologue |
| Message-ID | <t99hU-5Ry-23@gated-at.bofh.it> |
| In reply to | #1578103 |
From: He Kuang <hekuang@huawei.com>
Since HAVE_KPROBES can be enabled in arm64, this patch introduces
regs_query_register_offset() to convert register name to offset for
arm64, so the BPF prologue feature is ready to use.
Signed-off-by: He Kuang <hekuang@huawei.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Bintian Wang <bintian.wang@huawei.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20170207073412.26983-1-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/arch/arm64/Makefile | 1 +
tools/perf/arch/arm64/util/dwarf-regs.c | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile
index 18b13518d8d8..eebe1ec9d2ee 100644
--- a/tools/perf/arch/arm64/Makefile
+++ b/tools/perf/arch/arm64/Makefile
@@ -2,3 +2,4 @@ ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
PERF_HAVE_JITDUMP := 1
+PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
diff --git a/tools/perf/arch/arm64/util/dwarf-regs.c b/tools/perf/arch/arm64/util/dwarf-regs.c
index d49efeb8172e..068b6189157b 100644
--- a/tools/perf/arch/arm64/util/dwarf-regs.c
+++ b/tools/perf/arch/arm64/util/dwarf-regs.c
@@ -10,17 +10,20 @@
#include <stddef.h>
#include <dwarf-regs.h>
+#include <linux/ptrace.h> /* for struct user_pt_regs */
+#include "util.h"
struct pt_regs_dwarfnum {
const char *name;
unsigned int dwarfnum;
};
-#define STR(s) #s
#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
#define GPR_DWARFNUM_NAME(num) \
{.name = STR(%x##num), .dwarfnum = num}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
+#define DWARFNUM2OFFSET(index) \
+ (index * sizeof((struct user_pt_regs *)0)->regs[0])
/*
* Reference:
@@ -78,3 +81,13 @@ const char *get_arch_regstr(unsigned int n)
return roff->name;
return NULL;
}
+
+int regs_query_register_offset(const char *name)
+{
+ const struct pt_regs_dwarfnum *roff;
+
+ for (roff = regdwarfnum_table; roff->name != NULL; roff++)
+ if (!strcmp(roff->name, name))
+ return DWARFNUM2OFFSET(roff->dwarfnum);
+ return -EINVAL;
+}
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 03:50 +0100 |
| Subject | [PATCH 24/32] tools include: Add a __fallthrough statement |
| Message-ID | <t99rz-5V8-3@gated-at.bofh.it> |
| In reply to | #1578103 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
For cases where implicit fall through case labels are intended,
to let us inform that to gcc >= 7:
CC /tmp/build/perf/util/string.o
util/string.c: In function 'perf_atoll':
util/string.c:22:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (*p)
^
util/string.c:24:3: note: here
case '\0':
^~~~
So we introduce:
#define __fallthrough __attribute__ ((fallthrough))
And use it in such cases.
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: Wang Nan <wangnan0@huawei.com>
Cc: William Cohen <wcohen@redhat.com>
Link: http://lkml.kernel.org/n/tip-qnpig0xfop4hwv6k4mv1wts5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/include/linux/compiler.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index e33fc1df3935..d94179f94caa 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -126,4 +126,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
#define WRITE_ONCE(x, val) \
({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
+
+#ifndef __fallthrough
+# if defined(__GNUC__) && __GNUC__ >= 7
+# define __fallthrough __attribute__ ((fallthrough))
+# else
+# define __fallthrough
+# endif
+#endif
+
#endif /* _TOOLS_LINUX_COMPILER_H */
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-02-10 04:10 +0100 |
| Subject | Re: [PATCH 24/32] tools include: Add a __fallthrough statement |
| Message-ID | <t99KW-6h2-15@gated-at.bofh.it> |
| In reply to | #1578131 |
On Thu, 2017-02-09 at 22:39 -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> For cases where implicit fall through case labels are intended,
> to let us inform that to gcc >= 7:
I believe this should be added to compiler_gcc.h
> diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
[]
> @@ -126,4 +126,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
> #define WRITE_ONCE(x, val) \
> ({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
>
> +
> +#ifndef __fallthrough
> +# if defined(__GNUC__) && __GNUC__ >= 7
> +# define __fallthrough __attribute__ ((fallthrough))
> +# else
> +# define __fallthrough
> +# endif
> +#endif
> +
> #endif /* _TOOLS_LINUX_COMPILER_H */
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 15:50 +0100 |
| Subject | Re: [PATCH 24/32] tools include: Add a __fallthrough statement |
| Message-ID | <t9kGm-4F0-11@gated-at.bofh.it> |
| In reply to | #1578150 |
Em Thu, Feb 09, 2017 at 07:02:06PM -0800, Joe Perches escreveu:
> On Thu, 2017-02-09 at 22:39 -0300, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > For cases where implicit fall through case labels are intended,
> > to let us inform that to gcc >= 7:
>
> I believe this should be added to compiler_gcc.h
We still don't have it in tools/include/linux, but yeah, its a good idea
to have the equivalent of include/linux/compiler-gcc.h.
Then, at some point, the kernel can grab the definition from tools, i.e.
when people start trying to build the kernel _and_ this specific warning
is enabled there, as it is in tools/.
- Arnaldo
> > diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
> []
> > @@ -126,4 +126,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
> > #define WRITE_ONCE(x, val) \
> > ({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })
> >
> > +
> > +#ifndef __fallthrough
> > +# if defined(__GNUC__) && __GNUC__ >= 7
> > +# define __fallthrough __attribute__ ((fallthrough))
> > +# else
> > +# define __fallthrough
> > +# endif
> > +#endif
> > +
> > #endif /* _TOOLS_LINUX_COMPILER_H */
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-02-10 19:00 +0100 |
| Subject | [PATCH] compiler/compiler-gcc: Add __fallthrough |
| Message-ID | <t9nEe-6Co-35@gated-at.bofh.it> |
| In reply to | #1578519 |
gcc v7.0 can warn on missing break statements from case labels using a special __attribute__((fallthrough))__ marker. Add a __fallthrough convenience macro for gcc versions >= 7 and make the generic use of __fallthrough a no-op. Signed-off-by: Joe Perches <joe@perches.com> --- include/linux/compiler-gcc.h | 7 +++++++ include/linux/compiler.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index d5e1fedbad24..6af8d6448f10 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -304,6 +304,13 @@ #define __no_sanitize_address __attribute__((no_sanitize_address)) #endif +#if GCC_VERSION >= 70000 +/* + * Tell the compiler not to warn when a switch/case fallthrough marker exists + */ +#define __fallthrough __attribute__ ((fallthrough)) +#endif + #endif /* gcc version >= 40000 specific checks */ #if !defined(__noclone) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 6e8e160b1e4b..16b6efc877f4 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -477,6 +477,12 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s #define __assume_aligned(a, ...) #endif +/* + * switch/case fallthrough checking + */ +#ifndef __fallthrough +#define __fallthrough +#endif /* Are two types/vars the same type (ignoring qualifiers)? */ #ifndef __same_type -- 2.10.0.rc2.1.g053435c
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-02-10 19:20 +0100 |
| Subject | Re: [PATCH] compiler/compiler-gcc: Add __fallthrough |
| Message-ID | <t9nXA-6ZO-9@gated-at.bofh.it> |
| In reply to | #1578651 |
Em Fri, Feb 10, 2017 at 09:08:35AM -0800, Joe Perches escreveu: > gcc v7.0 can warn on missing break statements from case labels > using a special __attribute__((fallthrough))__ marker. > > Add a __fallthrough convenience macro for gcc versions >= 7 and > make the generic use of __fallthrough a no-op. Can you state in the log message were this idea came from? Say, something like: "This was introduced in the tools/include/linux/compiler.h, where it was first noticed while buildint tools/perf/ in a Fedora Rawhide environment." BTW, I added this to my tree: https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=e058554b1418e00864f1702c84bfa1d7cf314627 tools include: Introduce linux/compiler-gcc.h To match the kernel headers structure, setting up things that are specific to gcc or to some specific version of gcc. It gets included by linux/compiler.h when gcc is the compiler being used. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Perches <joe@perches.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-pi5mxx176lotfce90rn17j88@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Thanks, - Arnaldo > Signed-off-by: Joe Perches <joe@perches.com> > --- > include/linux/compiler-gcc.h | 7 +++++++ > include/linux/compiler.h | 6 ++++++ > 2 files changed, 13 insertions(+) > > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index d5e1fedbad24..6af8d6448f10 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -304,6 +304,13 @@ > #define __no_sanitize_address __attribute__((no_sanitize_address)) > #endif > > +#if GCC_VERSION >= 70000 > +/* > + * Tell the compiler not to warn when a switch/case fallthrough marker exists > + */ > +#define __fallthrough __attribute__ ((fallthrough)) > +#endif > + > #endif /* gcc version >= 40000 specific checks */ > > #if !defined(__noclone) > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > index 6e8e160b1e4b..16b6efc877f4 100644 > --- a/include/linux/compiler.h > +++ b/include/linux/compiler.h > @@ -477,6 +477,12 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s > #define __assume_aligned(a, ...) > #endif > > +/* > + * switch/case fallthrough checking > + */ > +#ifndef __fallthrough > +#define __fallthrough > +#endif > > /* Are two types/vars the same type (ignoring qualifiers)? */ > #ifndef __same_type > -- > 2.10.0.rc2.1.g053435c
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-02-10 20:00 +0100 |
| Subject | Re: [PATCH] compiler/compiler-gcc: Add __fallthrough |
| Message-ID | <t9oAi-7fF-29@gated-at.bofh.it> |
| In reply to | #1578673 |
On Fri, 2017-02-10 at 14:18 -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 10, 2017 at 09:08:35AM -0800, Joe Perches escreveu: > > gcc v7.0 can warn on missing break statements from case labels > > using a special __attribute__((fallthrough))__ marker. > > > > Add a __fallthrough convenience macro for gcc versions >= 7 and > > make the generic use of __fallthrough a no-op. > > Can you state in the log message were this idea came from? Say, > something like: > > "This was introduced in the tools/include/linux/compiler.h, where it was > first noticed while buildint tools/perf/ in a Fedora Rawhide > environment." The request is from at least 2002. Maybe Andrew could add a link like: Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 if he applies it.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.kernel
csiph-web