* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-02-05 16:25 Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 01/19] perf build tests: Elide "-f Makefile" from make invokation Arnaldo Carvalho de Melo ` (19 more replies) 0 siblings, 20 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Marcin Ślusarz, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit d3aaf09f889b31f3b424bf9603b163ec1204c361: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-04 08:58:01 +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 for you to fetch changes up to 598b7c6919c7bbcc1243009721a01bc12275ff3e: perf jit: add source line info support (2016-02-05 12:33:09 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible fixes: - Handle spaces in file names obtained from /proc/pid/maps (Marcin Ślusarz) New features: - Improved support for java, using the JVMTI agent library to do jitdumps that then will be inserted in synthesized PERF_RECORD_MMAP2 events via 'perf inject' pointed to synthesized ELF files stored in ~/.debug and keyed with build-ids, to allow symbol resolution and even annotation with source line info, see the changeset comments to see how to use it (Stephane Eranian) Documentation: - Document mmore variables in the 'perf config' man page (Taeung Song) Infrastructure: - Improve a bit the 'make -C tools/perf build-test' output (Arnaldo Carvalho de Melo) - Do 'build-test' in parallell, using 'make -j' (Arnaldo Carvalho de Melo) - Fix handling of 'clean' in multi-target make invokations for parallell builds (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (4): perf build tests: Elide "-f Makefile" from make invokation perf build tests: Move the feature related vars to the front of the make cmdline perf build tests: Do parallell builds with 'build-test' perf inject: Make sure mmap records are ordered when injecting build_ids Jiri Olsa (1): perf tools: Fix parallel build including 'clean' target Marcin Ślusarz (1): perf tools: handle spaces in file names obtained from /proc/pid/maps Stephane Eranian (5): perf symbols: add Java demangling support perf build: Add libcrypto feature detection perf inject: Add jitdump mmap injection support perf tools: add JVMTI agent library perf jit: add source line info support Taeung Song (8): perf config: Document 'ui.show-headers' variable in man page perf config: Document variables for 'call-graph' section in man page perf config: Document variables for 'report' section in man page perf config: Document 'top.children' variable in man page perf config: Document 'man.viewer' variable in man page perf config: Document 'pager.<subcommand>' variables in man page perf config: Document 'kmem.default' variable in man page perf config: Document 'record.build-id' variable in man page tools/build/Makefile.feature | 2 + tools/build/feature/Makefile | 4 + tools/build/feature/test-all.c | 5 + tools/build/feature/test-libcrypto.c | 17 + tools/perf/Documentation/perf-config.txt | 143 +++++++ tools/perf/Documentation/perf-inject.txt | 7 + tools/perf/Makefile | 16 +- tools/perf/Makefile.perf | 3 + tools/perf/builtin-inject.c | 107 ++++- tools/perf/config/Makefile | 11 + tools/perf/jvmti/Makefile | 76 ++++ tools/perf/jvmti/jvmti_agent.c | 465 +++++++++++++++++++++ tools/perf/jvmti/jvmti_agent.h | 36 ++ tools/perf/jvmti/libjvmti.c | 304 ++++++++++++++ tools/perf/tests/make | 11 +- tools/perf/util/Build | 6 + tools/perf/util/demangle-java.c | 199 +++++++++ tools/perf/util/demangle-java.h | 10 + tools/perf/util/event.c | 2 +- tools/perf/util/genelf.c | 449 +++++++++++++++++++++ tools/perf/util/genelf.h | 67 +++ tools/perf/util/genelf_debug.c | 610 ++++++++++++++++++++++++++++ tools/perf/util/jit.h | 15 + tools/perf/util/jitdump.c | 672 +++++++++++++++++++++++++++++++ tools/perf/util/jitdump.h | 124 ++++++ tools/perf/util/symbol-elf.c | 3 + 26 files changed, 3357 insertions(+), 7 deletions(-) create mode 100644 tools/build/feature/test-libcrypto.c create mode 100644 tools/perf/jvmti/Makefile create mode 100644 tools/perf/jvmti/jvmti_agent.c create mode 100644 tools/perf/jvmti/jvmti_agent.h create mode 100644 tools/perf/jvmti/libjvmti.c create mode 100644 tools/perf/util/demangle-java.c create mode 100644 tools/perf/util/demangle-java.h create mode 100644 tools/perf/util/genelf.c create mode 100644 tools/perf/util/genelf.h create mode 100644 tools/perf/util/genelf_debug.c create mode 100644 tools/perf/util/jit.h create mode 100644 tools/perf/util/jitdump.c create mode 100644 tools/perf/util/jitdump.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH 01/19] perf build tests: Elide "-f Makefile" from make invokation 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 02/19] perf build tests: Move the feature related vars to the front of the make cmdline Arnaldo Carvalho de Melo ` (18 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan See http://www.infradead.org/rpr.html From: Arnaldo Carvalho de Melo <acme@redhat.com> Since this is the name that 'make' will look for if no explicit -f file is passed. This in turn makes the output of 'build-test' more compact: Before: $ perf stat make -C tools/perf build-test <SNIP> cd . && make FEATURE_DUMP_COPY=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump make_no_libaudit_O: cd . && make -f Makefile O=/tmp/tmp.tHIa0Kkk2Y DESTDIR=/tmp/tmp.foK7rckkVi NO_LIBAUDIT=1 FEATURES_DUMP=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP <SNIP> After: $ perf stat make -C tools/perf build-test <SNIP> make_no_libaudit_O: cd . && make O=/tmp/tmp.tHIa0Kkk2Y DESTDIR=/tmp/tmp.foK7rckkVi NO_LIBAUDIT=1 FEATURES_DUMP=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP <SNIP> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-m440lb8dkfsywsyah0htif6t@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/make | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/make b/tools/perf/tests/make index cc72b67bde5e..0b70cf16a562 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -111,6 +111,9 @@ run := make_pure # disable features detection ifeq ($(MK),Makefile) run += make_clean_all +MAKE_F := $(MAKE) +else +MAKE_F := $(MAKE) -f $(MK) endif run += make_python_perf_so run += make_debug @@ -270,12 +273,12 @@ endif MAKEFLAGS := --no-print-directory -clean := @(cd $(PERF); make -s -f $(MK) $(O_OPT) clean >/dev/null) +clean := @(cd $(PERF); $(MAKE_F) -s $(O_OPT) clean >/dev/null) $(run): $(call clean) @TMP_DEST=$$(mktemp -d); \ - cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST $($@)"; \ + cmd="cd $(PERF) && $(MAKE_F) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST $($@)"; \ printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \ ( eval $$cmd ) >> $@ 2>&1; \ echo " test: $(call test,$@)" >> $@ 2>&1; \ @@ -286,7 +289,7 @@ $(run_O): $(call clean) @TMP_O=$$(mktemp -d); \ TMP_DEST=$$(mktemp -d); \ - cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \ + cmd="cd $(PERF) && $(MAKE_F) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \ printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \ ( eval $$cmd ) >> $@ 2>&1 && \ echo " test: $(call test_O,$@)" >> $@ 2>&1; \ -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 02/19] perf build tests: Move the feature related vars to the front of the make cmdline 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 01/19] perf build tests: Elide "-f Makefile" from make invokation Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 03/19] perf config: Document 'ui.show-headers' variable in man page Arnaldo Carvalho de Melo ` (17 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> So that we do less visual searching on the 'make build-test' output to see the feature related variables: After: $ make -C tools/perf build-test <SNIP> make_no_newt_O: cd . && make NO_NEWT=1 FEATURES_DUMP=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP O=/tmp/tmp.dz55IX DESTDIR=/tmp/tmp.X29xxo make_tags_O: cd . && make tags FEATURES_DUMP=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP O=/tmp/tmp.6ecLh8 DESTDIR=/tmp/tmp.6vIla578Ho make_util_pmu_bison_o_O: cd . && make util/pmu-bison.o FEATURES_DUMP=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP O=/tmp/tmp.SVPM2G DESTDIR=/tmp/tmp.C0oAam Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-dx4krgzqa566v1pedrbrcchi@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/make | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 0b70cf16a562..12dcae7aa515 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -278,7 +278,7 @@ clean := @(cd $(PERF); $(MAKE_F) -s $(O_OPT) clean >/dev/null) $(run): $(call clean) @TMP_DEST=$$(mktemp -d); \ - cmd="cd $(PERF) && $(MAKE_F) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST $($@)"; \ + cmd="cd $(PERF) && $(MAKE_F) $($@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \ printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \ ( eval $$cmd ) >> $@ 2>&1; \ echo " test: $(call test,$@)" >> $@ 2>&1; \ @@ -289,7 +289,7 @@ $(run_O): $(call clean) @TMP_O=$$(mktemp -d); \ TMP_DEST=$$(mktemp -d); \ - cmd="cd $(PERF) && $(MAKE_F) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \ + cmd="cd $(PERF) && $(MAKE_F) $($(patsubst %_O,%,$@)) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST"; \ printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \ ( eval $$cmd ) >> $@ 2>&1 && \ echo " test: $(call test_O,$@)" >> $@ 2>&1; \ -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 03/19] perf config: Document 'ui.show-headers' variable in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 01/19] perf build tests: Elide "-f Makefile" from make invokation Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 02/19] perf build tests: Move the feature related vars to the front of the make cmdline Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 04/19] perf config: Document variables for 'call-graph' section " Arnaldo Carvalho de Melo ` (16 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Taeung Song <treeze.taeung@gmail.com> This option controls display of column headers (like 'Overhead' and 'Symbol') in 'report' and 'top'. If this option is false, they are hidden. This option is only applied to TUI. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-2-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 74589c68558a..42787222ad15 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -296,6 +296,12 @@ hist.*:: and 'baz' to 50.00% for each, while 'absolute' would show their current overhead (33.33%). +ui.*:: + ui.show-headers:: + This option controls display of column headers (like 'Overhead' and 'Symbol') + in 'report' and 'top'. If this option is false, they are hidden. + This option is only applied to TUI. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 04/19] perf config: Document variables for 'call-graph' section in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (2 preceding siblings ...) 2016-02-05 16:25 ` [PATCH 03/19] perf config: Document 'ui.show-headers' variable in man page Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 05/19] perf config: Document variables for 'report' " Arnaldo Carvalho de Melo ` (15 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Taeung Song <treeze.taeung@gmail.com> Explain 'call-graph' section and its variables: 'record-mode', 'dump-size', 'print-type', 'order', 'sort-key', 'threshold' and 'print-limit'. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-3-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 67 ++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 42787222ad15..42310ae7e636 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -302,6 +302,73 @@ ui.*:: in 'report' and 'top'. If this option is false, they are hidden. This option is only applied to TUI. +call-graph.*:: + When sub-commands 'top' and 'report' work with -g/—-children + there're options in control of call-graph. + + call-graph.record-mode:: + The record-mode can be 'fp' (frame pointer), 'dwarf' and 'lbr'. + The value of 'dwarf' is effective only if perf detect needed library + (libunwind or a recent version of libdw). + 'lbr' only work for cpus that support it. + + call-graph.dump-size:: + The size of stack to dump in order to do post-unwinding. Default is 8192 (byte). + When using dwarf into record-mode, the default size will be used if omitted. + + call-graph.print-type:: + The print-types can be graph (graph absolute), fractal (graph relative), + flat and folded. This option controls a way to show overhead for each callchain + entry. Suppose a following example. + + Overhead Symbols + ........ ....... + 40.00% foo + | + ---foo + | + |--50.00%--bar + | main + | + --50.00%--baz + main + + This output is a 'fractal' format. The 'foo' came from 'bar' and 'baz' exactly + half and half so 'fractal' shows 50.00% for each + (meaning that it assumes 100% total overhead of 'foo'). + + The 'graph' uses absolute overhead value of 'foo' as total so each of + 'bar' and 'baz' callchain will have 20.00% of overhead. + If 'flat' is used, single column and linear exposure of call chains. + 'folded' mean call chains are displayed in a line, separated by semicolons. + + call-graph.order:: + This option controls print order of callchains. The default is + 'callee' which means callee is printed at top and then followed by its + caller and so on. The 'caller' prints it in reverse order. + + If this option is not set and report.children or top.children is + set to true (or the equivalent command line option is given), + the default value of this option is changed to 'caller' for the + execution of 'perf report' or 'perf top'. Other commands will + still default to 'callee'. + + call-graph.sort-key:: + The callchains are merged if they contain same information. + The sort-key option determines a way to compare the callchains. + A value of 'sort-key' can be 'function' or 'address'. + The default is 'function'. + + call-graph.threshold:: + When there're many callchains it'd print tons of lines. So perf omits + small callchains under a certain overhead (threshold) and this option + control the threshold. Default is 0.5 (%). The overhead is calculated + by value depends on call-graph.print-type. + + call-graph.print-limit:: + This is a maximum number of lines of callchain printed for a single + histogram entry. Default is 0 which means no limitation. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 05/19] perf config: Document variables for 'report' section in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (3 preceding siblings ...) 2016-02-05 16:25 ` [PATCH 04/19] perf config: Document variables for 'call-graph' section " Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 06/19] perf config: Document 'top.children' variable " Arnaldo Carvalho de Melo ` (14 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Taeung Song <treeze.taeung@gmail.com> Explain 'report' section's variables: 'percent-limit', 'queue-size' and 'children'. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-4-git-send-email-treeze.taeung@gmail.com [ Fix some grammar issues, add some more info ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 42310ae7e636..f38f46f67d74 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -369,6 +369,42 @@ call-graph.*:: This is a maximum number of lines of callchain printed for a single histogram entry. Default is 0 which means no limitation. +report.*:: + report.percent-limit:: + This one is mostly the same as call-graph.threshold but works for + histogram entries. Entries having an overhead lower than this + percentage will not be printed. Default is '0'. If percent-limit + is '10', only entries which have more than 10% of overhead will be + printed. + + report.queue-size:: + This option sets up the maximum allocation size of the internal + event queue for ordering events. Default is 0, meaning no limit. + + report.children:: + 'Children' means functions called from another function. + If this option is true, 'perf report' cumulates callchains of children + and show (accumulated) total overhead as well as 'Self' overhead. + Please refer to the 'perf report' manual. The default is 'true'. + + report.group:: + This option is to show event group information together. + Example output with this turned on, notice that there is one column + per event in the group, ref-cycles and cycles: + + # group: {ref-cycles,cycles} + # ======== + # + # Samples: 7K of event 'anon group { ref-cycles, cycles }' + # Event count (approx.): 6876107743 + # + # Overhead Command Shared Object Symbol + # ................ ....... ................. ................... + # + 99.84% 99.76% noploop noploop [.] main + 0.07% 0.00% noploop ld-2.15.so [.] strcmp + 0.03% 0.00% noploop [kernel.kallsyms] [k] timerqueue_del + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 06/19] perf config: Document 'top.children' variable in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (4 preceding siblings ...) 2016-02-05 16:25 ` [PATCH 05/19] perf config: Document variables for 'report' " Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 07/19] perf config: Document 'man.viewer' " Arnaldo Carvalho de Melo ` (13 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo From: Taeung Song <treeze.taeung@gmail.com> Explain 'top.children' variable. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-5-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index f38f46f67d74..5e1db5ae53c4 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -405,6 +405,13 @@ report.*:: 0.07% 0.00% noploop ld-2.15.so [.] strcmp 0.03% 0.00% noploop [kernel.kallsyms] [k] timerqueue_del +top.*:: + top.children:: + Same as 'report.children'. So if it is enabled, the output of 'top' + command will have 'Children' overhead column as well as 'Self' overhead + column by default. + The default is 'true'. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 07/19] perf config: Document 'man.viewer' variable in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (5 preceding siblings ...) 2016-02-05 16:25 ` [PATCH 06/19] perf config: Document 'top.children' variable " Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 08/19] perf config: Document 'pager.<subcommand>' variables " Arnaldo Carvalho de Melo ` (12 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo From: Taeung Song <treeze.taeung@gmail.com> Explain 'man.viewer' variable and how to add new man viewer tools. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-6-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 5e1db5ae53c4..fd3f048c9644 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -412,6 +412,15 @@ top.*:: column by default. The default is 'true'. +man.*:: + man.viewer:: + This option can assign a tool to view manual pages when 'help' + subcommand was invoked. Supported tools are 'man', 'woman' + (with emacs client) and 'konqueror'. Default is 'man'. + + New man viewer tool can be also added using 'man.<tool>.cmd' + or use different path using 'man.<tool>.path' config option. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 08/19] perf config: Document 'pager.<subcommand>' variables in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (6 preceding siblings ...) 2016-02-05 16:25 ` [PATCH 07/19] perf config: Document 'man.viewer' " Arnaldo Carvalho de Melo @ 2016-02-05 16:25 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 09/19] perf config: Document 'kmem.default' variable " Arnaldo Carvalho de Melo ` (11 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Taeung Song <treeze.taeung@gmail.com> Explain 'pager.<subcommand>' variables. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-7-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index fd3f048c9644..99aa72e5e9cf 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -421,6 +421,11 @@ man.*:: New man viewer tool can be also added using 'man.<tool>.cmd' or use different path using 'man.<tool>.path' config option. +pager.*:: + pager.<subcommand>:: + When the subcommand is run on stdio, determine whether it uses + pager or not based on this value. Default is 'unspecified'. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 09/19] perf config: Document 'kmem.default' variable in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (7 preceding siblings ...) 2016-02-05 16:25 ` [PATCH 08/19] perf config: Document 'pager.<subcommand>' variables " Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 10/19] perf config: Document 'record.build-id' " Arnaldo Carvalho de Melo ` (10 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo From: Taeung Song <treeze.taeung@gmail.com> Explain 'kmem.default' variable. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-8-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 99aa72e5e9cf..fb1f4a984e63 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -426,6 +426,11 @@ pager.*:: When the subcommand is run on stdio, determine whether it uses pager or not based on this value. Default is 'unspecified'. +kmem.*:: + kmem.default:: + This option decides which allocator is to be analyzed if neither + '--slab' nor '--page' option is used. Default is 'slab'. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 10/19] perf config: Document 'record.build-id' variable in man page 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (8 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 09/19] perf config: Document 'kmem.default' variable " Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 11/19] perf tools: Fix parallel build including 'clean' target Arnaldo Carvalho de Melo ` (9 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Taeung Song <treeze.taeung@gmail.com> Explain 'record.build-id' variable. Signed-off-by: Taeung Song <treeze.taeung@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1454577913-16401-9-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-config.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index fb1f4a984e63..c7158bfb1649 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -431,6 +431,14 @@ kmem.*:: This option decides which allocator is to be analyzed if neither '--slab' nor '--page' option is used. Default is 'slab'. +record.*:: + record.build-id:: + This option can be 'cache', 'no-cache' or 'skip'. + 'cache' is to post-process data and save/update the binaries into + the build-id cache (in ~/.debug). This is the default. + But if this option is 'no-cache', it will not update the build-id cache. + 'skip' skips post-processing and does not update the cache. + SEE ALSO -------- linkperf:perf[1] -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 11/19] perf tools: Fix parallel build including 'clean' target 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (9 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 10/19] perf config: Document 'record.build-id' " Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 12/19] perf build tests: Do parallell builds with 'build-test' Arnaldo Carvalho de Melo ` (8 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Jiri Olsa, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@redhat.com> Do not parallelize 'clean' with other targets, figure out if it is present and do it first, then the other targets. Noticed with: tools/perf> make -j24 clean all LD arch/libperf-in.o LD plugin_xen-in.o arch//libperf-in.o: file not recognized: File truncated make[3]: *** [arch/libperf-in.o] Error 1 make[2]: *** [arch] Error 2 make[2]: *** Waiting for unfinished jobs.... AR libapi.a Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-kb0qs29zbz7hxn32mc5zbsoz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 4b68f465195c..67837c6cdbd8 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -68,6 +68,20 @@ all tags TAGS: $(print_msg) $(make) +ifdef MAKECMDGOALS +has_clean := 0 +ifneq ($(filter clean,$(MAKECMDGOALS)),) + has_clean := 1 +endif # clean + +ifeq ($(has_clean),1) + rest := $(filter-out clean,$(MAKECMDGOALS)) + ifneq ($(rest),) +$(rest): clean + endif # rest +endif # has_clean +endif # MAKECMDGOALS + # # The clean target is not really parallel, don't print the jobs info: # -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 12/19] perf build tests: Do parallell builds with 'build-test' 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (10 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 11/19] perf tools: Fix parallel build including 'clean' target Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 13/19] perf tools: handle spaces in file names obtained from /proc/pid/maps Arnaldo Carvalho de Melo ` (7 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan See http://www.infradead.org/rpr.html From: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-jhmnf9g7y9ryqcjql00unk5y@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 67837c6cdbd8..32a64e619028 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -99,7 +99,7 @@ clean: # make -C tools/perf -f tests/make # build-test: - @$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile --no-print-directory tarpkg out + @$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory tarpkg out # # All other targets get passed through: -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 13/19] perf tools: handle spaces in file names obtained from /proc/pid/maps 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (11 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 12/19] perf build tests: Do parallell builds with 'build-test' Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 14/19] perf symbols: add Java demangling support Arnaldo Carvalho de Melo ` (6 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Marcin Ślusarz, Arnaldo Carvalho de Melo From: Marcin Ślusarz <marcin.slusarz@gmail.com> Steam frequently puts game binaries in folders with spaces. Note: "(deleted)" markers are now treated as part of the file name. Signed-off-by: Marcin Ślusarz <marcin.slusarz@gmail.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Fixes: 6064803313ba ("perf tools: Use sscanf for parsing /proc/pid/maps") Link: http://lkml.kernel.org/r/20160119190303.GA17579@marcin-Inspiron-7720 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 85155e91b61b..7bad5c3fa7b7 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -282,7 +282,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool, strcpy(execname, ""); /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ - n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", + n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %[^\n]\n", &event->mmap2.start, &event->mmap2.len, prot, &event->mmap2.pgoff, &event->mmap2.maj, &event->mmap2.min, -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 14/19] perf symbols: add Java demangling support 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (12 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 13/19] perf tools: handle spaces in file names obtained from /proc/pid/maps Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 15/19] perf build: Add libcrypto feature detection Arnaldo Carvalho de Melo ` (5 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Stephane Eranian, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Stephane Eranian <eranian@google.com> Add Java function descriptor demangling support. Something bfd cannot do. Use the JAVA_DEMANGLE_NORET flag to avoid decoding the return type of functions. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-2-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/Build | 1 + tools/perf/util/demangle-java.c | 199 ++++++++++++++++++++++++++++++++++++++++ tools/perf/util/demangle-java.h | 10 ++ tools/perf/util/symbol-elf.c | 3 + 4 files changed, 213 insertions(+) create mode 100644 tools/perf/util/demangle-java.c create mode 100644 tools/perf/util/demangle-java.h diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 5eec53a3f4ac..edae107416b6 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -105,6 +105,7 @@ libperf-y += scripting-engines/ libperf-$(CONFIG_ZLIB) += zlib.o libperf-$(CONFIG_LZMA) += lzma.o +libperf-y += demangle-java.o CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" diff --git a/tools/perf/util/demangle-java.c b/tools/perf/util/demangle-java.c new file mode 100644 index 000000000000..3e6062ab2cdd --- /dev/null +++ b/tools/perf/util/demangle-java.c @@ -0,0 +1,199 @@ +#include <sys/types.h> +#include <stdio.h> +#include <string.h> +#include "util.h" +#include "debug.h" +#include "symbol.h" + +#include "demangle-java.h" + +enum { + MODE_PREFIX = 0, + MODE_CLASS = 1, + MODE_FUNC = 2, + MODE_TYPE = 3, + MODE_CTYPE = 3, /* class arg */ +}; + +#define BASE_ENT(c, n) [c - 'A']=n +static const char *base_types['Z' - 'A' + 1] = { + BASE_ENT('B', "byte" ), + BASE_ENT('C', "char" ), + BASE_ENT('D', "double" ), + BASE_ENT('F', "float" ), + BASE_ENT('I', "int" ), + BASE_ENT('J', "long" ), + BASE_ENT('S', "short" ), + BASE_ENT('Z', "bool" ), +}; + +/* + * demangle Java symbol between str and end positions and stores + * up to maxlen characters into buf. The parser starts in mode. + * + * Use MODE_PREFIX to process entire prototype till end position + * Use MODE_TYPE to process return type if str starts on return type char + * + * Return: + * success: buf + * error : NULL + */ +static char * +__demangle_java_sym(const char *str, const char *end, char *buf, int maxlen, int mode) +{ + int rlen = 0; + int array = 0; + int narg = 0; + const char *q; + + if (!end) + end = str + strlen(str); + + for (q = str; q != end; q++) { + + if (rlen == (maxlen - 1)) + break; + + switch (*q) { + case 'L': + if (mode == MODE_PREFIX || mode == MODE_CTYPE) { + if (mode == MODE_CTYPE) { + if (narg) + rlen += scnprintf(buf + rlen, maxlen - rlen, ", "); + narg++; + } + rlen += scnprintf(buf + rlen, maxlen - rlen, "class "); + if (mode == MODE_PREFIX) + mode = MODE_CLASS; + } else + buf[rlen++] = *q; + break; + case 'B': + case 'C': + case 'D': + case 'F': + case 'I': + case 'J': + case 'S': + case 'Z': + if (mode == MODE_TYPE) { + if (narg) + rlen += scnprintf(buf + rlen, maxlen - rlen, ", "); + rlen += scnprintf(buf + rlen, maxlen - rlen, "%s", base_types[*q - 'A']); + while (array--) + rlen += scnprintf(buf + rlen, maxlen - rlen, "[]"); + array = 0; + narg++; + } else + buf[rlen++] = *q; + break; + case 'V': + if (mode == MODE_TYPE) { + rlen += scnprintf(buf + rlen, maxlen - rlen, "void"); + while (array--) + rlen += scnprintf(buf + rlen, maxlen - rlen, "[]"); + array = 0; + } else + buf[rlen++] = *q; + break; + case '[': + if (mode != MODE_TYPE) + goto error; + array++; + break; + case '(': + if (mode != MODE_FUNC) + goto error; + buf[rlen++] = *q; + mode = MODE_TYPE; + break; + case ')': + if (mode != MODE_TYPE) + goto error; + buf[rlen++] = *q; + narg = 0; + break; + case ';': + if (mode != MODE_CLASS && mode != MODE_CTYPE) + goto error; + /* safe because at least one other char to process */ + if (isalpha(*(q + 1))) + rlen += scnprintf(buf + rlen, maxlen - rlen, "."); + if (mode == MODE_CLASS) + mode = MODE_FUNC; + else if (mode == MODE_CTYPE) + mode = MODE_TYPE; + break; + case '/': + if (mode != MODE_CLASS && mode != MODE_CTYPE) + goto error; + rlen += scnprintf(buf + rlen, maxlen - rlen, "."); + break; + default : + buf[rlen++] = *q; + } + } + buf[rlen] = '\0'; + return buf; +error: + return NULL; +} + +/* + * Demangle Java function signature (openJDK, not GCJ) + * input: + * str: string to parse. String is not modified + * flags: comobination of JAVA_DEMANGLE_* flags to modify demangling + * return: + * if input can be demangled, then a newly allocated string is returned. + * if input cannot be demangled, then NULL is returned + * + * Note: caller is responsible for freeing demangled string + */ +char * +java_demangle_sym(const char *str, int flags) +{ + char *buf, *ptr; + char *p; + size_t len, l1 = 0; + + if (!str) + return NULL; + + /* find start of retunr type */ + p = strrchr(str, ')'); + if (!p) + return NULL; + + /* + * expansion factor estimated to 3x + */ + len = strlen(str) * 3 + 1; + buf = malloc(len); + if (!buf) + return NULL; + + buf[0] = '\0'; + if (!(flags & JAVA_DEMANGLE_NORET)) { + /* + * get return type first + */ + ptr = __demangle_java_sym(p + 1, NULL, buf, len, MODE_TYPE); + if (!ptr) + goto error; + + /* add space between return type and function prototype */ + l1 = strlen(buf); + buf[l1++] = ' '; + } + + /* process function up to return type */ + ptr = __demangle_java_sym(str, p + 1, buf + l1, len - l1, MODE_PREFIX); + if (!ptr) + goto error; + + return buf; +error: + free(buf); + return NULL; +} diff --git a/tools/perf/util/demangle-java.h b/tools/perf/util/demangle-java.h new file mode 100644 index 000000000000..a981c1f968fe --- /dev/null +++ b/tools/perf/util/demangle-java.h @@ -0,0 +1,10 @@ +#ifndef __PERF_DEMANGLE_JAVA +#define __PERF_DEMANGLE_JAVA 1 +/* + * demangle function flags + */ +#define JAVA_DEMANGLE_NORET 0x1 /* do not process return type */ + +char * java_demangle_sym(const char *str, int flags); + +#endif /* __PERF_DEMANGLE_JAVA */ diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 562b8ebeae5b..b1dd68f358fc 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -6,6 +6,7 @@ #include <inttypes.h> #include "symbol.h" +#include "demangle-java.h" #include "machine.h" #include "vdso.h" #include <symbol/kallsyms.h> @@ -1077,6 +1078,8 @@ new_symbol: demangle_flags = DMGL_PARAMS | DMGL_ANSI; demangled = bfd_demangle(NULL, elf_name, demangle_flags); + if (demangled == NULL) + demangled = java_demangle_sym(elf_name, JAVA_DEMANGLE_NORET); if (demangled != NULL) elf_name = demangled; } -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 15/19] perf build: Add libcrypto feature detection 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (13 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 14/19] perf symbols: add Java demangling support Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 16/19] perf inject: Make sure mmap records are ordered when injecting build_ids Arnaldo Carvalho de Melo ` (4 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Stephane Eranian, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo From: Stephane Eranian <eranian@google.com> Will be used to generate build-ids in the jitdump code. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-3-git-send-email-eranian@google.com [ tools/perf/Makefile.perf comment about NO_LIBCRYPTO and added it to tests/make ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/build/Makefile.feature | 2 ++ tools/build/feature/Makefile | 4 ++++ tools/build/feature/test-all.c | 5 +++++ tools/build/feature/test-libcrypto.c | 17 +++++++++++++++++ tools/perf/Makefile.perf | 3 +++ tools/perf/config/Makefile | 11 +++++++++++ tools/perf/tests/make | 2 ++ 7 files changed, 44 insertions(+) create mode 100644 tools/build/feature/test-libcrypto.c diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 7bff2ea831cf..6b7707270aa3 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -46,6 +46,7 @@ FEATURE_TESTS_BASIC := \ libpython \ libpython-version \ libslang \ + libcrypto \ libunwind \ pthread-attr-setaffinity-np \ stackprotector-all \ @@ -87,6 +88,7 @@ FEATURE_DISPLAY ?= \ libperl \ libpython \ libslang \ + libcrypto \ libunwind \ libdw-dwarf-unwind \ zlib \ diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index bf8f0352264d..c5f4c417428d 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -23,6 +23,7 @@ FILES= \ test-libpython.bin \ test-libpython-version.bin \ test-libslang.bin \ + test-libcrypto.bin \ test-libunwind.bin \ test-libunwind-debug-frame.bin \ test-pthread-attr-setaffinity-np.bin \ @@ -105,6 +106,9 @@ $(OUTPUT)test-libaudit.bin: $(OUTPUT)test-libslang.bin: $(BUILD) -I/usr/include/slang -lslang +$(OUTPUT)test-libcrypto.bin: + $(BUILD) -lcrypto + $(OUTPUT)test-gtk2.bin: $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c index 81025cade45f..e499a36c1e4a 100644 --- a/tools/build/feature/test-all.c +++ b/tools/build/feature/test-all.c @@ -129,6 +129,10 @@ # include "test-bpf.c" #undef main +#define main main_test_libcrypto +# include "test-libcrypto.c" +#undef main + int main(int argc, char *argv[]) { main_test_libpython(); @@ -158,6 +162,7 @@ int main(int argc, char *argv[]) main_test_lzma(); main_test_get_cpuid(); main_test_bpf(); + main_test_libcrypto(); return 0; } diff --git a/tools/build/feature/test-libcrypto.c b/tools/build/feature/test-libcrypto.c new file mode 100644 index 000000000000..bd79dc7f28d3 --- /dev/null +++ b/tools/build/feature/test-libcrypto.c @@ -0,0 +1,17 @@ +#include <openssl/sha.h> +#include <openssl/md5.h> + +int main(void) +{ + MD5_CTX context; + unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; + unsigned char dat[] = "12345"; + + MD5_Init(&context); + MD5_Update(&context, &dat[0], sizeof(dat)); + MD5_Final(&md[0], &context); + + SHA1(&dat[0], sizeof(dat), &md[0]); + + return 0; +} diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 0ef3d97d7954..d404117810a7 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -58,6 +58,9 @@ include config/utilities.mak # # Define NO_LIBBIONIC if you do not want bionic support # +# Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support +# used for generating build-ids for ELFs generated by jitdump. +# # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support # for dwarf backtrace post unwind. # diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 0045a5ddd0ca..f7aeaf303f5a 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -404,6 +404,17 @@ ifndef NO_LIBAUDIT endif endif +ifndef NO_LIBCRYPTO + ifneq ($(feature-libcrypto), 1) + msg := $(warning No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev); + NO_LIBCRYPTO := 1 + else + CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT + EXTLIBS += -lcrypto + $(call detected,CONFIG_CRYPTO) + endif +endif + ifdef NO_NEWT NO_SLANG=1 endif diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 12dcae7aa515..cac15d93aea6 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -80,6 +80,7 @@ make_no_libaudit := NO_LIBAUDIT=1 make_no_libbionic := NO_LIBBIONIC=1 make_no_auxtrace := NO_AUXTRACE=1 make_no_libbpf := NO_LIBBPF=1 +make_no_libcrypto := NO_LIBCRYPTO=1 make_tags := tags make_cscope := cscope make_help := help @@ -103,6 +104,7 @@ make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 +make_minimal += NO_LIBCRYPTO=1 # $(run) contains all available tests run := make_pure -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 16/19] perf inject: Make sure mmap records are ordered when injecting build_ids 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (14 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 15/19] perf build: Add libcrypto feature detection Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 17/19] perf inject: Add jitdump mmap injection support Arnaldo Carvalho de Melo ` (3 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Stephane Eranian, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Sukadev Bhattiprolu From: Arnaldo Carvalho de Melo <acme@redhat.com> To make sure the mmap records are ordered correctly and so that the correct especially due to jitted code mmaps. We cannot generate the buildid hit list and inject the jit mmaps (will come right after this patch) in at the same time for now. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-3-git-send-email-eranian@google.com [ Carved out from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-inject.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 0022e02ed31a..6567baedd92a 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -755,6 +755,17 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) if (inject.session == NULL) return -1; + if (inject.build_ids) { + /* + * to make sure the mmap records are ordered correctly + * and so that the correct especially due to jitted code + * mmaps. We cannot generate the buildid hit list and + * inject the jit mmaps at the same time for now. + */ + inject.tool.ordered_events = true; + inject.tool.ordering_requires_timestamps = true; + } + ret = symbol__init(&inject.session->header.env); if (ret < 0) goto out_delete; -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 17/19] perf inject: Add jitdump mmap injection support 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (15 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 16/19] perf inject: Make sure mmap records are ordered when injecting build_ids Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 18/19] perf tools: add JVMTI agent library Arnaldo Carvalho de Melo ` (2 subsequent siblings) 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Stephane Eranian, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo From: Stephane Eranian <eranian@google.com> This patch adds a --jit/-j option to perf inject. This options injects MMAP records into the perf.data file to cover the jitted code mmaps. It also emits ELF images for each function in the jidump file. Those images are created where the jitdump file is. The MMAP records point to that location as well. Typical flow: $ perf record -k mono -- java -agentpath:libpjvmti.so java_class $ perf inject --jit -i perf.data -o perf.data.jitted $ perf report -i perf.data.jitted Note that jitdump.h support is not limited to Java, it works with any jitted environment modified to emit the jitdump file format, include those where code can be jitted multiple times and moved around. The jitdump.h format is adapted from the Oprofile project. The genelf.c (ELF binary generation) depends on MD5 hash encoding for the buildid. To enable this, libssl-dev must be installed. If not, then genelf.c defaults to using urandom to generate the buildid, which is not ideal. The Makefile auto-detects the presence on libssl-dev. This version mmaps the jitdump file to create a marker MMAP record in the perf.data file. The marker is used to detect jitdump and cause perf inject to inject the jitted mmaps and generate ELF images for jitted functions. In V8, the following fixes and changes were made among other things: - the jidump header format include a new flags field to be used to carry information about the configuration of the runtime agent. Contributed by: Adrian Hunter <adrian.hunter@intel.com> - Fix mmap pgoff: MMAP event pgoff must be the offset within the ELF file at which the code resides. Contributed by: Adrian Hunter <adrian.hunter@intel.com> - Fix ELF virtual addresses: perf tools expect the ELF virtual addresses of dynamic objects to match the file offset. Contributed by: Adrian Hunter <adrian.hunter@intel.com> - JIT MMAP injection does not obey finished_round semantics. JIT MMAP injection injects all MMAP events in one go, so it does not obey finished_round semantics, so drop the finished_round events from the output perf.data file. Contributed by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-3-git-send-email-eranian@google.com [ Moved inject.build_ids ordering bits to a separate patch, fixed the NO_LIBELF=1 build ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-inject.txt | 7 + tools/perf/builtin-inject.c | 98 ++++- tools/perf/util/Build | 2 + tools/perf/util/genelf.c | 442 ++++++++++++++++++++ tools/perf/util/genelf.h | 63 +++ tools/perf/util/jit.h | 15 + tools/perf/util/jitdump.c | 670 +++++++++++++++++++++++++++++++ tools/perf/util/jitdump.h | 124 ++++++ 8 files changed, 1418 insertions(+), 3 deletions(-) create mode 100644 tools/perf/util/genelf.c create mode 100644 tools/perf/util/genelf.h create mode 100644 tools/perf/util/jit.h create mode 100644 tools/perf/util/jitdump.c create mode 100644 tools/perf/util/jitdump.h diff --git a/tools/perf/Documentation/perf-inject.txt b/tools/perf/Documentation/perf-inject.txt index 0b1cedeef895..87b2588d1cbd 100644 --- a/tools/perf/Documentation/perf-inject.txt +++ b/tools/perf/Documentation/perf-inject.txt @@ -53,6 +53,13 @@ include::itrace.txt[] --strip:: Use with --itrace to strip out non-synthesized events. +-j:: +--jit:: + Process jitdump files by injecting the mmap records corresponding to jitted + functions. This option also generates the ELF images for each jitted function + found in the jitdumps files captured in the input perf.data file. Use this option + if you are monitoring environment using JIT runtimes, such as Java, DART or V8. + SEE ALSO -------- linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1] diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 6567baedd92a..b38445f08c2f 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -17,6 +17,7 @@ #include "util/build-id.h" #include "util/data.h" #include "util/auxtrace.h" +#include "util/jit.h" #include <subcmd/parse-options.h> @@ -29,6 +30,7 @@ struct perf_inject { bool sched_stat; bool have_auxtrace; bool strip; + bool jit_mode; const char *input_name; struct perf_data_file output; u64 bytes_written; @@ -71,6 +73,15 @@ static int perf_event__repipe_oe_synth(struct perf_tool *tool, return perf_event__repipe_synth(tool, event); } +#ifdef HAVE_LIBELF_SUPPORT +static int perf_event__drop_oe(struct perf_tool *tool __maybe_unused, + union perf_event *event __maybe_unused, + struct ordered_events *oe __maybe_unused) +{ + return 0; +} +#endif + static int perf_event__repipe_op2_synth(struct perf_tool *tool, union perf_event *event, struct perf_session *session @@ -234,6 +245,27 @@ static int perf_event__repipe_mmap(struct perf_tool *tool, return err; } +#ifdef HAVE_LIBELF_SUPPORT +static int perf_event__jit_repipe_mmap(struct perf_tool *tool, + union perf_event *event, + struct perf_sample *sample, + struct machine *machine) +{ + struct perf_inject *inject = container_of(tool, struct perf_inject, tool); + u64 n = 0; + + /* + * if jit marker, then inject jit mmaps and generate ELF images + */ + if (!jit_process(inject->session, &inject->output, machine, + event->mmap.filename, sample->pid, &n)) { + inject->bytes_written += n; + return 0; + } + return perf_event__repipe_mmap(tool, event, sample, machine); +} +#endif + static int perf_event__repipe_mmap2(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, @@ -247,6 +279,27 @@ static int perf_event__repipe_mmap2(struct perf_tool *tool, return err; } +#ifdef HAVE_LIBELF_SUPPORT +static int perf_event__jit_repipe_mmap2(struct perf_tool *tool, + union perf_event *event, + struct perf_sample *sample, + struct machine *machine) +{ + struct perf_inject *inject = container_of(tool, struct perf_inject, tool); + u64 n = 0; + + /* + * if jit marker, then inject jit mmaps and generate ELF images + */ + if (!jit_process(inject->session, &inject->output, machine, + event->mmap2.filename, sample->pid, &n)) { + inject->bytes_written += n; + return 0; + } + return perf_event__repipe_mmap2(tool, event, sample, machine); +} +#endif + static int perf_event__repipe_fork(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, @@ -664,6 +717,23 @@ static int __cmd_inject(struct perf_inject *inject) return ret; } +#ifdef HAVE_LIBELF_SUPPORT +static int +jit_validate_events(struct perf_session *session) +{ + struct perf_evsel *evsel; + + /* + * check that all events use CLOCK_MONOTONIC + */ + evlist__for_each(session->evlist, evsel) { + if (evsel->attr.use_clockid == 0 || evsel->attr.clockid != CLOCK_MONOTONIC) + return -1; + } + return 0; +} +#endif + int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) { struct perf_inject inject = { @@ -703,7 +773,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) }; int ret; - const struct option options[] = { + struct option options[] = { OPT_BOOLEAN('b', "build-ids", &inject.build_ids, "Inject build-ids into the output stream"), OPT_STRING('i', "input", &inject.input_name, "file", @@ -713,6 +783,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) OPT_BOOLEAN('s', "sched-stat", &inject.sched_stat, "Merge sched-stat and sched-switch for getting events " "where and how long tasks slept"), + OPT_BOOLEAN('j', "jit", &inject.jit_mode, "merge jitdump files into perf.data file"), OPT_INCR('v', "verbose", &verbose, "be more verbose (show build ids, etc)"), OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file", @@ -729,7 +800,9 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) "perf inject [<options>]", NULL }; - +#ifndef HAVE_LIBELF_SUPPORT + set_option_nobuild(options, 'j', "jit", "NO_LIBELF=1", true); +#endif argc = parse_options(argc, argv, options, inject_usage, 0); /* @@ -765,7 +838,26 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) inject.tool.ordered_events = true; inject.tool.ordering_requires_timestamps = true; } - +#ifdef HAVE_LIBELF_SUPPORT + if (inject.jit_mode) { + /* + * validate event is using the correct clockid + */ + if (jit_validate_events(inject.session)) { + fprintf(stderr, "error, jitted code must be sampled with perf record -k 1\n"); + return -1; + } + inject.tool.mmap2 = perf_event__jit_repipe_mmap2; + inject.tool.mmap = perf_event__jit_repipe_mmap; + inject.tool.ordered_events = true; + inject.tool.ordering_requires_timestamps = true; + /* + * JIT MMAP injection injects all MMAP events in one go, so it + * does not obey finished_round semantics. + */ + inject.tool.finished_round = perf_event__drop_oe; + } +#endif ret = symbol__init(&inject.session->header.env); if (ret < 0) goto out_delete; diff --git a/tools/perf/util/Build b/tools/perf/util/Build index edae107416b6..52a4a806ee2f 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -106,6 +106,8 @@ libperf-y += scripting-engines/ libperf-$(CONFIG_ZLIB) += zlib.o libperf-$(CONFIG_LZMA) += lzma.o libperf-y += demangle-java.o +libperf-$(CONFIG_LIBELF) += jitdump.o +libperf-$(CONFIG_LIBELF) += genelf.o CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c new file mode 100644 index 000000000000..145f8116ef56 --- /dev/null +++ b/tools/perf/util/genelf.c @@ -0,0 +1,442 @@ +/* + * genelf.c + * Copyright (C) 2014, Google, Inc + * + * Contributed by: + * Stephane Eranian <eranian@gmail.com> + * + * Released under the GPL v2. (and only v2, not any later version) + */ + +#include <sys/types.h> +#include <stdio.h> +#include <getopt.h> +#include <stddef.h> +#include <libelf.h> +#include <string.h> +#include <stdlib.h> +#include <inttypes.h> +#include <limits.h> +#include <fcntl.h> +#include <err.h> +#include <dwarf.h> + +#include "perf.h" +#include "genelf.h" +#include "../util/jitdump.h" + +#define JVMTI + +#define BUILD_ID_URANDOM /* different uuid for each run */ + +#ifdef HAVE_LIBCRYPTO + +#define BUILD_ID_MD5 +#undef BUILD_ID_SHA /* does not seem to work well when linked with Java */ +#undef BUILD_ID_URANDOM /* different uuid for each run */ + +#ifdef BUILD_ID_SHA +#include <openssl/sha.h> +#endif + +#ifdef BUILD_ID_MD5 +#include <openssl/md5.h> +#endif +#endif + + +typedef struct { + unsigned int namesz; /* Size of entry's owner string */ + unsigned int descsz; /* Size of the note descriptor */ + unsigned int type; /* Interpretation of the descriptor */ + char name[0]; /* Start of the name+desc data */ +} Elf_Note; + +struct options { + char *output; + int fd; +}; + +static char shd_string_table[] = { + 0, + '.', 't', 'e', 'x', 't', 0, /* 1 */ + '.', 's', 'h', 's', 't', 'r', 't', 'a', 'b', 0, /* 7 */ + '.', 's', 'y', 'm', 't', 'a', 'b', 0, /* 17 */ + '.', 's', 't', 'r', 't', 'a', 'b', 0, /* 25 */ + '.', 'n', 'o', 't', 'e', '.', 'g', 'n', 'u', '.', 'b', 'u', 'i', 'l', 'd', '-', 'i', 'd', 0, /* 33 */ + '.', 'd', 'e', 'b', 'u', 'g', '_', 'l', 'i', 'n', 'e', 0, /* 52 */ + '.', 'd', 'e', 'b', 'u', 'g', '_', 'i', 'n', 'f', 'o', 0, /* 64 */ + '.', 'd', 'e', 'b', 'u', 'g', '_', 'a', 'b', 'b', 'r', 'e', 'v', 0, /* 76 */ +}; + +static struct buildid_note { + Elf_Note desc; /* descsz: size of build-id, must be multiple of 4 */ + char name[4]; /* GNU\0 */ + char build_id[20]; +} bnote; + +static Elf_Sym symtab[]={ + /* symbol 0 MUST be the undefined symbol */ + { .st_name = 0, /* index in sym_string table */ + .st_info = ELF_ST_TYPE(STT_NOTYPE), + .st_shndx = 0, /* for now */ + .st_value = 0x0, + .st_other = ELF_ST_VIS(STV_DEFAULT), + .st_size = 0, + }, + { .st_name = 1, /* index in sym_string table */ + .st_info = ELF_ST_BIND(STB_LOCAL) | ELF_ST_TYPE(STT_FUNC), + .st_shndx = 1, + .st_value = 0, /* for now */ + .st_other = ELF_ST_VIS(STV_DEFAULT), + .st_size = 0, /* for now */ + } +}; + +#ifdef BUILD_ID_URANDOM +static void +gen_build_id(struct buildid_note *note, + unsigned long load_addr __maybe_unused, + const void *code __maybe_unused, + size_t csize __maybe_unused) +{ + int fd; + size_t sz = sizeof(note->build_id); + ssize_t sret; + + fd = open("/dev/urandom", O_RDONLY); + if (fd == -1) + err(1, "cannot access /dev/urandom for builid"); + + sret = read(fd, note->build_id, sz); + + close(fd); + + if (sret != (ssize_t)sz) + memset(note->build_id, 0, sz); +} +#endif + +#ifdef BUILD_ID_SHA +static void +gen_build_id(struct buildid_note *note, + unsigned long load_addr __maybe_unused, + const void *code, + size_t csize) +{ + if (sizeof(note->build_id) < SHA_DIGEST_LENGTH) + errx(1, "build_id too small for SHA1"); + + SHA1(code, csize, (unsigned char *)note->build_id); +} +#endif + +#ifdef BUILD_ID_MD5 +static void +gen_build_id(struct buildid_note *note, unsigned long load_addr, const void *code, size_t csize) +{ + MD5_CTX context; + + if (sizeof(note->build_id) < 16) + errx(1, "build_id too small for MD5"); + + MD5_Init(&context); + MD5_Update(&context, &load_addr, sizeof(load_addr)); + MD5_Update(&context, code, csize); + MD5_Final((unsigned char *)note->build_id, &context); +} +#endif + +/* + * fd: file descriptor open for writing for the output file + * load_addr: code load address (could be zero, just used for buildid) + * sym: function name (for native code - used as the symbol) + * code: the native code + * csize: the code size in bytes + */ +int +jit_write_elf(int fd, uint64_t load_addr, const char *sym, + const void *code, int csize) +{ + Elf *e; + Elf_Data *d; + Elf_Scn *scn; + Elf_Ehdr *ehdr; + Elf_Shdr *shdr; + char *strsym = NULL; + int symlen; + int retval = -1; + + if (elf_version(EV_CURRENT) == EV_NONE) { + warnx("ELF initialization failed"); + return -1; + } + + e = elf_begin(fd, ELF_C_WRITE, NULL); + if (!e) { + warnx("elf_begin failed"); + goto error; + } + + /* + * setup ELF header + */ + ehdr = elf_newehdr(e); + if (!ehdr) { + warnx("cannot get ehdr"); + goto error; + } + + ehdr->e_ident[EI_DATA] = GEN_ELF_ENDIAN; + ehdr->e_ident[EI_CLASS] = GEN_ELF_CLASS; + ehdr->e_machine = GEN_ELF_ARCH; + ehdr->e_type = ET_DYN; + ehdr->e_entry = GEN_ELF_TEXT_OFFSET; + ehdr->e_version = EV_CURRENT; + ehdr->e_shstrndx= 2; /* shdr index for section name */ + + /* + * setup text section + */ + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + goto error; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + goto error; + } + + d->d_align = 16; + d->d_off = 0LL; + d->d_buf = (void *)code; + d->d_type = ELF_T_BYTE; + d->d_size = csize; + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + goto error; + } + + shdr->sh_name = 1; + shdr->sh_type = SHT_PROGBITS; + shdr->sh_addr = GEN_ELF_TEXT_OFFSET; + shdr->sh_flags = SHF_EXECINSTR | SHF_ALLOC; + shdr->sh_entsize = 0; + + /* + * setup section headers string table + */ + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + goto error; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + goto error; + } + + d->d_align = 1; + d->d_off = 0LL; + d->d_buf = shd_string_table; + d->d_type = ELF_T_BYTE; + d->d_size = sizeof(shd_string_table); + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + goto error; + } + + shdr->sh_name = 7; /* offset of '.shstrtab' in shd_string_table */ + shdr->sh_type = SHT_STRTAB; + shdr->sh_flags = 0; + shdr->sh_entsize = 0; + + /* + * setup symtab section + */ + symtab[1].st_size = csize; + symtab[1].st_value = GEN_ELF_TEXT_OFFSET; + + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + goto error; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + goto error; + } + + d->d_align = 8; + d->d_off = 0LL; + d->d_buf = symtab; + d->d_type = ELF_T_SYM; + d->d_size = sizeof(symtab); + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + goto error; + } + + shdr->sh_name = 17; /* offset of '.symtab' in shd_string_table */ + shdr->sh_type = SHT_SYMTAB; + shdr->sh_flags = 0; + shdr->sh_entsize = sizeof(Elf_Sym); + shdr->sh_link = 4; /* index of .strtab section */ + + /* + * setup symbols string table + * 2 = 1 for 0 in 1st entry, 1 for the 0 at end of symbol for 2nd entry + */ + symlen = 2 + strlen(sym); + strsym = calloc(1, symlen); + if (!strsym) { + warnx("cannot allocate strsym"); + goto error; + } + strcpy(strsym + 1, sym); + + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + goto error; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + goto error; + } + + d->d_align = 1; + d->d_off = 0LL; + d->d_buf = strsym; + d->d_type = ELF_T_BYTE; + d->d_size = symlen; + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + goto error; + } + + shdr->sh_name = 25; /* offset in shd_string_table */ + shdr->sh_type = SHT_STRTAB; + shdr->sh_flags = 0; + shdr->sh_entsize = 0; + + /* + * setup build-id section + */ + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + goto error; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + goto error; + } + + /* + * build-id generation + */ + gen_build_id(&bnote, load_addr, code, csize); + bnote.desc.namesz = sizeof(bnote.name); /* must include 0 termination */ + bnote.desc.descsz = sizeof(bnote.build_id); + bnote.desc.type = NT_GNU_BUILD_ID; + strcpy(bnote.name, "GNU"); + + d->d_align = 4; + d->d_off = 0LL; + d->d_buf = &bnote; + d->d_type = ELF_T_BYTE; + d->d_size = sizeof(bnote); + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + goto error; + } + + shdr->sh_name = 33; /* offset in shd_string_table */ + shdr->sh_type = SHT_NOTE; + shdr->sh_addr = 0x0; + shdr->sh_flags = SHF_ALLOC; + shdr->sh_size = sizeof(bnote); + shdr->sh_entsize = 0; + + if (elf_update(e, ELF_C_WRITE) < 0) { + warnx("elf_update 4 failed"); + goto error; + } + + retval = 0; +error: + (void)elf_end(e); + + free(strsym); + + + return retval; +} + +#ifndef JVMTI + +static unsigned char x86_code[] = { + 0xBB, 0x2A, 0x00, 0x00, 0x00, /* movl $42, %ebx */ + 0xB8, 0x01, 0x00, 0x00, 0x00, /* movl $1, %eax */ + 0xCD, 0x80 /* int $0x80 */ +}; + +static struct options options; + +int main(int argc, char **argv) +{ + int c, fd, ret; + + while ((c = getopt(argc, argv, "o:h")) != -1) { + switch (c) { + case 'o': + options.output = optarg; + break; + case 'h': + printf("Usage: genelf -o output_file [-h]\n"); + return 0; + default: + errx(1, "unknown option"); + } + } + + fd = open(options.output, O_CREAT|O_TRUNC|O_RDWR, 0666); + if (fd == -1) + err(1, "cannot create file %s", options.output); + + ret = jit_write_elf(fd, "main", x86_code, sizeof(x86_code)); + close(fd); + + if (ret != 0) + unlink(options.output); + + return ret; +} +#endif diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h new file mode 100644 index 000000000000..d8e9ece13c8b --- /dev/null +++ b/tools/perf/util/genelf.h @@ -0,0 +1,63 @@ +#ifndef __GENELF_H__ +#define __GENELF_H__ + +/* genelf.c */ +extern int jit_write_elf(int fd, uint64_t code_addr, const char *sym, + const void *code, int csize); + +#if defined(__arm__) +#define GEN_ELF_ARCH EM_ARM +#define GEN_ELF_ENDIAN ELFDATA2LSB +#define GEN_ELF_CLASS ELFCLASS32 +#elif defined(__aarch64__) +#define GEN_ELF_ARCH EM_AARCH64 +#define GEN_ELF_ENDIAN ELFDATA2LSB +#define GEN_ELF_CLASS ELFCLASS64 +#elif defined(__x86_64__) +#define GEN_ELF_ARCH EM_X86_64 +#define GEN_ELF_ENDIAN ELFDATA2LSB +#define GEN_ELF_CLASS ELFCLASS64 +#elif defined(__i386__) +#define GEN_ELF_ARCH EM_386 +#define GEN_ELF_ENDIAN ELFDATA2LSB +#define GEN_ELF_CLASS ELFCLASS32 +#elif defined(__ppcle__) +#define GEN_ELF_ARCH EM_PPC +#define GEN_ELF_ENDIAN ELFDATA2LSB +#define GEN_ELF_CLASS ELFCLASS64 +#elif defined(__powerpc__) +#define GEN_ELF_ARCH EM_PPC64 +#define GEN_ELF_ENDIAN ELFDATA2MSB +#define GEN_ELF_CLASS ELFCLASS64 +#elif defined(__powerpcle__) +#define GEN_ELF_ARCH EM_PPC64 +#define GEN_ELF_ENDIAN ELFDATA2LSB +#define GEN_ELF_CLASS ELFCLASS64 +#else +#error "unsupported architecture" +#endif + +#if GEN_ELF_CLASS == ELFCLASS64 +#define elf_newehdr elf64_newehdr +#define elf_getshdr elf64_getshdr +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define ELF_ST_TYPE(a) ELF64_ST_TYPE(a) +#define ELF_ST_BIND(a) ELF64_ST_BIND(a) +#define ELF_ST_VIS(a) ELF64_ST_VISIBILITY(a) +#else +#define elf_newehdr elf32_newehdr +#define elf_getshdr elf32_getshdr +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define ELF_ST_TYPE(a) ELF32_ST_TYPE(a) +#define ELF_ST_BIND(a) ELF32_ST_BIND(a) +#define ELF_ST_VIS(a) ELF32_ST_VISIBILITY(a) +#endif + +/* The .text section is directly after the ELF header */ +#define GEN_ELF_TEXT_OFFSET sizeof(Elf_Ehdr) + +#endif diff --git a/tools/perf/util/jit.h b/tools/perf/util/jit.h new file mode 100644 index 000000000000..a1e99da0715a --- /dev/null +++ b/tools/perf/util/jit.h @@ -0,0 +1,15 @@ +#ifndef __JIT_H__ +#define __JIT_H__ + +#include <data.h> + +extern int jit_process(struct perf_session *session, + struct perf_data_file *output, + struct machine *machine, + char *filename, + pid_t pid, + u64 *nbytes); + +extern int jit_inject_record(const char *filename); + +#endif /* __JIT_H__ */ diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c new file mode 100644 index 000000000000..9f7a01289efe --- /dev/null +++ b/tools/perf/util/jitdump.c @@ -0,0 +1,670 @@ +#include <sys/types.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <fcntl.h> +#include <unistd.h> +#include <inttypes.h> +#include <byteswap.h> +#include <sys/stat.h> +#include <sys/mman.h> + +#include "util.h" +#include "event.h" +#include "debug.h" +#include "evlist.h" +#include "symbol.h" +#include "strlist.h" +#include <elf.h> + +#include "session.h" +#include "jit.h" +#include "jitdump.h" +#include "genelf.h" +#include "../builtin.h" + +struct jit_buf_desc { + struct perf_data_file *output; + struct perf_session *session; + struct machine *machine; + union jr_entry *entry; + void *buf; + uint64_t sample_type; + size_t bufsize; + FILE *in; + bool needs_bswap; /* handles cross-endianess */ + void *debug_data; + size_t nr_debug_entries; + uint32_t code_load_count; + u64 bytes_written; + struct rb_root code_root; + char dir[PATH_MAX]; +}; + +struct debug_line_info { + unsigned long vma; + unsigned int lineno; + /* The filename format is unspecified, absolute path, relative etc. */ + char const filename[0]; +}; + +struct jit_tool { + struct perf_tool tool; + struct perf_data_file output; + struct perf_data_file input; + u64 bytes_written; +}; + +#define hmax(a, b) ((a) > (b) ? (a) : (b)) +#define get_jit_tool(t) (container_of(tool, struct jit_tool, tool)) + +static int +jit_emit_elf(char *filename, + const char *sym, + uint64_t code_addr, + const void *code, + int csize) +{ + int ret, fd; + + if (verbose > 0) + fprintf(stderr, "write ELF image %s\n", filename); + + fd = open(filename, O_CREAT|O_TRUNC|O_WRONLY, 0644); + if (fd == -1) { + pr_warning("cannot create jit ELF %s: %s\n", filename, strerror(errno)); + return -1; + } + + ret = jit_write_elf(fd, code_addr, sym, (const void *)code, csize); + + close(fd); + + if (ret) + unlink(filename); + + return ret; +} + +static void +jit_close(struct jit_buf_desc *jd) +{ + if (!(jd && jd->in)) + return; + funlockfile(jd->in); + fclose(jd->in); + jd->in = NULL; +} + +static int +jit_open(struct jit_buf_desc *jd, const char *name) +{ + struct jitheader header; + struct jr_prefix *prefix; + ssize_t bs, bsz = 0; + void *n, *buf = NULL; + int ret, retval = -1; + + jd->in = fopen(name, "r"); + if (!jd->in) + return -1; + + bsz = hmax(sizeof(header), sizeof(*prefix)); + + buf = malloc(bsz); + if (!buf) + goto error; + + /* + * protect from writer modifying the file while we are reading it + */ + flockfile(jd->in); + + ret = fread(buf, sizeof(header), 1, jd->in); + if (ret != 1) + goto error; + + memcpy(&header, buf, sizeof(header)); + + if (header.magic != JITHEADER_MAGIC) { + if (header.magic != JITHEADER_MAGIC_SW) + goto error; + jd->needs_bswap = true; + } + + if (jd->needs_bswap) { + header.version = bswap_32(header.version); + header.total_size = bswap_32(header.total_size); + header.pid = bswap_32(header.pid); + header.elf_mach = bswap_32(header.elf_mach); + header.timestamp = bswap_64(header.timestamp); + header.flags = bswap_64(header.flags); + } + + if (verbose > 2) + pr_debug("version=%u\nhdr.size=%u\nts=0x%llx\npid=%d\nelf_mach=%d\n", + header.version, + header.total_size, + (unsigned long long)header.timestamp, + header.pid, + header.elf_mach); + + if (header.flags & JITDUMP_FLAGS_RESERVED) { + pr_err("jitdump file contains invalid or unsupported flags 0x%llx\n", + (unsigned long long)header.flags & JITDUMP_FLAGS_RESERVED); + goto error; + } + + bs = header.total_size - sizeof(header); + + if (bs > bsz) { + n = realloc(buf, bs); + if (!n) + goto error; + bsz = bs; + buf = n; + /* read extra we do not know about */ + ret = fread(buf, bs - bsz, 1, jd->in); + if (ret != 1) + goto error; + } + /* + * keep dirname for generating files and mmap records + */ + strcpy(jd->dir, name); + dirname(jd->dir); + + return 0; +error: + funlockfile(jd->in); + fclose(jd->in); + return retval; +} + +static union jr_entry * +jit_get_next_entry(struct jit_buf_desc *jd) +{ + struct jr_prefix *prefix; + union jr_entry *jr; + void *addr; + size_t bs, size; + int id, ret; + + if (!(jd && jd->in)) + return NULL; + + if (jd->buf == NULL) { + size_t sz = getpagesize(); + if (sz < sizeof(*prefix)) + sz = sizeof(*prefix); + + jd->buf = malloc(sz); + if (jd->buf == NULL) + return NULL; + + jd->bufsize = sz; + } + + prefix = jd->buf; + + /* + * file is still locked at this point + */ + ret = fread(prefix, sizeof(*prefix), 1, jd->in); + if (ret != 1) + return NULL; + + if (jd->needs_bswap) { + prefix->id = bswap_32(prefix->id); + prefix->total_size = bswap_32(prefix->total_size); + prefix->timestamp = bswap_64(prefix->timestamp); + } + id = prefix->id; + size = prefix->total_size; + + bs = (size_t)size; + if (bs < sizeof(*prefix)) + return NULL; + + if (id >= JIT_CODE_MAX) { + pr_warning("next_entry: unknown prefix %d, skipping\n", id); + return NULL; + } + if (bs > jd->bufsize) { + void *n; + n = realloc(jd->buf, bs); + if (!n) + return NULL; + jd->buf = n; + jd->bufsize = bs; + } + + addr = ((void *)jd->buf) + sizeof(*prefix); + + ret = fread(addr, bs - sizeof(*prefix), 1, jd->in); + if (ret != 1) + return NULL; + + jr = (union jr_entry *)jd->buf; + + switch(id) { + case JIT_CODE_DEBUG_INFO: + if (jd->needs_bswap) { + uint64_t n; + jr->info.code_addr = bswap_64(jr->info.code_addr); + jr->info.nr_entry = bswap_64(jr->info.nr_entry); + for (n = 0 ; n < jr->info.nr_entry; n++) { + jr->info.entries[n].addr = bswap_64(jr->info.entries[n].addr); + jr->info.entries[n].lineno = bswap_32(jr->info.entries[n].lineno); + jr->info.entries[n].discrim = bswap_32(jr->info.entries[n].discrim); + } + } + break; + case JIT_CODE_CLOSE: + break; + case JIT_CODE_LOAD: + if (jd->needs_bswap) { + jr->load.pid = bswap_32(jr->load.pid); + jr->load.tid = bswap_32(jr->load.tid); + jr->load.vma = bswap_64(jr->load.vma); + jr->load.code_addr = bswap_64(jr->load.code_addr); + jr->load.code_size = bswap_64(jr->load.code_size); + jr->load.code_index= bswap_64(jr->load.code_index); + } + jd->code_load_count++; + break; + case JIT_CODE_MOVE: + if (jd->needs_bswap) { + jr->move.pid = bswap_32(jr->move.pid); + jr->move.tid = bswap_32(jr->move.tid); + jr->move.vma = bswap_64(jr->move.vma); + jr->move.old_code_addr = bswap_64(jr->move.old_code_addr); + jr->move.new_code_addr = bswap_64(jr->move.new_code_addr); + jr->move.code_size = bswap_64(jr->move.code_size); + jr->move.code_index = bswap_64(jr->move.code_index); + } + break; + case JIT_CODE_MAX: + default: + return NULL; + } + return jr; +} + +static int +jit_inject_event(struct jit_buf_desc *jd, union perf_event *event) +{ + ssize_t size; + + size = perf_data_file__write(jd->output, event, event->header.size); + if (size < 0) + return -1; + + jd->bytes_written += size; + return 0; +} + +static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr) +{ + struct perf_sample sample; + union perf_event *event; + struct perf_tool *tool = jd->session->tool; + uint64_t code, addr; + uintptr_t uaddr; + char *filename; + struct stat st; + size_t size; + u16 idr_size; + const char *sym; + uint32_t count; + int ret, csize; + pid_t pid, tid; + struct { + u32 pid, tid; + u64 time; + } *id; + + pid = jr->load.pid; + tid = jr->load.tid; + csize = jr->load.code_size; + addr = jr->load.code_addr; + sym = (void *)((unsigned long)jr + sizeof(jr->load)); + code = (unsigned long)jr + jr->load.p.total_size - csize; + count = jr->load.code_index; + idr_size = jd->machine->id_hdr_size; + + event = calloc(1, sizeof(*event) + idr_size); + if (!event) + return -1; + + filename = event->mmap2.filename; + size = snprintf(filename, PATH_MAX, "%s/jitted-%d-%u.so", + jd->dir, + pid, + count); + + size++; /* for \0 */ + + size = PERF_ALIGN(size, sizeof(u64)); + uaddr = (uintptr_t)code; + ret = jit_emit_elf(filename, sym, addr, (const void *)uaddr, csize); + + if (jd->debug_data && jd->nr_debug_entries) { + free(jd->debug_data); + jd->debug_data = NULL; + jd->nr_debug_entries = 0; + } + + if (ret) { + free(event); + return -1; + } + if (stat(filename, &st)) + memset(&st, 0, sizeof(stat)); + + event->mmap2.header.type = PERF_RECORD_MMAP2; + event->mmap2.header.misc = PERF_RECORD_MISC_USER; + event->mmap2.header.size = (sizeof(event->mmap2) - + (sizeof(event->mmap2.filename) - size) + idr_size); + + event->mmap2.pgoff = GEN_ELF_TEXT_OFFSET; + event->mmap2.start = addr; + event->mmap2.len = csize; + event->mmap2.pid = pid; + event->mmap2.tid = tid; + event->mmap2.ino = st.st_ino; + event->mmap2.maj = major(st.st_dev); + event->mmap2.min = minor(st.st_dev); + event->mmap2.prot = st.st_mode; + event->mmap2.flags = MAP_SHARED; + event->mmap2.ino_generation = 1; + + id = (void *)((unsigned long)event + event->mmap.header.size - idr_size); + if (jd->sample_type & PERF_SAMPLE_TID) { + id->pid = pid; + id->tid = tid; + } + if (jd->sample_type & PERF_SAMPLE_TIME) + id->time = jr->load.p.timestamp; + + /* + * create pseudo sample to induce dso hit increment + * use first address as sample address + */ + memset(&sample, 0, sizeof(sample)); + sample.pid = pid; + sample.tid = tid; + sample.time = id->time; + sample.ip = addr; + + ret = perf_event__process_mmap2(tool, event, &sample, jd->machine); + if (ret) + return ret; + + ret = jit_inject_event(jd, event); + /* + * mark dso as use to generate buildid in the header + */ + if (!ret) + build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine); + + return ret; +} + +static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr) +{ + struct perf_sample sample; + union perf_event *event; + struct perf_tool *tool = jd->session->tool; + char *filename; + size_t size; + struct stat st; + u16 idr_size; + int ret; + pid_t pid, tid; + struct { + u32 pid, tid; + u64 time; + } *id; + + pid = jr->move.pid; + tid = jr->move.tid; + idr_size = jd->machine->id_hdr_size; + + /* + * +16 to account for sample_id_all (hack) + */ + event = calloc(1, sizeof(*event) + 16); + if (!event) + return -1; + + filename = event->mmap2.filename; + size = snprintf(filename, PATH_MAX, "%s/jitted-%d-%"PRIu64, + jd->dir, + pid, + jr->move.code_index); + + size++; /* for \0 */ + + if (stat(filename, &st)) + memset(&st, 0, sizeof(stat)); + + size = PERF_ALIGN(size, sizeof(u64)); + + event->mmap2.header.type = PERF_RECORD_MMAP2; + event->mmap2.header.misc = PERF_RECORD_MISC_USER; + event->mmap2.header.size = (sizeof(event->mmap2) - + (sizeof(event->mmap2.filename) - size) + idr_size); + event->mmap2.pgoff = GEN_ELF_TEXT_OFFSET; + event->mmap2.start = jr->move.new_code_addr; + event->mmap2.len = jr->move.code_size; + event->mmap2.pid = pid; + event->mmap2.tid = tid; + event->mmap2.ino = st.st_ino; + event->mmap2.maj = major(st.st_dev); + event->mmap2.min = minor(st.st_dev); + event->mmap2.prot = st.st_mode; + event->mmap2.flags = MAP_SHARED; + event->mmap2.ino_generation = 1; + + id = (void *)((unsigned long)event + event->mmap.header.size - idr_size); + if (jd->sample_type & PERF_SAMPLE_TID) { + id->pid = pid; + id->tid = tid; + } + if (jd->sample_type & PERF_SAMPLE_TIME) + id->time = jr->load.p.timestamp; + + /* + * create pseudo sample to induce dso hit increment + * use first address as sample address + */ + memset(&sample, 0, sizeof(sample)); + sample.pid = pid; + sample.tid = tid; + sample.time = id->time; + sample.ip = jr->move.new_code_addr; + + ret = perf_event__process_mmap2(tool, event, &sample, jd->machine); + if (ret) + return ret; + + ret = jit_inject_event(jd, event); + if (!ret) + build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine); + + return ret; +} + +static int jit_repipe_debug_info(struct jit_buf_desc *jd, union jr_entry *jr) +{ + void *data; + size_t sz; + + if (!(jd && jr)) + return -1; + + sz = jr->prefix.total_size - sizeof(jr->info); + data = malloc(sz); + if (!data) + return -1; + + memcpy(data, &jr->info.entries, sz); + + jd->debug_data = data; + + /* + * we must use nr_entry instead of size here because + * we cannot distinguish actual entry from padding otherwise + */ + jd->nr_debug_entries = jr->info.nr_entry; + + return 0; +} + +static int +jit_process_dump(struct jit_buf_desc *jd) +{ + union jr_entry *jr; + int ret; + + while ((jr = jit_get_next_entry(jd))) { + switch(jr->prefix.id) { + case JIT_CODE_LOAD: + ret = jit_repipe_code_load(jd, jr); + break; + case JIT_CODE_MOVE: + ret = jit_repipe_code_move(jd, jr); + break; + case JIT_CODE_DEBUG_INFO: + ret = jit_repipe_debug_info(jd, jr); + break; + default: + ret = 0; + continue; + } + } + return ret; +} + +static int +jit_inject(struct jit_buf_desc *jd, char *path) +{ + int ret; + + if (verbose > 0) + fprintf(stderr, "injecting: %s\n", path); + + ret = jit_open(jd, path); + if (ret) + return -1; + + ret = jit_process_dump(jd); + + jit_close(jd); + + if (verbose > 0) + fprintf(stderr, "injected: %s (%d)\n", path, ret); + + return 0; +} + +/* + * File must be with pattern .../jit-XXXX.dump + * where XXXX is the PID of the process which did the mmap() + * as captured in the RECORD_MMAP record + */ +static int +jit_detect(char *mmap_name, pid_t pid) + { + char *p; + char *end = NULL; + pid_t pid2; + + if (verbose > 2) + fprintf(stderr, "jit marker trying : %s\n", mmap_name); + /* + * get file name + */ + p = strrchr(mmap_name, '/'); + if (!p) + return -1; + + /* + * match prefix + */ + if (strncmp(p, "/jit-", 5)) + return -1; + + /* + * skip prefix + */ + p += 5; + + /* + * must be followed by a pid + */ + if (!isdigit(*p)) + return -1; + + pid2 = (int)strtol(p, &end, 10); + if (!end) + return -1; + + /* + * pid does not match mmap pid + * pid==0 in system-wide mode (synthesized) + */ + if (pid && pid2 != pid) + return -1; + /* + * validate suffix + */ + if (strcmp(end, ".dump")) + return -1; + + if (verbose > 0) + fprintf(stderr, "jit marker found: %s\n", mmap_name); + + return 0; +} + +int +jit_process(struct perf_session *session, + struct perf_data_file *output, + struct machine *machine, + char *filename, + pid_t pid, + u64 *nbytes) +{ + struct perf_evsel *first; + struct jit_buf_desc jd; + int ret; + + /* + * first, detect marker mmap (i.e., the jitdump mmap) + */ + if (jit_detect(filename, pid)) + return -1; + + memset(&jd, 0, sizeof(jd)); + + jd.session = session; + jd.output = output; + jd.machine = machine; + + /* + * track sample_type to compute id_all layout + * perf sets the same sample type to all events as of now + */ + first = perf_evlist__first(session->evlist); + jd.sample_type = first->attr.sample_type; + + *nbytes = 0; + + ret = jit_inject(&jd, filename); + if (!ret) + *nbytes = jd.bytes_written; + + return ret; +} diff --git a/tools/perf/util/jitdump.h b/tools/perf/util/jitdump.h new file mode 100644 index 000000000000..b66c1f503d9e --- /dev/null +++ b/tools/perf/util/jitdump.h @@ -0,0 +1,124 @@ +/* + * jitdump.h: jitted code info encapsulation file format + * + * Adapted from OProfile GPLv2 support jidump.h: + * Copyright 2007 OProfile authors + * Jens Wilke + * Daniel Hansel + * Copyright IBM Corporation 2007 + */ +#ifndef JITDUMP_H +#define JITDUMP_H + +#include <sys/time.h> +#include <time.h> +#include <stdint.h> + +/* JiTD */ +#define JITHEADER_MAGIC 0x4A695444 +#define JITHEADER_MAGIC_SW 0x4454694A + +#define PADDING_8ALIGNED(x) ((((x) + 7) & 7) ^ 7) + +#define JITHEADER_VERSION 1 + +enum jitdump_flags_bits { + JITDUMP_FLAGS_MAX_BIT, +}; + +#define JITDUMP_FLAGS_RESERVED (JITDUMP_FLAGS_MAX_BIT < 64 ? \ + (~((1ULL << JITDUMP_FLAGS_MAX_BIT) - 1)) : 0) + +struct jitheader { + uint32_t magic; /* characters "jItD" */ + uint32_t version; /* header version */ + uint32_t total_size; /* total size of header */ + uint32_t elf_mach; /* elf mach target */ + uint32_t pad1; /* reserved */ + uint32_t pid; /* JIT process id */ + uint64_t timestamp; /* timestamp */ + uint64_t flags; /* flags */ +}; + +enum jit_record_type { + JIT_CODE_LOAD = 0, + JIT_CODE_MOVE = 1, + JIT_CODE_DEBUG_INFO = 2, + JIT_CODE_CLOSE = 3, + + JIT_CODE_MAX, +}; + +/* record prefix (mandatory in each record) */ +struct jr_prefix { + uint32_t id; + uint32_t total_size; + uint64_t timestamp; +}; + +struct jr_code_load { + struct jr_prefix p; + + uint32_t pid; + uint32_t tid; + uint64_t vma; + uint64_t code_addr; + uint64_t code_size; + uint64_t code_index; +}; + +struct jr_code_close { + struct jr_prefix p; +}; + +struct jr_code_move { + struct jr_prefix p; + + uint32_t pid; + uint32_t tid; + uint64_t vma; + uint64_t old_code_addr; + uint64_t new_code_addr; + uint64_t code_size; + uint64_t code_index; +}; + +struct debug_entry { + uint64_t addr; + int lineno; /* source line number starting at 1 */ + int discrim; /* column discriminator, 0 is default */ + const char name[0]; /* null terminated filename, \xff\0 if same as previous entry */ +}; + +struct jr_code_debug_info { + struct jr_prefix p; + + uint64_t code_addr; + uint64_t nr_entry; + struct debug_entry entries[0]; +}; + +union jr_entry { + struct jr_code_debug_info info; + struct jr_code_close close; + struct jr_code_load load; + struct jr_code_move move; + struct jr_prefix prefix; +}; + +static inline struct debug_entry * +debug_entry_next(struct debug_entry *ent) +{ + void *a = ent + 1; + size_t l = strlen(ent->name) + 1; + return a + l; +} + +static inline char * +debug_entry_file(struct debug_entry *ent) +{ + void *a = ent + 1; + return a; +} + +#endif /* !JITDUMP_H */ -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 18/19] perf tools: add JVMTI agent library 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (16 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 17/19] perf inject: Add jitdump mmap injection support Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 19/19] perf jit: add source line info support Arnaldo Carvalho de Melo 2016-02-09 9:40 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Stephane Eranian, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo See http://www.infradead.org/rpr.html From: Stephane Eranian <eranian@google.com> This is a standalone JVMTI library to help profile Java jitted code with perf record/perf report. The library is not installed or compiled automatically by perf Makefile. It is not used directly by perf. It is arch agnostic and has been tested on X86 and ARM. It needs to be used with a Java runtime, such as OpenJDK, as follows: $ java -agentpath:libjvmti.so ....... See the "Committer Notes" below on how to build it. When used this way, java will generate a jitdump binary file in $HOME/.debug/java/jit/java-jit-* This binary dump file contains information to help symbolize and annotate jitted code. The jitdump information must be injected into the perf.data file using: $ perf inject --jit -i perf.data -o perf.data.jitted This injects the MMAP records to cover the jitted code and also generates one ELF image for each jitted function. The ELF images are created in the same subdir as the jitdump file. The MMAP records point there too. Then, to visualize the function or asm profile, simply use the regular perf commands: $ perf report -i perf.data.jitted or $ perf annotate -i perf.data.jitted JVMTI agent code adapted from the OProfile's opagent code. This version of the JVMTI agent is using the CLOCK_MONOTONIC as the time source to timestamp jit samples. To correlate with perf_events samples, it needs to run on kernel 4.0.0-rc5+ or later with the following commit from Peter Zijlstra: 34f439278cef ("perf: Add per event clockid support") With this patch recording jitted code is done as follows: $ perf record -k mono -- java -agentpath:libjvmti.so ....... -------------------------------------------------------------------------- Committer Notes: Extended testing instructions: $ cd tools/perf/jvmti/ $ dnf install java-devel $ make Then, create some simple java stuff to record some samples: $ cat hello.java public class hello { public static void main(String[] args) { System.out.println("Hello, World"); } } $ javac hello.java $ java hello Hello, World $ And then record it using this jvmti thing: $ perf record -k mono java -agentpath:/home/acme/git/linux/tools/perf/jvmti/libjvmti.so hello java: jvmti: jitdump in /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jit-1908.dump Hello, World [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.030 MB perf.data (268 samples) ] $ Now lets insert the PERF_RECORD_MMAP2 records to point jitted mmaps to files created by the agent: $ perf inject --jit -i perf.data -o perf.data.jitted And finally see that it did its job: $ perf report -D -i perf.data.jitted | grep PERF_RECORD_MMAP2 | tail -5 79197149129422 0xfe10 [0xa0]: PERF_RECORD_MMAP2 1908/1923: [0x7f172428bd60(0x80) @ 0x40 fd:02 1840554 1]: --xs /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-283.so 79197149235701 0xfeb0 [0xa0]: PERF_RECORD_MMAP2 1908/1923: [0x7f172428ba60(0x180) @ 0x40 fd:02 1840555 1]: --xs /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-284.so 79197149250558 0xff50 [0xa0]: PERF_RECORD_MMAP2 1908/1923: [0x7f172428b860(0x180) @ 0x40 fd:02 1840556 1]: --xs /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-285.so 79197149714746 0xfff0 [0xa0]: PERF_RECORD_MMAP2 1908/1923: [0x7f172428b660(0x180) @ 0x40 fd:02 1840557 1]: --xs /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-286.so 79197149806558 0x10090 [0xa0]: PERF_RECORD_MMAP2 1908/1923: [0x7f172428b460(0x180) @ 0x40 fd:02 1840558 1]: --xs /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-287.so $ So: $ perf report -D -i perf.data | grep PERF_RECORD_MMAP2 | wc -l Failed to open /tmp/perf-1908.map, continuing without symbols 21 $ perf report -D -i perf.data.jitted | grep PERF_RECORD_MMAP2 | wc -l 307 $ echo $((307 - 21)) 286 $ 286 extra PERF_RECORD_MMAP2 records. All for thise tiny, with just one function, ELF files: $ file /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-9.so /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-9.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), corrupted program header size, BuildID[sha1]=ae54a2ebc3ecf0ba547bfc8cabdea1519df5203f, not stripped $ readelf -sw /home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-9.so Symbol table '.symtab' contains 2 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000040 9 FUNC LOCAL DEFAULT 1 atomic_cmpxchg_long $ Inserted into the build-id cache: $ ls -la ~/.debug/.build-id/ae/54a2ebc3ecf0ba547bfc8cabdea1519df5203f lrwxrwxrwx. 1 acme acme 111 Feb 5 11:30 /home/acme/.debug/.build-id/ae/54a2ebc3ecf0ba547bfc8cabdea1519df5203f -> ../../home/acme/.debug/jit/java-jit-20160205.XXWIEDls/jitted-1908-9.so/ae54a2ebc3ecf0ba547bfc8cabdea1519df5203f Note: check why 'file' reports that 'corrupted program header size'. With a stupid java hog to do some profiling: $ cat hog.java public class hog { private static double do_something_else(int i) { double total = 0; while (i > 0) { total += Math.log(i--); } return total; } private static double do_something(int i) { double total = 0; while (i > 0) { total += Math.sqrt(i--) + do_something_else(i / 100); } return total; } public static void main(String[] args) { System.out.println(String.format("%s=%f & %f", args[0], do_something(Integer.parseInt(args[0])), do_something_else(Integer.parseInt(args[1])))); } } $ javac hog.java $ perf record -F 10000 -g -k mono java -agentpath:/home/acme/git/linux/tools/perf/jvmti/libjvmti.so hog 100000 2345000 java: jvmti: jitdump in /home/acme/.debug/jit/java-jit-20160205.XX4sqd14/jit-8670.dump 100000=291561592.669602 & 32050989.778714 [ perf record: Woken up 6 times to write data ] [ perf record: Captured and wrote 1.536 MB perf.data (12538 samples) ] $ perf inject --jit -i perf.data -o perf.data.jitted Looking at the 'perf report' TUI, at one expanded callchain leading to the jitted code: $ perf report --no-children -i perf.data.jitted Samples: 12K of event 'cycles:pp', Event count (approx.): 3829569932 Overhead Comm Shared Object Symbol - 93.38% java jitted-8670-291.so [.] class hog.do_something_else(int) class hog.do_something_else(int) - Interpreter - 75.86% call_stub JavaCalls::call_helper jni_invoke_static jni_CallStaticVoidMethod JavaMain start_thread - 17.52% JavaCalls::call_helper jni_invoke_static jni_CallStaticVoidMethod JavaMain start_thread Signed-off-by: Stephane Eranian <eranian@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-4-git-send-email-eranian@google.com [ Made it build on fedora23, added some build/usage instructions ] [ Check if filename != NULL in compiled_method_load_cb, fixing segfault ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/jvmti/Makefile | 76 +++++++ tools/perf/jvmti/jvmti_agent.c | 465 +++++++++++++++++++++++++++++++++++++++++ tools/perf/jvmti/jvmti_agent.h | 29 +++ tools/perf/jvmti/libjvmti.c | 208 ++++++++++++++++++ 4 files changed, 778 insertions(+) create mode 100644 tools/perf/jvmti/Makefile create mode 100644 tools/perf/jvmti/jvmti_agent.c create mode 100644 tools/perf/jvmti/jvmti_agent.h create mode 100644 tools/perf/jvmti/libjvmti.c diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile new file mode 100644 index 000000000000..5968f8332a28 --- /dev/null +++ b/tools/perf/jvmti/Makefile @@ -0,0 +1,76 @@ +ARCH=$(shell uname -m) + +ifeq ($(ARCH), x86_64) +JARCH=amd64 +endif +ifeq ($(ARCH), armv7l) +JARCH=armhf +endif +ifeq ($(ARCH), armv6l) +JARCH=armhf +endif +ifeq ($(ARCH), aarch64) +JARCH=aarch64 +endif +ifeq ($(ARCH), ppc64) +JARCH=powerpc +endif +ifeq ($(ARCH), ppc64le) +JARCH=powerpc +endif + +DESTDIR=/usr/local + +VERSION=1 +REVISION=0 +AGE=0 + +LN=ln -sf +RM=rm + +SLIBJVMTI=libjvmti.so.$(VERSION).$(REVISION).$(AGE) +VLIBJVMTI=libjvmti.so.$(VERSION) +SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBJVMTI) +SOLIBEXT=so + +# The following works at least on fedora 23, you may need the next +# line for other distros. +JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') +#JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +# -lrt required in 32-bit mode for clock_gettime() +LIBS=-lelf -lrt +INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux + +TARGETS=$(SLIBJVMTI) + +SRCS=libjvmti.c jvmti_agent.c +OBJS=$(SRCS:.c=.o) +SOBJS=$(OBJS:.o=.lo) +OPT=-O2 -g -Werror -Wall + +CFLAGS=$(INCDIR) $(OPT) + +all: $(TARGETS) + +.c.o: + $(CC) $(CFLAGS) -c $*.c +.c.lo: + $(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.lo + +$(OBJS) $(SOBJS): Makefile jvmti_agent.h ../util/jitdump.h + +$(SLIBJVMTI): $(SOBJS) + $(CC) $(CFLAGS) $(SLDFLAGS) -o $@ $(SOBJS) $(LIBS) + $(LN) $@ libjvmti.$(SOLIBEXT) + +clean: + $(RM) -f *.o *.so.* *.so *.lo + +install: + -mkdir -p $(DESTDIR)/lib + install -m 755 $(SLIBJVMTI) $(DESTDIR)/lib/ + (cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) $(VLIBJVMTI)) + (cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) libjvmti.$(SOLIBEXT)) + ldconfig + +.SUFFIXES: .c .S .o .lo diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c new file mode 100644 index 000000000000..cbab139de5a4 --- /dev/null +++ b/tools/perf/jvmti/jvmti_agent.c @@ -0,0 +1,465 @@ +/* + * jvmti_agent.c: JVMTI agent interface + * + * Adapted from the Oprofile code in opagent.c: + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Copyright 2007 OProfile authors + * Jens Wilke + * Daniel Hansel + * Copyright IBM Corporation 2007 + */ +#include <sys/types.h> +#include <sys/stat.h> /* for mkdir() */ +#include <stdio.h> +#include <errno.h> +#include <string.h> +#include <stdlib.h> +#include <stdint.h> +#include <limits.h> +#include <fcntl.h> +#include <unistd.h> +#include <time.h> +#include <sys/mman.h> +#include <syscall.h> /* for gettid() */ +#include <err.h> + +#include "jvmti_agent.h" +#include "../util/jitdump.h" + +#define JIT_LANG "java" + +static char jit_path[PATH_MAX]; +static void *marker_addr; + +/* + * padding buffer + */ +static const char pad_bytes[7]; + +static inline pid_t gettid(void) +{ + return (pid_t)syscall(__NR_gettid); +} + +static int get_e_machine(struct jitheader *hdr) +{ + ssize_t sret; + char id[16]; + int fd, ret = -1; + int m = -1; + struct { + uint16_t e_type; + uint16_t e_machine; + } info; + + fd = open("/proc/self/exe", O_RDONLY); + if (fd == -1) + return -1; + + sret = read(fd, id, sizeof(id)); + if (sret != sizeof(id)) + goto error; + + /* check ELF signature */ + if (id[0] != 0x7f || id[1] != 'E' || id[2] != 'L' || id[3] != 'F') + goto error; + + sret = read(fd, &info, sizeof(info)); + if (sret != sizeof(info)) + goto error; + + m = info.e_machine; + if (m < 0) + m = 0; /* ELF EM_NONE */ + + hdr->elf_mach = m; + ret = 0; +error: + close(fd); + return ret; +} + +#define NSEC_PER_SEC 1000000000 +static int perf_clk_id = CLOCK_MONOTONIC; + +static inline uint64_t +timespec_to_ns(const struct timespec *ts) +{ + return ((uint64_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; +} + +static inline uint64_t +perf_get_timestamp(void) +{ + struct timespec ts; + int ret; + + ret = clock_gettime(perf_clk_id, &ts); + if (ret) + return 0; + + return timespec_to_ns(&ts); +} + +static int +debug_cache_init(void) +{ + char str[32]; + char *base, *p; + struct tm tm; + time_t t; + int ret; + + time(&t); + localtime_r(&t, &tm); + + base = getenv("JITDUMPDIR"); + if (!base) + base = getenv("HOME"); + if (!base) + base = "."; + + strftime(str, sizeof(str), JIT_LANG"-jit-%Y%m%d", &tm); + + snprintf(jit_path, PATH_MAX - 1, "%s/.debug/", base); + + ret = mkdir(jit_path, 0755); + if (ret == -1) { + if (errno != EEXIST) { + warn("jvmti: cannot create jit cache dir %s", jit_path); + return -1; + } + } + + snprintf(jit_path, PATH_MAX - 1, "%s/.debug/jit", base); + ret = mkdir(jit_path, 0755); + if (ret == -1) { + if (errno != EEXIST) { + warn("cannot create jit cache dir %s", jit_path); + return -1; + } + } + + snprintf(jit_path, PATH_MAX - 1, "%s/.debug/jit/%s.XXXXXXXX", base, str); + + p = mkdtemp(jit_path); + if (p != jit_path) { + warn("cannot create jit cache dir %s", jit_path); + return -1; + } + + return 0; +} + +static int +perf_open_marker_file(int fd) +{ + long pgsz; + + pgsz = sysconf(_SC_PAGESIZE); + if (pgsz == -1) + return -1; + + /* + * we mmap the jitdump to create an MMAP RECORD in perf.data file. + * The mmap is captured either live (perf record running when we mmap) + * or in deferred mode, via /proc/PID/maps + * the MMAP record is used as a marker of a jitdump file for more meta + * data info about the jitted code. Perf report/annotate detect this + * special filename and process the jitdump file. + * + * mapping must be PROT_EXEC to ensure it is captured by perf record + * even when not using -d option + */ + marker_addr = mmap(NULL, pgsz, PROT_READ|PROT_EXEC, MAP_PRIVATE, fd, 0); + return (marker_addr == MAP_FAILED) ? -1 : 0; +} + +static void +perf_close_marker_file(void) +{ + long pgsz; + + if (!marker_addr) + return; + + pgsz = sysconf(_SC_PAGESIZE); + if (pgsz == -1) + return; + + munmap(marker_addr, pgsz); +} + +void *jvmti_open(void) +{ + int pad_cnt; + char dump_path[PATH_MAX]; + struct jitheader header; + int fd; + FILE *fp; + + /* + * check if clockid is supported + */ + if (!perf_get_timestamp()) + warnx("jvmti: kernel does not support %d clock id", perf_clk_id); + + memset(&header, 0, sizeof(header)); + + debug_cache_init(); + + /* + * jitdump file name + */ + snprintf(dump_path, PATH_MAX, "%s/jit-%i.dump", jit_path, getpid()); + + fd = open(dump_path, O_CREAT|O_TRUNC|O_RDWR, 0666); + if (fd == -1) + return NULL; + + /* + * create perf.data maker for the jitdump file + */ + if (perf_open_marker_file(fd)) { + warnx("jvmti: failed to create marker file"); + return NULL; + } + + fp = fdopen(fd, "w+"); + if (!fp) { + warn("jvmti: cannot create %s", dump_path); + close(fd); + goto error; + } + + warnx("jvmti: jitdump in %s", dump_path); + + if (get_e_machine(&header)) { + warn("get_e_machine failed\n"); + goto error; + } + + header.magic = JITHEADER_MAGIC; + header.version = JITHEADER_VERSION; + header.total_size = sizeof(header); + header.pid = getpid(); + + /* calculate amount of padding '\0' */ + pad_cnt = PADDING_8ALIGNED(header.total_size); + header.total_size += pad_cnt; + + header.timestamp = perf_get_timestamp(); + + if (!fwrite(&header, sizeof(header), 1, fp)) { + warn("jvmti: cannot write dumpfile header"); + goto error; + } + + /* write padding '\0' if necessary */ + if (pad_cnt && !fwrite(pad_bytes, pad_cnt, 1, fp)) { + warn("jvmti: cannot write dumpfile header padding"); + goto error; + } + + return fp; +error: + fclose(fp); + return NULL; +} + +int +jvmti_close(void *agent) +{ + struct jr_code_close rec; + FILE *fp = agent; + + if (!fp) { + warnx("jvmti: incalid fd in close_agent"); + return -1; + } + + rec.p.id = JIT_CODE_CLOSE; + rec.p.total_size = sizeof(rec); + + rec.p.timestamp = perf_get_timestamp(); + + if (!fwrite(&rec, sizeof(rec), 1, fp)) + return -1; + + fclose(fp); + + fp = NULL; + + perf_close_marker_file(); + + return 0; +} + +int +jvmti_write_code(void *agent, char const *sym, + uint64_t vma, void const *code, unsigned int const size) +{ + static int code_generation = 1; + struct jr_code_load rec; + size_t sym_len; + size_t padding_count; + FILE *fp = agent; + int ret = -1; + + /* don't care about 0 length function, no samples */ + if (size == 0) + return 0; + + if (!fp) { + warnx("jvmti: invalid fd in write_native_code"); + return -1; + } + + sym_len = strlen(sym) + 1; + + rec.p.id = JIT_CODE_LOAD; + rec.p.total_size = sizeof(rec) + sym_len; + padding_count = PADDING_8ALIGNED(rec.p.total_size); + rec.p. total_size += padding_count; + rec.p.timestamp = perf_get_timestamp(); + + rec.code_size = size; + rec.vma = vma; + rec.code_addr = vma; + rec.pid = getpid(); + rec.tid = gettid(); + + if (code) + rec.p.total_size += size; + + /* + * If JVM is multi-threaded, nultiple concurrent calls to agent + * may be possible, so protect file writes + */ + flockfile(fp); + + /* + * get code index inside lock to avoid race condition + */ + rec.code_index = code_generation++; + + ret = fwrite_unlocked(&rec, sizeof(rec), 1, fp); + fwrite_unlocked(sym, sym_len, 1, fp); + + if (padding_count) + fwrite_unlocked(pad_bytes, padding_count, 1, fp); + + if (code) + fwrite_unlocked(code, size, 1, fp); + + funlockfile(fp); + + ret = 0; + + return ret; +} + +int +jvmti_write_debug_info(void *agent, uint64_t code, const char *file, + jvmtiAddrLocationMap const *map, + jvmtiLineNumberEntry *li, jint num) +{ + static const char *prev_str = "\xff"; + struct jr_code_debug_info rec; + size_t sret, len, size, flen; + size_t padding_count; + FILE *fp = agent; + int i; + + /* + * no entry to write + */ + if (!num) + return 0; + + if (!fp) { + warnx("jvmti: invalid fd in write_debug_info"); + return -1; + } + + flen = strlen(file) + 1; + + rec.p.id = JIT_CODE_DEBUG_INFO; + size = sizeof(rec); + rec.p.timestamp = perf_get_timestamp(); + rec.code_addr = (uint64_t)(uintptr_t)code; + rec.nr_entry = num; + + /* + * on disk source line info layout: + * uint64_t : addr + * int : line number + * file[] : source file name + * padding : pad to multiple of 8 bytes + */ + size += num * (sizeof(uint64_t) + sizeof(int)); + size += flen + (num - 1) * 2; + /* + * pad to 8 bytes + */ + padding_count = PADDING_8ALIGNED(size); + + rec.p.total_size = size + padding_count; + + /* + * If JVM is multi-threaded, nultiple concurrent calls to agent + * may be possible, so protect file writes + */ + flockfile(fp); + + sret = fwrite_unlocked(&rec, sizeof(rec), 1, fp); + if (sret != 1) + goto error; + + for (i = 0; i < num; i++) { + uint64_t addr; + + addr = (uint64_t)map[i].start_address; + len = sizeof(addr); + sret = fwrite_unlocked(&addr, len, 1, fp); + if (sret != 1) + goto error; + + len = sizeof(int); + sret = fwrite_unlocked(&li[i].line_number, len, 1, fp); + if (sret != 1) + goto error; + + if (i == 0) { + sret = fwrite_unlocked(file, flen, 1, fp); + } else { + sret = fwrite_unlocked(prev_str, 2, 1, fp); + } + if (sret != 1) + goto error; + + } + if (padding_count) + sret = fwrite_unlocked(pad_bytes, padding_count, 1, fp); + if (sret != 1) + goto error; + + funlockfile(fp); + return 0; +error: + funlockfile(fp); + return -1; +} diff --git a/tools/perf/jvmti/jvmti_agent.h b/tools/perf/jvmti/jvmti_agent.h new file mode 100644 index 000000000000..8251a1c5ee3f --- /dev/null +++ b/tools/perf/jvmti/jvmti_agent.h @@ -0,0 +1,29 @@ +#ifndef __JVMTI_AGENT_H__ +#define __JVMTI_AGENT_H__ + +#include <sys/types.h> +#include <stdint.h> +#include <jvmti.h> + +#define __unused __attribute__((unused)) + +#if defined(__cplusplus) +extern "C" { +#endif + +void *jvmti_open(void); +int jvmti_close(void *agent); +int jvmti_write_code(void *agent, char const *symbol_name, + uint64_t vma, void const *code, + const unsigned int code_size); +int jvmti_write_debug_info(void *agent, + uint64_t code, + const char *file, + jvmtiAddrLocationMap const *map, + jvmtiLineNumberEntry *tab, jint nr); + +#if defined(__cplusplus) +} + +#endif +#endif /* __JVMTI_H__ */ diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c new file mode 100644 index 000000000000..92ffbe4ff160 --- /dev/null +++ b/tools/perf/jvmti/libjvmti.c @@ -0,0 +1,208 @@ +#include <sys/types.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <err.h> +#include <jvmti.h> +#include <limits.h> + +#include "jvmti_agent.h" + +static int has_line_numbers; +void *jvmti_agent; + +static void JNICALL +compiled_method_load_cb(jvmtiEnv *jvmti, + jmethodID method, + jint code_size, + void const *code_addr, + jint map_length, + jvmtiAddrLocationMap const *map, + void const *compile_info __unused) +{ + jvmtiLineNumberEntry *tab = NULL; + jclass decl_class; + char *class_sign = NULL; + char *func_name = NULL; + char *func_sign = NULL; + char *file_name= NULL; + char fn[PATH_MAX]; + uint64_t addr = (uint64_t)(uintptr_t)code_addr; + jvmtiError ret; + jint nr_lines = 0; + size_t len; + + ret = (*jvmti)->GetMethodDeclaringClass(jvmti, method, + &decl_class); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: cannot get declaring class"); + return; + } + + if (has_line_numbers && map && map_length) { + + ret = (*jvmti)->GetLineNumberTable(jvmti, method, &nr_lines, &tab); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: cannot get line table for method"); + } else { + ret = (*jvmti)->GetSourceFileName(jvmti, decl_class, &file_name); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: cannot get source filename ret=%d", ret); + nr_lines = 0; + } + } + } + + ret = (*jvmti)->GetClassSignature(jvmti, decl_class, + &class_sign, NULL); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: getclassignature failed"); + goto error; + } + + ret = (*jvmti)->GetMethodName(jvmti, method, &func_name, + &func_sign, NULL); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: failed getmethodname"); + goto error; + } + + /* + * Assume path name is class hierarchy, this is a common practice with Java programs + */ + if (*class_sign == 'L') { + int j, i = 0; + char *p = strrchr(class_sign, '/'); + if (p) { + /* drop the 'L' prefix and copy up to the final '/' */ + for (i = 0; i < (p - class_sign); i++) + fn[i] = class_sign[i+1]; + } + /* + * append file name, we use loops and not string ops to avoid modifying + * class_sign which is used later for the symbol name + */ + for (j = 0; i < (PATH_MAX - 1) && file_name && j < strlen(file_name); j++, i++) + fn[i] = file_name[j]; + fn[i] = '\0'; + } else { + /* fallback case */ + strcpy(fn, file_name); + } + /* + * write source line info record if we have it + */ + if (jvmti_write_debug_info(jvmti_agent, addr, fn, map, tab, nr_lines)) + warnx("jvmti: write_debug_info() failed"); + + len = strlen(func_name) + strlen(class_sign) + strlen(func_sign) + 2; + { + char str[len]; + snprintf(str, len, "%s%s%s", class_sign, func_name, func_sign); + if (jvmti_write_code(jvmti_agent, str, addr, code_addr, code_size)) + warnx("jvmti: write_code() failed"); + } +error: + (*jvmti)->Deallocate(jvmti, (unsigned char *)func_name); + (*jvmti)->Deallocate(jvmti, (unsigned char *)func_sign); + (*jvmti)->Deallocate(jvmti, (unsigned char *)class_sign); + (*jvmti)->Deallocate(jvmti, (unsigned char *)tab); + (*jvmti)->Deallocate(jvmti, (unsigned char *)file_name); +} + +static void JNICALL +code_generated_cb(jvmtiEnv *jvmti, + char const *name, + void const *code_addr, + jint code_size) +{ + uint64_t addr = (uint64_t)(unsigned long)code_addr; + int ret; + + ret = jvmti_write_code(jvmti_agent, name, addr, code_addr, code_size); + if (ret) + warnx("jvmti: write_code() failed for code_generated"); +} + +JNIEXPORT jint JNICALL +Agent_OnLoad(JavaVM *jvm, char *options, void *reserved __unused) +{ + jvmtiEventCallbacks cb; + jvmtiCapabilities caps1; + jvmtiJlocationFormat format; + jvmtiEnv *jvmti = NULL; + jint ret; + + jvmti_agent = jvmti_open(); + if (!jvmti_agent) { + warnx("jvmti: open_agent failed"); + return -1; + } + + /* + * Request a JVMTI interface version 1 environment + */ + ret = (*jvm)->GetEnv(jvm, (void *)&jvmti, JVMTI_VERSION_1); + if (ret != JNI_OK) { + warnx("jvmti: jvmti version 1 not supported"); + return -1; + } + + /* + * acquire method_load capability, we require it + * request line numbers (optional) + */ + memset(&caps1, 0, sizeof(caps1)); + caps1.can_generate_compiled_method_load_events = 1; + + ret = (*jvmti)->AddCapabilities(jvmti, &caps1); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: acquire compiled_method capability failed"); + return -1; + } + ret = (*jvmti)->GetJLocationFormat(jvmti, &format); + if (ret == JVMTI_ERROR_NONE && format == JVMTI_JLOCATION_JVMBCI) { + memset(&caps1, 0, sizeof(caps1)); + caps1.can_get_line_numbers = 1; + caps1.can_get_source_file_name = 1; + ret = (*jvmti)->AddCapabilities(jvmti, &caps1); + if (ret == JVMTI_ERROR_NONE) + has_line_numbers = 1; + } + + memset(&cb, 0, sizeof(cb)); + + cb.CompiledMethodLoad = compiled_method_load_cb; + cb.DynamicCodeGenerated = code_generated_cb; + + ret = (*jvmti)->SetEventCallbacks(jvmti, &cb, sizeof(cb)); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: cannot set event callbacks"); + return -1; + } + + ret = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, + JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: setnotification failed for method_load"); + return -1; + } + + ret = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, + JVMTI_EVENT_DYNAMIC_CODE_GENERATED, NULL); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: setnotification failed on code_generated"); + return -1; + } + return 0; +} + +JNIEXPORT void JNICALL +Agent_OnUnload(JavaVM *jvm __unused) +{ + int ret; + + ret = jvmti_close(jvmti_agent); + if (ret) + errx(1, "Error: op_close_agent()"); +} -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 19/19] perf jit: add source line info support 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (17 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 18/19] perf tools: add JVMTI agent library Arnaldo Carvalho de Melo @ 2016-02-05 16:26 ` Arnaldo Carvalho de Melo 2016-02-09 9:40 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar 19 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:26 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Stephane Eranian, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo From: Stephane Eranian <eranian@google.com> This patch adds source line information support to perf for jitted code. The source line info must be emitted by the runtime, such as JVMTI. Perf injects extract the source line info from the jitdump file and adds the corresponding .debug_lines section in the ELF image generated for each jitted function. The source line enables matching any address in the profile with a source file and line number. The improvement is visible in perf annotate with the source code displayed alongside the assembly code. The dwarf code leverages the support from OProfile which is also released under GPLv2. Copyright 2007 OProfile authors. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-5-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/jvmti/jvmti_agent.c | 32 +-- tools/perf/jvmti/jvmti_agent.h | 11 +- tools/perf/jvmti/libjvmti.c | 122 ++++++++- tools/perf/util/Build | 3 + tools/perf/util/genelf.c | 15 +- tools/perf/util/genelf.h | 6 +- tools/perf/util/genelf_debug.c | 610 +++++++++++++++++++++++++++++++++++++++++ tools/perf/util/jitdump.c | 8 +- 8 files changed, 768 insertions(+), 39 deletions(-) create mode 100644 tools/perf/util/genelf_debug.c diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c index cbab139de5a4..6461e02ab940 100644 --- a/tools/perf/jvmti/jvmti_agent.c +++ b/tools/perf/jvmti/jvmti_agent.c @@ -374,20 +374,20 @@ jvmti_write_code(void *agent, char const *sym, int jvmti_write_debug_info(void *agent, uint64_t code, const char *file, - jvmtiAddrLocationMap const *map, - jvmtiLineNumberEntry *li, jint num) + jvmti_line_info_t *li, int nr_lines) { - static const char *prev_str = "\xff"; struct jr_code_debug_info rec; size_t sret, len, size, flen; size_t padding_count; + uint64_t addr; + const char *fn = file; FILE *fp = agent; int i; /* * no entry to write */ - if (!num) + if (!nr_lines) return 0; if (!fp) { @@ -401,17 +401,18 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file, size = sizeof(rec); rec.p.timestamp = perf_get_timestamp(); rec.code_addr = (uint64_t)(uintptr_t)code; - rec.nr_entry = num; + rec.nr_entry = nr_lines; /* * on disk source line info layout: * uint64_t : addr * int : line number + * int : column discriminator * file[] : source file name * padding : pad to multiple of 8 bytes */ - size += num * (sizeof(uint64_t) + sizeof(int)); - size += flen + (num - 1) * 2; + size += nr_lines * sizeof(struct debug_entry); + size += flen * nr_lines; /* * pad to 8 bytes */ @@ -429,28 +430,27 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file, if (sret != 1) goto error; - for (i = 0; i < num; i++) { - uint64_t addr; + for (i = 0; i < nr_lines; i++) { - addr = (uint64_t)map[i].start_address; + addr = (uint64_t)li[i].pc; len = sizeof(addr); sret = fwrite_unlocked(&addr, len, 1, fp); if (sret != 1) goto error; - len = sizeof(int); + len = sizeof(li[0].line_number); sret = fwrite_unlocked(&li[i].line_number, len, 1, fp); if (sret != 1) goto error; - if (i == 0) { - sret = fwrite_unlocked(file, flen, 1, fp); - } else { - sret = fwrite_unlocked(prev_str, 2, 1, fp); - } + len = sizeof(li[0].discrim); + sret = fwrite_unlocked(&li[i].discrim, len, 1, fp); if (sret != 1) goto error; + sret = fwrite_unlocked(fn, flen, 1, fp); + if (sret != 1) + goto error; } if (padding_count) sret = fwrite_unlocked(pad_bytes, padding_count, 1, fp); diff --git a/tools/perf/jvmti/jvmti_agent.h b/tools/perf/jvmti/jvmti_agent.h index 8251a1c5ee3f..bedf5d0ba9ff 100644 --- a/tools/perf/jvmti/jvmti_agent.h +++ b/tools/perf/jvmti/jvmti_agent.h @@ -11,16 +11,23 @@ extern "C" { #endif +typedef struct { + unsigned long pc; + int line_number; + int discrim; /* discriminator -- 0 for now */ +} jvmti_line_info_t; + void *jvmti_open(void); int jvmti_close(void *agent); int jvmti_write_code(void *agent, char const *symbol_name, uint64_t vma, void const *code, const unsigned int code_size); + int jvmti_write_debug_info(void *agent, uint64_t code, const char *file, - jvmtiAddrLocationMap const *map, - jvmtiLineNumberEntry *tab, jint nr); + jvmti_line_info_t *li, + int nr_lines); #if defined(__cplusplus) } diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c index 92ffbe4ff160..ac12e4b91a92 100644 --- a/tools/perf/jvmti/libjvmti.c +++ b/tools/perf/jvmti/libjvmti.c @@ -4,6 +4,7 @@ #include <stdlib.h> #include <err.h> #include <jvmti.h> +#include <jvmticmlr.h> #include <limits.h> #include "jvmti_agent.h" @@ -11,6 +12,100 @@ static int has_line_numbers; void *jvmti_agent; +static jvmtiError +do_get_line_numbers(jvmtiEnv *jvmti, void *pc, jmethodID m, jint bci, + jvmti_line_info_t *tab, jint *nr) +{ + jint i, lines = 0; + jint nr_lines = 0; + jvmtiLineNumberEntry *loc_tab = NULL; + jvmtiError ret; + + ret = (*jvmti)->GetLineNumberTable(jvmti, m, &nr_lines, &loc_tab); + if (ret != JVMTI_ERROR_NONE) + return ret; + + for (i = 0; i < nr_lines; i++) { + if (loc_tab[i].start_location < bci) { + tab[lines].pc = (unsigned long)pc; + tab[lines].line_number = loc_tab[i].line_number; + tab[lines].discrim = 0; /* not yet used */ + lines++; + } else { + break; + } + } + (*jvmti)->Deallocate(jvmti, (unsigned char *)loc_tab); + *nr = lines; + return JVMTI_ERROR_NONE; +} + +static jvmtiError +get_line_numbers(jvmtiEnv *jvmti, const void *compile_info, jvmti_line_info_t **tab, int *nr_lines) +{ + const jvmtiCompiledMethodLoadRecordHeader *hdr; + jvmtiCompiledMethodLoadInlineRecord *rec; + jvmtiLineNumberEntry *lne = NULL; + PCStackInfo *c; + jint nr, ret; + int nr_total = 0; + int i, lines_total = 0; + + if (!(tab && nr_lines)) + return JVMTI_ERROR_NULL_POINTER; + + /* + * Phase 1 -- get the number of lines necessary + */ + for (hdr = compile_info; hdr != NULL; hdr = hdr->next) { + if (hdr->kind == JVMTI_CMLR_INLINE_INFO) { + rec = (jvmtiCompiledMethodLoadInlineRecord *)hdr; + for (i = 0; i < rec->numpcs; i++) { + c = rec->pcinfo + i; + nr = 0; + /* + * unfortunately, need a tab to get the number of lines! + */ + ret = (*jvmti)->GetLineNumberTable(jvmti, c->methods[0], &nr, &lne); + if (ret == JVMTI_ERROR_NONE) { + /* free what was allocated for nothing */ + (*jvmti)->Deallocate(jvmti, (unsigned char *)lne); + nr_total += (int)nr; + } + } + } + } + + if (nr_total == 0) + return JVMTI_ERROR_NOT_FOUND; + + /* + * Phase 2 -- allocate big enough line table + */ + *tab = malloc(nr_total * sizeof(**tab)); + if (!*tab) + return JVMTI_ERROR_OUT_OF_MEMORY; + + for (hdr = compile_info; hdr != NULL; hdr = hdr->next) { + if (hdr->kind == JVMTI_CMLR_INLINE_INFO) { + rec = (jvmtiCompiledMethodLoadInlineRecord *)hdr; + for (i = 0; i < rec->numpcs; i++) { + c = rec->pcinfo + i; + nr = 0; + ret = do_get_line_numbers(jvmti, c->pc, + c->methods[0], + c->bcis[0], + *tab + lines_total, + &nr); + if (ret == JVMTI_ERROR_NONE) + lines_total += nr; + } + } + } + *nr_lines = lines_total; + return JVMTI_ERROR_NONE; +} + static void JNICALL compiled_method_load_cb(jvmtiEnv *jvmti, jmethodID method, @@ -18,9 +113,9 @@ compiled_method_load_cb(jvmtiEnv *jvmti, void const *code_addr, jint map_length, jvmtiAddrLocationMap const *map, - void const *compile_info __unused) + const void *compile_info) { - jvmtiLineNumberEntry *tab = NULL; + jvmti_line_info_t *line_tab = NULL; jclass decl_class; char *class_sign = NULL; char *func_name = NULL; @@ -29,7 +124,7 @@ compiled_method_load_cb(jvmtiEnv *jvmti, char fn[PATH_MAX]; uint64_t addr = (uint64_t)(uintptr_t)code_addr; jvmtiError ret; - jint nr_lines = 0; + int nr_lines = 0; /* in line_tab[] */ size_t len; ret = (*jvmti)->GetMethodDeclaringClass(jvmti, method, @@ -40,19 +135,19 @@ compiled_method_load_cb(jvmtiEnv *jvmti, } if (has_line_numbers && map && map_length) { - - ret = (*jvmti)->GetLineNumberTable(jvmti, method, &nr_lines, &tab); + ret = get_line_numbers(jvmti, compile_info, &line_tab, &nr_lines); if (ret != JVMTI_ERROR_NONE) { warnx("jvmti: cannot get line table for method"); - } else { - ret = (*jvmti)->GetSourceFileName(jvmti, decl_class, &file_name); - if (ret != JVMTI_ERROR_NONE) { - warnx("jvmti: cannot get source filename ret=%d", ret); - nr_lines = 0; - } + nr_lines = 0; } } + ret = (*jvmti)->GetSourceFileName(jvmti, decl_class, &file_name); + if (ret != JVMTI_ERROR_NONE) { + warnx("jvmti: cannot get source filename ret=%d", ret); + goto error; + } + ret = (*jvmti)->GetClassSignature(jvmti, decl_class, &class_sign, NULL); if (ret != JVMTI_ERROR_NONE) { @@ -92,13 +187,14 @@ compiled_method_load_cb(jvmtiEnv *jvmti, /* * write source line info record if we have it */ - if (jvmti_write_debug_info(jvmti_agent, addr, fn, map, tab, nr_lines)) + if (jvmti_write_debug_info(jvmti_agent, addr, fn, line_tab, nr_lines)) warnx("jvmti: write_debug_info() failed"); len = strlen(func_name) + strlen(class_sign) + strlen(func_sign) + 2; { char str[len]; snprintf(str, len, "%s%s%s", class_sign, func_name, func_sign); + if (jvmti_write_code(jvmti_agent, str, addr, code_addr, code_size)) warnx("jvmti: write_code() failed"); } @@ -106,8 +202,8 @@ error: (*jvmti)->Deallocate(jvmti, (unsigned char *)func_name); (*jvmti)->Deallocate(jvmti, (unsigned char *)func_sign); (*jvmti)->Deallocate(jvmti, (unsigned char *)class_sign); - (*jvmti)->Deallocate(jvmti, (unsigned char *)tab); (*jvmti)->Deallocate(jvmti, (unsigned char *)file_name); + free(line_tab); } static void JNICALL diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 52a4a806ee2f..a34752d28488 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -108,8 +108,11 @@ libperf-$(CONFIG_LZMA) += lzma.o libperf-y += demangle-java.o libperf-$(CONFIG_LIBELF) += jitdump.o libperf-$(CONFIG_LIBELF) += genelf.o +libperf-$(CONFIG_LIBELF) += genelf_debug.o CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" +# avoid compiler warnings in 32-bit mode +CFLAGS_genelf_debug.o += -Wno-packed $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c $(call rule_mkdir) diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c index 145f8116ef56..c1ef805c6a8f 100644 --- a/tools/perf/util/genelf.c +++ b/tools/perf/util/genelf.c @@ -156,7 +156,8 @@ gen_build_id(struct buildid_note *note, unsigned long load_addr, const void *cod */ int jit_write_elf(int fd, uint64_t load_addr, const char *sym, - const void *code, int csize) + const void *code, int csize, + void *debug, int nr_debug_entries) { Elf *e; Elf_Data *d; @@ -385,9 +386,15 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym, shdr->sh_size = sizeof(bnote); shdr->sh_entsize = 0; - if (elf_update(e, ELF_C_WRITE) < 0) { - warnx("elf_update 4 failed"); - goto error; + if (debug && nr_debug_entries) { + retval = jit_add_debug_info(e, load_addr, debug, nr_debug_entries); + if (retval) + goto error; + } else { + if (elf_update(e, ELF_C_WRITE) < 0) { + warnx("elf_update 4 failed"); + goto error; + } } retval = 0; diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h index d8e9ece13c8b..45bf9c6d3257 100644 --- a/tools/perf/util/genelf.h +++ b/tools/perf/util/genelf.h @@ -3,7 +3,11 @@ /* genelf.c */ extern int jit_write_elf(int fd, uint64_t code_addr, const char *sym, - const void *code, int csize); + const void *code, int csize, + void *debug, int nr_debug_entries); +/* genelf_debug.c */ +extern int jit_add_debug_info(Elf *e, uint64_t code_addr, + void *debug, int nr_debug_entries); #if defined(__arm__) #define GEN_ELF_ARCH EM_ARM diff --git a/tools/perf/util/genelf_debug.c b/tools/perf/util/genelf_debug.c new file mode 100644 index 000000000000..5980f7d256b1 --- /dev/null +++ b/tools/perf/util/genelf_debug.c @@ -0,0 +1,610 @@ +/* + * genelf_debug.c + * Copyright (C) 2015, Google, Inc + * + * Contributed by: + * Stephane Eranian <eranian@google.com> + * + * Released under the GPL v2. + * + * based on GPLv2 source code from Oprofile + * @remark Copyright 2007 OProfile authors + * @author Philippe Elie + */ +#include <sys/types.h> +#include <stdio.h> +#include <getopt.h> +#include <stddef.h> +#include <libelf.h> +#include <string.h> +#include <stdlib.h> +#include <inttypes.h> +#include <limits.h> +#include <fcntl.h> +#include <err.h> +#include <dwarf.h> + +#include "perf.h" +#include "genelf.h" +#include "../util/jitdump.h" + +#define BUFFER_EXT_DFL_SIZE (4 * 1024) + +typedef uint32_t uword; +typedef uint16_t uhalf; +typedef int32_t sword; +typedef int16_t shalf; +typedef uint8_t ubyte; +typedef int8_t sbyte; + +struct buffer_ext { + size_t cur_pos; + size_t max_sz; + void *data; +}; + +static void +buffer_ext_dump(struct buffer_ext *be, const char *msg) +{ + size_t i; + warnx("DUMP for %s", msg); + for (i = 0 ; i < be->cur_pos; i++) + warnx("%4zu 0x%02x", i, (((char *)be->data)[i]) & 0xff); +} + +static inline int +buffer_ext_add(struct buffer_ext *be, void *addr, size_t sz) +{ + void *tmp; + size_t be_sz = be->max_sz; + +retry: + if ((be->cur_pos + sz) < be_sz) { + memcpy(be->data + be->cur_pos, addr, sz); + be->cur_pos += sz; + return 0; + } + + if (!be_sz) + be_sz = BUFFER_EXT_DFL_SIZE; + else + be_sz <<= 1; + + tmp = realloc(be->data, be_sz); + if (!tmp) + return -1; + + be->data = tmp; + be->max_sz = be_sz; + + goto retry; +} + +static void +buffer_ext_init(struct buffer_ext *be) +{ + be->data = NULL; + be->cur_pos = 0; + be->max_sz = 0; +} + +static inline size_t +buffer_ext_size(struct buffer_ext *be) +{ + return be->cur_pos; +} + +static inline void * +buffer_ext_addr(struct buffer_ext *be) +{ + return be->data; +} + +struct debug_line_header { + // Not counting this field + uword total_length; + // version number (2 currently) + uhalf version; + // relative offset from next field to + // program statement + uword prolog_length; + ubyte minimum_instruction_length; + ubyte default_is_stmt; + // line_base - see DWARF 2 specs + sbyte line_base; + // line_range - see DWARF 2 specs + ubyte line_range; + // number of opcode + 1 + ubyte opcode_base; + /* follow the array of opcode args nr: ubytes [nr_opcode_base] */ + /* follow the search directories index, zero terminated string + * terminated by an empty string. + */ + /* follow an array of { filename, LEB128, LEB128, LEB128 }, first is + * the directory index entry, 0 means current directory, then mtime + * and filesize, last entry is followed by en empty string. + */ + /* follow the first program statement */ +} __attribute__((packed)); + +/* DWARF 2 spec talk only about one possible compilation unit header while + * binutils can handle two flavours of dwarf 2, 32 and 64 bits, this is not + * related to the used arch, an ELF 32 can hold more than 4 Go of debug + * information. For now we handle only DWARF 2 32 bits comp unit. It'll only + * become a problem if we generate more than 4GB of debug information. + */ +struct compilation_unit_header { + uword total_length; + uhalf version; + uword debug_abbrev_offset; + ubyte pointer_size; +} __attribute__((packed)); + +#define DW_LNS_num_opcode (DW_LNS_set_isa + 1) + +/* field filled at run time are marked with -1 */ +static struct debug_line_header const default_debug_line_header = { + .total_length = -1, + .version = 2, + .prolog_length = -1, + .minimum_instruction_length = 1, /* could be better when min instruction size != 1 */ + .default_is_stmt = 1, /* we don't take care about basic block */ + .line_base = -5, /* sensible value for line base ... */ + .line_range = -14, /* ... and line range are guessed statically */ + .opcode_base = DW_LNS_num_opcode +}; + +static ubyte standard_opcode_length[] = +{ + 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 +}; +#if 0 +{ + [DW_LNS_advance_pc] = 1, + [DW_LNS_advance_line] = 1, + [DW_LNS_set_file] = 1, + [DW_LNS_set_column] = 1, + [DW_LNS_fixed_advance_pc] = 1, + [DW_LNS_set_isa] = 1, +}; +#endif + +/* field filled at run time are marked with -1 */ +static struct compilation_unit_header default_comp_unit_header = { + .total_length = -1, + .version = 2, + .debug_abbrev_offset = 0, /* we reuse the same abbrev entries for all comp unit */ + .pointer_size = sizeof(void *) +}; + +static void emit_uword(struct buffer_ext *be, uword data) +{ + buffer_ext_add(be, &data, sizeof(uword)); +} + +static void emit_string(struct buffer_ext *be, const char *s) +{ + buffer_ext_add(be, (void *)s, strlen(s) + 1); +} + +static void emit_unsigned_LEB128(struct buffer_ext *be, + unsigned long data) +{ + do { + ubyte cur = data & 0x7F; + data >>= 7; + if (data) + cur |= 0x80; + buffer_ext_add(be, &cur, 1); + } while (data); +} + +static void emit_signed_LEB128(struct buffer_ext *be, long data) +{ + int more = 1; + int negative = data < 0; + int size = sizeof(long) * CHAR_BIT; + while (more) { + ubyte cur = data & 0x7F; + data >>= 7; + if (negative) + data |= - (1 << (size - 7)); + if ((data == 0 && !(cur & 0x40)) || + (data == -1l && (cur & 0x40))) + more = 0; + else + cur |= 0x80; + buffer_ext_add(be, &cur, 1); + } +} + +static void emit_extended_opcode(struct buffer_ext *be, ubyte opcode, + void *data, size_t data_len) +{ + buffer_ext_add(be, (char *)"", 1); + + emit_unsigned_LEB128(be, data_len + 1); + + buffer_ext_add(be, &opcode, 1); + buffer_ext_add(be, data, data_len); +} + +static void emit_opcode(struct buffer_ext *be, ubyte opcode) +{ + buffer_ext_add(be, &opcode, 1); +} + +static void emit_opcode_signed(struct buffer_ext *be, + ubyte opcode, long data) +{ + buffer_ext_add(be, &opcode, 1); + emit_signed_LEB128(be, data); +} + +static void emit_opcode_unsigned(struct buffer_ext *be, ubyte opcode, + unsigned long data) +{ + buffer_ext_add(be, &opcode, 1); + emit_unsigned_LEB128(be, data); +} + +static void emit_advance_pc(struct buffer_ext *be, unsigned long delta_pc) +{ + emit_opcode_unsigned(be, DW_LNS_advance_pc, delta_pc); +} + +static void emit_advance_lineno(struct buffer_ext *be, long delta_lineno) +{ + emit_opcode_signed(be, DW_LNS_advance_line, delta_lineno); +} + +static void emit_lne_end_of_sequence(struct buffer_ext *be) +{ + emit_extended_opcode(be, DW_LNE_end_sequence, NULL, 0); +} + +static void emit_set_file(struct buffer_ext *be, unsigned long idx) +{ + emit_opcode_unsigned(be, DW_LNS_set_file, idx); +} + +static void emit_lne_define_filename(struct buffer_ext *be, + const char *filename) +{ + buffer_ext_add(be, (void *)"", 1); + + /* LNE field, strlen(filename) + zero termination, 3 bytes for: the dir entry, timestamp, filesize */ + emit_unsigned_LEB128(be, strlen(filename) + 5); + emit_opcode(be, DW_LNE_define_file); + emit_string(be, filename); + /* directory index 0=do not know */ + emit_unsigned_LEB128(be, 0); + /* last modification date on file 0=do not know */ + emit_unsigned_LEB128(be, 0); + /* filesize 0=do not know */ + emit_unsigned_LEB128(be, 0); +} + +static void emit_lne_set_address(struct buffer_ext *be, + void *address) +{ + emit_extended_opcode(be, DW_LNE_set_address, &address, sizeof(unsigned long)); +} + +static ubyte get_special_opcode(struct debug_entry *ent, + unsigned int last_line, + unsigned long last_vma) +{ + unsigned int temp; + unsigned long delta_addr; + + /* + * delta from line_base + */ + temp = (ent->lineno - last_line) - default_debug_line_header.line_base; + + if (temp >= default_debug_line_header.line_range) + return 0; + + /* + * delta of addresses + */ + delta_addr = (ent->addr - last_vma) / default_debug_line_header.minimum_instruction_length; + + /* This is not sufficient to ensure opcode will be in [0-256] but + * sufficient to ensure when summing with the delta lineno we will + * not overflow the unsigned long opcode */ + + if (delta_addr <= 256 / default_debug_line_header.line_range) { + unsigned long opcode = temp + + (delta_addr * default_debug_line_header.line_range) + + default_debug_line_header.opcode_base; + + return opcode <= 255 ? opcode : 0; + } + return 0; +} + +static void emit_lineno_info(struct buffer_ext *be, + struct debug_entry *ent, size_t nr_entry, + unsigned long code_addr) +{ + size_t i; + + /* + * Machine state at start of a statement program + * address = 0 + * file = 1 + * line = 1 + * column = 0 + * is_stmt = default_is_stmt as given in the debug_line_header + * basic block = 0 + * end sequence = 0 + */ + + /* start state of the state machine we take care of */ + unsigned long last_vma = code_addr; + char const *cur_filename = NULL; + unsigned long cur_file_idx = 0; + int last_line = 1; + + emit_lne_set_address(be, (void *)code_addr); + + for (i = 0; i < nr_entry; i++, ent = debug_entry_next(ent)) { + int need_copy = 0; + ubyte special_opcode; + + /* + * check if filename changed, if so add it + */ + if (!cur_filename || strcmp(cur_filename, ent->name)) { + emit_lne_define_filename(be, ent->name); + cur_filename = ent->name; + emit_set_file(be, ++cur_file_idx); + need_copy = 1; + } + + special_opcode = get_special_opcode(ent, last_line, last_vma); + if (special_opcode != 0) { + last_line = ent->lineno; + last_vma = ent->addr; + emit_opcode(be, special_opcode); + } else { + /* + * lines differ, emit line delta + */ + if (last_line != ent->lineno) { + emit_advance_lineno(be, ent->lineno - last_line); + last_line = ent->lineno; + need_copy = 1; + } + /* + * addresses differ, emit address delta + */ + if (last_vma != ent->addr) { + emit_advance_pc(be, ent->addr - last_vma); + last_vma = ent->addr; + need_copy = 1; + } + /* + * add new row to matrix + */ + if (need_copy) + emit_opcode(be, DW_LNS_copy); + } + } +} + +static void add_debug_line(struct buffer_ext *be, + struct debug_entry *ent, size_t nr_entry, + unsigned long code_addr) +{ + struct debug_line_header * dbg_header; + size_t old_size; + + old_size = buffer_ext_size(be); + + buffer_ext_add(be, (void *)&default_debug_line_header, + sizeof(default_debug_line_header)); + + buffer_ext_add(be, &standard_opcode_length, sizeof(standard_opcode_length)); + + // empty directory entry + buffer_ext_add(be, (void *)"", 1); + + // empty filename directory + buffer_ext_add(be, (void *)"", 1); + + dbg_header = buffer_ext_addr(be) + old_size; + dbg_header->prolog_length = (buffer_ext_size(be) - old_size) - + offsetof(struct debug_line_header, minimum_instruction_length); + + emit_lineno_info(be, ent, nr_entry, code_addr); + + emit_lne_end_of_sequence(be); + + dbg_header = buffer_ext_addr(be) + old_size; + dbg_header->total_length = (buffer_ext_size(be) - old_size) - + offsetof(struct debug_line_header, version); +} + +static void +add_debug_abbrev(struct buffer_ext *be) +{ + emit_unsigned_LEB128(be, 1); + emit_unsigned_LEB128(be, DW_TAG_compile_unit); + emit_unsigned_LEB128(be, DW_CHILDREN_yes); + emit_unsigned_LEB128(be, DW_AT_stmt_list); + emit_unsigned_LEB128(be, DW_FORM_data4); + emit_unsigned_LEB128(be, 0); + emit_unsigned_LEB128(be, 0); + emit_unsigned_LEB128(be, 0); +} + +static void +add_compilation_unit(struct buffer_ext *be, + size_t offset_debug_line) +{ + struct compilation_unit_header *comp_unit_header; + size_t old_size = buffer_ext_size(be); + + buffer_ext_add(be, &default_comp_unit_header, + sizeof(default_comp_unit_header)); + + emit_unsigned_LEB128(be, 1); + emit_uword(be, offset_debug_line); + + comp_unit_header = buffer_ext_addr(be) + old_size; + comp_unit_header->total_length = (buffer_ext_size(be) - old_size) - + offsetof(struct compilation_unit_header, version); +} + +static int +jit_process_debug_info(uint64_t code_addr, + void *debug, int nr_debug_entries, + struct buffer_ext *dl, + struct buffer_ext *da, + struct buffer_ext *di) +{ + struct debug_entry *ent = debug; + int i; + + for (i = 0; i < nr_debug_entries; i++) { + ent->addr = ent->addr - code_addr; + ent = debug_entry_next(ent); + } + add_compilation_unit(di, buffer_ext_size(dl)); + add_debug_line(dl, debug, nr_debug_entries, 0); + add_debug_abbrev(da); + if (0) buffer_ext_dump(da, "abbrev"); + + return 0; +} + +int +jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries) +{ + Elf_Data *d; + Elf_Scn *scn; + Elf_Shdr *shdr; + struct buffer_ext dl, di, da; + int ret; + + buffer_ext_init(&dl); + buffer_ext_init(&di); + buffer_ext_init(&da); + + ret = jit_process_debug_info(code_addr, debug, nr_debug_entries, &dl, &da, &di); + if (ret) + return -1; + /* + * setup .debug_line section + */ + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + return -1; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + return -1; + } + + d->d_align = 1; + d->d_off = 0LL; + d->d_buf = buffer_ext_addr(&dl); + d->d_type = ELF_T_BYTE; + d->d_size = buffer_ext_size(&dl); + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + return -1; + } + + shdr->sh_name = 52; /* .debug_line */ + shdr->sh_type = SHT_PROGBITS; + shdr->sh_addr = 0; /* must be zero or == sh_offset -> dynamic object */ + shdr->sh_flags = 0; + shdr->sh_entsize = 0; + + /* + * setup .debug_info section + */ + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + return -1; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + return -1; + } + + d->d_align = 1; + d->d_off = 0LL; + d->d_buf = buffer_ext_addr(&di); + d->d_type = ELF_T_BYTE; + d->d_size = buffer_ext_size(&di); + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + return -1; + } + + shdr->sh_name = 64; /* .debug_info */ + shdr->sh_type = SHT_PROGBITS; + shdr->sh_addr = 0; /* must be zero or == sh_offset -> dynamic object */ + shdr->sh_flags = 0; + shdr->sh_entsize = 0; + + /* + * setup .debug_abbrev section + */ + scn = elf_newscn(e); + if (!scn) { + warnx("cannot create section"); + return -1; + } + + d = elf_newdata(scn); + if (!d) { + warnx("cannot get new data"); + return -1; + } + + d->d_align = 1; + d->d_off = 0LL; + d->d_buf = buffer_ext_addr(&da); + d->d_type = ELF_T_BYTE; + d->d_size = buffer_ext_size(&da); + d->d_version = EV_CURRENT; + + shdr = elf_getshdr(scn); + if (!shdr) { + warnx("cannot get section header"); + return -1; + } + + shdr->sh_name = 76; /* .debug_info */ + shdr->sh_type = SHT_PROGBITS; + shdr->sh_addr = 0; /* must be zero or == sh_offset -> dynamic object */ + shdr->sh_flags = 0; + shdr->sh_entsize = 0; + + /* + * now we update the ELF image with all the sections + */ + if (elf_update(e, ELF_C_WRITE) < 0) { + warnx("elf_update debug failed"); + return -1; + } + return 0; +} diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 9f7a01289efe..99fa5eee9fe0 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c @@ -63,7 +63,9 @@ jit_emit_elf(char *filename, const char *sym, uint64_t code_addr, const void *code, - int csize) + int csize, + void *debug, + int nr_debug_entries) { int ret, fd; @@ -76,7 +78,7 @@ jit_emit_elf(char *filename, return -1; } - ret = jit_write_elf(fd, code_addr, sym, (const void *)code, csize); + ret = jit_write_elf(fd, code_addr, sym, (const void *)code, csize, debug, nr_debug_entries); close(fd); @@ -347,7 +349,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr) size = PERF_ALIGN(size, sizeof(u64)); uaddr = (uintptr_t)code; - ret = jit_emit_elf(filename, sym, addr, (const void *)uaddr, csize); + ret = jit_emit_elf(filename, sym, addr, (const void *)uaddr, csize, jd->debug_data, jd->nr_debug_entries); if (jd->debug_data && jd->nr_debug_entries) { free(jd->debug_data); -- 2.5.0 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (18 preceding siblings ...) 2016-02-05 16:26 ` [PATCH 19/19] perf jit: add source line info support Arnaldo Carvalho de Melo @ 2016-02-09 9:40 ` Ingo Molnar 19 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-02-09 9:40 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Marcin Ślusarz, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit d3aaf09f889b31f3b424bf9603b163ec1204c361: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-04 08:58:01 +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 > > for you to fetch changes up to 598b7c6919c7bbcc1243009721a01bc12275ff3e: > > perf jit: add source line info support (2016-02-05 12:33:09 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible fixes: > > - Handle spaces in file names obtained from /proc/pid/maps (Marcin Ślusarz) > > New features: > > - Improved support for java, using the JVMTI agent library to do jitdumps > that then will be inserted in synthesized PERF_RECORD_MMAP2 events via > 'perf inject' pointed to synthesized ELF files stored in ~/.debug and > keyed with build-ids, to allow symbol resolution and even annotation with > source line info, see the changeset comments to see how to use it (Stephane Eranian) > > Documentation: > > - Document mmore variables in the 'perf config' man page (Taeung Song) > > Infrastructure: > > - Improve a bit the 'make -C tools/perf build-test' output (Arnaldo Carvalho de Melo) > > - Do 'build-test' in parallell, using 'make -j' (Arnaldo Carvalho de Melo) > > - Fix handling of 'clean' in multi-target make invokations for parallell builds (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (4): > perf build tests: Elide "-f Makefile" from make invokation > perf build tests: Move the feature related vars to the front of the make cmdline > perf build tests: Do parallell builds with 'build-test' > perf inject: Make sure mmap records are ordered when injecting build_ids > > Jiri Olsa (1): > perf tools: Fix parallel build including 'clean' target > > Marcin Ślusarz (1): > perf tools: handle spaces in file names obtained from /proc/pid/maps > > Stephane Eranian (5): > perf symbols: add Java demangling support > perf build: Add libcrypto feature detection > perf inject: Add jitdump mmap injection support > perf tools: add JVMTI agent library > perf jit: add source line info support > > Taeung Song (8): > perf config: Document 'ui.show-headers' variable in man page > perf config: Document variables for 'call-graph' section in man page > perf config: Document variables for 'report' section in man page > perf config: Document 'top.children' variable in man page > perf config: Document 'man.viewer' variable in man page > perf config: Document 'pager.<subcommand>' variables in man page > perf config: Document 'kmem.default' variable in man page > perf config: Document 'record.build-id' variable in man page > > tools/build/Makefile.feature | 2 + > tools/build/feature/Makefile | 4 + > tools/build/feature/test-all.c | 5 + > tools/build/feature/test-libcrypto.c | 17 + > tools/perf/Documentation/perf-config.txt | 143 +++++++ > tools/perf/Documentation/perf-inject.txt | 7 + > tools/perf/Makefile | 16 +- > tools/perf/Makefile.perf | 3 + > tools/perf/builtin-inject.c | 107 ++++- > tools/perf/config/Makefile | 11 + > tools/perf/jvmti/Makefile | 76 ++++ > tools/perf/jvmti/jvmti_agent.c | 465 +++++++++++++++++++++ > tools/perf/jvmti/jvmti_agent.h | 36 ++ > tools/perf/jvmti/libjvmti.c | 304 ++++++++++++++ > tools/perf/tests/make | 11 +- > tools/perf/util/Build | 6 + > tools/perf/util/demangle-java.c | 199 +++++++++ > tools/perf/util/demangle-java.h | 10 + > tools/perf/util/event.c | 2 +- > tools/perf/util/genelf.c | 449 +++++++++++++++++++++ > tools/perf/util/genelf.h | 67 +++ > tools/perf/util/genelf_debug.c | 610 ++++++++++++++++++++++++++++ > tools/perf/util/jit.h | 15 + > tools/perf/util/jitdump.c | 672 +++++++++++++++++++++++++++++++ > tools/perf/util/jitdump.h | 124 ++++++ > tools/perf/util/symbol-elf.c | 3 + > 26 files changed, 3357 insertions(+), 7 deletions(-) > create mode 100644 tools/build/feature/test-libcrypto.c > create mode 100644 tools/perf/jvmti/Makefile > create mode 100644 tools/perf/jvmti/jvmti_agent.c > create mode 100644 tools/perf/jvmti/jvmti_agent.h > create mode 100644 tools/perf/jvmti/libjvmti.c > create mode 100644 tools/perf/util/demangle-java.c > create mode 100644 tools/perf/util/demangle-java.h > create mode 100644 tools/perf/util/genelf.c > create mode 100644 tools/perf/util/genelf.h > create mode 100644 tools/perf/util/genelf_debug.c > create mode 100644 tools/perf/util/jit.h > create mode 100644 tools/perf/util/jitdump.c > create mode 100644 tools/perf/util/jitdump.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2017-11-03 13:54 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Andrey Vagin, Andy Lutomirski, Changbin Du, Cyrill Gorcunov, David Ahern, Jin Yao, Jiri Olsa, kernel-team, Michael Ellerman, Milian Wolff, Namhyung Kim, Peter Zijlstra, Wang Nan, yuzhoujian, Arnaldo Carvalho de Melo Hi Ingo, A bit of trivia info is now automatically shown in the container builds, the gcc version used to build the tools, that gets changed as the distros update gcc and as I update the container build images :-) Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 0d3d73aac2ff05c78387aa9dcc2c8aa3804405e7: perf/core: Rewrite event timekeeping (2017-10-27 10:31:59 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.15-20171103 for you to fetch changes up to 7285cf3325b4a1dfb336d31eebc27dfbc30fb9aa: perf srcline: Show correct function name for srcline of callchains (2017-11-01 11:44:38 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Beautify the 'kcmp' and 'prctl' syscall arguments in 'perf trace' (Arnaldo Carvalho de Melo) - Implement a way to print formatted output to per-event files in 'perf script' to facilitate generate flamegraphs, elliminating the need to write scripts to do that separation (yuzhoujian, Arnaldo Carvalho de Melo) Make 'perf stat --per-thread' update shadow stats to show metrics (Jiri Olsa) - Fix double mapping al->addr in callchain processing for children without self period (Namhyung Kim) - Fix memory leak in addr2inlines() when libbfd is not used (Namhyung Kim) - Show correct function name for srcline of callchains when libbfd is not used (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (11): perf script: Add a few missing conversions to fprintf style perf script: Use pr_debug where appropriate perf script: Use event_format__fprintf() perf evsel: Restore evsel->priv as a tool private area perf script: Allow creating per-event dump files tools include uapi: Grab a copy of linux/prctl.h perf trace beauty prctl: Generate 'option' string table from kernel headers perf script: Print information about per-event-dump files tools include uapi: Grab a copy of linux/kcmp.h perf trace beauty: Implement pid_fd beautifier perf trace beauty kcmp: Beautify arguments Jiri Olsa (5): perf tools: Rename struct perf_data_file to perf_data perf tools: Add struct perf_data_file perf tools: Add perf_data_file__write function perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats perf stat: Make --per-thread update shadow stats to show metrics Namhyung Kim (3): perf callchain: Fix double mapping al->addr for children without self period perf srcline: Fix memory leak in addr2inlines() perf srcline: Show correct function name for srcline of callchains tools/include/uapi/linux/kcmp.h | 27 +++++ tools/include/uapi/linux/prctl.h | 200 +++++++++++++++++++++++++++++++ tools/perf/Documentation/perf-script.txt | 4 + tools/perf/Makefile.perf | 22 +++- tools/perf/builtin-annotate.c | 10 +- tools/perf/builtin-buildid-cache.c | 8 +- tools/perf/builtin-buildid-list.c | 16 +-- tools/perf/builtin-c2c.c | 10 +- tools/perf/builtin-diff.c | 18 +-- tools/perf/builtin-evlist.c | 12 +- tools/perf/builtin-inject.c | 36 +++--- tools/perf/builtin-kmem.c | 8 +- tools/perf/builtin-kvm.c | 14 ++- tools/perf/builtin-lock.c | 12 +- tools/perf/builtin-mem.c | 12 +- tools/perf/builtin-record.c | 50 ++++---- tools/perf/builtin-report.c | 14 +-- tools/perf/builtin-sched.c | 24 ++-- tools/perf/builtin-script.c | 169 ++++++++++++++++++++++---- tools/perf/builtin-stat.c | 39 +++--- tools/perf/builtin-timechart.c | 14 ++- tools/perf/builtin-trace.c | 40 ++++++- tools/perf/check-headers.sh | 2 + tools/perf/tests/topology.c | 22 ++-- tools/perf/trace/beauty/Build | 2 + tools/perf/trace/beauty/beauty.h | 18 +++ tools/perf/trace/beauty/kcmp.c | 44 +++++++ tools/perf/trace/beauty/kcmp_type.sh | 10 ++ tools/perf/trace/beauty/prctl.c | 82 +++++++++++++ tools/perf/trace/beauty/prctl_option.sh | 17 +++ tools/perf/util/auxtrace.c | 4 +- tools/perf/util/callchain.c | 5 +- tools/perf/util/data-convert-bt.c | 12 +- tools/perf/util/data.c | 94 ++++++++------- tools/perf/util/data.h | 38 +++--- tools/perf/util/evsel.h | 3 + tools/perf/util/header.c | 20 ++-- tools/perf/util/intel-bts.c | 6 +- tools/perf/util/intel-pt.c | 6 +- tools/perf/util/jit.h | 2 +- tools/perf/util/jitdump.c | 10 +- tools/perf/util/session.c | 44 +++---- tools/perf/util/session.h | 4 +- tools/perf/util/srcline.c | 102 +++++++++------- tools/perf/util/stat-shadow.c | 48 ++++---- tools/perf/util/stat.c | 24 ++-- tools/perf/util/stat.h | 2 +- 47 files changed, 999 insertions(+), 381 deletions(-) create mode 100644 tools/include/uapi/linux/kcmp.h create mode 100644 tools/include/uapi/linux/prctl.h create mode 100644 tools/perf/trace/beauty/kcmp.c create mode 100755 tools/perf/trace/beauty/kcmp_type.sh create mode 100644 tools/perf/trace/beauty/prctl.c create mode 100755 tools/perf/trace/beauty/prctl_option.sh Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5: Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6: Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:edge: Ok gcc (Alpine 6.4.0) 6.4.0 5 android-ndk:r12b-arm: Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 6 android-ndk:r15c-arm: Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 7 centos:5: Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 8 centos:6: Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 9 centos:7: Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) 10 debian:7: Ok gcc (Debian 4.7.2-5) 4.7.2 11 debian:8: Ok gcc (Debian 4.9.2-10) 4.9.2 12 debian:9: Ok gcc (Debian 6.3.0-18) 6.3.0 20170516 13 debian:experimental: Ok gcc (Debian 7.2.0-11) 7.2.0 14 debian:experimental-x-arm64: Ok aarch64-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0 15 debian:experimental-x-mips: Ok mips-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0 16 debian:experimental-x-mips64: Ok mips64-linux-gnuabi64-gcc (Debian 7.2.0-6) 7.2.0 17 debian:experimental-x-mipsel: Ok mipsel-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0 18 fedora:20: Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 19 fedora:21: Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) 20 fedora:22: Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 21 fedora:23: Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 22 fedora:24: Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 23 fedora:24-x-ARC-uClibc: Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 24 fedora:25: Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 25 fedora:26: Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2) 26 fedora:rawhide: Ok gcc (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1) 27 mageia:5: Ok gcc (GCC) 4.9.2 28 mageia:6: Ok gcc (Mageia 5.4.0-5.mga6) 5.4.0 29 opensuse:42.1: Ok gcc (SUSE Linux) 4.8.5 30 opensuse:42.2: Ok gcc (SUSE Linux) 4.8.5 31 opensuse:42.3: Ok gcc (SUSE Linux) 4.8.5 32 opensuse:tumbleweed: Ok gcc (SUSE Linux) 7.2.1 20170901 [gcc-7-branch revision 251580] 33 oraclelinux:6: Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 34 oraclelinux:7: Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) 35 ubuntu:12.04.5: Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 36 ubuntu:14.04.4: Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 37 ubuntu:14.04.4-x-linaro-arm64: Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404 38 ubuntu:15.04: Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2 39 ubuntu:15.10: Ok gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 40 ubuntu:16.04: Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 41 ubuntu:16.04-x-arm: Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 42 ubuntu:16.04-x-arm64: Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 43 ubuntu:16.04-x-powerpc: Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 44 ubuntu:16.04-x-powerpc64: Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609 45 ubuntu:16.04-x-powerpc64el: Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 46 ubuntu:16.04-x-s390: Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 47 ubuntu:16.10: Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 48 ubuntu:17.04: Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406 49 ubuntu:17.10: Ok gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0 # # uname -a Linux jouet 4.14.0-rc6+ #1 SMP Tue Oct 31 14:43:51 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Number of exit events of a simple workload : Ok 22: Software clock events period values : Ok 23: Object code reading : Ok 24: Sample parsing : Ok 25: Use a dummy software event to keep tracking : Ok 26: Parse with no sample_id_all bit set : Ok 27: Filter hist entries : Ok 28: Lookup mmap thread : Ok 29: Share thread mg : Ok 30: Sort output of hist entries : Ok 31: Cumulate child hist entries : Ok 32: Track with sched_switch : Ok 33: Filter fds with revents mask in a fdarray : Ok 34: Add fd to a fdarray, making it autogrow : Ok 35: kmod_path__parse : Ok 36: Thread map : Ok 37: LLVM search and compile : 37.1: Basic BPF llvm compile : Ok 37.2: kbuild searching : Ok 37.3: Compile source for BPF prologue generation : Ok 37.4: Compile source for BPF relocation : Ok 38: Session topology : Ok 39: BPF filter : 39.1: Basic BPF filtering : Ok 39.2: BPF pinning : Ok 39.3: BPF prologue generation : Ok 39.4: BPF relocation checker : Ok 40: Synthesize thread map : Ok 41: Remove thread map : Ok 42: Synthesize cpu map : Ok 43: Synthesize stat config : Ok 44: Synthesize stat : Ok 45: Synthesize stat round : Ok 46: Synthesize attr update : Ok 47: Event times : Ok 48: Read backward ring buffer : Ok 49: Print cpu map : Ok 50: Probe SDT events : Ok 51: is_printable_array : Ok 52: Print bitmap : Ok 53: perf hooks : Ok 54: builtin clang support : Skip (not compiled in) 55: unit_number__scnprintf : Ok 56: x86 rdpmc : Ok 57: Convert perf time to TSC : Ok 58: DWARF unwind : Ok 59: x86 instruction decoder - new instructions : Ok 60: Use vfs_getname probe to get syscall args filenames : Ok 61: probe libc's inet_pton & backtrace it with ping : Ok 62: Check open filename arg using perf trace + vfs_getname: Ok 63: Add vfs_getname probe to get syscall args filenames : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_clean_all_O: make clean all make_no_libnuma_O: make NO_LIBNUMA=1 make_no_demangle_O: make NO_DEMANGLE=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_static_O: make LDFLAGS=-static make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_pure_O: make make_no_libaudit_O: make NO_LIBAUDIT=1 make_debug_O: make DEBUG=1 make_no_newt_O: make NO_NEWT=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_slang_O: make NO_SLANG=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libbionic_O: make NO_LIBBIONIC=1 make_doc_O: make doc make_tags_O: make tags make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_help_O: make help make_no_libbpf_O: make NO_LIBBPF=1 make_perf_o_O: make perf.o make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_util_map_o_O: make util/map.o make_install_bin_O: make install-bin make_no_backtrace_O: make NO_BACKTRACE=1 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 OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2017-08-14 16:27 Arnaldo Carvalho de Melo 2017-08-14 17:39 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-08-14 16:27 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 82119cbe8e1e32cc2a941393e59816e731681310: Merge tag 'perf-core-for-mingo-4.14-20170801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-10 17:07:02 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.14-20170814 for you to fetch changes up to 8fc375d7d36c72b4c2d55f5c24be022a939295d4: perf test shell: Add uprobes + backtrace ping test (2017-08-11 16:18:49 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Infrastructure: - Do not consider empty files as valid srclines (Milian Wolff) - Fix wrong size in perf_record_mmap for last kernel module, which resulted in erroneous symbol resolution in at least s390x (Thomas Richter) - Add missing newline to expr parser error messages (Andi Kleen) - Fix saved values rbtree lookup in 'perf stat' (Andi Kleen) - Add support for shell based tests in 'perf test', add a few that run 'perf probe', 'perf trace', using kprobes, uprobes to check the output of those tools and the effects on the system, checking, for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo) Arch specific: - Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao) - Update POWER9 vendor events tables (Sukadev Bhattiprolu) - Fix module symbol adjustment for s390x (Thomas Richter) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (2): perf stat: Fix saved values rbtree lookup perf tools: Add missing newline to expr parser error messages Arnaldo Carvalho de Melo (10): perf test: Make 'list' subcommand match main 'perf test' numbering/matching perf test: Add 'struct test *' to the test functions perf test: Add infrastructure to run shell based tests perf test: Make 'list' use same filtering code as main 'perf test' perf test shell: Add 'probe_vfs_getname' shell test perf test shell: Install shell tests perf test shell: Move vfs_getname probe function to lib perf test shell: Add test using probe:vfs_getname and verifying results perf test shell: Add test using vfs_getname + 'perf trace' perf test shell: Add uprobes + backtrace ping test Milian Wolff (2): perf util: Take elf_name as const string in dso__demangle_sym perf srcline: Do not consider empty files as valid srclines Naveen N. Rao (1): perf scripting python: Add ppc64le to audit uname list Sukadev Bhattiprolu (2): perf vendor events powerpc: remove suffix in mapfile perf vendor events powerpc: Update POWER9 events Thomas Richter (2): perf record: Fix wrong size in perf_record_mmap for last kernel module perf report: Fix module symbol adjustment for s390x tools/perf/Makefile.perf | 6 +- tools/perf/arch/s390/util/sym-handling.c | 7 + tools/perf/arch/x86/include/arch-tests.h | 11 +- tools/perf/arch/x86/tests/insn-x86.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 2 +- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/pmu-events/arch/powerpc/mapfile.csv | 20 +- .../perf/pmu-events/arch/powerpc/power9/cache.json | 191 +- .../arch/powerpc/power9/floating-point.json | 42 +- .../pmu-events/arch/powerpc/power9/frontend.json | 517 ++-- .../pmu-events/arch/powerpc/power9/marked.json | 905 +++---- .../pmu-events/arch/powerpc/power9/memory.json | 178 +- .../perf/pmu-events/arch/powerpc/power9/other.json | 2768 ++++++++++++++++---- .../pmu-events/arch/powerpc/power9/pipeline.json | 779 +++--- tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 167 +- .../arch/powerpc/power9/translation.json | 314 +-- .../python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 1 + tools/perf/tests/attr.c | 2 +- tools/perf/tests/backward-ring-buffer.c | 2 +- tools/perf/tests/bitmap.c | 2 +- tools/perf/tests/bp_signal.c | 2 +- tools/perf/tests/bp_signal_overflow.c | 2 +- tools/perf/tests/bpf.c | 4 +- tools/perf/tests/builtin-test.c | 184 +- tools/perf/tests/clang.c | 4 +- tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/cpumap.c | 4 +- tools/perf/tests/dso-data.c | 6 +- tools/perf/tests/dwarf-unwind.c | 2 +- tools/perf/tests/event-times.c | 2 +- tools/perf/tests/event_update.c | 2 +- tools/perf/tests/evsel-roundtrip-name.c | 2 +- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/tests/expr.c | 2 +- tools/perf/tests/fdarray.c | 4 +- tools/perf/tests/hists_cumulate.c | 2 +- tools/perf/tests/hists_filter.c | 2 +- tools/perf/tests/hists_link.c | 2 +- tools/perf/tests/hists_output.c | 2 +- tools/perf/tests/is_printable_array.c | 2 +- tools/perf/tests/keep-tracking.c | 2 +- tools/perf/tests/kmod-path.c | 2 +- tools/perf/tests/llvm.c | 2 +- tools/perf/tests/mmap-basic.c | 2 +- tools/perf/tests/mmap-thread-lookup.c | 2 +- tools/perf/tests/openat-syscall-all-cpus.c | 2 +- tools/perf/tests/openat-syscall-tp-fields.c | 2 +- tools/perf/tests/openat-syscall.c | 2 +- tools/perf/tests/parse-events.c | 2 +- tools/perf/tests/parse-no-sample-id-all.c | 2 +- tools/perf/tests/perf-hooks.c | 2 +- tools/perf/tests/perf-record.c | 2 +- tools/perf/tests/pmu.c | 2 +- tools/perf/tests/python-use.c | 2 +- tools/perf/tests/sample-parsing.c | 2 +- tools/perf/tests/sdt.c | 4 +- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 28 + tools/perf/tests/shell/probe_vfs_getname.sh | 10 + .../tests/shell/record+script_probe_vfs_getname.sh | 37 + .../perf/tests/shell/trace+probe_libc_inet_pton.sh | 40 + tools/perf/tests/shell/trace+probe_vfs_getname.sh | 31 + tools/perf/tests/stat.c | 6 +- tools/perf/tests/sw-clock.c | 2 +- tools/perf/tests/switch-tracking.c | 2 +- tools/perf/tests/task-exit.c | 2 +- tools/perf/tests/tests.h | 113 +- tools/perf/tests/thread-map.c | 6 +- tools/perf/tests/thread-mg-share.c | 2 +- tools/perf/tests/topology.c | 2 +- tools/perf/tests/unit_number__scnprintf.c | 2 +- tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/util/expr.y | 2 +- tools/perf/util/machine.c | 4 +- tools/perf/util/srcline.c | 6 + tools/perf/util/stat-shadow.c | 6 +- tools/perf/util/symbol-elf.c | 12 +- tools/perf/util/symbol-minimal.c | 2 +- tools/perf/util/symbol.c | 21 +- tools/perf/util/symbol.h | 7 +- 80 files changed, 4054 insertions(+), 2479 deletions(-) create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. The 'perf test' also runs shell scripts exercising the tools, checking if they affect the system in certain ways, like setting up kprobes and uprobes, request callchains for well known programs and check that they are the expected ones, see if 'perf trace' beautifies system call arguments correctly, etc. Additionally, a new set of tests, script based, runs the tools in a live system, setting probes in place that then gets used by 'perf trace', with its output compared against expected results. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:3.6: Ok 4 alpine:edge: Ok 5 android-ndk:r12b-arm: Ok 6 archlinux:latest: Ok 7 centos:5: Ok 8 centos:6: Ok 9 centos:7: Ok 10 debian:7: Ok 11 debian:8: Ok 12 debian:9: Ok 13 debian:experimental: Ok 14 debian:experimental-x-arm64: Ok 15 debian:experimental-x-mips: Ok 16 debian:experimental-x-mips64: Ok 17 debian:experimental-x-mipsel: Ok 18 fedora:20: Ok 19 fedora:21: Ok 20 fedora:22: Ok 21 fedora:23: Ok 22 fedora:24: Ok 23 fedora:24-x-ARC-uClibc: Ok 24 fedora:25: Ok 25 fedora:26: Ok 26 fedora:rawhide: Ok 27 mageia:5: Ok 28 opensuse:13.2: Ok 29 opensuse:42.1: Ok 30 opensuse:42.2: Ok 31 opensuse:tumbleweed: Ok 32 oraclelinux:6: Ok 33 oraclelinux:7: Ok 34 ubuntu:12.04.5: Ok 35 ubuntu:14.04.4: Ok 36 ubuntu:14.04.4-x-linaro-arm64: Ok 37 ubuntu:15.10: Ok 38 ubuntu:16.04: Ok 39 ubuntu:16.04-x-arm: Ok 40 ubuntu:16.04-x-arm64: Ok 41 ubuntu:16.04-x-powerpc: Ok 42 ubuntu:16.04-x-powerpc64: Ok 43 ubuntu:16.04-x-powerpc64el: Ok 44 ubuntu:16.04-x-s390: Ok 45 ubuntu:16.10: Ok 46 ubuntu:17.04: Ok 47 ubuntu:17.10: Ok # # uname -a Linux jouet 4.13.0-rc4+ #2 SMP Fri Aug 11 12:39:09 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: Simple expression parser : Ok 7: PERF_RECORD_* events & perf_sample fields : Ok 8: Parse perf pmu format : Ok 9: DSO data read : Ok 10: DSO data cache : Ok 11: DSO data reopen : Ok 12: Roundtrip evsel->name : Ok 13: Parse sched tracepoints fields : Ok 14: syscalls:sys_enter_openat event fields : Ok 15: Setup struct perf_event_attr : Ok 16: Match and link multiple hists : Ok 17: 'import perf' in python : Ok 18: Breakpoint overflow signal handler : Ok 19: Breakpoint overflow sampling : Ok 20: Number of exit events of a simple workload : Ok 21: Software clock events period values : Ok 22: Object code reading : Ok 23: Sample parsing : Ok 24: Use a dummy software event to keep tracking : Ok 25: Parse with no sample_id_all bit set : Ok 26: Filter hist entries : Ok 27: Lookup mmap thread : Ok 28: Share thread mg : Ok 29: Sort output of hist entries : Ok 30: Cumulate child hist entries : Ok 31: Track with sched_switch : Ok 32: Filter fds with revents mask in a fdarray : Ok 33: Add fd to a fdarray, making it autogrow : Ok 34: kmod_path__parse : Ok 35: Thread map : Ok 36: LLVM search and compile : 36.1: Basic BPF llvm compile : Ok 36.2: kbuild searching : Ok 36.3: Compile source for BPF prologue generation : Ok 36.4: Compile source for BPF relocation : Ok 37: Session topology : Ok 38: BPF filter : 38.1: Basic BPF filtering : Ok 38.2: BPF pinning : Ok 38.3: BPF prologue generation : Ok 38.4: BPF relocation checker : Ok 39: Synthesize thread map : Ok 40: Remove thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok 46: Event times : Ok 47: Read backward ring buffer : Ok 48: Print cpu map : Ok 49: Probe SDT events : Ok 50: is_printable_array : Ok 51: Print bitmap : Ok 52: perf hooks : Ok 53: builtin clang support : Skip (not compiled in) 54: unit_number__scnprintf : Ok 55: x86 rdpmc : Ok 56: Convert perf time to TSC : Ok 57: DWARF unwind : Ok 58: x86 instruction decoder - new instructions : Ok 59: Intel cqm nmi context read : Skip 60: Use vfs_getname probe to get syscall args filenames : Ok 61: probe libc's inet_pton & backtrace it with ping : Ok 62: Check open filename arg using perf trace + vfs_getname: Ok 63: Add vfs_getname probe to get syscall args filenames : Ok # # The static build test works on Fedora 25, is failing on Fedora 26, # this issue is being investigated. $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_slang_O: make NO_SLANG=1 make_install_prefix_O: make install prefix=/tmp/krava make_install_bin_O: make install-bin make_debug_O: make DEBUG=1 make_clean_all_O: make clean all make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_auxtrace_O: make NO_AUXTRACE=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_help_O: make help make_no_demangle_O: make NO_DEMANGLE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_newt_O: make NO_NEWT=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_perf_o_O: make perf.o make_no_gtk2_O: make NO_GTK2=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libbpf_O: make NO_LIBBPF=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_tags_O: make tags make_util_map_o_O: make util/map.o make_pure_O: make make_no_libperl_O: make NO_LIBPERL=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libelf_O: make NO_LIBELF=1 make_doc_O: make doc OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2017-08-14 16:27 Arnaldo Carvalho de Melo @ 2017-08-14 17:39 ` Ingo Molnar 2017-08-14 17:52 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 53+ messages in thread From: Ingo Molnar @ 2017-08-14 17:39 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > > The following changes since commit 82119cbe8e1e32cc2a941393e59816e731681310: > > Merge tag 'perf-core-for-mingo-4.14-20170801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-10 17:07:02 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.14-20170814 > > for you to fetch changes up to 8fc375d7d36c72b4c2d55f5c24be022a939295d4: > > perf test shell: Add uprobes + backtrace ping test (2017-08-11 16:18:49 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > Infrastructure: > > - Do not consider empty files as valid srclines (Milian Wolff) > > - Fix wrong size in perf_record_mmap for last kernel module, > which resulted in erroneous symbol resolution in at least s390x (Thomas Richter) > > - Add missing newline to expr parser error messages (Andi Kleen) > > - Fix saved values rbtree lookup in 'perf stat' (Andi Kleen) > > - Add support for shell based tests in 'perf test', add a few that > run 'perf probe', 'perf trace', using kprobes, uprobes to check > the output of those tools and the effects on the system, checking, > for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo) > > Arch specific: > > - Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao) > > - Update POWER9 vendor events tables (Sukadev Bhattiprolu) > > - Fix module symbol adjustment for s390x (Thomas Richter) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (2): > perf stat: Fix saved values rbtree lookup > perf tools: Add missing newline to expr parser error messages > > Arnaldo Carvalho de Melo (10): > perf test: Make 'list' subcommand match main 'perf test' numbering/matching > perf test: Add 'struct test *' to the test functions > perf test: Add infrastructure to run shell based tests > perf test: Make 'list' use same filtering code as main 'perf test' > perf test shell: Add 'probe_vfs_getname' shell test > perf test shell: Install shell tests > perf test shell: Move vfs_getname probe function to lib > perf test shell: Add test using probe:vfs_getname and verifying results > perf test shell: Add test using vfs_getname + 'perf trace' > perf test shell: Add uprobes + backtrace ping test > > Milian Wolff (2): > perf util: Take elf_name as const string in dso__demangle_sym > perf srcline: Do not consider empty files as valid srclines > > Naveen N. Rao (1): > perf scripting python: Add ppc64le to audit uname list > > Sukadev Bhattiprolu (2): > perf vendor events powerpc: remove suffix in mapfile > perf vendor events powerpc: Update POWER9 events > > Thomas Richter (2): > perf record: Fix wrong size in perf_record_mmap for last kernel module > perf report: Fix module symbol adjustment for s390x > > tools/perf/Makefile.perf | 6 +- > tools/perf/arch/s390/util/sym-handling.c | 7 + > tools/perf/arch/x86/include/arch-tests.h | 11 +- > tools/perf/arch/x86/tests/insn-x86.c | 2 +- > tools/perf/arch/x86/tests/intel-cqm.c | 2 +- > tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- > tools/perf/arch/x86/tests/rdpmc.c | 2 +- > tools/perf/pmu-events/arch/powerpc/mapfile.csv | 20 +- > .../perf/pmu-events/arch/powerpc/power9/cache.json | 191 +- > .../arch/powerpc/power9/floating-point.json | 42 +- > .../pmu-events/arch/powerpc/power9/frontend.json | 517 ++-- > .../pmu-events/arch/powerpc/power9/marked.json | 905 +++---- > .../pmu-events/arch/powerpc/power9/memory.json | 178 +- > .../perf/pmu-events/arch/powerpc/power9/other.json | 2768 ++++++++++++++++---- > .../pmu-events/arch/powerpc/power9/pipeline.json | 779 +++--- > tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 167 +- > .../arch/powerpc/power9/translation.json | 314 +-- > .../python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 1 + > tools/perf/tests/attr.c | 2 +- > tools/perf/tests/backward-ring-buffer.c | 2 +- > tools/perf/tests/bitmap.c | 2 +- > tools/perf/tests/bp_signal.c | 2 +- > tools/perf/tests/bp_signal_overflow.c | 2 +- > tools/perf/tests/bpf.c | 4 +- > tools/perf/tests/builtin-test.c | 184 +- > tools/perf/tests/clang.c | 4 +- > tools/perf/tests/code-reading.c | 2 +- > tools/perf/tests/cpumap.c | 4 +- > tools/perf/tests/dso-data.c | 6 +- > tools/perf/tests/dwarf-unwind.c | 2 +- > tools/perf/tests/event-times.c | 2 +- > tools/perf/tests/event_update.c | 2 +- > tools/perf/tests/evsel-roundtrip-name.c | 2 +- > tools/perf/tests/evsel-tp-sched.c | 2 +- > tools/perf/tests/expr.c | 2 +- > tools/perf/tests/fdarray.c | 4 +- > tools/perf/tests/hists_cumulate.c | 2 +- > tools/perf/tests/hists_filter.c | 2 +- > tools/perf/tests/hists_link.c | 2 +- > tools/perf/tests/hists_output.c | 2 +- > tools/perf/tests/is_printable_array.c | 2 +- > tools/perf/tests/keep-tracking.c | 2 +- > tools/perf/tests/kmod-path.c | 2 +- > tools/perf/tests/llvm.c | 2 +- > tools/perf/tests/mmap-basic.c | 2 +- > tools/perf/tests/mmap-thread-lookup.c | 2 +- > tools/perf/tests/openat-syscall-all-cpus.c | 2 +- > tools/perf/tests/openat-syscall-tp-fields.c | 2 +- > tools/perf/tests/openat-syscall.c | 2 +- > tools/perf/tests/parse-events.c | 2 +- > tools/perf/tests/parse-no-sample-id-all.c | 2 +- > tools/perf/tests/perf-hooks.c | 2 +- > tools/perf/tests/perf-record.c | 2 +- > tools/perf/tests/pmu.c | 2 +- > tools/perf/tests/python-use.c | 2 +- > tools/perf/tests/sample-parsing.c | 2 +- > tools/perf/tests/sdt.c | 4 +- > tools/perf/tests/shell/lib/probe_vfs_getname.sh | 28 + > tools/perf/tests/shell/probe_vfs_getname.sh | 10 + > .../tests/shell/record+script_probe_vfs_getname.sh | 37 + > .../perf/tests/shell/trace+probe_libc_inet_pton.sh | 40 + > tools/perf/tests/shell/trace+probe_vfs_getname.sh | 31 + > tools/perf/tests/stat.c | 6 +- > tools/perf/tests/sw-clock.c | 2 +- > tools/perf/tests/switch-tracking.c | 2 +- > tools/perf/tests/task-exit.c | 2 +- > tools/perf/tests/tests.h | 113 +- > tools/perf/tests/thread-map.c | 6 +- > tools/perf/tests/thread-mg-share.c | 2 +- > tools/perf/tests/topology.c | 2 +- > tools/perf/tests/unit_number__scnprintf.c | 2 +- > tools/perf/tests/vmlinux-kallsyms.c | 2 +- > tools/perf/util/expr.y | 2 +- > tools/perf/util/machine.c | 4 +- > tools/perf/util/srcline.c | 6 + > tools/perf/util/stat-shadow.c | 6 +- > tools/perf/util/symbol-elf.c | 12 +- > tools/perf/util/symbol-minimal.c | 2 +- > tools/perf/util/symbol.c | 21 +- > tools/perf/util/symbol.h | 7 +- > 80 files changed, 4054 insertions(+), 2479 deletions(-) > create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh > create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh > create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh > create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh > create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2017-08-14 17:39 ` Ingo Molnar @ 2017-08-14 17:52 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-08-14 17:52 UTC (permalink / raw) To: Ingo Molnar Cc: Kim Phillips, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, acme Em Mon, Aug 14, 2017 at 07:39:48PM +0200, Ingo Molnar escreveu: > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Infrastructure: > > - Add support for shell based tests in 'perf test', add a few that > > run 'perf probe', 'perf trace', using kprobes, uprobes to check > > the output of those tools and the effects on the system, checking, > > for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo) <SNIP> > > create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh > > create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh > > create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh > > create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh > > create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh > > Pulled, thanks a lot Arnaldo! Thanks! I'm working with Kim Phillips to fix some issues he noticed while testing on his ARM systems where 'perf probe' is not available, my perf/core branch has several fixes to handle this that will be in my next pull request. - Arnaldo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2017-03-14 18:50 Arnaldo Carvalho de Melo 2017-03-15 18:29 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin, Alexei Starovoitov, Ananth N Mavinakayanahalli, Andi Kleen, Aravinda Prasad, Brendan Gregg, Changbin Du, Daniel Borkmann, Eric Biederman, Feng Tang, Hari Bathini, Jiri Olsa, kernel-team, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 84e5b549214f2160c12318aac549de85f600c79a: Merge tag 'perf-core-for-mingo-4.11-20170306' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-07 08:14:14 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170314 for you to fetch changes up to 5f6bee34707973ea7879a7857fd63ddccc92fff3: kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL (2017-03-14 15:17:40 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Add PERF_RECORD_NAMESPACES so that the kernel can record information required to associate samples to namespaces, helping in container problem characterization. Now the 'perf record has a --namespace' option to ask for such info, and when present, it can be used, initially, via a new sort order, 'cgroup_id', allowing histogram entry bucketization by a (device, inode) based cgroup identifier (Hari Bathini) - Add --next option to 'perf sched timehist', showing what is the next thread to run (Brendan Gregg) Fixes: - Fix segfault with basic block 'cycles' sort dimension (Changbin Du) - Add c2c to command-list.txt, making it appear in the 'perf help' output (Changbin Du) - Fix zeroing of 'abs_path' variable in the perf hists browser switch file code (Changbin Du) - Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim) Infrastructure: - Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao) - Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du) Documentation: - Document +field style argument support for --field option (Changbin Du) - Clarify 'perf c2c --stats' help message (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Brendan Gregg (1): perf sched timehist: Add --next option Changbin Du (5): perf tools: Missing c2c command in command-list perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git perf sort: Fix segfault with basic block 'cycles' sort dimension perf report: Document +field style argument support for --field option perf hists browser: Fix typo in function switch_data_file Hari Bathini (5): perf: Add PERF_RECORD_NAMESPACES to include namespaces related info perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info perf record: Synthesize namespace events for current processes perf script: Add script print support for namespace events perf tools: Add 'cgroup_id' sort order keyword Namhyung Kim (3): perf report: Hide tip message when -q option is given perf c2c: Clarify help message of --stats option perf c2c: Fix display bug when using pipe Naveen N. Rao (5): perf probe: Factor out the ftrace README scanning perf kretprobes: Offset from reloc_sym if kernel supports it perf powerpc: Choose local entry point with kretprobes doc: trace/kprobes: add information about NOKPROBE_SYMBOL kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL Documentation/trace/kprobetrace.txt | 5 +- include/linux/perf_event.h | 2 + include/uapi/linux/perf_event.h | 32 +++++- kernel/events/core.c | 139 ++++++++++++++++++++++++++ kernel/fork.c | 2 + kernel/kprobes.c | 5 +- kernel/nsproxy.c | 3 + tools/include/uapi/linux/perf_event.h | 32 +++++- tools/perf/.gitignore | 2 + tools/perf/Documentation/perf-record.txt | 3 + tools/perf/Documentation/perf-report.txt | 7 +- tools/perf/Documentation/perf-sched.txt | 4 + tools/perf/Documentation/perf-script.txt | 3 + tools/perf/arch/powerpc/util/sym-handling.c | 14 ++- tools/perf/builtin-annotate.c | 1 + tools/perf/builtin-c2c.c | 4 +- tools/perf/builtin-diff.c | 1 + tools/perf/builtin-inject.c | 13 +++ tools/perf/builtin-kmem.c | 1 + tools/perf/builtin-kvm.c | 2 + tools/perf/builtin-lock.c | 1 + tools/perf/builtin-mem.c | 1 + tools/perf/builtin-record.c | 35 ++++++- tools/perf/builtin-report.c | 4 +- tools/perf/builtin-sched.c | 26 ++++- tools/perf/builtin-script.c | 41 ++++++++ tools/perf/builtin-trace.c | 3 +- tools/perf/command-list.txt | 1 + tools/perf/perf.h | 1 + tools/perf/ui/browsers/hists.c | 2 +- tools/perf/util/Build | 1 + tools/perf/util/data-convert-bt.c | 1 + tools/perf/util/event.c | 150 ++++++++++++++++++++++++++-- tools/perf/util/event.h | 19 ++++ tools/perf/util/evsel.c | 3 + tools/perf/util/hist.c | 7 ++ tools/perf/util/hist.h | 1 + tools/perf/util/machine.c | 34 +++++++ tools/perf/util/machine.h | 3 + tools/perf/util/namespaces.c | 36 +++++++ tools/perf/util/namespaces.h | 26 +++++ tools/perf/util/probe-event.c | 12 +-- tools/perf/util/probe-file.c | 77 ++++++++------ tools/perf/util/probe-file.h | 1 + tools/perf/util/session.c | 7 ++ tools/perf/util/sort.c | 46 +++++++++ tools/perf/util/sort.h | 7 ++ tools/perf/util/thread.c | 44 +++++++- tools/perf/util/thread.h | 6 ++ tools/perf/util/tool.h | 2 + 50 files changed, 799 insertions(+), 74 deletions(-) create mode 100644 tools/perf/util/namespaces.c create mode 100644 tools/perf/util/namespaces.h Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:edge: Ok 4 android-ndk:r12b-arm: Ok 5 archlinux:latest: Ok 6 centos:5: Ok 7 centos:6: Ok 8 centos:7: Ok 9 debian:7: Ok 10 debian:8: Ok 11 debian:experimental: Ok 12 debian:experimental-x-arm64: Ok 13 debian:experimental-x-mips: Ok 14 debian:experimental-x-mips64: Ok 15 debian:experimental-x-mipsel: Ok 16 fedora:20: Ok 17 fedora:21: Ok 18 fedora:22: Ok 19 fedora:23: Ok 20 fedora:24: Ok 21 fedora:24-x-ARC-uClibc: Ok 22 fedora:25: Ok 23 fedora:rawhide: Ok 24 mageia:5: Ok 25 opensuse:13.2: Ok 26 opensuse:42.1: Ok 27 opensuse:tumbleweed: Ok 28 ubuntu:12.04.5: Ok 29 ubuntu:14.04.4: Ok 30 ubuntu:14.04.4-x-linaro-arm64: Ok 31 ubuntu:15.10: Ok 32 ubuntu:16.04: Ok 33 ubuntu:16.04-x-arm: Ok 34 ubuntu:16.04-x-arm64: Ok 35 ubuntu:16.04-x-powerpc: Ok 36 ubuntu:16.04-x-powerpc64: Ok 37 ubuntu:16.04-x-s390: Ok 38 ubuntu:16.10: Ok 39 ubuntu:17.04: Ok # # uname -a Linux zoo 4.9.13-100.fc24.x86_64 #1 SMP Mon Feb 27 16:57:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: PERF_RECORD_* events & perf_sample fields : Ok 7: Parse perf pmu format : Ok 8: DSO data read : Ok 9: DSO data cache : Ok 10: DSO data reopen : Ok 11: Roundtrip evsel->name : Ok 12: Parse sched tracepoints fields : Ok 13: syscalls:sys_enter_openat event fields : Ok 14: Setup struct perf_event_attr : Ok 15: Match and link multiple hists : Ok 16: 'import perf' in python : Ok 17: Breakpoint overflow signal handler : Ok 18: Breakpoint overflow sampling : Ok 19: Number of exit events of a simple workload : Ok 20: Software clock events period values : Ok 21: Object code reading : Ok 22: Sample parsing : Ok 23: Use a dummy software event to keep tracking: Ok 24: Parse with no sample_id_all bit set : Ok 25: Filter hist entries : Ok 26: Lookup mmap thread : Ok 27: Share thread mg : Ok 28: Sort output of hist entries : Ok 29: Cumulate child hist entries : Ok 30: Track with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: kmod_path__parse : Ok 34: Thread map : Ok 35: LLVM search and compile : 35.1: Basic BPF llvm compile : Ok 35.2: kbuild searching : Ok 35.3: Compile source for BPF prologue generation: Ok 35.4: Compile source for BPF relocation : Ok 36: Session topology : Ok 37: BPF filter : 37.1: Basic BPF filtering : Ok 37.2: BPF 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_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_debug_O: make DEBUG=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_pure_O: make make_no_libbpf_O: make NO_LIBBPF=1 make_tags_O: make tags make_with_babeltrace_O: make LIBBABELTRACE=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_perf_o_O: make perf.o make_no_demangle_O: make NO_DEMANGLE=1 make_clean_all_O: make clean all make_no_slang_O: make NO_SLANG=1 make_doc_O: make doc make_no_newt_O: make NO_NEWT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_bin_O: make install-bin make_no_gtk2_O: make NO_GTK2=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_util_map_o_O: make util/map.o make_no_libperl_O: make NO_LIBPERL=1 make_static_O: make LDFLAGS=-static make_no_libunwind_O: make NO_LIBUNWIND=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_help_O: make help make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 OK $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2017-03-14 18:50 Arnaldo Carvalho de Melo @ 2017-03-15 18:29 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2017-03-15 18:29 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov, Ananth N Mavinakayanahalli, Andi Kleen, Aravinda Prasad, Brendan Gregg, Changbin Du, Daniel Borkmann, Eric Biederman, Feng Tang, Hari Bathini, Jiri Olsa, kernel-team, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 84e5b549214f2160c12318aac549de85f600c79a: > > Merge tag 'perf-core-for-mingo-4.11-20170306' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-07 08:14:14 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170314 > > for you to fetch changes up to 5f6bee34707973ea7879a7857fd63ddccc92fff3: > > kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL (2017-03-14 15:17:40 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Add PERF_RECORD_NAMESPACES so that the kernel can record information > required to associate samples to namespaces, helping in container > problem characterization. > > Now the 'perf record has a --namespace' option to ask for such info, > and when present, it can be used, initially, via a new sort order, > 'cgroup_id', allowing histogram entry bucketization by a (device, inode) > based cgroup identifier (Hari Bathini) > > - Add --next option to 'perf sched timehist', showing what is the next > thread to run (Brendan Gregg) > > Fixes: > > - Fix segfault with basic block 'cycles' sort dimension (Changbin Du) > > - Add c2c to command-list.txt, making it appear in the 'perf help' > output (Changbin Du) > > - Fix zeroing of 'abs_path' variable in the perf hists browser switch > file code (Changbin Du) > > - Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim) > > Infrastructure: > > - Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao) > > - Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du) > > Documentation: > > - Document +field style argument support for --field option (Changbin Du) > > - Clarify 'perf c2c --stats' help message (Namhyung Kim) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Brendan Gregg (1): > perf sched timehist: Add --next option > > Changbin Du (5): > perf tools: Missing c2c command in command-list > perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git > perf sort: Fix segfault with basic block 'cycles' sort dimension > perf report: Document +field style argument support for --field option > perf hists browser: Fix typo in function switch_data_file > > Hari Bathini (5): > perf: Add PERF_RECORD_NAMESPACES to include namespaces related info > perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info > perf record: Synthesize namespace events for current processes > perf script: Add script print support for namespace events > perf tools: Add 'cgroup_id' sort order keyword > > Namhyung Kim (3): > perf report: Hide tip message when -q option is given > perf c2c: Clarify help message of --stats option > perf c2c: Fix display bug when using pipe > > Naveen N. Rao (5): > perf probe: Factor out the ftrace README scanning > perf kretprobes: Offset from reloc_sym if kernel supports it > perf powerpc: Choose local entry point with kretprobes > doc: trace/kprobes: add information about NOKPROBE_SYMBOL > kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL > > Documentation/trace/kprobetrace.txt | 5 +- > include/linux/perf_event.h | 2 + > include/uapi/linux/perf_event.h | 32 +++++- > kernel/events/core.c | 139 ++++++++++++++++++++++++++ > kernel/fork.c | 2 + > kernel/kprobes.c | 5 +- > kernel/nsproxy.c | 3 + > tools/include/uapi/linux/perf_event.h | 32 +++++- > tools/perf/.gitignore | 2 + > tools/perf/Documentation/perf-record.txt | 3 + > tools/perf/Documentation/perf-report.txt | 7 +- > tools/perf/Documentation/perf-sched.txt | 4 + > tools/perf/Documentation/perf-script.txt | 3 + > tools/perf/arch/powerpc/util/sym-handling.c | 14 ++- > tools/perf/builtin-annotate.c | 1 + > tools/perf/builtin-c2c.c | 4 +- > tools/perf/builtin-diff.c | 1 + > tools/perf/builtin-inject.c | 13 +++ > tools/perf/builtin-kmem.c | 1 + > tools/perf/builtin-kvm.c | 2 + > tools/perf/builtin-lock.c | 1 + > tools/perf/builtin-mem.c | 1 + > tools/perf/builtin-record.c | 35 ++++++- > tools/perf/builtin-report.c | 4 +- > tools/perf/builtin-sched.c | 26 ++++- > tools/perf/builtin-script.c | 41 ++++++++ > tools/perf/builtin-trace.c | 3 +- > tools/perf/command-list.txt | 1 + > tools/perf/perf.h | 1 + > tools/perf/ui/browsers/hists.c | 2 +- > tools/perf/util/Build | 1 + > tools/perf/util/data-convert-bt.c | 1 + > tools/perf/util/event.c | 150 ++++++++++++++++++++++++++-- > tools/perf/util/event.h | 19 ++++ > tools/perf/util/evsel.c | 3 + > tools/perf/util/hist.c | 7 ++ > tools/perf/util/hist.h | 1 + > tools/perf/util/machine.c | 34 +++++++ > tools/perf/util/machine.h | 3 + > tools/perf/util/namespaces.c | 36 +++++++ > tools/perf/util/namespaces.h | 26 +++++ > tools/perf/util/probe-event.c | 12 +-- > tools/perf/util/probe-file.c | 77 ++++++++------ > tools/perf/util/probe-file.h | 1 + > tools/perf/util/session.c | 7 ++ > tools/perf/util/sort.c | 46 +++++++++ > tools/perf/util/sort.h | 7 ++ > tools/perf/util/thread.c | 44 +++++++- > tools/perf/util/thread.h | 6 ++ > tools/perf/util/tool.h | 2 + > 50 files changed, 799 insertions(+), 74 deletions(-) > create mode 100644 tools/perf/util/namespaces.c > create mode 100644 tools/perf/util/namespaces.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-12-01 18:02 Arnaldo Carvalho de Melo 2016-12-02 9:10 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-12-01 18:02 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Chris Ryder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, Mark Rutland, Namhyung Kim, Pawel Moll, Peter Zijlstra, Wang Nan, Will Deacon, Zefan Li, pi3orama, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 2471cece40d61b0035360338569d338f9dea6099: Merge tag 'perf-core-for-mingo-20161125' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-25 18:12:41 +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-20161201 for you to fetch changes up to 0fcb1da4aba6e6c7b32de5e0948b740b31ad822d: perf annotate: AArch64 support (2016-12-01 13:03:19 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Support AArch64 in the 'annotate' code, native/local and cross-arch/remote (Kim Phillips) - Allow considering just events in a given time interval, via the '--time start.s.ms,end.s.ms' command line, added to 'perf kmem', 'perf report', 'perf sched timehist' and 'perf script' (David Ahern) - Add option to stop printing a callchain at one of a given group of symbol names (David Ahern) - Handle cpu migration events in 'perf sched timehist' (David Ahern) - Track memory freed in 'perf kmem stat' (David Ahern) Infrastructure: - Initial support (and perf test entry) for tooling hooks, starting with 'record_start' and 'record_end', that will have as its initial user the eBPF infrastructure, where perf_ prefixed functions will be JITed and run when such hooks are called (Wang Nan) - Remove redundant "test" and similar strings from 'perf test' descriptions (Arnaldo Carvalho de Melo) - libbpf assorted improvements (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): perf ui helpline: Provide a printf variant perf annotate: Show invalid jump offset in error message perf test: Remove "test" and similar strings from test descriptions David Ahern (10): perf sched timehist: Handle cpu migration events perf trace: Update tid/pid filtering option to leverage symbol_conf perf kmem stat: Track memory freed perf script: Add option to stop printing callchain perf tools: Add time-based utility functions perf tools: Move parse_nsec_time to time-utils.c perf script: Add option to specify time window of interest perf sched timehist: Add option to specify time window of interest perf kmem: Add option to specify time window of interest perf report: Add option to specify time window of interest Kim Phillips (2): perf annotate: Use arch->objdump.comment_char in dec__parse() perf annotate: AArch64 support Wang Nan (4): tools lib bpf: Add missing BPF functions tools lib bpf: Add private field for bpf_object tools lib bpf: Retrive bpf_map through offset of bpf_map_def perf tools: Introduce perf hooks tools/lib/bpf/bpf.c | 56 ++++++++++ tools/lib/bpf/bpf.h | 7 ++ tools/lib/bpf/libbpf.c | 35 ++++++ tools/lib/bpf/libbpf.h | 13 +++ tools/perf/Documentation/perf-kmem.txt | 7 ++ tools/perf/Documentation/perf-report.txt | 7 ++ tools/perf/Documentation/perf-sched.txt | 12 +++ tools/perf/Documentation/perf-script.txt | 10 ++ tools/perf/arch/arm64/annotate/instructions.c | 62 +++++++++++ tools/perf/arch/x86/tests/arch-tests.c | 10 +- tools/perf/builtin-kmem.c | 36 ++++++- tools/perf/builtin-record.c | 11 ++ tools/perf/builtin-report.c | 14 ++- tools/perf/builtin-sched.c | 148 ++++++++++++++++++++++++-- tools/perf/builtin-script.c | 17 ++- tools/perf/builtin-trace.c | 49 ++------- tools/perf/tests/Build | 1 + tools/perf/tests/bpf.c | 6 +- tools/perf/tests/builtin-test.c | 96 +++++++++-------- tools/perf/tests/llvm.c | 8 +- tools/perf/tests/perf-hooks.c | 44 ++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/annotate.c | 6 +- tools/perf/ui/helpline.c | 10 ++ tools/perf/ui/helpline.h | 1 + tools/perf/util/Build | 3 + tools/perf/util/annotate.c | 7 +- tools/perf/util/evsel_fprintf.c | 8 ++ tools/perf/util/perf-hooks-list.h | 3 + tools/perf/util/perf-hooks.c | 84 +++++++++++++++ tools/perf/util/perf-hooks.h | 37 +++++++ tools/perf/util/symbol.c | 8 ++ tools/perf/util/symbol.h | 6 +- tools/perf/util/time-utils.c | 119 +++++++++++++++++++++ tools/perf/util/time-utils.h | 14 +++ tools/perf/util/util.c | 33 ------ tools/perf/util/util.h | 2 - 37 files changed, 842 insertions(+), 149 deletions(-) create mode 100644 tools/perf/arch/arm64/annotate/instructions.c create mode 100644 tools/perf/tests/perf-hooks.c create mode 100644 tools/perf/util/perf-hooks-list.h create mode 100644 tools/perf/util/perf-hooks.c create mode 100644 tools/perf/util/perf-hooks.h create mode 100644 tools/perf/util/time-utils.c create mode 100644 tools/perf/util/time-utils.h # uname -a Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: PERF_RECORD_* events & perf_sample fields : Ok 7: Parse perf pmu format : Ok 8: DSO data read : Ok 9: DSO data cache : Ok 10: DSO data reopen : Ok 11: Roundtrip evsel->name : Ok 12: Parse sched tracepoints fields : Ok 13: syscalls:sys_enter_openat event fields : Ok 14: Setup struct perf_event_attr : Ok 15: Match and link multiple hists : Ok 16: 'import perf' in python : Ok 17: Breakpoint overflow signal handler : Ok 18: Breakpoint overflow sampling : Ok 19: Number of exit events of a simple workload : Ok 20: Software clock events period values : Ok 21: Object code reading : Ok 22: Sample parsing : Ok 23: Use a dummy software event to keep tracking: Ok 24: Parse with no sample_id_all bit set : Ok 25: Filter hist entries : Ok 26: Lookup mmap thread : Ok 27: Share thread mg : Ok 28: Sort output of hist entries : Ok 29: Cumulate child hist entries : Ok 30: Track with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: kmod_path__parse : Ok 34: Thread map : Ok 35: LLVM search and compile : 35.1: Basic BPF llvm compile : Ok 35.2: kbuild searching : Ok 35.3: Compile source for BPF prologue generation: Ok 35.4: Compile source for BPF relocation : Ok 36: Session topology : Ok 37: BPF filter : 37.1: Basic BPF filtering : Ok 37.2: BPF prologue generation : Ok 37.3: BPF relocation checker : Ok 38: Synthesize thread map : Ok 39: Synthesize cpu map : Ok 40: Synthesize stat config : Ok 41: Synthesize stat : Ok 42: Synthesize stat round : Ok 43: Synthesize attr update : Ok 44: Event times : Ok 45: Read backward ring buffer : Ok 46: Print cpu map : Ok 47: Probe SDT events : Ok 48: is_printable_array : Ok 49: Print bitmap : Ok 50: perf hooks : Ok 51: x86 rdpmc : Ok 52: Convert perf time to TSC : Ok 53: DWARF unwind : Ok 54: x86 instruction decoder - new instructions : Ok 55: Intel cqm nmi context read : Skip # # uname -a Linux zoo 4.7.3-200.fc24.x86_64 #1 SMP Wed Sep 7 17:31:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # dm 1 alpine:3.4: Ok 2 android-ndk:r12b-arm: Ok 3 archlinux:latest: Ok 4 centos:5: Ok 5 centos:6: Ok 6 centos:7: Ok 7 debian:7: Ok 8 debian:8: Ok 9 debian:experimental: Ok 10 fedora:20: Ok 11 fedora:21: Ok 12 fedora:22: Ok 13 fedora:23: Ok 14 fedora:24: Ok 15 fedora:24-x-ARC-uClibc: Ok 16 fedora:rawhide: Ok 17 mageia:5: Ok 18 opensuse:13.2: Ok 19 opensuse:42.1: Ok 20 opensuse:tumbleweed: Ok 21 ubuntu:12.04.5: Ok 22 ubuntu:14.04: Ok 23 ubuntu:14.04.4: Ok 24 ubuntu:15.10: Ok 25 ubuntu:16.04: Ok 26 ubuntu:16.04-x-arm: Ok 27 ubuntu:16.04-x-arm64: Ok 28 ubuntu:16.04-x-powerpc: Ok 29 ubuntu:16.04-x-powerpc64: Ok 30 ubuntu:16.04-x-powerpc64el: Ok 31 ubuntu:16.04-x-s390: Ok 32 ubuntu:16.10: Ok # $ grep PRETTY_NAME /etc/os-release PRETTY_NAME="Fedora 25 (Workstation Edition)" $ $ perf stat make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_slang_O: make NO_SLANG=1 make_util_map_o_O: make util/map.o make_static_O: make LDFLAGS=-static make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_perf_o_O: make perf.o make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libelf_O: make NO_LIBELF=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_backtrace_O: make NO_BACKTRACE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libperl_O: make NO_LIBPERL=1 make_tags_O: make tags make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_install_bin_O: make install-bin make_no_newt_O: make NO_NEWT=1 make_pure_O: make make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_clean_all_O: make clean all make_no_gtk2_O: make NO_GTK2=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libbpf_O: make NO_LIBBPF=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_help_O: make help make_doc_O: make doc make_debug_O: make DEBUG=1 make_install_O: make install OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-12-01 18:02 Arnaldo Carvalho de Melo @ 2016-12-02 9:10 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-12-02 9:10 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Chris Ryder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, Mark Rutland, Namhyung Kim, Pawel Moll, Peter Zijlstra, Wang Nan, Will Deacon, Zefan Li, pi3orama, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 2471cece40d61b0035360338569d338f9dea6099: > > Merge tag 'perf-core-for-mingo-20161125' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-25 18:12:41 +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-20161201 > > for you to fetch changes up to 0fcb1da4aba6e6c7b32de5e0948b740b31ad822d: > > perf annotate: AArch64 support (2016-12-01 13:03:19 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Support AArch64 in the 'annotate' code, native/local and > cross-arch/remote (Kim Phillips) > > - Allow considering just events in a given time interval, via the > '--time start.s.ms,end.s.ms' command line, added to 'perf kmem', > 'perf report', 'perf sched timehist' and 'perf script' (David Ahern) > > - Add option to stop printing a callchain at one of a given group of > symbol names (David Ahern) > > - Handle cpu migration events in 'perf sched timehist' (David Ahern) > > - Track memory freed in 'perf kmem stat' (David Ahern) > > Infrastructure: > > - Initial support (and perf test entry) for tooling hooks, starting with > 'record_start' and 'record_end', that will have as its initial user the > eBPF infrastructure, where perf_ prefixed functions will be JITed and > run when such hooks are called (Wang Nan) > > - Remove redundant "test" and similar strings from 'perf test' descriptions > (Arnaldo Carvalho de Melo) > > - libbpf assorted improvements (Wang Nan) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > perf ui helpline: Provide a printf variant > perf annotate: Show invalid jump offset in error message > perf test: Remove "test" and similar strings from test descriptions > > David Ahern (10): > perf sched timehist: Handle cpu migration events > perf trace: Update tid/pid filtering option to leverage symbol_conf > perf kmem stat: Track memory freed > perf script: Add option to stop printing callchain > perf tools: Add time-based utility functions > perf tools: Move parse_nsec_time to time-utils.c > perf script: Add option to specify time window of interest > perf sched timehist: Add option to specify time window of interest > perf kmem: Add option to specify time window of interest > perf report: Add option to specify time window of interest > > Kim Phillips (2): > perf annotate: Use arch->objdump.comment_char in dec__parse() > perf annotate: AArch64 support > > Wang Nan (4): > tools lib bpf: Add missing BPF functions > tools lib bpf: Add private field for bpf_object > tools lib bpf: Retrive bpf_map through offset of bpf_map_def > perf tools: Introduce perf hooks > > tools/lib/bpf/bpf.c | 56 ++++++++++ > tools/lib/bpf/bpf.h | 7 ++ > tools/lib/bpf/libbpf.c | 35 ++++++ > tools/lib/bpf/libbpf.h | 13 +++ > tools/perf/Documentation/perf-kmem.txt | 7 ++ > tools/perf/Documentation/perf-report.txt | 7 ++ > tools/perf/Documentation/perf-sched.txt | 12 +++ > tools/perf/Documentation/perf-script.txt | 10 ++ > tools/perf/arch/arm64/annotate/instructions.c | 62 +++++++++++ > tools/perf/arch/x86/tests/arch-tests.c | 10 +- > tools/perf/builtin-kmem.c | 36 ++++++- > tools/perf/builtin-record.c | 11 ++ > tools/perf/builtin-report.c | 14 ++- > tools/perf/builtin-sched.c | 148 ++++++++++++++++++++++++-- > tools/perf/builtin-script.c | 17 ++- > tools/perf/builtin-trace.c | 49 ++------- > tools/perf/tests/Build | 1 + > tools/perf/tests/bpf.c | 6 +- > tools/perf/tests/builtin-test.c | 96 +++++++++-------- > tools/perf/tests/llvm.c | 8 +- > tools/perf/tests/perf-hooks.c | 44 ++++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/ui/browsers/annotate.c | 6 +- > tools/perf/ui/helpline.c | 10 ++ > tools/perf/ui/helpline.h | 1 + > tools/perf/util/Build | 3 + > tools/perf/util/annotate.c | 7 +- > tools/perf/util/evsel_fprintf.c | 8 ++ > tools/perf/util/perf-hooks-list.h | 3 + > tools/perf/util/perf-hooks.c | 84 +++++++++++++++ > tools/perf/util/perf-hooks.h | 37 +++++++ > tools/perf/util/symbol.c | 8 ++ > tools/perf/util/symbol.h | 6 +- > tools/perf/util/time-utils.c | 119 +++++++++++++++++++++ > tools/perf/util/time-utils.h | 14 +++ > tools/perf/util/util.c | 33 ------ > tools/perf/util/util.h | 2 - > 37 files changed, 842 insertions(+), 149 deletions(-) > create mode 100644 tools/perf/arch/arm64/annotate/instructions.c > create mode 100644 tools/perf/tests/perf-hooks.c > create mode 100644 tools/perf/util/perf-hooks-list.h > create mode 100644 tools/perf/util/perf-hooks.c > create mode 100644 tools/perf/util/perf-hooks.h > create mode 100644 tools/perf/util/time-utils.c > create mode 100644 tools/perf/util/time-utils.h > > # uname -a > Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > # perf test > 1: vmlinux symtab matches kallsyms : Ok > 2: Detect openat syscall event : Ok > 3: Detect openat syscall event on all cpus : Ok > 4: Read samples using the mmap interface : Ok > 5: Parse event definition strings : Ok > 6: PERF_RECORD_* events & perf_sample fields : Ok > 7: Parse perf pmu format : Ok > 8: DSO data read : Ok > 9: DSO data cache : Ok > 10: DSO data reopen : Ok > 11: Roundtrip evsel->name : Ok > 12: Parse sched tracepoints fields : Ok > 13: syscalls:sys_enter_openat event fields : Ok > 14: Setup struct perf_event_attr : Ok > 15: Match and link multiple hists : Ok > 16: 'import perf' in python : Ok > 17: Breakpoint overflow signal handler : Ok > 18: Breakpoint overflow sampling : Ok > 19: Number of exit events of a simple workload : Ok > 20: Software clock events period values : Ok > 21: Object code reading : Ok > 22: Sample parsing : Ok > 23: Use a dummy software event to keep tracking: Ok > 24: Parse with no sample_id_all bit set : Ok > 25: Filter hist entries : Ok > 26: Lookup mmap thread : Ok > 27: Share thread mg : Ok > 28: Sort output of hist entries : Ok > 29: Cumulate child hist entries : Ok > 30: Track with sched_switch : Ok > 31: Filter fds with revents mask in a fdarray : Ok > 32: Add fd to a fdarray, making it autogrow : Ok > 33: kmod_path__parse : Ok > 34: Thread map : Ok > 35: LLVM search and compile : > 35.1: Basic BPF llvm compile : Ok > 35.2: kbuild searching : Ok > 35.3: Compile source for BPF prologue generation: Ok > 35.4: Compile source for BPF relocation : Ok > 36: Session topology : Ok > 37: BPF filter : > 37.1: Basic BPF filtering : Ok > 37.2: BPF prologue generation : Ok > 37.3: BPF relocation checker : Ok > 38: Synthesize thread map : Ok > 39: Synthesize cpu map : Ok > 40: Synthesize stat config : Ok > 41: Synthesize stat : Ok > 42: Synthesize stat round : Ok > 43: Synthesize attr update : Ok > 44: Event times : Ok > 45: Read backward ring buffer : Ok > 46: Print cpu map : Ok > 47: Probe SDT events : Ok > 48: is_printable_array : Ok > 49: Print bitmap : Ok > 50: perf hooks : Ok > 51: x86 rdpmc : Ok > 52: Convert perf time to TSC : Ok > 53: DWARF unwind : Ok > 54: x86 instruction decoder - new instructions : Ok > 55: Intel cqm nmi context read : Skip > # > # uname -a > Linux zoo 4.7.3-200.fc24.x86_64 #1 SMP Wed Sep 7 17:31:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > # dm > 1 alpine:3.4: Ok > 2 android-ndk:r12b-arm: Ok > 3 archlinux:latest: Ok > 4 centos:5: Ok > 5 centos:6: Ok > 6 centos:7: Ok > 7 debian:7: Ok > 8 debian:8: Ok > 9 debian:experimental: Ok > 10 fedora:20: Ok > 11 fedora:21: Ok > 12 fedora:22: Ok > 13 fedora:23: Ok > 14 fedora:24: Ok > 15 fedora:24-x-ARC-uClibc: Ok > 16 fedora:rawhide: Ok > 17 mageia:5: Ok > 18 opensuse:13.2: Ok > 19 opensuse:42.1: Ok > 20 opensuse:tumbleweed: Ok > 21 ubuntu:12.04.5: Ok > 22 ubuntu:14.04: Ok > 23 ubuntu:14.04.4: Ok > 24 ubuntu:15.10: Ok > 25 ubuntu:16.04: Ok > 26 ubuntu:16.04-x-arm: Ok > 27 ubuntu:16.04-x-arm64: Ok > 28 ubuntu:16.04-x-powerpc: Ok > 29 ubuntu:16.04-x-powerpc64: Ok > 30 ubuntu:16.04-x-powerpc64el: Ok > 31 ubuntu:16.04-x-s390: Ok > 32 ubuntu:16.10: Ok > # > $ grep PRETTY_NAME /etc/os-release > PRETTY_NAME="Fedora 25 (Workstation Edition)" > $ > $ perf stat make -C tools/perf build-test > make: Entering directory '/home/acme/git/linux/tools/perf' > - tarpkg: ./tests/perf-targz-src-pkg . > make_no_slang_O: make NO_SLANG=1 > make_util_map_o_O: make util/map.o > make_static_O: make LDFLAGS=-static > make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 > make_perf_o_O: make perf.o > make_no_libunwind_O: make NO_LIBUNWIND=1 > make_no_libelf_O: make NO_LIBELF=1 > make_util_pmu_bison_o_O: make util/pmu-bison.o > make_no_backtrace_O: make NO_BACKTRACE=1 > make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 > make_no_demangle_O: make NO_DEMANGLE=1 > make_no_libperl_O: make NO_LIBPERL=1 > make_tags_O: make tags > make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 > make_install_prefix_slash_O: make install prefix=/tmp/krava/ > make_no_auxtrace_O: make NO_AUXTRACE=1 > make_no_libnuma_O: make NO_LIBNUMA=1 > make_install_bin_O: make install-bin > make_no_newt_O: make NO_NEWT=1 > make_pure_O: make > make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 > make_clean_all_O: make clean all > make_no_gtk2_O: make NO_GTK2=1 > make_no_libbionic_O: make NO_LIBBIONIC=1 > make_install_prefix_O: make install prefix=/tmp/krava > make_no_libbpf_O: make NO_LIBBPF=1 > make_no_libaudit_O: make NO_LIBAUDIT=1 > make_with_babeltrace_O: make LIBBABELTRACE=1 > make_no_libpython_O: make NO_LIBPYTHON=1 > make_help_O: make help > make_doc_O: make doc > make_debug_O: make DEBUG=1 > make_install_O: make install > OK > make: Leaving directory '/home/acme/git/linux/tools/perf' > $ > Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-09-01 16:45 Arnaldo Carvalho de Melo 2016-09-05 13:16 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-09-01 16:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Anton Blanchard, David Ahern, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Shawn Lin, Wang Nan, Yauheni Kaliuta, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 36e674a05164cdbb9d4a5b1b0b279fabae6c13bd: Merge tag 'perf-core-for-mingo-20160823' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-08-24 11:08:10 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160901 for you to fetch changes up to 6243b9dc4c991fe8bdc53a0e029908aef3ddb101: perf probe: Move dwarf specific functions to dwarf-aux.c (2016-09-01 12:42:26 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Support generating cross arch probes, i.e. if you specify a vmlinux file for different arch than the one in the host machine, $ perf probe --definition function_name args will generate the probe definition string needed to append to the target machine /sys/kernel/debug/tracing/kprobes_events file, using scripting (Masami Hiramatsu). - Make 'perf probe' skip the function prologue in uprobes if program compiled without optimization, using the same strategy as gdb and systemtap uses, fixing a bug where: $ perf probe -x ./test 'foo i' When 'foo(42)' was used on the "./test" executable would produce i=0 instead of the expected i=42 (Ravi Bangoria) - Demangle symbols for synthesized @plt entries too (Millian Wolff) Documentation: - Show default report configuration in 'perf config' example and docs (Millian Wolff) Infrastructure: - Make 'perf test vmlinux' tolerate the symbol aliasing pruning done when loading kallsyms and vmlinux (Arnaldo Carvalho de Melo) - Improve output of 'perf test vmlinux' test, to help identify on the verbose output which lines are warning and which are errors (Arnaldo Carvalho de Melo) - Prep work to stop having to pass symbol_filter_t to lots of functions, simplifying symtab loading routines (Arnaldo Carvalho de Melo) - Honor symbol_conf.allow_aliases when loading kallsyms as well, it was using it only when loading vmlinux files (Arnaldo Carvalho de Melo) - Fixup symbol->end before doing alias pruning when loading symbol tables (Arnaldo Carvalho de Melo) - Fix error handling of lzma kernel module decompression (Shawn Lin) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (8): perf annotate: Initialize the priv are in symbol__new() perf symbols: Rename ->ignore to ->idle perf probe: Do not use map_load filters for function perf test vmlinux: Clarify which -v lines are errors or warning perf test vmlinux: Avoid printing headers for empty lists perf test vmlinux: Tolerate symbol aliases perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too perf symbols: Fixup symbol sizes before picking best ones Masami Hiramatsu (5): perf probe: Remove unused tracing_dir variable perf probe: Show trace event definition perf probe: Ignore vmlinux buildid if offline kernel is given perf probe: Support probing on offline cross-arch binary perf probe: Ignore vmlinux Build-id when offline vmlinux given Milian Wolff (2): perf symbols: Demangle symbols for synthesized @plt entries. perf config: Show default report configuration in example and docs Ravi Bangoria (3): perf probe: Add helper function to check if probe with variable perf uprobe: Skip prologue if program compiled without optimization perf probe: Move dwarf specific functions to dwarf-aux.c Shawn Lin (1): perf tools: Fix error handling of lzma decompression tools/perf/Documentation/perf-config.txt | 8 + tools/perf/Documentation/perf-probe.txt | 9 ++ tools/perf/Documentation/perfconfig.example | 9 ++ tools/perf/arch/arm/include/dwarf-regs-table.h | 9 ++ tools/perf/arch/arm64/include/dwarf-regs-table.h | 13 ++ tools/perf/arch/powerpc/include/dwarf-regs-table.h | 27 ++++ tools/perf/arch/s390/include/dwarf-regs-table.h | 8 + tools/perf/arch/sh/include/dwarf-regs-table.h | 25 +++ tools/perf/arch/sparc/include/dwarf-regs-table.h | 18 +++ tools/perf/arch/x86/include/dwarf-regs-table.h | 14 ++ tools/perf/arch/xtensa/include/dwarf-regs-table.h | 8 + tools/perf/builtin-annotate.c | 7 +- tools/perf/builtin-probe.c | 35 +++- tools/perf/builtin-report.c | 6 +- tools/perf/builtin-top.c | 8 +- tools/perf/tests/vmlinux-kallsyms.c | 44 +++-- tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 7 - tools/perf/util/annotate.h | 1 - tools/perf/util/dwarf-aux.c | 179 +++++++++++++++++++++ tools/perf/util/dwarf-aux.h | 8 + tools/perf/util/dwarf-regs.c | 59 +++++++ tools/perf/util/evsel_fprintf.c | 4 +- tools/perf/util/include/dwarf-regs.h | 6 + tools/perf/util/lzma.c | 15 +- tools/perf/util/probe-event.c | 101 +++++++++--- tools/perf/util/probe-event.h | 3 + tools/perf/util/probe-file.c | 5 +- tools/perf/util/probe-finder.c | 60 +++++-- tools/perf/util/probe-finder.h | 1 + tools/perf/util/symbol-elf.c | 86 ++++++---- tools/perf/util/symbol.c | 30 +++- tools/perf/util/symbol.h | 5 +- 33 files changed, 698 insertions(+), 121 deletions(-) create mode 100644 tools/perf/arch/arm/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/arm64/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/powerpc/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/s390/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/sh/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/sparc/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/x86/include/dwarf-regs-table.h create mode 100644 tools/perf/arch/xtensa/include/dwarf-regs-table.h create mode 100644 tools/perf/util/dwarf-regs.c Build stats: 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 fedora:20: Ok 10 fedora:21: Ok 11 fedora:22: Ok 12 fedora:23: Ok 13 fedora:24: Ok 14 fedora:24-x-ARC-uClibc: Ok 15 fedora:rawhide: Ok 16 mageia:5: Ok 17 opensuse:13.2: Ok 18 opensuse:42.1: Ok 19 opensuse:tumbleweed: Ok 20 ubuntu:12.04.5: Ok 21 ubuntu:14.04.4: Ok 22 ubuntu:15.10: Ok 23 ubuntu:16.04: Ok 24 ubuntu:16.04-x-arm: Ok 25 ubuntu:16.04-x-arm64: Ok 26 ubuntu:16.04-x-powerpc64: Ok 27 ubuntu:16.04-x-powerpc64el: Ok 28 ubuntu:16.10: Ok 29 ubuntu:16.10-x-s390: Ok ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-09-01 16:45 Arnaldo Carvalho de Melo @ 2016-09-05 13:16 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-09-05 13:16 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Anton Blanchard, David Ahern, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Shawn Lin, Wang Nan, Yauheni Kaliuta, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 36e674a05164cdbb9d4a5b1b0b279fabae6c13bd: > > Merge tag 'perf-core-for-mingo-20160823' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-08-24 11:08:10 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160901 > > for you to fetch changes up to 6243b9dc4c991fe8bdc53a0e029908aef3ddb101: > > perf probe: Move dwarf specific functions to dwarf-aux.c (2016-09-01 12:42:26 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Support generating cross arch probes, i.e. if you specify a vmlinux > file for different arch than the one in the host machine, > > $ perf probe --definition function_name args > > will generate the probe definition string needed to append to the > target machine /sys/kernel/debug/tracing/kprobes_events file, using > scripting (Masami Hiramatsu). > > - Make 'perf probe' skip the function prologue in uprobes if program > compiled without optimization, using the same strategy as gdb and > systemtap uses, fixing a bug where: > > $ perf probe -x ./test 'foo i' > > When 'foo(42)' was used on the "./test" executable would produce i=0 > instead of the expected i=42 (Ravi Bangoria) > > - Demangle symbols for synthesized @plt entries too (Millian Wolff) > > Documentation: > > - Show default report configuration in 'perf config' example > and docs (Millian Wolff) > > Infrastructure: > > - Make 'perf test vmlinux' tolerate the symbol aliasing pruning done when > loading kallsyms and vmlinux (Arnaldo Carvalho de Melo) > > - Improve output of 'perf test vmlinux' test, to help identify on the verbose > output which lines are warning and which are errors (Arnaldo Carvalho de Melo) > > - Prep work to stop having to pass symbol_filter_t to lots of functions, > simplifying symtab loading routines (Arnaldo Carvalho de Melo) > > - Honor symbol_conf.allow_aliases when loading kallsyms as well, it was using > it only when loading vmlinux files (Arnaldo Carvalho de Melo) > > - Fixup symbol->end before doing alias pruning when loading symbol tables > (Arnaldo Carvalho de Melo) > > - Fix error handling of lzma kernel module decompression (Shawn Lin) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (8): > perf annotate: Initialize the priv are in symbol__new() > perf symbols: Rename ->ignore to ->idle > perf probe: Do not use map_load filters for function > perf test vmlinux: Clarify which -v lines are errors or warning > perf test vmlinux: Avoid printing headers for empty lists > perf test vmlinux: Tolerate symbol aliases > perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too > perf symbols: Fixup symbol sizes before picking best ones > > Masami Hiramatsu (5): > perf probe: Remove unused tracing_dir variable > perf probe: Show trace event definition > perf probe: Ignore vmlinux buildid if offline kernel is given > perf probe: Support probing on offline cross-arch binary > perf probe: Ignore vmlinux Build-id when offline vmlinux given > > Milian Wolff (2): > perf symbols: Demangle symbols for synthesized @plt entries. > perf config: Show default report configuration in example and docs > > Ravi Bangoria (3): > perf probe: Add helper function to check if probe with variable > perf uprobe: Skip prologue if program compiled without optimization > perf probe: Move dwarf specific functions to dwarf-aux.c > > Shawn Lin (1): > perf tools: Fix error handling of lzma decompression > > tools/perf/Documentation/perf-config.txt | 8 + > tools/perf/Documentation/perf-probe.txt | 9 ++ > tools/perf/Documentation/perfconfig.example | 9 ++ > tools/perf/arch/arm/include/dwarf-regs-table.h | 9 ++ > tools/perf/arch/arm64/include/dwarf-regs-table.h | 13 ++ > tools/perf/arch/powerpc/include/dwarf-regs-table.h | 27 ++++ > tools/perf/arch/s390/include/dwarf-regs-table.h | 8 + > tools/perf/arch/sh/include/dwarf-regs-table.h | 25 +++ > tools/perf/arch/sparc/include/dwarf-regs-table.h | 18 +++ > tools/perf/arch/x86/include/dwarf-regs-table.h | 14 ++ > tools/perf/arch/xtensa/include/dwarf-regs-table.h | 8 + > tools/perf/builtin-annotate.c | 7 +- > tools/perf/builtin-probe.c | 35 +++- > tools/perf/builtin-report.c | 6 +- > tools/perf/builtin-top.c | 8 +- > tools/perf/tests/vmlinux-kallsyms.c | 44 +++-- > tools/perf/util/Build | 1 + > tools/perf/util/annotate.c | 7 - > tools/perf/util/annotate.h | 1 - > tools/perf/util/dwarf-aux.c | 179 +++++++++++++++++++++ > tools/perf/util/dwarf-aux.h | 8 + > tools/perf/util/dwarf-regs.c | 59 +++++++ > tools/perf/util/evsel_fprintf.c | 4 +- > tools/perf/util/include/dwarf-regs.h | 6 + > tools/perf/util/lzma.c | 15 +- > tools/perf/util/probe-event.c | 101 +++++++++--- > tools/perf/util/probe-event.h | 3 + > tools/perf/util/probe-file.c | 5 +- > tools/perf/util/probe-finder.c | 60 +++++-- > tools/perf/util/probe-finder.h | 1 + > tools/perf/util/symbol-elf.c | 86 ++++++---- > tools/perf/util/symbol.c | 30 +++- > tools/perf/util/symbol.h | 5 +- > 33 files changed, 698 insertions(+), 121 deletions(-) > create mode 100644 tools/perf/arch/arm/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/arm64/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/powerpc/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/s390/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/sh/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/sparc/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/x86/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/xtensa/include/dwarf-regs-table.h > create mode 100644 tools/perf/util/dwarf-regs.c > > Build stats: > > 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 fedora:20: Ok > 10 fedora:21: Ok > 11 fedora:22: Ok > 12 fedora:23: Ok > 13 fedora:24: Ok > 14 fedora:24-x-ARC-uClibc: Ok > 15 fedora:rawhide: Ok > 16 mageia:5: Ok > 17 opensuse:13.2: Ok > 18 opensuse:42.1: Ok > 19 opensuse:tumbleweed: Ok > 20 ubuntu:12.04.5: Ok > 21 ubuntu:14.04.4: Ok > 22 ubuntu:15.10: Ok > 23 ubuntu:16.04: Ok > 24 ubuntu:16.04-x-arm: Ok > 25 ubuntu:16.04-x-arm64: Ok > 26 ubuntu:16.04-x-powerpc64: Ok > 27 ubuntu:16.04-x-powerpc64el: Ok > 28 ubuntu:16.10: Ok > 29 ubuntu:16.10-x-s390: Ok Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-07-14 2:20 Arnaldo Carvalho de Melo 2016-07-14 6:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-07-14 2:20 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, Hemant Kumar, Jiri Olsa, Josh Poimboeuf, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, I've added building objtool to most of the containers in my build test setup: [root@jouet ~]# perf stat dm alpine:3.4: Ok centos:5: Ok centos:6: Ok centos:7: Ok debian:7: Ok debian:8: Ok debian:experimental: Ok fedora:21: Ok fedora:22: Ok fedora:23: Ok fedora:24: Ok fedora:rawhide: Ok mageia:5: Ok opensuse:13.2: Ok opensuse:42.1: Ok ubuntu:12.04.5: Ok ubuntu:14.04.4: Ok ubuntu:15.10: Ok ubuntu:16.04: Ok Performance counter stats for 'dm': 2601.121782 task-clock (msec) # 0.002 CPUs utilized 86,368 context-switches # 0.033 M/sec 5,740 cpu-migrations # 0.002 M/sec 53,962 page-faults # 0.021 M/sec 7,217,605,183 cycles # 2.775 GHz 6,534,540,119 instructions # 0.91 insn per cycle 1,408,715,184 branches # 541.580 M/sec 18,523,459 branch-misses # 1.31% of all branches 1541.746171526 seconds time elapsed [root@jouet ~]# - Arnaldo The following changes since commit 7b39cafb7aa68ef8e32a9f51fbe737d96084ca74: tools: Work around BITS_PER_LONG related build failure in objtool (2016-07-13 09:37:43 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160713 for you to fetch changes up to 8e5dc848356ecf6ea8d27d641c4d7ad8d42fe92b: perf test: Add a test case for SDT event (2016-07-13 23:09:10 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Finish merging initial SDT (Statically Defined Traces) support, see cset comments for details about how it all works (Masami Hiramatsu) - Support attaching eBPF programs to tracepoints (Wang Nan) Infrastructure: - Fix up BITS_PER_LONG setting (Arnaldo Carvalho de Melo) - Add fallback from ELF_C_READ_MMAP to ELF_C_READ in objtool, fixing the build in libelf implementations lacking that elf_begin() cmd, such as Alpine Linux's (Arnaldo Carvalho de Melo) - Avoid checking code drift on busybox's diff in objtool (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): tools: Fix up BITS_PER_LONG setting objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ objtool: Avoid checking code drift on busybox's diff Masami Hiramatsu (11): perf probe: Fix to show correct error message for $vars and $params perf probe: Accept %sdt and %cached event name perf probe: Make --list show only available cached events perf probe-cache: Add for_each_probe_cache_entry() wrapper perf probe: Allow wildcard for cached events perf probe: Search SDT/cached event from all probe caches perf list: Show SDT and pre-cached events perf probe: Support @BUILDID or @FILE suffix for SDT events perf probe: Support a special SDT probe format perf build: Add sdt feature detection perf test: Add a test case for SDT event Wang Nan (5): tools lib bpf: New API to adjust type of a BPF program tools lib bpf: Report error when kernel doesn't support program type perf event parser: Add const qualifier to evt_name and sys_name perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event() perf bpf: Support BPF program attach to tracepoints tools/build/Makefile.feature | 3 +- tools/build/feature/Makefile | 6 +- tools/build/feature/test-all.c | 5 + tools/build/feature/test-sdt.c | 7 + tools/include/asm-generic/bitsperlong.h | 24 ++- tools/lib/bpf/libbpf.c | 80 +++++++-- tools/lib/bpf/libbpf.h | 10 ++ tools/objtool/Makefile | 5 +- tools/objtool/elf.c | 7 + tools/perf/Documentation/perf-probe.txt | 11 +- tools/perf/Makefile.perf | 3 + tools/perf/builtin-list.c | 6 +- tools/perf/builtin-probe.c | 2 +- tools/perf/config/Makefile | 10 ++ tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/make | 3 +- tools/perf/tests/sdt.c | 115 ++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/util/bpf-loader.c | 73 +++++++- tools/perf/util/bpf-loader.h | 12 +- tools/perf/util/build-id.c | 76 +++++++- tools/perf/util/build-id.h | 3 +- tools/perf/util/parse-events.c | 110 ++++++++++-- tools/perf/util/parse-events.h | 4 +- tools/perf/util/probe-event.c | 309 +++++++++++++++++++++++++++----- tools/perf/util/probe-event.h | 1 + tools/perf/util/probe-file.c | 57 ++++-- tools/perf/util/probe-file.h | 14 ++ 29 files changed, 850 insertions(+), 112 deletions(-) create mode 100644 tools/build/feature/test-sdt.c create mode 100644 tools/perf/tests/sdt.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-07-14 2:20 Arnaldo Carvalho de Melo @ 2016-07-14 6:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-07-14 6:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, Hemant Kumar, Jiri Olsa, Josh Poimboeuf, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > I've added building objtool to most of the containers in my build test setup: > > [root@jouet ~]# perf stat dm > alpine:3.4: Ok > centos:5: Ok > centos:6: Ok > centos:7: Ok > debian:7: Ok > debian:8: Ok > debian:experimental: Ok > fedora:21: Ok > fedora:22: Ok > fedora:23: Ok > fedora:24: Ok > fedora:rawhide: Ok > mageia:5: Ok > opensuse:13.2: Ok > opensuse:42.1: Ok > ubuntu:12.04.5: Ok > ubuntu:14.04.4: Ok > ubuntu:15.10: Ok > ubuntu:16.04: Ok > > Performance counter stats for 'dm': > > 2601.121782 task-clock (msec) # 0.002 CPUs utilized > 86,368 context-switches # 0.033 M/sec > 5,740 cpu-migrations # 0.002 M/sec > 53,962 page-faults # 0.021 M/sec > 7,217,605,183 cycles # 2.775 GHz > 6,534,540,119 instructions # 0.91 insn per cycle > 1,408,715,184 branches # 541.580 M/sec > 18,523,459 branch-misses # 1.31% of all branches > > 1541.746171526 seconds time elapsed > > [root@jouet ~]# > > - Arnaldo > > The following changes since commit 7b39cafb7aa68ef8e32a9f51fbe737d96084ca74: > > tools: Work around BITS_PER_LONG related build failure in objtool (2016-07-13 09:37:43 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160713 > > for you to fetch changes up to 8e5dc848356ecf6ea8d27d641c4d7ad8d42fe92b: > > perf test: Add a test case for SDT event (2016-07-13 23:09:10 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Finish merging initial SDT (Statically Defined Traces) support, see > cset comments for details about how it all works (Masami Hiramatsu) > > - Support attaching eBPF programs to tracepoints (Wang Nan) > > Infrastructure: > > - Fix up BITS_PER_LONG setting (Arnaldo Carvalho de Melo) > > - Add fallback from ELF_C_READ_MMAP to ELF_C_READ in objtool, fixing > the build in libelf implementations lacking that elf_begin() cmd, > such as Alpine Linux's (Arnaldo Carvalho de Melo) > > - Avoid checking code drift on busybox's diff in objtool (Arnaldo Carvalho de Melo) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > tools: Fix up BITS_PER_LONG setting > objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ > objtool: Avoid checking code drift on busybox's diff > > Masami Hiramatsu (11): > perf probe: Fix to show correct error message for $vars and $params > perf probe: Accept %sdt and %cached event name > perf probe: Make --list show only available cached events > perf probe-cache: Add for_each_probe_cache_entry() wrapper > perf probe: Allow wildcard for cached events > perf probe: Search SDT/cached event from all probe caches > perf list: Show SDT and pre-cached events > perf probe: Support @BUILDID or @FILE suffix for SDT events > perf probe: Support a special SDT probe format > perf build: Add sdt feature detection > perf test: Add a test case for SDT event > > Wang Nan (5): > tools lib bpf: New API to adjust type of a BPF program > tools lib bpf: Report error when kernel doesn't support program type > perf event parser: Add const qualifier to evt_name and sys_name > perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event() > perf bpf: Support BPF program attach to tracepoints > > tools/build/Makefile.feature | 3 +- > tools/build/feature/Makefile | 6 +- > tools/build/feature/test-all.c | 5 + > tools/build/feature/test-sdt.c | 7 + > tools/include/asm-generic/bitsperlong.h | 24 ++- > tools/lib/bpf/libbpf.c | 80 +++++++-- > tools/lib/bpf/libbpf.h | 10 ++ > tools/objtool/Makefile | 5 +- > tools/objtool/elf.c | 7 + > tools/perf/Documentation/perf-probe.txt | 11 +- > tools/perf/Makefile.perf | 3 + > tools/perf/builtin-list.c | 6 +- > tools/perf/builtin-probe.c | 2 +- > tools/perf/config/Makefile | 10 ++ > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/make | 3 +- > tools/perf/tests/sdt.c | 115 ++++++++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/util/bpf-loader.c | 73 +++++++- > tools/perf/util/bpf-loader.h | 12 +- > tools/perf/util/build-id.c | 76 +++++++- > tools/perf/util/build-id.h | 3 +- > tools/perf/util/parse-events.c | 110 ++++++++++-- > tools/perf/util/parse-events.h | 4 +- > tools/perf/util/probe-event.c | 309 +++++++++++++++++++++++++++----- > tools/perf/util/probe-event.h | 1 + > tools/perf/util/probe-file.c | 57 ++++-- > tools/perf/util/probe-file.h | 14 ++ > 29 files changed, 850 insertions(+), 112 deletions(-) > create mode 100644 tools/build/feature/test-sdt.c > create mode 100644 tools/perf/tests/sdt.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-06-15 18:13 Arnaldo Carvalho de Melo 2016-06-16 6:29 ` Jiri Olsa 2016-06-16 8:29 ` Ingo Molnar 0 siblings, 2 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-15 18:13 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a: perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86 (2016-06-14 11:16:59 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160615 for you to fetch changes up to 2fd457a34525ea3bc609e377b46af759af8a7934: perf probe: Add --cache option to cache the probe definitions (2016-06-15 14:34:42 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Add --ldlat option to 'perf mem' to specify load latency for loads event (e.g. cpu/mem-loads/ ) (Jiri Olsa) Build fixes: - Fix libunwind related compile error for static cross build (He Kuang) Infrastructure: - UI refactorings to support headers with multiple lines, non-evsel hists browsers, toggle showing callchains, etc (Jiri Olsa) - More prep work for caching probe definitions, paving the way for supporting SDT (Statically Defined Traces) userspace probes (Masami Hiramatsu) - Handle NULL at perf_config_set__delete() (Taeung Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- He Kuang (1): perf unwind: Fix compile error for static cross build Jiri Olsa (10): perf mem: Add --ldlat option perf tools: Fix Data Object sort entry width index perf tui: Separate hierarchy and standard headers output perf stdio: Separate headers output perf stdio: Separate hierarchy headers output perf stdio: Separate standard headers output perf stdio: Do not pass hists in hist_entry__fprintf perf stdio: Add use_callchain parameter to hists__fprintf perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback Masami Hiramatsu (7): perf tools: Fix rm_rf() to handle non-regular files correctly perf probe: Fix to add NULL check for strndup perf buildid: Rename and export build_id_cache__cachedir() perf probe: Add perf_probe_event__copy() perf probe: Uncomment and export synthesize_perf_probe_point() perf probe: Introduce perf_cache interfaces perf probe: Add --cache option to cache the probe definitions Taeung Song (1): perf config: Handle NULL at perf_config_set__delete() tools/perf/Documentation/perf-mem.txt | 3 + tools/perf/Documentation/perf-probe.txt | 4 + tools/perf/builtin-diff.c | 7 +- tools/perf/builtin-mem.c | 1 + tools/perf/builtin-probe.c | 1 + tools/perf/builtin-report.c | 3 +- tools/perf/builtin-top.c | 2 +- tools/perf/config/Makefile | 3 + tools/perf/ui/browsers/hists.c | 39 ++-- tools/perf/ui/gtk/hists.c | 2 +- tools/perf/ui/hist.c | 11 +- tools/perf/ui/stdio/hist.c | 133 +++++++------ tools/perf/util/build-id.c | 12 +- tools/perf/util/build-id.h | 2 + tools/perf/util/config.c | 3 + tools/perf/util/hist.c | 2 +- tools/perf/util/hist.h | 7 +- tools/perf/util/mem-events.c | 17 +- tools/perf/util/mem-events.h | 1 + tools/perf/util/probe-event.c | 128 ++++++++++-- tools/perf/util/probe-event.h | 5 + tools/perf/util/probe-file.c | 331 ++++++++++++++++++++++++++++++++ tools/perf/util/probe-file.h | 20 ++ tools/perf/util/sort.c | 14 +- tools/perf/util/util.c | 13 +- 25 files changed, 640 insertions(+), 124 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-06-15 18:13 Arnaldo Carvalho de Melo @ 2016-06-16 6:29 ` Jiri Olsa 2016-06-16 19:54 ` Arnaldo Carvalho de Melo 2016-06-16 8:29 ` Ingo Molnar 1 sibling, 1 reply; 53+ messages in thread From: Jiri Olsa @ 2016-06-16 6:29 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo On Wed, Jun 15, 2016 at 03:13:09PM -0300, Arnaldo Carvalho de Melo wrote: SNIP > ---------------------------------------------------------------- > He Kuang (1): > perf unwind: Fix compile error for static cross build > > Jiri Olsa (10): > perf mem: Add --ldlat option > perf tools: Fix Data Object sort entry width index > perf tui: Separate hierarchy and standard headers output > perf stdio: Separate headers output > perf stdio: Separate hierarchy headers output > perf stdio: Separate standard headers output > perf stdio: Do not pass hists in hist_entry__fprintf > perf stdio: Add use_callchain parameter to hists__fprintf > perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback > perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback hi, any reason for skipping this one?: perf tools: Rename __hists__add_entry to hists__add_entry thanks, jirka ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-06-16 6:29 ` Jiri Olsa @ 2016-06-16 19:54 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-16 19:54 UTC (permalink / raw) To: Jiri Olsa Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Em Thu, Jun 16, 2016 at 08:29:47AM +0200, Jiri Olsa escreveu: > On Wed, Jun 15, 2016 at 03:13:09PM -0300, Arnaldo Carvalho de Melo wrote: > > SNIP > > > ---------------------------------------------------------------- > > He Kuang (1): > > perf unwind: Fix compile error for static cross build > > > > Jiri Olsa (10): > > perf mem: Add --ldlat option > > perf tools: Fix Data Object sort entry width index > > perf tui: Separate hierarchy and standard headers output > > perf stdio: Separate headers output > > perf stdio: Separate hierarchy headers output > > perf stdio: Separate standard headers output > > perf stdio: Do not pass hists in hist_entry__fprintf > > perf stdio: Add use_callchain parameter to hists__fprintf > > perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback > > perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback > hi, > any reason for skipping this one?: > perf tools: Rename __hists__add_entry to hists__add_entry nope, will apply. - Arnaldo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-06-15 18:13 Arnaldo Carvalho de Melo 2016-06-16 6:29 ` Jiri Olsa @ 2016-06-16 8:29 ` Ingo Molnar 1 sibling, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-06-16 8:29 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a: > > perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86 (2016-06-14 11:16:59 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160615 > > for you to fetch changes up to 2fd457a34525ea3bc609e377b46af759af8a7934: > > perf probe: Add --cache option to cache the probe definitions (2016-06-15 14:34:42 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Add --ldlat option to 'perf mem' to specify load latency for loads > event (e.g. cpu/mem-loads/ ) (Jiri Olsa) > > Build fixes: > > - Fix libunwind related compile error for static cross build (He Kuang) > > Infrastructure: > > - UI refactorings to support headers with multiple lines, non-evsel > hists browsers, toggle showing callchains, etc (Jiri Olsa) > > - More prep work for caching probe definitions, paving the way > for supporting SDT (Statically Defined Traces) userspace probes (Masami Hiramatsu) > > - Handle NULL at perf_config_set__delete() (Taeung Song) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > He Kuang (1): > perf unwind: Fix compile error for static cross build > > Jiri Olsa (10): > perf mem: Add --ldlat option > perf tools: Fix Data Object sort entry width index > perf tui: Separate hierarchy and standard headers output > perf stdio: Separate headers output > perf stdio: Separate hierarchy headers output > perf stdio: Separate standard headers output > perf stdio: Do not pass hists in hist_entry__fprintf > perf stdio: Add use_callchain parameter to hists__fprintf > perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback > perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback > > Masami Hiramatsu (7): > perf tools: Fix rm_rf() to handle non-regular files correctly > perf probe: Fix to add NULL check for strndup > perf buildid: Rename and export build_id_cache__cachedir() > perf probe: Add perf_probe_event__copy() > perf probe: Uncomment and export synthesize_perf_probe_point() > perf probe: Introduce perf_cache interfaces > perf probe: Add --cache option to cache the probe definitions > > Taeung Song (1): > perf config: Handle NULL at perf_config_set__delete() > > tools/perf/Documentation/perf-mem.txt | 3 + > tools/perf/Documentation/perf-probe.txt | 4 + > tools/perf/builtin-diff.c | 7 +- > tools/perf/builtin-mem.c | 1 + > tools/perf/builtin-probe.c | 1 + > tools/perf/builtin-report.c | 3 +- > tools/perf/builtin-top.c | 2 +- > tools/perf/config/Makefile | 3 + > tools/perf/ui/browsers/hists.c | 39 ++-- > tools/perf/ui/gtk/hists.c | 2 +- > tools/perf/ui/hist.c | 11 +- > tools/perf/ui/stdio/hist.c | 133 +++++++------ > tools/perf/util/build-id.c | 12 +- > tools/perf/util/build-id.h | 2 + > tools/perf/util/config.c | 3 + > tools/perf/util/hist.c | 2 +- > tools/perf/util/hist.h | 7 +- > tools/perf/util/mem-events.c | 17 +- > tools/perf/util/mem-events.h | 1 + > tools/perf/util/probe-event.c | 128 ++++++++++-- > tools/perf/util/probe-event.h | 5 + > tools/perf/util/probe-file.c | 331 ++++++++++++++++++++++++++++++++ > tools/perf/util/probe-file.h | 20 ++ > tools/perf/util/sort.c | 14 +- > tools/perf/util/util.c | 13 +- > 25 files changed, 640 insertions(+), 124 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-04-07 20:58 Arnaldo Carvalho de Melo 2016-04-08 13:15 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-04-07 20:58 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, build tested on: # perf stat -e cycles dm alldeps-ubuntu-12.04: Ok minimal-debian-experimental-x-mips64: Ok minimal-debian-experimental-x-mips64el: Ok minimal-debian-experimental-x-mipsel: Ok minimal-ubuntu-x-arm: Ok minimal-ubuntu-x-arm64: Ok minimal-ubuntu-x-ppc64: Ok minimal-ubuntu-x-ppc64el: Ok alldeps-debian: Ok alldeps-mageia: Ok alldeps-rhel7: Ok alldeps-centos: Ok alldeps-opensuse: Ok alldeps-ubuntu: Ok Performance counter stats for 'dm': 3,095,685,547 cycles 454.805537820 seconds time elapsed # 'perf test' passes on fedora23 x86_64, Thanks, - Arnaldo The following changes since commit dad38ca64a252144b4ccdfe9730a3fe2b7c61957: Merge tag 'perf-core-for-mingo-20160401' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-06 08:46:23 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160407 for you to fetch changes up to 98c3d844cd0bc56d33800114e6b6adcd0a5ec381: perf symbols: Adjust symbol for shared objects (2016-04-07 17:17:01 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Beautify more syscall arguments in 'perf trace', using the type column in tracepoint /format fields to attach, for instance, a pid_t resolver to the thread COMM, also attach a mode_t beautifier in the same fashion (Arnaldo Carvalho de Melo) - Build the syscall table id <-> name resolver using the same .tbl file used in the kernel to generate headers, to avoid the delay in getting new syscalls supported in the audit-libs external dependency, done so far only for x86_64 (Arnaldo Carvalho de Melo) - Improve the documentation of event specifications (Andi Kleen) - Process update events in 'perf script', fixing up this use case: # perf stat -a -I 1000 -e cycles record | perf script -s script.py - Shared object symbol adjustment fixes, fixing symbol resolution in Android (Wang Nan) Infrastructure: - Add dedicated unwind addr_space member into thread struct, to allow tools to use thread->priv, noticed while working on having callchains in 'perf trace' (Jiri Olsa) Build fixes: - Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (1): perf list: Document event specifications better Arnaldo Carvalho de Melo (11): perf probe: Check if dwarf_getlocations() is available perf script perl: Do error checking on new backtrace routine perf trace: Beautify sched_setscheduler 'policy' argument perf trace: Beautify wait4/waitid 'options' argument perf trace: Infrastructure to show COMM strings for syscalls returning PIDs perf trace: Beautify set_tid_address, getpid, getppid return values perf trace: Beautify pid_t arguments perf trace: Beautify mode_t arguments perf trace: Move syscall table id <-> name routines to separate class perf tools: Allow generating per-arch syscall table arrays perf tools: Build syscall table .c header from kernel's syscall_64.tbl Jiri Olsa (4): perf tools: Remove superfluous ARCH Makefile includes perf tools: Introduce trim function perf tools: Add dedicated unwind addr_space member into thread struct perf script: Process event update events Vinson Lee (1): perf config: Fix build with older toolchain. Wang Nan (2): perf symbols: Record text offset in dso to calculate objdump address perf symbols: Adjust symbol for shared objects tools/build/Makefile.feature | 2 + tools/build/feature/Makefile | 4 + tools/build/feature/test-all.c | 5 + tools/build/feature/test-dwarf_getlocations.c | 12 + tools/perf/Documentation/perf-list.txt | 107 +++++- tools/perf/Makefile.perf | 13 +- tools/perf/arch/x86/Makefile | 23 ++ tools/perf/arch/x86/entry/syscalls/syscall_64.tbl | 374 +++++++++++++++++++++ tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 39 +++ tools/perf/builtin-script.c | 1 + tools/perf/builtin-trace.c | 156 +++++---- tools/perf/config/Makefile | 11 +- tools/perf/trace/beauty/mode_t.c | 68 ++++ tools/perf/trace/beauty/pid.c | 18 + tools/perf/trace/beauty/sched_policy.c | 44 +++ tools/perf/trace/beauty/waitid_options.c | 26 ++ tools/perf/ui/browsers/hists.c | 3 +- tools/perf/ui/stdio/hist.c | 3 +- tools/perf/util/Build | 5 + tools/perf/util/config.c | 6 +- tools/perf/util/dwarf-aux.c | 9 + tools/perf/util/map.c | 14 + .../perf/util/scripting-engines/trace-event-perl.c | 30 +- tools/perf/util/symbol-elf.c | 13 +- tools/perf/util/syscalltbl.c | 134 ++++++++ tools/perf/util/syscalltbl.h | 20 ++ tools/perf/util/thread.h | 6 + tools/perf/util/unwind-libunwind.c | 25 +- tools/perf/util/util.h | 5 + 29 files changed, 1060 insertions(+), 116 deletions(-) create mode 100644 tools/build/feature/test-dwarf_getlocations.c create mode 100644 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl create mode 100755 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh create mode 100644 tools/perf/trace/beauty/mode_t.c create mode 100644 tools/perf/trace/beauty/pid.c create mode 100644 tools/perf/trace/beauty/sched_policy.c create mode 100644 tools/perf/trace/beauty/waitid_options.c create mode 100644 tools/perf/util/syscalltbl.c create mode 100644 tools/perf/util/syscalltbl.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-04-07 20:58 Arnaldo Carvalho de Melo @ 2016-04-08 13:15 ` Arnaldo Carvalho de Melo 2016-04-13 6:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-04-08 13:15 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo Em Thu, Apr 07, 2016 at 05:58:21PM -0300, Arnaldo Carvalho de Melo escreveu: > Hi Ingo, > > Please consider pulling, build tested on: Ingo, if you haven't pulled this one, please pull instead perf-core-for-mingo-20160408, which has the same tag text and contents + a Tested-by tag from Milian for the unwind thread one and a bisection fix one liner for the syscall_tbl generation from Wang, Thanks, - Arnaldo > # perf stat -e cycles dm > alldeps-ubuntu-12.04: Ok > minimal-debian-experimental-x-mips64: Ok > minimal-debian-experimental-x-mips64el: Ok > minimal-debian-experimental-x-mipsel: Ok > minimal-ubuntu-x-arm: Ok > minimal-ubuntu-x-arm64: Ok > minimal-ubuntu-x-ppc64: Ok > minimal-ubuntu-x-ppc64el: Ok > alldeps-debian: Ok > alldeps-mageia: Ok > alldeps-rhel7: Ok > alldeps-centos: Ok > alldeps-opensuse: Ok > alldeps-ubuntu: Ok > > Performance counter stats for 'dm': > > 3,095,685,547 cycles > > 454.805537820 seconds time elapsed > > # > > 'perf test' passes on fedora23 x86_64, > > Thanks, > > - Arnaldo > > The following changes since commit dad38ca64a252144b4ccdfe9730a3fe2b7c61957: > > Merge tag 'perf-core-for-mingo-20160401' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-06 08:46:23 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160407 > > for you to fetch changes up to 98c3d844cd0bc56d33800114e6b6adcd0a5ec381: > > perf symbols: Adjust symbol for shared objects (2016-04-07 17:17:01 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Beautify more syscall arguments in 'perf trace', using the type column in > tracepoint /format fields to attach, for instance, a pid_t resolver to the > thread COMM, also attach a mode_t beautifier in the same fashion > (Arnaldo Carvalho de Melo) > > - Build the syscall table id <-> name resolver using the same .tbl file > used in the kernel to generate headers, to avoid the delay in getting > new syscalls supported in the audit-libs external dependency, done so > far only for x86_64 (Arnaldo Carvalho de Melo) > > - Improve the documentation of event specifications (Andi Kleen) > > - Process update events in 'perf script', fixing up this use case: > > # perf stat -a -I 1000 -e cycles record | perf script -s script.py > > - Shared object symbol adjustment fixes, fixing symbol resolution in > Android (Wang Nan) > > Infrastructure: > > - Add dedicated unwind addr_space member into thread struct, to allow > tools to use thread->priv, noticed while working on having callchains > in 'perf trace' (Jiri Olsa) > > Build fixes: > > - Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (1): > perf list: Document event specifications better > > Arnaldo Carvalho de Melo (11): > perf probe: Check if dwarf_getlocations() is available > perf script perl: Do error checking on new backtrace routine > perf trace: Beautify sched_setscheduler 'policy' argument > perf trace: Beautify wait4/waitid 'options' argument > perf trace: Infrastructure to show COMM strings for syscalls returning PIDs > perf trace: Beautify set_tid_address, getpid, getppid return values > perf trace: Beautify pid_t arguments > perf trace: Beautify mode_t arguments > perf trace: Move syscall table id <-> name routines to separate class > perf tools: Allow generating per-arch syscall table arrays > perf tools: Build syscall table .c header from kernel's syscall_64.tbl > > Jiri Olsa (4): > perf tools: Remove superfluous ARCH Makefile includes > perf tools: Introduce trim function > perf tools: Add dedicated unwind addr_space member into thread struct > perf script: Process event update events > > Vinson Lee (1): > perf config: Fix build with older toolchain. > > Wang Nan (2): > perf symbols: Record text offset in dso to calculate objdump address > perf symbols: Adjust symbol for shared objects > > tools/build/Makefile.feature | 2 + > tools/build/feature/Makefile | 4 + > tools/build/feature/test-all.c | 5 + > tools/build/feature/test-dwarf_getlocations.c | 12 + > tools/perf/Documentation/perf-list.txt | 107 +++++- > tools/perf/Makefile.perf | 13 +- > tools/perf/arch/x86/Makefile | 23 ++ > tools/perf/arch/x86/entry/syscalls/syscall_64.tbl | 374 +++++++++++++++++++++ > tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 39 +++ > tools/perf/builtin-script.c | 1 + > tools/perf/builtin-trace.c | 156 +++++---- > tools/perf/config/Makefile | 11 +- > tools/perf/trace/beauty/mode_t.c | 68 ++++ > tools/perf/trace/beauty/pid.c | 18 + > tools/perf/trace/beauty/sched_policy.c | 44 +++ > tools/perf/trace/beauty/waitid_options.c | 26 ++ > tools/perf/ui/browsers/hists.c | 3 +- > tools/perf/ui/stdio/hist.c | 3 +- > tools/perf/util/Build | 5 + > tools/perf/util/config.c | 6 +- > tools/perf/util/dwarf-aux.c | 9 + > tools/perf/util/map.c | 14 + > .../perf/util/scripting-engines/trace-event-perl.c | 30 +- > tools/perf/util/symbol-elf.c | 13 +- > tools/perf/util/syscalltbl.c | 134 ++++++++ > tools/perf/util/syscalltbl.h | 20 ++ > tools/perf/util/thread.h | 6 + > tools/perf/util/unwind-libunwind.c | 25 +- > tools/perf/util/util.h | 5 + > 29 files changed, 1060 insertions(+), 116 deletions(-) > create mode 100644 tools/build/feature/test-dwarf_getlocations.c > create mode 100644 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl > create mode 100755 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh > create mode 100644 tools/perf/trace/beauty/mode_t.c > create mode 100644 tools/perf/trace/beauty/pid.c > create mode 100644 tools/perf/trace/beauty/sched_policy.c > create mode 100644 tools/perf/trace/beauty/waitid_options.c > create mode 100644 tools/perf/util/syscalltbl.c > create mode 100644 tools/perf/util/syscalltbl.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-04-08 13:15 ` Arnaldo Carvalho de Melo @ 2016-04-13 6:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-04-13 6:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Em Thu, Apr 07, 2016 at 05:58:21PM -0300, Arnaldo Carvalho de Melo escreveu: > > Hi Ingo, > > > > Please consider pulling, build tested on: > > Ingo, if you haven't pulled this one, please pull instead > perf-core-for-mingo-20160408, which has the same tag text and contents + > a Tested-by tag from Milian for the unwind thread one and a bisection > fix one liner for the syscall_tbl generation from Wang, Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-03-10 21:04 Arnaldo Carvalho de Melo 2016-03-11 8:43 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-03-10 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Borislav Petkov, Chris Phlipot, Colin Ian King, David Ahern, Davidlohr Bueso, He Kuang, H . Peter Anvin, Jiri Olsa, Mel Gorman, Namhyung Kim, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 3a99e6db539e53cc9c79282e80f8362b0cb96ac8: perf bench mem: Prepare the x86-64 build for upstream memcpy_mcsafe() changes (2016-03-09 10:40:01 +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-20160310 for you to fetch changes up to 206cab651d07563d766c7f4cb73f858c5df3dec5: perf stat: Add --metric-only support for -A (2016-03-10 16:50:47 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Implement 'perf stat --metric-only' (Andi Kleen) - Fix perf script python database export crash (Chris Phlipot) Infrastructure: - perf top/report --hierarchy assorted fixes for problems introduced in this perf/core cycle (Namhyung Kim) - Support '~' operation in libtraceevent (Steven Rosted) Build fixes: - Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF devel files are not installed (Arnaldo Carvalho de Melo) - Do not try building jitdump on unsupported arches (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (3): perf stat: Document CSV format in manpage perf stat: Implement --metric-only mode perf stat: Add --metric-only support for -A Arnaldo Carvalho de Melo (1): perf jitdump: DWARF is also needed Chris Phlipot (1): perf tools: Fix perf script python database export crash Jiri Olsa (3): perf tools: Pass perf_hpp_list all the way through setup_sort_list perf tools: Omit unnecessary cast in perf_pmu__parse_scale perf jitdump: Build only on supported archs Namhyung Kim (10): perf tools: Fix hist_entry__filter() for hierarchy perf tools: Add more sort entry check functions perf tools: Fix command line filters in hierarchy mode perf tools: Remove hist_entry->fmt field perf hists browser: Cleanup hist_browser__fprintf_hierarchy_entry() perf tools: Remove nr_sort_keys field perf tools: Recalc total periods using top-level entries in hierarchy perf tools: Add sort__has_comm variable perf hists browser: Allow thread filtering for comm sort key perf hists browser: Check sort keys before hot key actions Steven Rostedt (1): tools lib traceevent: Add '~' operation within arg_num_eval() tools/lib/traceevent/event-parse.c | 6 + tools/perf/Documentation/perf-stat.txt | 27 ++++ tools/perf/arch/arm/Makefile | 1 + tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/powerpc/Makefile | 1 + tools/perf/arch/x86/Makefile | 1 + tools/perf/builtin-inject.c | 12 +- tools/perf/builtin-stat.c | 244 +++++++++++++++++++++++++++++++-- tools/perf/config/Makefile | 7 + tools/perf/ui/browsers/hists.c | 73 ++++++---- tools/perf/ui/hist.c | 3 - tools/perf/util/Build | 3 + tools/perf/util/evsel.h | 6 +- tools/perf/util/hist.c | 144 +++++++++++++++++-- tools/perf/util/hist.h | 6 +- tools/perf/util/pmu.c | 4 +- tools/perf/util/sort.c | 147 +++++++++----------- tools/perf/util/sort.h | 2 +- 18 files changed, 542 insertions(+), 146 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-03-10 21:04 Arnaldo Carvalho de Melo @ 2016-03-11 8:43 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-03-11 8:43 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen, Borislav Petkov, Chris Phlipot, Colin Ian King, David Ahern, Davidlohr Bueso, He Kuang, H . Peter Anvin, Jiri Olsa, Mel Gorman, Namhyung Kim, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 3a99e6db539e53cc9c79282e80f8362b0cb96ac8: > > perf bench mem: Prepare the x86-64 build for upstream memcpy_mcsafe() changes (2016-03-09 10:40:01 +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-20160310 > > for you to fetch changes up to 206cab651d07563d766c7f4cb73f858c5df3dec5: > > perf stat: Add --metric-only support for -A (2016-03-10 16:50:47 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Implement 'perf stat --metric-only' (Andi Kleen) > > - Fix perf script python database export crash (Chris Phlipot) > > Infrastructure: > > - perf top/report --hierarchy assorted fixes for problems introduced in this > perf/core cycle (Namhyung Kim) > > - Support '~' operation in libtraceevent (Steven Rosted) > > Build fixes: > > - Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF > devel files are not installed (Arnaldo Carvalho de Melo) > > - Do not try building jitdump on unsupported arches (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (3): > perf stat: Document CSV format in manpage > perf stat: Implement --metric-only mode > perf stat: Add --metric-only support for -A > > Arnaldo Carvalho de Melo (1): > perf jitdump: DWARF is also needed > > Chris Phlipot (1): > perf tools: Fix perf script python database export crash > > Jiri Olsa (3): > perf tools: Pass perf_hpp_list all the way through setup_sort_list > perf tools: Omit unnecessary cast in perf_pmu__parse_scale > perf jitdump: Build only on supported archs > > Namhyung Kim (10): > perf tools: Fix hist_entry__filter() for hierarchy > perf tools: Add more sort entry check functions > perf tools: Fix command line filters in hierarchy mode > perf tools: Remove hist_entry->fmt field > perf hists browser: Cleanup hist_browser__fprintf_hierarchy_entry() > perf tools: Remove nr_sort_keys field > perf tools: Recalc total periods using top-level entries in hierarchy > perf tools: Add sort__has_comm variable > perf hists browser: Allow thread filtering for comm sort key > perf hists browser: Check sort keys before hot key actions > > Steven Rostedt (1): > tools lib traceevent: Add '~' operation within arg_num_eval() > > tools/lib/traceevent/event-parse.c | 6 + > tools/perf/Documentation/perf-stat.txt | 27 ++++ > tools/perf/arch/arm/Makefile | 1 + > tools/perf/arch/arm64/Makefile | 1 + > tools/perf/arch/powerpc/Makefile | 1 + > tools/perf/arch/x86/Makefile | 1 + > tools/perf/builtin-inject.c | 12 +- > tools/perf/builtin-stat.c | 244 +++++++++++++++++++++++++++++++-- > tools/perf/config/Makefile | 7 + > tools/perf/ui/browsers/hists.c | 73 ++++++---- > tools/perf/ui/hist.c | 3 - > tools/perf/util/Build | 3 + > tools/perf/util/evsel.h | 6 +- > tools/perf/util/hist.c | 144 +++++++++++++++++-- > tools/perf/util/hist.h | 6 +- > tools/perf/util/pmu.c | 4 +- > tools/perf/util/sort.c | 147 +++++++++----------- > tools/perf/util/sort.h | 2 +- > 18 files changed, 542 insertions(+), 146 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-02-26 23:18 Arnaldo Carvalho de Melo 2016-02-27 9:36 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-26 23:18 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, Li Zefan, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Stephane Eranian, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 06466212a69c0511c5dcff7363c207ffc8913731: Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-25 08:20:56 +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-20160226 for you to fetch changes up to 1d6c9407d45dd622b277ca9f725da3cc9e95b5de: perf trace: Print content of bpf-output event (2016-02-26 19:57:07 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Show extra line telling no entries below --percent-limit are at that --hierarchy level (Namhyung Kim) - 'perf report/top --hierarchy' assorted alignment fixes (Namhyung Kim) - Handle empty print fmts in 'perf script -s' i.e. when running python or perl scripts (Taeung Song) - Improve support for bpf-output events in 'perf trace' (Wang Nan) - Fix parsing of pmu events with empty list of modifiers, this cures a perf/core-only regression where '-e intel_pt//' got broken (Arnaldo Carvalho de Melo) Infrastructure: - Improve missing OpenJDK devel files error message in jvmti Makefile (Stephane Eranian) - Remove duplicated code and needless script_spec__findnew() (Taeung Song) - Bring perf_default_config to the very beginning at main(), removing the need for each subcommand to do this (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf tools: Use asprintf() for simple string formatting/allocation perf tools: Fix parsing of pmu events with empty list of modifiers Namhyung Kim (10): perf hists: Add more helper functions for the hierarchy mode perf report: Show message for percent limit on stdio perf hists browser: Cleanup hist_browser__update_percent_limit() perf hists browser: Show message for percent limit perf report: Show message for percent limit on gtk perf hists: Fix comparing of dynamic entries perf report: Fix indentation of dynamic entries in hierarchy perf report: Left align dynamic entries in hierarchy perf hists: Fix dynamic entry display in hierarchy perf report: Update column width of dynamic entries Stephane Eranian (1): perf jvmti: improve error message in Makefile Taeung Song (2): perf script: Exception handling when the print fmt is empty perf script: Remove duplicated code and needless script_spec__findnew() Wang Nan (4): perf config: Bring perf_default_config to the very beginning at main() perf tools: Only set filter for tracepoints events perf trace: Call bpf__apply_obj_config in 'perf trace' perf trace: Print content of bpf-output event tools/perf/builtin-diff.c | 2 - tools/perf/builtin-help.c | 2 +- tools/perf/builtin-kmem.c | 4 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-script.c | 21 +--- tools/perf/builtin-top.c | 4 +- tools/perf/builtin-trace.c | 46 +++++++- tools/perf/jvmti/Makefile | 17 ++- tools/perf/perf.c | 16 ++- tools/perf/tests/llvm.c | 8 -- tools/perf/ui/browsers/hists.c | 128 +++++++++++++++++++-- tools/perf/ui/gtk/hists.c | 11 ++ tools/perf/ui/hist.c | 22 ++++ tools/perf/ui/stdio/hist.c | 49 ++++++-- tools/perf/util/color.c | 5 +- tools/perf/util/data-convert-bt.c | 2 +- tools/perf/util/evlist.c | 3 + tools/perf/util/help-unknown-cmd.c | 5 +- tools/perf/util/hist.c | 48 +++++++- tools/perf/util/hist.h | 4 + tools/perf/util/parse-events.y | 6 +- .../perf/util/scripting-engines/trace-event-perl.c | 3 + .../util/scripting-engines/trace-event-python.c | 3 + tools/perf/util/sort.c | 30 ++++- tools/perf/util/sort.h | 1 + 25 files changed, 363 insertions(+), 79 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-02-26 23:18 Arnaldo Carvalho de Melo @ 2016-02-27 9:36 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-02-27 9:36 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, Li Zefan, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Stephane Eranian, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 06466212a69c0511c5dcff7363c207ffc8913731: > > Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-25 08:20:56 +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-20160226 > > for you to fetch changes up to 1d6c9407d45dd622b277ca9f725da3cc9e95b5de: > > perf trace: Print content of bpf-output event (2016-02-26 19:57:07 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Show extra line telling no entries below --percent-limit are > at that --hierarchy level (Namhyung Kim) > > - 'perf report/top --hierarchy' assorted alignment fixes (Namhyung Kim) > > - Handle empty print fmts in 'perf script -s' i.e. when running > python or perl scripts (Taeung Song) > > - Improve support for bpf-output events in 'perf trace' (Wang Nan) > > - Fix parsing of pmu events with empty list of modifiers, this > cures a perf/core-only regression where '-e intel_pt//' got > broken (Arnaldo Carvalho de Melo) > > Infrastructure: > > - Improve missing OpenJDK devel files error message in jvmti > Makefile (Stephane Eranian) > > - Remove duplicated code and needless script_spec__findnew() (Taeung Song) > > - Bring perf_default_config to the very beginning at main(), removing > the need for each subcommand to do this (Wang Nan) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > perf tools: Use asprintf() for simple string formatting/allocation > perf tools: Fix parsing of pmu events with empty list of modifiers > > Namhyung Kim (10): > perf hists: Add more helper functions for the hierarchy mode > perf report: Show message for percent limit on stdio > perf hists browser: Cleanup hist_browser__update_percent_limit() > perf hists browser: Show message for percent limit > perf report: Show message for percent limit on gtk > perf hists: Fix comparing of dynamic entries > perf report: Fix indentation of dynamic entries in hierarchy > perf report: Left align dynamic entries in hierarchy > perf hists: Fix dynamic entry display in hierarchy > perf report: Update column width of dynamic entries > > Stephane Eranian (1): > perf jvmti: improve error message in Makefile > > Taeung Song (2): > perf script: Exception handling when the print fmt is empty > perf script: Remove duplicated code and needless script_spec__findnew() > > Wang Nan (4): > perf config: Bring perf_default_config to the very beginning at main() > perf tools: Only set filter for tracepoints events > perf trace: Call bpf__apply_obj_config in 'perf trace' > perf trace: Print content of bpf-output event > > tools/perf/builtin-diff.c | 2 - > tools/perf/builtin-help.c | 2 +- > tools/perf/builtin-kmem.c | 4 +- > tools/perf/builtin-report.c | 2 +- > tools/perf/builtin-script.c | 21 +--- > tools/perf/builtin-top.c | 4 +- > tools/perf/builtin-trace.c | 46 +++++++- > tools/perf/jvmti/Makefile | 17 ++- > tools/perf/perf.c | 16 ++- > tools/perf/tests/llvm.c | 8 -- > tools/perf/ui/browsers/hists.c | 128 +++++++++++++++++++-- > tools/perf/ui/gtk/hists.c | 11 ++ > tools/perf/ui/hist.c | 22 ++++ > tools/perf/ui/stdio/hist.c | 49 ++++++-- > tools/perf/util/color.c | 5 +- > tools/perf/util/data-convert-bt.c | 2 +- > tools/perf/util/evlist.c | 3 + > tools/perf/util/help-unknown-cmd.c | 5 +- > tools/perf/util/hist.c | 48 +++++++- > tools/perf/util/hist.h | 4 + > tools/perf/util/parse-events.y | 6 +- > .../perf/util/scripting-engines/trace-event-perl.c | 3 + > .../util/scripting-engines/trace-event-python.c | 3 + > tools/perf/util/sort.c | 30 ++++- > tools/perf/util/sort.h | 1 + > 25 files changed, 363 insertions(+), 79 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2015-04-08 14:23 Arnaldo Carvalho de Melo 2015-04-08 15:05 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-04-08 14:23 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrew Morton, Borislav Petkov, David Ahern, Frederic Weisbecker, He Kuang, H. Peter Anvin, Jiri Olsa, John Stultz, Joonsoo Kim, Kaixu Xia, Kan Liang, Linus Torvalds, linux-mm, Markus T Metzger, Masami Hiramatsu, Mathieu Poirier, Mike Galbraith, Minchan Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Robert Richter, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, William Cohen, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, it is the pull req from yesterday, minus a patch that introduced a problem, plus a fex fixes. I am investigating a problem I noticed for another patch that is upstream and after that will get back to the removed patch from yesterday's batch, - Arnaldo The following changes since commit 6645f3187f5beb64f7a40515cfa18f3889264ece: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-04-03 07:00:02 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo for you to fetch changes up to a1e12da4796a4ddd0e911687a290eb396d1c64bf: perf tools: Add 'I' event modifier for exclude_idle bit (2015-04-08 11:00:16 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Teach about perf_event_attr.clockid to 'perf record' (Peter Zijlstra) - perf sched replay improvements for high CPU core count machines (Yunlong Song) - Consider PERF_RECORD_ events with cpumode == 0 in 'perf top', removing one cause of long term memory usage buildup, i.e. not processing PERF_RECORD_EXIT events (Arnaldo Carvalho de Melo) - Add 'I' event modifier for perf_event_attr.exclude_idle bit (Jiri Olsa) - Respect -i option 'in perf kmem' (Jiri Olsa) Infrastructure: - Honor operator priority in libtraceevent (Namhyung Kim) - Merge all perf_event_attr print functions (Peter Zijlstra) - Check kmaps access to make code more robust (Wang Nan) - Fix inverted logic in perf_mmap__empty() (He Kuang) - Fix ARM 32 'perf probe' building error (Wang Nan) - Fix perf_event_attr tests (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- He Kuang (1): perf evlist: Fix inverted logic in perf_mmap__empty Jiri Olsa (3): perf kmem: Respect -i option perf tests: Fix attr tests perf tools: Add 'I' event modifier for exclude_idle bit Namhyung Kim (1): tools lib traceevent: Honor operator priority Peter Zijlstra (2): perf record: Add clockid parameter perf tools: Merge all perf_event_attr print functions Wang Nan (3): perf kmaps: Check kmaps to make code more robust perf probe: Fix ARM 32 building error perf report: Don't call map__kmap if map is NULL. Yunlong Song (9): perf sched replay: Use struct task_desc instead of struct task_task for correct meaning perf sched replay: Increase the MAX_PID value to fix assertion failure problem perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max perf sched replay: Realloc the memory of pid_to_task stepwise to adapt to the different pid_max configurations perf sched replay: Fix the segmentation fault problem caused by pr_err in threads perf sched replay: Handle the dead halt of sem_wait when create_tasks() fails for any task perf sched replay: Fix the EMFILE error caused by the limitation of the maximum open files perf sched replay: Support using -f to override perf.data file ownership perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10 tools/lib/traceevent/event-parse.c | 17 +- tools/perf/Documentation/perf-list.txt | 1 + tools/perf/Documentation/perf-record.txt | 7 + tools/perf/builtin-kmem.c | 3 +- tools/perf/builtin-record.c | 87 +++++++++ tools/perf/builtin-report.c | 2 +- tools/perf/builtin-sched.c | 67 +++++-- tools/perf/perf.h | 2 + tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/base-stat | 2 +- tools/perf/tests/parse-events.c | 40 ++++ tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 325 ++++++++++++++++--------------- tools/perf/util/evsel.h | 6 + tools/perf/util/header.c | 28 +-- tools/perf/util/machine.c | 5 +- tools/perf/util/map.c | 20 ++ tools/perf/util/map.h | 6 +- tools/perf/util/parse-events.c | 8 +- tools/perf/util/parse-events.l | 2 +- tools/perf/util/probe-event.c | 5 +- tools/perf/util/session.c | 3 + tools/perf/util/symbol-elf.c | 16 +- tools/perf/util/symbol.c | 34 +++- 24 files changed, 477 insertions(+), 213 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2015-04-08 14:23 Arnaldo Carvalho de Melo @ 2015-04-08 15:05 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2015-04-08 15:05 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrew Morton, Borislav Petkov, David Ahern, Frederic Weisbecker, He Kuang, H. Peter Anvin, Jiri Olsa, John Stultz, Joonsoo Kim, Kaixu Xia, Kan Liang, Linus Torvalds, linux-mm, Markus T Metzger, Masami Hiramatsu, Mathieu Poirier, Mike Galbraith, Minchan Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Robert Richter, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, William Cohen, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, it is the pull req from yesterday, minus a patch > that introduced a problem, plus a fex fixes. > > I am investigating a problem I noticed for another patch that is upstream > and after that will get back to the removed patch from yesterday's batch, > > - Arnaldo > > The following changes since commit 6645f3187f5beb64f7a40515cfa18f3889264ece: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-04-03 07:00:02 +0200) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo > > for you to fetch changes up to a1e12da4796a4ddd0e911687a290eb396d1c64bf: > > perf tools: Add 'I' event modifier for exclude_idle bit (2015-04-08 11:00:16 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Teach about perf_event_attr.clockid to 'perf record' (Peter Zijlstra) > > - perf sched replay improvements for high CPU core count machines (Yunlong Song) > > - Consider PERF_RECORD_ events with cpumode == 0 in 'perf top', removing one > cause of long term memory usage buildup, i.e. not processing PERF_RECORD_EXIT > events (Arnaldo Carvalho de Melo) > > - Add 'I' event modifier for perf_event_attr.exclude_idle bit (Jiri Olsa) > > - Respect -i option 'in perf kmem' (Jiri Olsa) > > Infrastructure: > > - Honor operator priority in libtraceevent (Namhyung Kim) > > - Merge all perf_event_attr print functions (Peter Zijlstra) > > - Check kmaps access to make code more robust (Wang Nan) > > - Fix inverted logic in perf_mmap__empty() (He Kuang) > > - Fix ARM 32 'perf probe' building error (Wang Nan) > > - Fix perf_event_attr tests (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > He Kuang (1): > perf evlist: Fix inverted logic in perf_mmap__empty > > Jiri Olsa (3): > perf kmem: Respect -i option > perf tests: Fix attr tests > perf tools: Add 'I' event modifier for exclude_idle bit > > Namhyung Kim (1): > tools lib traceevent: Honor operator priority > > Peter Zijlstra (2): > perf record: Add clockid parameter > perf tools: Merge all perf_event_attr print functions > > Wang Nan (3): > perf kmaps: Check kmaps to make code more robust > perf probe: Fix ARM 32 building error > perf report: Don't call map__kmap if map is NULL. > > Yunlong Song (9): > perf sched replay: Use struct task_desc instead of struct task_task for correct meaning > perf sched replay: Increase the MAX_PID value to fix assertion failure problem > perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max > perf sched replay: Realloc the memory of pid_to_task stepwise to adapt to the different pid_max configurations > perf sched replay: Fix the segmentation fault problem caused by pr_err in threads > perf sched replay: Handle the dead halt of sem_wait when create_tasks() fails for any task > perf sched replay: Fix the EMFILE error caused by the limitation of the maximum open files > perf sched replay: Support using -f to override perf.data file ownership > perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10 > > tools/lib/traceevent/event-parse.c | 17 +- > tools/perf/Documentation/perf-list.txt | 1 + > tools/perf/Documentation/perf-record.txt | 7 + > tools/perf/builtin-kmem.c | 3 +- > tools/perf/builtin-record.c | 87 +++++++++ > tools/perf/builtin-report.c | 2 +- > tools/perf/builtin-sched.c | 67 +++++-- > tools/perf/perf.h | 2 + > tools/perf/tests/attr/base-record | 2 +- > tools/perf/tests/attr/base-stat | 2 +- > tools/perf/tests/parse-events.c | 40 ++++ > tools/perf/util/evlist.c | 2 +- > tools/perf/util/evsel.c | 325 ++++++++++++++++--------------- > tools/perf/util/evsel.h | 6 + > tools/perf/util/header.c | 28 +-- > tools/perf/util/machine.c | 5 +- > tools/perf/util/map.c | 20 ++ > tools/perf/util/map.h | 6 +- > tools/perf/util/parse-events.c | 8 +- > tools/perf/util/parse-events.l | 2 +- > tools/perf/util/probe-event.c | 5 +- > tools/perf/util/session.c | 3 + > tools/perf/util/symbol-elf.c | 16 +- > tools/perf/util/symbol.c | 34 +++- > 24 files changed, 477 insertions(+), 213 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2015-03-21 18:54 Arnaldo Carvalho de Melo 2015-03-22 9:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-03-21 18:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Borislav Petkov, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu, Mike Galbraith, Milos Vyletel, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt, Wang Nan, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, this is on top of my previous pull request, Thanks, - Arnaldo The following changes since commit 0c8c20779c5d56b93b8cb4cd30ba129a927ab437: perf report: Don't allow empty argument for '-t'. (2015-03-19 13:53:28 -0300) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-2 for you to fetch changes up to ca33380adf74afb985bf7aab09ec46707a5d2d57: perf tools: Use kmod_path__parse for machine__new_dso (2015-03-21 14:58:07 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo) - Indicate which callchain entries are annotated in the TUI hists browser (report/top) (Arnaldo Carvalho de Melo) - Fix failure to add multiple probes without debuginfo (He Kuang) - Fix 'trace' summary_only option (David Ahern) - Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel) - Don't allow empty argument for field-separator, fixing segfault (Wang Nan) Infrastructure: - Add destructor for format_field in libtraceevent (David Ahern) - Prep work for support lzma compressed kernel modules (Jiri Olsa) - Update .gitignore with recently added/renamed feature detection files (Yunlong Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf trace: Handle legacy syscalls tracepoints perf hists browser: Indicate which callchain entries are annotated David Ahern (2): perf trace: Fix summary_only option tools lib traceevent: Add destructor for format_field He Kuang (1): perf probe: Fix failure to add multiple probes without debuginfo Jiri Olsa (10): perf build: Fix feature_check name clash perf build: Separate feature make support into config/Makefile.feature perf build: Make features checks directory configurable perf build: Move feature checks code under tools/build tools build: Add feature check for lzma library perf tools: Add lzma decompression support for kernel module perf tools: Add kmod_path__parse function perf tools: Add dsos__addnew function perf tools: Add machine__module_dso function perf tools: Use kmod_path__parse for machine__new_dso Milos Vyletel (1): perf tools: Fix race in build_id_cache__add_s() Wang Nan (1): perf tools: Don't allow empty argument for field-separator Yunlong Song (2): perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file perf build: Add config/feature-checks/*.output to the .gitignore file tools/build/Makefile.feature | 171 ++++++++++++++++++++ .../feature-checks => build/feature}/.gitignore | 1 + .../feature-checks => build/feature}/Makefile | 8 +- .../feature-checks => build/feature}/test-all.c | 5 + .../feature}/test-backtrace.c | 0 .../feature-checks => build/feature}/test-bionic.c | 0 .../feature}/test-compile.c | 0 .../feature}/test-cplus-demangle.c | 0 .../feature-checks => build/feature}/test-dwarf.c | 0 .../feature}/test-fortify-source.c | 0 .../feature-checks => build/feature}/test-glibc.c | 0 .../feature}/test-gtk2-infobar.c | 0 .../feature-checks => build/feature}/test-gtk2.c | 0 .../feature-checks => build/feature}/test-hello.c | 0 .../feature}/test-libaudit.c | 0 .../feature}/test-libbabeltrace.c | 0 .../feature-checks => build/feature}/test-libbfd.c | 0 .../feature}/test-libdw-dwarf-unwind.c | 0 .../feature}/test-libelf-getphdrnum.c | 0 .../feature}/test-libelf-mmap.c | 0 .../feature-checks => build/feature}/test-libelf.c | 0 .../feature}/test-libnuma.c | 0 .../feature}/test-libperl.c | 0 .../feature}/test-libpython-version.c | 0 .../feature}/test-libpython.c | 0 .../feature}/test-libslang.c | 0 .../feature}/test-libunwind-debug-frame.c | 0 .../feature}/test-libunwind.c | 0 tools/build/feature/test-lzma.c | 10 ++ .../feature}/test-pthread-attr-setaffinity-np.c | 0 .../feature}/test-stackprotector-all.c | 0 .../feature}/test-sync-compare-and-swap.c | 0 .../feature}/test-timerfd.c | 0 .../feature-checks => build/feature}/test-zlib.c | 0 tools/lib/traceevent/event-parse.c | 11 +- tools/lib/traceevent/event-parse.h | 1 + tools/perf/.gitignore | 2 +- tools/perf/Makefile.perf | 4 +- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-trace.c | 21 ++- tools/perf/config/Makefile | 176 ++------------------- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/kmod-path.c | 73 +++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/hists.c | 4 +- tools/perf/util/Build | 1 + tools/perf/util/build-id.c | 3 +- tools/perf/util/dso.c | 90 +++++++++-- tools/perf/util/dso.h | 15 ++ tools/perf/util/lzma.c | 95 +++++++++++ tools/perf/util/machine.c | 83 +++++----- tools/perf/util/probe-event.c | 4 +- tools/perf/util/util.h | 4 + 55 files changed, 557 insertions(+), 235 deletions(-) create mode 100644 tools/build/Makefile.feature rename tools/{perf/config/feature-checks => build/feature}/.gitignore (52%) rename tools/{perf/config/feature-checks => build/feature}/Makefile (96%) rename tools/{perf/config/feature-checks => build/feature}/test-all.c (97%) rename tools/{perf/config/feature-checks => build/feature}/test-backtrace.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-bionic.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-compile.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-cplus-demangle.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-dwarf.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-fortify-source.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-glibc.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-gtk2-infobar.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-gtk2.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-hello.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libaudit.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libbabeltrace.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libbfd.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libdw-dwarf-unwind.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libelf-getphdrnum.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libelf-mmap.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libelf.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libnuma.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libperl.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libpython-version.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libpython.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libslang.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libunwind-debug-frame.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libunwind.c (100%) create mode 100644 tools/build/feature/test-lzma.c rename tools/{perf/config/feature-checks => build/feature}/test-pthread-attr-setaffinity-np.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-stackprotector-all.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-sync-compare-and-swap.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-timerfd.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-zlib.c (100%) create mode 100644 tools/perf/tests/kmod-path.c create mode 100644 tools/perf/util/lzma.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2015-03-21 18:54 Arnaldo Carvalho de Melo @ 2015-03-22 9:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2015-03-22 9:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Borislav Petkov, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu, Mike Galbraith, Milos Vyletel, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt, Wang Nan, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, this is on top of my previous pull request, > > Thanks, > > - Arnaldo > > The following changes since commit 0c8c20779c5d56b93b8cb4cd30ba129a927ab437: > > perf report: Don't allow empty argument for '-t'. (2015-03-19 13:53:28 -0300) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-2 > > for you to fetch changes up to ca33380adf74afb985bf7aab09ec46707a5d2d57: > > perf tools: Use kmod_path__parse for machine__new_dso (2015-03-21 14:58:07 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo) > > - Indicate which callchain entries are annotated in the > TUI hists browser (report/top) (Arnaldo Carvalho de Melo) > > - Fix failure to add multiple probes without debuginfo (He Kuang) > > - Fix 'trace' summary_only option (David Ahern) > > - Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel) > > - Don't allow empty argument for field-separator, fixing segfault (Wang Nan) > > Infrastructure: > > - Add destructor for format_field in libtraceevent (David Ahern) > > - Prep work for support lzma compressed kernel modules (Jiri Olsa) > > - Update .gitignore with recently added/renamed feature detection files (Yunlong Song) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > perf trace: Handle legacy syscalls tracepoints > perf hists browser: Indicate which callchain entries are annotated > > David Ahern (2): > perf trace: Fix summary_only option > tools lib traceevent: Add destructor for format_field > > He Kuang (1): > perf probe: Fix failure to add multiple probes without debuginfo > > Jiri Olsa (10): > perf build: Fix feature_check name clash > perf build: Separate feature make support into config/Makefile.feature > perf build: Make features checks directory configurable > perf build: Move feature checks code under tools/build > tools build: Add feature check for lzma library > perf tools: Add lzma decompression support for kernel module > perf tools: Add kmod_path__parse function > perf tools: Add dsos__addnew function > perf tools: Add machine__module_dso function > perf tools: Use kmod_path__parse for machine__new_dso > > Milos Vyletel (1): > perf tools: Fix race in build_id_cache__add_s() > > Wang Nan (1): > perf tools: Don't allow empty argument for field-separator > > Yunlong Song (2): > perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file > perf build: Add config/feature-checks/*.output to the .gitignore file > > tools/build/Makefile.feature | 171 ++++++++++++++++++++ > .../feature-checks => build/feature}/.gitignore | 1 + > .../feature-checks => build/feature}/Makefile | 8 +- > .../feature-checks => build/feature}/test-all.c | 5 + > .../feature}/test-backtrace.c | 0 > .../feature-checks => build/feature}/test-bionic.c | 0 > .../feature}/test-compile.c | 0 > .../feature}/test-cplus-demangle.c | 0 > .../feature-checks => build/feature}/test-dwarf.c | 0 > .../feature}/test-fortify-source.c | 0 > .../feature-checks => build/feature}/test-glibc.c | 0 > .../feature}/test-gtk2-infobar.c | 0 > .../feature-checks => build/feature}/test-gtk2.c | 0 > .../feature-checks => build/feature}/test-hello.c | 0 > .../feature}/test-libaudit.c | 0 > .../feature}/test-libbabeltrace.c | 0 > .../feature-checks => build/feature}/test-libbfd.c | 0 > .../feature}/test-libdw-dwarf-unwind.c | 0 > .../feature}/test-libelf-getphdrnum.c | 0 > .../feature}/test-libelf-mmap.c | 0 > .../feature-checks => build/feature}/test-libelf.c | 0 > .../feature}/test-libnuma.c | 0 > .../feature}/test-libperl.c | 0 > .../feature}/test-libpython-version.c | 0 > .../feature}/test-libpython.c | 0 > .../feature}/test-libslang.c | 0 > .../feature}/test-libunwind-debug-frame.c | 0 > .../feature}/test-libunwind.c | 0 > tools/build/feature/test-lzma.c | 10 ++ > .../feature}/test-pthread-attr-setaffinity-np.c | 0 > .../feature}/test-stackprotector-all.c | 0 > .../feature}/test-sync-compare-and-swap.c | 0 > .../feature}/test-timerfd.c | 0 > .../feature-checks => build/feature}/test-zlib.c | 0 > tools/lib/traceevent/event-parse.c | 11 +- > tools/lib/traceevent/event-parse.h | 1 + > tools/perf/.gitignore | 2 +- > tools/perf/Makefile.perf | 4 +- > tools/perf/builtin-diff.c | 2 +- > tools/perf/builtin-mem.c | 2 +- > tools/perf/builtin-trace.c | 21 ++- > tools/perf/config/Makefile | 176 ++------------------- > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/kmod-path.c | 73 +++++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/ui/browsers/hists.c | 4 +- > tools/perf/util/Build | 1 + > tools/perf/util/build-id.c | 3 +- > tools/perf/util/dso.c | 90 +++++++++-- > tools/perf/util/dso.h | 15 ++ > tools/perf/util/lzma.c | 95 +++++++++++ > tools/perf/util/machine.c | 83 +++++----- > tools/perf/util/probe-event.c | 4 +- > tools/perf/util/util.h | 4 + > 55 files changed, 557 insertions(+), 235 deletions(-) > create mode 100644 tools/build/Makefile.feature > rename tools/{perf/config/feature-checks => build/feature}/.gitignore (52%) > rename tools/{perf/config/feature-checks => build/feature}/Makefile (96%) > rename tools/{perf/config/feature-checks => build/feature}/test-all.c (97%) > rename tools/{perf/config/feature-checks => build/feature}/test-backtrace.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-bionic.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-compile.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-cplus-demangle.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-dwarf.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-fortify-source.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-glibc.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-gtk2-infobar.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-gtk2.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-hello.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libaudit.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libbabeltrace.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libbfd.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libdw-dwarf-unwind.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libelf-getphdrnum.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libelf-mmap.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libelf.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libnuma.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libperl.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libpython-version.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libpython.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libslang.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libunwind-debug-frame.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libunwind.c (100%) > create mode 100644 tools/build/feature/test-lzma.c > rename tools/{perf/config/feature-checks => build/feature}/test-pthread-attr-setaffinity-np.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-stackprotector-all.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-sync-compare-and-swap.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-timerfd.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-zlib.c (100%) > create mode 100644 tools/perf/tests/kmod-path.c > create mode 100644 tools/perf/util/lzma.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2015-02-27 19:22 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-02-27 19:22 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Paul Mackerras, Peter Zijlstra, Wang Nan, Yunlong Song, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 0afb1704010f60e7ae85aef0f93fc10f2d99761e: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-02-26 12:25:20 +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 for you to fetch changes up to fefd2d9619de3bf0bf02a8622e9f445c3d19cc3f: perf report: Fix branch stack mode cannot be set (2015-02-27 15:52:42 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Fix SIGBUS failures due to misaligned accesses in Sparc64 (David Ahern) - Fix branch stack mode in 'perf report' (He Kuang) - Fix a 'perf probe' operator precedence bug (He Kuang) - Fix Support for different binaries with same name in 'perf diff' (Kan Liang) - Check kprobes blacklist when adding new events via 'perf probe' (Masami Hiramatsu) - Add --purge FILE to remove all caches of FILE in 'perf buildid-cache' (Masami Hiramatsu) - Show usage with some incorrect params (Masami Hiramatsu) - Add new buildid cache if update target is not cached in 'buildid-cache' (Masami Hiramatsu) - Allow listing events with 'tracepoint' prefix in 'perf list' (Yunlong Song) - Sort the output of 'perf list' (Yunlong Song) - Fix bash completion of 'perf --' (Yunlong Song) Developer Zone: - Handle strdup() failure path in 'perf probe' (Arnaldo Carvalho de Melo) - Fix get_real_path to free allocated memory in error path in 'perf probe' (Masami Hiramatsu) - Use pr_debug instead of verbose && pr_info perf buildid-cache (Masami Hiramatsu) - Fix building of 'perf data' with some gcc versions due to incorrect array struct entry (Yunlong Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (1): perf probe: Handle strdup() failure David Ahern (1): perf trace: Fix SIGBUS failures due to misaligned accesses He Kuang (2): perf probe: Fix a precedence bug perf report: Fix branch stack mode cannot be set Kan Liang (1): perf diff: Support for different binaries Masami Hiramatsu (6): perf probe: Check kprobes blacklist when adding new events perf probe: Fix get_real_path to free allocated memory in error path perf buildid-cache: Add new buildid cache if update target is not cached perf buildid-cache: Add --purge FILE to remove all caches of FILE perf buildid-cache: Use pr_debug instead of verbose && pr_info perf buildid-cache: Show usage with incorrect params Yunlong Song (8): perf data: Fix sentinel setting for data_cmds array perf list: Sort the output of 'perf list' to view more clearly perf list: Allow listing events with 'tracepoint' prefix perf list: Avoid confusion of perf output and the next command prompt perf tools: Remove the '--(null)' long_name for --list-opts perf list: Clean up the printing functions of hardware/software events perf list: Extend raw-dump to certain kind of events perf tools: Fix the bash completion problem of 'perf --*' tools/perf/Documentation/perf-buildid-cache.txt | 24 ++- tools/perf/Documentation/perf-diff.txt | 5 + tools/perf/Documentation/perf-list.txt | 6 + tools/perf/builtin-buildid-cache.c | 72 ++++++-- tools/perf/builtin-data.c | 2 +- tools/perf/builtin-list.c | 27 ++- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-trace.c | 36 +++- tools/perf/perf-completion.sh | 6 +- tools/perf/perf.c | 28 ++++ tools/perf/util/build-id.c | 105 ++++++++++-- tools/perf/util/build-id.h | 4 + tools/perf/util/parse-events.c | 210 +++++++++++++++++------- tools/perf/util/parse-events.h | 11 +- tools/perf/util/parse-options.c | 5 +- tools/perf/util/probe-event.c | 117 ++++++++++++- tools/perf/util/sort.c | 9 + 17 files changed, 542 insertions(+), 127 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2014-01-17 14:57 Arnaldo Carvalho de Melo 2014-01-19 12:11 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-01-17 14:57 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, David A. Long, Frederic Weisbecker, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Oleg Nesterov, Paul Mackerras, Peter Zijlstra, Srikar Dronamraju, Stephane Eranian, Steven Rostedt, yrl.pp-manager.tt, Arnaldo Carvalho de Melo From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 3e7e09dbd1080de5dcf10092830e39bc2e2932ec: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-16 09:34:01 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo for you to fetch changes up to 2a29190c040c0b11e39197c67abf6f87e0a61f9a: perf tools: Remove unnecessary callchain cursor state restore on unmatch (2014-01-17 11:25:24 -0300) ---------------------------------------------------------------- Developer stuff: . Improve callchain processing by removing unnecessary work. (Frederic Weisbecker) . Fix comm override error handling (Frederic Weisbecker) . Improve 'perf probe' exit path, release resources (Masami Hiramatsu) . Improve libtraceevent plugins exit path, allowing the registering of an unregister handler to be called at exit time (Namhyung Kim) . Add an alias to the build test makefile (make -C tools/perf build-test) (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Frederic Weisbecker (3): perf tools: Do proper comm override error handling perf callchain: Spare double comparison of callchain first entry perf tools: Remove unnecessary callchain cursor state restore on unmatch Masami Hiramatsu (3): perf probe: Release allocated probe_trace_event if failed perf probe: Release all dynamically allocated parameters perf symbols: Export elf_section_by_name and reuse Namhyung Kim (13): tools lib traceevent: Add pevent_unregister_event_handler() tools lib traceevent: Add pevent_unregister_print_function() tools lib traceevent: Unregister handler when function plugin is unloaded tools lib traceevent: Unregister handler when hrtimer plugin is unloaded tools lib traceevent: Unregister handler when kmem plugin is unloaded tools lib traceevent: Unregister handler when kvm plugin is unloaded tools lib traceevent: Unregister handler when sched_switch plugin is unloaded tools lib traceevent: Unregister handler when mac80211 plugin is unloaded tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded tools lib traceevent: Unregister handler when scsi plugin is unloaded tools lib traceevent: Unregister handler when xen plugin is unloaded perf tools: Add 'build-test' make target tools/lib/traceevent/event-parse.c | 136 ++++++++++++++++++++++++++--- tools/lib/traceevent/event-parse.h | 5 ++ tools/lib/traceevent/plugin_cfg80211.c | 6 ++ tools/lib/traceevent/plugin_function.c | 3 + tools/lib/traceevent/plugin_hrtimer.c | 10 +++ tools/lib/traceevent/plugin_jbd2.c | 9 ++ tools/lib/traceevent/plugin_kmem.c | 22 +++++ tools/lib/traceevent/plugin_kvm.c | 29 ++++++ tools/lib/traceevent/plugin_mac80211.c | 7 ++ tools/lib/traceevent/plugin_sched_switch.c | 12 +++ tools/lib/traceevent/plugin_scsi.c | 6 ++ tools/lib/traceevent/plugin_xen.c | 6 ++ tools/perf/Makefile | 6 ++ tools/perf/builtin-probe.c | 48 ++++++++-- tools/perf/util/callchain.c | 23 +++-- tools/perf/util/comm.c | 19 ++-- tools/perf/util/comm.h | 2 +- tools/perf/util/probe-event.c | 111 +++++++++++++---------- tools/perf/util/probe-event.h | 6 ++ tools/perf/util/symbol-elf.c | 5 +- tools/perf/util/symbol.h | 5 ++ tools/perf/util/thread.c | 5 +- tools/perf/util/unwind.c | 20 +---- 23 files changed, 389 insertions(+), 112 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2014-01-17 14:57 Arnaldo Carvalho de Melo @ 2014-01-19 12:11 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2014-01-19 12:11 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, David A. Long, Frederic Weisbecker, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Oleg Nesterov, Paul Mackerras, Peter Zijlstra, Srikar Dronamraju, Stephane Eranian, Steven Rostedt, yrl.pp-manager.tt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> > > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 3e7e09dbd1080de5dcf10092830e39bc2e2932ec: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-16 09:34:01 +0100) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo > > for you to fetch changes up to 2a29190c040c0b11e39197c67abf6f87e0a61f9a: > > perf tools: Remove unnecessary callchain cursor state restore on unmatch (2014-01-17 11:25:24 -0300) > > ---------------------------------------------------------------- > Developer stuff: > > . Improve callchain processing by removing unnecessary work. (Frederic Weisbecker) > > . Fix comm override error handling (Frederic Weisbecker) > > . Improve 'perf probe' exit path, release resources (Masami Hiramatsu) > > . Improve libtraceevent plugins exit path, allowing the registering of > an unregister handler to be called at exit time (Namhyung Kim) > > . Add an alias to the build test makefile (make -C tools/perf build-test) > (Namhyung Kim) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Frederic Weisbecker (3): > perf tools: Do proper comm override error handling > perf callchain: Spare double comparison of callchain first entry > perf tools: Remove unnecessary callchain cursor state restore on unmatch > > Masami Hiramatsu (3): > perf probe: Release allocated probe_trace_event if failed > perf probe: Release all dynamically allocated parameters > perf symbols: Export elf_section_by_name and reuse > > Namhyung Kim (13): > tools lib traceevent: Add pevent_unregister_event_handler() > tools lib traceevent: Add pevent_unregister_print_function() > tools lib traceevent: Unregister handler when function plugin is unloaded > tools lib traceevent: Unregister handler when hrtimer plugin is unloaded > tools lib traceevent: Unregister handler when kmem plugin is unloaded > tools lib traceevent: Unregister handler when kvm plugin is unloaded > tools lib traceevent: Unregister handler when sched_switch plugin is unloaded > tools lib traceevent: Unregister handler when mac80211 plugin is unloaded > tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded > tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded > tools lib traceevent: Unregister handler when scsi plugin is unloaded > tools lib traceevent: Unregister handler when xen plugin is unloaded > perf tools: Add 'build-test' make target > > tools/lib/traceevent/event-parse.c | 136 ++++++++++++++++++++++++++--- > tools/lib/traceevent/event-parse.h | 5 ++ > tools/lib/traceevent/plugin_cfg80211.c | 6 ++ > tools/lib/traceevent/plugin_function.c | 3 + > tools/lib/traceevent/plugin_hrtimer.c | 10 +++ > tools/lib/traceevent/plugin_jbd2.c | 9 ++ > tools/lib/traceevent/plugin_kmem.c | 22 +++++ > tools/lib/traceevent/plugin_kvm.c | 29 ++++++ > tools/lib/traceevent/plugin_mac80211.c | 7 ++ > tools/lib/traceevent/plugin_sched_switch.c | 12 +++ > tools/lib/traceevent/plugin_scsi.c | 6 ++ > tools/lib/traceevent/plugin_xen.c | 6 ++ > tools/perf/Makefile | 6 ++ > tools/perf/builtin-probe.c | 48 ++++++++-- > tools/perf/util/callchain.c | 23 +++-- > tools/perf/util/comm.c | 19 ++-- > tools/perf/util/comm.h | 2 +- > tools/perf/util/probe-event.c | 111 +++++++++++++---------- > tools/perf/util/probe-event.h | 6 ++ > tools/perf/util/symbol-elf.c | 5 +- > tools/perf/util/symbol.h | 5 ++ > tools/perf/util/thread.c | 5 +- > tools/perf/util/unwind.c | 20 +---- > 23 files changed, 389 insertions(+), 112 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2012-05-22 17:39 Arnaldo Carvalho de Melo 2012-05-23 15:06 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-05-22 17:39 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Anshuman Khandual, Corey Ashford, David Ahern, Frederic Weisbecker, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Tom Zanussi, arnaldo.melo, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 73787190d04a34e6da745da893b3ae8bedde418f: Merge branch 'perf/parse-events-4' of git://github.com/fweisbec/tracing into perf/core (2012-05-21 10:42:09 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core for you to fetch changes up to 26252ea675663d1bc6747125fcaa2b7cc4ed8a03: perf evlist: Show event attribute details (2012-05-22 14:30:11 -0300) ---------------------------------------------------------------- Fixes and improvements for perf/core: . Fix perf perl script build fallout from libtraceevent conversion, from Frederic Weisbecker. . Libtraceevent Makefile fixes, from Namhyung Kim . Pipe mode fixes, from Stephane Eranian . Event parsing improvements, from Jiri Olsa. . Endianness fixes, from Jiri Olsa . Bump the default sampling freq to 4 kHz, requested by Ingo Molnar. . Show event attribute details, such as the sampling freq, in the 'perf evlist' command. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Anshuman Khandual (1): perf record: Fix documentation for branch stack sampling Arnaldo Carvalho de Melo (2): perf tools: Bump default sample freq to 4 kHz perf evlist: Show event attribute details Frederic Weisbecker (2): perf script: Explicitly handle known default print arg type perf script: Rename struct event to struct event_format in perl engine Jiri Olsa (7): perf test: Move parse event automated tests to separated object perf tools: Add support for displaying event parser debug info perf tools: Use allocated list for each parsed event perf tools: Separate 'mem:' event scanner bits perf tools: Add hardcoded name term for pmu events perf tools: Carry perf_event_attr bitfield throught different endians perf tools: Add union u64_swap type for swapping u64 data Namhyung Kim (3): perf tools: Rename libparsevent to libtraceevent in Makefile perf tools: Always try to build libtraceevent perf target: Add cpu flag to sample_type if target has cpu Stephane Eranian (4): perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA perf inject: Fix broken perf inject -b perf tools: Fix piped mode read code perf buildid-list: Work better with pipe mode tools/perf/Documentation/perf-evlist.txt | 8 + tools/perf/Documentation/perf-record.txt | 2 +- tools/perf/Makefile | 37 +- tools/perf/builtin-buildid-list.c | 6 +- tools/perf/builtin-evlist.c | 103 +++- tools/perf/builtin-inject.c | 5 + tools/perf/builtin-record.c | 6 +- tools/perf/builtin-test.c | 552 +---------------- tools/perf/builtin-top.c | 5 +- tools/perf/util/build-id.c | 2 + tools/perf/util/evsel.c | 12 +- tools/perf/util/header.c | 10 +- tools/perf/util/header.h | 2 +- tools/perf/util/parse-events-test.c | 625 ++++++++++++++++++++ tools/perf/util/parse-events.c | 69 ++- tools/perf/util/parse-events.h | 20 +- tools/perf/util/parse-events.l | 26 +- tools/perf/util/parse-events.y | 77 ++- tools/perf/util/pmu.c | 4 +- .../perf/util/scripting-engines/trace-event-perl.c | 16 +- tools/perf/util/session.c | 68 ++- tools/perf/util/types.h | 5 + 22 files changed, 1002 insertions(+), 658 deletions(-) create mode 100644 tools/perf/util/parse-events-test.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2012-05-22 17:39 Arnaldo Carvalho de Melo @ 2012-05-23 15:06 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2012-05-23 15:06 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Anshuman Khandual, Corey Ashford, David Ahern, Frederic Weisbecker, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Tom Zanussi, arnaldo.melo, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 73787190d04a34e6da745da893b3ae8bedde418f: > > Merge branch 'perf/parse-events-4' of git://github.com/fweisbec/tracing into perf/core (2012-05-21 10:42:09 +0200) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core > > for you to fetch changes up to 26252ea675663d1bc6747125fcaa2b7cc4ed8a03: > > perf evlist: Show event attribute details (2012-05-22 14:30:11 -0300) > > ---------------------------------------------------------------- > Fixes and improvements for perf/core: > > . Fix perf perl script build fallout from libtraceevent conversion, > from Frederic Weisbecker. > > . Libtraceevent Makefile fixes, from Namhyung Kim > > . Pipe mode fixes, from Stephane Eranian > > . Event parsing improvements, from Jiri Olsa. > > . Endianness fixes, from Jiri Olsa > > . Bump the default sampling freq to 4 kHz, requested by Ingo Molnar. > > . Show event attribute details, such as the sampling freq, in the > 'perf evlist' command. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Anshuman Khandual (1): > perf record: Fix documentation for branch stack sampling > > Arnaldo Carvalho de Melo (2): > perf tools: Bump default sample freq to 4 kHz > perf evlist: Show event attribute details > > Frederic Weisbecker (2): > perf script: Explicitly handle known default print arg type > perf script: Rename struct event to struct event_format in perl engine > > Jiri Olsa (7): > perf test: Move parse event automated tests to separated object > perf tools: Add support for displaying event parser debug info > perf tools: Use allocated list for each parsed event > perf tools: Separate 'mem:' event scanner bits > perf tools: Add hardcoded name term for pmu events > perf tools: Carry perf_event_attr bitfield throught different endians > perf tools: Add union u64_swap type for swapping u64 data > > Namhyung Kim (3): > perf tools: Rename libparsevent to libtraceevent in Makefile > perf tools: Always try to build libtraceevent > perf target: Add cpu flag to sample_type if target has cpu > > Stephane Eranian (4): > perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA > perf inject: Fix broken perf inject -b > perf tools: Fix piped mode read code > perf buildid-list: Work better with pipe mode > > tools/perf/Documentation/perf-evlist.txt | 8 + > tools/perf/Documentation/perf-record.txt | 2 +- > tools/perf/Makefile | 37 +- > tools/perf/builtin-buildid-list.c | 6 +- > tools/perf/builtin-evlist.c | 103 +++- > tools/perf/builtin-inject.c | 5 + > tools/perf/builtin-record.c | 6 +- > tools/perf/builtin-test.c | 552 +---------------- > tools/perf/builtin-top.c | 5 +- > tools/perf/util/build-id.c | 2 + > tools/perf/util/evsel.c | 12 +- > tools/perf/util/header.c | 10 +- > tools/perf/util/header.h | 2 +- > tools/perf/util/parse-events-test.c | 625 ++++++++++++++++++++ > tools/perf/util/parse-events.c | 69 ++- > tools/perf/util/parse-events.h | 20 +- > tools/perf/util/parse-events.l | 26 +- > tools/perf/util/parse-events.y | 77 ++- > tools/perf/util/pmu.c | 4 +- > .../perf/util/scripting-engines/trace-event-perl.c | 16 +- > tools/perf/util/session.c | 68 ++- > tools/perf/util/types.h | 5 + > 22 files changed, 1002 insertions(+), 658 deletions(-) > create mode 100644 tools/perf/util/parse-events-test.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
end of thread, other threads:[~2017-11-03 13:55 UTC | newest] Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-02-05 16:25 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 01/19] perf build tests: Elide "-f Makefile" from make invokation Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 02/19] perf build tests: Move the feature related vars to the front of the make cmdline Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 03/19] perf config: Document 'ui.show-headers' variable in man page Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 04/19] perf config: Document variables for 'call-graph' section " Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 05/19] perf config: Document variables for 'report' " Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 06/19] perf config: Document 'top.children' variable " Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 07/19] perf config: Document 'man.viewer' " Arnaldo Carvalho de Melo 2016-02-05 16:25 ` [PATCH 08/19] perf config: Document 'pager.<subcommand>' variables " Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 09/19] perf config: Document 'kmem.default' variable " Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 10/19] perf config: Document 'record.build-id' " Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 11/19] perf tools: Fix parallel build including 'clean' target Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 12/19] perf build tests: Do parallell builds with 'build-test' Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 13/19] perf tools: handle spaces in file names obtained from /proc/pid/maps Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 14/19] perf symbols: add Java demangling support Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 15/19] perf build: Add libcrypto feature detection Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 16/19] perf inject: Make sure mmap records are ordered when injecting build_ids Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 17/19] perf inject: Add jitdump mmap injection support Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 18/19] perf tools: add JVMTI agent library Arnaldo Carvalho de Melo 2016-02-05 16:26 ` [PATCH 19/19] perf jit: add source line info support Arnaldo Carvalho de Melo 2016-02-09 9:40 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar -- strict thread matches above, loose matches on Subject: below -- 2017-11-03 13:54 Arnaldo Carvalho de Melo 2017-08-14 16:27 Arnaldo Carvalho de Melo 2017-08-14 17:39 ` Ingo Molnar 2017-08-14 17:52 ` Arnaldo Carvalho de Melo 2017-03-14 18:50 Arnaldo Carvalho de Melo 2017-03-15 18:29 ` Ingo Molnar 2016-12-01 18:02 Arnaldo Carvalho de Melo 2016-12-02 9:10 ` Ingo Molnar 2016-09-01 16:45 Arnaldo Carvalho de Melo 2016-09-05 13:16 ` Ingo Molnar 2016-07-14 2:20 Arnaldo Carvalho de Melo 2016-07-14 6:58 ` Ingo Molnar 2016-06-15 18:13 Arnaldo Carvalho de Melo 2016-06-16 6:29 ` Jiri Olsa 2016-06-16 19:54 ` Arnaldo Carvalho de Melo 2016-06-16 8:29 ` Ingo Molnar 2016-04-07 20:58 Arnaldo Carvalho de Melo 2016-04-08 13:15 ` Arnaldo Carvalho de Melo 2016-04-13 6:58 ` Ingo Molnar 2016-03-10 21:04 Arnaldo Carvalho de Melo 2016-03-11 8:43 ` Ingo Molnar 2016-02-26 23:18 Arnaldo Carvalho de Melo 2016-02-27 9:36 ` Ingo Molnar 2015-04-08 14:23 Arnaldo Carvalho de Melo 2015-04-08 15:05 ` Ingo Molnar 2015-03-21 18:54 Arnaldo Carvalho de Melo 2015-03-22 9:58 ` Ingo Molnar 2015-02-27 19:22 Arnaldo Carvalho de Melo 2014-01-17 14:57 Arnaldo Carvalho de Melo 2014-01-19 12:11 ` Ingo Molnar 2012-05-22 17:39 Arnaldo Carvalho de Melo 2012-05-23 15:06 ` Ingo Molnar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).