* [GIT PULL 00/14] perf/core improvements and fixes
@ 2014-06-12 15:30 Jiri Olsa
2014-06-12 20:55 ` Jean Pihet
2014-06-13 6:20 ` Ingo Molnar
0 siblings, 2 replies; 30+ messages in thread
From: Jiri Olsa @ 2014-06-12 15:30 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo, Corey Ashford,
David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
hi Ingo,
please consider pulling
thanks,
jirka
The following changes since commit 7184062b94b4bfac08715fb786fd2df399c5d6ee:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-06-12 13:54:42 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
for you to fetch changes up to 45dc1bb5c1d47f9519e2101f6b073bb4bb1d1f99:
perf tests: Add test for closing dso objects on EMFILE error (2014-06-12 16:53:23 +0200)
----------------------------------------------------------------
perf/core improvements and fixes:
. Honor user freq/interval properly in record command (Namhyung Kim)
. Speedup DWARF unwind (Jiri Olsa)
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
----------------------------------------------------------------
Jiri Olsa (13):
perf tools: Cache register accesses for unwind processing
perf tools: Separate dso data related variables
perf tools: Add data_fd into dso object
perf tools: Add global list of opened dso objects
perf tools: Add global count of opened dso objects
perf tools: Cache dso data file descriptor
perf tools: Add file size check and factor dso__data_read_offset
perf tools: Allow to close dso fd in case of open failure
perf tools: Add dso__data_* interface descriptons
perf tests: Spawn child for each test
perf tests: Allow reuse of test_file function
perf tests: Add test for caching dso file descriptors
perf tests: Add test for closing dso objects on EMFILE error
Namhyung Kim (1):
perf record: Fix to honor user freq/interval properly
tools/perf/tests/builtin-test.c | 42 +++++-
tools/perf/tests/dso-data.c | 214 +++++++++++++++++++++++++++-
tools/perf/tests/tests.h | 2 +
tools/perf/util/dso.c | 279 +++++++++++++++++++++++++++++++++----
tools/perf/util/dso.h | 50 ++++++-
tools/perf/util/event.h | 5 +
tools/perf/util/evsel.c | 4 +-
tools/perf/util/perf_regs.c | 10 +-
tools/perf/util/perf_regs.h | 4 +-
tools/perf/util/unwind-libunwind.c | 2 -
10 files changed, 574 insertions(+), 38 deletions(-)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2014-06-12 15:30 Jiri Olsa
@ 2014-06-12 20:55 ` Jean Pihet
2014-06-13 9:03 ` Jiri Olsa
2014-06-13 6:20 ` Ingo Molnar
1 sibling, 1 reply; 30+ messages in thread
From: Jean Pihet @ 2014-06-12 20:55 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel@vger.kernel.org, Andi Kleen,
Arnaldo Carvalho de Melo, Corey Ashford, David Ahern,
Frederic Weisbecker, Namhyung Kim, Paul Mackerras, Peter Zijlstra
Hi Jiri,
On 12 June 2014 17:30, Jiri Olsa <jolsa@kernel.org> wrote:
> hi Ingo,
> please consider pulling
>
> thanks,
> jirka
>
> The following changes since commit 7184062b94b4bfac08715fb786fd2df399c5d6ee:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-06-12 13:54:42 +0200)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
>
> for you to fetch changes up to 45dc1bb5c1d47f9519e2101f6b073bb4bb1d1f99:
>
> perf tests: Add test for closing dso objects on EMFILE error (2014-06-12 16:53:23 +0200)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> . Honor user freq/interval properly in record command (Namhyung Kim)
>
> . Speedup DWARF unwind (Jiri Olsa)
Here are the results of the performance assessment on ARMv7, FWIW:
The results for unwind_speedup (v4) on ARMv7 are:
- libunwind: between -17% in execution time for light load (i.e. using
not-so-deep backtraces from the stress app.) and -25% for deep
backtrace (the stress_bt app.),
- libdw: no significant improvement (0-3% improvement).
The results for unwind_speedup (v3) on ARMv7 are:
- libunwind: between -29% in execution time for light load (i.e. using
not-so-deep backtraces from the stress app.) and -49% for deep
backtrace (the stress_bt app.),
- libdw: no significant improvement (0-2% improvement).
Note: v3 is faster than v4 by 13-25%, with and without the speed-up
patches. The real cause has been investigated, yet.
Cf. https://wiki.linaro.org/LEG/Engineering/TOOLS/perf-callstack-unwinding#Speed_improvement
for the details.
Regards,
Jean
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
>
> ----------------------------------------------------------------
> Jiri Olsa (13):
> perf tools: Cache register accesses for unwind processing
> perf tools: Separate dso data related variables
> perf tools: Add data_fd into dso object
> perf tools: Add global list of opened dso objects
> perf tools: Add global count of opened dso objects
> perf tools: Cache dso data file descriptor
> perf tools: Add file size check and factor dso__data_read_offset
> perf tools: Allow to close dso fd in case of open failure
> perf tools: Add dso__data_* interface descriptons
> perf tests: Spawn child for each test
> perf tests: Allow reuse of test_file function
> perf tests: Add test for caching dso file descriptors
> perf tests: Add test for closing dso objects on EMFILE error
>
> Namhyung Kim (1):
> perf record: Fix to honor user freq/interval properly
>
> tools/perf/tests/builtin-test.c | 42 +++++-
> tools/perf/tests/dso-data.c | 214 +++++++++++++++++++++++++++-
> tools/perf/tests/tests.h | 2 +
> tools/perf/util/dso.c | 279 +++++++++++++++++++++++++++++++++----
> tools/perf/util/dso.h | 50 ++++++-
> tools/perf/util/event.h | 5 +
> tools/perf/util/evsel.c | 4 +-
> tools/perf/util/perf_regs.c | 10 +-
> tools/perf/util/perf_regs.h | 4 +-
> tools/perf/util/unwind-libunwind.c | 2 -
> 10 files changed, 574 insertions(+), 38 deletions(-)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2014-06-12 15:30 Jiri Olsa
2014-06-12 20:55 ` Jean Pihet
@ 2014-06-13 6:20 ` Ingo Molnar
1 sibling, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2014-06-13 6:20 UTC (permalink / raw)
To: Jiri Olsa
Cc: linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
David Ahern, Frederic Weisbecker, Jean Pihet, Namhyung Kim,
Paul Mackerras, Peter Zijlstra
* Jiri Olsa <jolsa@kernel.org> wrote:
> hi Ingo,
> please consider pulling
>
> thanks,
> jirka
>
> The following changes since commit 7184062b94b4bfac08715fb786fd2df399c5d6ee:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-06-12 13:54:42 +0200)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
>
> for you to fetch changes up to 45dc1bb5c1d47f9519e2101f6b073bb4bb1d1f99:
>
> perf tests: Add test for closing dso objects on EMFILE error (2014-06-12 16:53:23 +0200)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> . Honor user freq/interval properly in record command (Namhyung Kim)
>
> . Speedup DWARF unwind (Jiri Olsa)
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
>
> ----------------------------------------------------------------
> Jiri Olsa (13):
> perf tools: Cache register accesses for unwind processing
> perf tools: Separate dso data related variables
> perf tools: Add data_fd into dso object
> perf tools: Add global list of opened dso objects
> perf tools: Add global count of opened dso objects
> perf tools: Cache dso data file descriptor
> perf tools: Add file size check and factor dso__data_read_offset
> perf tools: Allow to close dso fd in case of open failure
> perf tools: Add dso__data_* interface descriptons
> perf tests: Spawn child for each test
> perf tests: Allow reuse of test_file function
> perf tests: Add test for caching dso file descriptors
> perf tests: Add test for closing dso objects on EMFILE error
>
> Namhyung Kim (1):
> perf record: Fix to honor user freq/interval properly
>
> tools/perf/tests/builtin-test.c | 42 +++++-
> tools/perf/tests/dso-data.c | 214 +++++++++++++++++++++++++++-
> tools/perf/tests/tests.h | 2 +
> tools/perf/util/dso.c | 279 +++++++++++++++++++++++++++++++++----
> tools/perf/util/dso.h | 50 ++++++-
> tools/perf/util/event.h | 5 +
> tools/perf/util/evsel.c | 4 +-
> tools/perf/util/perf_regs.c | 10 +-
> tools/perf/util/perf_regs.h | 4 +-
> tools/perf/util/unwind-libunwind.c | 2 -
> 10 files changed, 574 insertions(+), 38 deletions(-)
Pulled, thanks a lot Jiri!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2014-06-12 20:55 ` Jean Pihet
@ 2014-06-13 9:03 ` Jiri Olsa
0 siblings, 0 replies; 30+ messages in thread
From: Jiri Olsa @ 2014-06-13 9:03 UTC (permalink / raw)
To: Jean Pihet
Cc: Jiri Olsa, Ingo Molnar, linux-kernel@vger.kernel.org, Andi Kleen,
Arnaldo Carvalho de Melo, Corey Ashford, David Ahern,
Frederic Weisbecker, Namhyung Kim, Paul Mackerras, Peter Zijlstra
On Thu, Jun 12, 2014 at 10:55:55PM +0200, Jean Pihet wrote:
> Hi Jiri,
>
>
> On 12 June 2014 17:30, Jiri Olsa <jolsa@kernel.org> wrote:
> > hi Ingo,
> > please consider pulling
> >
> > thanks,
> > jirka
> >
> > The following changes since commit 7184062b94b4bfac08715fb786fd2df399c5d6ee:
> >
> > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-06-12 13:54:42 +0200)
> >
> > are available in the git repository at:
> >
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
> >
> > for you to fetch changes up to 45dc1bb5c1d47f9519e2101f6b073bb4bb1d1f99:
> >
> > perf tests: Add test for closing dso objects on EMFILE error (2014-06-12 16:53:23 +0200)
> >
> > ----------------------------------------------------------------
> > perf/core improvements and fixes:
> >
> > . Honor user freq/interval properly in record command (Namhyung Kim)
> >
> > . Speedup DWARF unwind (Jiri Olsa)
> Here are the results of the performance assessment on ARMv7, FWIW:
>
> The results for unwind_speedup (v4) on ARMv7 are:
> - libunwind: between -17% in execution time for light load (i.e. using
> not-so-deep backtraces from the stress app.) and -25% for deep
> backtrace (the stress_bt app.),
> - libdw: no significant improvement (0-3% improvement).
>
> The results for unwind_speedup (v3) on ARMv7 are:
> - libunwind: between -29% in execution time for light load (i.e. using
> not-so-deep backtraces from the stress app.) and -49% for deep
> backtrace (the stress_bt app.),
> - libdw: no significant improvement (0-2% improvement).
>
> Note: v3 is faster than v4 by 13-25%, with and without the speed-up
> patches. The real cause has been investigated, yet.
hi,
yep, I also found the v4 to be slower, because of the
caching code in each open.. I believe the first version
you meassured was the original, that kept all dso objects
open.. now the caching code spends more cycles
also we are not mmapping dso so far.. there's the cached
read in place
please let me know if you think it's something else
thanks for testing,
jirka
^ permalink raw reply [flat|nested] 30+ messages in thread
* [GIT PULL 00/14] perf/core improvements and fixes
@ 2015-05-29 16:30 Arnaldo Carvalho de Melo
2015-05-29 18:20 ` Ingo Molnar
0 siblings, 1 reply; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-05-29 16:30 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
Jiri Olsa, Martin Liska, Masami Hiramatsu, Namhyung Kim,
Paul Mackerras, Peter Zijlstra, pi3orama, Rabin Vincent,
Riku Voipio, Stephane Eranian, Wang Nan, Zefan Li,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider applying,
- Arnaldo
The following changes since commit f1942b96b4b44c1ab0e0b82fef93ba7e1fada7af:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-28 11:09:22 +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 ed426915900db3c58c410b8b38f6ff0e46bf6c96:
perf tools: Make Ctrl-C stop processing on TUI (2015-05-29 12:49:00 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Make Ctrl-C stop processing on TUI, allowing interrupting the load of big
perf.data files (Namhyung Kim)
- Fix 'perf annotate' -i option, which is currently ignored (Martin Liška)
- Add ARM64 perf_regs_load to support libunwind and enable testing (Wang Nan)
Infrastructure:
- Fix thread ref-counting in db-export (Adrian Hunter)
- Fix compiler warning about may be accessing uninitialized (Arnaldo Carvalho de Melo)
- No need to have two lists for user and kernel DSOs, unify them (Arnaldo Carvalho de Melo)
- Function namespace consistency fixups (Arnaldo Carvalho de Melo)
- Do not fail on missing Build file, fixing the build on MIPS (Jiri Olsa)
- Fix up syscall tests, making those tests pass on ARM64 (Riku Voipio)
- Fix 'function unused' warning in 'perf probe' (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (1):
perf db-export: Fix thread ref-counting
Arnaldo Carvalho de Melo (5):
perf kmem: Fix compiler warning about may be accessing uninitialized variable
perf machine: Adopt findnew_kernel method
perf machine: No need to have two DSOs lists
perf machine: Introduce machine__findnew_dso() method
perf machine: Fix up vdso methods names
Jiri Olsa (1):
perf build: Do not fail on missing Build file
Martin Liška (1):
perf annotate: Fix -i option, which is currently ignored.
Namhyung Kim (1):
perf tools: Make Ctrl-C stop processing on TUI
Riku Voipio (3):
perf tests: Switch from open to openat
perf tests: Aename open*.c to openat*.c
perf tests: Remove getpgrp from mmap-basic
Wang Nan (2):
perf probe: Fix 'function unused' warning
perf tools: Add ARM64 perf_regs_load to support libunwind and enable testing
tools/build/Makefile.build | 2 +-
tools/build/tests/ex/Build | 1 +
tools/build/tests/ex/empty2/README | 2 +
tools/perf/arch/arm64/Build | 1 +
tools/perf/arch/arm64/include/perf_regs.h | 3 +
tools/perf/arch/arm64/tests/Build | 2 +
tools/perf/arch/arm64/tests/dwarf-unwind.c | 61 ++++++++++++++++++++
tools/perf/arch/arm64/tests/regs_load.S | 46 +++++++++++++++
tools/perf/builtin-annotate.c | 3 +-
tools/perf/builtin-kmem.c | 2 +-
tools/perf/tests/Build | 8 +--
tools/perf/tests/builtin-test.c | 14 ++---
tools/perf/tests/hists_common.c | 3 +-
tools/perf/tests/mmap-basic.c | 6 +-
...yscall-all-cpus.c => openat-syscall-all-cpus.c} | 12 ++--
...call-tp-fields.c => openat-syscall-tp-fields.c} | 6 +-
.../tests/{open-syscall.c => openat-syscall.c} | 14 ++---
tools/perf/tests/parse-events.c | 12 ++--
tools/perf/tests/tests.h | 8 +--
tools/perf/ui/browsers/annotate.c | 4 ++
tools/perf/ui/browsers/hists.c | 4 ++
tools/perf/ui/tui/setup.c | 2 +-
tools/perf/util/build-id.c | 59 ++++++-------------
tools/perf/util/db-export.c | 19 ++++---
tools/perf/util/dso.c | 6 +-
tools/perf/util/dso.h | 4 +-
tools/perf/util/header.c | 6 +-
tools/perf/util/machine.c | 46 ++++++++-------
tools/perf/util/machine.h | 5 +-
tools/perf/util/map.c | 4 +-
tools/perf/util/probe-event.c | 66 +++++++++++-----------
tools/perf/util/symbol-elf.c | 6 +-
tools/perf/util/vdso.c | 24 ++++----
tools/perf/util/vdso.h | 4 +-
34 files changed, 277 insertions(+), 188 deletions(-)
create mode 100644 tools/build/tests/ex/empty2/README
create mode 100644 tools/perf/arch/arm64/tests/Build
create mode 100644 tools/perf/arch/arm64/tests/dwarf-unwind.c
create mode 100644 tools/perf/arch/arm64/tests/regs_load.S
rename tools/perf/tests/{open-syscall-all-cpus.c => openat-syscall-all-cpus.c} (90%)
rename tools/perf/tests/{open-syscall-tp-fields.c => openat-syscall-tp-fields.c} (94%)
rename tools/perf/tests/{open-syscall.c => openat-syscall.c} (79%)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2015-05-29 16:30 Arnaldo Carvalho de Melo
@ 2015-05-29 18:20 ` Ingo Molnar
0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2015-05-29 18:20 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern,
Don Zickus, Frederic Weisbecker, Jiri Olsa, Martin Liska,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
pi3orama, Rabin Vincent, Riku Voipio, Stephane Eranian, Wang Nan,
Zefan Li, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider applying,
>
> - Arnaldo
>
> The following changes since commit f1942b96b4b44c1ab0e0b82fef93ba7e1fada7af:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-28 11:09:22 +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 ed426915900db3c58c410b8b38f6ff0e46bf6c96:
>
> perf tools: Make Ctrl-C stop processing on TUI (2015-05-29 12:49:00 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Make Ctrl-C stop processing on TUI, allowing interrupting the load of big
> perf.data files (Namhyung Kim)
>
> - Fix 'perf annotate' -i option, which is currently ignored (Martin Liška)
>
> - Add ARM64 perf_regs_load to support libunwind and enable testing (Wang Nan)
>
> Infrastructure:
>
> - Fix thread ref-counting in db-export (Adrian Hunter)
>
> - Fix compiler warning about may be accessing uninitialized (Arnaldo Carvalho de Melo)
>
> - No need to have two lists for user and kernel DSOs, unify them (Arnaldo Carvalho de Melo)
>
> - Function namespace consistency fixups (Arnaldo Carvalho de Melo)
>
> - Do not fail on missing Build file, fixing the build on MIPS (Jiri Olsa)
>
> - Fix up syscall tests, making those tests pass on ARM64 (Riku Voipio)
>
> - Fix 'function unused' warning in 'perf probe' (Wang Nan)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (1):
> perf db-export: Fix thread ref-counting
>
> Arnaldo Carvalho de Melo (5):
> perf kmem: Fix compiler warning about may be accessing uninitialized variable
> perf machine: Adopt findnew_kernel method
> perf machine: No need to have two DSOs lists
> perf machine: Introduce machine__findnew_dso() method
> perf machine: Fix up vdso methods names
>
> Jiri Olsa (1):
> perf build: Do not fail on missing Build file
>
> Martin Liška (1):
> perf annotate: Fix -i option, which is currently ignored.
>
> Namhyung Kim (1):
> perf tools: Make Ctrl-C stop processing on TUI
>
> Riku Voipio (3):
> perf tests: Switch from open to openat
> perf tests: Aename open*.c to openat*.c
> perf tests: Remove getpgrp from mmap-basic
>
> Wang Nan (2):
> perf probe: Fix 'function unused' warning
> perf tools: Add ARM64 perf_regs_load to support libunwind and enable testing
>
> tools/build/Makefile.build | 2 +-
> tools/build/tests/ex/Build | 1 +
> tools/build/tests/ex/empty2/README | 2 +
> tools/perf/arch/arm64/Build | 1 +
> tools/perf/arch/arm64/include/perf_regs.h | 3 +
> tools/perf/arch/arm64/tests/Build | 2 +
> tools/perf/arch/arm64/tests/dwarf-unwind.c | 61 ++++++++++++++++++++
> tools/perf/arch/arm64/tests/regs_load.S | 46 +++++++++++++++
> tools/perf/builtin-annotate.c | 3 +-
> tools/perf/builtin-kmem.c | 2 +-
> tools/perf/tests/Build | 8 +--
> tools/perf/tests/builtin-test.c | 14 ++---
> tools/perf/tests/hists_common.c | 3 +-
> tools/perf/tests/mmap-basic.c | 6 +-
> ...yscall-all-cpus.c => openat-syscall-all-cpus.c} | 12 ++--
> ...call-tp-fields.c => openat-syscall-tp-fields.c} | 6 +-
> .../tests/{open-syscall.c => openat-syscall.c} | 14 ++---
> tools/perf/tests/parse-events.c | 12 ++--
> tools/perf/tests/tests.h | 8 +--
> tools/perf/ui/browsers/annotate.c | 4 ++
> tools/perf/ui/browsers/hists.c | 4 ++
> tools/perf/ui/tui/setup.c | 2 +-
> tools/perf/util/build-id.c | 59 ++++++-------------
> tools/perf/util/db-export.c | 19 ++++---
> tools/perf/util/dso.c | 6 +-
> tools/perf/util/dso.h | 4 +-
> tools/perf/util/header.c | 6 +-
> tools/perf/util/machine.c | 46 ++++++++-------
> tools/perf/util/machine.h | 5 +-
> tools/perf/util/map.c | 4 +-
> tools/perf/util/probe-event.c | 66 +++++++++++-----------
> tools/perf/util/symbol-elf.c | 6 +-
> tools/perf/util/vdso.c | 24 ++++----
> tools/perf/util/vdso.h | 4 +-
> 34 files changed, 277 insertions(+), 188 deletions(-)
> create mode 100644 tools/build/tests/ex/empty2/README
> create mode 100644 tools/perf/arch/arm64/tests/Build
> create mode 100644 tools/perf/arch/arm64/tests/dwarf-unwind.c
> create mode 100644 tools/perf/arch/arm64/tests/regs_load.S
> rename tools/perf/tests/{open-syscall-all-cpus.c => openat-syscall-all-cpus.c} (90%)
> rename tools/perf/tests/{open-syscall-tp-fields.c => openat-syscall-tp-fields.c} (94%)
> rename tools/perf/tests/{open-syscall.c => openat-syscall.c} (79%)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
* [GIT PULL 00/14] perf/core improvements and fixes
@ 2015-08-17 19:11 Arnaldo Carvalho de Melo
2015-08-20 9:50 ` Ingo Molnar
0 siblings, 1 reply; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-17 19: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,
Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra,
Stephane Eranian, Will Deacon
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Hi Ingo,
This comes with part of Adrian's latest pull req to support Intel PT
on tools/perf, with enough to testing it, see the example in the latest
patch in this series.
More wore patches for BTS and further Intel PT goodies will come soon,
after some issues with resolving symbols get fixed. This was something that
wasn't present last time I tested the BTS bits, so I think we should resolve
it soon, but while we do it, these patches should move things forward wrt
being able to test the stuff already in the kernel and to have access to this
hardware feature using perf.
Please consider applying,
- Arnaldo
The following changes since commit a897b5f0393a8a05d230c9248dc5324fb30720a0:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-08-13 09:23:53 +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 5efb1d5489520ce72232bbc28e9156f0ebddc44e:
perf tools: Take Intel PT into use (2015-08-17 11:11:37 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
- Support Intel PT in several tools, enabling the use of the processor trace
feature introduced in Intel Broadwell processors: (Adrian Hunter)
# dmesg | grep Performance
# [0.188477] Performance Events: PEBS fmt2+, 16-deep LBR, Broadwell events, full-width counters, Intel PMU driver.
# perf record -e intel_pt//u -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.216 MB perf.data ]
# perf script # then navigate in the tool output to some area, like this one:
184 1030 dl_main (/usr/lib64/ld-2.17.so) => 7f21ba661440 dl_main (/usr/lib64/ld-2.17.so)
185 1457 dl_main (/usr/lib64/ld-2.17.so) => 7f21ba669f10 _dl_new_object (/usr/lib64/ld-2.17.so)
186 9f37 _dl_new_object (/usr/lib64/ld-2.17.so) => 7f21ba677b90 strlen (/usr/lib64/ld-2.17.so)
187 7ba3 strlen (/usr/lib64/ld-2.17.so) => 7f21ba677c75 strlen (/usr/lib64/ld-2.17.so)
188 7c78 strlen (/usr/lib64/ld-2.17.so) => 7f21ba669f3c _dl_new_object (/usr/lib64/ld-2.17.so)
189 9f8a _dl_new_object (/usr/lib64/ld-2.17.so) => 7f21ba65fab0 calloc@plt (/usr/lib64/ld-2.17.so)
190 fab0 calloc@plt (/usr/lib64/ld-2.17.so) => 7f21ba675e70 calloc (/usr/lib64/ld-2.17.so)
191 5e87 calloc (/usr/lib64/ld-2.17.so) => 7f21ba65fa90 malloc@plt (/usr/lib64/ld-2.17.so)
192 fa90 malloc@plt (/usr/lib64/ld-2.17.so) => 7f21ba675e60 malloc (/usr/lib64/ld-2.17.so)
193 5e68 malloc (/usr/lib64/ld-2.17.so) => 7f21ba65fa80 __libc_memalign@plt (/usr/lib64/ld-2.17.so)
194 fa80 __libc_memalign@plt (/usr/lib64/ld-2.17.so) => 7f21ba675d50 __libc_memalign (/usr/lib64/ld-2.17.so)
195 5d63 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675e20 __libc_memalign (/usr/lib64/ld-2.17.so)
196 5e40 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675d73 __libc_memalign (/usr/lib64/ld-2.17.so)
197 5d97 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675e18 __libc_memalign (/usr/lib64/ld-2.17.so)
198 5e1e __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675df9 __libc_memalign (/usr/lib64/ld-2.17.so)
199 5e10 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba669f8f _dl_new_object (/usr/lib64/ld-2.17.so)
200 9fc2 _dl_new_object (/usr/lib64/ld-2.17.so) => 7f21ba678e70 memcpy (/usr/lib64/ld-2.17.so)
201 8e8c memcpy (/usr/lib64/ld-2.17.so) => 7f21ba678ea0 memcpy (/usr/lib64/ld-2.17.so)
- Fix annotation of vdso (Adrian Hunter)
- Fix DWARF callchains in 'perf script' (Jiri Olsa)
- Fix adding probes in kernel syscalls and listing which variables can be
collected at kernel syscall function lines (Masami Hiramatsu)
Build Fixes:
- Fix 32-bit compilation error in util/annotate.c (Adrian Hunter)
- Support static linking with libdw on Fedora 22 (Andi Kleen)
Infrastructure:
- Add a helper function to probe whether cpu-wide tracing is possible (Adrian Hunter)
- Move vfs_getname storage to per thread area in 'perf trace' (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Adrian Hunter (10):
perf annotate: Fix 32-bit compilation error in util/annotate.c
perf symbols: Fix annotation of vdso
perf tools: Add a helper function to probe whether cpu-wide tracing is possible
perf auxtrace: Add Intel PT as an AUX area tracing type
perf tools: Add Intel PT packet decoder
perf tools: Add Intel PT instruction decoder
perf tools: Add Intel PT log
perf tools: Add Intel PT decoder
perf tools: Add Intel PT support
perf tools: Take Intel PT into use
Andi Kleen (1):
perf tools: Support static linking with libdw
Arnaldo Carvalho de Melo (1):
perf trace: Move vfs_getname storage to per thread area
Jiri Olsa (1):
perf script: Initialize callchain_param.record_mode
Masami Hiramatsu (1):
perf probe: Fix to add missed brace around if block
tools/build/Makefile.build | 2 +
tools/build/feature/Makefile | 7 +-
tools/perf/.gitignore | 1 +
tools/perf/Documentation/intel-pt.txt | 588 ++++++
tools/perf/Makefile.perf | 12 +-
tools/perf/arch/x86/util/Build | 4 +
tools/perf/arch/x86/util/auxtrace.c | 38 +
tools/perf/arch/x86/util/intel-pt.c | 752 ++++++++
tools/perf/arch/x86/util/pmu.c | 15 +
tools/perf/builtin-script.c | 17 +
tools/perf/builtin-trace.c | 38 +-
tools/perf/config/Makefile | 6 +-
tools/perf/util/Build | 2 +
tools/perf/util/annotate.c | 4 +-
tools/perf/util/auxtrace.c | 6 +-
tools/perf/util/auxtrace.h | 1 +
tools/perf/util/dwarf-aux.c | 3 +-
tools/perf/util/evlist.h | 1 +
tools/perf/util/intel-pt-decoder/Build | 11 +
.../util/intel-pt-decoder/gen-insn-attr-x86.awk | 386 ++++
tools/perf/util/intel-pt-decoder/inat.c | 96 +
tools/perf/util/intel-pt-decoder/inat.h | 221 +++
tools/perf/util/intel-pt-decoder/insn.c | 594 ++++++
tools/perf/util/intel-pt-decoder/insn.h | 201 ++
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 1816 +++++++++++++++++++
.../perf/util/intel-pt-decoder/intel-pt-decoder.h | 104 ++
.../util/intel-pt-decoder/intel-pt-insn-decoder.c | 246 +++
.../util/intel-pt-decoder/intel-pt-insn-decoder.h | 65 +
tools/perf/util/intel-pt-decoder/intel-pt-log.c | 155 ++
tools/perf/util/intel-pt-decoder/intel-pt-log.h | 52 +
.../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 400 ++++
.../util/intel-pt-decoder/intel-pt-pkt-decoder.h | 64 +
.../perf/util/intel-pt-decoder/x86-opcode-map.txt | 970 ++++++++++
tools/perf/util/intel-pt.c | 1911 ++++++++++++++++++++
tools/perf/util/intel-pt.h | 51 +
tools/perf/util/pmu.c | 4 +-
tools/perf/util/record.c | 24 +
tools/perf/util/symbol-elf.c | 11 +
38 files changed, 8858 insertions(+), 21 deletions(-)
create mode 100644 tools/perf/Documentation/intel-pt.txt
create mode 100644 tools/perf/arch/x86/util/auxtrace.c
create mode 100644 tools/perf/arch/x86/util/intel-pt.c
create mode 100644 tools/perf/arch/x86/util/pmu.c
create mode 100644 tools/perf/util/intel-pt-decoder/Build
create mode 100644 tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk
create mode 100644 tools/perf/util/intel-pt-decoder/inat.c
create mode 100644 tools/perf/util/intel-pt-decoder/inat.h
create mode 100644 tools/perf/util/intel-pt-decoder/insn.c
create mode 100644 tools/perf/util/intel-pt-decoder/insn.h
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-log.c
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-log.h
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.h
create mode 100644 tools/perf/util/intel-pt-decoder/x86-opcode-map.txt
create mode 100644 tools/perf/util/intel-pt.c
create mode 100644 tools/perf/util/intel-pt.h
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2015-08-17 19:11 Arnaldo Carvalho de Melo
@ 2015-08-20 9:50 ` Ingo Molnar
0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2015-08-20 9:50 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,
Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra,
Stephane Eranian, Will Deacon
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Hi Ingo,
>
> This comes with part of Adrian's latest pull req to support Intel PT
> on tools/perf, with enough to testing it, see the example in the latest
> patch in this series.
>
> More wore patches for BTS and further Intel PT goodies will come soon,
> after some issues with resolving symbols get fixed. This was something that
> wasn't present last time I tested the BTS bits, so I think we should resolve
> it soon, but while we do it, these patches should move things forward wrt
> being able to test the stuff already in the kernel and to have access to this
> hardware feature using perf.
>
> Please consider applying,
>
> - Arnaldo
>
> The following changes since commit a897b5f0393a8a05d230c9248dc5324fb30720a0:
>
> Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-08-13 09:23:53 +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 5efb1d5489520ce72232bbc28e9156f0ebddc44e:
>
> perf tools: Take Intel PT into use (2015-08-17 11:11:37 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> - Support Intel PT in several tools, enabling the use of the processor trace
> feature introduced in Intel Broadwell processors: (Adrian Hunter)
>
> # dmesg | grep Performance
> # [0.188477] Performance Events: PEBS fmt2+, 16-deep LBR, Broadwell events, full-width counters, Intel PMU driver.
> # perf record -e intel_pt//u -a sleep 1
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.216 MB perf.data ]
> # perf script # then navigate in the tool output to some area, like this one:
> 184 1030 dl_main (/usr/lib64/ld-2.17.so) => 7f21ba661440 dl_main (/usr/lib64/ld-2.17.so)
> 185 1457 dl_main (/usr/lib64/ld-2.17.so) => 7f21ba669f10 _dl_new_object (/usr/lib64/ld-2.17.so)
> 186 9f37 _dl_new_object (/usr/lib64/ld-2.17.so) => 7f21ba677b90 strlen (/usr/lib64/ld-2.17.so)
> 187 7ba3 strlen (/usr/lib64/ld-2.17.so) => 7f21ba677c75 strlen (/usr/lib64/ld-2.17.so)
> 188 7c78 strlen (/usr/lib64/ld-2.17.so) => 7f21ba669f3c _dl_new_object (/usr/lib64/ld-2.17.so)
> 189 9f8a _dl_new_object (/usr/lib64/ld-2.17.so) => 7f21ba65fab0 calloc@plt (/usr/lib64/ld-2.17.so)
> 190 fab0 calloc@plt (/usr/lib64/ld-2.17.so) => 7f21ba675e70 calloc (/usr/lib64/ld-2.17.so)
> 191 5e87 calloc (/usr/lib64/ld-2.17.so) => 7f21ba65fa90 malloc@plt (/usr/lib64/ld-2.17.so)
> 192 fa90 malloc@plt (/usr/lib64/ld-2.17.so) => 7f21ba675e60 malloc (/usr/lib64/ld-2.17.so)
> 193 5e68 malloc (/usr/lib64/ld-2.17.so) => 7f21ba65fa80 __libc_memalign@plt (/usr/lib64/ld-2.17.so)
> 194 fa80 __libc_memalign@plt (/usr/lib64/ld-2.17.so) => 7f21ba675d50 __libc_memalign (/usr/lib64/ld-2.17.so)
> 195 5d63 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675e20 __libc_memalign (/usr/lib64/ld-2.17.so)
> 196 5e40 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675d73 __libc_memalign (/usr/lib64/ld-2.17.so)
> 197 5d97 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675e18 __libc_memalign (/usr/lib64/ld-2.17.so)
> 198 5e1e __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba675df9 __libc_memalign (/usr/lib64/ld-2.17.so)
> 199 5e10 __libc_memalign (/usr/lib64/ld-2.17.so) => 7f21ba669f8f _dl_new_object (/usr/lib64/ld-2.17.so)
> 200 9fc2 _dl_new_object (/usr/lib64/ld-2.17.so) => 7f21ba678e70 memcpy (/usr/lib64/ld-2.17.so)
> 201 8e8c memcpy (/usr/lib64/ld-2.17.so) => 7f21ba678ea0 memcpy (/usr/lib64/ld-2.17.so)
>
> - Fix annotation of vdso (Adrian Hunter)
>
> - Fix DWARF callchains in 'perf script' (Jiri Olsa)
>
> - Fix adding probes in kernel syscalls and listing which variables can be
> collected at kernel syscall function lines (Masami Hiramatsu)
>
> Build Fixes:
>
> - Fix 32-bit compilation error in util/annotate.c (Adrian Hunter)
>
> - Support static linking with libdw on Fedora 22 (Andi Kleen)
>
> Infrastructure:
>
> - Add a helper function to probe whether cpu-wide tracing is possible (Adrian Hunter)
>
> - Move vfs_getname storage to per thread area in 'perf trace' (Arnaldo Carvalho de Melo)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Adrian Hunter (10):
> perf annotate: Fix 32-bit compilation error in util/annotate.c
> perf symbols: Fix annotation of vdso
> perf tools: Add a helper function to probe whether cpu-wide tracing is possible
> perf auxtrace: Add Intel PT as an AUX area tracing type
> perf tools: Add Intel PT packet decoder
> perf tools: Add Intel PT instruction decoder
> perf tools: Add Intel PT log
> perf tools: Add Intel PT decoder
> perf tools: Add Intel PT support
> perf tools: Take Intel PT into use
>
> Andi Kleen (1):
> perf tools: Support static linking with libdw
>
> Arnaldo Carvalho de Melo (1):
> perf trace: Move vfs_getname storage to per thread area
>
> Jiri Olsa (1):
> perf script: Initialize callchain_param.record_mode
>
> Masami Hiramatsu (1):
> perf probe: Fix to add missed brace around if block
>
> tools/build/Makefile.build | 2 +
> tools/build/feature/Makefile | 7 +-
> tools/perf/.gitignore | 1 +
> tools/perf/Documentation/intel-pt.txt | 588 ++++++
> tools/perf/Makefile.perf | 12 +-
> tools/perf/arch/x86/util/Build | 4 +
> tools/perf/arch/x86/util/auxtrace.c | 38 +
> tools/perf/arch/x86/util/intel-pt.c | 752 ++++++++
> tools/perf/arch/x86/util/pmu.c | 15 +
> tools/perf/builtin-script.c | 17 +
> tools/perf/builtin-trace.c | 38 +-
> tools/perf/config/Makefile | 6 +-
> tools/perf/util/Build | 2 +
> tools/perf/util/annotate.c | 4 +-
> tools/perf/util/auxtrace.c | 6 +-
> tools/perf/util/auxtrace.h | 1 +
> tools/perf/util/dwarf-aux.c | 3 +-
> tools/perf/util/evlist.h | 1 +
> tools/perf/util/intel-pt-decoder/Build | 11 +
> .../util/intel-pt-decoder/gen-insn-attr-x86.awk | 386 ++++
> tools/perf/util/intel-pt-decoder/inat.c | 96 +
> tools/perf/util/intel-pt-decoder/inat.h | 221 +++
> tools/perf/util/intel-pt-decoder/insn.c | 594 ++++++
> tools/perf/util/intel-pt-decoder/insn.h | 201 ++
> .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 1816 +++++++++++++++++++
> .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 104 ++
> .../util/intel-pt-decoder/intel-pt-insn-decoder.c | 246 +++
> .../util/intel-pt-decoder/intel-pt-insn-decoder.h | 65 +
> tools/perf/util/intel-pt-decoder/intel-pt-log.c | 155 ++
> tools/perf/util/intel-pt-decoder/intel-pt-log.h | 52 +
> .../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 400 ++++
> .../util/intel-pt-decoder/intel-pt-pkt-decoder.h | 64 +
> .../perf/util/intel-pt-decoder/x86-opcode-map.txt | 970 ++++++++++
> tools/perf/util/intel-pt.c | 1911 ++++++++++++++++++++
> tools/perf/util/intel-pt.h | 51 +
> tools/perf/util/pmu.c | 4 +-
> tools/perf/util/record.c | 24 +
> tools/perf/util/symbol-elf.c | 11 +
> 38 files changed, 8858 insertions(+), 21 deletions(-)
> create mode 100644 tools/perf/Documentation/intel-pt.txt
> create mode 100644 tools/perf/arch/x86/util/auxtrace.c
> create mode 100644 tools/perf/arch/x86/util/intel-pt.c
> create mode 100644 tools/perf/arch/x86/util/pmu.c
> create mode 100644 tools/perf/util/intel-pt-decoder/Build
> create mode 100644 tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk
> create mode 100644 tools/perf/util/intel-pt-decoder/inat.c
> create mode 100644 tools/perf/util/intel-pt-decoder/inat.h
> create mode 100644 tools/perf/util/intel-pt-decoder/insn.c
> create mode 100644 tools/perf/util/intel-pt-decoder/insn.h
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-log.c
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-log.h
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
> create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.h
> create mode 100644 tools/perf/util/intel-pt-decoder/x86-opcode-map.txt
> create mode 100644 tools/perf/util/intel-pt.c
> create mode 100644 tools/perf/util/intel-pt.h
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
* [GIT PULL 00/14] perf/core improvements and fixes
@ 2015-12-07 22:17 Arnaldo Carvalho de Melo
2015-12-08 4:24 ` Ingo Molnar
0 siblings, 1 reply; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-12-07 22:17 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Masami Hiramatsu, Namhyung Kim,
Peter Zijlstra, pi3orama, Russell King, Wang Nan, Will Deacon,
Zefan Li
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Hi Ingo,
Please consider pulling, will continue processing the backlog tomorrow,
Thanks,
- Arnaldo
The following changes since commit f1ad44884a4c421ceaa9a4a8242aeeee6f686670:
perf/x86: Remove old MSR perf tracing code (2015-12-06 12:56:14 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
for you to fetch changes up to cfef25b8daf7e4b49c84e174a904af9d89dc7c46:
perf annotate: ARM support (2015-12-07 18:13:00 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Fixes and improvements for supporting annotating ARM binaries, support ARM
call and jump instructions, more work needed to have arch specific stuff
separated into tools/perf/arch/*/annotate/ (Russell King)
- Fix several 'perf test' entries broken by recent perf/core changes (Jiri Olsa)
Infrastructure:
- Consolidate perf_ev{list,sel}__{enable,disable}() calls (Jiri Olsa)
- Pass correct string to dso__adjust_kmod_long_name (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Jiri Olsa (12):
perf test: Use machine__new_host in dwarf unwind test
perf test: Use machine__new_host in mmap thread lookup test
perf test: Use machine__new_host in mmap thread code reading test
perf test: Fix cpus and thread maps reference in error path
perf test: Prevent using bpf-output event in round trip name test
perf test: Create kernel maps properly for hist entries test
perf evsel: Use event maps directly in perf_evsel__enable
perf evsel: Introduce disable() method
perf evlist: Factor perf_evlist__(enable|disable) functions
perf stat: Use perf_evlist__enable in handle_initial_delay
perf stat: Create events as disabled
perf stat: Move enable_on_exec setup under earlier code
Russell King (1):
perf annotate: ARM support
Wang Nan (1):
perf machine: Pass correct string to dso__adjust_kmod_long_name
tools/perf/builtin-stat.c | 44 ++++++++++++++++++++-------------
tools/perf/tests/code-reading.c | 14 +++++++----
tools/perf/tests/dwarf-unwind.c | 8 ++----
tools/perf/tests/evsel-roundtrip-name.c | 3 ++-
tools/perf/tests/hists_common.c | 5 ++++
tools/perf/tests/mmap-thread-lookup.c | 6 ++---
tools/perf/util/annotate.c | 23 +++++++++++++++++
tools/perf/util/evlist.c | 32 ++++++------------------
tools/perf/util/evsel.c | 15 ++++++++++-
tools/perf/util/evsel.h | 3 ++-
tools/perf/util/machine.c | 2 +-
11 files changed, 95 insertions(+), 60 deletions(-)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2015-12-07 22:17 Arnaldo Carvalho de Melo
@ 2015-12-08 4:24 ` Ingo Molnar
0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2015-12-08 4:24 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Masami Hiramatsu, Namhyung Kim,
Peter Zijlstra, pi3orama, Russell King, Wang Nan, Will Deacon,
Zefan Li
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Hi Ingo,
>
> Please consider pulling, will continue processing the backlog tomorrow,
>
> Thanks,
>
> - Arnaldo
>
> The following changes since commit f1ad44884a4c421ceaa9a4a8242aeeee6f686670:
>
> perf/x86: Remove old MSR perf tracing code (2015-12-06 12:56:14 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>
> for you to fetch changes up to cfef25b8daf7e4b49c84e174a904af9d89dc7c46:
>
> perf annotate: ARM support (2015-12-07 18:13:00 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Fixes and improvements for supporting annotating ARM binaries, support ARM
> call and jump instructions, more work needed to have arch specific stuff
> separated into tools/perf/arch/*/annotate/ (Russell King)
>
> - Fix several 'perf test' entries broken by recent perf/core changes (Jiri Olsa)
>
> Infrastructure:
>
> - Consolidate perf_ev{list,sel}__{enable,disable}() calls (Jiri Olsa)
>
> - Pass correct string to dso__adjust_kmod_long_name (Wang Nan)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Jiri Olsa (12):
> perf test: Use machine__new_host in dwarf unwind test
> perf test: Use machine__new_host in mmap thread lookup test
> perf test: Use machine__new_host in mmap thread code reading test
> perf test: Fix cpus and thread maps reference in error path
> perf test: Prevent using bpf-output event in round trip name test
> perf test: Create kernel maps properly for hist entries test
> perf evsel: Use event maps directly in perf_evsel__enable
> perf evsel: Introduce disable() method
> perf evlist: Factor perf_evlist__(enable|disable) functions
> perf stat: Use perf_evlist__enable in handle_initial_delay
> perf stat: Create events as disabled
> perf stat: Move enable_on_exec setup under earlier code
>
> Russell King (1):
> perf annotate: ARM support
>
> Wang Nan (1):
> perf machine: Pass correct string to dso__adjust_kmod_long_name
>
> tools/perf/builtin-stat.c | 44 ++++++++++++++++++++-------------
> tools/perf/tests/code-reading.c | 14 +++++++----
> tools/perf/tests/dwarf-unwind.c | 8 ++----
> tools/perf/tests/evsel-roundtrip-name.c | 3 ++-
> tools/perf/tests/hists_common.c | 5 ++++
> tools/perf/tests/mmap-thread-lookup.c | 6 ++---
> tools/perf/util/annotate.c | 23 +++++++++++++++++
> tools/perf/util/evlist.c | 32 ++++++------------------
> tools/perf/util/evsel.c | 15 ++++++++++-
> tools/perf/util/evsel.h | 3 ++-
> tools/perf/util/machine.c | 2 +-
> 11 files changed, 95 insertions(+), 60 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
* [GIT PULL 00/14] perf/core improvements and fixes
@ 2016-04-19 15:50 Arnaldo Carvalho de Melo
2016-04-19 19:00 ` Ingo Molnar
0 siblings, 1 reply; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Alexander Shishkin, Chris Phlipot, Colin Ian King, David Ahern,
H. Peter Anvin, Jiri Olsa, Milian Wolff, Namhyung Kim,
Peter Zijlstra, Stephane Eranian, Stephen Rothwell,
Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 9243ae5b28d02dc7d71a4f00c981ef6feaede3f1:
Merge tag 'perf-core-for-mingo-20160415' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-16 11:09:57 +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-20160419
for you to fetch changes up to 6566feafb4dba4eef30a9c0b25e6f49f996178b6:
perf test: Add missing verbose output explaining the reason for failure (2016-04-19 12:39:36 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
Build fixes:
- Fix 'perf trace' build when DWARF unwind isn't available (Arnaldo Carvalho de Melo)
- Remove x86 references from arch-neutral Build, fixing it in !x86 arches,
reported as breaking the build for powerpc64le in linux-next (Arnaldo Carvalho de Melo)
Infrastructure:
- Do memset() variable 'st' using the correct size in the jit code (Colin Ian King)
- Fix postgresql ubuntu 'perf script' install instructions (Chris Phlipot)
- Use callchain_param more thoroughly when checking how callchains were
configured, eventually will be the only way to look for callchain parameters
(Arnaldo Carvalho de Melo)
- Fix some issues in the 'perf test kallsyms' entry (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (12):
perf trace: Fix build when DWARF unwind isn't available
perf evsel: Add missign class prefix to has_branch_stack method
perf script: Check sample->callchain before using it
perf callchain: Set callchain_param.enabled when parsing --call-graph
perf report: Use callchain_param.enabled instead of tool specific knob
perf tools: Ditch record_opts.callgraph_set
perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs
perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain
perf build: Remove x86 references from arch-neutral Build
perf symbols: Allow loading kallsyms without considering kcore files
perf test: Ignore kcore files in the "vmlinux matches kallsyms" test
perf test: Add missing verbose output explaining the reason for failure
Chris Phlipot (1):
perf script: Fix postgresql ubuntu install instructions
Colin Ian King (1):
perf jit: memset() variable 'st' using the correct size
tools/perf/builtin-record.c | 14 ++++++-------
tools/perf/builtin-report.c | 11 +++++-----
tools/perf/builtin-script.c | 2 +-
tools/perf/builtin-top.c | 25 +++++++++++------------
tools/perf/builtin-trace.c | 10 ++++-----
tools/perf/perf.h | 1 -
tools/perf/scripts/python/export-to-postgresql.py | 5 ++---
tools/perf/tests/vmlinux-kallsyms.c | 11 +++++++++-
tools/perf/ui/browsers/hists.c | 5 ++---
tools/perf/util/Build | 4 ----
tools/perf/util/callchain.c | 2 ++
tools/perf/util/evsel.h | 2 +-
tools/perf/util/jitdump.c | 4 ++--
tools/perf/util/machine.c | 14 +++++++++----
tools/perf/util/machine.h | 2 ++
tools/perf/util/session.c | 4 ++--
tools/perf/util/symbol.c | 12 ++++++++---
tools/perf/util/symbol.h | 2 ++
18 files changed, 74 insertions(+), 56 deletions(-)
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2016-04-19 15:50 Arnaldo Carvalho de Melo
@ 2016-04-19 19:00 ` Ingo Molnar
0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2016-04-19 19:00 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Chris Phlipot,
Colin Ian King, David Ahern, H. Peter Anvin, Jiri Olsa,
Milian Wolff, Namhyung Kim, Peter Zijlstra, Stephane Eranian,
Stephen Rothwell, Thomas Gleixner, Wang Nan,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
>
> The following changes since commit 9243ae5b28d02dc7d71a4f00c981ef6feaede3f1:
>
> Merge tag 'perf-core-for-mingo-20160415' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-16 11:09:57 +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-20160419
>
> for you to fetch changes up to 6566feafb4dba4eef30a9c0b25e6f49f996178b6:
>
> perf test: Add missing verbose output explaining the reason for failure (2016-04-19 12:39:36 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> Build fixes:
>
> - Fix 'perf trace' build when DWARF unwind isn't available (Arnaldo Carvalho de Melo)
>
> - Remove x86 references from arch-neutral Build, fixing it in !x86 arches,
> reported as breaking the build for powerpc64le in linux-next (Arnaldo Carvalho de Melo)
>
> Infrastructure:
>
> - Do memset() variable 'st' using the correct size in the jit code (Colin Ian King)
>
> - Fix postgresql ubuntu 'perf script' install instructions (Chris Phlipot)
>
> - Use callchain_param more thoroughly when checking how callchains were
> configured, eventually will be the only way to look for callchain parameters
> (Arnaldo Carvalho de Melo)
>
> - Fix some issues in the 'perf test kallsyms' entry (Arnaldo Carvalho de Melo)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (12):
> perf trace: Fix build when DWARF unwind isn't available
> perf evsel: Add missign class prefix to has_branch_stack method
> perf script: Check sample->callchain before using it
> perf callchain: Set callchain_param.enabled when parsing --call-graph
> perf report: Use callchain_param.enabled instead of tool specific knob
> perf tools: Ditch record_opts.callgraph_set
> perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs
> perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain
> perf build: Remove x86 references from arch-neutral Build
> perf symbols: Allow loading kallsyms without considering kcore files
> perf test: Ignore kcore files in the "vmlinux matches kallsyms" test
> perf test: Add missing verbose output explaining the reason for failure
>
> Chris Phlipot (1):
> perf script: Fix postgresql ubuntu install instructions
>
> Colin Ian King (1):
> perf jit: memset() variable 'st' using the correct size
>
> tools/perf/builtin-record.c | 14 ++++++-------
> tools/perf/builtin-report.c | 11 +++++-----
> tools/perf/builtin-script.c | 2 +-
> tools/perf/builtin-top.c | 25 +++++++++++------------
> tools/perf/builtin-trace.c | 10 ++++-----
> tools/perf/perf.h | 1 -
> tools/perf/scripts/python/export-to-postgresql.py | 5 ++---
> tools/perf/tests/vmlinux-kallsyms.c | 11 +++++++++-
> tools/perf/ui/browsers/hists.c | 5 ++---
> tools/perf/util/Build | 4 ----
> tools/perf/util/callchain.c | 2 ++
> tools/perf/util/evsel.h | 2 +-
> tools/perf/util/jitdump.c | 4 ++--
> tools/perf/util/machine.c | 14 +++++++++----
> tools/perf/util/machine.h | 2 ++
> tools/perf/util/session.c | 4 ++--
> tools/perf/util/symbol.c | 12 ++++++++---
> tools/perf/util/symbol.h | 2 ++
> 18 files changed, 74 insertions(+), 56 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
* [GIT PULL 00/14] perf/core improvements and fixes
@ 2017-02-01 12:24 Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 01/14] perf ftrace: Remove needless code setting default tracer Arnaldo Carvalho de Melo
` (14 more replies)
0 siblings, 15 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Alexei Starovoitov, Daniel Borkmann, David Ahern,
Frederic Weisbecker, Jiri Olsa, Joe Stringer, Josh Poimboeuf,
Krister Johansen, Masami Hiramatsu, Michal Marek, Namhyung Kim,
Peter Zijlstra, Steven Rostedt, Taeung Song, Wang Nan,
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 e2cf00c257f5bbc071b489b1dfbeaa30b6f12da6:
Merge tag 'perf-core-for-mingo-4.11-20170126' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-01-26 16:20:59 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.11-20170201
for you to fetch changes up to b05d1093987a78695766b71a2d723aa65b5c25c5:
perf ftrace: Add ftrace.tracer config option (2017-01-31 16:20:09 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
New features:
. Allow configuring a 'perf ftrace' default --tracer (Taeung Song)
Infrastructure:
. Sync tools/arch/{powerpc,arm}/include/uapi/asm/kvm.h and
tools/arch/x86/include/asm/cpufeatures.h (Ingo Molnar)
. Add BPF program file system pinning APIs and respective
'perf test' entry (Joe Stringer)
. Make tools tree support 'make -s' (Josh Poimboeuf)
. Reference count maps in callchains, fixing SEGFAULT when
referencing maps after it is freed (Krister Johansen)
. Create for_each_event trace points iterator (Taeung Song)
. Do not consider an error not to have any perfconfig file
(Arnaldo Carvalho de Melo
. Propagate perf_config() errors (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf config: Do not consider an error not to have any perfconfig file
perf tools: Propagate perf_config() errors
Ingo Molnar (1):
tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h
Joe Stringer (6):
tools lib bpf: Add BPF program pinning APIs
tools lib bpf: Add bpf_map__pin()
tools lib bpf: Add bpf_object__pin()
tools perf util: Make rm_rf(path) argument const
tools lib api fs: Add bpf_fs filesystem detector
perf test: Add libbpf pinning test
Josh Poimboeuf (1):
tools build: Add tools tree support for 'make -s'
Krister Johansen (1):
perf callchain: Reference count maps
Taeung Song (3):
perf ftrace: Remove needless code setting default tracer
perf tools: Create for_each_event macro for tracepoints iteration
perf ftrace: Add ftrace.tracer config option
Makefile | 6 +-
tools/arch/arm/include/uapi/asm/kvm.h | 9 ++
tools/arch/powerpc/include/uapi/asm/kvm.h | 5 +
tools/arch/x86/include/asm/cpufeatures.h | 11 ++
tools/build/Makefile.build | 10 ++
tools/lib/api/fs/fs.c | 16 +++
tools/lib/api/fs/fs.h | 1 +
tools/lib/bpf/libbpf.c | 195 ++++++++++++++++++++++++++++++
tools/lib/bpf/libbpf.h | 5 +
tools/perf/builtin-ftrace.c | 30 ++++-
tools/perf/builtin-help.c | 6 +-
tools/perf/builtin-kmem.c | 8 +-
tools/perf/builtin-record.c | 4 +-
tools/perf/builtin-report.c | 4 +-
tools/perf/builtin-top.c | 4 +-
tools/perf/perf.c | 15 ++-
tools/perf/tests/bpf.c | 42 ++++++-
tools/perf/util/callchain.c | 27 ++++-
tools/perf/util/callchain.h | 6 +
tools/perf/util/config.c | 23 ++--
tools/perf/util/data-convert-bt.c | 7 +-
tools/perf/util/hist.c | 11 +-
tools/perf/util/intel-pt.c | 4 +-
tools/perf/util/llvm-utils.c | 4 +-
tools/perf/util/trace-event-info.c | 38 +++---
tools/perf/util/util.c | 2 +-
tools/perf/util/util.h | 2 +-
tools/scripts/Makefile.include | 12 +-
28 files changed, 446 insertions(+), 61 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.
Several are cross builds, the ones with -x-ARCH, and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.
The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.
Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.
# dm
1 alpine:3.4: Ok
2 android-ndk:r12b-arm: Ok
3 archlinux:latest: Ok
4 centos:5: Ok
5 centos:6: Ok
6 centos:7: Ok
7 debian:7: Ok
8 debian:8: Ok
9 debian:experimental: Ok
10 debian:experimental-x-arm64: Ok
11 debian:experimental-x-mips: Ok
12 debian:experimental-x-mips64: Ok
13 debian:experimental-x-mipsel: Ok
14 fedora:20: Ok
15 fedora:21: Ok
16 fedora:22: Ok
17 fedora:23: Ok
18 fedora:24: Ok
19 fedora:24-x-ARC-uClibc: Ok
20 fedora:25: Ok
21 fedora:rawhide: Ok
22 mageia:5: Ok
23 opensuse:13.2: Ok
24 opensuse:42.1: Ok
25 opensuse:tumbleweed: Ok
26 ubuntu:12.04.5: Ok
27 ubuntu:14.04.4-x-linaro-arm64: Ok
28 ubuntu:15.10: Ok
29 ubuntu:16.04: Ok
30 ubuntu:16.04-x-arm: Ok
31 ubuntu:16.04-x-arm64: Ok
32 ubuntu:16.04-x-powerpc: Ok
33 ubuntu:16.04-x-powerpc64: Ok
34 ubuntu:16.04-x-powerpc64el: Ok
35 ubuntu:16.04-x-s390: Ok
36 ubuntu:16.10: Ok
#
# uname -a
Linux jouet 4.9.6-200.fc25.x86_64 #1 SMP Thu Jan 26 10:17:45 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: Detect openat syscall event : Ok
3: Detect openat syscall event on all cpus : Ok
4: Read samples using the mmap interface : Ok
5: Parse event definition strings : Ok
6: PERF_RECORD_* events & perf_sample fields : Ok
7: Parse perf pmu format : Ok
8: DSO data read : Ok
9: DSO data cache : Ok
10: DSO data reopen : Ok
11: Roundtrip evsel->name : Ok
12: Parse sched tracepoints fields : Ok
13: syscalls:sys_enter_openat event fields : Ok
14: Setup struct perf_event_attr : Ok
15: Match and link multiple hists : Ok
16: 'import perf' in python : Ok
17: Breakpoint overflow signal handler : Ok
18: Breakpoint overflow sampling : Ok
19: Number of exit events of a simple workload : Ok
20: Software clock events period values : Ok
21: Object code reading : Ok
22: Sample parsing : Ok
23: Use a dummy software event to keep tracking: Ok
24: Parse with no sample_id_all bit set : Ok
25: Filter hist entries : Ok
26: Lookup mmap thread : Ok
27: Share thread mg : Ok
28: Sort output of hist entries : Ok
29: Cumulate child hist entries : Ok
30: Track with sched_switch : Ok
31: Filter fds with revents mask in a fdarray : Ok
32: Add fd to a fdarray, making it autogrow : Ok
33: kmod_path__parse : Ok
34: Thread map : Ok
35: LLVM search and compile :
35.1: Basic BPF llvm compile : Ok
35.2: kbuild searching : Ok
35.3: Compile source for BPF prologue generation: Ok
35.4: Compile source for BPF relocation : Ok
36: Session topology : Ok
37: BPF filter :
37.1: Basic BPF filtering : Ok
37.2: BPF pinning : Ok
37.3: BPF prologue generation : Ok
37.4: BPF relocation checker : Ok
38: Synthesize thread map : Ok
39: Remove thread map : Ok
40: Synthesize cpu map : Ok
41: Synthesize stat config : Ok
42: Synthesize stat : Ok
43: Synthesize stat round : Ok
44: Synthesize attr update : Ok
45: Event times : Ok
46: Read backward ring buffer : Ok
47: Print cpu map : Ok
48: Probe SDT events : Ok
49: is_printable_array : Ok
50: Print bitmap : Ok
51: perf hooks : Ok
52: builtin clang support : Skip (not compiled in)
53: unit_number__scnprintf : Ok
54: x86 rdpmc : Ok
55: Convert perf time to TSC : Ok
56: DWARF unwind : Ok
57: x86 instruction decoder - new instructions : Ok
58: Intel cqm nmi context read : Skip
$ perf stat make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_debug_O: make DEBUG=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_doc_O: make doc
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_slang_O: make NO_SLANG=1
make_clean_all_O: make clean all
make_no_libperl_O: make NO_LIBPERL=1
make_install_prefix_O: make install prefix=/tmp/krava
make_help_O: make help
make_no_auxtrace_O: make NO_AUXTRACE=1
make_tags_O: make tags
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_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libelf_O: make NO_LIBELF=1
make_no_libunwind_O: make NO_LIBUNWIND=1
make_static_O: make LDFLAGS=-static
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_newt_O: make NO_NEWT=1
make_no_libbionic_O: make NO_LIBBIONIC=1
make_pure_O: make
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_no_gtk2_O: make NO_GTK2=1
make_util_map_o_O: make util/map.o
make_no_libaudit_O: make NO_LIBAUDIT=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_install_bin_O: make install-bin
make_no_backtrace_O: make NO_BACKTRACE=1
make_no_libbpf_O: make NO_LIBBPF=1
make_install_O: make install
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 01/14] perf ftrace: Remove needless code setting default tracer
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2017-02-01 12:24 ` Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 02/14] tools build: Add tools tree support for 'make -s' Arnaldo Carvalho de Melo
` (13 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim,
Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo
From: Taeung Song <treeze.taeung@gmail.com>
As a result of commit a3497642c261 ("perf ftrace: Make 'function_graph'
be the default tracer") the ftrace.tracer variable can't be NULL but the
other code setting default tracer remained.
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1485423339-22780-1-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-ftrace.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index d05658d2b8f1..414444d0e919 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -202,7 +202,7 @@ int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
{
int ret;
struct perf_ftrace ftrace = {
- .tracer = "function_graph",
+ .tracer = DEFAULT_TRACER,
.target = { .uid = UINT_MAX, },
};
const char * const ftrace_usage[] = {
@@ -231,9 +231,6 @@ int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
if (ret < 0)
goto out_delete_evlist;
- if (ftrace.tracer == NULL)
- ftrace.tracer = DEFAULT_TRACER;
-
ret = __cmd_ftrace(&ftrace, argc, argv);
out_delete_evlist:
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 02/14] tools build: Add tools tree support for 'make -s'
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 01/14] perf ftrace: Remove needless code setting default tracer Arnaldo Carvalho de Melo
@ 2017-02-01 12:24 ` Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 03/14] perf config: Do not consider an error not to have any perfconfig file Arnaldo Carvalho de Melo
` (12 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Josh Poimboeuf, Jiri Olsa, Michal Marek,
Arnaldo Carvalho de Melo
From: Josh Poimboeuf <jpoimboe@redhat.com>
When doing a kernel build with 'make -s', everything is silenced except
the objtool build. That's because the tools tree support for silent
builds is some combination of missing and broken.
Three changes are needed to fix it:
- Makefile: propagate '-s' to the sub-make's MAKEFLAGS variable so the
tools Makefiles can see it.
- tools/scripts/Makefile.include: fix the tools Makefiles' ability to
recognize '-s'. The MAKE_VERSION and MAKEFLAGS checks are copied from
the top-level Makefile. This silences the "DESCEND objtool" message.
- tools/build/Makefile.build: add support to the tools Build files for
recognizing '-s'. Again the MAKE_VERSION and MAKEFLAGS checks are
copied from the top-level Makefile. This silences all the object
compile/link messages.
Reported-and-Tested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michal Marek <mmarek@suse.com>
Link: http://lkml.kernel.org/r/e8967562ef640c3ae9a76da4ae0f4e47df737c34.1484799200.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
Makefile | 6 ++++--
tools/build/Makefile.build | 10 ++++++++++
tools/scripts/Makefile.include | 12 +++++++++++-
3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 098840012b9b..80341dfb2c50 100644
--- a/Makefile
+++ b/Makefile
@@ -87,10 +87,12 @@ endif
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
quiet=silent_
+ tools_silent=s
endif
else # make-3.8x
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
quiet=silent_
+ tools_silent=-s
endif
endif
@@ -1607,11 +1609,11 @@ image_name:
# Clear a bunch of variables before executing the submake
tools/: FORCE
$(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
tools/%: FORCE
$(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
# Single targets
# ---------------------------------------------------------------------------
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 99c0ccd2f176..e279a71c650d 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -19,6 +19,16 @@ else
Q=@
endif
+ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
+ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
+ quiet=silent_
+endif
+else # make-3.8x
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+ quiet=silent_
+endif
+endif
+
build-dir := $(srctree)/tools/build
# Define $(fixdep) for dep-cmd function
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 8abbef164b4e..19edc1a7a232 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -46,6 +46,16 @@ else
NO_SUBDIR = :
endif
+ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
+ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
+ silent=1
+endif
+else # make-3.8x
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+ silent=1
+endif
+endif
+
#
# Define a callable command for descending to a new directory
#
@@ -58,7 +68,7 @@ descend = \
QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
QUIET_SUBDIR1 =
-ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifneq ($(silent),1)
ifneq ($(V),1)
QUIET_CC = @echo ' CC '$@;
QUIET_CC_FPIC = @echo ' CC FPIC '$@;
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 03/14] perf config: Do not consider an error not to have any perfconfig file
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 01/14] perf ftrace: Remove needless code setting default tracer Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 02/14] tools build: Add tools tree support for 'make -s' Arnaldo Carvalho de Melo
@ 2017-02-01 12:24 ` Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 04/14] perf tools: Propagate perf_config() errors Arnaldo Carvalho de Melo
` (11 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Namhyung Kim, Taeung Song, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
While propagating the errors from perf_config(), which were being
completely ignored, everything stopped working for people without a
~/.perfconfig file, because the perf_config_set__init() was considering
an error not to have a .perfconfig file, duh, fix it by checking the
errno after the failed stat() call.
It should also not return an error when it says it is ignoring the file,
and also a empty file should not return an error either.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 8beeb00f2c84 ("perf config: Use new perf_config_set__init() to initialize config set")
Link: http://lkml.kernel.org/n/tip-ygpbab3apbs6l8wr97xedwks@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/config.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 3d906dbbef74..615e8b4a693b 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -646,8 +646,13 @@ static int perf_config_set__init(struct perf_config_set *set)
goto out;
}
- if (stat(user_config, &st) < 0)
+ if (stat(user_config, &st) < 0) {
+ if (errno == ENOENT)
+ ret = 0;
goto out_free;
+ }
+
+ ret = 0;
if (st.st_uid && (st.st_uid != geteuid())) {
warning("File %s not owned by current user or root, "
@@ -655,11 +660,8 @@ static int perf_config_set__init(struct perf_config_set *set)
goto out_free;
}
- if (!st.st_size)
- goto out_free;
-
- ret = perf_config_from_file(collect_config, user_config, set);
-
+ if (st.st_size)
+ ret = perf_config_from_file(collect_config, user_config, set);
out_free:
free(user_config);
}
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 04/14] perf tools: Propagate perf_config() errors
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2017-02-01 12:24 ` [PATCH 03/14] perf config: Do not consider an error not to have any perfconfig file Arnaldo Carvalho de Melo
@ 2017-02-01 12:24 ` Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 05/14] tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h Arnaldo Carvalho de Melo
` (10 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Previously these were being ignored, sometimes silently.
Stop doing that, emitting debug messages and handling the errors.
Testing it:
$ cat ~/.perfconfig
cat: /home/acme/.perfconfig: No such file or directory
$ perf stat -e cycles usleep 1
Performance counter stats for 'usleep 1':
938,996 cycles:u
0.003813731 seconds time elapsed
$ perf top --stdio
Error:
You may not have permission to collect system-wide stats.
Consider tweaking /proc/sys/kernel/perf_event_paranoid,
<SNIP>
[ perf record: Captured and wrote 0.019 MB perf.data (7 samples) ]
[acme@jouet linux]$ perf report --stdio
# To display the perf.data header info, please use --header/--header-only options.
# Overhead Command Shared Object Symbol
# ........ ....... ................. .........................
71.77% usleep libc-2.24.so [.] _dl_addr
27.07% usleep ld-2.24.so [.] _dl_next_ld_env_entry
1.13% usleep [kernel.kallsyms] [k] page_fault
$
$ touch ~/.perfconfig
$ ls -la ~/.perfconfig
-rw-rw-r--. 1 acme acme 0 Jan 27 12:14 /home/acme/.perfconfig
$
$ perf stat -e instructions usleep 1
Performance counter stats for 'usleep 1':
244,610 instructions:u
0.000805383 seconds time elapsed
$
[root@jouet ~]# chown acme.acme ~/.perfconfig
[root@jouet ~]# perf stat -e cycles usleep 1
Warning: File /root/.perfconfig not owned by current user or root, ignoring it.
Performance counter stats for 'usleep 1':
937,615 cycles
0.000836931 seconds time elapsed
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-j2rq96so6xdqlr8p8rd6a3jx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-help.c | 6 ++++--
tools/perf/builtin-kmem.c | 8 ++++++--
tools/perf/builtin-record.c | 4 +++-
tools/perf/builtin-report.c | 4 +++-
tools/perf/builtin-top.c | 4 +++-
tools/perf/perf.c | 15 ++++++++++-----
tools/perf/util/callchain.c | 16 ++++++++++++++--
tools/perf/util/config.c | 9 +++++----
tools/perf/util/data-convert-bt.c | 7 +++++--
tools/perf/util/hist.c | 4 +++-
tools/perf/util/intel-pt.c | 4 +++-
tools/perf/util/llvm-utils.c | 4 +++-
12 files changed, 62 insertions(+), 23 deletions(-)
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 93da24a638be..aed0d844e8c2 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -447,11 +447,13 @@ int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
NULL
};
const char *alias;
- int rc = 0;
+ int rc;
load_command_list("perf-", &main_cmds, &other_cmds);
- perf_config(perf_help_config, &help_format);
+ rc = perf_config(perf_help_config, &help_format);
+ if (rc)
+ return rc;
argc = parse_options_subcommand(argc, argv, builtin_help_options,
builtin_help_subcommands, builtin_help_usage, 0);
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 915869e00d86..29f4751a3574 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -1920,10 +1920,12 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
NULL
};
struct perf_session *session;
- int ret = -1;
const char errmsg[] = "No %s allocation events found. Have you run 'perf kmem record --%s'?\n";
+ int ret = perf_config(kmem_config, NULL);
+
+ if (ret)
+ return ret;
- perf_config(kmem_config, NULL);
argc = parse_options_subcommand(argc, argv, kmem_options,
kmem_subcommands, kmem_usage, 0);
@@ -1948,6 +1950,8 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
if (session == NULL)
return -1;
+ ret = -1;
+
if (kmem_slab) {
if (!perf_evlist__find_tracepoint_by_name(session->evlist,
"kmem:kmalloc")) {
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 33a9eaaf9db4..ffac8ca9fb01 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1670,7 +1670,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
if (rec->evlist == NULL)
return -ENOMEM;
- perf_config(perf_record_config, rec);
+ err = perf_config(perf_record_config, rec);
+ if (err)
+ return err;
argc = parse_options(argc, argv, record_options, record_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 06cc759a4597..dbd7fa028861 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -847,7 +847,9 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
if (ret < 0)
return ret;
- perf_config(report__config, &report);
+ ret = perf_config(report__config, &report);
+ if (ret)
+ return ret;
argc = parse_options(argc, argv, options, report_usage, 0);
if (argc) {
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 3df4178ba378..20aef9815cd8 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1216,7 +1216,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
if (top.evlist == NULL)
return -ENOMEM;
- perf_config(perf_top_config, &top);
+ status = perf_config(perf_top_config, &top);
+ if (status)
+ return status;
argc = parse_options(argc, argv, options, top_usage, 0);
if (argc)
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 34bcf90f8871..6d5479e03e0d 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -90,11 +90,12 @@ static int pager_command_config(const char *var, const char *value, void *data)
/* returns 0 for "no pager", 1 for "use pager", and -1 for "not specified" */
int check_pager_config(const char *cmd)
{
+ int err;
struct pager_config c;
c.cmd = cmd;
c.val = -1;
- perf_config(pager_command_config, &c);
- return c.val;
+ err = perf_config(pager_command_config, &c);
+ return err ?: c.val;
}
static int browser_command_config(const char *var, const char *value, void *data)
@@ -113,11 +114,12 @@ static int browser_command_config(const char *var, const char *value, void *data
*/
static int check_browser_config(const char *cmd)
{
+ int err;
struct pager_config c;
c.cmd = cmd;
c.val = -1;
- perf_config(browser_command_config, &c);
- return c.val;
+ err = perf_config(browser_command_config, &c);
+ return err ?: c.val;
}
static void commit_pager_choice(void)
@@ -509,6 +511,7 @@ static void cache_line_size(int *cacheline_sizep)
int main(int argc, const char **argv)
{
+ int err;
const char *cmd;
char sbuf[STRERR_BUFSIZE];
int value;
@@ -534,7 +537,9 @@ int main(int argc, const char **argv)
srandom(time(NULL));
perf_config__init();
- perf_config(perf_default_config, NULL);
+ err = perf_config(perf_default_config, NULL);
+ if (err)
+ return err;
set_buildid_dir(NULL);
/* get debugfs/tracefs mount point from /proc/mounts */
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 42922512c1c6..e16db30dfe40 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -48,6 +48,8 @@ static int parse_callchain_mode(const char *value)
callchain_param.mode = CHAIN_FOLDED;
return 0;
}
+
+ pr_err("Invalid callchain mode: %s\n", value);
return -1;
}
@@ -63,6 +65,8 @@ static int parse_callchain_order(const char *value)
callchain_param.order_set = true;
return 0;
}
+
+ pr_err("Invalid callchain order: %s\n", value);
return -1;
}
@@ -80,6 +84,8 @@ static int parse_callchain_sort_key(const char *value)
callchain_param.branch_callstack = 1;
return 0;
}
+
+ pr_err("Invalid callchain sort key: %s\n", value);
return -1;
}
@@ -97,6 +103,8 @@ static int parse_callchain_value(const char *value)
callchain_param.value = CCVAL_COUNT;
return 0;
}
+
+ pr_err("Invalid callchain config key: %s\n", value);
return -1;
}
@@ -210,13 +218,17 @@ int perf_callchain_config(const char *var, const char *value)
return parse_callchain_sort_key(value);
if (!strcmp(var, "threshold")) {
callchain_param.min_percent = strtod(value, &endptr);
- if (value == endptr)
+ if (value == endptr) {
+ pr_err("Invalid callchain threshold: %s\n", value);
return -1;
+ }
}
if (!strcmp(var, "print-limit")) {
callchain_param.print_limit = strtod(value, &endptr);
- if (value == endptr)
+ if (value == endptr) {
+ pr_err("Invalid callchain print limit: %s\n", value);
return -1;
+ }
}
return 0;
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 615e8b4a693b..0c7d5a4975cd 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -386,8 +386,10 @@ static int perf_buildid_config(const char *var, const char *value)
if (!strcmp(var, "buildid.dir")) {
const char *dir = perf_config_dirname(var, value);
- if (!dir)
+ if (!dir) {
+ pr_err("Invalid buildid directory!\n");
return -1;
+ }
strncpy(buildid_dir, dir, MAXPATHLEN-1);
buildid_dir[MAXPATHLEN-1] = '\0';
}
@@ -405,10 +407,9 @@ static int perf_default_core_config(const char *var __maybe_unused,
static int perf_ui_config(const char *var, const char *value)
{
/* Add other config variables here. */
- if (!strcmp(var, "ui.show-headers")) {
+ if (!strcmp(var, "ui.show-headers"))
symbol_conf.show_hist_headers = perf_config_bool(var, value);
- return 0;
- }
+
return 0;
}
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 7123f4de32cc..4e6cbc99f08e 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -1473,7 +1473,7 @@ int bt_convert__perf2ctf(const char *input, const char *path,
},
};
struct ctf_writer *cw = &c.writer;
- int err = -1;
+ int err;
if (opts->all) {
c.tool.comm = process_comm_event;
@@ -1481,12 +1481,15 @@ int bt_convert__perf2ctf(const char *input, const char *path,
c.tool.fork = process_fork_event;
}
- perf_config(convert__config, &c);
+ err = perf_config(convert__config, &c);
+ if (err)
+ return err;
/* CTF writer */
if (ctf_writer__init(cw, path))
return -1;
+ err = -1;
/* perf.data session */
session = perf_session__new(&file, 0, &c.tool);
if (!session)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 6770a9645609..cff2e9041b15 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -2439,8 +2439,10 @@ int parse_filter_percentage(const struct option *opt __maybe_unused,
symbol_conf.filter_relative = true;
else if (!strcmp(arg, "absolute"))
symbol_conf.filter_relative = false;
- else
+ else {
+ pr_debug("Invalud percentage: %s\n", arg);
return -1;
+ }
return 0;
}
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 85d5eeb66c75..da20cd5612e9 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2159,7 +2159,9 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
addr_filters__init(&pt->filts);
- perf_config(intel_pt_perf_config, pt);
+ err = perf_config(intel_pt_perf_config, pt);
+ if (err)
+ goto err_free;
err = auxtrace_queues__init(&pt->queues);
if (err)
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
index b23ff44cf214..824356488ce6 100644
--- a/tools/perf/util/llvm-utils.c
+++ b/tools/perf/util/llvm-utils.c
@@ -48,8 +48,10 @@ int perf_llvm_config(const char *var, const char *value)
llvm_param.kbuild_opts = strdup(value);
else if (!strcmp(var, "dump-obj"))
llvm_param.dump_obj = !!perf_config_bool(var, value);
- else
+ else {
+ pr_debug("Invalid LLVM config option: %s\n", value);
return -1;
+ }
llvm_param.user_set_param = true;
return 0;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 05/14] tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2017-02-01 12:24 ` [PATCH 04/14] perf tools: Propagate perf_config() errors Arnaldo Carvalho de Melo
@ 2017-02-01 12:24 ` Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 06/14] perf callchain: Reference count maps Arnaldo Carvalho de Melo
` (9 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, David Ahern, Jiri Olsa, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Ingo Molnar <mingo@kernel.org>
The following upstream headers were updated:
- The x86 cpufeatures.h file picked up a couple of new feature entries
- The PowerPC and ARM KVM headers picked up new features
None of which requires changes to perf tooling, so refresh the tooling copy.
Solves these build time warnings:
Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
Warning: arch/arm/include/uapi/asm/kvm.h differs from kernel
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170130081131.GA8322@gmail.com
[ resync tools/arch/x86/include/asm/cpufeatures.h ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/arch/arm/include/uapi/asm/kvm.h | 9 +++++++++
tools/arch/powerpc/include/uapi/asm/kvm.h | 5 +++++
tools/arch/x86/include/asm/cpufeatures.h | 11 +++++++++++
3 files changed, 25 insertions(+)
diff --git a/tools/arch/arm/include/uapi/asm/kvm.h b/tools/arch/arm/include/uapi/asm/kvm.h
index a2b3eb313a25..af05f8e0903e 100644
--- a/tools/arch/arm/include/uapi/asm/kvm.h
+++ b/tools/arch/arm/include/uapi/asm/kvm.h
@@ -84,6 +84,15 @@ struct kvm_regs {
#define KVM_VGIC_V2_DIST_SIZE 0x1000
#define KVM_VGIC_V2_CPU_SIZE 0x2000
+/* Supported VGICv3 address types */
+#define KVM_VGIC_V3_ADDR_TYPE_DIST 2
+#define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
+#define KVM_VGIC_ITS_ADDR_TYPE 4
+
+#define KVM_VGIC_V3_DIST_SIZE SZ_64K
+#define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
+#define KVM_VGIC_V3_ITS_SIZE (2 * SZ_64K)
+
#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
#define KVM_ARM_VCPU_PSCI_0_2 1 /* CPU uses PSCI v0.2 */
diff --git a/tools/arch/powerpc/include/uapi/asm/kvm.h b/tools/arch/powerpc/include/uapi/asm/kvm.h
index c93cf35ce379..3603b6f51b11 100644
--- a/tools/arch/powerpc/include/uapi/asm/kvm.h
+++ b/tools/arch/powerpc/include/uapi/asm/kvm.h
@@ -573,6 +573,10 @@ struct kvm_get_htab_header {
#define KVM_REG_PPC_SPRG9 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba)
#define KVM_REG_PPC_DBSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb)
+/* POWER9 registers */
+#define KVM_REG_PPC_TIDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbc)
+#define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd)
+
/* Transactional Memory checkpointed state:
* This is all GPRs, all VSX regs and a subset of SPRs
*/
@@ -596,6 +600,7 @@ struct kvm_get_htab_header {
#define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67)
#define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68)
#define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69)
+#define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a)
/* PPC64 eXternal Interrupt Controller Specification */
#define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index cddd5d06e1cb..eafee3161d1c 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -105,6 +105,7 @@
#define X86_FEATURE_AMD_DCM ( 3*32+27) /* multi-node processor */
#define X86_FEATURE_APERFMPERF ( 3*32+28) /* APERFMPERF */
#define X86_FEATURE_NONSTOP_TSC_S3 ( 3*32+30) /* TSC doesn't stop in S3 state */
+#define X86_FEATURE_TSC_KNOWN_FREQ ( 3*32+31) /* TSC has known frequency */
/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
#define X86_FEATURE_XMM3 ( 4*32+ 0) /* "pni" SSE-3 */
@@ -188,10 +189,14 @@
#define X86_FEATURE_CPB ( 7*32+ 2) /* AMD Core Performance Boost */
#define X86_FEATURE_EPB ( 7*32+ 3) /* IA32_ENERGY_PERF_BIAS support */
+#define X86_FEATURE_CAT_L3 ( 7*32+ 4) /* Cache Allocation Technology L3 */
+#define X86_FEATURE_CAT_L2 ( 7*32+ 5) /* Cache Allocation Technology L2 */
+#define X86_FEATURE_CDP_L3 ( 7*32+ 6) /* Code and Data Prioritization L3 */
#define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
+#define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */
#define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */
#define X86_FEATURE_AVX512_4VNNIW (7*32+16) /* AVX-512 Neural Network Instructions */
#define X86_FEATURE_AVX512_4FMAPS (7*32+17) /* AVX-512 Multiply Accumulation Single precision */
@@ -220,11 +225,13 @@
#define X86_FEATURE_RTM ( 9*32+11) /* Restricted Transactional Memory */
#define X86_FEATURE_CQM ( 9*32+12) /* Cache QoS Monitoring */
#define X86_FEATURE_MPX ( 9*32+14) /* Memory Protection Extension */
+#define X86_FEATURE_RDT_A ( 9*32+15) /* Resource Director Technology Allocation */
#define X86_FEATURE_AVX512F ( 9*32+16) /* AVX-512 Foundation */
#define X86_FEATURE_AVX512DQ ( 9*32+17) /* AVX-512 DQ (Double/Quad granular) Instructions */
#define X86_FEATURE_RDSEED ( 9*32+18) /* The RDSEED instruction */
#define X86_FEATURE_ADX ( 9*32+19) /* The ADCX and ADOX instructions */
#define X86_FEATURE_SMAP ( 9*32+20) /* Supervisor Mode Access Prevention */
+#define X86_FEATURE_AVX512IFMA ( 9*32+21) /* AVX-512 Integer Fused Multiply-Add instructions */
#define X86_FEATURE_CLFLUSHOPT ( 9*32+23) /* CLFLUSHOPT instruction */
#define X86_FEATURE_CLWB ( 9*32+24) /* CLWB instruction */
#define X86_FEATURE_AVX512PF ( 9*32+26) /* AVX-512 Prefetch */
@@ -278,8 +285,10 @@
#define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 16 */
+#define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/
#define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */
#define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */
+#define X86_FEATURE_RDPID (16*32+ 22) /* RDPID instruction */
/* AMD-defined CPU features, CPUID level 0x80000007 (ebx), word 17 */
#define X86_FEATURE_OVERFLOW_RECOV (17*32+0) /* MCA overflow recovery support */
@@ -310,4 +319,6 @@
#define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */
#define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */
#define X86_BUG_MONITOR X86_BUG(12) /* IPI required to wake up remote CPU */
+#define X86_BUG_AMD_E400 X86_BUG(13) /* CPU is among the affected by Erratum 400 */
+
#endif /* _ASM_X86_CPUFEATURES_H */
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 06/14] perf callchain: Reference count maps
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2017-02-01 12:24 ` [PATCH 05/14] tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h Arnaldo Carvalho de Melo
@ 2017-02-01 12:24 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 07/14] tools lib bpf: Add BPF program pinning APIs Arnaldo Carvalho de Melo
` (8 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Krister Johansen, Frederic Weisbecker,
Masami Hiramatsu, Namhyung Kim, stable, Arnaldo Carvalho de Melo
From: Krister Johansen <kjlx@templeofstupid.com>
If dso__load_kcore frees all of the existing maps, but one has already
been attached to a callchain cursor node, then we can get a SIGSEGV in
any function that happens to try to use this invalid cursor. Use the
existing map refcount mechanism to forestall cleanup of a map until the
cursor iterates past the node.
Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: stable@kernel.org
Fixes: 84c2cafa2889 ("perf tools: Reference count struct map")
Link: http://lkml.kernel.org/r/20170106062331.GB2707@templeofstupid.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/callchain.c | 11 +++++++++--
tools/perf/util/callchain.h | 6 ++++++
tools/perf/util/hist.c | 7 +++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index e16db30dfe40..aba953421a03 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -449,7 +449,7 @@ fill_node(struct callchain_node *node, struct callchain_cursor *cursor)
}
call->ip = cursor_node->ip;
call->ms.sym = cursor_node->sym;
- call->ms.map = cursor_node->map;
+ call->ms.map = map__get(cursor_node->map);
if (cursor_node->branch) {
call->branch_count = 1;
@@ -489,6 +489,7 @@ add_child(struct callchain_node *parent,
list_for_each_entry_safe(call, tmp, &new->val, list) {
list_del(&call->list);
+ map__zput(call->ms.map);
free(call);
}
free(new);
@@ -773,6 +774,7 @@ merge_chain_branch(struct callchain_cursor *cursor,
list->ms.map, list->ms.sym,
false, NULL, 0, 0);
list_del(&list->list);
+ map__zput(list->ms.map);
free(list);
}
@@ -823,7 +825,8 @@ int callchain_cursor_append(struct callchain_cursor *cursor,
}
node->ip = ip;
- node->map = map;
+ map__zput(node->map);
+ node->map = map__get(map);
node->sym = sym;
node->branch = branch;
node->nr_loop_iter = nr_loop_iter;
@@ -1154,11 +1157,13 @@ static void free_callchain_node(struct callchain_node *node)
list_for_each_entry_safe(list, tmp, &node->parent_val, list) {
list_del(&list->list);
+ map__zput(list->ms.map);
free(list);
}
list_for_each_entry_safe(list, tmp, &node->val, list) {
list_del(&list->list);
+ map__zput(list->ms.map);
free(list);
}
@@ -1222,6 +1227,7 @@ int callchain_node__make_parent_list(struct callchain_node *node)
goto out;
*new = *chain;
new->has_children = false;
+ map__get(new->ms.map);
list_add_tail(&new->list, &head);
}
parent = parent->parent;
@@ -1242,6 +1248,7 @@ int callchain_node__make_parent_list(struct callchain_node *node)
out:
list_for_each_entry_safe(chain, new, &head, list) {
list_del(&chain->list);
+ map__zput(chain->ms.map);
free(chain);
}
return -ENOMEM;
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 35c8e379530f..4f4b60f1558a 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -5,6 +5,7 @@
#include <linux/list.h>
#include <linux/rbtree.h>
#include "event.h"
+#include "map.h"
#include "symbol.h"
#define HELP_PAD "\t\t\t\t"
@@ -184,8 +185,13 @@ int callchain_merge(struct callchain_cursor *cursor,
*/
static inline void callchain_cursor_reset(struct callchain_cursor *cursor)
{
+ struct callchain_cursor_node *node;
+
cursor->nr = 0;
cursor->last = &cursor->first;
+
+ for (node = cursor->first; node != NULL; node = node->next)
+ map__zput(node->map);
}
int callchain_cursor_append(struct callchain_cursor *cursor, u64 ip,
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index cff2e9041b15..32c6a939e4cc 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1,6 +1,7 @@
#include "util.h"
#include "build-id.h"
#include "hist.h"
+#include "map.h"
#include "session.h"
#include "sort.h"
#include "evlist.h"
@@ -1019,6 +1020,10 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
int max_stack_depth, void *arg)
{
int err, err2;
+ struct map *alm = NULL;
+
+ if (al && al->map)
+ alm = map__get(al->map);
err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent,
iter->evsel, al, max_stack_depth);
@@ -1058,6 +1063,8 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
if (!err)
err = err2;
+ map__put(alm);
+
return err;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 07/14] tools lib bpf: Add BPF program pinning APIs
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (5 preceding siblings ...)
2017-02-01 12:24 ` [PATCH 06/14] perf callchain: Reference count maps Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 08/14] tools lib bpf: Add bpf_map__pin() Arnaldo Carvalho de Melo
` (7 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joe Stringer, Alexei Starovoitov, Daniel Borkmann,
Wang Nan, netdev, Arnaldo Carvalho de Melo
From: Joe Stringer <joe@ovn.org>
Add new APIs to pin a BPF program (or specific instances) to the
filesystem. The user can specify the path full path within a BPF
filesystem to pin the program.
bpf_program__pin_instance(prog, path, n) will pin the nth instance of
'prog' to the specified path.
bpf_program__pin(prog, path) will create the directory 'path' (if it
does not exist) and pin each instance within that directory. For
instance, path/0, path/1, path/2.
Committer notes:
- Add missing headers for mkdir()
- Check strdup() for failure
- Check snprintf >= size, not >, as == also means truncated, see 'man
snprintf', return value.
- Conditionally define BPF_FS_MAGIC, as it isn't in magic.h in older
systems and we're not yet having a tools/include/uapi/linux/magic.h
copy.
- Do not include linux/magic.h, not present in older distros.
Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-2-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/bpf/libbpf.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++
tools/lib/bpf/libbpf.h | 3 ++
2 files changed, 123 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index e6cd62b1264b..c4465b2fddf6 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -4,6 +4,7 @@
* Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org>
* Copyright (C) 2015 Wang Nan <wangnan0@huawei.com>
* Copyright (C) 2015 Huawei Inc.
+ * Copyright (C) 2017 Nicira, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,6 +23,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#include <libgen.h>
#include <inttypes.h>
#include <string.h>
#include <unistd.h>
@@ -32,6 +34,10 @@
#include <linux/kernel.h>
#include <linux/bpf.h>
#include <linux/list.h>
+#include <linux/limits.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/vfs.h>
#include <libelf.h>
#include <gelf.h>
@@ -42,6 +48,10 @@
#define EM_BPF 247
#endif
+#ifndef BPF_FS_MAGIC
+#define BPF_FS_MAGIC 0xcafe4a11
+#endif
+
#define __printf(a, b) __attribute__((format(printf, a, b)))
__printf(1, 2)
@@ -1237,6 +1247,116 @@ int bpf_object__load(struct bpf_object *obj)
return err;
}
+static int check_path(const char *path)
+{
+ struct statfs st_fs;
+ char *dname, *dir;
+ int err = 0;
+
+ if (path == NULL)
+ return -EINVAL;
+
+ dname = strdup(path);
+ if (dname == NULL)
+ return -ENOMEM;
+
+ dir = dirname(dname);
+ if (statfs(dir, &st_fs)) {
+ pr_warning("failed to statfs %s: %s\n", dir, strerror(errno));
+ err = -errno;
+ }
+ free(dname);
+
+ if (!err && st_fs.f_type != BPF_FS_MAGIC) {
+ pr_warning("specified path %s is not on BPF FS\n", path);
+ err = -EINVAL;
+ }
+
+ return err;
+}
+
+int bpf_program__pin_instance(struct bpf_program *prog, const char *path,
+ int instance)
+{
+ int err;
+
+ err = check_path(path);
+ if (err)
+ return err;
+
+ if (prog == NULL) {
+ pr_warning("invalid program pointer\n");
+ return -EINVAL;
+ }
+
+ if (instance < 0 || instance >= prog->instances.nr) {
+ pr_warning("invalid prog instance %d of prog %s (max %d)\n",
+ instance, prog->section_name, prog->instances.nr);
+ return -EINVAL;
+ }
+
+ if (bpf_obj_pin(prog->instances.fds[instance], path)) {
+ pr_warning("failed to pin program: %s\n", strerror(errno));
+ return -errno;
+ }
+ pr_debug("pinned program '%s'\n", path);
+
+ return 0;
+}
+
+static int make_dir(const char *path)
+{
+ int err = 0;
+
+ if (mkdir(path, 0700) && errno != EEXIST)
+ err = -errno;
+
+ if (err)
+ pr_warning("failed to mkdir %s: %s\n", path, strerror(-err));
+ return err;
+}
+
+int bpf_program__pin(struct bpf_program *prog, const char *path)
+{
+ int i, err;
+
+ err = check_path(path);
+ if (err)
+ return err;
+
+ if (prog == NULL) {
+ pr_warning("invalid program pointer\n");
+ return -EINVAL;
+ }
+
+ if (prog->instances.nr <= 0) {
+ pr_warning("no instances of prog %s to pin\n",
+ prog->section_name);
+ return -EINVAL;
+ }
+
+ err = make_dir(path);
+ if (err)
+ return err;
+
+ for (i = 0; i < prog->instances.nr; i++) {
+ char buf[PATH_MAX];
+ int len;
+
+ len = snprintf(buf, PATH_MAX, "%s/%d", path, i);
+ if (len < 0)
+ return -EINVAL;
+ else if (len >= PATH_MAX)
+ return -ENAMETOOLONG;
+
+ err = bpf_program__pin_instance(prog, buf, i);
+ if (err)
+ return err;
+ }
+
+ return 0;
+}
+
void bpf_object__close(struct bpf_object *obj)
{
size_t i;
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 4014d1ba5e3d..9f8aa63b95f4 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -106,6 +106,9 @@ void *bpf_program__priv(struct bpf_program *prog);
const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
int bpf_program__fd(struct bpf_program *prog);
+int bpf_program__pin_instance(struct bpf_program *prog, const char *path,
+ int instance);
+int bpf_program__pin(struct bpf_program *prog, const char *path);
struct bpf_insn;
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 08/14] tools lib bpf: Add bpf_map__pin()
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (6 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 07/14] tools lib bpf: Add BPF program pinning APIs Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 09/14] tools lib bpf: Add bpf_object__pin() Arnaldo Carvalho de Melo
` (6 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joe Stringer, Alexei Starovoitov, Daniel Borkmann,
Wang Nan, netdev, Arnaldo Carvalho de Melo
From: Joe Stringer <joe@ovn.org>
Add a new API to pin a BPF map to the filesystem. The user can specify
the path full path within a BPF filesystem to pin the map.
Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-3-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/bpf/libbpf.c | 22 ++++++++++++++++++++++
tools/lib/bpf/libbpf.h | 1 +
2 files changed, 23 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index c4465b2fddf6..6a8c8beeb291 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1357,6 +1357,28 @@ int bpf_program__pin(struct bpf_program *prog, const char *path)
return 0;
}
+int bpf_map__pin(struct bpf_map *map, const char *path)
+{
+ int err;
+
+ err = check_path(path);
+ if (err)
+ return err;
+
+ if (map == NULL) {
+ pr_warning("invalid map pointer\n");
+ return -EINVAL;
+ }
+
+ if (bpf_obj_pin(map->fd, path)) {
+ pr_warning("failed to pin map: %s\n", strerror(errno));
+ return -errno;
+ }
+
+ pr_debug("pinned map '%s'\n", path);
+ return 0;
+}
+
void bpf_object__close(struct bpf_object *obj)
{
size_t i;
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 9f8aa63b95f4..2addf9d5b13c 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -236,6 +236,7 @@ typedef void (*bpf_map_clear_priv_t)(struct bpf_map *, void *);
int bpf_map__set_priv(struct bpf_map *map, void *priv,
bpf_map_clear_priv_t clear_priv);
void *bpf_map__priv(struct bpf_map *map);
+int bpf_map__pin(struct bpf_map *map, const char *path);
long libbpf_get_error(const void *ptr);
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 09/14] tools lib bpf: Add bpf_object__pin()
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (7 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 08/14] tools lib bpf: Add bpf_map__pin() Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 10/14] tools perf util: Make rm_rf(path) argument const Arnaldo Carvalho de Melo
` (5 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joe Stringer, Alexei Starovoitov, Daniel Borkmann,
Wang Nan, netdev, Arnaldo Carvalho de Melo
From: Joe Stringer <joe@ovn.org>
Add a new API to pin a BPF object to the filesystem. The user can
specify the path within a BPF filesystem to pin the object.
Programs will be pinned under a subdirectory named the same as the
program, with each instance appearing as a numbered file under that
directory, and maps will be pinned under the path using the name of
the map as the file basename.
For example, with the directory '/sys/fs/bpf/foo' and a BPF object which
contains two instances of a program named 'bar', and a map named 'baz':
/sys/fs/bpf/foo/bar/0
/sys/fs/bpf/foo/bar/1
/sys/fs/bpf/foo/baz
Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-4-joe@ovn.org
[ Check snprintf >= for truncation, as snprintf(bf, size, ...) == size also means truncation ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/bpf/libbpf.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
tools/lib/bpf/libbpf.h | 1 +
2 files changed, 54 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 6a8c8beeb291..ac6eb863b2a4 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1379,6 +1379,59 @@ int bpf_map__pin(struct bpf_map *map, const char *path)
return 0;
}
+int bpf_object__pin(struct bpf_object *obj, const char *path)
+{
+ struct bpf_program *prog;
+ struct bpf_map *map;
+ int err;
+
+ if (!obj)
+ return -ENOENT;
+
+ if (!obj->loaded) {
+ pr_warning("object not yet loaded; load it first\n");
+ return -ENOENT;
+ }
+
+ err = make_dir(path);
+ if (err)
+ return err;
+
+ bpf_map__for_each(map, obj) {
+ char buf[PATH_MAX];
+ int len;
+
+ len = snprintf(buf, PATH_MAX, "%s/%s", path,
+ bpf_map__name(map));
+ if (len < 0)
+ return -EINVAL;
+ else if (len >= PATH_MAX)
+ return -ENAMETOOLONG;
+
+ err = bpf_map__pin(map, buf);
+ if (err)
+ return err;
+ }
+
+ bpf_object__for_each_program(prog, obj) {
+ char buf[PATH_MAX];
+ int len;
+
+ len = snprintf(buf, PATH_MAX, "%s/%s", path,
+ prog->section_name);
+ if (len < 0)
+ return -EINVAL;
+ else if (len >= PATH_MAX)
+ return -ENAMETOOLONG;
+
+ err = bpf_program__pin(prog, buf);
+ if (err)
+ return err;
+ }
+
+ return 0;
+}
+
void bpf_object__close(struct bpf_object *obj)
{
size_t i;
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 2addf9d5b13c..b30394f9947a 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -65,6 +65,7 @@ struct bpf_object *bpf_object__open(const char *path);
struct bpf_object *bpf_object__open_buffer(void *obj_buf,
size_t obj_buf_sz,
const char *name);
+int bpf_object__pin(struct bpf_object *object, const char *path);
void bpf_object__close(struct bpf_object *object);
/* Load/unload object into/from kernel */
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 10/14] tools perf util: Make rm_rf(path) argument const
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (8 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 09/14] tools lib bpf: Add bpf_object__pin() Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 11/14] tools lib api fs: Add bpf_fs filesystem detector Arnaldo Carvalho de Melo
` (4 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joe Stringer, Alexei Starovoitov, Daniel Borkmann,
Wang Nan, netdev, Arnaldo Carvalho de Melo
From: Joe Stringer <joe@ovn.org>
rm_rf() doesn't modify its path argument, and a future caller will pass
a string constant into it to delete.
Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-5-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/util.c | 2 +-
tools/perf/util/util.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index bf29aed16bd6..d8b45cea54d0 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -85,7 +85,7 @@ int mkdir_p(char *path, mode_t mode)
return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0;
}
-int rm_rf(char *path)
+int rm_rf(const char *path)
{
DIR *dir;
int ret = 0;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 6e8be174ec0b..c74708da8571 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -209,7 +209,7 @@ static inline int sane_case(int x, int high)
}
int mkdir_p(char *path, mode_t mode);
-int rm_rf(char *path);
+int rm_rf(const char *path);
struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *));
bool lsdir_no_dot_filter(const char *name, struct dirent *d);
int copyfile(const char *from, const char *to);
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 11/14] tools lib api fs: Add bpf_fs filesystem detector
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (9 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 10/14] tools perf util: Make rm_rf(path) argument const Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 12/14] perf test: Add libbpf pinning test Arnaldo Carvalho de Melo
` (3 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joe Stringer, Alexei Starovoitov, Daniel Borkmann,
Wang Nan, netdev, Arnaldo Carvalho de Melo
From: Joe Stringer <joe@ovn.org>
Allow mounting of the BPF filesystem at /sys/fs/bpf.
Signed-off-by: Joe Stringer <joe@ovn.org>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-6-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/api/fs/fs.c | 16 ++++++++++++++++
tools/lib/api/fs/fs.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c
index f99f49e4a31e..4b6bfc43cccf 100644
--- a/tools/lib/api/fs/fs.c
+++ b/tools/lib/api/fs/fs.c
@@ -38,6 +38,10 @@
#define HUGETLBFS_MAGIC 0x958458f6
#endif
+#ifndef BPF_FS_MAGIC
+#define BPF_FS_MAGIC 0xcafe4a11
+#endif
+
static const char * const sysfs__fs_known_mountpoints[] = {
"/sys",
0,
@@ -75,6 +79,11 @@ static const char * const hugetlbfs__known_mountpoints[] = {
0,
};
+static const char * const bpf_fs__known_mountpoints[] = {
+ "/sys/fs/bpf",
+ 0,
+};
+
struct fs {
const char *name;
const char * const *mounts;
@@ -89,6 +98,7 @@ enum {
FS__DEBUGFS = 2,
FS__TRACEFS = 3,
FS__HUGETLBFS = 4,
+ FS__BPF_FS = 5,
};
#ifndef TRACEFS_MAGIC
@@ -121,6 +131,11 @@ static struct fs fs__entries[] = {
.mounts = hugetlbfs__known_mountpoints,
.magic = HUGETLBFS_MAGIC,
},
+ [FS__BPF_FS] = {
+ .name = "bpf",
+ .mounts = bpf_fs__known_mountpoints,
+ .magic = BPF_FS_MAGIC,
+ },
};
static bool fs__read_mounts(struct fs *fs)
@@ -280,6 +295,7 @@ FS(procfs, FS__PROCFS);
FS(debugfs, FS__DEBUGFS);
FS(tracefs, FS__TRACEFS);
FS(hugetlbfs, FS__HUGETLBFS);
+FS(bpf_fs, FS__BPF_FS);
int filename__read_int(const char *filename, int *value)
{
diff --git a/tools/lib/api/fs/fs.h b/tools/lib/api/fs/fs.h
index a63269f5d20c..6b332dc74498 100644
--- a/tools/lib/api/fs/fs.h
+++ b/tools/lib/api/fs/fs.h
@@ -22,6 +22,7 @@ FS(procfs)
FS(debugfs)
FS(tracefs)
FS(hugetlbfs)
+FS(bpf_fs)
#undef FS
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 12/14] perf test: Add libbpf pinning test
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (10 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 11/14] tools lib api fs: Add bpf_fs filesystem detector Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 13/14] perf tools: Create for_each_event macro for tracepoints iteration Arnaldo Carvalho de Melo
` (2 subsequent siblings)
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joe Stringer, Alexei Starovoitov, Daniel Borkmann,
Wang Nan, netdev, Arnaldo Carvalho de Melo
From: Joe Stringer <joe@ovn.org>
Add a test for the newly added BPF object pinning functionality.
For example:
# tools/perf/perf test 37
37: BPF filter :
37.1: Basic BPF filtering : Ok
37.2: BPF pinning : Ok
37.3: BPF prologue generation : Ok
37.4: BPF relocation checker : Ok
# tools/perf/perf test 37 -v 2>&1 | grep pinned
libbpf: pinned map '/sys/fs/bpf/perf_test/flip_table'
libbpf: pinned program '/sys/fs/bpf/perf_test/func=SyS_epoll_wait/0'
Signed-off-by: Joe Stringer <joe@ovn.org>
Requested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-7-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/bpf.c | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 92343f43e44a..1a04fe77487d 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -5,11 +5,13 @@
#include <util/evlist.h>
#include <linux/bpf.h>
#include <linux/filter.h>
+#include <api/fs/fs.h>
#include <bpf/bpf.h>
#include "tests.h"
#include "llvm.h"
#include "debug.h"
#define NR_ITERS 111
+#define PERF_TEST_BPF_PATH "/sys/fs/bpf/perf_test"
#ifdef HAVE_LIBBPF_SUPPORT
@@ -54,6 +56,7 @@ static struct {
const char *msg_load_fail;
int (*target_func)(void);
int expect_result;
+ bool pin;
} bpf_testcase_table[] = {
{
LLVM_TESTCASE_BASE,
@@ -63,6 +66,17 @@ static struct {
"load bpf object failed",
&epoll_wait_loop,
(NR_ITERS + 1) / 2,
+ false,
+ },
+ {
+ LLVM_TESTCASE_BASE,
+ "BPF pinning",
+ "[bpf_pinning]",
+ "fix kbuild first",
+ "check your vmlinux setting?",
+ &epoll_wait_loop,
+ (NR_ITERS + 1) / 2,
+ true,
},
#ifdef HAVE_BPF_PROLOGUE
{
@@ -73,6 +87,7 @@ static struct {
"check your vmlinux setting?",
&llseek_loop,
(NR_ITERS + 1) / 4,
+ false,
},
#endif
{
@@ -83,6 +98,7 @@ static struct {
"libbpf error when dealing with relocation",
NULL,
0,
+ false,
},
};
@@ -226,10 +242,34 @@ static int __test__bpf(int idx)
goto out;
}
- if (obj)
+ if (obj) {
ret = do_test(obj,
bpf_testcase_table[idx].target_func,
bpf_testcase_table[idx].expect_result);
+ if (ret != TEST_OK)
+ goto out;
+ if (bpf_testcase_table[idx].pin) {
+ int err;
+
+ if (!bpf_fs__mount()) {
+ pr_debug("BPF filesystem not mounted\n");
+ ret = TEST_FAIL;
+ goto out;
+ }
+ err = mkdir(PERF_TEST_BPF_PATH, 0777);
+ if (err && errno != EEXIST) {
+ pr_debug("Failed to make perf_test dir: %s\n",
+ strerror(errno));
+ ret = TEST_FAIL;
+ goto out;
+ }
+ if (bpf_object__pin(obj, PERF_TEST_BPF_PATH))
+ ret = TEST_FAIL;
+ if (rm_rf(PERF_TEST_BPF_PATH))
+ ret = TEST_FAIL;
+ }
+ }
+
out:
bpf__clear();
return ret;
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 13/14] perf tools: Create for_each_event macro for tracepoints iteration
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (11 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 12/14] perf test: Add libbpf pinning test Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 14/14] perf ftrace: Add ftrace.tracer config option Arnaldo Carvalho de Melo
2017-02-01 14:35 ` [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Taeung Song, Frederic Weisbecker, Jiri Olsa,
Namhyung Kim, Peter Zijlstra, Steven Rostedt, Wang Nan,
Arnaldo Carvalho de Melo
From: Taeung Song <treeze.taeung@gmail.com>
Similar to for_each_subsystem and for_each_event in util/parse-events.c,
add new macro 'for_each_event' for easy iteration over the tracepoints
in order to be more compact and readable.
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1485862711-20216-2-git-send-email-treeze.taeung@gmail.com
[ Slight change to keep existing style for checking strcmp() return ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/trace-event-info.c | 38 ++++++++++++++++++--------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index ceb0e2720223..e7d60d05596d 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -170,6 +170,12 @@ static bool name_in_tp_list(char *sys, struct tracepoint_path *tps)
return false;
}
+#define for_each_event(dir, dent, tps) \
+ while ((dent = readdir(dir))) \
+ if (dent->d_type == DT_DIR && \
+ (strcmp(dent->d_name, ".")) && \
+ (strcmp(dent->d_name, ".."))) \
+
static int copy_event_system(const char *sys, struct tracepoint_path *tps)
{
struct dirent *dent;
@@ -186,12 +192,10 @@ static int copy_event_system(const char *sys, struct tracepoint_path *tps)
return -errno;
}
- while ((dent = readdir(dir))) {
- if (dent->d_type != DT_DIR ||
- strcmp(dent->d_name, ".") == 0 ||
- strcmp(dent->d_name, "..") == 0 ||
- !name_in_tp_list(dent->d_name, tps))
+ for_each_event(dir, dent, tps) {
+ if (!name_in_tp_list(dent->d_name, tps))
continue;
+
if (asprintf(&format, "%s/%s/format", sys, dent->d_name) < 0) {
err = -ENOMEM;
goto out;
@@ -210,12 +214,10 @@ static int copy_event_system(const char *sys, struct tracepoint_path *tps)
}
rewinddir(dir);
- while ((dent = readdir(dir))) {
- if (dent->d_type != DT_DIR ||
- strcmp(dent->d_name, ".") == 0 ||
- strcmp(dent->d_name, "..") == 0 ||
- !name_in_tp_list(dent->d_name, tps))
+ for_each_event(dir, dent, tps) {
+ if (!name_in_tp_list(dent->d_name, tps))
continue;
+
if (asprintf(&format, "%s/%s/format", sys, dent->d_name) < 0) {
err = -ENOMEM;
goto out;
@@ -290,13 +292,11 @@ static int record_event_files(struct tracepoint_path *tps)
goto out;
}
- while ((dent = readdir(dir))) {
- if (dent->d_type != DT_DIR ||
- strcmp(dent->d_name, ".") == 0 ||
- strcmp(dent->d_name, "..") == 0 ||
- strcmp(dent->d_name, "ftrace") == 0 ||
+ for_each_event(dir, dent, tps) {
+ if (strcmp(dent->d_name, "ftrace") == 0 ||
!system_in_tp_list(dent->d_name, tps))
continue;
+
count++;
}
@@ -307,13 +307,11 @@ static int record_event_files(struct tracepoint_path *tps)
}
rewinddir(dir);
- while ((dent = readdir(dir))) {
- if (dent->d_type != DT_DIR ||
- strcmp(dent->d_name, ".") == 0 ||
- strcmp(dent->d_name, "..") == 0 ||
- strcmp(dent->d_name, "ftrace") == 0 ||
+ for_each_event(dir, dent, tps) {
+ if (strcmp(dent->d_name, "ftrace") == 0 ||
!system_in_tp_list(dent->d_name, tps))
continue;
+
if (asprintf(&sys, "%s/%s", path, dent->d_name) < 0) {
err = -ENOMEM;
goto out;
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 14/14] perf ftrace: Add ftrace.tracer config option
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (12 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 13/14] perf tools: Create for_each_event macro for tracepoints iteration Arnaldo Carvalho de Melo
@ 2017-02-01 12:25 ` Arnaldo Carvalho de Melo
2017-02-01 14:35 ` [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar
14 siblings, 0 replies; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-01 12:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim,
Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo
From: Taeung Song <treeze.taeung@gmail.com>
Currently 'perf ftrace' command allows selecting 'function_graph' or
'function', defaulting to 'function_graph'.
Add ftrace.tracer config option to select the default tracer:
# cat ~/.perfconfig
[ftrace]
tracer = function
# perf ftrace usleep 123456 | head -10
<...>-14450 [002] d... 10089.284231: finish_task_switch <-__schedule
<...>-14450 [002] .... 10089.284232: finish_wait <-pipe_wait
<...>-14450 [002] .... 10089.284232: mutex_lock <-pipe_wait
<...>-14450 [002] .... 10089.284232: _cond_resched <-mutex_lock
Committer notes:
Retesting it with invalid variables, invalid values for ftrace.tracer,
and a valid one:
# cat ~/.perfconfig
[ftrace]
trace = function
# perf ftrace usleep 1
Error: wrong config key-value pair ftrace.trace=function
# cat ~/.perfconfig
[ftrace]
tracer = functin
# perf ftrace usleep 1
Please select "function_graph" (default) or "function"
Error: wrong config key-value pair ftrace.tracer=functin
# cat ~/.perfconfig
[ftrace]
tracer = function
# perf ftrace usleep 1 | head -5
<idle>-0 [000] d... 3855.820847: switch_mm_irqs_off <-__schedule
<...>-18550 [000] d... 3855.820849: finish_task_switch <-__schedule
<...>-18550 [000] d... 3855.820851: smp_irq_work_interrupt <-irq_work_interrupt
<...>-18550 [000] d... 3855.820851: irq_enter <-smp_irq_work_interrupt
<...>-18550 [000] d... 3855.820851: rcu_irq_enter <-irq_enter
#
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1485862711-20216-3-git-send-email-treeze.taeung@gmail.com
[ Added missign space in error message, changed the logic to make it more compact and less error prone ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-ftrace.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 414444d0e919..c3e643666c72 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -17,6 +17,7 @@
#include "evlist.h"
#include "target.h"
#include "thread_map.h"
+#include "util/config.h"
#define DEFAULT_TRACER "function_graph"
@@ -198,6 +199,26 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
return done ? 0 : -1;
}
+static int perf_ftrace_config(const char *var, const char *value, void *cb)
+{
+ struct perf_ftrace *ftrace = cb;
+
+ if (prefixcmp(var, "ftrace."))
+ return 0;
+
+ if (strcmp(var, "ftrace.tracer"))
+ return -1;
+
+ if (!strcmp(value, "function_graph") ||
+ !strcmp(value, "function")) {
+ ftrace->tracer = value;
+ return 0;
+ }
+
+ pr_err("Please select \"function_graph\" (default) or \"function\"\n");
+ return -1;
+}
+
int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
{
int ret;
@@ -218,6 +239,10 @@ int cmd_ftrace(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_END()
};
+ ret = perf_config(perf_ftrace_config, &ftrace);
+ if (ret < 0)
+ return -1;
+
argc = parse_options(argc, argv, ftrace_options, ftrace_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (!argc)
--
2.9.3
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (13 preceding siblings ...)
2017-02-01 12:25 ` [PATCH 14/14] perf ftrace: Add ftrace.tracer config option Arnaldo Carvalho de Melo
@ 2017-02-01 14:35 ` Ingo Molnar
14 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2017-02-01 14:35 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Daniel Borkmann,
David Ahern, Frederic Weisbecker, Jiri Olsa, Joe Stringer,
Josh Poimboeuf, Krister Johansen, Masami Hiramatsu, Michal Marek,
Namhyung Kim, Peter Zijlstra, Steven Rostedt, Taeung Song,
Wang Nan, 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 e2cf00c257f5bbc071b489b1dfbeaa30b6f12da6:
>
> Merge tag 'perf-core-for-mingo-4.11-20170126' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-01-26 16:20:59 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.11-20170201
>
> for you to fetch changes up to b05d1093987a78695766b71a2d723aa65b5c25c5:
>
> perf ftrace: Add ftrace.tracer config option (2017-01-31 16:20:09 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> New features:
>
> . Allow configuring a 'perf ftrace' default --tracer (Taeung Song)
>
> Infrastructure:
>
> . Sync tools/arch/{powerpc,arm}/include/uapi/asm/kvm.h and
> tools/arch/x86/include/asm/cpufeatures.h (Ingo Molnar)
>
> . Add BPF program file system pinning APIs and respective
> 'perf test' entry (Joe Stringer)
>
> . Make tools tree support 'make -s' (Josh Poimboeuf)
>
> . Reference count maps in callchains, fixing SEGFAULT when
> referencing maps after it is freed (Krister Johansen)
>
> . Create for_each_event trace points iterator (Taeung Song)
>
> . Do not consider an error not to have any perfconfig file
> (Arnaldo Carvalho de Melo
>
> . Propagate perf_config() errors (Arnaldo Carvalho de Melo)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
> perf config: Do not consider an error not to have any perfconfig file
> perf tools: Propagate perf_config() errors
>
> Ingo Molnar (1):
> tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h
>
> Joe Stringer (6):
> tools lib bpf: Add BPF program pinning APIs
> tools lib bpf: Add bpf_map__pin()
> tools lib bpf: Add bpf_object__pin()
> tools perf util: Make rm_rf(path) argument const
> tools lib api fs: Add bpf_fs filesystem detector
> perf test: Add libbpf pinning test
>
> Josh Poimboeuf (1):
> tools build: Add tools tree support for 'make -s'
>
> Krister Johansen (1):
> perf callchain: Reference count maps
>
> Taeung Song (3):
> perf ftrace: Remove needless code setting default tracer
> perf tools: Create for_each_event macro for tracepoints iteration
> perf ftrace: Add ftrace.tracer config option
>
> Makefile | 6 +-
> tools/arch/arm/include/uapi/asm/kvm.h | 9 ++
> tools/arch/powerpc/include/uapi/asm/kvm.h | 5 +
> tools/arch/x86/include/asm/cpufeatures.h | 11 ++
> tools/build/Makefile.build | 10 ++
> tools/lib/api/fs/fs.c | 16 +++
> tools/lib/api/fs/fs.h | 1 +
> tools/lib/bpf/libbpf.c | 195 ++++++++++++++++++++++++++++++
> tools/lib/bpf/libbpf.h | 5 +
> tools/perf/builtin-ftrace.c | 30 ++++-
> tools/perf/builtin-help.c | 6 +-
> tools/perf/builtin-kmem.c | 8 +-
> tools/perf/builtin-record.c | 4 +-
> tools/perf/builtin-report.c | 4 +-
> tools/perf/builtin-top.c | 4 +-
> tools/perf/perf.c | 15 ++-
> tools/perf/tests/bpf.c | 42 ++++++-
> tools/perf/util/callchain.c | 27 ++++-
> tools/perf/util/callchain.h | 6 +
> tools/perf/util/config.c | 23 ++--
> tools/perf/util/data-convert-bt.c | 7 +-
> tools/perf/util/hist.c | 11 +-
> tools/perf/util/intel-pt.c | 4 +-
> tools/perf/util/llvm-utils.c | 4 +-
> tools/perf/util/trace-event-info.c | 38 +++---
> tools/perf/util/util.c | 2 +-
> tools/perf/util/util.h | 2 +-
> tools/scripts/Makefile.include | 12 +-
> 28 files changed, 446 insertions(+), 61 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
* [GIT PULL 00/14] perf/core improvements and fixes
@ 2018-03-19 19:01 Arnaldo Carvalho de Melo
2018-03-19 19:39 ` Ingo Molnar
0 siblings, 1 reply; 30+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-03-19 19:01 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
Adrian Hunter, Alexander Shishkin, Andi Kleen, Colin King,
David Ahern, Jin Yao, Jiri Olsa, Josh Poimboeuf, Kan Liang,
kernel-janitors, Laura Abbott, linux-kselftest, linuxppc-dev,
linux-trace-users, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
Ravi Bangoria, Sergey Senozhatsky, Shuah Khan, Stephane Eranian,
Steven Rostedt, Sukadev Bhattiprolu, Tom Zanussi, Wang Nan,
Willy Tarreau, Yisheng Xie, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling, this has those 31 patches that were
blocked due to some problems (author not being the fist S-o-B, build
broken on ppc), those issues should all be fixed and then we have 14
patches more, described in the signed tag.
Regards,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit 10f354a36f9a9aa1b8bffe0abc1cd43822a85bcd:
perf test: Fix exit code for record+probe_libc_inet_pton.sh (2018-03-16 13:56:31 -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-4.17-20180319
for you to fetch changes up to 1cd618838b9703eabe4a75badf433382b12f6bef:
perf tests bp_account: Fix build with clang-6 (2018-03-19 13:51:54 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
- Fixes for problems experienced with new gcc 8 warnings, that treated
as errors, broke the build, related to snprintf and casting issues.
(Arnaldo Carvalho de Melo, Jiri Olsa, Josh Poinboeuf)
- Fix build of new breakpoint 'perf test' entry with clang < 6, noticed
on fedora 25, 26 and 27 (Arnaldo Carvalho de Melo)
- Workaround problem with symbol resolution in 'perf annotate', using
the symbol name already present in the objdump output (Arnaldo Carvalho de Melo)
- Document 'perf top --ignore-vmlinux' (Arnaldo Carvalho de Melo)
- Fix out of bounds access on array fd when cnt is 100 in one of the
'perf test' entries, detected using 'cpptest' (Colin Ian King)
- Add support for the forced leader feature, i.e. 'perf report --group'
for a group of events not really grouped when scheduled (without using
{} to enclose the list of events in the command line) in pipe mode,
e.g.:
$ perf record -e cycles,instructions -o - kill | perf report --group -i -
- Use right type to access array elements in 'perf probe' (Masami Hiramatsu)
- Update POWER9 vendor events (those described in JSON format) (Sukadev Bhattiprolu)
- Discard head in overwrite_rb_find_range() (Yisheng Xie)
- Avoid setting 'quiet' to 'true' unnecessarily (Yisheng Xie)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (4):
perf annotate: Use asprintf when formatting objdump command line
perf top: Document --ignore-vmlinux
perf annotate: Use ops->target.name when available for unresolved call targets
perf tests bp_account: Fix build with clang-6
Colin Ian King (1):
perf tests: Fix out of bounds access on array fd when cnt is 100
Jiri Olsa (4):
perf record: Synthesize features before events in pipe mode
perf report: Support forced leader feature in pipe mode
perf tools: Fix snprint warnings for gcc 8
perf tools: Fix python extension build for gcc 8
Josh Poimboeuf (1):
objtool, perf: Fix GCC 8 -Wrestrict error
Masami Hiramatsu (1):
perf probe: Use right type to access array elements
Sukadev Bhattiprolu (1):
perf vendor events: Update POWER9 events
Yisheng Xie (2):
perf mmap: Discard head in overwrite_rb_find_range()
perf debug: Avoid setting 'quiet' to 'true' unnecessarily
tools/lib/str_error_r.c | 2 +-
tools/perf/Documentation/perf-top.txt | 3 +
tools/perf/builtin-record.c | 18 +-
tools/perf/builtin-report.c | 57 +++--
tools/perf/builtin-script.c | 22 +-
.../perf/pmu-events/arch/powerpc/power9/cache.json | 25 ---
.../pmu-events/arch/powerpc/power9/frontend.json | 10 -
.../pmu-events/arch/powerpc/power9/marked.json | 5 -
.../pmu-events/arch/powerpc/power9/memory.json | 5 -
.../perf/pmu-events/arch/powerpc/power9/other.json | 241 ++++++++++++++-------
.../pmu-events/arch/powerpc/power9/pipeline.json | 50 ++---
tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 5 -
.../arch/powerpc/power9/translation.json | 10 +-
tools/perf/tests/attr.c | 4 +-
tools/perf/tests/bp_account.c | 10 +-
tools/perf/tests/mem.c | 2 +-
tools/perf/tests/pmu.c | 2 +-
tools/perf/util/annotate.c | 20 +-
tools/perf/util/cgroup.c | 2 +-
tools/perf/util/debug.c | 1 -
tools/perf/util/header.c | 11 +-
tools/perf/util/mmap.c | 15 +-
tools/perf/util/parse-events.c | 4 +-
tools/perf/util/pmu.c | 2 +-
tools/perf/util/probe-finder.c | 13 +-
tools/perf/util/setup.py | 2 +
26 files changed, 298 insertions(+), 243 deletions(-)
Test results:
The first ones are container (docker) based builds of tools/perf with and
without libelf support. Where clang is available, it is also used to build
perf with/without libelf.
The objtool and samples/bpf/ builds are disabled now that I'm switching from
using the sources in a local volume to fetching them from a http server to
build it inside the container, to make it easier to build in a container cluster.
Those will come back later.
Several are cross builds, the ones with -x-ARCH and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.
The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.
Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.
[root@jouet ~]# time dm
1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0
2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822
3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0
4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0
5 alpine:edge : Ok gcc (Alpine 6.4.0) 6.4.0
6 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
7 amazonlinux:2 : Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
8 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
9 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
10 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
11 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
12 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
13 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2
14 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u1) 4.9.2
15 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
16 debian:experimental : Ok gcc (Debian 7.2.0-17) 7.2.1 20171205
17 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
18 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
19 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 7.2.0-11) 7.2.0
20 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
21 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
22 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
23 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
24 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
25 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
26 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
27 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
28 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
29 fedora:27 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
30 fedora:rawhide : Ok gcc (GCC) 8.0.1 20180222 (Red Hat 8.0.1-0.16)
31 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0
32 mageia:5 : Ok gcc (GCC) 4.9.2
33 mageia:6 : Ok gcc (Mageia 5.4.0-5.mga6) 5.4.0
34 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5
35 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5
36 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5
37 opensuse:tumbleweed : Ok gcc (SUSE Linux) 7.3.0
38 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
39 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16.0.3)
40 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
41 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
42 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404
43 ubuntu:15.04 : Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
44 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
45 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
46 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
47 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
48 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
49 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
50 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
51 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
52 ubuntu:17.04 : Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
53 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
54 ubuntu:18.04 : Ok gcc (Ubuntu 7.2.0-16ubuntu1) 7.2.0
# uname -a
Linux jouet 4.16.0-rc5-00086-gdf09348f78dc #1 SMP Fri Mar 16 09:46:40 -03 2018 x86_64 x86_64 x86_64 GNU/Linux
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: Detect openat syscall event : Ok
3: Detect openat syscall event on all cpus : Ok
4: Read samples using the mmap interface : Ok
5: Test data source output : Ok
6: Parse event definition strings : Ok
7: Simple expression parser : Ok
8: PERF_RECORD_* events & perf_sample fields : Ok
9: Parse perf pmu format : Ok
10: DSO data read : Ok
11: DSO data cache : Ok
12: DSO data reopen : Ok
13: Roundtrip evsel->name : Ok
14: Parse sched tracepoints fields : Ok
15: syscalls:sys_enter_openat event fields : Ok
16: Setup struct perf_event_attr : Ok
17: Match and link multiple hists : Ok
18: 'import perf' in python : Ok
19: Breakpoint overflow signal handler : Ok
20: Breakpoint overflow sampling : Ok
21: Breakpoint accounting : Skip
22: Number of exit events of a simple workload : Ok
23: Software clock events period values : Ok
24: Object code reading : Ok
25: Sample parsing : Ok
26: Use a dummy software event to keep tracking : Ok
27: Parse with no sample_id_all bit set : Ok
28: Filter hist entries : Ok
29: Lookup mmap thread : Ok
30: Share thread mg : Ok
31: Sort output of hist entries : Ok
32: Cumulate child hist entries : Ok
33: Track with sched_switch : Ok
34: Filter fds with revents mask in a fdarray : Ok
35: Add fd to a fdarray, making it autogrow : Ok
36: kmod_path__parse : Ok
37: Thread map : Ok
38: LLVM search and compile :
38.1: Basic BPF llvm compile : Ok
38.2: kbuild searching : Ok
38.3: Compile source for BPF prologue generation : Ok
38.4: Compile source for BPF relocation : Ok
39: Session topology : Ok
40: BPF filter :
40.1: Basic BPF filtering : Ok
40.2: BPF pinning : Ok
40.3: BPF prologue generation : Ok
40.4: BPF relocation checker : Ok
41: Synthesize thread map : Ok
42: Remove thread map : Ok
43: Synthesize cpu map : Ok
44: Synthesize stat config : Ok
45: Synthesize stat : Ok
46: Synthesize stat round : Ok
47: Synthesize attr update : Ok
48: Event times : Ok
49: Read backward ring buffer : Ok
50: Print cpu map : Ok
51: Probe SDT events : Ok
52: is_printable_array : Ok
53: Print bitmap : Ok
54: perf hooks : Ok
55: builtin clang support : Skip (not compiled in)
56: unit_number__scnprintf : Ok
57: mem2node : Ok
58: x86 rdpmc : Ok
59: Convert perf time to TSC : Ok
60: DWARF unwind : Ok
61: x86 instruction decoder - new instructions : Ok
62: Use vfs_getname probe to get syscall args filenames : Ok
63: Check open filename arg using perf trace + vfs_getname: Ok
64: probe libc's inet_pton & backtrace it with ping : Ok
65: Add vfs_getname probe to get syscall args filenames : Ok
#
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/perf/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_libelf_O: make NO_LIBELF=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_no_libbpf_O: make NO_LIBBPF=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
make_no_slang_O: make NO_SLANG=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_clean_all_O: make clean all
make_util_map_o_O: make util/map.o
make_no_demangle_O: make NO_DEMANGLE=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_pure_O: make
make_install_bin_O: make install-bin
make_install_O: make install
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_tags_O: make tags
make_install_prefix_O: make install prefix=/tmp/krava
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_gtk2_O: make NO_GTK2=1
make_static_O: make LDFLAGS=-static
make_help_O: make help
make_no_newt_O: make NO_NEWT=1
make_debug_O: make DEBUG=1
make_no_libunwind_O: make NO_LIBUNWIND=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_perf_o_O: make perf.o
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_no_libpython_O: make NO_LIBPYTHON=1
make_doc_O: make doc
OK
make: Leaving directory '/home/acme/git/perf/tools/perf'
$
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2018-03-19 19:01 Arnaldo Carvalho de Melo
@ 2018-03-19 19:39 ` Ingo Molnar
0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2018-03-19 19:39 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, linux-perf-users, Adrian Hunter, Alexander Shishkin,
Andi Kleen, Colin King, David Ahern, Jin Yao, Jiri Olsa,
Josh Poimboeuf, Kan Liang, kernel-janitors, Laura Abbott,
linux-kselftest, linuxppc-dev, linux-trace-users,
Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Ravi Bangoria,
Sergey Senozhatsky, Shuah Khan, Stephane Eranian, Steven Rostedt,
Sukadev Bhattiprolu, Tom Zanussi, Wang Nan, Willy Tarreau,
Yisheng Xie, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling, this has those 31 patches that were
> blocked due to some problems (author not being the fist S-o-B, build
> broken on ppc), those issues should all be fixed and then we have 14
> patches more, described in the signed tag.
>
> Regards,
>
> - Arnaldo
>
> Test results at the end of this message, as usual.
>
> The following changes since commit 10f354a36f9a9aa1b8bffe0abc1cd43822a85bcd:
>
> perf test: Fix exit code for record+probe_libc_inet_pton.sh (2018-03-16 13:56:31 -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-4.17-20180319
>
> for you to fetch changes up to 1cd618838b9703eabe4a75badf433382b12f6bef:
>
> perf tests bp_account: Fix build with clang-6 (2018-03-19 13:51:54 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> - Fixes for problems experienced with new gcc 8 warnings, that treated
> as errors, broke the build, related to snprintf and casting issues.
> (Arnaldo Carvalho de Melo, Jiri Olsa, Josh Poinboeuf)
>
> - Fix build of new breakpoint 'perf test' entry with clang < 6, noticed
> on fedora 25, 26 and 27 (Arnaldo Carvalho de Melo)
>
> - Workaround problem with symbol resolution in 'perf annotate', using
> the symbol name already present in the objdump output (Arnaldo Carvalho de Melo)
>
> - Document 'perf top --ignore-vmlinux' (Arnaldo Carvalho de Melo)
>
> - Fix out of bounds access on array fd when cnt is 100 in one of the
> 'perf test' entries, detected using 'cpptest' (Colin Ian King)
>
> - Add support for the forced leader feature, i.e. 'perf report --group'
> for a group of events not really grouped when scheduled (without using
> {} to enclose the list of events in the command line) in pipe mode,
> e.g.:
>
> $ perf record -e cycles,instructions -o - kill | perf report --group -i -
>
> - Use right type to access array elements in 'perf probe' (Masami Hiramatsu)
>
> - Update POWER9 vendor events (those described in JSON format) (Sukadev Bhattiprolu)
>
> - Discard head in overwrite_rb_find_range() (Yisheng Xie)
>
> - Avoid setting 'quiet' to 'true' unnecessarily (Yisheng Xie)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (4):
> perf annotate: Use asprintf when formatting objdump command line
> perf top: Document --ignore-vmlinux
> perf annotate: Use ops->target.name when available for unresolved call targets
> perf tests bp_account: Fix build with clang-6
>
> Colin Ian King (1):
> perf tests: Fix out of bounds access on array fd when cnt is 100
>
> Jiri Olsa (4):
> perf record: Synthesize features before events in pipe mode
> perf report: Support forced leader feature in pipe mode
> perf tools: Fix snprint warnings for gcc 8
> perf tools: Fix python extension build for gcc 8
>
> Josh Poimboeuf (1):
> objtool, perf: Fix GCC 8 -Wrestrict error
>
> Masami Hiramatsu (1):
> perf probe: Use right type to access array elements
>
> Sukadev Bhattiprolu (1):
> perf vendor events: Update POWER9 events
>
> Yisheng Xie (2):
> perf mmap: Discard head in overwrite_rb_find_range()
> perf debug: Avoid setting 'quiet' to 'true' unnecessarily
>
> tools/lib/str_error_r.c | 2 +-
> tools/perf/Documentation/perf-top.txt | 3 +
> tools/perf/builtin-record.c | 18 +-
> tools/perf/builtin-report.c | 57 +++--
> tools/perf/builtin-script.c | 22 +-
> .../perf/pmu-events/arch/powerpc/power9/cache.json | 25 ---
> .../pmu-events/arch/powerpc/power9/frontend.json | 10 -
> .../pmu-events/arch/powerpc/power9/marked.json | 5 -
> .../pmu-events/arch/powerpc/power9/memory.json | 5 -
> .../perf/pmu-events/arch/powerpc/power9/other.json | 241 ++++++++++++++-------
> .../pmu-events/arch/powerpc/power9/pipeline.json | 50 ++---
> tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 5 -
> .../arch/powerpc/power9/translation.json | 10 +-
> tools/perf/tests/attr.c | 4 +-
> tools/perf/tests/bp_account.c | 10 +-
> tools/perf/tests/mem.c | 2 +-
> tools/perf/tests/pmu.c | 2 +-
> tools/perf/util/annotate.c | 20 +-
> tools/perf/util/cgroup.c | 2 +-
> tools/perf/util/debug.c | 1 -
> tools/perf/util/header.c | 11 +-
> tools/perf/util/mmap.c | 15 +-
> tools/perf/util/parse-events.c | 4 +-
> tools/perf/util/pmu.c | 2 +-
> tools/perf/util/probe-finder.c | 13 +-
> tools/perf/util/setup.py | 2 +
> 26 files changed, 298 insertions(+), 243 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2018-03-19 19:39 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-01 12:24 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 01/14] perf ftrace: Remove needless code setting default tracer Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 02/14] tools build: Add tools tree support for 'make -s' Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 03/14] perf config: Do not consider an error not to have any perfconfig file Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 04/14] perf tools: Propagate perf_config() errors Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 05/14] tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h Arnaldo Carvalho de Melo
2017-02-01 12:24 ` [PATCH 06/14] perf callchain: Reference count maps Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 07/14] tools lib bpf: Add BPF program pinning APIs Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 08/14] tools lib bpf: Add bpf_map__pin() Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 09/14] tools lib bpf: Add bpf_object__pin() Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 10/14] tools perf util: Make rm_rf(path) argument const Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 11/14] tools lib api fs: Add bpf_fs filesystem detector Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 12/14] perf test: Add libbpf pinning test Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 13/14] perf tools: Create for_each_event macro for tracepoints iteration Arnaldo Carvalho de Melo
2017-02-01 12:25 ` [PATCH 14/14] perf ftrace: Add ftrace.tracer config option Arnaldo Carvalho de Melo
2017-02-01 14:35 ` [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2018-03-19 19:01 Arnaldo Carvalho de Melo
2018-03-19 19:39 ` Ingo Molnar
2016-04-19 15:50 Arnaldo Carvalho de Melo
2016-04-19 19:00 ` Ingo Molnar
2015-12-07 22:17 Arnaldo Carvalho de Melo
2015-12-08 4:24 ` Ingo Molnar
2015-08-17 19:11 Arnaldo Carvalho de Melo
2015-08-20 9:50 ` Ingo Molnar
2015-05-29 16:30 Arnaldo Carvalho de Melo
2015-05-29 18:20 ` Ingo Molnar
2014-06-12 15:30 Jiri Olsa
2014-06-12 20:55 ` Jean Pihet
2014-06-13 9:03 ` Jiri Olsa
2014-06-13 6:20 ` 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).