Skip to content

Commit 11737ca

Browse files
committed
Merge tag 'perf-core-for-mingo-4.17-20180216' 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: - Fix wrong jump arrow in systems with branch records with cycles, i.e. Intel's >= Skylake (Jin Yao) - Fix 'perf record --per-thread' problem introduced when implementing 'perf stat --per-thread (Jin Yao) - Use arch__compare_symbol_names() to fix 'perf test vmlinux', that was using strcmp(symbol names) while the dso routines doing symbol lookups used the arch overridable one, making this test fail in architectures that overrided that function with something other than strcmp() (Jiri Olsa) - Add 'perf script --show-round-event' to display PERF_RECORD_FINISHED_ROUND entries (Jiri Olsa) - Fix dwarf unwind for stripped binaries in 'perf test' (Jiri Olsa) - Use ordered_events for 'perf report --tasks', otherwise we may get artifacts when PERF_RECORD_FORK gets processed before PERF_RECORD_COMM (when they got recorded in different CPUs) (Jiri Olsa) - Add support to display group output for non group events, i.e. now when one uses 'perf report --group' on a perf.data file recorded without explicitly grouping events with {} (e.g. "perf record -e '{cycles,instructions}'" get the same output that would produce, i.e. see all those non-grouped events in multiple columns, at the same time (Jiri Olsa) - Skip non-address kallsyms entries, e.g. '(null)' for !root (Jiri Olsa) - Kernel maps fixes wrt perf.data(report) versus live system (top) (Jiri Olsa) - Fix memory corruption when using 'perf record -j call -g -a <application>' followed by 'perf report --branch-history' (Jiri Olsa) - ARM CoreSight fixes (Mathieu Poirier) - Add inject capability for CoreSight Traces (Robert Waker) - Update documentation for use of 'perf' + ARM CoreSight (Robert Walker) - Man pages fixes (Sangwon Hong, Jaecheol Shin) - Fix some 'perf test' cases on s/390 and x86_64 (some backtraces changed with a glibc update) (Thomas Richter) - Add detailed CPUID info in the 'perf.data' headers for s/390 to then use it in 'perf annotate' (Thomas Richter) - Add '--interval-count N' to 'perf stat', to use with -I, i.e. 'perf stat -I 1000 --interval-count 2' will show stats every 1000ms, two times (yuzhoujian) - Add 'perf stat --timeout Nms', that will run for that many milliseconds and then stop, printing the counters (yuzhoujian) - Fix description for 'perf report --mem-modex (Andi Kleen) - Use a wildcard to remove the vfs_getname probe in the 'perf test' shell based test cases (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 7057bb9 + 21316ac commit 11737ca

47 files changed

Lines changed: 1577 additions & 273 deletions

Some content is hidden

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

‎Documentation/trace/coresight.txt‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,54 @@ Details on how to use the generic STM API can be found here [2].
330330

331331
[1]. Documentation/ABI/testing/sysfs-bus-coresight-devices-stm
332332
[2]. Documentation/trace/stm.txt
333+
334+
335+
Using perf tools
336+
----------------
337+
338+
perf can be used to record and analyze trace of programs.
339+
340+
Execution can be recorded using 'perf record' with the cs_etm event,
341+
specifying the name of the sink to record to, e.g:
342+
343+
perf record -e cs_etm/@20070000.etr/u --per-thread
344+
345+
The 'perf report' and 'perf script' commands can be used to analyze execution,
346+
synthesizing instruction and branch events from the instruction trace.
347+
'perf inject' can be used to replace the trace data with the synthesized events.
348+
The --itrace option controls the type and frequency of synthesized events
349+
(see perf documentation).
350+
351+
Note that only 64-bit programs are currently supported - further work is
352+
required to support instruction decode of 32-bit Arm programs.
353+
354+
355+
Generating coverage files for Feedback Directed Optimization: AutoFDO
356+
---------------------------------------------------------------------
357+
358+
'perf inject' accepts the --itrace option in which case tracing data is
359+
removed and replaced with the synthesized events. e.g.
360+
361+
perf inject --itrace --strip -i perf.data -o perf.data.new
362+
363+
Below is an example of using ARM ETM for autoFDO. It requires autofdo
364+
(https://github.com/google/autofdo) and gcc version 5. The bubble
365+
sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tutorial).
366+
367+
$ gcc-5 -O3 sort.c -o sort
368+
$ taskset -c 2 ./sort
369+
Bubble sorting array of 30000 elements
370+
5910 ms
371+
372+
$ perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 ./sort
373+
Bubble sorting array of 30000 elements
374+
12543 ms
375+
[ perf record: Woken up 35 times to write data ]
376+
[ perf record: Captured and wrote 69.640 MB perf.data ]
377+
378+
$ perf inject -i perf.data -o inj.data --itrace=il64 --strip
379+
$ create_gcov --binary=./sort --profile=inj.data --gcov=sort.gcov -gcov_version=1
380+
$ gcc-5 -O3 -fauto-profile=sort.gcov sort.c -o sort_autofdo
381+
$ taskset -c 2 ./sort_autofdo
382+
Bubble sorting array of 30000 elements
383+
5806 ms

0 commit comments

Comments
 (0)