Skip to content

Commit aa469aa

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-core-for-mingo-4.15-20170922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: - Support direct --user-regs arguments in 'perf record', previously the only way to sample PERF_SAMPLE_REGS_USER was implicitly selecting it when recording callchains (Andi Kleen) - Support showing sampled user regs in 'perf script' (Andi Kleen) - Introduce the concept of weak groups in 'perf stat': try to set up a group, but if it's not schedulable fallback to not using a group. That gives us the best of both worlds: groups if they work, but still a usable fallback if they don't. E.g: (Andi Kleen) % perf stat -e '{branches,branch-misses,l1d.replacement,l2_lines_in.all,l2_rqsts.all_code_rd}:W' -a sleep 1 125,366,055 branches (80.02%) 9,208,402 branch-misses # 7.35% of all branches (80.01%) 24,560,249 l1d.replacement (80.00%) 43,174,971 l2_lines_in.all (80.05%) 31,891,457 l2_rqsts.all_code_rd (79.92%) - Support metrics in 'stat' and 'list'. A metric is a formula that uses multiple events to compute a higher level result (e.g. IPC). (Andi Kleen) - Add Intel processors vendor event metrics JSON files (Andi Kleen) - Add 'pid' and 'tid' options to 'perf sched timehist' (David Ahern) - Generate 'behavior' string table from kernel headers, helps getting new parameters when synchronizing kernel headers, like MADV_WIPEONFORK and MADV_KEEPONFORK, that are now beautied (Arnaldo Carvalho de Melo) - Improve TUI progress bar by showing how many bytes from a total were processed (Jiri Olsa) - Use scandir() to replace readdir(), prep work to have the synthesizing of PERF_RECORD_ entries for existing threads be multithreaded, making 'perf top' bearable on high core count systems such as Intel's Knights Landing/Mill (Kan Liang) - Allow creating a ~/.perfconfig file when setting a variable to its default value, previously it would bail out and not write such a file (Taeung Song) - Introduce wrapper for allowing purely single threaded apps to avoid the costs of locking (Arnaldo Carvalho de Melo) - Introduce hashtable to reduce the cost of thread lookup - Fix build C++ build wrt poison.h using void pointer arithmetic, affects only the embedded clang/llvm case, that is disabled by default (Arnaldo Carvalho de Melo) - Fix leaking rec_argv in error cases (Martin Kepplinger) - Remove Intel CQM perf test, that infrastructure was nuked (Xiaochen Shen) Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents c52f56a + 0a7c74e commit aa469aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2988
-489
lines changed

tools/include/linux/poison.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
# define POISON_POINTER_DELTA 0
1515
#endif
1616

17+
#ifdef __cplusplus
18+
#define LIST_POISON1 NULL
19+
#define LIST_POISON2 NULL
20+
#else
1721
/*
1822
* These are non-NULL pointers that will result in page faults
1923
* under normal circumstances, used to verify that nobody uses
2024
* non-initialized list entries.
2125
*/
2226
#define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA)
2327
#define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA)
28+
#endif
2429

2530
/********** include/linux/timer.h **********/
2631
/*

tools/include/uapi/asm-generic/mman-common.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,12 @@
5858
overrides the coredump filter bits */
5959
#define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag */
6060

61+
#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
62+
#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
63+
6164
/* compatibility flags */
6265
#define MAP_FILE 0
6366

64-
/*
65-
* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
66-
* This gives us 6 bits, which is enough until someone invents 128 bit address
67-
* spaces.
68-
*
69-
* Assume these are all power of twos.
70-
* When 0 use the default page size.
71-
*/
72-
#define MAP_HUGE_SHIFT 26
73-
#define MAP_HUGE_MASK 0x3f
74-
7567
#define PKEY_DISABLE_ACCESS 0x1
7668
#define PKEY_DISABLE_WRITE 0x2
7769
#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\

