* [GIT PULL 00/20] perf/core improvements and fixes
@ 2012-07-05 15:44 Arnaldo Carvalho de Melo
2012-07-06 8:22 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-07-05 15:44 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa,
Johannes Berg, Namhyung Kim, Namhyung Kim, Namhyung Kim,
Paul Mackerras, Peter Huewe, Peter Zijlstra, Stephane Eranian,
Steven Rostedt, Ulrich Drepper, Wolfgang Mauerer, arnaldo.melo,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling, this one contains my first merge, a pull
request by Namhyung, please check if everything is OK,
Thanks,
- Arnaldo
The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3:
perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83:
Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
. Preparatory patches to use hw events in PMU syntax, from Jiri Olsa
. Remaining backport of trace-cmd's libparseevent, from Namhyung Kim
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core
Jiri Olsa (4):
perf test: Use ARRAY_SIZE in parse events tests
perf tools: Add empty rule for new line in event syntax parsing
perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
perf tools: Split event symbols arrays to hw and sw parts
Namhyung Kim (10):
tools lib traceevent: Fix printk_cmp()
tools lib traceevent: Introduce extend_token()
tools lib traceevent: Handle strdup failure cases
tools lib traceevent: Handle realloc() failure path
tools lib traceevent: Pass string type argument to args
tools lib traceevent: Do not call add_event() again if allocation failed
tools lib traceevent: Fix some comments
tools lib traceevent: Check result of malloc() during reading token
tools lib traceevent: Check return value of arg_to_str()
tools lib traceevent: Cleanup realloc use
Peter Huewe (1):
tools lib traceevent: Add missing break in make_bprint_args
Steven Rostedt (4):
tools lib traceevent: Let filtering numbers by string use function names
tools lib traceevent: Add support for "%.*s" in bprintk events
tools lib traceevent: Add support to show migrate disable counter
tools lib traceevent: Fix %pM print format arg handling
Wolfgang Mauerer (1):
tools lib traceevent: Fix trace_printk for long integers
tools/lib/traceevent/event-parse.c | 287 +++++++++++++++++++++++------------
tools/lib/traceevent/parse-filter.c | 86 +++++++----
tools/perf/util/parse-events-test.c | 29 ++--
tools/perf/util/parse-events.c | 174 ++++++++++++++-------
tools/perf/util/parse-events.l | 3 +-
tools/perf/util/parse-events.y | 15 +-
6 files changed, 391 insertions(+), 203 deletions(-)
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2012-07-05 15:44 Arnaldo Carvalho de Melo
@ 2012-07-06 8:22 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2012-07-06 8:22 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Borislav Petkov, Corey Ashford, David Ahern,
Frederic Weisbecker, Jiri Olsa, Johannes Berg, Namhyung Kim,
Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Huewe,
Peter Zijlstra, Stephane Eranian, Steven Rostedt, Ulrich Drepper,
Wolfgang Mauerer, arnaldo.melo, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> Hi Ingo,
>
> Please consider pulling, this one contains my first
> merge, a pull request by Namhyung, please check if everything
> is OK,
>
> Thanks,
>
> - Arnaldo
>
> The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3:
>
> perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
>
> for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83:
>
> Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300)
>
> ----------------------------------------------------------------
>
> perf/core improvements and fixes:
>
> . Preparatory patches to use hw events in PMU syntax, from Jiri Olsa
>
> . Remaining backport of trace-cmd's libparseevent, from Namhyung Kim
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
> Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core
>
> Jiri Olsa (4):
> perf test: Use ARRAY_SIZE in parse events tests
> perf tools: Add empty rule for new line in event syntax parsing
> perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
> perf tools: Split event symbols arrays to hw and sw parts
>
> Namhyung Kim (10):
> tools lib traceevent: Fix printk_cmp()
> tools lib traceevent: Introduce extend_token()
> tools lib traceevent: Handle strdup failure cases
> tools lib traceevent: Handle realloc() failure path
> tools lib traceevent: Pass string type argument to args
> tools lib traceevent: Do not call add_event() again if allocation failed
> tools lib traceevent: Fix some comments
> tools lib traceevent: Check result of malloc() during reading token
> tools lib traceevent: Check return value of arg_to_str()
> tools lib traceevent: Cleanup realloc use
>
> Peter Huewe (1):
> tools lib traceevent: Add missing break in make_bprint_args
>
> Steven Rostedt (4):
> tools lib traceevent: Let filtering numbers by string use function names
> tools lib traceevent: Add support for "%.*s" in bprintk events
> tools lib traceevent: Add support to show migrate disable counter
> tools lib traceevent: Fix %pM print format arg handling
>
> Wolfgang Mauerer (1):
> tools lib traceevent: Fix trace_printk for long integers
>
> tools/lib/traceevent/event-parse.c | 287 +++++++++++++++++++++++------------
> tools/lib/traceevent/parse-filter.c | 86 +++++++----
> tools/perf/util/parse-events-test.c | 29 ++--
> tools/perf/util/parse-events.c | 174 ++++++++++++++-------
> tools/perf/util/parse-events.l | 3 +-
> tools/perf/util/parse-events.y | 15 +-
> 6 files changed, 391 insertions(+), 203 deletions(-)
Pulled, thanks a lot Arnaldo! The commits from Namhyung Kim are
looking good as well.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2012-09-11 23:52 Arnaldo Carvalho de Melo
2012-09-13 15:15 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-09-11 23:52 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Mike Galbraith,
Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
Peter Zijlstra, Stephane Eranian, Steven Rostedt, arnaldo.melo,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
Best Regards,
- Arnaldo
The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99:
perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300)
----------------------------------------------------------------
perf/core improvements and fixes
. Remove die()/exit() calls from several tools.
. Add missing perf_regs.h file to MANIFEST
. Clean up and improve 'perf sched' performance by elliminating lots of
needless calls to libtraceevent.
. More patches to make perf build on Android, from Irina Tirdea
. Resolve vdso callchains, from Jiri Olsa
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (9):
perf test: Remove die() calls
perf sched: Remove die() calls
perf kmem: Remove die() calls
perf tools: Add missing perf_regs.h file to MANIFEST
perf sched: Remove unused thread parameter
perf sched: Use perf_tool as ancestor
perf evsel: Introduce perf_evsel__{str,int}val methods
perf sched: Use perf_evsel__{int,str}val
perf sched: Don't read all tracepoint variables in advance
Irina Tirdea (5):
perf tools: include wrapper for magic.h
perf tools: Update types definitions for Android
perf tools: include __WORDSIZE definition
perf tools: fix ALIGN redefinition in system headers
perf tools: Use __maybe_used for unused variables
Jiri Olsa (4):
perf tools: Do backtrace post unwind only if we regs and stack were captured
perf tools: Add memdup function
perf symbols: Make dsos__find function globally available
perf tools: Back [vdso] DSO with real data
tools/lib/traceevent/event-parse.c | 8 +-
tools/lib/traceevent/event-parse.h | 4 +-
tools/perf/MANIFEST | 1 +
tools/perf/Makefile | 3 +
tools/perf/bench/bench.h | 3 +-
tools/perf/bench/mem-memcpy.c | 2 +-
tools/perf/bench/mem-memset.c | 2 +-
tools/perf/bench/sched-messaging.c | 2 +-
tools/perf/bench/sched-pipe.c | 6 +-
tools/perf/builtin-annotate.c | 2 +-
tools/perf/builtin-bench.c | 2 +-
tools/perf/builtin-buildid-cache.c | 10 +-
tools/perf/builtin-buildid-list.c | 3 +-
tools/perf/builtin-diff.c | 4 +-
tools/perf/builtin-evlist.c | 2 +-
tools/perf/builtin-help.c | 2 +-
tools/perf/builtin-inject.c | 24 +-
tools/perf/builtin-kmem.c | 130 +-
tools/perf/builtin-kvm.c | 2 +-
tools/perf/builtin-list.c | 2 +-
tools/perf/builtin-lock.c | 4 +-
tools/perf/builtin-probe.c | 24 +-
tools/perf/builtin-record.c | 10 +-
tools/perf/builtin-report.c | 11 +-
tools/perf/builtin-sched.c | 1446 +++++++++-----------
tools/perf/builtin-script.c | 29 +-
tools/perf/builtin-stat.c | 40 +-
tools/perf/builtin-test.c | 23 +-
tools/perf/builtin-timechart.c | 30 +-
tools/perf/builtin-top.c | 7 +-
tools/perf/ui/browser.c | 7 +-
tools/perf/ui/browsers/annotate.c | 6 +-
tools/perf/ui/gtk/browser.c | 5 +-
tools/perf/ui/gtk/setup.c | 2 +-
tools/perf/ui/gtk/util.c | 4 +-
tools/perf/ui/helpline.c | 2 +-
tools/perf/ui/helpline.h | 8 +-
tools/perf/ui/hist.c | 21 +-
tools/perf/ui/tui/setup.c | 4 +-
tools/perf/util/alias.c | 3 +-
tools/perf/util/annotate.c | 6 +-
tools/perf/util/annotate.h | 13 +-
tools/perf/util/build-id.c | 11 +-
tools/perf/util/cache.h | 6 +-
tools/perf/util/callchain.c | 6 +-
tools/perf/util/cgroup.c | 4 +-
tools/perf/util/config.c | 6 +-
tools/perf/util/debug.h | 9 +-
tools/perf/util/event.c | 29 +-
tools/perf/util/event.h | 2 +-
tools/perf/util/evsel.c | 35 +
tools/perf/util/evsel.h | 7 +
tools/perf/util/header.c | 177 ++-
tools/perf/util/header.h | 2 +-
tools/perf/util/help.c | 3 +-
tools/perf/util/hist.c | 2 +-
tools/perf/util/hist.h | 32 +-
tools/perf/util/include/linux/bitops.h | 4 +
tools/perf/util/include/linux/compiler.h | 8 +-
tools/perf/util/include/linux/kernel.h | 13 +-
tools/perf/util/include/linux/magic.h | 12 +
tools/perf/util/include/linux/string.h | 2 +
tools/perf/util/include/linux/types.h | 8 +
tools/perf/util/intlist.c | 4 +-
tools/perf/util/map.c | 12 +-
tools/perf/util/map.h | 2 +-
tools/perf/util/parse-events-test.c | 6 +-
tools/perf/util/parse-events.c | 7 +-
tools/perf/util/parse-events.l | 2 +-
tools/perf/util/parse-events.y | 4 +-
tools/perf/util/parse-options.c | 3 +-
tools/perf/util/perf_regs.h | 2 +-
tools/perf/util/pmu.y | 6 +-
tools/perf/util/probe-event.c | 21 +-
tools/perf/util/probe-finder.c | 4 +-
tools/perf/util/python.c | 8 +-
.../perf/util/scripting-engines/trace-event-perl.c | 8 +-
.../util/scripting-engines/trace-event-python.c | 10 +-
tools/perf/util/session.c | 61 +-
tools/perf/util/sort.c | 14 +-
tools/perf/util/string.c | 18 +-
tools/perf/util/symbol-minimal.c | 28 +-
tools/perf/util/symbol.c | 6 +-
tools/perf/util/symbol.h | 8 +-
tools/perf/util/trace-event-parse.c | 4 +-
tools/perf/util/trace-event-scripting.c | 33 +-
tools/perf/util/unwind.c | 36 +-
tools/perf/util/unwind.h | 11 +-
tools/perf/util/util.h | 2 +-
tools/perf/util/vdso.c | 111 ++
tools/perf/util/vdso.h | 18 +
tools/perf/util/wrapper.c | 3 +-
92 files changed, 1518 insertions(+), 1231 deletions(-)
create mode 100644 tools/perf/util/include/linux/magic.h
create mode 100644 tools/perf/util/vdso.c
create mode 100644 tools/perf/util/vdso.h
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2012-09-11 23:52 Arnaldo Carvalho de Melo
@ 2012-09-13 15:15 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2012-09-13 15:15 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, David Ahern, Frederic Weisbecker, Irina Tirdea,
Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim,
Paul Mackerras, Pekka Enberg, Peter Zijlstra, Stephane Eranian,
Steven Rostedt, arnaldo.melo, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> Best Regards,
>
> - Arnaldo
>
> The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
>
> for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99:
>
> perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes
>
> . Remove die()/exit() calls from several tools.
>
> . Add missing perf_regs.h file to MANIFEST
>
> . Clean up and improve 'perf sched' performance by elliminating lots of
> needless calls to libtraceevent.
>
> . More patches to make perf build on Android, from Irina Tirdea
>
> . Resolve vdso callchains, from Jiri Olsa
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (9):
> perf test: Remove die() calls
> perf sched: Remove die() calls
> perf kmem: Remove die() calls
> perf tools: Add missing perf_regs.h file to MANIFEST
> perf sched: Remove unused thread parameter
> perf sched: Use perf_tool as ancestor
> perf evsel: Introduce perf_evsel__{str,int}val methods
> perf sched: Use perf_evsel__{int,str}val
> perf sched: Don't read all tracepoint variables in advance
>
> Irina Tirdea (5):
> perf tools: include wrapper for magic.h
> perf tools: Update types definitions for Android
> perf tools: include __WORDSIZE definition
> perf tools: fix ALIGN redefinition in system headers
> perf tools: Use __maybe_used for unused variables
>
> Jiri Olsa (4):
> perf tools: Do backtrace post unwind only if we regs and stack were captured
> perf tools: Add memdup function
> perf symbols: Make dsos__find function globally available
> perf tools: Back [vdso] DSO with real data
>
> tools/lib/traceevent/event-parse.c | 8 +-
> tools/lib/traceevent/event-parse.h | 4 +-
> tools/perf/MANIFEST | 1 +
> tools/perf/Makefile | 3 +
> tools/perf/bench/bench.h | 3 +-
> tools/perf/bench/mem-memcpy.c | 2 +-
> tools/perf/bench/mem-memset.c | 2 +-
> tools/perf/bench/sched-messaging.c | 2 +-
> tools/perf/bench/sched-pipe.c | 6 +-
> tools/perf/builtin-annotate.c | 2 +-
> tools/perf/builtin-bench.c | 2 +-
> tools/perf/builtin-buildid-cache.c | 10 +-
> tools/perf/builtin-buildid-list.c | 3 +-
> tools/perf/builtin-diff.c | 4 +-
> tools/perf/builtin-evlist.c | 2 +-
> tools/perf/builtin-help.c | 2 +-
> tools/perf/builtin-inject.c | 24 +-
> tools/perf/builtin-kmem.c | 130 +-
> tools/perf/builtin-kvm.c | 2 +-
> tools/perf/builtin-list.c | 2 +-
> tools/perf/builtin-lock.c | 4 +-
> tools/perf/builtin-probe.c | 24 +-
> tools/perf/builtin-record.c | 10 +-
> tools/perf/builtin-report.c | 11 +-
> tools/perf/builtin-sched.c | 1446 +++++++++-----------
> tools/perf/builtin-script.c | 29 +-
> tools/perf/builtin-stat.c | 40 +-
> tools/perf/builtin-test.c | 23 +-
> tools/perf/builtin-timechart.c | 30 +-
> tools/perf/builtin-top.c | 7 +-
> tools/perf/ui/browser.c | 7 +-
> tools/perf/ui/browsers/annotate.c | 6 +-
> tools/perf/ui/gtk/browser.c | 5 +-
> tools/perf/ui/gtk/setup.c | 2 +-
> tools/perf/ui/gtk/util.c | 4 +-
> tools/perf/ui/helpline.c | 2 +-
> tools/perf/ui/helpline.h | 8 +-
> tools/perf/ui/hist.c | 21 +-
> tools/perf/ui/tui/setup.c | 4 +-
> tools/perf/util/alias.c | 3 +-
> tools/perf/util/annotate.c | 6 +-
> tools/perf/util/annotate.h | 13 +-
> tools/perf/util/build-id.c | 11 +-
> tools/perf/util/cache.h | 6 +-
> tools/perf/util/callchain.c | 6 +-
> tools/perf/util/cgroup.c | 4 +-
> tools/perf/util/config.c | 6 +-
> tools/perf/util/debug.h | 9 +-
> tools/perf/util/event.c | 29 +-
> tools/perf/util/event.h | 2 +-
> tools/perf/util/evsel.c | 35 +
> tools/perf/util/evsel.h | 7 +
> tools/perf/util/header.c | 177 ++-
> tools/perf/util/header.h | 2 +-
> tools/perf/util/help.c | 3 +-
> tools/perf/util/hist.c | 2 +-
> tools/perf/util/hist.h | 32 +-
> tools/perf/util/include/linux/bitops.h | 4 +
> tools/perf/util/include/linux/compiler.h | 8 +-
> tools/perf/util/include/linux/kernel.h | 13 +-
> tools/perf/util/include/linux/magic.h | 12 +
> tools/perf/util/include/linux/string.h | 2 +
> tools/perf/util/include/linux/types.h | 8 +
> tools/perf/util/intlist.c | 4 +-
> tools/perf/util/map.c | 12 +-
> tools/perf/util/map.h | 2 +-
> tools/perf/util/parse-events-test.c | 6 +-
> tools/perf/util/parse-events.c | 7 +-
> tools/perf/util/parse-events.l | 2 +-
> tools/perf/util/parse-events.y | 4 +-
> tools/perf/util/parse-options.c | 3 +-
> tools/perf/util/perf_regs.h | 2 +-
> tools/perf/util/pmu.y | 6 +-
> tools/perf/util/probe-event.c | 21 +-
> tools/perf/util/probe-finder.c | 4 +-
> tools/perf/util/python.c | 8 +-
> .../perf/util/scripting-engines/trace-event-perl.c | 8 +-
> .../util/scripting-engines/trace-event-python.c | 10 +-
> tools/perf/util/session.c | 61 +-
> tools/perf/util/sort.c | 14 +-
> tools/perf/util/string.c | 18 +-
> tools/perf/util/symbol-minimal.c | 28 +-
> tools/perf/util/symbol.c | 6 +-
> tools/perf/util/symbol.h | 8 +-
> tools/perf/util/trace-event-parse.c | 4 +-
> tools/perf/util/trace-event-scripting.c | 33 +-
> tools/perf/util/unwind.c | 36 +-
> tools/perf/util/unwind.h | 11 +-
> tools/perf/util/util.h | 2 +-
> tools/perf/util/vdso.c | 111 ++
> tools/perf/util/vdso.h | 18 +
> tools/perf/util/wrapper.c | 3 +-
> 92 files changed, 1518 insertions(+), 1231 deletions(-)
> create mode 100644 tools/perf/util/include/linux/magic.h
> create mode 100644 tools/perf/util/vdso.c
> create mode 100644 tools/perf/util/vdso.h
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2013-12-13 15:11 Arnaldo Carvalho de Melo
2013-12-16 13:54 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-13 15:11 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Ramkumar Ramachandra, Stephane Eranian, Steven Rostedt,
Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Hi Ingo,
Please consider pulling,
Regards,
- Arnaldo
The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63:
perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c:
tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
Fixes:
. Fix inverted error verification bug in thread__fork, from David Ahern.
New features:
. Shell completion for 'perf kvm', from Ramkumar Ramachandra.
Refactorings:
. Get rid of panic() like calls in libtraceevent, from Namyung Kim.
. Start carving out symbol parsing routines from perf, just moving routines to
topic files in tools/lib/symbol/, tools that want to use it need to integrate
it directly, i.e. no tools/lib/symbol/Makefile is provided.
. Assorted refactoring patches, moving code around and adding
utility evlist methods that will be used in the IPT patchset,
from Adrian Hunter.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (5):
perf tools: Add perf_event_paranoid()
perf header: Allow header->data_offset to be predetermined
perf evlist: Add can_select_event() method
perf tools: Move mem_bswap32/64 to util.c
perf evlist: Add perf_evlist__to_front()
Arnaldo Carvalho de Melo (1):
tools lib symbol: Start carving out symbol parsing routines from perf
David Ahern (1):
perf tools: Fix inverted error verification bug in thread__fork
Namhyung Kim (12):
tools lib traceevent: Get rid of malloc_or_die() in show_error()
tools lib traceevent: Get rid of die in add_filter_type()
tools lib traceevent: Get rid of malloc_or_die() allocate_arg()
tools lib traceevent: Get rid of malloc_or_die() in read_token()
tools lib traceevent: Get rid of malloc_or_die() in find_event()
tools lib traceevent: Get rid of die() in add_right()
tools lib traceevent: Make add_left() return pevent_errno
tools lib traceevent: Get rid of die() in reparent_op_arg()
tools lib traceevent: Refactor create_arg_item()
tools lib traceevent: Refactor process_filter()
tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno
tools lib traceevent: Refactor pevent_filter_match() to get rid of die()
Ramkumar Ramachandra (1):
perf completion: Complete 'perf kvm'
tools/lib/symbol/kallsyms.c | 58 +++++
tools/lib/symbol/kallsyms.h | 24 ++
tools/lib/traceevent/event-parse.h | 43 ++-
tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++--------------
tools/perf/MANIFEST | 2 +
tools/perf/Makefile.perf | 5 +
tools/perf/perf-completion.sh | 4 +
tools/perf/util/event.c | 1 +
tools/perf/util/evlist.c | 20 +-
tools/perf/util/evlist.h | 5 +
tools/perf/util/header.c | 3 +-
tools/perf/util/machine.c | 1 +
tools/perf/util/record.c | 37 +++
tools/perf/util/session.c | 21 --
tools/perf/util/session.h | 2 -
tools/perf/util/symbol-elf.c | 1 +
tools/perf/util/symbol.c | 69 +----
tools/perf/util/symbol.h | 3 -
tools/perf/util/thread.c | 2 +-
tools/perf/util/util.c | 41 +++
tools/perf/util/util.h | 4 +
21 files changed, 550 insertions(+), 303 deletions(-)
create mode 100644 tools/lib/symbol/kallsyms.c
create mode 100644 tools/lib/symbol/kallsyms.h
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2013-12-13 15:11 Arnaldo Carvalho de Melo
@ 2013-12-16 13:54 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2013-12-16 13:54 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Ramkumar Ramachandra, Stephane Eranian, Steven Rostedt,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
>
> Hi Ingo,
>
> Please consider pulling,
>
> Regards,
>
> - Arnaldo
>
> The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63:
>
> perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
>
> for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c:
>
> tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> Fixes:
>
> . Fix inverted error verification bug in thread__fork, from David Ahern.
>
> New features:
>
> . Shell completion for 'perf kvm', from Ramkumar Ramachandra.
>
> Refactorings:
>
> . Get rid of panic() like calls in libtraceevent, from Namyung Kim.
>
> . Start carving out symbol parsing routines from perf, just moving routines to
> topic files in tools/lib/symbol/, tools that want to use it need to integrate
> it directly, i.e. no tools/lib/symbol/Makefile is provided.
>
> . Assorted refactoring patches, moving code around and adding
> utility evlist methods that will be used in the IPT patchset,
> from Adrian Hunter.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (5):
> perf tools: Add perf_event_paranoid()
> perf header: Allow header->data_offset to be predetermined
> perf evlist: Add can_select_event() method
> perf tools: Move mem_bswap32/64 to util.c
> perf evlist: Add perf_evlist__to_front()
>
> Arnaldo Carvalho de Melo (1):
> tools lib symbol: Start carving out symbol parsing routines from perf
>
> David Ahern (1):
> perf tools: Fix inverted error verification bug in thread__fork
>
> Namhyung Kim (12):
> tools lib traceevent: Get rid of malloc_or_die() in show_error()
> tools lib traceevent: Get rid of die in add_filter_type()
> tools lib traceevent: Get rid of malloc_or_die() allocate_arg()
> tools lib traceevent: Get rid of malloc_or_die() in read_token()
> tools lib traceevent: Get rid of malloc_or_die() in find_event()
> tools lib traceevent: Get rid of die() in add_right()
> tools lib traceevent: Make add_left() return pevent_errno
> tools lib traceevent: Get rid of die() in reparent_op_arg()
> tools lib traceevent: Refactor create_arg_item()
> tools lib traceevent: Refactor process_filter()
> tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno
> tools lib traceevent: Refactor pevent_filter_match() to get rid of die()
>
> Ramkumar Ramachandra (1):
> perf completion: Complete 'perf kvm'
>
> tools/lib/symbol/kallsyms.c | 58 +++++
> tools/lib/symbol/kallsyms.h | 24 ++
> tools/lib/traceevent/event-parse.h | 43 ++-
> tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++--------------
> tools/perf/MANIFEST | 2 +
> tools/perf/Makefile.perf | 5 +
> tools/perf/perf-completion.sh | 4 +
> tools/perf/util/event.c | 1 +
> tools/perf/util/evlist.c | 20 +-
> tools/perf/util/evlist.h | 5 +
> tools/perf/util/header.c | 3 +-
> tools/perf/util/machine.c | 1 +
> tools/perf/util/record.c | 37 +++
> tools/perf/util/session.c | 21 --
> tools/perf/util/session.h | 2 -
> tools/perf/util/symbol-elf.c | 1 +
> tools/perf/util/symbol.c | 69 +----
> tools/perf/util/symbol.h | 3 -
> tools/perf/util/thread.c | 2 +-
> tools/perf/util/util.c | 41 +++
> tools/perf/util/util.h | 4 +
> 21 files changed, 550 insertions(+), 303 deletions(-)
> create mode 100644 tools/lib/symbol/kallsyms.c
> create mode 100644 tools/lib/symbol/kallsyms.h
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2014-09-17 21:24 Arnaldo Carvalho de Melo
2014-09-19 5:15 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Alexander Yarygin, Anton Blanchard, Avi Kivity, Chanho Park,
Christian Borntraeger, Corey Ashford, David Ahern, david lerner,
Don Zickus, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
John Spencer, Kyle McMartin, linux-perf-users, Masami Hiramatsu,
Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras,
Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu,
yrl.pp-manager.tt, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:
perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:
perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
o Add +field argument support for --sort option (Jiri Olsa)
o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)
o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)
o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)
o Disable kernel symbol demangling by default (Avi Kivity)
Infrastructure:
o More intel PT prep work, from Adrian Hunter, including:
- Let a user specify a PMU event without any config terms
- Add perf-with-kcore script
- Let default config be defined for a PMU
- Add perf_pmu__scan_file()
o "perf kvm stat report" improvements by Alexander Yarygin:
o Save pid string in opts.target.pid
o Enable the target.system_wide flag
o Unify the title bar output
o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)
o Allow to specify lib compile variable for spec usage (Jiri Olsa)
o Fix build on ARM (Stephane Eranian)
o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)
o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)
o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)
Chanho Park (1):
perf tools: define _DEFAULT_SOURCE for glibc_2.20
o Allow to specify lib compile variable for spec usage (Jiri Olsa)
o Fix GNU-only grep usage in Makefile (John Spencer)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (4):
perf tools: Let a user specify a PMU event without any config terms
perf tools: Add perf-with-kcore script
perf tools: Let default config be defined for a PMU
perf tools: Add perf_pmu__scan_file()
Alexander Yarygin (3):
perf kvm stat report: Save pid string in opts.target.pid
perf kvm stat report: Enable the target.system_wide flag
perf kvm stat report: Unify the title bar output
Anton Blanchard (3):
perf tools powerpc: Fix build issue when DWARF support is disabled
perf symbols: Ignore stripped vmlinux and fallback to kallsyms
perf symbols: Add path to Ubuntu kernel debuginfo file
Arnaldo Carvalho de Melo (2):
perf tools: Don't include sys/poll.h directly
perf record: Use ring buffer consume method to look like other tools
Avi Kivity (1):
perf tools: Disable kernel symbol demangling by default
Chanho Park (1):
perf tools: define _DEFAULT_SOURCE for glibc_2.20
Jiri Olsa (2):
perf tools: Add +field argument support for --sort option
perf tools: Allow to specify lib compile variable for spec usage
John Spencer (1):
perf tools: Fix GNU-only grep usage in Makefile
Masami Hiramatsu (2):
perf probe: Do not access kallsyms when analyzing user binaries
perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name
Stephane Eranian (1):
perf tool: fix compilation for ARM
tools/perf/.gitignore | 1 +
tools/perf/Documentation/perf-probe.txt | 3 +
tools/perf/Documentation/perf-report.txt | 3 +
tools/perf/Documentation/perf-top.txt | 3 +
tools/perf/Makefile.perf | 5 +-
tools/perf/arch/arm/tests/dwarf-unwind.c | 1 +
tools/perf/arch/arm/util/unwind-libunwind.c | 1 +
tools/perf/arch/powerpc/Makefile | 2 +-
tools/perf/bench/sched-messaging.c | 2 +-
tools/perf/builtin-kvm.c | 23 +--
tools/perf/builtin-probe.c | 5 +-
tools/perf/builtin-record.c | 8 +-
tools/perf/builtin-report.c | 2 +
tools/perf/builtin-top.c | 4 +-
tools/perf/config/Makefile | 12 +-
tools/perf/config/utilities.mak | 2 +-
tools/perf/perf-with-kcore.sh | 259 ++++++++++++++++++++++++++++
tools/perf/tests/pmu.c | 2 +-
tools/perf/util/kvm-stat.h | 1 -
tools/perf/util/parse-events.c | 13 +-
tools/perf/util/parse-events.y | 10 ++
tools/perf/util/pmu.c | 79 +++++++--
tools/perf/util/pmu.h | 12 +-
tools/perf/util/probe-event.c | 9 +-
tools/perf/util/probe-event.h | 3 +-
tools/perf/util/probe-finder.c | 16 +-
tools/perf/util/sort.c | 37 +++-
tools/perf/util/symbol-elf.c | 15 +-
tools/perf/util/symbol.c | 9 +-
tools/perf/util/symbol.h | 1 +
tools/perf/util/util.h | 4 +-
31 files changed, 487 insertions(+), 60 deletions(-)
create mode 100644 tools/perf/perf-with-kcore.sh
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2014-09-17 21:24 Arnaldo Carvalho de Melo
@ 2014-09-19 5:15 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2014-09-19 5:15 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Alexander Yarygin, Anton Blanchard,
Avi Kivity, Chanho Park, Christian Borntraeger, Corey Ashford,
David Ahern, david lerner, Don Zickus, Frederic Weisbecker,
Jean Pihet, Jiri Olsa, John Spencer, Kyle McMartin,
linux-perf-users, Masami Hiramatsu, Michael Ellerman,
Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:
>
> perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>
> for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:
>
> perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> o Add +field argument support for --sort option (Jiri Olsa)
>
> o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)
>
> o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)
>
> o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)
>
> o Disable kernel symbol demangling by default (Avi Kivity)
>
> Infrastructure:
>
> o More intel PT prep work, from Adrian Hunter, including:
>
> - Let a user specify a PMU event without any config terms
> - Add perf-with-kcore script
> - Let default config be defined for a PMU
> - Add perf_pmu__scan_file()
>
> o "perf kvm stat report" improvements by Alexander Yarygin:
> o Save pid string in opts.target.pid
> o Enable the target.system_wide flag
> o Unify the title bar output
>
> o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)
>
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
>
> o Fix build on ARM (Stephane Eranian)
>
> o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)
>
> o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)
>
> o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)
>
> Chanho Park (1):
> perf tools: define _DEFAULT_SOURCE for glibc_2.20
>
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
>
> o Fix GNU-only grep usage in Makefile (John Spencer)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (4):
> perf tools: Let a user specify a PMU event without any config terms
> perf tools: Add perf-with-kcore script
> perf tools: Let default config be defined for a PMU
> perf tools: Add perf_pmu__scan_file()
>
> Alexander Yarygin (3):
> perf kvm stat report: Save pid string in opts.target.pid
> perf kvm stat report: Enable the target.system_wide flag
> perf kvm stat report: Unify the title bar output
>
> Anton Blanchard (3):
> perf tools powerpc: Fix build issue when DWARF support is disabled
> perf symbols: Ignore stripped vmlinux and fallback to kallsyms
> perf symbols: Add path to Ubuntu kernel debuginfo file
>
> Arnaldo Carvalho de Melo (2):
> perf tools: Don't include sys/poll.h directly
> perf record: Use ring buffer consume method to look like other tools
>
> Avi Kivity (1):
> perf tools: Disable kernel symbol demangling by default
>
> Chanho Park (1):
> perf tools: define _DEFAULT_SOURCE for glibc_2.20
>
> Jiri Olsa (2):
> perf tools: Add +field argument support for --sort option
> perf tools: Allow to specify lib compile variable for spec usage
>
> John Spencer (1):
> perf tools: Fix GNU-only grep usage in Makefile
>
> Masami Hiramatsu (2):
> perf probe: Do not access kallsyms when analyzing user binaries
> perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name
>
> Stephane Eranian (1):
> perf tool: fix compilation for ARM
>
> tools/perf/.gitignore | 1 +
> tools/perf/Documentation/perf-probe.txt | 3 +
> tools/perf/Documentation/perf-report.txt | 3 +
> tools/perf/Documentation/perf-top.txt | 3 +
> tools/perf/Makefile.perf | 5 +-
> tools/perf/arch/arm/tests/dwarf-unwind.c | 1 +
> tools/perf/arch/arm/util/unwind-libunwind.c | 1 +
> tools/perf/arch/powerpc/Makefile | 2 +-
> tools/perf/bench/sched-messaging.c | 2 +-
> tools/perf/builtin-kvm.c | 23 +--
> tools/perf/builtin-probe.c | 5 +-
> tools/perf/builtin-record.c | 8 +-
> tools/perf/builtin-report.c | 2 +
> tools/perf/builtin-top.c | 4 +-
> tools/perf/config/Makefile | 12 +-
> tools/perf/config/utilities.mak | 2 +-
> tools/perf/perf-with-kcore.sh | 259 ++++++++++++++++++++++++++++
> tools/perf/tests/pmu.c | 2 +-
> tools/perf/util/kvm-stat.h | 1 -
> tools/perf/util/parse-events.c | 13 +-
> tools/perf/util/parse-events.y | 10 ++
> tools/perf/util/pmu.c | 79 +++++++--
> tools/perf/util/pmu.h | 12 +-
> tools/perf/util/probe-event.c | 9 +-
> tools/perf/util/probe-event.h | 3 +-
> tools/perf/util/probe-finder.c | 16 +-
> tools/perf/util/sort.c | 37 +++-
> tools/perf/util/symbol-elf.c | 15 +-
> tools/perf/util/symbol.c | 9 +-
> tools/perf/util/symbol.h | 1 +
> tools/perf/util/util.h | 4 +-
> 31 files changed, 487 insertions(+), 60 deletions(-)
> create mode 100644 tools/perf/perf-with-kcore.sh
Pulled into tip:perf/core, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2015-03-03 3:25 Arnaldo Carvalho de Melo
2015-03-03 6:20 ` Ingo Molnar
2015-03-10 10:03 ` Ingo Molnar
0 siblings, 2 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-03 3:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
Arnaldo Carvalho de Melo
Hi Ingo,
This one has the thread reference counting, that I tested using 'perf probe':
perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid'
perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid'
perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid'
perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top
with that I checked and in the end the refcount reaches zero and
thread__delete is called, as expected, using 'perf script', looking at the
callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to
work.
David, Namhyung, please holler if you find something fishy with this
thread refcnt stuff, as it is something that is related to previous/current
work by you guys,
Ah, I also merged perf/urgent so that it is buildable in more systems.o
There is also the revert for that is_power_of_2 "simplification" in perf_mmap,
that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry
about that one, should have caught that :-\
Please consider pulling,
- Arnaldo
The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301:
Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
for you to fetch changes up to ae536acfacb65a4a9858c32b12361e09f84f4157:
perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)
- 'perf record' Documentation fixes (Namhyung Kim)
- Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)
Infrastructure:
- Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)
- Reference count struct thread (Arnaldo Carvalho de Melo)
- No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)
- Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter)
- Only include tsc file for x86 (David Ahern)
- Compare JOBS to 0 after grep (David Ahern)
- Improve feature detection messages (Ingo Molnar)
- Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)
- Remove bias offset to find probe point by address (Masami Hiramatsu)
- Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (1):
perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test
Arnaldo Carvalho de Melo (3):
perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads
perf tools: Reference count struct thread
perf sched: No need to keep the session around
David Ahern (2):
perf tools: Only include tsc file for x86
perf tools: Compare JOBS to 0 after grep
Ingo Molnar (7):
perf tools: Add PERF-FEATURES to the .gitignore file
perf tools: Remove annoying extra message from the features build
perf tools: Improve Python feature detection messages
perf tools: Improve libperl detection message
perf tools: Improve libbfd detection message
perf tools: Improve feature test debuggability
perf tools: Improve 'libbabel' feature check failure message
Kan Liang (1):
Revert "perf: Remove the extra validity check on nr_pages"
Masami Hiramatsu (2):
perf probe: Warn if given uprobe event accesses memory on older kernel
perf probe: Remove bias offset to find probe point by address
Namhyung Kim (3):
perf tools: Fix build error on ARCH=i386/x86_64/sparc64
perf record: Get rid of -l option from Documentation
perf record: Document --group option
Suzuki K. Poulose (1):
perf stat: Report unsupported events properly
kernel/events/core.c | 2 +-
tools/perf/.gitignore | 1 +
tools/perf/Documentation/perf-record.txt | 12 ++++--
tools/perf/Makefile | 2 +-
tools/perf/builtin-sched.c | 26 +++++--------
tools/perf/builtin-stat.c | 5 ++-
tools/perf/builtin-trace.c | 7 +++-
tools/perf/config/Makefile | 17 ++++-----
tools/perf/config/Makefile.arch | 27 +++----------
tools/perf/config/feature-checks/Makefile | 16 ++++----
.../test-pthread-attr-setaffinity-np.c | 4 +-
tools/perf/config/utilities.mak | 3 +-
tools/perf/ui/browsers/hists.c | 6 +--
tools/perf/util/Build | 2 +-
tools/perf/util/build-id.c | 5 ++-
tools/perf/util/event.c | 34 ++++++++++++-----
tools/perf/util/hist.c | 2 +
tools/perf/util/hist.h | 2 +-
tools/perf/util/machine.c | 44 +++++++++++-----------
tools/perf/util/machine.h | 1 -
tools/perf/util/probe-event.c | 23 +++++++++++
tools/perf/util/probe-finder.c | 5 +--
tools/perf/util/session.c | 6 ---
tools/perf/util/thread.c | 14 +++++++
tools/perf/util/thread.h | 13 +++++++
25 files changed, 164 insertions(+), 115 deletions(-)
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2015-03-03 3:25 Arnaldo Carvalho de Melo
@ 2015-03-03 6:20 ` Ingo Molnar
2015-03-10 10:03 ` Ingo Molnar
1 sibling, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2015-03-03 6:20 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> This one has the thread reference counting, that I tested using 'perf probe':
>
> perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid'
> perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid'
> perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid'
> perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top
>
> with that I checked and in the end the refcount reaches zero and
> thread__delete is called, as expected, using 'perf script', looking at the
> callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to
> work.
>
> David, Namhyung, please holler if you find something fishy with this
> thread refcnt stuff, as it is something that is related to previous/current
> work by you guys,
>
> Ah, I also merged perf/urgent so that it is buildable in more systems.o
>
> There is also the revert for that is_power_of_2 "simplification" in perf_mmap,
> that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry
> about that one, should have caught that :-\
>
> Please consider pulling,
>
> - Arnaldo
> The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301:
>
> Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -0300)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>
> for you to fetch changes up to ae536acfacb65a4a9858c32b12361e09f84f4157:
>
> perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)
>
> - 'perf record' Documentation fixes (Namhyung Kim)
>
> - Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)
>
> Infrastructure:
>
> - Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)
>
> - Reference count struct thread (Arnaldo Carvalho de Melo)
>
> - No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)
>
> - Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter)
>
> - Only include tsc file for x86 (David Ahern)
>
> - Compare JOBS to 0 after grep (David Ahern)
>
> - Improve feature detection messages (Ingo Molnar)
>
> - Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)
>
> - Remove bias offset to find probe point by address (Masami Hiramatsu)
>
> - Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (1):
> perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test
>
> Arnaldo Carvalho de Melo (3):
> perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads
> perf tools: Reference count struct thread
> perf sched: No need to keep the session around
>
> David Ahern (2):
> perf tools: Only include tsc file for x86
> perf tools: Compare JOBS to 0 after grep
>
> Ingo Molnar (7):
> perf tools: Add PERF-FEATURES to the .gitignore file
> perf tools: Remove annoying extra message from the features build
> perf tools: Improve Python feature detection messages
> perf tools: Improve libperl detection message
> perf tools: Improve libbfd detection message
> perf tools: Improve feature test debuggability
> perf tools: Improve 'libbabel' feature check failure message
>
> Kan Liang (1):
> Revert "perf: Remove the extra validity check on nr_pages"
>
> Masami Hiramatsu (2):
> perf probe: Warn if given uprobe event accesses memory on older kernel
> perf probe: Remove bias offset to find probe point by address
>
> Namhyung Kim (3):
> perf tools: Fix build error on ARCH=i386/x86_64/sparc64
> perf record: Get rid of -l option from Documentation
> perf record: Document --group option
>
> Suzuki K. Poulose (1):
> perf stat: Report unsupported events properly
>
> kernel/events/core.c | 2 +-
> tools/perf/.gitignore | 1 +
> tools/perf/Documentation/perf-record.txt | 12 ++++--
> tools/perf/Makefile | 2 +-
> tools/perf/builtin-sched.c | 26 +++++--------
> tools/perf/builtin-stat.c | 5 ++-
> tools/perf/builtin-trace.c | 7 +++-
> tools/perf/config/Makefile | 17 ++++-----
> tools/perf/config/Makefile.arch | 27 +++----------
> tools/perf/config/feature-checks/Makefile | 16 ++++----
> .../test-pthread-attr-setaffinity-np.c | 4 +-
> tools/perf/config/utilities.mak | 3 +-
> tools/perf/ui/browsers/hists.c | 6 +--
> tools/perf/util/Build | 2 +-
> tools/perf/util/build-id.c | 5 ++-
> tools/perf/util/event.c | 34 ++++++++++++-----
> tools/perf/util/hist.c | 2 +
> tools/perf/util/hist.h | 2 +-
> tools/perf/util/machine.c | 44 +++++++++++-----------
> tools/perf/util/machine.h | 1 -
> tools/perf/util/probe-event.c | 23 +++++++++++
> tools/perf/util/probe-finder.c | 5 +--
> tools/perf/util/session.c | 6 ---
> tools/perf/util/thread.c | 14 +++++++
> tools/perf/util/thread.h | 13 +++++++
> 25 files changed, 164 insertions(+), 115 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2015-03-03 3:25 Arnaldo Carvalho de Melo
2015-03-03 6:20 ` Ingo Molnar
@ 2015-03-10 10:03 ` Ingo Molnar
2015-03-10 14:03 ` Arnaldo Carvalho de Melo
1 sibling, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2015-03-10 10:03 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
Arnaldo Carvalho de Melo
So I got this error today:
┌─Warning:───────────────────────────┐
│The vmlinux file can't be used. │
│Kernel samples will not be resolved.│
│ │
│ │
│Press any key... │
└────────────────────────────────────┘
... and sadly perf is being passive-aggressive again: being negative
but refusing to say why! :-)
Is there a way to figure out why it did not like the vmlinux?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2015-03-10 10:03 ` Ingo Molnar
@ 2015-03-10 14:03 ` Arnaldo Carvalho de Melo
2015-03-10 14:37 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-10 14:03 UTC (permalink / raw)
To: Ingo Molnar
Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter, Andi Kleen,
Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner
Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu:
> So I got this error today:
>
> ┌─Warning:───────────────────────────┐
> │The vmlinux file can't be used. │
> │Kernel samples will not be resolved.│
> │ │
> │ │
> │Press any key... │
> └────────────────────────────────────┘
>
> ... and sadly perf is being passive-aggressive again: being negative
> but refusing to say why! :-)
> Is there a way to figure out why it did not like the vmlinux?
I'll check and improve the message.
But you must've noticed that perf is going to a therapist, aka improving
error messages... ;-)
- Arnaldo
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2015-03-10 14:03 ` Arnaldo Carvalho de Melo
@ 2015-03-10 14:37 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2015-03-10 14:37 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter, Andi Kleen,
Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
He Kuang, H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner
* Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu:
> > So I got this error today:
> >
> > ┌─Warning:───────────────────────────┐
> > │The vmlinux file can't be used. │
> > │Kernel samples will not be resolved.│
> > │ │
> > │ │
> > │Press any key... │
> > └────────────────────────────────────┘
> >
> > ... and sadly perf is being passive-aggressive again: being negative
> > but refusing to say why! :-)
>
> > Is there a way to figure out why it did not like the vmlinux?
>
> I'll check and improve the message.
>
> But you must've noticed that perf is going to a therapist, aka
> improving error messages... ;-)
Absolutely! ;-)
Also, on the positive side, today I was able to build and run perf on
ancient user-space: a Fedora Core 6 installation, with very few hacks
(see the attached hacks).
The HAVE_NEW_FLAX hack results in a non-working -e option.
Thanks,
Ingo
Index: tip/tools/perf/util/parse-events.c
===================================================================
--- tip.orig/tools/perf/util/parse-events.c
+++ tip/tools/perf/util/parse-events.c
@@ -968,6 +968,13 @@ perf_pmu__parse_check(const char *name)
return r ? r->type : PMU_EVENT_SYMBOL_ERR;
}
+#ifndef HAVE_NEW_FLEX
+static int parse_events_lex_init_extra(int start_token __maybe_unused, void **scanner __maybe_unused)
+{
+ return -1;
+}
+#endif
+
static int parse_events__scanner(const char *str, void *data, int start_token)
{
YY_BUFFER_STATE buffer;
Index: tip/tools/perf/util/symbol-elf.c
===================================================================
--- tip.orig/tools/perf/util/symbol-elf.c
+++ tip/tools/perf/util/symbol-elf.c
@@ -53,6 +53,13 @@ static int elf_getphdrnum(Elf *elf, size
}
#endif
+#ifndef HAVE_ELF_GETPHDRNUM
+static int elf_getphdrnum (Elf *__elf __maybe_unused, size_t *__dst __maybe_unused)
+{
+ return 1;
+}
+#endif
+
#ifndef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
#endif
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2016-12-05 21:37 Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 01/20] tools build: Make fixdep parsing wait for last target Arnaldo Carvalho de Melo
` (20 more replies)
0 siblings, 21 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin,
Alexei Starovoitov, Chris Riyder, David Ahern, He Kuang,
Jiri Olsa, Joe Stringer, Kim Phillips, linuxppc-dev,
Markus Trippelsdorf, Masami Hiramatsu, Michael Ellerman,
Namhyung Kim, Naveen N . Rao, Peter Foley, Peter Zijlstra,
Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, pi3orama,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4:
Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08:03 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161205
for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9:
perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
Fixes:
- Do not show a bogus target address in 'perf annotate' for targetless powerpc
jump instructions such as 'bctr' (Ravi Bangoria)
- tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa)
- Fix building objtool with clang (Peter Foley)
Infrastructure:
- Support linking perf with clang and LLVM libraries, initially statically, but
this limitation will be lifted and shared libraries, when available, will
be preferred to the static build, that should, as with other features, be
enabled explicitly (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Jiri Olsa (7):
tools build: Make fixdep parsing wait for last target
tools build: Make the .cmd file more readable
tools build: Move tabs to spaces where suitable
perf tools: Move install-gtk target into rules area
perf tools: Move python/perf.so target into rules area
perf tools: Cleanup build directory before each test
perf tools: Add non config targets
Peter Foley (1):
tools build: Fix objtool build with clang
Ravi Bangoria (1):
perf annotate: Show raw form for jump instruction with indirect target
Wang Nan (11):
perf tools: Pass context to perf hook functions
perf llvm: Extract helpers in llvm-utils.c
tools build: Add feature detection for LLVM
tools build: Add feature detection for clang
perf build: Add clang and llvm compile and linking support
perf clang: Add builtin clang support ant test case
perf clang: Use real file system for #include
perf clang: Allow passing CFLAGS to builtin clang
perf clang: Update test case to use real BPF script
perf clang: Support compile IR to BPF object and add testcase
perf clang: Compile BPF script using builtin clang support
tools/build/Build.include | 20 ++--
tools/build/Makefile.feature | 138 +++++++++++++-------------
tools/build/feature/Makefile | 120 +++++++++++++----------
tools/build/feature/test-clang.cpp | 21 ++++
tools/build/feature/test-llvm.cpp | 8 ++
tools/build/fixdep.c | 5 +-
tools/perf/Makefile.config | 62 +++++++++---
tools/perf/Makefile.perf | 56 +++++++----
tools/perf/tests/Build | 1 +
tools/perf/tests/builtin-test.c | 9 ++
tools/perf/tests/clang.c | 46 +++++++++
tools/perf/tests/llvm.h | 7 ++
tools/perf/tests/make | 4 +-
tools/perf/tests/perf-hooks.c | 14 ++-
tools/perf/tests/tests.h | 3 +
tools/perf/util/Build | 2 +
tools/perf/util/annotate.c | 3 +
tools/perf/util/bpf-loader.c | 19 +++-
tools/perf/util/c++/Build | 2 +
tools/perf/util/c++/clang-c.h | 43 ++++++++
tools/perf/util/c++/clang-test.cpp | 62 ++++++++++++
tools/perf/util/c++/clang.cpp | 195 +++++++++++++++++++++++++++++++++++++
tools/perf/util/c++/clang.h | 26 +++++
tools/perf/util/llvm-utils.c | 76 +++++++++++----
tools/perf/util/llvm-utils.h | 6 ++
tools/perf/util/perf-hooks.c | 10 +-
tools/perf/util/perf-hooks.h | 6 +-
tools/perf/util/util-cxx.h | 26 +++++
28 files changed, 795 insertions(+), 195 deletions(-)
create mode 100644 tools/build/feature/test-clang.cpp
create mode 100644 tools/build/feature/test-llvm.cpp
create mode 100644 tools/perf/tests/clang.c
create mode 100644 tools/perf/util/c++/Build
create mode 100644 tools/perf/util/c++/clang-c.h
create mode 100644 tools/perf/util/c++/clang-test.cpp
create mode 100644 tools/perf/util/c++/clang.cpp
create mode 100644 tools/perf/util/c++/clang.h
create mode 100644 tools/perf/util/util-cxx.h
# uname -a
Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: Detect openat syscall event : Ok
3: Detect openat syscall event on all cpus : Ok
4: Read samples using the mmap interface : Ok
5: Parse event definition strings : Ok
6: PERF_RECORD_* events & perf_sample fields : Ok
7: Parse perf pmu format : Ok
8: DSO data read : Ok
9: DSO data cache : Ok
10: DSO data reopen : Ok
11: Roundtrip evsel->name : Ok
12: Parse sched tracepoints fields : Ok
13: syscalls:sys_enter_openat event fields : Ok
14: Setup struct perf_event_attr : Ok
15: Match and link multiple hists : Ok
16: 'import perf' in python : Ok
17: Breakpoint overflow signal handler : Ok
18: Breakpoint overflow sampling : Ok
19: Number of exit events of a simple workload : Ok
20: Software clock events period values : Ok
21: Object code reading : Ok
22: Sample parsing : Ok
23: Use a dummy software event to keep tracking: Ok
24: Parse with no sample_id_all bit set : Ok
25: Filter hist entries : Ok
26: Lookup mmap thread : Ok
27: Share thread mg : Ok
28: Sort output of hist entries : Ok
29: Cumulate child hist entries : Ok
30: Track with sched_switch : Ok
31: Filter fds with revents mask in a fdarray : Ok
32: Add fd to a fdarray, making it autogrow : Ok
33: kmod_path__parse : Ok
34: Thread map : Ok
35: LLVM search and compile :
35.1: Basic BPF llvm compile : Ok
35.2: kbuild searching : Ok
35.3: Compile source for BPF prologue generation: Ok
35.4: Compile source for BPF relocation : Ok
36: Session topology : Ok
37: BPF filter :
37.1: Basic BPF filtering : Ok
37.2: BPF prologue generation : Ok
37.3: BPF relocation checker : Ok
38: Synthesize thread map : Ok
39: Synthesize cpu map : Ok
40: Synthesize stat config : Ok
41: Synthesize stat : Ok
42: Synthesize stat round : Ok
43: Synthesize attr update : Ok
44: Event times : Ok
45: Read backward ring buffer : Ok
46: Print cpu map : Ok
47: Probe SDT events : Ok
48: is_printable_array : Ok
49: Print bitmap : Ok
50: perf hooks : Ok
51: builtin clang support : Skip (not compiled in)
52: x86 rdpmc : Ok
53: Convert perf time to TSC : Ok
54: DWARF unwind : Ok
55: x86 instruction decoder - new instructions : Ok
56: Intel cqm nmi context read : Skip
#
# time dm
1 alpine:3.4: Ok
2 android-ndk:r12b-arm: Ok
3 archlinux:latest: Ok
4 centos:5: Ok
5 centos:6: Ok
6 centos:7: Ok
7 debian:7: Ok
8 debian:8: Ok
9 debian:experimental: Ok
10 fedora:20: Ok
11 fedora:21: Ok
12 fedora:22: Ok
13 fedora:23: Ok
14 fedora:24: Ok
15 fedora:24-x-ARC-uClibc: Ok
16 fedora:25: Ok
17 fedora:rawhide: Ok
18 mageia:5: Ok
19 opensuse:13.2: Ok
20 opensuse:42.1: Ok
21 opensuse:tumbleweed: Ok
22 ubuntu:12.04.5: Ok
23 ubuntu:14.04.4-x-linaro-arm64: Ok
24 ubuntu:16.04: Ok
25 ubuntu:16.04-x-arm: Ok
26 ubuntu:16.04-x-arm64: Ok
27 ubuntu:16.04-x-powerpc: Ok
28 ubuntu:16.04-x-powerpc64: Ok
29 ubuntu:16.04-x-powerpc64el: Ok
30 ubuntu:16.04-x-s390: Ok
31 ubuntu:16.10: Ok
#
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_no_backtrace_O: make NO_BACKTRACE=1
make_no_gtk2_O: make NO_GTK2=1
make_static_O: make LDFLAGS=-static
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_perf_o_O: make perf.o
make_no_slang_O: make NO_SLANG=1
make_install_prefix_O: make install prefix=/tmp/krava
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_newt_O: make NO_NEWT=1
make_debug_O: make DEBUG=1
make_tags_O: make tags
make_no_libbionic_O: make NO_LIBBIONIC=1
make_help_O: make help
make_install_O: make install
make_no_libunwind_O: make NO_LIBUNWIND=1
make_pure_O: make
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_libbpf_O: make NO_LIBBPF=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_doc_O: make doc
make_no_libaudit_O: make NO_LIBAUDIT=1
make_clean_all_O: make clean all
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_util_map_o_O: make util/map.o
make_install_bin_O: make install-bin
make_no_demangle_O: make NO_DEMANGLE=1
make_no_libelf_O: make NO_LIBELF=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_with_clangllvm_O: make LIBCLANGLLVM=1
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 01/20] tools build: Make fixdep parsing wait for last target
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 02/20] tools build: Fix objtool build with clang Arnaldo Carvalho de Melo
` (19 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, Jiri Olsa, Wang Nan,
Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@redhat.com>
The fixdep tool, among other things, replaces the target of the object
in the gcc generated dependency output file.
The parsing code assumes there's only single target in the rule but this
is not always the case as described in here:
https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.html
Make the fixdep code smart enough to skip all the possible targets.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Foley <pefoley2@pefoley.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20161201130025.GA16430@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/fixdep.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/build/fixdep.c b/tools/build/fixdep.c
index 1521d36cef0d..734d1547cbae 100644
--- a/tools/build/fixdep.c
+++ b/tools/build/fixdep.c
@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)
char *end = m + len;
char *p;
char s[PATH_MAX];
- int is_target;
+ int is_target, has_target = 0;
int saw_any_target = 0;
int is_first_dep = 0;
@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)
if (is_target) {
/* The /next/ file is the first dependency */
is_first_dep = 1;
- } else {
+ has_target = 1;
+ } else if (has_target) {
/* Save this token/filename */
memcpy(s, m, p-m);
s[p - m] = 0;
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 02/20] tools build: Fix objtool build with clang
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 01/20] tools build: Make fixdep parsing wait for last target Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 03/20] perf tools: Pass context to perf hook functions Arnaldo Carvalho de Melo
` (18 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, Peter Foley, Wang Nan, Arnaldo Carvalho de Melo
From: Peter Foley <pefoley2@pefoley.com>
Clang doesn't support multiple arguments being passed to -Wp, so split
them.
Fixes this error:
HOSTCC tools/objtool/fixdep.o
cat: tools/objtool/.fixdep.o.d: No such file or directory
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20161128024346.17371-1-pefoley2@pefoley.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Build.include | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/build/Build.include b/tools/build/Build.include
index c4ae12a5d0a5..62dcf0c7aac2 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -89,12 +89,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
# - per target C flags
# - per object C flags
# - BUILD_STR macro to allow '-D"$(variable)"' constructs
-c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
+c_flags_1 = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1))
c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2))
-cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))
+cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))
###
## HOSTCC C flags
-host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
+host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 03/20] perf tools: Pass context to perf hook functions
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 01/20] tools build: Make fixdep parsing wait for last target Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 02/20] tools build: Fix objtool build with clang Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 04/20] perf llvm: Extract helpers in llvm-utils.c Arnaldo Carvalho de Melo
` (17 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Pass a pointer to perf hook functions so they receive context
information during setup.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-6-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/perf-hooks.c | 14 +++++++++-----
tools/perf/util/perf-hooks.c | 10 +++++++---
tools/perf/util/perf-hooks.h | 6 ++++--
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/tools/perf/tests/perf-hooks.c b/tools/perf/tests/perf-hooks.c
index 9338cb2c25ab..665ecc19671c 100644
--- a/tools/perf/tests/perf-hooks.c
+++ b/tools/perf/tests/perf-hooks.c
@@ -15,13 +15,13 @@ static void sigsegv_handler(int sig __maybe_unused)
exit(-1);
}
-static int hook_flags;
-static void the_hook(void)
+static void the_hook(void *_hook_flags)
{
+ int *hook_flags = _hook_flags;
int *p = NULL;
- hook_flags = 1234;
+ *hook_flags = 1234;
/* Generate a segfault, test perf_hooks__recover */
*p = 0;
@@ -29,13 +29,17 @@ static void the_hook(void)
int test__perf_hooks(int subtest __maybe_unused)
{
+ int hook_flags = 0;
+
signal(SIGSEGV, sigsegv_handler);
- perf_hooks__set_hook("test", the_hook);
+ perf_hooks__set_hook("test", the_hook, &hook_flags);
perf_hooks__invoke_test();
/* hook is triggered? */
- if (hook_flags != 1234)
+ if (hook_flags != 1234) {
+ pr_debug("Setting failed: %d (%p)\n", hook_flags, &hook_flags);
return TEST_FAIL;
+ }
/* the buggy hook is removed? */
if (perf_hooks__get_hook("test"))
diff --git a/tools/perf/util/perf-hooks.c b/tools/perf/util/perf-hooks.c
index 4ce88e37dd63..cb368306b12b 100644
--- a/tools/perf/util/perf-hooks.c
+++ b/tools/perf/util/perf-hooks.c
@@ -27,7 +27,7 @@ void perf_hooks__invoke(const struct perf_hook_desc *desc)
*(current_perf_hook->p_hook_func) = NULL;
} else {
current_perf_hook = desc;
- (**desc->p_hook_func)();
+ (**desc->p_hook_func)(desc->hook_ctx);
}
current_perf_hook = NULL;
}
@@ -41,7 +41,9 @@ void perf_hooks__recover(void)
#define PERF_HOOK(name) \
perf_hook_func_t __perf_hook_func_##name = NULL; \
struct perf_hook_desc __perf_hook_desc_##name = \
- {.hook_name = #name, .p_hook_func = &__perf_hook_func_##name};
+ {.hook_name = #name, \
+ .p_hook_func = &__perf_hook_func_##name, \
+ .hook_ctx = NULL};
#include "perf-hooks-list.h"
#undef PERF_HOOK
@@ -54,7 +56,8 @@ static struct perf_hook_desc *perf_hooks[] = {
#undef PERF_HOOK
int perf_hooks__set_hook(const char *hook_name,
- perf_hook_func_t hook_func)
+ perf_hook_func_t hook_func,
+ void *hook_ctx)
{
unsigned int i;
@@ -65,6 +68,7 @@ int perf_hooks__set_hook(const char *hook_name,
if (*(perf_hooks[i]->p_hook_func))
pr_warning("Overwrite existing hook: %s\n", hook_name);
*(perf_hooks[i]->p_hook_func) = hook_func;
+ perf_hooks[i]->hook_ctx = hook_ctx;
return 0;
}
return -ENOENT;
diff --git a/tools/perf/util/perf-hooks.h b/tools/perf/util/perf-hooks.h
index 1d482b26b4b9..838d5797bc1e 100644
--- a/tools/perf/util/perf-hooks.h
+++ b/tools/perf/util/perf-hooks.h
@@ -5,10 +5,11 @@
extern "C" {
#endif
-typedef void (*perf_hook_func_t)(void);
+typedef void (*perf_hook_func_t)(void *ctx);
struct perf_hook_desc {
const char * const hook_name;
perf_hook_func_t * const p_hook_func;
+ void *hook_ctx;
};
extern void perf_hooks__invoke(const struct perf_hook_desc *);
@@ -26,7 +27,8 @@ static inline void perf_hooks__invoke_##name(void) \
extern int
perf_hooks__set_hook(const char *hook_name,
- perf_hook_func_t hook_func);
+ perf_hook_func_t hook_func,
+ void *hook_ctx);
extern perf_hook_func_t
perf_hooks__get_hook(const char *hook_name);
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 04/20] perf llvm: Extract helpers in llvm-utils.c
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 03/20] perf tools: Pass context to perf hook functions Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 05/20] tools build: Add feature detection for LLVM Arnaldo Carvalho de Melo
` (16 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
The following commits will use builtin clang to compile BPF scripts.
llvm__get_kbuild_opts() and llvm__get_nr_cpus() are extracted to help
building '-DKERNEL_VERSION_CODE' and '-D__NR_CPUS__' macros.
Doing object dumping in bpf loader, so further builtin clang compiling
needn't consider it.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-7-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/bpf-loader.c | 4 +++
tools/perf/util/llvm-utils.c | 76 +++++++++++++++++++++++++++++++++-----------
tools/perf/util/llvm-utils.h | 6 ++++
3 files changed, 68 insertions(+), 18 deletions(-)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index a5fd275238f7..cf16b94115b5 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -90,6 +90,10 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source)
if (err)
return ERR_PTR(-BPF_LOADER_ERRNO__COMPILE);
obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, filename);
+
+ if (!IS_ERR(obj) && llvm_param.dump_obj)
+ llvm__dump_obj(filename, obj_buf, obj_buf_sz);
+
free(obj_buf);
} else
obj = bpf_object__open(filename);
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
index 27b6f303720a..b23ff44cf214 100644
--- a/tools/perf/util/llvm-utils.c
+++ b/tools/perf/util/llvm-utils.c
@@ -7,6 +7,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <linux/err.h>
#include "debug.h"
#include "llvm-utils.h"
#include "config.h"
@@ -282,9 +283,10 @@ static const char *kinc_fetch_script =
"rm -rf $TMPDIR\n"
"exit $RET\n";
-static inline void
-get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts)
+void llvm__get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts)
{
+ static char *saved_kbuild_dir;
+ static char *saved_kbuild_include_opts;
int err;
if (!kbuild_dir || !kbuild_include_opts)
@@ -293,10 +295,28 @@ get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts)
*kbuild_dir = NULL;
*kbuild_include_opts = NULL;
+ if (saved_kbuild_dir && saved_kbuild_include_opts &&
+ !IS_ERR(saved_kbuild_dir) && !IS_ERR(saved_kbuild_include_opts)) {
+ *kbuild_dir = strdup(saved_kbuild_dir);
+ *kbuild_include_opts = strdup(saved_kbuild_include_opts);
+
+ if (*kbuild_dir && *kbuild_include_opts)
+ return;
+
+ zfree(kbuild_dir);
+ zfree(kbuild_include_opts);
+ /*
+ * Don't fall through: it may breaks saved_kbuild_dir and
+ * saved_kbuild_include_opts if detect them again when
+ * memory is low.
+ */
+ return;
+ }
+
if (llvm_param.kbuild_dir && !llvm_param.kbuild_dir[0]) {
pr_debug("[llvm.kbuild-dir] is set to \"\" deliberately.\n");
pr_debug("Skip kbuild options detection.\n");
- return;
+ goto errout;
}
err = detect_kbuild_dir(kbuild_dir);
@@ -306,7 +326,7 @@ get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts)
"Hint:\tSet correct kbuild directory using 'kbuild-dir' option in [llvm]\n"
" \tsection of ~/.perfconfig or set it to \"\" to suppress kbuild\n"
" \tdetection.\n\n");
- return;
+ goto errout;
}
pr_debug("Kernel build dir is set to %s\n", *kbuild_dir);
@@ -325,14 +345,43 @@ get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts)
free(*kbuild_dir);
*kbuild_dir = NULL;
- return;
+ goto errout;
}
pr_debug("include option is set to %s\n", *kbuild_include_opts);
+
+ saved_kbuild_dir = strdup(*kbuild_dir);
+ saved_kbuild_include_opts = strdup(*kbuild_include_opts);
+
+ if (!saved_kbuild_dir || !saved_kbuild_include_opts) {
+ zfree(&saved_kbuild_dir);
+ zfree(&saved_kbuild_include_opts);
+ }
+ return;
+errout:
+ saved_kbuild_dir = ERR_PTR(-EINVAL);
+ saved_kbuild_include_opts = ERR_PTR(-EINVAL);
}
-static void
-dump_obj(const char *path, void *obj_buf, size_t size)
+int llvm__get_nr_cpus(void)
+{
+ static int nr_cpus_avail = 0;
+ char serr[STRERR_BUFSIZE];
+
+ if (nr_cpus_avail > 0)
+ return nr_cpus_avail;
+
+ nr_cpus_avail = sysconf(_SC_NPROCESSORS_CONF);
+ if (nr_cpus_avail <= 0) {
+ pr_err(
+"WARNING:\tunable to get available CPUs in this system: %s\n"
+" \tUse 128 instead.\n", str_error_r(errno, serr, sizeof(serr)));
+ nr_cpus_avail = 128;
+ }
+ return nr_cpus_avail;
+}
+
+void llvm__dump_obj(const char *path, void *obj_buf, size_t size)
{
char *obj_path = strdup(path);
FILE *fp;
@@ -406,15 +455,9 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
* This is an optional work. Even it fail we can continue our
* work. Needn't to check error return.
*/
- get_kbuild_opts(&kbuild_dir, &kbuild_include_opts);
+ llvm__get_kbuild_opts(&kbuild_dir, &kbuild_include_opts);
- nr_cpus_avail = sysconf(_SC_NPROCESSORS_CONF);
- if (nr_cpus_avail <= 0) {
- pr_err(
-"WARNING:\tunable to get available CPUs in this system: %s\n"
-" \tUse 128 instead.\n", str_error_r(errno, serr, sizeof(serr)));
- nr_cpus_avail = 128;
- }
+ nr_cpus_avail = llvm__get_nr_cpus();
snprintf(nr_cpus_avail_str, sizeof(nr_cpus_avail_str), "%d",
nr_cpus_avail);
@@ -453,9 +496,6 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
free(kbuild_dir);
free(kbuild_include_opts);
- if (llvm_param.dump_obj)
- dump_obj(path, obj_buf, obj_buf_sz);
-
if (!p_obj_buf)
free(obj_buf);
else
diff --git a/tools/perf/util/llvm-utils.h b/tools/perf/util/llvm-utils.h
index 9f501cef06a1..c87a2a92a88f 100644
--- a/tools/perf/util/llvm-utils.h
+++ b/tools/perf/util/llvm-utils.h
@@ -50,4 +50,10 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf, size_t *p_obj_buf_sz);
/* This function is for test__llvm() use only */
int llvm__search_clang(void);
+
+/* Following functions are reused by builtin clang support */
+void llvm__get_kbuild_opts(char **kbuild_dir, char **kbuild_include_opts);
+int llvm__get_nr_cpus(void);
+
+void llvm__dump_obj(const char *path, void *obj_buf, size_t size);
#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 05/20] tools build: Add feature detection for LLVM
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 04/20] perf llvm: Extract helpers in llvm-utils.c Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 06/20] tools build: Add feature detection for clang Arnaldo Carvalho de Melo
` (15 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Check if basic LLVM compiling environment is ready.
Use llvm-config to detect include and library directories. Avoid using
'llvm-config --cxxflags' because its result contain some unwanted flags
like --sysroot (if LLVM is built by yocto).
Use '?=' to set LLVM_CONFIG, so explicitly passing LLVM_CONFIG to make
would override it.
Use 'llvm-config --libs BPF' to check if BPF backend is compiled in.
Since now BPF bytecode is the only required backend, no need to waste
time linking llvm and clang if BPF backend is missing. This also
introduce an implicit requirement that LLVM should be new enough. Old
LLVM doesn't support BPF backend.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-8-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/feature/Makefile | 8 ++++++++
tools/build/feature/test-llvm.cpp | 8 ++++++++
2 files changed, 16 insertions(+)
create mode 100644 tools/build/feature/test-llvm.cpp
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 8f668bce8996..c09de59affc9 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -55,6 +55,7 @@ FILES := $(addprefix $(OUTPUT),$(FILES))
CC := $(CROSS_COMPILE)gcc -MD
CXX := $(CROSS_COMPILE)g++ -MD
PKG_CONFIG := $(CROSS_COMPILE)pkg-config
+LLVM_CONFIG ?= llvm-config
all: $(FILES)
@@ -229,6 +230,13 @@ $(OUTPUT)test-cxx.bin:
$(OUTPUT)test-jvmti.bin:
$(BUILD)
+$(OUTPUT)test-llvm.bin:
+ $(BUILDXX) -std=gnu++11 \
+ -I$(shell $(LLVM_CONFIG) --includedir) \
+ -L$(shell $(LLVM_CONFIG) --libdir) \
+ $(shell $(LLVM_CONFIG) --libs Core BPF) \
+ $(shell $(LLVM_CONFIG) --system-libs)
+
-include $(OUTPUT)*.d
###############################
diff --git a/tools/build/feature/test-llvm.cpp b/tools/build/feature/test-llvm.cpp
new file mode 100644
index 000000000000..d8d2cee35345
--- /dev/null
+++ b/tools/build/feature/test-llvm.cpp
@@ -0,0 +1,8 @@
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/raw_ostream.h"
+int main()
+{
+ llvm::errs() << "Hello World!\n";
+ llvm::llvm_shutdown();
+ return 0;
+}
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 06/20] tools build: Add feature detection for clang
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 05/20] tools build: Add feature detection for LLVM Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 07/20] perf build: Add clang and llvm compile and linking support Arnaldo Carvalho de Melo
` (14 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Check if basic clang compiling environment is ready.
Doesn't like 'llvm-config --libs' which can returns llvm libraries in right
order and duplicates some libraries if necessary, there's no correspondence for
clang libraries (-lclangxxx). to avoid extra complexity and to avoid new clang
breaking libraries ordering, use --start-group and --end-group.
In this test case, manually identify required clang libs and hope it to be
stable. Putting all clang libraries here is possible (use make's wildcard), but
then feature checking becomes very slow.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-9-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/feature/Makefile | 10 ++++++++++
tools/build/feature/test-clang.cpp | 21 +++++++++++++++++++++
2 files changed, 31 insertions(+)
create mode 100644 tools/build/feature/test-clang.cpp
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index c09de59affc9..871d5536951d 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -237,6 +237,16 @@ $(OUTPUT)test-llvm.bin:
$(shell $(LLVM_CONFIG) --libs Core BPF) \
$(shell $(LLVM_CONFIG) --system-libs)
+$(OUTPUT)test-clang.bin:
+ $(BUILDXX) -std=gnu++11 \
+ -I$(shell $(LLVM_CONFIG) --includedir) \
+ -L$(shell $(LLVM_CONFIG) --libdir) \
+ -Wl,--start-group -lclangBasic -lclangDriver \
+ -lclangFrontend -lclangEdit -lclangLex \
+ -lclangAST -Wl,--end-group \
+ $(shell $(LLVM_CONFIG) --libs Core option) \
+ $(shell $(LLVM_CONFIG) --system-libs)
+
-include $(OUTPUT)*.d
###############################
diff --git a/tools/build/feature/test-clang.cpp b/tools/build/feature/test-clang.cpp
new file mode 100644
index 000000000000..e23c1b1f1b91
--- /dev/null
+++ b/tools/build/feature/test-clang.cpp
@@ -0,0 +1,21 @@
+#include "clang/Basic/VirtualFileSystem.h"
+#include "clang/Driver/Driver.h"
+#include "clang/Frontend/TextDiagnosticPrinter.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace clang;
+using namespace clang::driver;
+
+int main()
+{
+ IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
+ IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
+
+ DiagnosticsEngine Diags(DiagID, &*DiagOpts);
+ Driver TheDriver("test", "bpf-pc-linux", Diags);
+
+ llvm::llvm_shutdown();
+ return 0;
+}
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 07/20] perf build: Add clang and llvm compile and linking support
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (5 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 06/20] tools build: Add feature detection for clang Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 08/20] perf clang: Add builtin clang support ant test case Arnaldo Carvalho de Melo
` (13 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Add necessary c++ flags and link libraries to support builtin clang and
LLVM. Add all llvm and clang libraries, so don't need to worry about
clang changes its libraries setting. However, linking perf would take
much longer than usual.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-10-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile.config | 35 +++++++++++++++++++++++++++++++++++
tools/perf/Makefile.perf | 23 ++++++++++++++++++++++-
tools/perf/tests/make | 2 ++
3 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 8a493d46fab9..b7c9c8051a33 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -136,6 +136,7 @@ endif
# Treat warnings as errors unless directed not to
ifneq ($(WERROR),0)
CFLAGS += -Werror
+ CXXFLAGS += -Werror
endif
ifndef DEBUG
@@ -182,6 +183,13 @@ CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -std=gnu99
+CXXFLAGS += -std=gnu++11 -fno-exceptions -fno-rtti
+CXXFLAGS += -Wall
+CXXFLAGS += -fno-omit-frame-pointer
+CXXFLAGS += -ggdb3
+CXXFLAGS += -funwind-tables
+CXXFLAGS += -Wno-strict-aliasing
+
# Enforce a non-executable stack, as we may regress (again) in the future by
# adding assembler files missing the .GNU-stack linker note.
LDFLAGS += -Wl,-z,noexecstack
@@ -783,6 +791,33 @@ ifndef NO_JVMTI
endif
endif
+USE_CXX = 0
+USE_CLANGLLVM = 0
+ifdef LIBCLANGLLVM
+ $(call feature_check,cxx)
+ ifneq ($(feature-cxx), 1)
+ msg := $(warning No g++ found, disable clang and llvm support. Please install g++)
+ else
+ $(call feature_check,llvm)
+ ifneq ($(feature-llvm), 1)
+ msg := $(warning No libLLVM found, disable clang and llvm support. Please install llvm-dev)
+ else
+ $(call feature_check,clang)
+ ifneq ($(feature-clang), 1)
+ msg := $(warning No libclang found, disable clang and llvm support. Please install libclang-dev)
+ else
+ CFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT
+ CXXFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT -I$(shell $(LLVM_CONFIG) --includedir)
+ $(call detected,CONFIG_CXX)
+ $(call detected,CONFIG_CLANGLLVM)
+ USE_CXX = 1
+ USE_LLVM = 1
+ USE_CLANG = 1
+ endif
+ endif
+ endif
+endif
+
# Among the variables below, these:
# perfexecdir
# template_dir
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 3cb1df43ad3e..dfb20dd31865 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -88,6 +88,10 @@ include ../scripts/utilities.mak
# and bypass the feature detection
#
# Define NO_JVMTI if you do not want jvmti agent built
+#
+# Define LIBCLANGLLVM if you DO want builtin clang and llvm support.
+# When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if
+# llvm-config is not in $PATH.
# As per kernel Makefile, avoid funny character set dependencies
unexport LC_ALL
@@ -143,6 +147,7 @@ endef
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
$(call allow-override,AR,$(CROSS_COMPILE)ar)
$(call allow-override,LD,$(CROSS_COMPILE)ld)
+$(call allow-override,CXX,$(CROSS_COMPILE)g++)
LD += $(EXTRA_LDFLAGS)
@@ -151,6 +156,7 @@ HOSTLD ?= ld
HOSTAR ?= ar
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
+LLVM_CONFIG ?= llvm-config
RM = rm -f
LN = ln -f
@@ -338,6 +344,21 @@ endif
LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+ifeq ($(USE_CLANG), 1)
+ CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization
+ LIBCLANG = $(foreach l,$(CLANGLIBS_LIST),$(wildcard $(shell $(LLVM_CONFIG) --libdir)/libclang$(l).a))
+ LIBS += -Wl,--start-group $(LIBCLANG) -Wl,--end-group
+endif
+
+ifeq ($(USE_LLVM), 1)
+ LIBLLVM = $(shell $(LLVM_CONFIG) --libs all) $(shell $(LLVM_CONFIG) --system-libs)
+ LIBS += -L$(shell $(LLVM_CONFIG) --libdir) $(LIBLLVM)
+endif
+
+ifeq ($(USE_CXX), 1)
+ LIBS += -lstdc++
+endif
+
export INSTALL SHELL_PATH
### Build rules
@@ -356,7 +377,7 @@ strip: $(PROGRAMS) $(OUTPUT)perf
PERF_IN := $(OUTPUT)perf-in.o
-export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
+export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK
export HOSTCC HOSTLD HOSTAR
include $(srctree)/tools/build/Makefile.include
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 08ed7f12cc37..aa49b6600d1f 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -83,6 +83,7 @@ make_no_libbpf := NO_LIBBPF=1
make_no_libcrypto := NO_LIBCRYPTO=1
make_with_babeltrace:= LIBBABELTRACE=1
make_no_sdt := NO_SDT=1
+make_with_clangllvm := LIBCLANGLLVM=1
make_tags := tags
make_cscope := cscope
make_help := help
@@ -139,6 +140,7 @@ run += make_no_libbionic
run += make_no_auxtrace
run += make_no_libbpf
run += make_with_babeltrace
+run += make_with_clangllvm
run += make_help
run += make_doc
run += make_perf_o
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 08/20] perf clang: Add builtin clang support ant test case
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (6 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 07/20] perf build: Add clang and llvm compile and linking support Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 09/20] perf clang: Use real file system for #include Arnaldo Carvalho de Melo
` (12 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Add basic clang support in clang.cpp and test__clang() testcase. The
first testcase checks if builtin clang is able to generate LLVM IR.
tests/clang.c is a proxy. Real testcase resides in
utils/c++/clang-test.cpp in c++ and exports C interface to perf test
subsystem.
Test result:
$ perf test -v clang
51: builtin clang support :
51.1: Test builtin clang compile C source to IR :
--- start ---
test child forked, pid 13215
test child finished with 0
---- end ----
Test builtin clang support subtest 0: Ok
Committer note:
Make sure you've enabled CLANG and LLVM builtin support by setting
the LIBCLANGLLVM variable on the make command line, e.g.:
make LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin
Otherwise you'll get this when trying to do the 'perf test' call above:
# perf test clang
51: builtin clang support : Skip (not compiled in)
#
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-11-wangnan0@huawei.com
[ Removed "Test" from descriptions, redundant and already removed from all the other entries ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/Build | 1 +
tools/perf/tests/builtin-test.c | 9 ++++
tools/perf/tests/clang.c | 42 +++++++++++++++++
tools/perf/tests/tests.h | 3 ++
tools/perf/util/Build | 2 +
tools/perf/util/c++/Build | 2 +
tools/perf/util/c++/clang-c.h | 16 +++++++
tools/perf/util/c++/clang-test.cpp | 31 ++++++++++++
tools/perf/util/c++/clang.cpp | 96 ++++++++++++++++++++++++++++++++++++++
tools/perf/util/c++/clang.h | 16 +++++++
10 files changed, 218 insertions(+)
create mode 100644 tools/perf/tests/clang.c
create mode 100644 tools/perf/util/c++/Build
create mode 100644 tools/perf/util/c++/clang-c.h
create mode 100644 tools/perf/util/c++/clang-test.cpp
create mode 100644 tools/perf/util/c++/clang.cpp
create mode 100644 tools/perf/util/c++/clang.h
diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index af3ec94869aa..6676c2dd6dcb 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -43,6 +43,7 @@ perf-y += sdt.o
perf-y += is_printable_array.o
perf-y += bitmap.o
perf-y += perf-hooks.o
+perf-y += clang.o
$(OUTPUT)tests/llvm-src-base.c: tests/bpf-script-example.c tests/Build
$(call rule_mkdir)
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index d1bec0444be7..23605202d4a1 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -234,6 +234,15 @@ static struct test generic_tests[] = {
.func = test__perf_hooks,
},
{
+ .desc = "builtin clang support",
+ .func = test__clang,
+ .subtest = {
+ .skip_if_fail = true,
+ .get_nr = test__clang_subtest_get_nr,
+ .get_desc = test__clang_subtest_get_desc,
+ }
+ },
+ {
.func = NULL,
},
};
diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c
new file mode 100644
index 000000000000..636d6d0e9037
--- /dev/null
+++ b/tools/perf/tests/clang.c
@@ -0,0 +1,42 @@
+#include "tests.h"
+#include "debug.h"
+#include "util.h"
+#include "c++/clang-c.h"
+
+static struct {
+ int (*func)(void);
+ const char *desc;
+} clang_testcase_table[] = {
+#ifdef HAVE_LIBCLANGLLVM_SUPPORT
+ {
+ .func = test__clang_to_IR,
+ .desc = "builtin clang compile C source to IR",
+ },
+#endif
+};
+
+int test__clang_subtest_get_nr(void)
+{
+ return (int)ARRAY_SIZE(clang_testcase_table);
+}
+
+const char *test__clang_subtest_get_desc(int i)
+{
+ if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
+ return NULL;
+ return clang_testcase_table[i].desc;
+}
+
+#ifndef HAVE_LIBCLANGLLVM_SUPPORT
+int test__clang(int i __maybe_unused)
+{
+ return TEST_SKIP;
+}
+#else
+int test__clang(int i __maybe_unused)
+{
+ if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
+ return TEST_FAIL;
+ return clang_testcase_table[i].func();
+}
+#endif
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 3a1f98f291ba..0d7b251305af 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -92,6 +92,9 @@ int test__sdt_event(int subtest);
int test__is_printable_array(int subtest);
int test__bitmap_print(int subtest);
int test__perf_hooks(int subtest);
+int test__clang(int subtest);
+const char *test__clang_subtest_get_desc(int subtest);
+int test__clang_subtest_get_nr(void);
#if defined(__arm__) || defined(__aarch64__)
#ifdef HAVE_DWARF_UNWIND_SUPPORT
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index bdad82a9812d..3840e3a87057 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -126,6 +126,8 @@ endif
libperf-y += perf-hooks.o
+libperf-$(CONFIG_CXX) += c++/
+
CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
# avoid compiler warnings in 32-bit mode
CFLAGS_genelf_debug.o += -Wno-packed
diff --git a/tools/perf/util/c++/Build b/tools/perf/util/c++/Build
new file mode 100644
index 000000000000..988fef1b11d7
--- /dev/null
+++ b/tools/perf/util/c++/Build
@@ -0,0 +1,2 @@
+libperf-$(CONFIG_CLANGLLVM) += clang.o
+libperf-$(CONFIG_CLANGLLVM) += clang-test.o
diff --git a/tools/perf/util/c++/clang-c.h b/tools/perf/util/c++/clang-c.h
new file mode 100644
index 000000000000..dcde4b564f3b
--- /dev/null
+++ b/tools/perf/util/c++/clang-c.h
@@ -0,0 +1,16 @@
+#ifndef PERF_UTIL_CLANG_C_H
+#define PERF_UTIL_CLANG_C_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void perf_clang__init(void);
+extern void perf_clang__cleanup(void);
+
+extern int test__clang_to_IR(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/tools/perf/util/c++/clang-test.cpp b/tools/perf/util/c++/clang-test.cpp
new file mode 100644
index 000000000000..3da6bfa4bc54
--- /dev/null
+++ b/tools/perf/util/c++/clang-test.cpp
@@ -0,0 +1,31 @@
+#include "clang.h"
+#include "clang-c.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/LLVMContext.h"
+
+class perf_clang_scope {
+public:
+ explicit perf_clang_scope() {perf_clang__init();}
+ ~perf_clang_scope() {perf_clang__cleanup();}
+};
+
+extern "C" {
+
+int test__clang_to_IR(void)
+{
+ perf_clang_scope _scope;
+
+ std::unique_ptr<llvm::Module> M =
+ perf::getModuleFromSource("perf-test.c",
+ "int myfunc(void) {return 1;}");
+
+ if (!M)
+ return -1;
+
+ for (llvm::Function& F : *M)
+ if (F.getName() == "myfunc")
+ return 0;
+ return -1;
+}
+
+}
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
new file mode 100644
index 000000000000..c17b1176e25d
--- /dev/null
+++ b/tools/perf/util/c++/clang.cpp
@@ -0,0 +1,96 @@
+/*
+ * llvm C frontend for perf. Support dynamically compile C file
+ *
+ * Inspired by clang example code:
+ * http://llvm.org/svn/llvm-project/cfe/trunk/examples/clang-interpreter/main.cpp
+ *
+ * Copyright (C) 2016 Wang Nan <wangnan0@huawei.com>
+ * Copyright (C) 2016 Huawei Inc.
+ */
+
+#include "clang/CodeGen/CodeGenAction.h"
+#include "clang/Frontend/CompilerInvocation.h"
+#include "clang/Frontend/CompilerInstance.h"
+#include "clang/Frontend/TextDiagnosticPrinter.h"
+#include "clang/Tooling/Tooling.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Option/Option.h"
+#include "llvm/Support/ManagedStatic.h"
+#include <memory>
+
+#include "clang.h"
+#include "clang-c.h"
+
+namespace perf {
+
+static std::unique_ptr<llvm::LLVMContext> LLVMCtx;
+
+using namespace clang;
+
+static vfs::InMemoryFileSystem *
+buildVFS(StringRef& Name, StringRef& Content)
+{
+ vfs::InMemoryFileSystem *VFS = new vfs::InMemoryFileSystem(true);
+ VFS->addFile(Twine(Name), 0, llvm::MemoryBuffer::getMemBuffer(Content));
+ return VFS;
+}
+
+static CompilerInvocation *
+createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags)
+{
+ llvm::opt::ArgStringList CCArgs {
+ "-cc1",
+ "-triple", "bpf-pc-linux",
+ "-fsyntax-only",
+ "-ferror-limit", "19",
+ "-fmessage-length", "127",
+ "-O2",
+ "-nostdsysteminc",
+ "-nobuiltininc",
+ "-vectorize-loops",
+ "-vectorize-slp",
+ "-Wno-unused-value",
+ "-Wno-pointer-sign",
+ "-x", "c"};
+ CompilerInvocation *CI = tooling::newInvocation(&Diags, CCArgs);
+
+ FrontendOptions& Opts = CI->getFrontendOpts();
+ Opts.Inputs.clear();
+ Opts.Inputs.emplace_back(Path, IK_C);
+ return CI;
+}
+
+std::unique_ptr<llvm::Module>
+getModuleFromSource(StringRef Name, StringRef Content)
+{
+ CompilerInstance Clang;
+ Clang.createDiagnostics();
+
+ IntrusiveRefCntPtr<vfs::FileSystem> VFS = buildVFS(Name, Content);
+ Clang.setVirtualFileSystem(&*VFS);
+
+ IntrusiveRefCntPtr<CompilerInvocation> CI =
+ createCompilerInvocation(Name, Clang.getDiagnostics());
+ Clang.setInvocation(&*CI);
+
+ std::unique_ptr<CodeGenAction> Act(new EmitLLVMOnlyAction(&*LLVMCtx));
+ if (!Clang.ExecuteAction(*Act))
+ return std::unique_ptr<llvm::Module>(nullptr);
+
+ return Act->takeModule();
+}
+
+}
+
+extern "C" {
+void perf_clang__init(void)
+{
+ perf::LLVMCtx.reset(new llvm::LLVMContext());
+}
+
+void perf_clang__cleanup(void)
+{
+ perf::LLVMCtx.reset(nullptr);
+ llvm::llvm_shutdown();
+}
+}
diff --git a/tools/perf/util/c++/clang.h b/tools/perf/util/c++/clang.h
new file mode 100644
index 000000000000..f64483be43d0
--- /dev/null
+++ b/tools/perf/util/c++/clang.h
@@ -0,0 +1,16 @@
+#ifndef PERF_UTIL_CLANG_H
+#define PERF_UTIL_CLANG_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
+#include <memory>
+namespace perf {
+
+using namespace llvm;
+
+std::unique_ptr<Module>
+getModuleFromSource(StringRef Name, StringRef Content);
+
+}
+#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 09/20] perf clang: Use real file system for #include
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (7 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 08/20] perf clang: Add builtin clang support ant test case Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 10/20] perf clang: Allow passing CFLAGS to builtin clang Arnaldo Carvalho de Melo
` (11 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Utilize clang's OverlayFileSystem facility, allow CompilerInstance to
access real file system.
With this patch the '#include' directive can be used.
Add a new getModuleFromSource for real file.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-12-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/c++/clang.cpp | 44 +++++++++++++++++++++++++++++++------------
tools/perf/util/c++/clang.h | 3 +++
2 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index c17b1176e25d..cf96199b4b6f 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -15,6 +15,7 @@
#include "clang/Tooling/Tooling.h"
#include "llvm/IR/Module.h"
#include "llvm/Option/Option.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
#include <memory>
@@ -27,14 +28,6 @@ static std::unique_ptr<llvm::LLVMContext> LLVMCtx;
using namespace clang;
-static vfs::InMemoryFileSystem *
-buildVFS(StringRef& Name, StringRef& Content)
-{
- vfs::InMemoryFileSystem *VFS = new vfs::InMemoryFileSystem(true);
- VFS->addFile(Twine(Name), 0, llvm::MemoryBuffer::getMemBuffer(Content));
- return VFS;
-}
-
static CompilerInvocation *
createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags)
{
@@ -60,17 +53,17 @@ createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags)
return CI;
}
-std::unique_ptr<llvm::Module>
-getModuleFromSource(StringRef Name, StringRef Content)
+static std::unique_ptr<llvm::Module>
+getModuleFromSource(StringRef Path,
+ IntrusiveRefCntPtr<vfs::FileSystem> VFS)
{
CompilerInstance Clang;
Clang.createDiagnostics();
- IntrusiveRefCntPtr<vfs::FileSystem> VFS = buildVFS(Name, Content);
Clang.setVirtualFileSystem(&*VFS);
IntrusiveRefCntPtr<CompilerInvocation> CI =
- createCompilerInvocation(Name, Clang.getDiagnostics());
+ createCompilerInvocation(Path, Clang.getDiagnostics());
Clang.setInvocation(&*CI);
std::unique_ptr<CodeGenAction> Act(new EmitLLVMOnlyAction(&*LLVMCtx));
@@ -80,6 +73,33 @@ getModuleFromSource(StringRef Name, StringRef Content)
return Act->takeModule();
}
+std::unique_ptr<llvm::Module>
+getModuleFromSource(StringRef Name, StringRef Content)
+{
+ using namespace vfs;
+
+ llvm::IntrusiveRefCntPtr<OverlayFileSystem> OverlayFS(
+ new OverlayFileSystem(getRealFileSystem()));
+ llvm::IntrusiveRefCntPtr<InMemoryFileSystem> MemFS(
+ new InMemoryFileSystem(true));
+
+ /*
+ * pushOverlay helps setting working dir for MemFS. Must call
+ * before addFile.
+ */
+ OverlayFS->pushOverlay(MemFS);
+ MemFS->addFile(Twine(Name), 0, llvm::MemoryBuffer::getMemBuffer(Content));
+
+ return getModuleFromSource(Name, OverlayFS);
+}
+
+std::unique_ptr<llvm::Module>
+getModuleFromSource(StringRef Path)
+{
+ IntrusiveRefCntPtr<vfs::FileSystem> VFS(vfs::getRealFileSystem());
+ return getModuleFromSource(Path, VFS);
+}
+
}
extern "C" {
diff --git a/tools/perf/util/c++/clang.h b/tools/perf/util/c++/clang.h
index f64483be43d0..90aff0162f1c 100644
--- a/tools/perf/util/c++/clang.h
+++ b/tools/perf/util/c++/clang.h
@@ -12,5 +12,8 @@ using namespace llvm;
std::unique_ptr<Module>
getModuleFromSource(StringRef Name, StringRef Content);
+std::unique_ptr<Module>
+getModuleFromSource(StringRef Path);
+
}
#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 10/20] perf clang: Allow passing CFLAGS to builtin clang
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (8 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 09/20] perf clang: Use real file system for #include Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 11/20] perf clang: Update test case to use real BPF script Arnaldo Carvalho de Melo
` (10 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Improve getModuleFromSource() API to accept a cflags list. This feature
will be used to pass LINUX_VERSION_CODE and -I flags.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-13-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/c++/clang-test.cpp | 5 +++--
tools/perf/util/c++/clang.cpp | 21 +++++++++++++--------
tools/perf/util/c++/clang.h | 8 ++++++--
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/c++/clang-test.cpp b/tools/perf/util/c++/clang-test.cpp
index 3da6bfa4bc54..0f484fbb2b58 100644
--- a/tools/perf/util/c++/clang-test.cpp
+++ b/tools/perf/util/c++/clang-test.cpp
@@ -16,8 +16,9 @@ int test__clang_to_IR(void)
perf_clang_scope _scope;
std::unique_ptr<llvm::Module> M =
- perf::getModuleFromSource("perf-test.c",
- "int myfunc(void) {return 1;}");
+ perf::getModuleFromSource({"-DRESULT=1"},
+ "perf-test.c",
+ "int myfunc(void) {return RESULT;}");
if (!M)
return -1;
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index cf96199b4b6f..715ca0a3dee0 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -29,7 +29,8 @@ static std::unique_ptr<llvm::LLVMContext> LLVMCtx;
using namespace clang;
static CompilerInvocation *
-createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags)
+createCompilerInvocation(llvm::opt::ArgStringList CFlags, StringRef& Path,
+ DiagnosticsEngine& Diags)
{
llvm::opt::ArgStringList CCArgs {
"-cc1",
@@ -45,6 +46,8 @@ createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags)
"-Wno-unused-value",
"-Wno-pointer-sign",
"-x", "c"};
+
+ CCArgs.append(CFlags.begin(), CFlags.end());
CompilerInvocation *CI = tooling::newInvocation(&Diags, CCArgs);
FrontendOptions& Opts = CI->getFrontendOpts();
@@ -54,8 +57,8 @@ createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags)
}
static std::unique_ptr<llvm::Module>
-getModuleFromSource(StringRef Path,
- IntrusiveRefCntPtr<vfs::FileSystem> VFS)
+getModuleFromSource(llvm::opt::ArgStringList CFlags,
+ StringRef Path, IntrusiveRefCntPtr<vfs::FileSystem> VFS)
{
CompilerInstance Clang;
Clang.createDiagnostics();
@@ -63,7 +66,8 @@ getModuleFromSource(StringRef Path,
Clang.setVirtualFileSystem(&*VFS);
IntrusiveRefCntPtr<CompilerInvocation> CI =
- createCompilerInvocation(Path, Clang.getDiagnostics());
+ createCompilerInvocation(std::move(CFlags), Path,
+ Clang.getDiagnostics());
Clang.setInvocation(&*CI);
std::unique_ptr<CodeGenAction> Act(new EmitLLVMOnlyAction(&*LLVMCtx));
@@ -74,7 +78,8 @@ getModuleFromSource(StringRef Path,
}
std::unique_ptr<llvm::Module>
-getModuleFromSource(StringRef Name, StringRef Content)
+getModuleFromSource(llvm::opt::ArgStringList CFlags,
+ StringRef Name, StringRef Content)
{
using namespace vfs;
@@ -90,14 +95,14 @@ getModuleFromSource(StringRef Name, StringRef Content)
OverlayFS->pushOverlay(MemFS);
MemFS->addFile(Twine(Name), 0, llvm::MemoryBuffer::getMemBuffer(Content));
- return getModuleFromSource(Name, OverlayFS);
+ return getModuleFromSource(std::move(CFlags), Name, OverlayFS);
}
std::unique_ptr<llvm::Module>
-getModuleFromSource(StringRef Path)
+getModuleFromSource(llvm::opt::ArgStringList CFlags, StringRef Path)
{
IntrusiveRefCntPtr<vfs::FileSystem> VFS(vfs::getRealFileSystem());
- return getModuleFromSource(Path, VFS);
+ return getModuleFromSource(std::move(CFlags), Path, VFS);
}
}
diff --git a/tools/perf/util/c++/clang.h b/tools/perf/util/c++/clang.h
index 90aff0162f1c..b4fc2a96b79d 100644
--- a/tools/perf/util/c++/clang.h
+++ b/tools/perf/util/c++/clang.h
@@ -4,16 +4,20 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/Option/Option.h"
#include <memory>
+
namespace perf {
using namespace llvm;
std::unique_ptr<Module>
-getModuleFromSource(StringRef Name, StringRef Content);
+getModuleFromSource(opt::ArgStringList CFlags,
+ StringRef Name, StringRef Content);
std::unique_ptr<Module>
-getModuleFromSource(StringRef Path);
+getModuleFromSource(opt::ArgStringList CFlags,
+ StringRef Path);
}
#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 11/20] perf clang: Update test case to use real BPF script
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (9 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 10/20] perf clang: Allow passing CFLAGS to builtin clang Arnaldo Carvalho de Melo
@ 2016-12-05 21:37 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 12/20] perf clang: Support compile IR to BPF object and add testcase Arnaldo Carvalho de Melo
` (9 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Allow C++ code to use util.h and tests/llvm.h. Let 'perf test' compile a
real BPF script.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-14-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile.config | 27 +++++++++++++++------------
tools/perf/tests/llvm.h | 7 +++++++
tools/perf/util/c++/clang-test.cpp | 17 ++++++++++++++---
tools/perf/util/util-cxx.h | 26 ++++++++++++++++++++++++++
4 files changed, 62 insertions(+), 15 deletions(-)
create mode 100644 tools/perf/util/util-cxx.h
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index b7c9c8051a33..09c2a9874f2f 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -212,24 +212,27 @@ ifeq ($(DEBUG),0)
endif
endif
-CFLAGS += -I$(src-perf)/util/include
-CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
-CFLAGS += -I$(srctree)/tools/include/uapi
-CFLAGS += -I$(srctree)/tools/include/
-CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/uapi
-CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/
-CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/
+INC_FLAGS += -I$(src-perf)/util/include
+INC_FLAGS += -I$(src-perf)/arch/$(ARCH)/include
+INC_FLAGS += -I$(srctree)/tools/include/uapi
+INC_FLAGS += -I$(srctree)/tools/include/
+INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/uapi
+INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/
+INC_FLAGS += -I$(srctree)/tools/arch/$(ARCH)/
# $(obj-perf) for generated common-cmds.h
# $(obj-perf)/util for generated bison/flex headers
ifneq ($(OUTPUT),)
-CFLAGS += -I$(obj-perf)/util
-CFLAGS += -I$(obj-perf)
+INC_FLAGS += -I$(obj-perf)/util
+INC_FLAGS += -I$(obj-perf)
endif
-CFLAGS += -I$(src-perf)/util
-CFLAGS += -I$(src-perf)
-CFLAGS += -I$(srctree)/tools/lib/
+INC_FLAGS += -I$(src-perf)/util
+INC_FLAGS += -I$(src-perf)
+INC_FLAGS += -I$(srctree)/tools/lib/
+
+CFLAGS += $(INC_FLAGS)
+CXXFLAGS += $(INC_FLAGS)
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
diff --git a/tools/perf/tests/llvm.h b/tools/perf/tests/llvm.h
index 0eaa604be99d..b83571758d83 100644
--- a/tools/perf/tests/llvm.h
+++ b/tools/perf/tests/llvm.h
@@ -1,6 +1,10 @@
#ifndef PERF_TEST_LLVM_H
#define PERF_TEST_LLVM_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stddef.h> /* for size_t */
#include <stdbool.h> /* for bool */
@@ -20,4 +24,7 @@ enum test_llvm__testcase {
int test_llvm__fetch_bpf_obj(void **p_obj_buf, size_t *p_obj_buf_sz,
enum test_llvm__testcase index, bool force,
bool *should_load_fail);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/tools/perf/util/c++/clang-test.cpp b/tools/perf/util/c++/clang-test.cpp
index 0f484fbb2b58..d84e760d2aab 100644
--- a/tools/perf/util/c++/clang-test.cpp
+++ b/tools/perf/util/c++/clang-test.cpp
@@ -3,6 +3,10 @@
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
+#include <util-cxx.h>
+#include <tests/llvm.h>
+#include <string>
+
class perf_clang_scope {
public:
explicit perf_clang_scope() {perf_clang__init();}
@@ -14,17 +18,24 @@ extern "C" {
int test__clang_to_IR(void)
{
perf_clang_scope _scope;
+ unsigned int kernel_version;
+
+ if (fetch_kernel_version(&kernel_version, NULL, 0))
+ return -1;
+
+ std::string cflag_kver("-DLINUX_VERSION_CODE=" +
+ std::to_string(kernel_version));
std::unique_ptr<llvm::Module> M =
- perf::getModuleFromSource({"-DRESULT=1"},
+ perf::getModuleFromSource({cflag_kver.c_str()},
"perf-test.c",
- "int myfunc(void) {return RESULT;}");
+ test_llvm__bpf_base_prog);
if (!M)
return -1;
for (llvm::Function& F : *M)
- if (F.getName() == "myfunc")
+ if (F.getName() == "bpf_func__SyS_epoll_wait")
return 0;
return -1;
}
diff --git a/tools/perf/util/util-cxx.h b/tools/perf/util/util-cxx.h
new file mode 100644
index 000000000000..0e0e019c9f34
--- /dev/null
+++ b/tools/perf/util/util-cxx.h
@@ -0,0 +1,26 @@
+/*
+ * Support C++ source use utilities defined in util.h
+ */
+
+#ifndef PERF_UTIL_UTIL_CXX_H
+#define PERF_UTIL_UTIL_CXX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Now 'new' is the only C++ keyword found in util.h:
+ * in tools/include/linux/rbtree.h
+ *
+ * Other keywords, like class and delete, should be
+ * redefined if necessary.
+ */
+#define new _new
+#include "util.h"
+#undef new
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 12/20] perf clang: Support compile IR to BPF object and add testcase
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (10 preceding siblings ...)
2016-12-05 21:37 ` [PATCH 11/20] perf clang: Update test case to use real BPF script Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 13/20] perf clang: Compile BPF script using builtin clang support Arnaldo Carvalho de Melo
` (8 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
getBPFObjectFromModule() is introduced to compile LLVM IR(Module)
to BPF object. Add new testcase for it.
Test result:
$ ./buildperf/perf test -v clang
51: builtin clang support :
51.1: builtin clang compile C source to IR :
--- start ---
test child forked, pid 21822
test child finished with 0
---- end ----
builtin clang support subtest 0: Ok
51.2: builtin clang compile C source to ELF object :
--- start ---
test child forked, pid 21823
test child finished with 0
---- end ----
builtin clang support subtest 1: Ok
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-15-wangnan0@huawei.com
[ Remove redundant "Test" from entry descriptions ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/clang.c | 6 ++++-
tools/perf/util/c++/clang-c.h | 1 +
tools/perf/util/c++/clang-test.cpp | 31 +++++++++++++++++++++-----
tools/perf/util/c++/clang.cpp | 45 ++++++++++++++++++++++++++++++++++++++
tools/perf/util/c++/clang.h | 3 +++
5 files changed, 79 insertions(+), 7 deletions(-)
diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c
index 636d6d0e9037..f853e242a86c 100644
--- a/tools/perf/tests/clang.c
+++ b/tools/perf/tests/clang.c
@@ -12,6 +12,10 @@ static struct {
.func = test__clang_to_IR,
.desc = "builtin clang compile C source to IR",
},
+ {
+ .func = test__clang_to_obj,
+ .desc = "builtin clang compile C source to ELF object",
+ },
#endif
};
@@ -33,7 +37,7 @@ int test__clang(int i __maybe_unused)
return TEST_SKIP;
}
#else
-int test__clang(int i __maybe_unused)
+int test__clang(int i)
{
if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
return TEST_FAIL;
diff --git a/tools/perf/util/c++/clang-c.h b/tools/perf/util/c++/clang-c.h
index dcde4b564f3b..22b3936d1f09 100644
--- a/tools/perf/util/c++/clang-c.h
+++ b/tools/perf/util/c++/clang-c.h
@@ -9,6 +9,7 @@ extern void perf_clang__init(void);
extern void perf_clang__cleanup(void);
extern int test__clang_to_IR(void);
+extern int test__clang_to_obj(void);
#ifdef __cplusplus
}
diff --git a/tools/perf/util/c++/clang-test.cpp b/tools/perf/util/c++/clang-test.cpp
index d84e760d2aab..9b11e8c82798 100644
--- a/tools/perf/util/c++/clang-test.cpp
+++ b/tools/perf/util/c++/clang-test.cpp
@@ -13,15 +13,13 @@ public:
~perf_clang_scope() {perf_clang__cleanup();}
};
-extern "C" {
-
-int test__clang_to_IR(void)
+static std::unique_ptr<llvm::Module>
+__test__clang_to_IR(void)
{
- perf_clang_scope _scope;
unsigned int kernel_version;
if (fetch_kernel_version(&kernel_version, NULL, 0))
- return -1;
+ return std::unique_ptr<llvm::Module>(nullptr);
std::string cflag_kver("-DLINUX_VERSION_CODE=" +
std::to_string(kernel_version));
@@ -30,14 +28,35 @@ int test__clang_to_IR(void)
perf::getModuleFromSource({cflag_kver.c_str()},
"perf-test.c",
test_llvm__bpf_base_prog);
+ return M;
+}
+
+extern "C" {
+int test__clang_to_IR(void)
+{
+ perf_clang_scope _scope;
+ auto M = __test__clang_to_IR();
if (!M)
return -1;
-
for (llvm::Function& F : *M)
if (F.getName() == "bpf_func__SyS_epoll_wait")
return 0;
return -1;
}
+int test__clang_to_obj(void)
+{
+ perf_clang_scope _scope;
+
+ auto M = __test__clang_to_IR();
+ if (!M)
+ return -1;
+
+ auto Buffer = perf::getBPFObjectFromModule(&*M);
+ if (!Buffer)
+ return -1;
+ return 0;
+}
+
}
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index 715ca0a3dee0..2a1a75df204f 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -13,10 +13,15 @@
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Tooling/Tooling.h"
+#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/TargetRegistry.h"
+#include "llvm/Support/TargetSelect.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetOptions.h"
#include <memory>
#include "clang.h"
@@ -105,12 +110,52 @@ getModuleFromSource(llvm::opt::ArgStringList CFlags, StringRef Path)
return getModuleFromSource(std::move(CFlags), Path, VFS);
}
+std::unique_ptr<llvm::SmallVectorImpl<char>>
+getBPFObjectFromModule(llvm::Module *Module)
+{
+ using namespace llvm;
+
+ std::string TargetTriple("bpf-pc-linux");
+ std::string Error;
+ const Target* Target = TargetRegistry::lookupTarget(TargetTriple, Error);
+ if (!Target) {
+ llvm::errs() << Error;
+ return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);
+ }
+
+ llvm::TargetOptions Opt;
+ TargetMachine *TargetMachine =
+ Target->createTargetMachine(TargetTriple,
+ "generic", "",
+ Opt, Reloc::Static);
+
+ Module->setDataLayout(TargetMachine->createDataLayout());
+ Module->setTargetTriple(TargetTriple);
+
+ std::unique_ptr<SmallVectorImpl<char>> Buffer(new SmallVector<char, 0>());
+ raw_svector_ostream ostream(*Buffer);
+
+ legacy::PassManager PM;
+ if (TargetMachine->addPassesToEmitFile(PM, ostream,
+ TargetMachine::CGFT_ObjectFile)) {
+ llvm::errs() << "TargetMachine can't emit a file of this type\n";
+ return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);;
+ }
+ PM.run(*Module);
+
+ return std::move(Buffer);
+}
+
}
extern "C" {
void perf_clang__init(void)
{
perf::LLVMCtx.reset(new llvm::LLVMContext());
+ LLVMInitializeBPFTargetInfo();
+ LLVMInitializeBPFTarget();
+ LLVMInitializeBPFTargetMC();
+ LLVMInitializeBPFAsmPrinter();
}
void perf_clang__cleanup(void)
diff --git a/tools/perf/util/c++/clang.h b/tools/perf/util/c++/clang.h
index b4fc2a96b79d..dd8b0427550d 100644
--- a/tools/perf/util/c++/clang.h
+++ b/tools/perf/util/c++/clang.h
@@ -19,5 +19,8 @@ std::unique_ptr<Module>
getModuleFromSource(opt::ArgStringList CFlags,
StringRef Path);
+std::unique_ptr<llvm::SmallVectorImpl<char>>
+getBPFObjectFromModule(llvm::Module *Module);
+
}
#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 13/20] perf clang: Compile BPF script using builtin clang support
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (11 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 12/20] perf clang: Support compile IR to BPF object and add testcase Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 14/20] tools build: Make the .cmd file more readable Arnaldo Carvalho de Melo
` (7 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Wang Nan, Alexei Starovoitov, He Kuang, Jiri Olsa,
Joe Stringer, Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
After this patch, perf utilizes builtin clang support to build BPF
script, no longer depend on external clang, but fallbacking to it
if for some reason the builtin compiling framework fails.
Test:
$ type clang
-bash: type: clang: not found
$ cat ~/.perfconfig
$ echo '#define LINUX_VERSION_CODE 0x040700' > ./test.c
$ cat ./tools/perf/tests/bpf-script-example.c >> ./test.c
$ ./perf record -v --dry-run -e ./test.c 2>&1 | grep builtin
bpf: successfull builtin compilation
$
Can't pass cflags so unable to include kernel headers now. Will be fixed
by following commits.
Committer notes:
Make sure '-v' comes before the '-e ./test.c' in the command line otherwise the
'verbose' variable will not be set when the bpf event is parsed and thus the
pr_debug indicating a 'successfull builtin compilation' will not be output, as
the debug level (1) will be less than what 'verbose' has at that point (0).
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-16-wangnan0@huawei.com
[ Spell check/reflow successfull pr_debug string ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/bpf-loader.c | 15 +++++++++++----
tools/perf/util/c++/clang-c.h | 26 ++++++++++++++++++++++++++
tools/perf/util/c++/clang.cpp | 29 +++++++++++++++++++++++++++++
3 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index cf16b94115b5..36c861103291 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -14,11 +14,11 @@
#include "debug.h"
#include "bpf-loader.h"
#include "bpf-prologue.h"
-#include "llvm-utils.h"
#include "probe-event.h"
#include "probe-finder.h" // for MAX_PROBES
#include "parse-events.h"
#include "llvm-utils.h"
+#include "c++/clang-c.h"
#define DEFINE_PRINT_FN(name, level) \
static int libbpf_##name(const char *fmt, ...) \
@@ -86,9 +86,16 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source)
void *obj_buf;
size_t obj_buf_sz;
- err = llvm__compile_bpf(filename, &obj_buf, &obj_buf_sz);
- if (err)
- return ERR_PTR(-BPF_LOADER_ERRNO__COMPILE);
+ perf_clang__init();
+ err = perf_clang__compile_bpf(filename, &obj_buf, &obj_buf_sz);
+ perf_clang__cleanup();
+ if (err) {
+ pr_warning("bpf: builtin compilation failed: %d, try external compiler\n", err);
+ err = llvm__compile_bpf(filename, &obj_buf, &obj_buf_sz);
+ if (err)
+ return ERR_PTR(-BPF_LOADER_ERRNO__COMPILE);
+ } else
+ pr_debug("bpf: successfull builtin compilation\n");
obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, filename);
if (!IS_ERR(obj) && llvm_param.dump_obj)
diff --git a/tools/perf/util/c++/clang-c.h b/tools/perf/util/c++/clang-c.h
index 22b3936d1f09..0eadd792ab1f 100644
--- a/tools/perf/util/c++/clang-c.h
+++ b/tools/perf/util/c++/clang-c.h
@@ -1,16 +1,42 @@
#ifndef PERF_UTIL_CLANG_C_H
#define PERF_UTIL_CLANG_C_H
+#include <stddef.h> /* for size_t */
+#include <util-cxx.h> /* for __maybe_unused */
+
#ifdef __cplusplus
extern "C" {
#endif
+#ifdef HAVE_LIBCLANGLLVM_SUPPORT
extern void perf_clang__init(void);
extern void perf_clang__cleanup(void);
extern int test__clang_to_IR(void);
extern int test__clang_to_obj(void);
+extern int perf_clang__compile_bpf(const char *filename,
+ void **p_obj_buf,
+ size_t *p_obj_buf_sz);
+#else
+
+
+static inline void perf_clang__init(void) { }
+static inline void perf_clang__cleanup(void) { }
+
+static inline int test__clang_to_IR(void) { return -1; }
+static inline int test__clang_to_obj(void) { return -1;}
+
+static inline int
+perf_clang__compile_bpf(const char *filename __maybe_unused,
+ void **p_obj_buf __maybe_unused,
+ size_t *p_obj_buf_sz __maybe_unused)
+{
+ return -ENOTSUP;
+}
+
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index 2a1a75df204f..1e974152cac2 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -163,4 +163,33 @@ void perf_clang__cleanup(void)
perf::LLVMCtx.reset(nullptr);
llvm::llvm_shutdown();
}
+
+int perf_clang__compile_bpf(const char *filename,
+ void **p_obj_buf,
+ size_t *p_obj_buf_sz)
+{
+ using namespace perf;
+
+ if (!p_obj_buf || !p_obj_buf_sz)
+ return -EINVAL;
+
+ llvm::opt::ArgStringList CFlags;
+ auto M = getModuleFromSource(std::move(CFlags), filename);
+ if (!M)
+ return -EINVAL;
+ auto O = getBPFObjectFromModule(&*M);
+ if (!O)
+ return -EINVAL;
+
+ size_t size = O->size_in_bytes();
+ void *buffer;
+
+ buffer = malloc(size);
+ if (!buffer)
+ return -ENOMEM;
+ memcpy(buffer, O->data(), size);
+ *p_obj_buf = buffer;
+ *p_obj_buf_sz = size;
+ return 0;
+}
}
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 14/20] tools build: Make the .cmd file more readable
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (12 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 13/20] perf clang: Compile BPF script using builtin clang support Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 15/20] tools build: Move tabs to spaces where suitable Arnaldo Carvalho de Melo
` (6 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
Putting extra line between dependencies and cmd_* definition
to make it more readable.
Before:
$ cat .builtin-top.o.cmd
...
/home/jolsa/kernel/linux-perf/tools/include/linux/stringify.h \
/home/jolsa/kernel/linux-perf/tools/include/linux/time64.h
cmd_builtin-top.o := gcc -Wp,-MD,./.builtin-top.o.d -Wp,-MT,builtin-...
...
After:
$ cat .builtin-top.o.cmd
...
/home/jolsa/kernel/linux-perf/tools/include/linux/stringify.h \
/home/jolsa/kernel/linux-perf/tools/include/linux/time64.h
cmd_builtin-top.o := gcc -Wp,-MD,./.builtin-top.o.d -Wp,-MT,builtin-...
...
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1480884178-8072-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Build.include | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/build/Build.include b/tools/build/Build.include
index 62dcf0c7aac2..475152c52871 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -65,7 +65,7 @@ dep-cmd = $(if $(wildcard $(fixdep)),
printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
printf '\# using basic dep data\n\n' >> $(dot-target).cmd; \
cat $(depfile) >> $(dot-target).cmd; \
- printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
+ printf '\n%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
###
# if_changed_dep - execute command if any prerequisite is newer than
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 15/20] tools build: Move tabs to spaces where suitable
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (13 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 14/20] tools build: Make the .cmd file more readable Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 16/20] perf tools: Move install-gtk target into rules area Arnaldo Carvalho de Melo
` (5 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
We've been hit several times by a Makefile bug where line indented by
tab was falsely considered as target command.
We prevent this by always using space indentation for everything except
for the target commands.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1480884178-8072-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Build.include | 12 ++--
tools/build/Makefile.feature | 138 +++++++++++++++++++++----------------------
tools/build/feature/Makefile | 102 ++++++++++++++++----------------
3 files changed, 126 insertions(+), 126 deletions(-)
diff --git a/tools/build/Build.include b/tools/build/Build.include
index 475152c52871..418871d02ebf 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -72,15 +72,15 @@ dep-cmd = $(if $(wildcard $(fixdep)),
# target, or command line has changed and update
# dependencies in the cmd file
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)), \
- @set -e; \
- $(echo-cmd) $(cmd_$(1)) && $(dep-cmd))
+ @set -e; \
+ $(echo-cmd) $(cmd_$(1)) && $(dep-cmd))
# if_changed - execute command if any prerequisite is newer than
# target, or command line has changed
-if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
- @set -e; \
- $(echo-cmd) $(cmd_$(1)); \
- printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
+if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
+ @set -e; \
+ $(echo-cmd) $(cmd_$(1)); \
+ printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
###
# C flags to be used in rule definitions, includes:
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index ae52e029dd22..e3fb5ecbdcb6 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -27,58 +27,58 @@ endef
# the rule that uses them - an example for that is the 'bionic'
# feature check. ]
#
-FEATURE_TESTS_BASIC := \
- backtrace \
- dwarf \
- dwarf_getlocations \
- fortify-source \
- sync-compare-and-swap \
- glibc \
- gtk2 \
- gtk2-infobar \
- libaudit \
- libbfd \
- libelf \
- libelf-getphdrnum \
- libelf-gelf_getnote \
- libelf-getshdrstrndx \
- libelf-mmap \
- libnuma \
- numa_num_possible_cpus \
- libperl \
- libpython \
- libpython-version \
- libslang \
- libcrypto \
- libunwind \
- libunwind-x86 \
- libunwind-x86_64 \
- libunwind-arm \
- libunwind-aarch64 \
- pthread-attr-setaffinity-np \
- stackprotector-all \
- timerfd \
- libdw-dwarf-unwind \
- zlib \
- lzma \
- get_cpuid \
- bpf \
- sdt
+FEATURE_TESTS_BASIC := \
+ backtrace \
+ dwarf \
+ dwarf_getlocations \
+ fortify-source \
+ sync-compare-and-swap \
+ glibc \
+ gtk2 \
+ gtk2-infobar \
+ libaudit \
+ libbfd \
+ libelf \
+ libelf-getphdrnum \
+ libelf-gelf_getnote \
+ libelf-getshdrstrndx \
+ libelf-mmap \
+ libnuma \
+ numa_num_possible_cpus \
+ libperl \
+ libpython \
+ libpython-version \
+ libslang \
+ libcrypto \
+ libunwind \
+ libunwind-x86 \
+ libunwind-x86_64 \
+ libunwind-arm \
+ libunwind-aarch64 \
+ pthread-attr-setaffinity-np \
+ stackprotector-all \
+ timerfd \
+ libdw-dwarf-unwind \
+ zlib \
+ lzma \
+ get_cpuid \
+ bpf \
+ sdt
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
# of all feature tests
-FEATURE_TESTS_EXTRA := \
- bionic \
- compile-32 \
- compile-x32 \
- cplus-demangle \
- hello \
- libbabeltrace \
- liberty \
- liberty-z \
- libunwind-debug-frame \
- libunwind-debug-frame-arm \
- libunwind-debug-frame-aarch64
+FEATURE_TESTS_EXTRA := \
+ bionic \
+ compile-32 \
+ compile-x32 \
+ cplus-demangle \
+ hello \
+ libbabeltrace \
+ liberty \
+ liberty-z \
+ libunwind-debug-frame \
+ libunwind-debug-frame-arm \
+ libunwind-debug-frame-aarch64
FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC)
@@ -86,26 +86,26 @@ ifeq ($(FEATURE_TESTS),all)
FEATURE_TESTS := $(FEATURE_TESTS_BASIC) $(FEATURE_TESTS_EXTRA)
endif
-FEATURE_DISPLAY ?= \
- dwarf \
- dwarf_getlocations \
- glibc \
- gtk2 \
- libaudit \
- libbfd \
- libelf \
- libnuma \
- numa_num_possible_cpus \
- libperl \
- libpython \
- libslang \
- libcrypto \
- libunwind \
- libdw-dwarf-unwind \
- zlib \
- lzma \
- get_cpuid \
- bpf
+FEATURE_DISPLAY ?= \
+ dwarf \
+ dwarf_getlocations \
+ glibc \
+ gtk2 \
+ libaudit \
+ libbfd \
+ libelf \
+ libnuma \
+ numa_num_possible_cpus \
+ libperl \
+ libpython \
+ libslang \
+ libcrypto \
+ libunwind \
+ libdw-dwarf-unwind \
+ zlib \
+ lzma \
+ get_cpuid \
+ bpf
# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
# If in the future we need per-feature checks/flags for features not
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 871d5536951d..303196c16019 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -1,54 +1,54 @@
-FILES= \
- test-all.bin \
- test-backtrace.bin \
- test-bionic.bin \
- test-dwarf.bin \
- test-dwarf_getlocations.bin \
- test-fortify-source.bin \
- test-sync-compare-and-swap.bin \
- test-glibc.bin \
- test-gtk2.bin \
- test-gtk2-infobar.bin \
- test-hello.bin \
- test-libaudit.bin \
- test-libbfd.bin \
- test-liberty.bin \
- test-liberty-z.bin \
- test-cplus-demangle.bin \
- test-libelf.bin \
- test-libelf-getphdrnum.bin \
- test-libelf-gelf_getnote.bin \
- test-libelf-getshdrstrndx.bin \
- test-libelf-mmap.bin \
- test-libnuma.bin \
- test-numa_num_possible_cpus.bin \
- test-libperl.bin \
- test-libpython.bin \
- test-libpython-version.bin \
- test-libslang.bin \
- test-libcrypto.bin \
- test-libunwind.bin \
- test-libunwind-debug-frame.bin \
- test-libunwind-x86.bin \
- test-libunwind-x86_64.bin \
- test-libunwind-arm.bin \
- test-libunwind-aarch64.bin \
- test-libunwind-debug-frame-arm.bin \
- test-libunwind-debug-frame-aarch64.bin \
- test-pthread-attr-setaffinity-np.bin \
- test-stackprotector-all.bin \
- test-timerfd.bin \
- test-libdw-dwarf-unwind.bin \
- test-libbabeltrace.bin \
- test-compile-32.bin \
- test-compile-x32.bin \
- test-zlib.bin \
- test-lzma.bin \
- test-bpf.bin \
- test-get_cpuid.bin \
- test-sdt.bin \
- test-cxx.bin \
- test-jvmti.bin
+FILES= \
+ test-all.bin \
+ test-backtrace.bin \
+ test-bionic.bin \
+ test-dwarf.bin \
+ test-dwarf_getlocations.bin \
+ test-fortify-source.bin \
+ test-sync-compare-and-swap.bin \
+ test-glibc.bin \
+ test-gtk2.bin \
+ test-gtk2-infobar.bin \
+ test-hello.bin \
+ test-libaudit.bin \
+ test-libbfd.bin \
+ test-liberty.bin \
+ test-liberty-z.bin \
+ test-cplus-demangle.bin \
+ test-libelf.bin \
+ test-libelf-getphdrnum.bin \
+ test-libelf-gelf_getnote.bin \
+ test-libelf-getshdrstrndx.bin \
+ test-libelf-mmap.bin \
+ test-libnuma.bin \
+ test-numa_num_possible_cpus.bin \
+ test-libperl.bin \
+ test-libpython.bin \
+ test-libpython-version.bin \
+ test-libslang.bin \
+ test-libcrypto.bin \
+ test-libunwind.bin \
+ test-libunwind-debug-frame.bin \
+ test-libunwind-x86.bin \
+ test-libunwind-x86_64.bin \
+ test-libunwind-arm.bin \
+ test-libunwind-aarch64.bin \
+ test-libunwind-debug-frame-arm.bin \
+ test-libunwind-debug-frame-aarch64.bin \
+ test-pthread-attr-setaffinity-np.bin \
+ test-stackprotector-all.bin \
+ test-timerfd.bin \
+ test-libdw-dwarf-unwind.bin \
+ test-libbabeltrace.bin \
+ test-compile-32.bin \
+ test-compile-x32.bin \
+ test-zlib.bin \
+ test-lzma.bin \
+ test-bpf.bin \
+ test-get_cpuid.bin \
+ test-sdt.bin \
+ test-cxx.bin \
+ test-jvmti.bin
FILES := $(addprefix $(OUTPUT),$(FILES))
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 16/20] perf tools: Move install-gtk target into rules area
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (14 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 15/20] tools build: Move tabs to spaces where suitable Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 17/20] perf tools: Move python/perf.so " Arnaldo Carvalho de Melo
` (4 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
The upcoming fixdep fix needs all targets at the same area, so they'll
fit under a signal condition block.
Move install-gtk target into the rules section.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1480884178-8072-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile.perf | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index dfb20dd31865..593d765d62ab 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -331,11 +331,6 @@ endif
ifndef NO_GTK2
ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
GTK_IN := $(OUTPUT)gtk-in.o
-
-install-gtk: $(OUTPUT)libperf-gtk.so
- $(call QUIET_INSTALL, 'GTK UI') \
- $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
- $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)'
endif
ifdef ASCIIDOC8
@@ -712,7 +707,14 @@ check: $(OUTPUT)common-cmds.h
### Installation rules
+ifndef NO_GTK2
+install-gtk: $(OUTPUT)libperf-gtk.so
+ $(call QUIET_INSTALL, 'GTK UI') \
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
+ $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)'
+else
install-gtk:
+endif
install-tools: all install-gtk
$(call QUIET_INSTALL, binaries) \
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 17/20] perf tools: Move python/perf.so target into rules area
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (15 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 16/20] perf tools: Move install-gtk target into rules area Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 18/20] perf tools: Cleanup build directory before each test Arnaldo Carvalho de Melo
` (3 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
Following fixdep fix needs all targets at the same area, so they'll fit
under signal condition block.
Moving python/perf.so target into rules section and intentionally
removing the perl script related comment.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1480884178-8072-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile.perf | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 593d765d62ab..2784b5843aef 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -268,17 +268,6 @@ python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT
PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI)
-$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
- $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
- CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \
- $(PYTHON_WORD) util/setup.py \
- --quiet build_ext; \
- mkdir -p $(OUTPUT)python && \
- cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
-#
-# No Perl scripts right now:
-#
-
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
PROGRAMS += $(OUTPUT)perf
@@ -362,6 +351,14 @@ SHELL = $(SHELL_PATH)
all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
+$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
+ $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
+ CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \
+ $(PYTHON_WORD) util/setup.py \
+ --quiet build_ext; \
+ mkdir -p $(OUTPUT)python && \
+ cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
+
please_set_SHELL_PATH_to_a_more_modern_shell:
$(Q)$$(:)
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 18/20] perf tools: Cleanup build directory before each test
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (16 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 17/20] perf tools: Move python/perf.so " Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 19/20] perf tools: Add non config targets Arnaldo Carvalho de Melo
` (2 subsequent siblings)
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
Cleanup the fixdep tool before every test.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1480884178-8072-8-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/make | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index aa49b6600d1f..0784748f1670 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -280,7 +280,7 @@ endif
MAKEFLAGS := --no-print-directory
-clean := @(cd $(PERF); $(MAKE_F) -s $(O_OPT) clean >/dev/null)
+clean := @(cd $(PERF); $(MAKE_F) -s $(O_OPT) clean >/dev/null && $(MAKE) -s $(O_OPT) -C ../build clean >/dev/null)
$(run):
$(call clean)
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 19/20] perf tools: Add non config targets
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (17 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 18/20] perf tools: Cleanup build directory before each test Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 20/20] perf annotate: Show raw form for jump instruction with indirect target Arnaldo Carvalho de Melo
2016-12-06 8:17 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Jiri Olsa, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
Adding some missing non config targets that were for some reason
omitted.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1480884178-8072-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile.perf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 2784b5843aef..10495c9dbe71 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -177,7 +177,7 @@ SUBCMD_DIR = $(srctree)/tools/lib/subcmd/
# non-config cases
config := 1
-NON_CONFIG_TARGETS := clean TAGS tags cscope help install-doc
+NON_CONFIG_TARGETS := clean TAGS tags cscope help install-doc install-man install-html install-info install-pdf doc man html info pdf
ifdef MAKECMDGOALS
ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 20/20] perf annotate: Show raw form for jump instruction with indirect target
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (18 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 19/20] perf tools: Add non config targets Arnaldo Carvalho de Melo
@ 2016-12-05 21:38 ` Arnaldo Carvalho de Melo
2016-12-06 8:17 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Ravi Bangoria, Alexander Shishkin, Chris Riyder,
Kim Phillips, Markus Trippelsdorf, Masami Hiramatsu,
Naveen N . Rao, Peter Zijlstra, Taeung Song, linuxppc-dev,
Arnaldo Carvalho de Melo
From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
For jump instructions that does not include target address as direct operand,
show the original disassembled line for them. This is needed for certain
powerpc jump instructions that use target address in a register (such as bctr,
btar, ...).
Before:
ld r12,32088(r12)
mtctr r12
v bctr ffffffffffffca2c
std r2,24(r1)
addis r12,r2,-1
After:
ld r12,32088(r12)
mtctr r12
v bctr
std r2,24(r1)
addis r12,r2,-1
Committer notes:
Testing it using a perf.data file and vmlinux for powerpc64,
cross-annotating it on a x86_64 workstation:
Before:
.__bpf_prog_run vmlinux.powerpc
│ std r10,512(r9) ▒
│ lbz r9,0(r31) ▒
│ rldicr r9,r9,3,60 ▒
│ ldx r9,r30,r9 ▒
│ mtctr r9 ▒
100.00 │ ↓ bctr 3fffffffffe01510 ▒
│ lwa r10,4(r31) ▒
│ lwz r9,0(r31) ▒
<SNIP>
Invalid jump offset: 3fffffffffe01510
After:
.__bpf_prog_run vmlinux.powerpc
│ std r10,512(r9) ▒
│ lbz r9,0(r31) ▒
│ rldicr r9,r9,3,60 ▒
│ ldx r9,r30,r9 ▒
│ mtctr r9 ▒
100.00 │ ↓ bctr ▒
│ lwa r10,4(r31) ▒
│ lwz r9,0(r31) ▒
<SNIP>
Invalid jump offset: 3fffffffffe01510
This, in turn, uncovers another problem with jumps without operands, the
ENTER/-> operation, to jump to the target, still continues using the bogus
target :-)
BTW, this was the file used for the above tests:
[acme@jouet ravi_bangoria]$ perf report --header-only -i perf.data.f22vm.powerdev
# ========
# captured on: Thu Nov 24 12:40:38 2016
# hostname : pdev-f22-qemu
# os release : 4.4.10-200.fc22.ppc64
# perf version : 4.9.rc1.g6298ce
# arch : ppc64
# nrcpus online : 48
# nrcpus avail : 48
# cpudesc : POWER7 (architected), altivec supported
# cpuid : 74,513
# total memory : 4158976 kB
# cmdline : /home/ravi/Workspace/linux/tools/perf/perf record -a
# event : name = cycles:ppp, , size = 112, { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|CPU|PERIOD, disabled = 1, inherit = 1, mmap = 1, c
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: cpu = 4, software = 1, tracepoint = 2, breakpoint = 5
# missing features: HEADER_TRACING_DATA HEADER_BRANCH_STACK HEADER_GROUP_DESC HEADER_AUXTRACE HEADER_STAT HEADER_CACHE
# ========
#
[acme@jouet ravi_bangoria]$
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Chris Riyder <chris.ryder@arm.com>
Cc: Kim Phillips <kim.phillips@arm.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1480953407-7605-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/annotate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4012b1de2813..ea7e0de4b9c1 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -237,6 +237,9 @@ static int jump__parse(struct arch *arch __maybe_unused, struct ins_operands *op
static int jump__scnprintf(struct ins *ins, char *bf, size_t size,
struct ins_operands *ops)
{
+ if (!ops->target.addr)
+ return ins__raw_scnprintf(ins, bf, size, ops);
+
return scnprintf(bf, size, "%-6.6s %" PRIx64, ins->name, ops->target.offset);
}
--
2.9.3
^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (19 preceding siblings ...)
2016-12-05 21:38 ` [PATCH 20/20] perf annotate: Show raw form for jump instruction with indirect target Arnaldo Carvalho de Melo
@ 2016-12-06 8:17 ` Ingo Molnar
20 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2016-12-06 8:17 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov,
Chris Riyder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer,
Kim Phillips, linuxppc-dev, Markus Trippelsdorf, Masami Hiramatsu,
Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Foley,
Peter Zijlstra, Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li,
pi3orama, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> Test results at the end of this message, as usual.
>
> The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4:
>
> Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08:03 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161205
>
> for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9:
>
> perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> Fixes:
>
> - Do not show a bogus target address in 'perf annotate' for targetless powerpc
> jump instructions such as 'bctr' (Ravi Bangoria)
>
> - tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa)
>
> - Fix building objtool with clang (Peter Foley)
>
> Infrastructure:
>
> - Support linking perf with clang and LLVM libraries, initially statically, but
> this limitation will be lifted and shared libraries, when available, will
> be preferred to the static build, that should, as with other features, be
> enabled explicitly (Wang Nan)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Jiri Olsa (7):
> tools build: Make fixdep parsing wait for last target
> tools build: Make the .cmd file more readable
> tools build: Move tabs to spaces where suitable
> perf tools: Move install-gtk target into rules area
> perf tools: Move python/perf.so target into rules area
> perf tools: Cleanup build directory before each test
> perf tools: Add non config targets
>
> Peter Foley (1):
> tools build: Fix objtool build with clang
>
> Ravi Bangoria (1):
> perf annotate: Show raw form for jump instruction with indirect target
>
> Wang Nan (11):
> perf tools: Pass context to perf hook functions
> perf llvm: Extract helpers in llvm-utils.c
> tools build: Add feature detection for LLVM
> tools build: Add feature detection for clang
> perf build: Add clang and llvm compile and linking support
> perf clang: Add builtin clang support ant test case
> perf clang: Use real file system for #include
> perf clang: Allow passing CFLAGS to builtin clang
> perf clang: Update test case to use real BPF script
> perf clang: Support compile IR to BPF object and add testcase
> perf clang: Compile BPF script using builtin clang support
>
> tools/build/Build.include | 20 ++--
> tools/build/Makefile.feature | 138 +++++++++++++-------------
> tools/build/feature/Makefile | 120 +++++++++++++----------
> tools/build/feature/test-clang.cpp | 21 ++++
> tools/build/feature/test-llvm.cpp | 8 ++
> tools/build/fixdep.c | 5 +-
> tools/perf/Makefile.config | 62 +++++++++---
> tools/perf/Makefile.perf | 56 +++++++----
> tools/perf/tests/Build | 1 +
> tools/perf/tests/builtin-test.c | 9 ++
> tools/perf/tests/clang.c | 46 +++++++++
> tools/perf/tests/llvm.h | 7 ++
> tools/perf/tests/make | 4 +-
> tools/perf/tests/perf-hooks.c | 14 ++-
> tools/perf/tests/tests.h | 3 +
> tools/perf/util/Build | 2 +
> tools/perf/util/annotate.c | 3 +
> tools/perf/util/bpf-loader.c | 19 +++-
> tools/perf/util/c++/Build | 2 +
> tools/perf/util/c++/clang-c.h | 43 ++++++++
> tools/perf/util/c++/clang-test.cpp | 62 ++++++++++++
> tools/perf/util/c++/clang.cpp | 195 +++++++++++++++++++++++++++++++++++++
> tools/perf/util/c++/clang.h | 26 +++++
> tools/perf/util/llvm-utils.c | 76 +++++++++++----
> tools/perf/util/llvm-utils.h | 6 ++
> tools/perf/util/perf-hooks.c | 10 +-
> tools/perf/util/perf-hooks.h | 6 +-
> tools/perf/util/util-cxx.h | 26 +++++
> 28 files changed, 795 insertions(+), 195 deletions(-)
> create mode 100644 tools/build/feature/test-clang.cpp
> create mode 100644 tools/build/feature/test-llvm.cpp
> create mode 100644 tools/perf/tests/clang.c
> create mode 100644 tools/perf/util/c++/Build
> create mode 100644 tools/perf/util/c++/clang-c.h
> create mode 100644 tools/perf/util/c++/clang-test.cpp
> create mode 100644 tools/perf/util/c++/clang.cpp
> create mode 100644 tools/perf/util/c++/clang.h
> create mode 100644 tools/perf/util/util-cxx.h
>
> # uname -a
> Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
> # perf test
> 1: vmlinux symtab matches kallsyms : Ok
> 2: Detect openat syscall event : Ok
> 3: Detect openat syscall event on all cpus : Ok
> 4: Read samples using the mmap interface : Ok
> 5: Parse event definition strings : Ok
> 6: PERF_RECORD_* events & perf_sample fields : Ok
> 7: Parse perf pmu format : Ok
> 8: DSO data read : Ok
> 9: DSO data cache : Ok
> 10: DSO data reopen : Ok
> 11: Roundtrip evsel->name : Ok
> 12: Parse sched tracepoints fields : Ok
> 13: syscalls:sys_enter_openat event fields : Ok
> 14: Setup struct perf_event_attr : Ok
> 15: Match and link multiple hists : Ok
> 16: 'import perf' in python : Ok
> 17: Breakpoint overflow signal handler : Ok
> 18: Breakpoint overflow sampling : Ok
> 19: Number of exit events of a simple workload : Ok
> 20: Software clock events period values : Ok
> 21: Object code reading : Ok
> 22: Sample parsing : Ok
> 23: Use a dummy software event to keep tracking: Ok
> 24: Parse with no sample_id_all bit set : Ok
> 25: Filter hist entries : Ok
> 26: Lookup mmap thread : Ok
> 27: Share thread mg : Ok
> 28: Sort output of hist entries : Ok
> 29: Cumulate child hist entries : Ok
> 30: Track with sched_switch : Ok
> 31: Filter fds with revents mask in a fdarray : Ok
> 32: Add fd to a fdarray, making it autogrow : Ok
> 33: kmod_path__parse : Ok
> 34: Thread map : Ok
> 35: LLVM search and compile :
> 35.1: Basic BPF llvm compile : Ok
> 35.2: kbuild searching : Ok
> 35.3: Compile source for BPF prologue generation: Ok
> 35.4: Compile source for BPF relocation : Ok
> 36: Session topology : Ok
> 37: BPF filter :
> 37.1: Basic BPF filtering : Ok
> 37.2: BPF prologue generation : Ok
> 37.3: BPF relocation checker : Ok
> 38: Synthesize thread map : Ok
> 39: Synthesize cpu map : Ok
> 40: Synthesize stat config : Ok
> 41: Synthesize stat : Ok
> 42: Synthesize stat round : Ok
> 43: Synthesize attr update : Ok
> 44: Event times : Ok
> 45: Read backward ring buffer : Ok
> 46: Print cpu map : Ok
> 47: Probe SDT events : Ok
> 48: is_printable_array : Ok
> 49: Print bitmap : Ok
> 50: perf hooks : Ok
> 51: builtin clang support : Skip (not compiled in)
> 52: x86 rdpmc : Ok
> 53: Convert perf time to TSC : Ok
> 54: DWARF unwind : Ok
> 55: x86 instruction decoder - new instructions : Ok
> 56: Intel cqm nmi context read : Skip
> #
> # time dm
> 1 alpine:3.4: Ok
> 2 android-ndk:r12b-arm: Ok
> 3 archlinux:latest: Ok
> 4 centos:5: Ok
> 5 centos:6: Ok
> 6 centos:7: Ok
> 7 debian:7: Ok
> 8 debian:8: Ok
> 9 debian:experimental: Ok
> 10 fedora:20: Ok
> 11 fedora:21: Ok
> 12 fedora:22: Ok
> 13 fedora:23: Ok
> 14 fedora:24: Ok
> 15 fedora:24-x-ARC-uClibc: Ok
> 16 fedora:25: Ok
> 17 fedora:rawhide: Ok
> 18 mageia:5: Ok
> 19 opensuse:13.2: Ok
> 20 opensuse:42.1: Ok
> 21 opensuse:tumbleweed: Ok
> 22 ubuntu:12.04.5: Ok
> 23 ubuntu:14.04.4-x-linaro-arm64: Ok
> 24 ubuntu:16.04: Ok
> 25 ubuntu:16.04-x-arm: Ok
> 26 ubuntu:16.04-x-arm64: Ok
> 27 ubuntu:16.04-x-powerpc: Ok
> 28 ubuntu:16.04-x-powerpc64: Ok
> 29 ubuntu:16.04-x-powerpc64el: Ok
> 30 ubuntu:16.04-x-s390: Ok
> 31 ubuntu:16.10: Ok
> #
> $ make -C tools/perf build-test
> make: Entering directory '/home/acme/git/linux/tools/perf'
> - tarpkg: ./tests/perf-targz-src-pkg .
> make_no_backtrace_O: make NO_BACKTRACE=1
> make_no_gtk2_O: make NO_GTK2=1
> make_static_O: make LDFLAGS=-static
> make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
> make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
> make_perf_o_O: make perf.o
> make_no_slang_O: make NO_SLANG=1
> make_install_prefix_O: make install prefix=/tmp/krava
> make_no_libpython_O: make NO_LIBPYTHON=1
> make_no_newt_O: make NO_NEWT=1
> make_debug_O: make DEBUG=1
> make_tags_O: make tags
> make_no_libbionic_O: make NO_LIBBIONIC=1
> make_help_O: make help
> make_install_O: make install
> make_no_libunwind_O: make NO_LIBUNWIND=1
> make_pure_O: make
> make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
> make_no_libperl_O: make NO_LIBPERL=1
> make_no_libbpf_O: make NO_LIBBPF=1
> make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
> make_doc_O: make doc
> make_no_libaudit_O: make NO_LIBAUDIT=1
> make_clean_all_O: make clean all
> make_with_babeltrace_O: make LIBBABELTRACE=1
> make_no_libnuma_O: make NO_LIBNUMA=1
> make_util_map_o_O: make util/map.o
> make_install_bin_O: make install-bin
> make_no_demangle_O: make NO_DEMANGLE=1
> make_no_libelf_O: make NO_LIBELF=1
> make_no_auxtrace_O: make NO_AUXTRACE=1
> make_util_pmu_bison_o_O: make util/pmu-bison.o
> make_install_prefix_slash_O: make install prefix=/tmp/krava/
> make_with_clangllvm_O: make LIBCLANGLLVM=1
> OK
> make: Leaving directory '/home/acme/git/linux/tools/perf'
> $
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-24 14:57 Arnaldo Carvalho de Melo
2017-03-24 18:39 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Alexander Shishkin, Alexis Berlemont, Andi Kleen, David Ahern,
Hanjun Guo, Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
Taeung Song, Wang Nan, linux-perf-users, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:
Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170324
for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:
perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)
- Collapse identically named PMU events in 'perf stat', allow
not merging it via --no-merge (Andi Kleen)
Fixes:
- Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
disassembly output to not ditch line:number lines needed by
'perf annotate --print-lines' logic (Taeung Song)
Infrastructure:
- SDT (Statically Defined Tracing)/uprobes_events arguments improvements
(Alexis Berlemont, Ravi Bangoria)
- Improvements for the handling of JSON described vendor events,
including having an expression parser to calculate metrics
from multiple vendor events (Andi Kleen)
- Update Intel JSON vendor event files (Andi Kleen)
- Restore error reporting in 'perf probe -d' when none of the events
requested to be deleted exist. (Kefeng Wang)
- Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
(Ravi Bangoria)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Alexis Berlemont (2):
perf sdt: Add scanning of sdt probes arguments
perf probe: Add sdt probes arguments into the uprobe cmd string
Andi Kleen (13):
perf stat: Factor out callback for collecting event values
perf stat: Collapse identically named events
perf stat: Handle partially bad results with merging
perf tools: Factor out PMU matching in parser
perf pmu: Expand PMU events by prefix match
perf pmu: Special case uncore_ prefix
perf tools: Add a simple expression parser for JSON
perf vendor events intel: Update Intel uncore JSON event files
perf pmu: Support MetricExpr header in JSON event list
perf stat: Output JSON MetricExpr metric
perf list: Support printing MetricExpr with --debug
perf pmu: Add support for MetricName JSON attribute
perf list: Move extra details printing to new option
Arnaldo Carvalho de Melo (1):
perf annotate: Add comment clarifying how the source code line is parsed
Kefeng Wang (1):
perf probe: Return errno when not hitting any event
Ravi Bangoria (2):
perf probe: Change MAX_CMDLEN
perf sdt x86: Add renaming logic for rNN and other registers
Taeung Song (1):
perf annotate: More exactly grep -v of the objdump command
tools/perf/Documentation/perf-list.txt | 4 +
tools/perf/Documentation/perf-stat.txt | 3 +
tools/perf/arch/x86/util/perf_regs.c | 103 +++++++++++
tools/perf/builtin-list.c | 14 +-
tools/perf/builtin-probe.c | 6 +-
tools/perf/builtin-stat.c | 146 ++++++++++++---
.../arch/x86/broadwellde/uncore-cache.json | 28 +--
.../arch/x86/broadwellde/uncore-memory.json | 26 ++-
.../arch/x86/broadwellde/uncore-power.json | 26 ++-
.../arch/x86/broadwellx/uncore-cache.json | 28 +--
.../arch/x86/broadwellx/uncore-interconnect.json | 6 +-
.../arch/x86/broadwellx/uncore-memory.json | 21 ++-
.../arch/x86/broadwellx/uncore-power.json | 26 ++-
.../pmu-events/arch/x86/haswellx/uncore-cache.json | 28 +--
.../arch/x86/haswellx/uncore-interconnect.json | 6 +-
.../arch/x86/haswellx/uncore-memory.json | 21 ++-
.../pmu-events/arch/x86/haswellx/uncore-power.json | 26 ++-
.../pmu-events/arch/x86/ivytown/uncore-cache.json | 22 +--
.../arch/x86/ivytown/uncore-interconnect.json | 12 +-
.../pmu-events/arch/x86/ivytown/uncore-memory.json | 19 +-
.../pmu-events/arch/x86/ivytown/uncore-power.json | 53 ++++--
.../pmu-events/arch/x86/jaketown/uncore-cache.json | 13 +-
.../arch/x86/jaketown/uncore-interconnect.json | 12 +-
.../arch/x86/jaketown/uncore-memory.json | 21 ++-
.../pmu-events/arch/x86/jaketown/uncore-power.json | 53 ++++--
tools/perf/pmu-events/jevents.c | 26 ++-
tools/perf/pmu-events/jevents.h | 3 +-
tools/perf/pmu-events/pmu-events.h | 2 +
tools/perf/tests/Build | 1 +
tools/perf/tests/builtin-test.c | 4 +
tools/perf/tests/expr.c | 56 ++++++
tools/perf/tests/tests.h | 1 +
tools/perf/util/Build | 6 +
tools/perf/util/annotate.c | 8 +-
tools/perf/util/evsel.c | 4 +
tools/perf/util/evsel.h | 5 +
tools/perf/util/expr.h | 25 +++
tools/perf/util/expr.y | 173 ++++++++++++++++++
tools/perf/util/parse-events.c | 78 +++++++-
tools/perf/util/parse-events.h | 10 +-
tools/perf/util/parse-events.y | 73 ++++----
tools/perf/util/perf_regs.c | 6 +
tools/perf/util/perf_regs.h | 6 +
tools/perf/util/pmu.c | 32 +++-
tools/perf/util/pmu.h | 6 +-
tools/perf/util/probe-event.c | 1 -
tools/perf/util/probe-file.c | 173 +++++++++++++++++-
tools/perf/util/stat-shadow.c | 197 +++++++++++++++++++++
tools/perf/util/stat.h | 2 +
tools/perf/util/symbol-elf.c | 25 ++-
tools/perf/util/symbol.h | 1 +
51 files changed, 1370 insertions(+), 277 deletions(-)
create mode 100644 tools/perf/tests/expr.c
create mode 100644 tools/perf/util/expr.h
create mode 100644 tools/perf/util/expr.y
Test results:
The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.
Several are cross builds, the ones with -x-ARCH, and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.
The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.
Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.
# dm
1 alpine:3.4: Ok
2 alpine:3.5: Ok
3 alpine:edge: Ok
4 android-ndk:r12b-arm: Ok
5 archlinux:latest: Ok
6 centos:5: Ok
7 centos:6: Ok
8 centos:7: Ok
9 debian:7: Ok
10 debian:8: Ok
11 debian:experimental: Ok
12 debian:experimental-x-arm64: Ok
13 debian:experimental-x-mips: Ok
14 debian:experimental-x-mips64: Ok
15 debian:experimental-x-mipsel: Ok
16 fedora:20: Ok
17 fedora:21: Ok
18 fedora:22: Ok
19 fedora:23: Ok
20 fedora:24: Ok
21 fedora:24-x-ARC-uClibc: Ok
22 fedora:25: Ok
23 fedora:rawhide: Ok
24 mageia:5: Ok
25 opensuse:13.2: Ok
26 opensuse:42.1: Ok
27 opensuse:tumbleweed: Ok
28 ubuntu:12.04.5: Ok
29 ubuntu:14.04.4: Ok
30 ubuntu:14.04.4-x-linaro-arm64: Ok
31 ubuntu:15.10: Ok
32 ubuntu:16.04: Ok
33 ubuntu:16.04-x-arm: Ok
34 ubuntu:16.04-x-arm64: Ok
35 ubuntu:16.04-x-powerpc: Ok
36 ubuntu:16.04-x-powerpc64: Ok
37 ubuntu:16.04-x-s390: Ok
38 ubuntu:16.10: Ok
39 ubuntu:17.04: Ok
#
# uname -a
Linux felicio.ghostprotocols.net 4.11.0-rc3+ #1 SMP Thu Mar 23 14:32:00 BRT 2017 x86_64 x86_64 x86_64 GNU/Linux
# Has peterz's fix for 'perf test tsc'
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: Detect openat syscall event : Ok
3: Detect openat syscall event on all cpus : Ok
4: Read samples using the mmap interface : Ok
5: Parse event definition strings : Ok
6: Simple expression parser : Ok
7: PERF_RECORD_* events & perf_sample fields : Ok
8: Parse perf pmu format : Ok
9: DSO data read : Ok
10: DSO data cache : Ok
11: DSO data reopen : Ok
12: Roundtrip evsel->name : Ok
13: Parse sched tracepoints fields : Ok
14: syscalls:sys_enter_openat event fields : Ok
15: Setup struct perf_event_attr : Ok
16: Match and link multiple hists : Ok
17: 'import perf' in python : Ok
18: Breakpoint overflow signal handler : Ok
19: Breakpoint overflow sampling : Ok
20: Number of exit events of a simple workload : Ok
21: Software clock events period values : Ok
22: Object code reading : Ok
23: Sample parsing : Ok
24: Use a dummy software event to keep tracking: Ok
25: Parse with no sample_id_all bit set : Ok
26: Filter hist entries : Ok
27: Lookup mmap thread : Ok
28: Share thread mg : Ok
29: Sort output of hist entries : Ok
30: Cumulate child hist entries : Ok
31: Track with sched_switch : Ok
32: Filter fds with revents mask in a fdarray : Ok
33: Add fd to a fdarray, making it autogrow : Ok
34: kmod_path__parse : Ok
35: Thread map : Ok
36: LLVM search and compile :
36.1: Basic BPF llvm compile : Ok
36.2: kbuild searching : Ok
36.3: Compile source for BPF prologue generation: Ok
36.4: Compile source for BPF relocation : Ok
37: Session topology : Ok
38: BPF filter :
38.1: Basic BPF filtering : Ok
38.2: BPF pinning : Ok
38.3: BPF prologue generation : Ok
38.4: BPF relocation checker : Ok
39: Synthesize thread map : Ok
40: Remove thread map : Ok
41: Synthesize cpu map : Ok
42: Synthesize stat config : Ok
43: Synthesize stat : Ok
44: Synthesize stat round : Ok
45: Synthesize attr update : Ok
46: Event times : Ok
47: Read backward ring buffer : Ok
48: Print cpu map : Ok
49: Probe SDT events : Ok
50: is_printable_array : Ok
51: Print bitmap : Ok
52: perf hooks : Ok
53: builtin clang support : Skip (not compiled in)
54: unit_number__scnprintf : Ok
55: x86 rdpmc : Ok
56: Convert perf time to TSC : Ok
57: DWARF unwind : Ok
58: x86 instruction decoder - new instructions : Ok
59: Intel cqm nmi context read : Skip
#
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_install_O: make install
make_install_bin_O: make install-bin
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_pure_O: make
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_no_newt_O: make NO_NEWT=1
make_debug_O: make DEBUG=1
make_doc_O: make doc
make_no_slang_O: make NO_SLANG=1
make_static_O: make LDFLAGS=-static
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
make_no_libbpf_O: make NO_LIBBPF=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_perf_o_O: make perf.o
make_no_libnuma_O: make NO_LIBNUMA=1
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_no_demangle_O: make NO_DEMANGLE=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_help_O: make help
make_util_map_o_O: make util/map.o
make_no_libperl_O: make NO_LIBPERL=1
make_no_gtk2_O: make NO_GTK2=1
make_install_prefix_O: make install prefix=/tmp/krava
make_clean_all_O: make clean all
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libunwind_O: make NO_LIBUNWIND=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_tags_O: make tags
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_libelf_O: make NO_LIBELF=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2017-03-24 14:57 Arnaldo Carvalho de Melo
@ 2017-03-24 18:39 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2017-03-24 18:39 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexis Berlemont,
Andi Kleen, David Ahern, Hanjun Guo, Hemant Kumar, Jiri Olsa,
John Shortt, Kefeng Wang, Madhavan Srinivasan, Masami Hiramatsu,
Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra,
Ravi Bangoria, Taeung Song, Wang Nan, linux-perf-users,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> Test results at the end of this message, as usual.
>
> The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:
>
> Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170324
>
> for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:
>
> perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)
>
> - Collapse identically named PMU events in 'perf stat', allow
> not merging it via --no-merge (Andi Kleen)
>
> Fixes:
>
> - Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
> disassembly output to not ditch line:number lines needed by
> 'perf annotate --print-lines' logic (Taeung Song)
>
> Infrastructure:
>
> - SDT (Statically Defined Tracing)/uprobes_events arguments improvements
> (Alexis Berlemont, Ravi Bangoria)
>
> - Improvements for the handling of JSON described vendor events,
> including having an expression parser to calculate metrics
> from multiple vendor events (Andi Kleen)
>
> - Update Intel JSON vendor event files (Andi Kleen)
>
> - Restore error reporting in 'perf probe -d' when none of the events
> requested to be deleted exist. (Kefeng Wang)
>
> - Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
> (Ravi Bangoria)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Alexis Berlemont (2):
> perf sdt: Add scanning of sdt probes arguments
> perf probe: Add sdt probes arguments into the uprobe cmd string
>
> Andi Kleen (13):
> perf stat: Factor out callback for collecting event values
> perf stat: Collapse identically named events
> perf stat: Handle partially bad results with merging
> perf tools: Factor out PMU matching in parser
> perf pmu: Expand PMU events by prefix match
> perf pmu: Special case uncore_ prefix
> perf tools: Add a simple expression parser for JSON
> perf vendor events intel: Update Intel uncore JSON event files
> perf pmu: Support MetricExpr header in JSON event list
> perf stat: Output JSON MetricExpr metric
> perf list: Support printing MetricExpr with --debug
> perf pmu: Add support for MetricName JSON attribute
> perf list: Move extra details printing to new option
>
> Arnaldo Carvalho de Melo (1):
> perf annotate: Add comment clarifying how the source code line is parsed
>
> Kefeng Wang (1):
> perf probe: Return errno when not hitting any event
>
> Ravi Bangoria (2):
> perf probe: Change MAX_CMDLEN
> perf sdt x86: Add renaming logic for rNN and other registers
>
> Taeung Song (1):
> perf annotate: More exactly grep -v of the objdump command
>
> tools/perf/Documentation/perf-list.txt | 4 +
> tools/perf/Documentation/perf-stat.txt | 3 +
> tools/perf/arch/x86/util/perf_regs.c | 103 +++++++++++
> tools/perf/builtin-list.c | 14 +-
> tools/perf/builtin-probe.c | 6 +-
> tools/perf/builtin-stat.c | 146 ++++++++++++---
> .../arch/x86/broadwellde/uncore-cache.json | 28 +--
> .../arch/x86/broadwellde/uncore-memory.json | 26 ++-
> .../arch/x86/broadwellde/uncore-power.json | 26 ++-
> .../arch/x86/broadwellx/uncore-cache.json | 28 +--
> .../arch/x86/broadwellx/uncore-interconnect.json | 6 +-
> .../arch/x86/broadwellx/uncore-memory.json | 21 ++-
> .../arch/x86/broadwellx/uncore-power.json | 26 ++-
> .../pmu-events/arch/x86/haswellx/uncore-cache.json | 28 +--
> .../arch/x86/haswellx/uncore-interconnect.json | 6 +-
> .../arch/x86/haswellx/uncore-memory.json | 21 ++-
> .../pmu-events/arch/x86/haswellx/uncore-power.json | 26 ++-
> .../pmu-events/arch/x86/ivytown/uncore-cache.json | 22 +--
> .../arch/x86/ivytown/uncore-interconnect.json | 12 +-
> .../pmu-events/arch/x86/ivytown/uncore-memory.json | 19 +-
> .../pmu-events/arch/x86/ivytown/uncore-power.json | 53 ++++--
> .../pmu-events/arch/x86/jaketown/uncore-cache.json | 13 +-
> .../arch/x86/jaketown/uncore-interconnect.json | 12 +-
> .../arch/x86/jaketown/uncore-memory.json | 21 ++-
> .../pmu-events/arch/x86/jaketown/uncore-power.json | 53 ++++--
> tools/perf/pmu-events/jevents.c | 26 ++-
> tools/perf/pmu-events/jevents.h | 3 +-
> tools/perf/pmu-events/pmu-events.h | 2 +
> tools/perf/tests/Build | 1 +
> tools/perf/tests/builtin-test.c | 4 +
> tools/perf/tests/expr.c | 56 ++++++
> tools/perf/tests/tests.h | 1 +
> tools/perf/util/Build | 6 +
> tools/perf/util/annotate.c | 8 +-
> tools/perf/util/evsel.c | 4 +
> tools/perf/util/evsel.h | 5 +
> tools/perf/util/expr.h | 25 +++
> tools/perf/util/expr.y | 173 ++++++++++++++++++
> tools/perf/util/parse-events.c | 78 +++++++-
> tools/perf/util/parse-events.h | 10 +-
> tools/perf/util/parse-events.y | 73 ++++----
> tools/perf/util/perf_regs.c | 6 +
> tools/perf/util/perf_regs.h | 6 +
> tools/perf/util/pmu.c | 32 +++-
> tools/perf/util/pmu.h | 6 +-
> tools/perf/util/probe-event.c | 1 -
> tools/perf/util/probe-file.c | 173 +++++++++++++++++-
> tools/perf/util/stat-shadow.c | 197 +++++++++++++++++++++
> tools/perf/util/stat.h | 2 +
> tools/perf/util/symbol-elf.c | 25 ++-
> tools/perf/util/symbol.h | 1 +
> 51 files changed, 1370 insertions(+), 277 deletions(-)
> create mode 100644 tools/perf/tests/expr.c
> create mode 100644 tools/perf/util/expr.h
> create mode 100644 tools/perf/util/expr.y
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-28 1:38 Arnaldo Carvalho de Melo
2017-03-28 5:45 ` Ingo Molnar
0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-28 1:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Alexander Shishkin, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang,
Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra,
Ravi Bangoria, Sukadev Bhattiprolu, Taeung Song, Tommi Rantala,
Wang Nan, Yao Jin, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92:
Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170327
for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de:
perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
New features:
- Handle inline functions in callchains (Jin Yao)
- Enable sorting by srcline as key (Milian Wolff)
Fixes:
- Fix no_size logic in addr_filter__resolve_kernel_syms() in the
auxtrace code (Adrian Hunter)
- Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo)
- Fix divide by zero when calculating percent for an event in a group in
the annotate by source line code (Taeung Song)
- build-id files now aren't anymore symlinks, their parent directories
are, so readlink the later (Taeung Song)
- Assorted fixes for null termination problems, mostly related to
readlink, detected by valgrind (Tommi Rantala)
Infrastructure:
- Make vfs_getname probe point logic in 'perf trace' more robust
wrt length of pathname (Arnaldo Carvalho de Melo)
- Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo)
- Show 'perf list sdt' option in man page (Ravi Bangoria)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (1):
perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()
Arnaldo Carvalho de Melo (4):
perf trace: Check for vfs_getname.pathname length
perf trace: Fix up error path indentation
perf trace: Fixup thread refcounting
perf tools: Remove unused 'prefix' from builtin functions
Jin Yao (5):
perf report: Refactor common code in srcline.c
perf report: Find the inline stack for a given address
perf report: Introduce --inline option
perf report: Show inline stack for stdio mode
perf report: Show inline stack for browser mode
Milian Wolff (1):
perf report: Enable sorting by srcline as key
Ravi Bangoria (1):
perf list sdt: Show option in man page
Taeung Song (2):
perf annotate: Fix a bug following symbolic link of a build-id file
perf annotate: Fix a bug of division by zero when calculating percent
Tommi Rantala (6):
perf buildid: Do not update SDT cache with null filename
perf buildid: Do not assume that readlink() returns a null terminated string
perf tests: Do not assume that readlink() returns a null terminated string
perf utils: use sizeof(buf) - 1 in readlink() call
perf utils: Null terminate buf in read_ftrace_printk()
perf utils: Readlink /proc/self/exe to find the perf binary
tools/perf/Documentation/perf-list.txt | 4 +-
tools/perf/Documentation/perf-report.txt | 5 +
tools/perf/bench/bench.h | 20 +--
tools/perf/bench/futex-hash.c | 3 +-
tools/perf/bench/futex-lock-pi.c | 3 +-
tools/perf/bench/futex-requeue.c | 3 +-
tools/perf/bench/futex-wake-parallel.c | 3 +-
tools/perf/bench/futex-wake.c | 3 +-
tools/perf/bench/mem-functions.c | 4 +-
tools/perf/bench/numa.c | 2 +-
tools/perf/bench/sched-messaging.c | 3 +-
tools/perf/bench/sched-pipe.c | 2 +-
tools/perf/builtin-annotate.c | 2 +-
tools/perf/builtin-bench.c | 12 +-
tools/perf/builtin-buildid-cache.c | 3 +-
tools/perf/builtin-buildid-list.c | 3 +-
tools/perf/builtin-c2c.c | 4 +-
tools/perf/builtin-config.c | 2 +-
tools/perf/builtin-data.c | 9 +-
tools/perf/builtin-diff.c | 2 +-
tools/perf/builtin-evlist.c | 2 +-
tools/perf/builtin-ftrace.c | 2 +-
tools/perf/builtin-help.c | 2 +-
tools/perf/builtin-inject.c | 2 +-
tools/perf/builtin-kallsyms.c | 2 +-
tools/perf/builtin-kmem.c | 4 +-
tools/perf/builtin-kvm.c | 16 +-
tools/perf/builtin-list.c | 2 +-
tools/perf/builtin-lock.c | 6 +-
tools/perf/builtin-mem.c | 6 +-
tools/perf/builtin-probe.c | 6 +-
tools/perf/builtin-record.c | 2 +-
tools/perf/builtin-report.c | 4 +-
tools/perf/builtin-sched.c | 6 +-
tools/perf/builtin-script.c | 4 +-
tools/perf/builtin-stat.c | 2 +-
tools/perf/builtin-timechart.c | 7 +-
tools/perf/builtin-top.c | 2 +-
tools/perf/builtin-trace.c | 25 ++--
tools/perf/builtin-version.c | 3 +-
tools/perf/builtin.h | 58 ++++----
tools/perf/perf.c | 11 +-
tools/perf/tests/builtin-test.c | 2 +-
tools/perf/tests/sdt.c | 2 +-
tools/perf/ui/browsers/hists.c | 181 ++++++++++++++++++++++-
tools/perf/ui/stdio/hist.c | 86 ++++++++++-
tools/perf/util/annotate.c | 23 ++-
tools/perf/util/auxtrace.c | 4 +-
tools/perf/util/build-id.c | 8 +-
tools/perf/util/callchain.c | 52 ++++++-
tools/perf/util/callchain.h | 3 +-
tools/perf/util/header.c | 8 +-
tools/perf/util/hist.c | 5 +
tools/perf/util/map.c | 3 +-
tools/perf/util/sort.c | 16 +-
tools/perf/util/sort.h | 1 +
tools/perf/util/srcline.c | 246 +++++++++++++++++++++++++++----
tools/perf/util/symbol-elf.c | 5 +
tools/perf/util/symbol-minimal.c | 7 +
tools/perf/util/symbol.h | 5 +-
tools/perf/util/trace-event-read.c | 4 +-
tools/perf/util/util.h | 20 ++-
62 files changed, 739 insertions(+), 208 deletions(-)
Test results:
The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.
Several are cross builds, the ones with -x-ARCH, and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.
The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.
Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.
# dm
1 alpine:3.4: Ok
2 alpine:3.5: Ok
3 alpine:edge: Ok
4 android-ndk:r12b-arm: Ok
5 archlinux:latest: Ok
6 centos:5: Ok
7 centos:6: Ok
8 centos:7: Ok
9 debian:7: Ok
10 debian:8: Ok
11 debian:9: Ok
12 debian:experimental: Ok
13 debian:experimental-x-arm64: Ok
14 debian:experimental-x-mips: Ok
15 debian:experimental-x-mips64: Ok
16 debian:experimental-x-mipsel: Ok
17 fedora:20: Ok
18 fedora:21: Ok
19 fedora:22: Ok
20 fedora:23: Ok
21 fedora:24: Ok
22 fedora:24-x-ARC-uClibc: Ok
23 fedora:25: Ok
24 fedora:rawhide: Ok
25 mageia:5: Ok
26 opensuse:13.2: Ok
27 opensuse:42.1: Ok
28 opensuse:tumbleweed: Ok
29 ubuntu:12.04.5: Ok
30 ubuntu:14.04.4: Ok
31 ubuntu:14.04.4-x-linaro-arm64: Ok
32 ubuntu:15.10: Ok
33 ubuntu:16.04: Ok
34 ubuntu:16.04-x-arm: Ok
35 ubuntu:16.04-x-arm64: Ok
36 ubuntu:16.04-x-powerpc: Ok
37 ubuntu:16.04-x-powerpc64: Ok
38 ubuntu:16.04-x-s390: Ok
39 ubuntu:16.10: Ok
40 ubuntu:17.04: Ok
#
# uname -a
Linux jouet 4.11.0-rc2+ #5 SMP Mon Mar 20 18:12:29 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
# This kernel lacks the fix by peterz for 'perf test tsc'
#
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: Detect openat syscall event : Ok
3: Detect openat syscall event on all cpus : Ok
4: Read samples using the mmap interface : Ok
5: Parse event definition strings : Ok
6: Simple expression parser : Ok
7: PERF_RECORD_* events & perf_sample fields : Ok
8: Parse perf pmu format : Ok
9: DSO data read : Ok
10: DSO data cache : Ok
11: DSO data reopen : Ok
12: Roundtrip evsel->name : Ok
13: Parse sched tracepoints fields : Ok
14: syscalls:sys_enter_openat event fields : Ok
15: Setup struct perf_event_attr : Ok
16: Match and link multiple hists : Ok
17: 'import perf' in python : Ok
18: Breakpoint overflow signal handler : Ok
19: Breakpoint overflow sampling : Ok
20: Number of exit events of a simple workload : Ok
21: Software clock events period values : Ok
22: Object code reading : Ok
23: Sample parsing : Ok
24: Use a dummy software event to keep tracking: Ok
25: Parse with no sample_id_all bit set : Ok
26: Filter hist entries : Ok
27: Lookup mmap thread : Ok
28: Share thread mg : Ok
29: Sort output of hist entries : Ok
30: Cumulate child hist entries : Ok
31: Track with sched_switch : Ok
32: Filter fds with revents mask in a fdarray : Ok
33: Add fd to a fdarray, making it autogrow : Ok
34: kmod_path__parse : Ok
35: Thread map : Ok
36: LLVM search and compile :
36.1: Basic BPF llvm compile : Ok
36.2: kbuild searching : Ok
36.3: Compile source for BPF prologue generation: Ok
36.4: Compile source for BPF relocation : Ok
37: Session topology : Ok
38: BPF filter :
38.1: Basic BPF filtering : Ok
38.2: BPF pinning : Ok
38.3: BPF prologue generation : Ok
38.4: BPF relocation checker : Ok
39: Synthesize thread map : Ok
40: Remove thread map : Ok
41: Synthesize cpu map : Ok
42: Synthesize stat config : Ok
43: Synthesize stat : Ok
44: Synthesize stat round : Ok
45: Synthesize attr update : Ok
46: Event times : Ok
47: Read backward ring buffer : Ok
48: Print cpu map : Ok
49: Probe SDT events : Ok
50: is_printable_array : Ok
51: Print bitmap : Ok
52: perf hooks : Ok
53: builtin clang support : Skip (not compiled in)
54: unit_number__scnprintf : Ok
55: x86 rdpmc : Ok
56: Convert perf time to TSC : FAILED!
57: DWARF unwind : Ok
58: x86 instruction decoder - new instructions : Ok
59: Intel cqm nmi context read : Skip
#
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_clean_all_O: make clean all
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_no_backtrace_O: make NO_BACKTRACE=1
make_install_O: make install
make_no_libaudit_O: make NO_LIBAUDIT=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_tags_O: make tags
make_no_slang_O: make NO_SLANG=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_pure_O: make
make_install_prefix_O: make install prefix=/tmp/krava
make_no_demangle_O: make NO_DEMANGLE=1
make_doc_O: make doc
make_no_gtk2_O: make NO_GTK2=1
make_help_O: make help
make_static_O: make LDFLAGS=-static
make_no_libunwind_O: make NO_LIBUNWIND=1
make_util_map_o_O: make util/map.o
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_libelf_O: make NO_LIBELF=1
make_debug_O: make DEBUG=1
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_perf_o_O: make perf.o
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libbpf_O: make NO_LIBBPF=1
make_no_newt_O: make NO_NEWT=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_install_bin_O: make install-bin
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [GIT PULL 00/20] perf/core improvements and fixes
2017-03-28 1:38 Arnaldo Carvalho de Melo
@ 2017-03-28 5:45 ` Ingo Molnar
0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2017-03-28 5:45 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
David Ahern, Jiri Olsa, Kan Liang, Masami Hiramatsu, Milian Wolff,
Namhyung Kim, Peter Zijlstra, Ravi Bangoria, Sukadev Bhattiprolu,
Taeung Song, Tommi Rantala, Wang Nan, Yao Jin,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> Test results at the end of this message, as usual.
>
> The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92:
>
> Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170327
>
> for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de:
>
> perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> New features:
>
> - Handle inline functions in callchains (Jin Yao)
>
> - Enable sorting by srcline as key (Milian Wolff)
>
> Fixes:
>
> - Fix no_size logic in addr_filter__resolve_kernel_syms() in the
> auxtrace code (Adrian Hunter)
>
> - Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo)
>
> - Fix divide by zero when calculating percent for an event in a group in
> the annotate by source line code (Taeung Song)
>
> - build-id files now aren't anymore symlinks, their parent directories
> are, so readlink the later (Taeung Song)
>
> - Assorted fixes for null termination problems, mostly related to
> readlink, detected by valgrind (Tommi Rantala)
>
> Infrastructure:
>
> - Make vfs_getname probe point logic in 'perf trace' more robust
> wrt length of pathname (Arnaldo Carvalho de Melo)
>
> - Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo)
>
> - Show 'perf list sdt' option in man page (Ravi Bangoria)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (1):
> perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()
>
> Arnaldo Carvalho de Melo (4):
> perf trace: Check for vfs_getname.pathname length
> perf trace: Fix up error path indentation
> perf trace: Fixup thread refcounting
> perf tools: Remove unused 'prefix' from builtin functions
>
> Jin Yao (5):
> perf report: Refactor common code in srcline.c
> perf report: Find the inline stack for a given address
> perf report: Introduce --inline option
> perf report: Show inline stack for stdio mode
> perf report: Show inline stack for browser mode
>
> Milian Wolff (1):
> perf report: Enable sorting by srcline as key
>
> Ravi Bangoria (1):
> perf list sdt: Show option in man page
>
> Taeung Song (2):
> perf annotate: Fix a bug following symbolic link of a build-id file
> perf annotate: Fix a bug of division by zero when calculating percent
>
> Tommi Rantala (6):
> perf buildid: Do not update SDT cache with null filename
> perf buildid: Do not assume that readlink() returns a null terminated string
> perf tests: Do not assume that readlink() returns a null terminated string
> perf utils: use sizeof(buf) - 1 in readlink() call
> perf utils: Null terminate buf in read_ftrace_printk()
> perf utils: Readlink /proc/self/exe to find the perf binary
>
> tools/perf/Documentation/perf-list.txt | 4 +-
> tools/perf/Documentation/perf-report.txt | 5 +
> tools/perf/bench/bench.h | 20 +--
> tools/perf/bench/futex-hash.c | 3 +-
> tools/perf/bench/futex-lock-pi.c | 3 +-
> tools/perf/bench/futex-requeue.c | 3 +-
> tools/perf/bench/futex-wake-parallel.c | 3 +-
> tools/perf/bench/futex-wake.c | 3 +-
> tools/perf/bench/mem-functions.c | 4 +-
> tools/perf/bench/numa.c | 2 +-
> tools/perf/bench/sched-messaging.c | 3 +-
> tools/perf/bench/sched-pipe.c | 2 +-
> tools/perf/builtin-annotate.c | 2 +-
> tools/perf/builtin-bench.c | 12 +-
> tools/perf/builtin-buildid-cache.c | 3 +-
> tools/perf/builtin-buildid-list.c | 3 +-
> tools/perf/builtin-c2c.c | 4 +-
> tools/perf/builtin-config.c | 2 +-
> tools/perf/builtin-data.c | 9 +-
> tools/perf/builtin-diff.c | 2 +-
> tools/perf/builtin-evlist.c | 2 +-
> tools/perf/builtin-ftrace.c | 2 +-
> tools/perf/builtin-help.c | 2 +-
> tools/perf/builtin-inject.c | 2 +-
> tools/perf/builtin-kallsyms.c | 2 +-
> tools/perf/builtin-kmem.c | 4 +-
> tools/perf/builtin-kvm.c | 16 +-
> tools/perf/builtin-list.c | 2 +-
> tools/perf/builtin-lock.c | 6 +-
> tools/perf/builtin-mem.c | 6 +-
> tools/perf/builtin-probe.c | 6 +-
> tools/perf/builtin-record.c | 2 +-
> tools/perf/builtin-report.c | 4 +-
> tools/perf/builtin-sched.c | 6 +-
> tools/perf/builtin-script.c | 4 +-
> tools/perf/builtin-stat.c | 2 +-
> tools/perf/builtin-timechart.c | 7 +-
> tools/perf/builtin-top.c | 2 +-
> tools/perf/builtin-trace.c | 25 ++--
> tools/perf/builtin-version.c | 3 +-
> tools/perf/builtin.h | 58 ++++----
> tools/perf/perf.c | 11 +-
> tools/perf/tests/builtin-test.c | 2 +-
> tools/perf/tests/sdt.c | 2 +-
> tools/perf/ui/browsers/hists.c | 181 ++++++++++++++++++++++-
> tools/perf/ui/stdio/hist.c | 86 ++++++++++-
> tools/perf/util/annotate.c | 23 ++-
> tools/perf/util/auxtrace.c | 4 +-
> tools/perf/util/build-id.c | 8 +-
> tools/perf/util/callchain.c | 52 ++++++-
> tools/perf/util/callchain.h | 3 +-
> tools/perf/util/header.c | 8 +-
> tools/perf/util/hist.c | 5 +
> tools/perf/util/map.c | 3 +-
> tools/perf/util/sort.c | 16 +-
> tools/perf/util/sort.h | 1 +
> tools/perf/util/srcline.c | 246 +++++++++++++++++++++++++++----
> tools/perf/util/symbol-elf.c | 5 +
> tools/perf/util/symbol-minimal.c | 7 +
> tools/perf/util/symbol.h | 5 +-
> tools/perf/util/trace-event-read.c | 4 +-
> tools/perf/util/util.h | 20 ++-
> 62 files changed, 739 insertions(+), 208 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2017-03-28 5:46 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 21:37 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 01/20] tools build: Make fixdep parsing wait for last target Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 02/20] tools build: Fix objtool build with clang Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 03/20] perf tools: Pass context to perf hook functions Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 04/20] perf llvm: Extract helpers in llvm-utils.c Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 05/20] tools build: Add feature detection for LLVM Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 06/20] tools build: Add feature detection for clang Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 07/20] perf build: Add clang and llvm compile and linking support Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 08/20] perf clang: Add builtin clang support ant test case Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 09/20] perf clang: Use real file system for #include Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 10/20] perf clang: Allow passing CFLAGS to builtin clang Arnaldo Carvalho de Melo
2016-12-05 21:37 ` [PATCH 11/20] perf clang: Update test case to use real BPF script Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 12/20] perf clang: Support compile IR to BPF object and add testcase Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 13/20] perf clang: Compile BPF script using builtin clang support Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 14/20] tools build: Make the .cmd file more readable Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 15/20] tools build: Move tabs to spaces where suitable Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 16/20] perf tools: Move install-gtk target into rules area Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 17/20] perf tools: Move python/perf.so " Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 18/20] perf tools: Cleanup build directory before each test Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 19/20] perf tools: Add non config targets Arnaldo Carvalho de Melo
2016-12-05 21:38 ` [PATCH 20/20] perf annotate: Show raw form for jump instruction with indirect target Arnaldo Carvalho de Melo
2016-12-06 8:17 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2017-03-28 1:38 Arnaldo Carvalho de Melo
2017-03-28 5:45 ` Ingo Molnar
2017-03-24 14:57 Arnaldo Carvalho de Melo
2017-03-24 18:39 ` Ingo Molnar
2015-03-03 3:25 Arnaldo Carvalho de Melo
2015-03-03 6:20 ` Ingo Molnar
2015-03-10 10:03 ` Ingo Molnar
2015-03-10 14:03 ` Arnaldo Carvalho de Melo
2015-03-10 14:37 ` Ingo Molnar
2014-09-17 21:24 Arnaldo Carvalho de Melo
2014-09-19 5:15 ` Ingo Molnar
2013-12-13 15:11 Arnaldo Carvalho de Melo
2013-12-16 13:54 ` Ingo Molnar
2012-09-11 23:52 Arnaldo Carvalho de Melo
2012-09-13 15:15 ` Ingo Molnar
2012-07-05 15:44 Arnaldo Carvalho de Melo
2012-07-06 8:22 ` Ingo Molnar
This is 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).