tools/perf/Documentation/perf-list.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ perf-list - List all symbolic event types
88
SYNOPSIS
99
--------
1010
[verse]
11-
'perf list' [--no-desc] [--long-desc] [hw|sw|cache|tracepoint|pmu|sdt|event_glob]
11+
'perf list' [--no-desc] [--long-desc]
12+
[hw|sw|cache|tracepoint|pmu|sdt|metric|metricgroup|event_glob]
1213

1314
DESCRIPTION
1415
-----------
@@ -47,6 +48,8 @@ counted. The following modifiers exist:
4748
P - use maximum detected precise level
4849
S - read sample value (PERF_SAMPLE_READ)
4950
D - pin the event to the PMU
51+
W - group is weak and will fallback to non-group if not schedulable,
52+
only supported in 'perf stat' for now.
5053

5154
The 'p' modifier can be used for specifying how precise the instruction
5255
address should be. The 'p' modifier can be specified multiple times:
@@ -246,6 +249,10 @@ To limit the list use:
246249

247250
. 'sdt' to list all Statically Defined Tracepoint events.
248251

252+
. 'metric' to list metrics
253+
254+
. 'metricgroup' to list metricgroups with metrics.
255+
249256
. If none of the above is matched, it will apply the supplied glob to all
250257
events, printing the ones that match.
251258

tools/perf/Documentation/perf-record.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ symbolic names, e.g. on x86, ax, si. To list the available registers use
377377
--intr-regs=\?. To name registers, pass a comma separated list such as
378378
--intr-regs=ax,bx. The list of register is architecture dependent.
379379

380+
--user-regs::
381+
Capture user registers at sample time. Same arguments as -I.
380382

381383
--running-time::
382384
Record running and enabled time for read events (:S)

tools/perf/Documentation/perf-sched.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ OPTIONS for 'perf sched timehist'
106106
--max-stack::
107107
Maximum number of functions to display in backtrace, default 5.
108108

109+
-p=::
110+
--pid=::
111+
Only show events for given process ID (comma separated list).
112+
113+
-t=::
114+
--tid=::
115+
Only show events for given thread ID (comma separated list).
116+
109117
-s::
110118
--summary::
111119
Show only a summary of scheduling by thread with min, max, and average

tools/perf/Documentation/perf-script.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ OPTIONS
116116
--fields::
117117
Comma separated list of fields to print. Options are:
118118
comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
119-
srcline, period, iregs, brstack, brstacksym, flags, bpf-output, brstackinsn, brstackoff,
120-
callindent, insn, insnlen, synth, phys_addr.
119+
srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn,
120+
brstackoff, callindent, insn, insnlen, synth, phys_addr.
121121
Field list can be prepended with the type, trace, sw or hw,
122122
to indicate to which event type the field list applies.
123123
e.g., -F sw:comm,tid,time,ip,sym and -F trace:time,cpu,trace

tools/perf/Documentation/perf-stat.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ Aggregate counts per processor socket for system-wide mode measurements.
199199
--per-core::
200200
Aggregate counts per physical processor for system-wide mode measurements.
201201

202+
-M::
203+
--metrics::
204+
Print metrics or metricgroups specified in a comma separated list.
205+
For a group all metrics from the group are added.
206+
The events from the metrics are automatically measured.
207+
See perf list output for the possble metrics and metricgroups.
208+
202209
-A::
203210
--no-aggr::
204211
Do not aggregate counts across all monitored CPUs.

tools/perf/MANIFEST

Lines changed: 2 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,8 @@
11
tools/perf
2-
tools/arch/alpha/include/asm/barrier.h
3-
tools/arch/arm/include/asm/barrier.h
4-
tools/arch/arm64/include/asm/barrier.h
5-
tools/arch/ia64/include/asm/barrier.h
6-
tools/arch/mips/include/asm/barrier.h
7-
tools/arch/powerpc/include/asm/barrier.h
8-
tools/arch/s390/include/asm/barrier.h
9-
tools/arch/sh/include/asm/barrier.h
10-
tools/arch/sparc/include/asm/barrier.h
11-
tools/arch/sparc/include/asm/barrier_32.h
12-
tools/arch/sparc/include/asm/barrier_64.h
13-
tools/arch/tile/include/asm/barrier.h
14-
tools/arch/x86/include/asm/barrier.h
15-
tools/arch/x86/include/asm/cmpxchg.h
16-
tools/arch/x86/include/asm/cpufeatures.h
17-
tools/arch/x86/include/asm/disabled-features.h
18-
tools/arch/x86/include/asm/required-features.h
19-
tools/arch/x86/include/uapi/asm/svm.h
20-
tools/arch/x86/include/uapi/asm/vmx.h
21-
tools/arch/x86/include/uapi/asm/kvm.h
22-
tools/arch/x86/include/uapi/asm/kvm_perf.h
23-
tools/arch/x86/lib/memcpy_64.S
24-
tools/arch/x86/lib/memset_64.S
25-
tools/arch/s390/include/uapi/asm/kvm_perf.h
26-
tools/arch/s390/include/uapi/asm/sie.h
27-
tools/arch/xtensa/include/asm/barrier.h
2+
tools/arch
283
tools/scripts
294
tools/build
30-
tools/arch/x86/include/asm/atomic.h
31-
tools/arch/x86/include/asm/rmwcc.h
5+
tools/include
326
tools/lib/traceevent
337
tools/lib/api
348
tools/lib/bpf
@@ -42,60 +16,3 @@ tools/lib/find_bit.c
4216
tools/lib/bitmap.c
4317
tools/lib/str_error_r.c
4418
tools/lib/vsprintf.c
45-
tools/include/asm/alternative-asm.h
46-
tools/include/asm/atomic.h
47-
tools/include/asm/barrier.h
48-
tools/include/asm/bug.h
49-
tools/include/asm-generic/atomic-gcc.h
50-
tools/include/asm-generic/barrier.h
51-
tools/include/asm-generic/bitops/arch_hweight.h
52-
tools/include/asm-generic/bitops/atomic.h
53-
tools/include/asm-generic/bitops/const_hweight.h
54-
tools/include/asm-generic/bitops/__ffs.h
55-
tools/include/asm-generic/bitops/__ffz.h
56-
tools/include/asm-generic/bitops/__fls.h
57-
tools/include/asm-generic/bitops/find.h
58-
tools/include/asm-generic/bitops/fls64.h
59-
tools/include/asm-generic/bitops/fls.h
60-
tools/include/asm-generic/bitops/hweight.h
61-
tools/include/asm-generic/bitops.h
62-
tools/include/linux/atomic.h
63-
tools/include/linux/bitops.h
64-
tools/include/linux/compiler.h
65-
tools/include/linux/compiler-gcc.h
66-
tools/include/linux/coresight-pmu.h
67-
tools/include/linux/bug.h
68-
tools/include/linux/filter.h
69-
tools/include/linux/hash.h
70-
tools/include/linux/kernel.h
71-
tools/include/linux/list.h
72-
tools/include/linux/log2.h
73-
tools/include/uapi/asm-generic/fcntl.h
74-
tools/include/uapi/asm-generic/ioctls.h
75-
tools/include/uapi/asm-generic/mman-common.h
76-
tools/include/uapi/asm-generic/mman.h
77-
tools/include/uapi/drm/drm.h
78-
tools/include/uapi/drm/i915_drm.h
79-
tools/include/uapi/linux/bpf.h
80-
tools/include/uapi/linux/bpf_common.h
81-
tools/include/uapi/linux/fcntl.h
82-
tools/include/uapi/linux/hw_breakpoint.h
83-
tools/include/uapi/linux/kvm.h
84-
tools/include/uapi/linux/mman.h
85-
tools/include/uapi/linux/perf_event.h
86-
tools/include/uapi/linux/sched.h
87-
tools/include/uapi/linux/stat.h
88-
tools/include/uapi/linux/vhost.h
89-
tools/include/uapi/sound/asound.h
90-
tools/include/linux/poison.h
91-
tools/include/linux/rbtree.h
92-
tools/include/linux/rbtree_augmented.h
93-
tools/include/linux/refcount.h
94-
tools/include/linux/string.h
95-
tools/include/linux/stringify.h
96-
tools/include/linux/types.h
97-
tools/include/linux/err.h
98-
tools/include/linux/bitmap.h
99-
tools/include/linux/time64.h
100-
tools/arch/*/include/uapi/asm/mman.h
101-
tools/arch/*/include/uapi/asm/perf_regs.h

tools/perf/Makefile.perf

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ AWK = awk
173173
# non-config cases
174174
config := 1
175175

176-
NON_CONFIG_TARGETS := clean TAGS tags cscope help install-doc install-man install-html install-info install-pdf doc man html info pdf
176+
NON_CONFIG_TARGETS := clean python-clean TAGS tags cscope help install-doc install-man install-html install-info install-pdf doc man html info pdf
177177

178178
ifdef MAKECMDGOALS
179179
ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
@@ -441,6 +441,13 @@ perf_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/perf_ioctl.sh
441441
$(perf_ioctl_array): $(perf_hdr_dir)/perf_event.h $(perf_ioctl_tbl)
442442
$(Q)$(SHELL) '$(perf_ioctl_tbl)' $(perf_hdr_dir) > $@
443443

444+
madvise_behavior_array := $(beauty_outdir)/madvise_behavior_array.c
445+
madvise_hdr_dir := $(srctree)/tools/include/uapi/asm-generic/
446+
madvise_behavior_tbl := $(srctree)/tools/perf/trace/beauty/madvise_behavior.sh
447+
448+
$(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl)
449+
$(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@
450+
444451
all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
445452

446453
$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
@@ -541,6 +548,7 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc
541548
$(sndrv_ctl_ioctl_array) \
542549
$(kvm_ioctl_array) \
543550
$(vhost_virtio_ioctl_array) \
551+
$(madvise_behavior_array) \
544552
$(perf_ioctl_array)
545553

546554
$(OUTPUT)%.o: %.c prepare FORCE
@@ -802,7 +810,10 @@ config-clean:
802810
$(call QUIET_CLEAN, config)
803811
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if $(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null
804812

805-
clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean
813+
python-clean:
814+
$(python-clean)
815+
816+
clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
806817
$(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
807818
$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
808819
$(Q)$(RM) $(OUTPUT).config-detected
@@ -811,6 +822,7 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea
811822
$(OUTPUT)util/intel-pt-decoder/inat-tables.c \
812823
$(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \
813824
$(OUTPUT)pmu-events/pmu-events.c \
825+
$(OUTPUT)$(madvise_behavior_array) \
814826
$(OUTPUT)$(drm_ioctl_array) \
815827
$(OUTPUT)$(pkey_alloc_access_rights_array) \
816828
$(OUTPUT)$(sndrv_ctl_ioctl_array) \
@@ -819,7 +831,6 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea
819831
$(OUTPUT)$(vhost_virtio_ioctl_array) \
820832
$(OUTPUT)$(perf_ioctl_array)
821833
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
822-
$(python-clean)
823834

824835
#
825836
# To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)

tools/perf/arch/x86/include/arch-tests.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ struct test;
88
int test__rdpmc(struct test *test __maybe_unused, int subtest);
99
int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest);
1010
int test__insn_x86(struct test *test __maybe_unused, int subtest);
11-
int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest);
1211

1312
#ifdef HAVE_DWARF_UNWIND_SUPPORT
1413
struct thread;

tools/perf/arch/x86/tests/Build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ libperf-y += arch-tests.o
55
libperf-y += rdpmc.o
66
libperf-y += perf-time-to-tsc.o
77
libperf-$(CONFIG_AUXTRACE) += insn-x86.o
8-
libperf-y += intel-cqm.o

tools/perf/arch/x86/tests/arch-tests.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ struct test arch_tests[] = {
2323
.func = test__insn_x86,
2424
},
2525
#endif
26-
{
27-
.desc = "Intel cqm nmi context read",
28-
.func = test__intel_cqm_count_nmi_context,
29-
},
3026
{
3127
.func = NULL,
3228
},

0 commit comments

Comments
 (0)