linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/27] perf/core improvements and fixes
@ 2016-09-29 14:35 Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 01/27] perf record: Fix documentation 'event_sources' -> 'event_source' Arnaldo Carvalho de Melo
                   ` (27 more replies)
  0 siblings, 28 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen, Anju T Sudhakar,
	Chong Jiang, Clark Williams, Daniel Bristot de Oliveira,
	David Ahern, Jiri Olsa, Josh Poimboeuf, linux-arm-kernel,
	linuxppc-dev, Masami Hiramatsu, Mathieu Poirier, Matt Fleming,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra, pi3orama,
	Ravi Bangoria, Simon Que, Steven Rostedt, Thomas Gleixner,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, more to come soon,

- Arnaldo

Build and test results at the end of this message.

The following changes since commit 6b652de2b27c0a4020ce0e8f277e782b6af76096:

  Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-23 07:21:38 +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-20160929

for you to fetch changes up to d18019a53a07e009899ff6b8dc5ec30f249360d9:

  perf tests: Add dwarf unwind test for powerpc (2016-09-29 11:18:21 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:
-------------

New features:

- Add support for using symbols in address filters with Intel PT and ARM
  CoreSight (hardware assisted tracing facilities) (Adrian Hunter, Mathieu Poirier)

Fixes:

- Fix MMAP event synthesis for pre-existing threads when no hugetlbfs
  mount is in place (Adrian Hunter)

- Don't ignore kernel idle symbols in 'perf script' (Adrian Hunter)

- Assorted Intel PT fixes (Adrian Hunter)

Improvements:

- Fix handling of C++ symbols in 'perf probe' (Masami Hiramatsu)

- Beautify sched_[gs]et_attr return value in 'perf trace' (Arnaldo Carvalho de Melo)

Infrastructure:
---------------

New features:

- Add dwarf unwind 'perf test' for powerpc (Ravi Bangoria)

Fixes:

- Fix error paths in 'perf record' (Adrian Hunter)

Documentation:

- Update documentation info about quipper, a C++ parser for converting
  to/from perf.data/chromium profiling format (Simon Que)

Build Fixes:

  Fix building in 32 bit platform with libbabeltrace (Wang Nan)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (16):
      perf record: Fix documentation 'event_sources' -> 'event_source'
      perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
      perf script: Fix vanished idle symbols
      perf record: Rename label 'out_symbol_exit'
      perf record: Fix error paths
      perf symbols: Add dso__last_symbol()
      perf record: Add support for using symbols in address filters
      perf probe: Increase debug level of SDT debug messages
      perf intel-pt: Fix snapshot overlap detection decoder errors
      perf intel-pt: Add support for recording the max non-turbo ratio
      perf intel-pt: Fix missing error codes processing auxtrace_info
      perf intel-pt: Add a helper function for processing AUXTRACE_INFO
      perf intel-pt: Record address filter in AUXTRACE_INFO event
      perf intel-pt: Read address filter from AUXTRACE_INFO event
      perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
      perf intel-pt: Fix decoding when there are address filters

Arnaldo Carvalho de Melo (1):
      perf trace: Beautify sched_[gs]et_attr return value

Masami Hiramatsu (4):
      perf probe: Ignore the error of finding inline instance
      perf probe: Skip if the function address is 0
      perf probe: Fix to cut off incompatible chars from group name
      perf probe: Match linkage name with mangled name

Mathieu Poirier (3):
      perf tools: Make perf_evsel__append_filter() generic
      perf evsel: New tracepoint specific function
      perf evsel: Add support for address filters

Ravi Bangoria (1):
      perf tests: Add dwarf unwind test for powerpc

Simon Que (1):
      perf tools: Update documentation info about quipper

Wang Nan (1):
      perf data: Fix building in 32 bit platform with libbabeltrace

 tools/perf/Documentation/perf-record.txt           |  61 +-
 tools/perf/Documentation/perf.data-file-format.txt |   6 +-
 tools/perf/arch/powerpc/Build                      |   1 +
 tools/perf/arch/powerpc/include/arch-tests.h       |  13 +
 tools/perf/arch/powerpc/include/perf_regs.h        |   2 +
 tools/perf/arch/powerpc/tests/Build                |   4 +
 tools/perf/arch/powerpc/tests/arch-tests.c         |  15 +
 tools/perf/arch/powerpc/tests/dwarf-unwind.c       |  62 ++
 tools/perf/arch/powerpc/tests/regs_load.S          |  94 +++
 tools/perf/arch/x86/util/intel-pt.c                |  57 +-
 tools/perf/builtin-record.c                        |  32 +-
 tools/perf/builtin-trace.c                         |  10 +-
 tools/perf/tests/Build                             |   2 +-
 tools/perf/tests/dwarf-unwind.c                    |   2 +-
 tools/perf/util/auxtrace.c                         | 737 +++++++++++++++++++++
 tools/perf/util/auxtrace.h                         |  54 ++
 tools/perf/util/build-id.c                         |   4 +-
 tools/perf/util/data-convert-bt.c                  |   2 +-
 tools/perf/util/dwarf-aux.c                        |  28 +-
 tools/perf/util/dwarf-aux.h                        |   3 +
 tools/perf/util/event.c                            |   3 +-
 tools/perf/util/evsel.c                            |  16 +-
 tools/perf/util/evsel.h                            |   5 +-
 tools/perf/util/evsel_fprintf.c                    |   7 +-
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |  30 +
 .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |   1 +
 tools/perf/util/intel-pt.c                         | 172 ++++-
 tools/perf/util/intel-pt.h                         |   4 +-
 tools/perf/util/parse-events.c                     |  41 +-
 tools/perf/util/probe-event.c                      |  10 +-
 tools/perf/util/probe-file.c                       |   2 +-
 tools/perf/util/probe-finder.c                     |  17 +-
 tools/perf/util/symbol.c                           |  15 +
 tools/perf/util/symbol.h                           |   1 +
 34 files changed, 1451 insertions(+), 62 deletions(-)
 create mode 100644 tools/perf/arch/powerpc/include/arch-tests.h
 create mode 100644 tools/perf/arch/powerpc/tests/Build
 create mode 100644 tools/perf/arch/powerpc/tests/arch-tests.c
 create mode 100644 tools/perf/arch/powerpc/tests/dwarf-unwind.c
 create mode 100644 tools/perf/arch/powerpc/tests/regs_load.S

  # time dm
   1  alpine:3.4: Ok
   2 android-ndk:r12b-arm: Ok
   3 archlinux:latest: Ok
   4 centos:5: Ok
   5 centos:6: Ok
   6 centos:7: Ok
   7 debian:7: Ok
   8 debian:8: Ok
   9 debian:experimental: Ok
  10 fedora:20: Ok
  11 fedora:21: Ok
  12 fedora:22: Ok
  13 fedora:23: Ok
  14 fedora:24: Ok
  15 fedora:24-x-ARC-uClibc: Ok
  16 fedora:rawhide: Ok
  17 mageia:5: Ok
  18 opensuse:13.2: Ok
  19 opensuse:42.1: Ok
  20 opensuse:tumbleweed: Ok
  21 ubuntu:12.04.5: Ok
  22 ubuntu:14.04: Ok
  23 ubuntu:14.04.4: Ok
  24 ubuntu:15.10: Ok
  25 ubuntu:16.04: Ok
  26 ubuntu:16.04-x-arm: Ok
  27 ubuntu:16.04-x-arm64: Ok
  28 ubuntu:16.04-x-powerpc: Ok
  29 ubuntu:16.04-x-powerpc64: Ok
  30 ubuntu:16.04-x-powerpc64el: Ok
  31 ubuntu:16.04-x-s390: Ok
  32 ubuntu:16.10: Ok
  33 2246.21

  real	37m26.862s
  user	0m2.148s
  sys	0m2.256s
  # 

  # 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 events tests                                       : Ok
   6: Validate PERF_RECORD_* events & perf_sample fields       : Ok
   7: Test perf pmu format parsing                             : Ok
   8: Test dso data read                                       : Ok
   9: Test dso data cache                                      : Ok
  10: Test dso data reopen                                     : Ok
  11: roundtrip evsel->name check                              : Ok
  12: Check parsing of sched tracepoints fields                : Ok
  13: Generate and check syscalls:sys_enter_openat event fields: Ok
  14: struct perf_event_attr setup                             : Ok
  15: Test matching and linking multiple hists                 : Ok
  16: Try 'import perf' in python, checking link problems      : Ok
  17: Test breakpoint overflow signal handler                  : Ok
  18: Test breakpoint overflow sampling                        : Ok
  19: Test number of exit event of a simple workload           : Ok
  20: Test software clock events have valid period values      : Ok
  21: Test object code reading                                 : Ok
  22: Test sample parsing                                      : Ok
  23: Test using a dummy software event to keep tracking       : Ok
  24: Test parsing with no sample_id_all bit set               : Ok
  25: Test filtering hist entries                              : Ok
  26: Test mmap thread lookup                                  : Ok
  27: Test thread mg sharing                                   : Ok
  28: Test output sorting of hist entries                      : Ok
  29: Test cumulation of child hist entries                    : Ok
  30: Test tracking 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: Test kmod_path__parse function                           : Ok
  34: Test thread map                                          : Ok
  35: Test LLVM searching and compiling                        :
  35.1: Basic BPF llvm compiling test                          : Ok
  35.2: Test kbuild searching                                  : Ok
  35.3: Compile source for BPF prologue generation test        : Ok
  35.4: Compile source for BPF relocation test                 : Ok
  36: Test topology in session                                 : Ok
  37: Test BPF filter                                          :
  37.1: Test basic BPF filtering                               : Ok
  37.2: Test BPF prologue generation                           : Ok
  37.3: Test BPF relocation checker                            : Ok
  38: Test thread map synthesize                               : Ok
  39: Test cpu map synthesize                                  : Ok
  40: Test stat config synthesize                              : Ok
  41: Test stat synthesize                                     : Ok
  42: Test stat round synthesize                               : Ok
  43: Test attr update synthesize                              : Ok
  44: Test events times                                        : Ok
  45: Test backward reading from ring buffer                   : Ok
  46: Test cpu map print                                       : Ok
  47: Test SDT event probing                                   : Ok
  48: Test is_printable_array function                         : Ok
  49: Test bitmap print                                        : Ok
  50: x86 rdpmc test                                           : Ok
  51: Test converting perf time to TSC                         : Ok
  52: Test dwarf unwind                                        : Ok
  53: Test x86 instruction decoder - new instructions          : Ok
  54: Test intel cqm nmi context read                          : Skip
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
                        tarpkg: ./tests/perf-targz-src-pkg .
                  make_debug_O: make DEBUG=1
             make_no_libnuma_O: make NO_LIBNUMA=1
               make_no_slang_O: make NO_SLANG=1
            make_no_libaudit_O: make NO_LIBAUDIT=1
              make_no_libbpf_O: make NO_LIBBPF=1
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
                   make_tags_O: make tags
                    make_doc_O: make doc
           make_no_libunwind_O: make NO_LIBUNWIND=1
            make_install_bin_O: make install-bin
           make_no_libbionic_O: make NO_LIBBIONIC=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
            make_no_demangle_O: make NO_DEMANGLE=1
                 make_perf_o_O: make perf.o
            make_no_auxtrace_O: make NO_AUXTRACE=1
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
                   make_pure_O: make
             make_util_map_o_O: make util/map.o
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
                make_no_newt_O: make NO_NEWT=1
           make_no_libpython_O: make NO_LIBPYTHON=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
                   make_help_O: make help
         make_install_prefix_O: make install prefix=/tmp/krava
                 make_static_O: make LDFLAGS=-static
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
           make_no_backtrace_O: make NO_BACKTRACE=1
              make_clean_all_O: make clean all
                make_install_O: make install
              make_no_libelf_O: make NO_LIBELF=1
             make_no_libperl_O: make NO_LIBPERL=1
                make_no_gtk2_O: make NO_GTK2=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
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 01/27] perf record: Fix documentation 'event_sources' -> 'event_source'
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 02/27] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change Arnaldo Carvalho de Melo
                   ` (26 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Change '/sys/bus/event_sources' to the correct path which is
'/sys/bus/event_source'.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-record.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 1a24f4d64328..babbb63e6d9d 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -35,15 +35,15 @@ OPTIONS
 
 	- a symbolically formed PMU event like 'pmu/param1=0x3,param2/' where
 	  'param1', 'param2', etc are defined as formats for the PMU in
-	  /sys/bus/event_sources/devices/<pmu>/format/*.
+	  /sys/bus/event_source/devices/<pmu>/format/*.
 
 	- a symbolically formed event like 'pmu/config=M,config1=N,config3=K/'
 
           where M, N, K are numbers (in decimal, hex, octal format). Acceptable
           values for each of 'config', 'config1' and 'config2' are defined by
-          corresponding entries in /sys/bus/event_sources/devices/<pmu>/format/*
+          corresponding entries in /sys/bus/event_source/devices/<pmu>/format/*
           param1 and param2 are defined as formats for the PMU in:
-          /sys/bus/event_sources/devices/<pmu>/format/*
+          /sys/bus/event_source/devices/<pmu>/format/*
 
 	  There are also some params which are not defined in .../<pmu>/format/*.
 	  These params can be used to overload default config values per event.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 02/27] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 01/27] perf record: Fix documentation 'event_sources' -> 'event_source' Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 03/27] perf data: Fix building in 32 bit platform with libbabeltrace Arnaldo Carvalho de Melo
                   ` (25 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Patch "perf record: Mark MAP_HUGETLB when synthesizing mmap events") breaks
MMAP event synthesis.  The executable name comparison will match any name
if the length is zero, resulting in all the user space maps becoming
anonymous.  This is particularly noticeable with system-wide traces.
Example:

	perf record -a sleep 1
	perf script --show-mmap-events

Committer note:

That is not the case when, say, one has a qemu instance and libvirt actually
mounts hugetlbfs. To test this I had to first umount it:

[root@jouet ~]# mount | grep hugetlbfs
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)
[root@jouet ~]#

After unmount it the error fixed by this patch manifests itself:

  # perf record -a sleep 1
  # perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp //anon
  #

Fixed version:

  # perf record -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.419 MB perf.data (182 samples) ]
  # perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp /usr/lib/systemd/systemd
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp /usr/lib64/libuuid.so.1.3.0
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp /usr/lib64/libblkid.so.1.1.0
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp /usr/lib64/libz.so.1.2.8
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp /usr/lib64/liblzma.so.5.2.2
[root@jouet ~]#

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2880e2226fdb..8ab0d7da956b 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -346,7 +346,8 @@ out:
 		if (!strcmp(execname, ""))
 			strcpy(execname, anonstr);
 
-		if (!strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
+		if (hugetlbfs_mnt_len &&
+		    !strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
 			strcpy(execname, anonstr);
 			event->mmap2.flags |= MAP_HUGETLB;
 		}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 03/27] perf data: Fix building in 32 bit platform with libbabeltrace
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 01/27] perf record: Fix documentation 'event_sources' -> 'event_source' Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 02/27] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 04/27] perf trace: Beautify sched_[gs]et_attr return value Arnaldo Carvalho de Melo
                   ` (24 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Wang Nan, Jiri Olsa, Zefan Li,
	pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

On ARM32 building it report following error when we build with
libbabeltrace:

  util/data-convert-bt.c: In function 'add_bpf_output_values':
  util/data-convert-bt.c:440:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
  cc1: all warnings being treated as errors

Fix it by changing %lu to %zu.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Fixes: 6122d57e9f7c ("perf data: Support converting data from bpf_perf_event_output()")
Link: http://lkml.kernel.org/r/1475035126-146587-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/data-convert-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 4f979bb27b6c..7123f4de32cc 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -437,7 +437,7 @@ add_bpf_output_values(struct bt_ctf_event_class *event_class,
 	int ret;
 
 	if (nr_elements * sizeof(u32) != raw_size)
-		pr_warning("Incorrect raw_size (%u) in bpf output event, skip %lu bytes\n",
+		pr_warning("Incorrect raw_size (%u) in bpf output event, skip %zu bytes\n",
 			   raw_size, nr_elements * sizeof(u32) - raw_size);
 
 	len_type = bt_ctf_event_class_get_field_by_name(event_class, "raw_len");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 04/27] perf trace: Beautify sched_[gs]et_attr return value
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 03/27] perf data: Fix building in 32 bit platform with libbabeltrace Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 05/27] perf tools: Update documentation info about quipper Arnaldo Carvalho de Melo
                   ` (23 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Arnaldo Carvalho de Melo,
	Adrian Hunter, Clark Williams, Daniel Bristot de Oliveira,
	David Ahern, Jiri Olsa, Namhyung Kim, Steven Rostedt, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Both return errno, show the string associated then.

More work needed to capture the sched_attr arg to beautify it in turn,
probably using BPF.

Before:

     0.210 ( 0.001 ms): sched_setattr(uattr: 0x7ffc684f02b0) = -22

After the patch, for this sched_attr, all other parms are zero, so not
shown:

        struct sched_attr attr = {
                .size           = sizeof(attr),
                .sched_policy   = SCHED_DEADLINE,
                .sched_runtime  = 10 * USECS_PER_SEC,
                .sched_period   = 30 * USECS_PER_SEC,
                .sched_deadline = attr.sched_period,
        };

     0.321 ( 0.002 ms): sched_setattr(uattr: 0x7ffc44116da0) = -1 EINVAL Invalid argument

  [root@jouet c]# perf trace -e sched_setattr ./sched_deadline
  Couldn't negotiate deadline: Invalid argument
     0.229 ( 0.003 ms): sched_setattr(uattr: 0x7ffd8dcd8df0) = -1 EINVAL Invalid argument
  [root@jouet c]#

Now to figure out the reason for this EINVAL.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-tyot2n7e48zm8pdw8tbcm3sl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index b4fc1ab3d2a7..1a54ce9d101c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -742,6 +742,8 @@ static struct syscall_fmt {
 	  .arg_scnprintf = { [1] = SCA_SIGNUM, /* sig */ }, },
 	{ .name	    = "rt_tgsigqueueinfo", .errmsg = true,
 	  .arg_scnprintf = { [2] = SCA_SIGNUM, /* sig */ }, },
+	{ .name	    = "sched_getattr",	      .errmsg = true, },
+	{ .name	    = "sched_setattr",	      .errmsg = true, },
 	{ .name	    = "sched_setscheduler",   .errmsg = true,
 	  .arg_scnprintf = { [1] = SCA_SCHED_POLICY, /* policy */ }, },
 	{ .name	    = "seccomp", .errmsg = true,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 05/27] perf tools: Update documentation info about quipper
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 04/27] perf trace: Beautify sched_[gs]et_attr return value Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 06/27] perf tools: Make perf_evsel__append_filter() generic Arnaldo Carvalho de Melo
                   ` (22 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Simon Que, Adrian Hunter,
	Chong Jiang, Arnaldo Carvalho de Melo

From: Simon Que <sque@chromium.org>

The existing link is outdated. The most recent quipper code can be found at the
new URL.

Committer notes:

Quipper is a C++ parser that can be used to convert from a perf.data
file to and from a protobuf, a Chromium OS facility.

Signed-off-by: Simon Que <sque@chromium.org>
Acked-by: Andi Kleen <ak@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Chong Jiang <chongjiang@chromium.org>
Link: http://lkml.kernel.org/n/tip-4q1nm7jl3vovp66p5bki20pq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf.data-file-format.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt
index fdc99fe6bbc3..b664b18d3991 100644
--- a/tools/perf/Documentation/perf.data-file-format.txt
+++ b/tools/perf/Documentation/perf.data-file-format.txt
@@ -437,6 +437,10 @@ in pmu-tools parser. This allows to read perf.data from python and dump it.
 quipper
 
 The quipper C++ parser is available at
-https://chromium.googlesource.com/chromiumos/platform/chromiumos-wide-profiling/
+https://chromium.googlesource.com/chromiumos/platform2
+
+It is under the chromiumos-wide-profiling/ subdirectory. This library can
+convert a perf data file to a protobuf and vice versa.
+
 Unfortunately this parser tends to be many versions behind and may not be able
 to parse data files generated by recent perf.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 06/27] perf tools: Make perf_evsel__append_filter() generic
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 05/27] perf tools: Update documentation info about quipper Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 07/27] perf evsel: New tracepoint specific function Arnaldo Carvalho de Melo
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Mathieu Poirier,
	Alexander Shishkin, Jiri Olsa, Peter Zijlstra, linux-arm-kernel,
	Arnaldo Carvalho de Melo

From: Mathieu Poirier <mathieu.poirier@linaro.org>

By making function perf_evsel__append_filter() take a format rather than
an operator it is possible to reuse the code for other purposes (ex.
Intel PT and CoreSight) than tracepoints.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c     | 9 +++++++--
 tools/perf/util/evsel.c        | 4 ++--
 tools/perf/util/evsel.h        | 2 +-
 tools/perf/util/parse-events.c | 4 ++--
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 1a54ce9d101c..e04ba9d852d4 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2143,6 +2143,7 @@ out_delete_sys_enter:
 static int trace__set_ev_qualifier_filter(struct trace *trace)
 {
 	int err = -1;
+	struct perf_evsel *sys_exit;
 	char *filter = asprintf_expr_inout_ints("id", !trace->not_ev_qualifier,
 						trace->ev_qualifier_ids.nr,
 						trace->ev_qualifier_ids.entries);
@@ -2150,8 +2151,12 @@ static int trace__set_ev_qualifier_filter(struct trace *trace)
 	if (filter == NULL)
 		goto out_enomem;
 
-	if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter, "&&", filter))
-		err = perf_evsel__append_filter(trace->syscalls.events.sys_exit, "&&", filter);
+	if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter,
+				       "(%s) && (%s)", filter)) {
+		sys_exit = trace->syscalls.events.sys_exit;
+		err = perf_evsel__append_filter(sys_exit,
+						"(%s) && (%s)", filter);
+	}
 
 	free(filter);
 out:
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f3225a2e6eee..4f327b522e5c 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1046,14 +1046,14 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
 }
 
 int perf_evsel__append_filter(struct perf_evsel *evsel,
-			      const char *op, const char *filter)
+			      const char *fmt, const char *filter)
 {
 	char *new_filter;
 
 	if (evsel->filter == NULL)
 		return perf_evsel__set_filter(evsel, filter);
 
-	if (asprintf(&new_filter,"(%s) %s (%s)", evsel->filter, op, filter) > 0) {
+	if (asprintf(&new_filter, fmt, evsel->filter, filter) > 0) {
 		free(evsel->filter);
 		evsel->filter = new_filter;
 		return 0;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 323806082c58..7ef960298b3d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,7 +236,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
 
 int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
 int perf_evsel__append_filter(struct perf_evsel *evsel,
-			      const char *op, const char *filter);
+			      const char *fmt, const char *filter);
 int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
 			     const char *filter);
 int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2eb8b1ed4cc8..b14784c765eb 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
 		return -1;
 	}
 
-	if (perf_evsel__append_filter(evsel, "&&", str) < 0) {
+	if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
 		fprintf(stderr,
 			"not enough memory to hold filter string\n");
 		return -1;
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
 
 	snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
 
-	if (perf_evsel__append_filter(evsel, "&&", new_filter) < 0) {
+	if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
 		fprintf(stderr,
 			"not enough memory to hold filter string\n");
 		return -1;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 07/27] perf evsel: New tracepoint specific function
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 06/27] perf tools: Make perf_evsel__append_filter() generic Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 08/27] perf evsel: Add support for address filters Arnaldo Carvalho de Melo
                   ` (20 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Mathieu Poirier,
	Alexander Shishkin, Jiri Olsa, Peter Zijlstra, linux-arm-kernel,
	Arnaldo Carvalho de Melo

From: Mathieu Poirier <mathieu.poirier@linaro.org>

Making function perf_evsel__append_filter() static and introducing a new
tracepoint specific function to append filters.  That way we eliminate
redundant code and avoid formatting mistake.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-3-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c     | 7 +++----
 tools/perf/util/evsel.c        | 9 +++++++--
 tools/perf/util/evsel.h        | 3 +--
 tools/perf/util/parse-events.c | 4 ++--
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index e04ba9d852d4..c298bd3e1d90 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2151,11 +2151,10 @@ static int trace__set_ev_qualifier_filter(struct trace *trace)
 	if (filter == NULL)
 		goto out_enomem;
 
-	if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter,
-				       "(%s) && (%s)", filter)) {
+	if (!perf_evsel__append_tp_filter(trace->syscalls.events.sys_enter,
+					  filter)) {
 		sys_exit = trace->syscalls.events.sys_exit;
-		err = perf_evsel__append_filter(sys_exit,
-						"(%s) && (%s)", filter);
+		err = perf_evsel__append_tp_filter(sys_exit, filter);
 	}
 
 	free(filter);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 4f327b522e5c..3b4e7c452e43 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1045,8 +1045,8 @@ int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
 	return -1;
 }
 
-int perf_evsel__append_filter(struct perf_evsel *evsel,
-			      const char *fmt, const char *filter)
+static int perf_evsel__append_filter(struct perf_evsel *evsel,
+				     const char *fmt, const char *filter)
 {
 	char *new_filter;
 
@@ -1062,6 +1062,11 @@ int perf_evsel__append_filter(struct perf_evsel *evsel,
 	return -1;
 }
 
+int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
+{
+	return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
+}
+
 int perf_evsel__enable(struct perf_evsel *evsel)
 {
 	int nthreads = thread_map__nr(evsel->threads);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 7ef960298b3d..1f8c48f87f7d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -235,8 +235,7 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
 			       bool use_sample_identifier);
 
 int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
-int perf_evsel__append_filter(struct perf_evsel *evsel,
-			      const char *fmt, const char *filter);
+int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
 int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
 			     const char *filter);
 int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index b14784c765eb..16bf09cc3e8d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
 		return -1;
 	}
 
-	if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
+	if (perf_evsel__append_tp_filter(evsel, str) < 0) {
 		fprintf(stderr,
 			"not enough memory to hold filter string\n");
 		return -1;
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
 
 	snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
 
-	if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
+	if (perf_evsel__append_tp_filter(evsel, new_filter) < 0) {
 		fprintf(stderr,
 			"not enough memory to hold filter string\n");
 		return -1;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 08/27] perf evsel: Add support for address filters
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 07/27] perf evsel: New tracepoint specific function Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 09/27] perf script: Fix vanished idle symbols Arnaldo Carvalho de Melo
                   ` (19 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Mathieu Poirier,
	Alexander Shishkin, Jiri Olsa, Peter Zijlstra, linux-arm-kernel,
	Arnaldo Carvalho de Melo

From: Mathieu Poirier <mathieu.poirier@linaro.org>

This patch makes it possible to use the current filter framework with
address filters.  That way address filters for HW tracers such as
CoreSight and Intel PT can be communicated to the kernel drivers.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-4-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c        |  5 +++++
 tools/perf/util/evsel.h        |  2 ++
 tools/perf/util/parse-events.c | 39 ++++++++++++++++++++++++++++++++++-----
 3 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 3b4e7c452e43..380e84c3af3d 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1067,6 +1067,11 @@ int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter)
 	return perf_evsel__append_filter(evsel, "(%s) && (%s)", filter);
 }
 
+int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter)
+{
+	return perf_evsel__append_filter(evsel, "%s,%s", filter);
+}
+
 int perf_evsel__enable(struct perf_evsel *evsel)
 {
 	int nthreads = thread_map__nr(evsel->threads);
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 1f8c48f87f7d..b1503b0ecdff 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,6 +236,8 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel,
 
 int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter);
 int perf_evsel__append_tp_filter(struct perf_evsel *evsel, const char *filter);
+int perf_evsel__append_addr_filter(struct perf_evsel *evsel,
+				   const char *filter);
 int perf_evsel__apply_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
 			     const char *filter);
 int perf_evsel__enable(struct perf_evsel *evsel);
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 16bf09cc3e8d..33546c3ac1fe 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1760,20 +1760,49 @@ foreach_evsel_in_last_glob(struct perf_evlist *evlist,
 static int set_filter(struct perf_evsel *evsel, const void *arg)
 {
 	const char *str = arg;
+	bool found = false;
+	int nr_addr_filters = 0;
+	struct perf_pmu *pmu = NULL;
 
-	if (evsel == NULL || evsel->attr.type != PERF_TYPE_TRACEPOINT) {
-		fprintf(stderr,
-			"--filter option should follow a -e tracepoint option\n");
-		return -1;
+	if (evsel == NULL)
+		goto err;
+
+	if (evsel->attr.type == PERF_TYPE_TRACEPOINT) {
+		if (perf_evsel__append_tp_filter(evsel, str) < 0) {
+			fprintf(stderr,
+				"not enough memory to hold filter string\n");
+			return -1;
+		}
+
+		return 0;
 	}
 
-	if (perf_evsel__append_tp_filter(evsel, str) < 0) {
+	while ((pmu = perf_pmu__scan(pmu)) != NULL)
+		if (pmu->type == evsel->attr.type) {
+			found = true;
+			break;
+		}
+
+	if (found)
+		perf_pmu__scan_file(pmu, "nr_addr_filters",
+				    "%d", &nr_addr_filters);
+
+	if (!nr_addr_filters)
+		goto err;
+
+	if (perf_evsel__append_addr_filter(evsel, str) < 0) {
 		fprintf(stderr,
 			"not enough memory to hold filter string\n");
 		return -1;
 	}
 
 	return 0;
+
+err:
+	fprintf(stderr,
+		"--filter option should follow a -e tracepoint or HW tracer option\n");
+
+	return -1;
 }
 
 int parse_filter(const struct option *opt, const char *str,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 09/27] perf script: Fix vanished idle symbols
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 08/27] perf evsel: Add support for address filters Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 10/27] perf record: Rename label 'out_symbol_exit' Arnaldo Carvalho de Melo
                   ` (18 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Commit 608c34de0b3d ("perf symbols: Mark if a symbol is idle in the
library") causes idle symbols to vanish from perf script output. That is
because print functions suppress symbols marked as 'idle'.

However, suppression of 'idle' functions is only used by 'perf top' and
'perf top' does not use the print functions.  Consequently that
functionality can simply be removed from the print functions.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Fixes: 608c34de0b3d ("perf symbols: Mark if a symbol is idle in the library")
Link: http://lkml.kernel.org/r/1474641528-18776-4-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel_fprintf.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index 9111e0666950..662a0a6182e7 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -122,9 +122,6 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
 			if (!node)
 				break;
 
-			if (node->sym && node->sym->idle)
-				goto next;
-
 			printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " ");
 
 			if (print_ip)
@@ -158,7 +155,7 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
 
 			if (!print_oneline)
 				printed += fprintf(fp, "\n");
-next:
+
 			callchain_cursor_advance(cursor);
 		}
 	}
@@ -181,7 +178,7 @@ int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
 	if (cursor != NULL) {
 		printed += sample__fprintf_callchain(sample, left_alignment,
 						     print_opts, cursor, fp);
-	} else if (!(al->sym && al->sym->idle)) {
+	} else {
 		printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " ");
 
 		if (print_ip)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 10/27] perf record: Rename label 'out_symbol_exit'
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 09/27] perf script: Fix vanished idle symbols Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 11/27] perf record: Fix error paths Arnaldo Carvalho de Melo
                   ` (17 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

In preparation for fixing the error paths, rename label
'out_symbol_exit' to be 'out' because that error path can be used
irrespective of whether symbols (or anything else) has been initialized.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-5-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 2d0d69be3bf8..b32a880ec473 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1643,7 +1643,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (rec->evlist->nr_entries == 0 &&
 	    perf_evlist__add_default(rec->evlist) < 0) {
 		pr_err("Not enough memory for event selector list\n");
-		goto out_symbol_exit;
+		goto out;
 	}
 
 	if (rec->opts.target.tid && !rec->opts.no_inherit_set)
@@ -1663,7 +1663,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 		ui__error("%s", errbuf);
 
 		err = -saved_errno;
-		goto out_symbol_exit;
+		goto out;
 	}
 
 	err = -ENOMEM;
@@ -1672,7 +1672,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 
 	err = auxtrace_record__options(rec->itr, rec->evlist, &rec->opts);
 	if (err)
-		goto out_symbol_exit;
+		goto out;
 
 	/*
 	 * We take all buildids when the file contains
@@ -1684,11 +1684,11 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 
 	if (record_opts__config(&rec->opts)) {
 		err = -EINVAL;
-		goto out_symbol_exit;
+		goto out;
 	}
 
 	err = __cmd_record(&record, argc, argv);
-out_symbol_exit:
+out:
 	perf_evlist__delete(rec->evlist);
 	symbol__exit();
 	auxtrace_record__free(rec->itr);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 11/27] perf record: Fix error paths
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 10/27] perf record: Rename label 'out_symbol_exit' Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 12/27] perf symbols: Add dso__last_symbol() Arnaldo Carvalho de Melo
                   ` (16 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Some error paths do not tidy-up. Fix that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-6-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index b32a880ec473..962adcfc43a5 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1573,23 +1573,23 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (!rec->itr) {
 		rec->itr = auxtrace_record__init(rec->evlist, &err);
 		if (err)
-			return err;
+			goto out;
 	}
 
 	err = auxtrace_parse_snapshot_options(rec->itr, &rec->opts,
 					      rec->opts.auxtrace_snapshot_opts);
 	if (err)
-		return err;
+		goto out;
 
 	if (dry_run)
-		return 0;
+		goto out;
 
 	err = bpf__setup_stdout(rec->evlist);
 	if (err) {
 		bpf__strerror_setup_stdout(rec->evlist, err, errbuf, sizeof(errbuf));
 		pr_err("ERROR: Setup BPF stdout failed: %s\n",
 			 errbuf);
-		return err;
+		goto out;
 	}
 
 	err = -ENOMEM;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 12/27] perf symbols: Add dso__last_symbol()
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 11/27] perf record: Fix error paths Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 13/27] perf record: Add support for using symbols in address filters Arnaldo Carvalho de Melo
                   ` (15 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Add a function to find the last symbol in a DSO. This will be used when
parsing address filters to calculate a region that includes the entire
DSO.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c | 15 +++++++++++++++
 tools/perf/util/symbol.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 19c9c558454f..aecff69a510d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -345,6 +345,16 @@ static struct symbol *symbols__first(struct rb_root *symbols)
 	return NULL;
 }
 
+static struct symbol *symbols__last(struct rb_root *symbols)
+{
+	struct rb_node *n = rb_last(symbols);
+
+	if (n)
+		return rb_entry(n, struct symbol, rb_node);
+
+	return NULL;
+}
+
 static struct symbol *symbols__next(struct symbol *sym)
 {
 	struct rb_node *n = rb_next(&sym->rb_node);
@@ -466,6 +476,11 @@ struct symbol *dso__first_symbol(struct dso *dso, enum map_type type)
 	return symbols__first(&dso->symbols[type]);
 }
 
+struct symbol *dso__last_symbol(struct dso *dso, enum map_type type)
+{
+	return symbols__last(&dso->symbols[type]);
+}
+
 struct symbol *dso__next_symbol(struct symbol *sym)
 {
 	return symbols__next(sym);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 0dacfb7d5b67..d964844eb314 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -259,6 +259,7 @@ struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
 struct symbol *symbol__next_by_name(struct symbol *sym);
 
 struct symbol *dso__first_symbol(struct dso *dso, enum map_type type);
+struct symbol *dso__last_symbol(struct dso *dso, enum map_type type);
 struct symbol *dso__next_symbol(struct symbol *sym);
 
 enum dso_type dso__type_fd(int fd);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 13/27] perf record: Add support for using symbols in address filters
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 12/27] perf symbols: Add dso__last_symbol() Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 14/27] perf probe: Increase debug level of SDT debug messages Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Symbols come from either the DSO or /proc/kallsyms for the kernel.
Details of the functionality can be found in Documentation/perf-record.txt.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-8-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-record.txt |  55 ++-
 tools/perf/builtin-record.c              |  14 +-
 tools/perf/util/auxtrace.c               | 737 +++++++++++++++++++++++++++++++
 tools/perf/util/auxtrace.h               |  54 +++
 4 files changed, 857 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index babbb63e6d9d..92335193dc33 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -89,9 +89,62 @@ OPTIONS
 
 --filter=<filter>::
         Event filter. This option should follow a event selector (-e) which
-	selects tracepoint event(s). Multiple '--filter' options are combined
+	selects either tracepoint event(s) or a hardware trace PMU
+	(e.g. Intel PT or CoreSight).
+
+	- tracepoint filters
+
+	In the case of tracepoints, multiple '--filter' options are combined
 	using '&&'.
 
+	- address filters
+
+	A hardware trace PMU advertises its ability to accept a number of
+	address filters	by specifying a non-zero value in
+	/sys/bus/event_source/devices/<pmu>/nr_addr_filters.
+
+	Address filters have the format:
+
+	filter|start|stop|tracestop <start> [/ <size>] [@<file name>]
+
+	Where:
+	- 'filter': defines a region that will be traced.
+	- 'start': defines an address at which tracing will begin.
+	- 'stop': defines an address at which tracing will stop.
+	- 'tracestop': defines a region in which tracing will stop.
+
+	<file name> is the name of the object file, <start> is the offset to the
+	code to trace in that file, and <size> is the size of the region to
+	trace. 'start' and 'stop' filters need not specify a <size>.
+
+	If no object file is specified then the kernel is assumed, in which case
+	the start address must be a current kernel memory address.
+
+	<start> can also be specified by providing the name of a symbol. If the
+	symbol name is not unique, it can be disambiguated by inserting #n where
+	'n' selects the n'th symbol in address order. Alternately #0, #g or #G
+	select only a global symbol. <size> can also be specified by providing
+	the name of a symbol, in which case the size is calculated to the end
+	of that symbol. For 'filter' and 'tracestop' filters, if <size> is
+	omitted and <start> is a symbol, then the size is calculated to the end
+	of that symbol.
+
+	If <size> is omitted and <start> is '*', then the start and size will
+	be calculated from the first and last symbols, i.e. to trace the whole
+	file.
+
+	If symbol names (or '*') are provided, they must be surrounded by white
+	space.
+
+	The filter passed to the kernel is not necessarily the same as entered.
+	To see the filter that is passed, use the -v option.
+
+	The kernel may not be able to configure a trace region if it is not
+	within a single mapping.  MMAP events (or /proc/<pid>/maps) can be
+	examined to determine if that is a possibility.
+
+	Multiple filters can be separated with space or comma.
+
 --exclude-perf::
 	Don't record events issued by perf itself. This option should follow
 	a event selector (-e) which selects tracepoint event(s). It adds a
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 962adcfc43a5..67d2a9003294 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1581,6 +1581,18 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (err)
 		goto out;
 
+	/*
+	 * Allow aliases to facilitate the lookup of symbols for address
+	 * filters. Refer to auxtrace_parse_filters().
+	 */
+	symbol_conf.allow_aliases = true;
+
+	symbol__init(NULL);
+
+	err = auxtrace_parse_filters(rec->evlist);
+	if (err)
+		goto out;
+
 	if (dry_run)
 		goto out;
 
@@ -1594,8 +1606,6 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 
 	err = -ENOMEM;
 
-	symbol__init(NULL);
-
 	if (symbol_conf.kptr_restrict)
 		pr_warning(
 "WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n"
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index c0aba8e839aa..c5a6e0b12452 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -16,6 +16,10 @@
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <stdbool.h>
+#include <ctype.h>
+#include <string.h>
+#include <limits.h>
+#include <errno.h>
 
 #include <linux/kernel.h>
 #include <linux/perf_event.h>
@@ -35,9 +39,14 @@
 #include "../perf.h"
 #include "util.h"
 #include "evlist.h"
+#include "dso.h"
+#include "map.h"
+#include "pmu.h"
+#include "evsel.h"
 #include "cpumap.h"
 #include "thread_map.h"
 #include "asm/bug.h"
+#include "symbol/kallsyms.h"
 #include "auxtrace.h"
 
 #include <linux/hash.h>
@@ -1399,3 +1408,731 @@ void *auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key)
 
 	return NULL;
 }
+
+static void addr_filter__free_str(struct addr_filter *filt)
+{
+	free(filt->str);
+	filt->action   = NULL;
+	filt->sym_from = NULL;
+	filt->sym_to   = NULL;
+	filt->filename = NULL;
+	filt->str      = NULL;
+}
+
+static struct addr_filter *addr_filter__new(void)
+{
+	struct addr_filter *filt = zalloc(sizeof(*filt));
+
+	if (filt)
+		INIT_LIST_HEAD(&filt->list);
+
+	return filt;
+}
+
+static void addr_filter__free(struct addr_filter *filt)
+{
+	if (filt)
+		addr_filter__free_str(filt);
+	free(filt);
+}
+
+static void addr_filters__add(struct addr_filters *filts,
+			      struct addr_filter *filt)
+{
+	list_add_tail(&filt->list, &filts->head);
+	filts->cnt += 1;
+}
+
+static void addr_filters__del(struct addr_filters *filts,
+			      struct addr_filter *filt)
+{
+	list_del_init(&filt->list);
+	filts->cnt -= 1;
+}
+
+void addr_filters__init(struct addr_filters *filts)
+{
+	INIT_LIST_HEAD(&filts->head);
+	filts->cnt = 0;
+}
+
+void addr_filters__exit(struct addr_filters *filts)
+{
+	struct addr_filter *filt, *n;
+
+	list_for_each_entry_safe(filt, n, &filts->head, list) {
+		addr_filters__del(filts, filt);
+		addr_filter__free(filt);
+	}
+}
+
+static int parse_num_or_str(char **inp, u64 *num, const char **str,
+			    const char *str_delim)
+{
+	*inp += strspn(*inp, " ");
+
+	if (isdigit(**inp)) {
+		char *endptr;
+
+		if (!num)
+			return -EINVAL;
+		errno = 0;
+		*num = strtoull(*inp, &endptr, 0);
+		if (errno)
+			return -errno;
+		if (endptr == *inp)
+			return -EINVAL;
+		*inp = endptr;
+	} else {
+		size_t n;
+
+		if (!str)
+			return -EINVAL;
+		*inp += strspn(*inp, " ");
+		*str = *inp;
+		n = strcspn(*inp, str_delim);
+		if (!n)
+			return -EINVAL;
+		*inp += n;
+		if (**inp) {
+			**inp = '\0';
+			*inp += 1;
+		}
+	}
+	return 0;
+}
+
+static int parse_action(struct addr_filter *filt)
+{
+	if (!strcmp(filt->action, "filter")) {
+		filt->start = true;
+		filt->range = true;
+	} else if (!strcmp(filt->action, "start")) {
+		filt->start = true;
+	} else if (!strcmp(filt->action, "stop")) {
+		filt->start = false;
+	} else if (!strcmp(filt->action, "tracestop")) {
+		filt->start = false;
+		filt->range = true;
+		filt->action += 5; /* Change 'tracestop' to 'stop' */
+	} else {
+		return -EINVAL;
+	}
+	return 0;
+}
+
+static int parse_sym_idx(char **inp, int *idx)
+{
+	*idx = -1;
+
+	*inp += strspn(*inp, " ");
+
+	if (**inp != '#')
+		return 0;
+
+	*inp += 1;
+
+	if (**inp == 'g' || **inp == 'G') {
+		*inp += 1;
+		*idx = 0;
+	} else {
+		unsigned long num;
+		char *endptr;
+
+		errno = 0;
+		num = strtoul(*inp, &endptr, 0);
+		if (errno)
+			return -errno;
+		if (endptr == *inp || num > INT_MAX)
+			return -EINVAL;
+		*inp = endptr;
+		*idx = num;
+	}
+
+	return 0;
+}
+
+static int parse_addr_size(char **inp, u64 *num, const char **str, int *idx)
+{
+	int err = parse_num_or_str(inp, num, str, " ");
+
+	if (!err && *str)
+		err = parse_sym_idx(inp, idx);
+
+	return err;
+}
+
+static int parse_one_filter(struct addr_filter *filt, const char **filter_inp)
+{
+	char *fstr;
+	int err;
+
+	filt->str = fstr = strdup(*filter_inp);
+	if (!fstr)
+		return -ENOMEM;
+
+	err = parse_num_or_str(&fstr, NULL, &filt->action, " ");
+	if (err)
+		goto out_err;
+
+	err = parse_action(filt);
+	if (err)
+		goto out_err;
+
+	err = parse_addr_size(&fstr, &filt->addr, &filt->sym_from,
+			      &filt->sym_from_idx);
+	if (err)
+		goto out_err;
+
+	fstr += strspn(fstr, " ");
+
+	if (*fstr == '/') {
+		fstr += 1;
+		err = parse_addr_size(&fstr, &filt->size, &filt->sym_to,
+				      &filt->sym_to_idx);
+		if (err)
+			goto out_err;
+		filt->range = true;
+	}
+
+	fstr += strspn(fstr, " ");
+
+	if (*fstr == '@') {
+		fstr += 1;
+		err = parse_num_or_str(&fstr, NULL, &filt->filename, " ,");
+		if (err)
+			goto out_err;
+	}
+
+	fstr += strspn(fstr, " ,");
+
+	*filter_inp += fstr - filt->str;
+
+	return 0;
+
+out_err:
+	addr_filter__free_str(filt);
+
+	return err;
+}
+
+int addr_filters__parse_bare_filter(struct addr_filters *filts,
+				    const char *filter)
+{
+	struct addr_filter *filt;
+	const char *fstr = filter;
+	int err;
+
+	while (*fstr) {
+		filt = addr_filter__new();
+		err = parse_one_filter(filt, &fstr);
+		if (err) {
+			addr_filter__free(filt);
+			addr_filters__exit(filts);
+			return err;
+		}
+		addr_filters__add(filts, filt);
+	}
+
+	return 0;
+}
+
+struct sym_args {
+	const char	*name;
+	u64		start;
+	u64		size;
+	int		idx;
+	int		cnt;
+	bool		started;
+	bool		global;
+	bool		selected;
+	bool		duplicate;
+	bool		near;
+};
+
+static bool kern_sym_match(struct sym_args *args, const char *name, char type)
+{
+	/* A function with the same name, and global or the n'th found or any */
+	return symbol_type__is_a(type, MAP__FUNCTION) &&
+	       !strcmp(name, args->name) &&
+	       ((args->global && isupper(type)) ||
+		(args->selected && ++(args->cnt) == args->idx) ||
+		(!args->global && !args->selected));
+}
+
+static int find_kern_sym_cb(void *arg, const char *name, char type, u64 start)
+{
+	struct sym_args *args = arg;
+
+	if (args->started) {
+		if (!args->size)
+			args->size = start - args->start;
+		if (args->selected) {
+			if (args->size)
+				return 1;
+		} else if (kern_sym_match(args, name, type)) {
+			args->duplicate = true;
+			return 1;
+		}
+	} else if (kern_sym_match(args, name, type)) {
+		args->started = true;
+		args->start = start;
+	}
+
+	return 0;
+}
+
+static int print_kern_sym_cb(void *arg, const char *name, char type, u64 start)
+{
+	struct sym_args *args = arg;
+
+	if (kern_sym_match(args, name, type)) {
+		pr_err("#%d\t0x%"PRIx64"\t%c\t%s\n",
+		       ++args->cnt, start, type, name);
+		args->near = true;
+	} else if (args->near) {
+		args->near = false;
+		pr_err("\t\twhich is near\t\t%s\n", name);
+	}
+
+	return 0;
+}
+
+static int sym_not_found_error(const char *sym_name, int idx)
+{
+	if (idx > 0) {
+		pr_err("N'th occurrence (N=%d) of symbol '%s' not found.\n",
+		       idx, sym_name);
+	} else if (!idx) {
+		pr_err("Global symbol '%s' not found.\n", sym_name);
+	} else {
+		pr_err("Symbol '%s' not found.\n", sym_name);
+	}
+	pr_err("Note that symbols must be functions.\n");
+
+	return -EINVAL;
+}
+
+static int find_kern_sym(const char *sym_name, u64 *start, u64 *size, int idx)
+{
+	struct sym_args args = {
+		.name = sym_name,
+		.idx = idx,
+		.global = !idx,
+		.selected = idx > 0,
+	};
+	int err;
+
+	*start = 0;
+	*size = 0;
+
+	err = kallsyms__parse("/proc/kallsyms", &args, find_kern_sym_cb);
+	if (err < 0) {
+		pr_err("Failed to parse /proc/kallsyms\n");
+		return err;
+	}
+
+	if (args.duplicate) {
+		pr_err("Multiple kernel symbols with name '%s'\n", sym_name);
+		args.cnt = 0;
+		kallsyms__parse("/proc/kallsyms", &args, print_kern_sym_cb);
+		pr_err("Disambiguate symbol name by inserting #n after the name e.g. %s #2\n",
+		       sym_name);
+		pr_err("Or select a global symbol by inserting #0 or #g or #G\n");
+		return -EINVAL;
+	}
+
+	if (!args.started) {
+		pr_err("Kernel symbol lookup: ");
+		return sym_not_found_error(sym_name, idx);
+	}
+
+	*start = args.start;
+	*size = args.size;
+
+	return 0;
+}
+
+static int find_entire_kern_cb(void *arg, const char *name __maybe_unused,
+			       char type, u64 start)
+{
+	struct sym_args *args = arg;
+
+	if (!symbol_type__is_a(type, MAP__FUNCTION))
+		return 0;
+
+	if (!args->started) {
+		args->started = true;
+		args->start = start;
+	}
+	/* Don't know exactly where the kernel ends, so we add a page */
+	args->size = round_up(start, page_size) + page_size - args->start;
+
+	return 0;
+}
+
+static int addr_filter__entire_kernel(struct addr_filter *filt)
+{
+	struct sym_args args = { .started = false };
+	int err;
+
+	err = kallsyms__parse("/proc/kallsyms", &args, find_entire_kern_cb);
+	if (err < 0 || !args.started) {
+		pr_err("Failed to parse /proc/kallsyms\n");
+		return err;
+	}
+
+	filt->addr = args.start;
+	filt->size = args.size;
+
+	return 0;
+}
+
+static int check_end_after_start(struct addr_filter *filt, u64 start, u64 size)
+{
+	if (start + size >= filt->addr)
+		return 0;
+
+	if (filt->sym_from) {
+		pr_err("Symbol '%s' (0x%"PRIx64") comes before '%s' (0x%"PRIx64")\n",
+		       filt->sym_to, start, filt->sym_from, filt->addr);
+	} else {
+		pr_err("Symbol '%s' (0x%"PRIx64") comes before address 0x%"PRIx64")\n",
+		       filt->sym_to, start, filt->addr);
+	}
+
+	return -EINVAL;
+}
+
+static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
+{
+	bool no_size = false;
+	u64 start, size;
+	int err;
+
+	if (symbol_conf.kptr_restrict) {
+		pr_err("Kernel addresses are restricted. Unable to resolve kernel symbols.\n");
+		return -EINVAL;
+	}
+
+	if (filt->sym_from && !strcmp(filt->sym_from, "*"))
+		return addr_filter__entire_kernel(filt);
+
+	if (filt->sym_from) {
+		err = find_kern_sym(filt->sym_from, &start, &size,
+				    filt->sym_from_idx);
+		if (err)
+			return err;
+		filt->addr = start;
+		if (filt->range && !filt->size && !filt->sym_to) {
+			filt->size = size;
+			no_size = !!size;
+		}
+	}
+
+	if (filt->sym_to) {
+		err = find_kern_sym(filt->sym_to, &start, &size,
+				    filt->sym_to_idx);
+		if (err)
+			return err;
+
+		err = check_end_after_start(filt, start, size);
+		if (err)
+			return err;
+		filt->size = start + size - filt->addr;
+		no_size = !!size;
+	}
+
+	/* The very last symbol in kallsyms does not imply a particular size */
+	if (no_size) {
+		pr_err("Cannot determine size of symbol '%s'\n",
+		       filt->sym_to ? filt->sym_to : filt->sym_from);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static struct dso *load_dso(const char *name)
+{
+	struct map *map;
+	struct dso *dso;
+
+	map = dso__new_map(name);
+	if (!map)
+		return NULL;
+
+	map__load(map);
+
+	dso = dso__get(map->dso);
+
+	map__put(map);
+
+	return dso;
+}
+
+static bool dso_sym_match(struct symbol *sym, const char *name, int *cnt,
+			  int idx)
+{
+	/* Same name, and global or the n'th found or any */
+	return !arch__compare_symbol_names(name, sym->name) &&
+	       ((!idx && sym->binding == STB_GLOBAL) ||
+		(idx > 0 && ++*cnt == idx) ||
+		idx < 0);
+}
+
+static void print_duplicate_syms(struct dso *dso, const char *sym_name)
+{
+	struct symbol *sym;
+	bool near = false;
+	int cnt = 0;
+
+	pr_err("Multiple symbols with name '%s'\n", sym_name);
+
+	sym = dso__first_symbol(dso, MAP__FUNCTION);
+	while (sym) {
+		if (dso_sym_match(sym, sym_name, &cnt, -1)) {
+			pr_err("#%d\t0x%"PRIx64"\t%c\t%s\n",
+			       ++cnt, sym->start,
+			       sym->binding == STB_GLOBAL ? 'g' :
+			       sym->binding == STB_LOCAL  ? 'l' : 'w',
+			       sym->name);
+			near = true;
+		} else if (near) {
+			near = false;
+			pr_err("\t\twhich is near\t\t%s\n", sym->name);
+		}
+		sym = dso__next_symbol(sym);
+	}
+
+	pr_err("Disambiguate symbol name by inserting #n after the name e.g. %s #2\n",
+	       sym_name);
+	pr_err("Or select a global symbol by inserting #0 or #g or #G\n");
+}
+
+static int find_dso_sym(struct dso *dso, const char *sym_name, u64 *start,
+			u64 *size, int idx)
+{
+	struct symbol *sym;
+	int cnt = 0;
+
+	*start = 0;
+	*size = 0;
+
+	sym = dso__first_symbol(dso, MAP__FUNCTION);
+	while (sym) {
+		if (*start) {
+			if (!*size)
+				*size = sym->start - *start;
+			if (idx > 0) {
+				if (*size)
+					return 1;
+			} else if (dso_sym_match(sym, sym_name, &cnt, idx)) {
+				print_duplicate_syms(dso, sym_name);
+				return -EINVAL;
+			}
+		} else if (dso_sym_match(sym, sym_name, &cnt, idx)) {
+			*start = sym->start;
+			*size = sym->end - sym->start;
+		}
+		sym = dso__next_symbol(sym);
+	}
+
+	if (!*start)
+		return sym_not_found_error(sym_name, idx);
+
+	return 0;
+}
+
+static int addr_filter__entire_dso(struct addr_filter *filt, struct dso *dso)
+{
+	struct symbol *first_sym = dso__first_symbol(dso, MAP__FUNCTION);
+	struct symbol *last_sym = dso__last_symbol(dso, MAP__FUNCTION);
+
+	if (!first_sym || !last_sym) {
+		pr_err("Failed to determine filter for %s\nNo symbols found.\n",
+		       filt->filename);
+		return -EINVAL;
+	}
+
+	filt->addr = first_sym->start;
+	filt->size = last_sym->end - first_sym->start;
+
+	return 0;
+}
+
+static int addr_filter__resolve_syms(struct addr_filter *filt)
+{
+	u64 start, size;
+	struct dso *dso;
+	int err = 0;
+
+	if (!filt->sym_from && !filt->sym_to)
+		return 0;
+
+	if (!filt->filename)
+		return addr_filter__resolve_kernel_syms(filt);
+
+	dso = load_dso(filt->filename);
+	if (!dso) {
+		pr_err("Failed to load symbols from: %s\n", filt->filename);
+		return -EINVAL;
+	}
+
+	if (filt->sym_from && !strcmp(filt->sym_from, "*")) {
+		err = addr_filter__entire_dso(filt, dso);
+		goto put_dso;
+	}
+
+	if (filt->sym_from) {
+		err = find_dso_sym(dso, filt->sym_from, &start, &size,
+				   filt->sym_from_idx);
+		if (err)
+			goto put_dso;
+		filt->addr = start;
+		if (filt->range && !filt->size && !filt->sym_to)
+			filt->size = size;
+	}
+
+	if (filt->sym_to) {
+		err = find_dso_sym(dso, filt->sym_to, &start, &size,
+				   filt->sym_to_idx);
+		if (err)
+			goto put_dso;
+
+		err = check_end_after_start(filt, start, size);
+		if (err)
+			return err;
+
+		filt->size = start + size - filt->addr;
+	}
+
+put_dso:
+	dso__put(dso);
+
+	return err;
+}
+
+static char *addr_filter__to_str(struct addr_filter *filt)
+{
+	char filename_buf[PATH_MAX];
+	const char *at = "";
+	const char *fn = "";
+	char *filter;
+	int err;
+
+	if (filt->filename) {
+		at = "@";
+		fn = realpath(filt->filename, filename_buf);
+		if (!fn)
+			return NULL;
+	}
+
+	if (filt->range) {
+		err = asprintf(&filter, "%s 0x%"PRIx64"/0x%"PRIx64"%s%s",
+			       filt->action, filt->addr, filt->size, at, fn);
+	} else {
+		err = asprintf(&filter, "%s 0x%"PRIx64"%s%s",
+			       filt->action, filt->addr, at, fn);
+	}
+
+	return err < 0 ? NULL : filter;
+}
+
+static int parse_addr_filter(struct perf_evsel *evsel, const char *filter,
+			     int max_nr)
+{
+	struct addr_filters filts;
+	struct addr_filter *filt;
+	int err;
+
+	addr_filters__init(&filts);
+
+	err = addr_filters__parse_bare_filter(&filts, filter);
+	if (err)
+		goto out_exit;
+
+	if (filts.cnt > max_nr) {
+		pr_err("Error: number of address filters (%d) exceeds maximum (%d)\n",
+		       filts.cnt, max_nr);
+		err = -EINVAL;
+		goto out_exit;
+	}
+
+	list_for_each_entry(filt, &filts.head, list) {
+		char *new_filter;
+
+		err = addr_filter__resolve_syms(filt);
+		if (err)
+			goto out_exit;
+
+		new_filter = addr_filter__to_str(filt);
+		if (!new_filter) {
+			err = -ENOMEM;
+			goto out_exit;
+		}
+
+		if (perf_evsel__append_addr_filter(evsel, new_filter)) {
+			err = -ENOMEM;
+			goto out_exit;
+		}
+	}
+
+out_exit:
+	addr_filters__exit(&filts);
+
+	if (err) {
+		pr_err("Failed to parse address filter: '%s'\n", filter);
+		pr_err("Filter format is: filter|start|stop|tracestop <start symbol or address> [/ <end symbol or size>] [@<file name>]\n");
+		pr_err("Where multiple filters are separated by space or comma.\n");
+	}
+
+	return err;
+}
+
+static struct perf_pmu *perf_evsel__find_pmu(struct perf_evsel *evsel)
+{
+	struct perf_pmu *pmu = NULL;
+
+	while ((pmu = perf_pmu__scan(pmu)) != NULL) {
+		if (pmu->type == evsel->attr.type)
+			break;
+	}
+
+	return pmu;
+}
+
+static int perf_evsel__nr_addr_filter(struct perf_evsel *evsel)
+{
+	struct perf_pmu *pmu = perf_evsel__find_pmu(evsel);
+	int nr_addr_filters = 0;
+
+	if (!pmu)
+		return 0;
+
+	perf_pmu__scan_file(pmu, "nr_addr_filters", "%d", &nr_addr_filters);
+
+	return nr_addr_filters;
+}
+
+int auxtrace_parse_filters(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel;
+	char *filter;
+	int err, max_nr;
+
+	evlist__for_each_entry(evlist, evsel) {
+		filter = evsel->filter;
+		max_nr = perf_evsel__nr_addr_filter(evsel);
+		if (!filter || !max_nr)
+			continue;
+		evsel->filter = NULL;
+		err = parse_addr_filter(evsel, filter, max_nr);
+		free(filter);
+		if (err)
+			return err;
+		pr_debug("Address filter: %s\n", evsel->filter);
+	}
+
+	return 0;
+}
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index 09286f193532..26fb1ee5746a 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -318,6 +318,48 @@ struct auxtrace_record {
 	unsigned int alignment;
 };
 
+/**
+ * struct addr_filter - address filter.
+ * @list: list node
+ * @range: true if it is a range filter
+ * @start: true if action is 'filter' or 'start'
+ * @action: 'filter', 'start' or 'stop' ('tracestop' is accepted but converted
+ *          to 'stop')
+ * @sym_from: symbol name for the filter address
+ * @sym_to: symbol name that determines the filter size
+ * @sym_from_idx: selects n'th from symbols with the same name (0 means global
+ *                and less than 0 means symbol must be unique)
+ * @sym_to_idx: same as @sym_from_idx but for @sym_to
+ * @addr: filter address
+ * @size: filter region size (for range filters)
+ * @filename: DSO file name or NULL for the kernel
+ * @str: allocated string that contains the other string members
+ */
+struct addr_filter {
+	struct list_head	list;
+	bool			range;
+	bool			start;
+	const char		*action;
+	const char		*sym_from;
+	const char		*sym_to;
+	int			sym_from_idx;
+	int			sym_to_idx;
+	u64			addr;
+	u64			size;
+	const char		*filename;
+	char			*str;
+};
+
+/**
+ * struct addr_filters - list of address filters.
+ * @head: list of address filters
+ * @cnt: number of address filters
+ */
+struct addr_filters {
+	struct list_head	head;
+	int			cnt;
+};
+
 #ifdef HAVE_AUXTRACE_SUPPORT
 
 /*
@@ -482,6 +524,12 @@ void perf_session__auxtrace_error_inc(struct perf_session *session,
 				      union perf_event *event);
 void events_stats__auxtrace_error_warn(const struct events_stats *stats);
 
+void addr_filters__init(struct addr_filters *filts);
+void addr_filters__exit(struct addr_filters *filts);
+int addr_filters__parse_bare_filter(struct addr_filters *filts,
+				    const char *filter);
+int auxtrace_parse_filters(struct perf_evlist *evlist);
+
 static inline int auxtrace__process_event(struct perf_session *session,
 					  union perf_event *event,
 					  struct perf_sample *sample,
@@ -640,6 +688,12 @@ void auxtrace_index__free(struct list_head *head __maybe_unused)
 {
 }
 
+static inline
+int auxtrace_parse_filters(struct perf_evlist *evlist __maybe_unused)
+{
+	return 0;
+}
+
 int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
 			struct auxtrace_mmap_params *mp,
 			void *userpg, int fd);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 14/27] perf probe: Increase debug level of SDT debug messages
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 13/27] perf record: Add support for using symbols in address filters Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 15/27] perf intel-pt: Fix snapshot overlap detection decoder errors Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Two SDT debug messages can occur for every DSO which is too noisy.
Consequently, increase debug level of SDT messages.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-9-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/build-id.c   | 4 ++--
 tools/perf/util/probe-file.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 5651f3c12f93..e528c40739cc 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -620,7 +620,7 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
 
 	ret = probe_cache__scan_sdt(cache, realname);
 	if (ret >= 0) {
-		pr_debug("Found %d SDTs in %s\n", ret, realname);
+		pr_debug4("Found %d SDTs in %s\n", ret, realname);
 		if (probe_cache__commit(cache) < 0)
 			ret = -1;
 	}
@@ -691,7 +691,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 
 	/* Update SDT cache : error is just warned */
 	if (build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
-		pr_debug("Failed to update/scan SDT cache for %s\n", realname);
+		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
 
 out_free:
 	if (!is_kallsyms)
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 6f931e442f14..436b64731f65 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -699,7 +699,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
 	INIT_LIST_HEAD(&sdtlist);
 	ret = get_sdt_note_list(&sdtlist, pathname);
 	if (ret < 0) {
-		pr_debug("Failed to get sdt note: %d\n", ret);
+		pr_debug4("Failed to get sdt note: %d\n", ret);
 		return ret;
 	}
 	list_for_each_entry(note, &sdtlist, note_list) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 15/27] perf intel-pt: Fix snapshot overlap detection decoder errors
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 14/27] perf probe: Increase debug level of SDT debug messages Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 16/27] perf intel-pt: Add support for recording the max non-turbo ratio Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, stable, #, v4.3+,
	Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Fix occasional decoder errors decoding trace data collected in snapshot
mode.

Snapshot mode can take successive snapshots of trace which might overlap.
The decoder checks whether there is an overlap but only looks at the
current and previous buffer. However buffers that do not contain
synchronization (i.e. PSB) packets cannot be decoded or used for overlap
checking. That means the decoder actually needs to check overlaps between
the current buffer and the previous buffer that contained usable data.
Make that change.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: stable@vger.kernel.org # v4.3+
Link: http://lkml.kernel.org/r/1474641528-18776-10-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index b9cc353cace2..b744ea812a2e 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -241,7 +241,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
 	}
 
 	queue = &ptq->pt->queues.queue_array[ptq->queue_nr];
-
+next:
 	buffer = auxtrace_buffer__next(queue, buffer);
 	if (!buffer) {
 		if (old_buffer)
@@ -264,9 +264,6 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
 	    intel_pt_do_fix_overlap(ptq->pt, old_buffer, buffer))
 		return -ENOMEM;
 
-	if (old_buffer)
-		auxtrace_buffer__drop_data(old_buffer);
-
 	if (buffer->use_data) {
 		b->len = buffer->use_size;
 		b->buf = buffer->use_data;
@@ -276,6 +273,16 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
 	}
 	b->ref_timestamp = buffer->reference;
 
+	/*
+	 * If in snapshot mode and the buffer has no usable data, get next
+	 * buffer and again check overlap against old_buffer.
+	 */
+	if (ptq->pt->snapshot_mode && !b->len)
+		goto next;
+
+	if (old_buffer)
+		auxtrace_buffer__drop_data(old_buffer);
+
 	if (!old_buffer || ptq->pt->sampling_mode || (ptq->pt->snapshot_mode &&
 						      !buffer->consecutive)) {
 		b->consecutive = false;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 16/27] perf intel-pt: Add support for recording the max non-turbo ratio
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 15/27] perf intel-pt: Fix snapshot overlap detection decoder errors Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 17/27] perf intel-pt: Fix missing error codes processing auxtrace_info Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Previously the maximum non-turbo ratio was calculated from TSC assuming
a 100 MHz multiplier which is correct for current hardware supporting
Intel PT.  However more recent kernels also now export the value, so use
that in preference to the calculated value.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-11-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/intel-pt.c |  6 ++++++
 tools/perf/util/intel-pt.c          | 14 +++++++++++++-
 tools/perf/util/intel-pt.h          |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index a2412e9d883b..18b21514c153 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -302,6 +302,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	bool cap_user_time_zero = false, per_cpu_mmaps;
 	u64 tsc_bit, mtc_bit, mtc_freq_bits, cyc_bit, noretcomp_bit;
 	u32 tsc_ctc_ratio_n, tsc_ctc_ratio_d;
+	unsigned long max_non_turbo_ratio;
 	int err;
 
 	if (priv_size != INTEL_PT_AUXTRACE_PRIV_SIZE)
@@ -317,6 +318,10 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 
 	intel_pt_tsc_ctc_ratio(&tsc_ctc_ratio_n, &tsc_ctc_ratio_d);
 
+	if (perf_pmu__scan_file(intel_pt_pmu, "max_nonturbo_ratio",
+				"%lu", &max_non_turbo_ratio) != 1)
+		max_non_turbo_ratio = 0;
+
 	if (!session->evlist->nr_mmaps)
 		return -EINVAL;
 
@@ -351,6 +356,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_N] = tsc_ctc_ratio_n;
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_D] = tsc_ctc_ratio_d;
 	auxtrace_info->priv[INTEL_PT_CYC_BIT] = cyc_bit;
+	auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO] = max_non_turbo_ratio;
 
 	return 0;
 }
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index b744ea812a2e..77fbf02c8e41 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2023,6 +2023,7 @@ static const char * const intel_pt_info_fmts[] = {
 	[INTEL_PT_TSC_CTC_N]		= "  TSC:CTC numerator   %"PRIu64"\n",
 	[INTEL_PT_TSC_CTC_D]		= "  TSC:CTC denominator %"PRIu64"\n",
 	[INTEL_PT_CYC_BIT]		= "  CYC bit             %#"PRIx64"\n",
+	[INTEL_PT_MAX_NONTURBO_RATIO]	= "  Max non-turbo ratio %"PRIu64"\n",
 };
 
 static void intel_pt_print_info(u64 *arr, int start, int finish)
@@ -2087,6 +2088,15 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 				    INTEL_PT_CYC_BIT);
 	}
 
+	if (auxtrace_info->header.size >= sizeof(struct auxtrace_info_event) +
+				(sizeof(u64) * INTEL_PT_MAX_NONTURBO_RATIO)) {
+		pt->max_non_turbo_ratio =
+			auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO];
+		intel_pt_print_info(&auxtrace_info->priv[0],
+				    INTEL_PT_MAX_NONTURBO_RATIO,
+				    INTEL_PT_MAX_NONTURBO_RATIO);
+	}
+
 	pt->timeless_decoding = intel_pt_timeless_decoding(pt);
 	pt->have_tsc = intel_pt_have_tsc(pt);
 	pt->sampling_mode = false;
@@ -2156,7 +2166,9 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	if (pt->tc.time_mult) {
 		u64 tsc_freq = intel_pt_ns_to_ticks(pt, 1000000000);
 
-		pt->max_non_turbo_ratio = (tsc_freq + 50000000) / 100000000;
+		if (!pt->max_non_turbo_ratio)
+			pt->max_non_turbo_ratio =
+					(tsc_freq + 50000000) / 100000000;
 		intel_pt_log("TSC frequency %"PRIu64"\n", tsc_freq);
 		intel_pt_log("Maximum non-turbo ratio %u\n",
 			     pt->max_non_turbo_ratio);
diff --git a/tools/perf/util/intel-pt.h b/tools/perf/util/intel-pt.h
index 0065949df693..8b8356233e6a 100644
--- a/tools/perf/util/intel-pt.h
+++ b/tools/perf/util/intel-pt.h
@@ -34,6 +34,7 @@ enum {
 	INTEL_PT_TSC_CTC_N,
 	INTEL_PT_TSC_CTC_D,
 	INTEL_PT_CYC_BIT,
+	INTEL_PT_MAX_NONTURBO_RATIO,
 	INTEL_PT_AUXTRACE_PRIV_MAX,
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 17/27] perf intel-pt: Fix missing error codes processing auxtrace_info
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 16/27] perf intel-pt: Add support for recording the max non-turbo ratio Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 18/27] perf intel-pt: Add a helper function for processing AUXTRACE_INFO Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Fix 2 places where the err variable was not being set.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-12-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 77fbf02c8e41..96519e801e53 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2138,11 +2138,13 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 		pt->switch_evsel = intel_pt_find_sched_switch(session->evlist);
 		if (!pt->switch_evsel) {
 			pr_err("%s: missing sched_switch event\n", __func__);
+			err = -EINVAL;
 			goto err_delete_thread;
 		}
 	} else if (pt->have_sched_switch == 2 &&
 		   !intel_pt_find_switch(session->evlist)) {
 		pr_err("%s: missing context_switch attribute flag\n", __func__);
+		err = -EINVAL;
 		goto err_delete_thread;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 18/27] perf intel-pt: Add a helper function for processing AUXTRACE_INFO
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 17/27] perf intel-pt: Fix missing error codes processing auxtrace_info Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 19/27] perf intel-pt: Record address filter in AUXTRACE_INFO event Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Add a helper function 'intel_pt_has()' to make it easier to determine
which members the AUXTRACE_INFO event contains.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-13-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 96519e801e53..f16b00f55a19 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2037,6 +2037,12 @@ static void intel_pt_print_info(u64 *arr, int start, int finish)
 		fprintf(stdout, intel_pt_info_fmts[i], arr[i]);
 }
 
+static bool intel_pt_has(struct auxtrace_info_event *auxtrace_info, int pos)
+{
+	return auxtrace_info->header.size >=
+		sizeof(struct auxtrace_info_event) + (sizeof(u64) * (pos + 1));
+}
+
 int intel_pt_process_auxtrace_info(union perf_event *event,
 				   struct perf_session *session)
 {
@@ -2077,8 +2083,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	intel_pt_print_info(&auxtrace_info->priv[0], INTEL_PT_PMU_TYPE,
 			    INTEL_PT_PER_CPU_MMAPS);
 
-	if (auxtrace_info->header.size >= sizeof(struct auxtrace_info_event) +
-					(sizeof(u64) * INTEL_PT_CYC_BIT)) {
+	if (intel_pt_has(auxtrace_info, INTEL_PT_CYC_BIT)) {
 		pt->mtc_bit = auxtrace_info->priv[INTEL_PT_MTC_BIT];
 		pt->mtc_freq_bits = auxtrace_info->priv[INTEL_PT_MTC_FREQ_BITS];
 		pt->tsc_ctc_ratio_n = auxtrace_info->priv[INTEL_PT_TSC_CTC_N];
@@ -2088,8 +2093,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 				    INTEL_PT_CYC_BIT);
 	}
 
-	if (auxtrace_info->header.size >= sizeof(struct auxtrace_info_event) +
-				(sizeof(u64) * INTEL_PT_MAX_NONTURBO_RATIO)) {
+	if (intel_pt_has(auxtrace_info, INTEL_PT_MAX_NONTURBO_RATIO)) {
 		pt->max_non_turbo_ratio =
 			auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO];
 		intel_pt_print_info(&auxtrace_info->priv[0],
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 19/27] perf intel-pt: Record address filter in AUXTRACE_INFO event
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 18/27] perf intel-pt: Add a helper function for processing AUXTRACE_INFO Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 20/27] perf intel-pt: Read address filter from " Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

The address filter is needed to help decode the trace, so store it in
the AUXTRACE_INFO event.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-14-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/intel-pt.c | 51 ++++++++++++++++++++++++++++++++++---
 tools/perf/util/intel-pt.h          |  3 +--
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index 18b21514c153..90fa2286edcf 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -62,6 +62,7 @@ struct intel_pt_recording {
 	size_t				snapshot_ref_buf_size;
 	int				snapshot_ref_cnt;
 	struct intel_pt_snapshot_ref	*snapshot_refs;
+	size_t				priv_size;
 };
 
 static int intel_pt_parse_terms_with_default(struct list_head *formats,
@@ -273,11 +274,37 @@ intel_pt_pmu_default_config(struct perf_pmu *intel_pt_pmu)
 	return attr;
 }
 
+static const char *intel_pt_find_filter(struct perf_evlist *evlist,
+					struct perf_pmu *intel_pt_pmu)
+{
+	struct perf_evsel *evsel;
+
+	evlist__for_each_entry(evlist, evsel) {
+		if (evsel->attr.type == intel_pt_pmu->type)
+			return evsel->filter;
+	}
+
+	return NULL;
+}
+
+static size_t intel_pt_filter_bytes(const char *filter)
+{
+	size_t len = filter ? strlen(filter) : 0;
+
+	return len ? roundup(len + 1, 8) : 0;
+}
+
 static size_t
-intel_pt_info_priv_size(struct auxtrace_record *itr __maybe_unused,
-			struct perf_evlist *evlist __maybe_unused)
+intel_pt_info_priv_size(struct auxtrace_record *itr, struct perf_evlist *evlist)
 {
-	return INTEL_PT_AUXTRACE_PRIV_SIZE;
+	struct intel_pt_recording *ptr =
+			container_of(itr, struct intel_pt_recording, itr);
+	const char *filter = intel_pt_find_filter(evlist, ptr->intel_pt_pmu);
+
+	ptr->priv_size = (INTEL_PT_AUXTRACE_PRIV_MAX * sizeof(u64)) +
+			 intel_pt_filter_bytes(filter);
+
+	return ptr->priv_size;
 }
 
 static void intel_pt_tsc_ctc_ratio(u32 *n, u32 *d)
@@ -303,9 +330,12 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	u64 tsc_bit, mtc_bit, mtc_freq_bits, cyc_bit, noretcomp_bit;
 	u32 tsc_ctc_ratio_n, tsc_ctc_ratio_d;
 	unsigned long max_non_turbo_ratio;
+	size_t filter_str_len;
+	const char *filter;
+	u64 *info;
 	int err;
 
-	if (priv_size != INTEL_PT_AUXTRACE_PRIV_SIZE)
+	if (priv_size != ptr->priv_size)
 		return -EINVAL;
 
 	intel_pt_parse_terms(&intel_pt_pmu->format, "tsc", &tsc_bit);
@@ -322,6 +352,9 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 				"%lu", &max_non_turbo_ratio) != 1)
 		max_non_turbo_ratio = 0;
 
+	filter = intel_pt_find_filter(session->evlist, ptr->intel_pt_pmu);
+	filter_str_len = filter ? strlen(filter) : 0;
+
 	if (!session->evlist->nr_mmaps)
 		return -EINVAL;
 
@@ -357,6 +390,16 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_D] = tsc_ctc_ratio_d;
 	auxtrace_info->priv[INTEL_PT_CYC_BIT] = cyc_bit;
 	auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO] = max_non_turbo_ratio;
+	auxtrace_info->priv[INTEL_PT_FILTER_STR_LEN] = filter_str_len;
+
+	info = &auxtrace_info->priv[INTEL_PT_FILTER_STR_LEN] + 1;
+
+	if (filter_str_len) {
+		size_t len = intel_pt_filter_bytes(filter);
+
+		strncpy((char *)info, filter, len);
+		info += len >> 3;
+	}
 
 	return 0;
 }
diff --git a/tools/perf/util/intel-pt.h b/tools/perf/util/intel-pt.h
index 8b8356233e6a..e13b14e5a37b 100644
--- a/tools/perf/util/intel-pt.h
+++ b/tools/perf/util/intel-pt.h
@@ -35,11 +35,10 @@ enum {
 	INTEL_PT_TSC_CTC_D,
 	INTEL_PT_CYC_BIT,
 	INTEL_PT_MAX_NONTURBO_RATIO,
+	INTEL_PT_FILTER_STR_LEN,
 	INTEL_PT_AUXTRACE_PRIV_MAX,
 };
 
-#define INTEL_PT_AUXTRACE_PRIV_SIZE (INTEL_PT_AUXTRACE_PRIV_MAX * sizeof(u64))
-
 struct auxtrace_record;
 struct perf_tool;
 union perf_event;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 20/27] perf intel-pt: Read address filter from AUXTRACE_INFO event
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 19/27] perf intel-pt: Record address filter in AUXTRACE_INFO event Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 21/27] perf intel-pt: Enable decoder to handle TIP.PGD with missing IP Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Read the address filter from the AUXTRACE_INFO event in preparation for
using it to assist in decoding.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-15-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index f16b00f55a19..c9fec19a7914 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -103,6 +103,8 @@ struct intel_pt {
 	unsigned max_non_turbo_ratio;
 
 	unsigned long num_events;
+
+	char *filter;
 };
 
 enum switch_state {
@@ -1774,6 +1776,7 @@ static void intel_pt_free(struct perf_session *session)
 	intel_pt_free_events(session);
 	session->auxtrace = NULL;
 	thread__put(pt->unknown_thread);
+	zfree(&pt->filter);
 	free(pt);
 }
 
@@ -2024,6 +2027,7 @@ static const char * const intel_pt_info_fmts[] = {
 	[INTEL_PT_TSC_CTC_D]		= "  TSC:CTC denominator %"PRIu64"\n",
 	[INTEL_PT_CYC_BIT]		= "  CYC bit             %#"PRIx64"\n",
 	[INTEL_PT_MAX_NONTURBO_RATIO]	= "  Max non-turbo ratio %"PRIu64"\n",
+	[INTEL_PT_FILTER_STR_LEN]	= "  Filter string len.  %"PRIu64"\n",
 };
 
 static void intel_pt_print_info(u64 *arr, int start, int finish)
@@ -2037,6 +2041,14 @@ static void intel_pt_print_info(u64 *arr, int start, int finish)
 		fprintf(stdout, intel_pt_info_fmts[i], arr[i]);
 }
 
+static void intel_pt_print_info_str(const char *name, const char *str)
+{
+	if (!dump_trace)
+		return;
+
+	fprintf(stdout, "  %-20s%s\n", name, str ? str : "");
+}
+
 static bool intel_pt_has(struct auxtrace_info_event *auxtrace_info, int pos)
 {
 	return auxtrace_info->header.size >=
@@ -2049,6 +2061,8 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * INTEL_PT_PER_CPU_MMAPS;
 	struct intel_pt *pt;
+	void *info_end;
+	u64 *info;
 	int err;
 
 	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
@@ -2101,6 +2115,42 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 				    INTEL_PT_MAX_NONTURBO_RATIO);
 	}
 
+	info = &auxtrace_info->priv[INTEL_PT_FILTER_STR_LEN] + 1;
+	info_end = (void *)info + auxtrace_info->header.size;
+
+	if (intel_pt_has(auxtrace_info, INTEL_PT_FILTER_STR_LEN)) {
+		size_t len;
+
+		len = auxtrace_info->priv[INTEL_PT_FILTER_STR_LEN];
+		intel_pt_print_info(&auxtrace_info->priv[0],
+				    INTEL_PT_FILTER_STR_LEN,
+				    INTEL_PT_FILTER_STR_LEN);
+		if (len) {
+			const char *filter = (const char *)info;
+
+			len = roundup(len + 1, 8);
+			info += len >> 3;
+			if ((void *)info > info_end) {
+				pr_err("%s: bad filter string length\n", __func__);
+				err = -EINVAL;
+				goto err_free_queues;
+			}
+			pt->filter = memdup(filter, len);
+			if (!pt->filter) {
+				err = -ENOMEM;
+				goto err_free_queues;
+			}
+			if (session->header.needs_swap)
+				mem_bswap_64(pt->filter, len);
+			if (pt->filter[len - 1]) {
+				pr_err("%s: filter string not null terminated\n", __func__);
+				err = -EINVAL;
+				goto err_free_queues;
+			}
+		}
+		intel_pt_print_info_str("Filter string", pt->filter);
+	}
+
 	pt->timeless_decoding = intel_pt_timeless_decoding(pt);
 	pt->have_tsc = intel_pt_have_tsc(pt);
 	pt->sampling_mode = false;
@@ -2218,6 +2268,7 @@ err_free_queues:
 	auxtrace_queues__free(&pt->queues);
 	session->auxtrace = NULL;
 err_free:
+	zfree(&pt->filter);
 	free(pt);
 	return err;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 21/27] perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (19 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 20/27] perf intel-pt: Read address filter from " Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 22/27] perf intel-pt: Fix decoding when there are address filters Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

When address filters are used, the decoder must detect the end of a
filter region (or a branch into a tracestop region) by matching Packet
Generation Disabled (TIP.PGD) packets against the object code using the
IP given in the packet. However, due to errata SKL014 "Intel PT TIP.PGD
May Not Have Target IP Payload", that IP may not be present.

Enable the decoder to handle that by adding a new callback function
'pgd_ip()' which indicates whether the IP is not traced, in which case
that is the point where the trace was disabled.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-16-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  | 30 ++++++++++++++++++++++
 .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |  1 +
 2 files changed, 31 insertions(+)

diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index 8ff6c6a61291..7591a0c37473 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -80,6 +80,7 @@ struct intel_pt_decoder {
 	int (*walk_insn)(struct intel_pt_insn *intel_pt_insn,
 			 uint64_t *insn_cnt_ptr, uint64_t *ip, uint64_t to_ip,
 			 uint64_t max_insn_cnt, void *data);
+	bool (*pgd_ip)(uint64_t ip, void *data);
 	void *data;
 	struct intel_pt_state state;
 	const unsigned char *buf;
@@ -186,6 +187,7 @@ struct intel_pt_decoder *intel_pt_decoder_new(struct intel_pt_params *params)
 
 	decoder->get_trace          = params->get_trace;
 	decoder->walk_insn          = params->walk_insn;
+	decoder->pgd_ip             = params->pgd_ip;
 	decoder->data               = params->data;
 	decoder->return_compression = params->return_compression;
 
@@ -1008,6 +1010,19 @@ static int intel_pt_walk_tip(struct intel_pt_decoder *decoder)
 	int err;
 
 	err = intel_pt_walk_insn(decoder, &intel_pt_insn, 0);
+	if (err == INTEL_PT_RETURN &&
+	    decoder->pgd_ip &&
+	    decoder->pkt_state == INTEL_PT_STATE_TIP_PGD &&
+	    (decoder->state.type & INTEL_PT_BRANCH) &&
+	    decoder->pgd_ip(decoder->state.to_ip, decoder->data)) {
+		/* Unconditional branch leaving filter region */
+		decoder->no_progress = 0;
+		decoder->pge = false;
+		decoder->continuous_period = false;
+		decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
+		decoder->state.to_ip = 0;
+		return 0;
+	}
 	if (err == INTEL_PT_RETURN)
 		return 0;
 	if (err)
@@ -1036,6 +1051,21 @@ static int intel_pt_walk_tip(struct intel_pt_decoder *decoder)
 	}
 
 	if (intel_pt_insn.branch == INTEL_PT_BR_CONDITIONAL) {
+		uint64_t to_ip = decoder->ip + intel_pt_insn.length +
+				 intel_pt_insn.rel;
+
+		if (decoder->pgd_ip &&
+		    decoder->pkt_state == INTEL_PT_STATE_TIP_PGD &&
+		    decoder->pgd_ip(to_ip, decoder->data)) {
+			/* Conditional branch leaving filter region */
+			decoder->pge = false;
+			decoder->continuous_period = false;
+			decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
+			decoder->ip = to_ip;
+			decoder->state.from_ip = decoder->ip;
+			decoder->state.to_ip = 0;
+			return 0;
+		}
 		intel_pt_log_at("ERROR: Conditional branch when expecting indirect branch",
 				decoder->ip);
 		decoder->pkt_state = INTEL_PT_STATE_ERR_RESYNC;
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
index 02c38fec1c37..89399985fa4d 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
@@ -83,6 +83,7 @@ struct intel_pt_params {
 	int (*walk_insn)(struct intel_pt_insn *intel_pt_insn,
 			 uint64_t *insn_cnt_ptr, uint64_t *ip, uint64_t to_ip,
 			 uint64_t max_insn_cnt, void *data);
+	bool (*pgd_ip)(uint64_t ip, void *data);
 	void *data;
 	bool return_compression;
 	uint64_t period;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 22/27] perf intel-pt: Fix decoding when there are address filters
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (20 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 21/27] perf intel-pt: Enable decoder to handle TIP.PGD with missing IP Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 23/27] perf probe: Ignore the error of finding inline instance Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter, Jiri Olsa,
	Masami Hiramatsu, Mathieu Poirier, Arnaldo Carvalho de Melo

From: Adrian Hunter <adrian.hunter@intel.com>

Due to errata SKL014 "Intel PT TIP.PGD May Not Have Target IP Payload",
the Intel PT decoder needs to match address filters against TIP.PGD
packets.  Parse the address filters and implement the decoder's
'pgd_ip()' callback to match the IP against the filter regions.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-17-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index c9fec19a7914..dc041d4368c8 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -105,6 +105,7 @@ struct intel_pt {
 	unsigned long num_events;
 
 	char *filter;
+	struct addr_filters filts;
 };
 
 enum switch_state {
@@ -550,6 +551,76 @@ out_no_cache:
 	return 0;
 }
 
+static bool intel_pt_match_pgd_ip(struct intel_pt *pt, uint64_t ip,
+				  uint64_t offset, const char *filename)
+{
+	struct addr_filter *filt;
+	bool have_filter   = false;
+	bool hit_tracestop = false;
+	bool hit_filter    = false;
+
+	list_for_each_entry(filt, &pt->filts.head, list) {
+		if (filt->start)
+			have_filter = true;
+
+		if ((filename && !filt->filename) ||
+		    (!filename && filt->filename) ||
+		    (filename && strcmp(filename, filt->filename)))
+			continue;
+
+		if (!(offset >= filt->addr && offset < filt->addr + filt->size))
+			continue;
+
+		intel_pt_log("TIP.PGD ip %#"PRIx64" offset %#"PRIx64" in %s hit filter: %s offset %#"PRIx64" size %#"PRIx64"\n",
+			     ip, offset, filename ? filename : "[kernel]",
+			     filt->start ? "filter" : "stop",
+			     filt->addr, filt->size);
+
+		if (filt->start)
+			hit_filter = true;
+		else
+			hit_tracestop = true;
+	}
+
+	if (!hit_tracestop && !hit_filter)
+		intel_pt_log("TIP.PGD ip %#"PRIx64" offset %#"PRIx64" in %s is not in a filter region\n",
+			     ip, offset, filename ? filename : "[kernel]");
+
+	return hit_tracestop || (have_filter && !hit_filter);
+}
+
+static int __intel_pt_pgd_ip(uint64_t ip, void *data)
+{
+	struct intel_pt_queue *ptq = data;
+	struct thread *thread;
+	struct addr_location al;
+	u8 cpumode;
+	u64 offset;
+
+	if (ip >= ptq->pt->kernel_start)
+		return intel_pt_match_pgd_ip(ptq->pt, ip, ip, NULL);
+
+	cpumode = PERF_RECORD_MISC_USER;
+
+	thread = ptq->thread;
+	if (!thread)
+		return -EINVAL;
+
+	thread__find_addr_map(thread, cpumode, MAP__FUNCTION, ip, &al);
+	if (!al.map || !al.map->dso)
+		return -EINVAL;
+
+	offset = al.map->map_ip(al.map, ip);
+
+	return intel_pt_match_pgd_ip(ptq->pt, ip, offset,
+				     al.map->dso->long_name);
+}
+
+static bool intel_pt_pgd_ip(uint64_t ip, void *data)
+{
+	return __intel_pt_pgd_ip(ip, data) > 0;
+}
+
 static bool intel_pt_get_config(struct intel_pt *pt,
 				struct perf_event_attr *attr, u64 *config)
 {
@@ -726,6 +797,9 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt,
 	params.tsc_ctc_ratio_n = pt->tsc_ctc_ratio_n;
 	params.tsc_ctc_ratio_d = pt->tsc_ctc_ratio_d;
 
+	if (pt->filts.cnt > 0)
+		params.pgd_ip = intel_pt_pgd_ip;
+
 	if (pt->synth_opts.instructions) {
 		if (pt->synth_opts.period) {
 			switch (pt->synth_opts.period_type) {
@@ -1776,6 +1850,7 @@ static void intel_pt_free(struct perf_session *session)
 	intel_pt_free_events(session);
 	session->auxtrace = NULL;
 	thread__put(pt->unknown_thread);
+	addr_filters__exit(&pt->filts);
 	zfree(&pt->filter);
 	free(pt);
 }
@@ -2073,6 +2148,8 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	if (!pt)
 		return -ENOMEM;
 
+	addr_filters__init(&pt->filts);
+
 	perf_config(intel_pt_perf_config, pt);
 
 	err = auxtrace_queues__init(&pt->queues);
@@ -2147,6 +2224,10 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 				err = -EINVAL;
 				goto err_free_queues;
 			}
+			err = addr_filters__parse_bare_filter(&pt->filts,
+							      filter);
+			if (err)
+				goto err_free_queues;
 		}
 		intel_pt_print_info_str("Filter string", pt->filter);
 	}
@@ -2268,6 +2349,7 @@ err_free_queues:
 	auxtrace_queues__free(&pt->queues);
 	session->auxtrace = NULL;
 err_free:
+	addr_filters__exit(&pt->filts);
 	zfree(&pt->filter);
 	free(pt);
 	return err;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 23/27] perf probe: Ignore the error of finding inline instance
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (21 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 22/27] perf intel-pt: Fix decoding when there are address filters Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 24/27] perf probe: Skip if the function address is 0 Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Masami Hiramatsu, David Ahern,
	Namhyung Kim, Peter Zijlstra, Thomas Gleixner,
	Arnaldo Carvalho de Melo

From: Masami Hiramatsu <mhiramat@kernel.org>

Ignore the error when the perf probe failed to find inline function
instances. This can happen when we search a method in C++ debuginfo.  If
there is completely no instance in target, perf probe can return an
error.

E.g. without this fix:
  ----
  $ perf probe -x /usr/lib64/libstdc++.so.6 -vD showmanyc
  probe-definition(0): showmanyc
  symbol:showmanyc file:(null) line:0 offset:0 return:0 lazy:(null)
  0 arguments
  symbol:catch file:(null) line:0 offset:0 return:0 lazy:(null)
  symbol:throw file:(null) line:0 offset:0 return:0 lazy:(null)
  symbol:rethrow file:(null) line:0 offset:0 return:0 lazy:(null)
  Open Debuginfo file: /usr/lib/debug/usr/lib64/libstdc++.so.6.0.22.debug
  Try to find probe point from debuginfo.
  Matched function: showmanyc
  An error occurred in debuginfo analysis (-2).
  Trying to use symbols.
  Failed to find symbol showmanyc in /usr/lib64/libstdc++.so.6.0.22
    Error: Failed to add events. Reason: No such file or directory (Code: -2)
  ----

This is because one of showmanyc is defined as inline but no instance
found. With this fix, it is succeeded to show as below.
  ----
  $ perf probe -x /usr/lib64/libstdc++.so.6 -D showmanyc
  p:probe_libstdc++/showmanyc /usr/lib64/libstdc++.so.6.0.22:0xb0e50
  p:probe_libstdc++/showmanyc_1 /usr/lib64/libstdc++.so.6.0.22:0xc7c40
  p:probe_libstdc++/showmanyc_2 /usr/lib64/libstdc++.so.6.0.22:0xecfa0
  p:probe_libstdc++/showmanyc_3 /usr/lib64/libstdc++.so.6.0.22:0x115fc0
  p:probe_libstdc++/showmanyc_4 /usr/lib64/libstdc++.so.6.0.22:0x121a90
  ----

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/147464489775.29804.3190419491209875936.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-finder.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 8daca4fc1f8d..5fe8325e81f2 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -988,7 +988,8 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
 	if (pp->file && strtailcmp(pp->file, dwarf_decl_file(sp_die)))
 		return DWARF_CB_OK;
 
-	pr_debug("Matched function: %s\n", dwarf_diename(sp_die));
+	pr_debug("Matched function: %s [%lx]\n", dwarf_diename(sp_die),
+		 (unsigned long)dwarf_dieoffset(sp_die));
 	pf->fname = dwarf_decl_file(sp_die);
 	if (pp->line) { /* Function relative line */
 		dwarf_decl_line(sp_die, &pf->lno);
@@ -1011,7 +1012,7 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
 		param->retval = die_walk_instances(sp_die,
 					probe_point_inline_cb, (void *)pf);
 		/* This could be a non-existed inline definition */
-		if (param->retval == -ENOENT && strisglob(pp->function))
+		if (param->retval == -ENOENT)
 			param->retval = 0;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 24/27] perf probe: Skip if the function address is 0
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (22 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 23/27] perf probe: Ignore the error of finding inline instance Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 25/27] perf probe: Fix to cut off incompatible chars from group name Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Masami Hiramatsu, David Ahern,
	Namhyung Kim, Peter Zijlstra, Thomas Gleixner,
	Arnaldo Carvalho de Melo

From: Masami Hiramatsu <mhiramat@kernel.org>

Skip probes if the entry address of the target function is 0.  This can
happen when we're handling C++ debuginfo files.

E.g. without this fix, below case still fail.
  ----
  $ ./perf probe -x /usr/lib64/libstdc++.so.6 -vD is_open
  probe-definition(0): is_open
  symbol:is_open file:(null) line:0 offset:0 return:0 lazy:(null)
  0 arguments
  symbol:catch file:(null) line:0 offset:0 return:0 lazy:(null)
  symbol:throw file:(null) line:0 offset:0 return:0 lazy:(null)
  symbol:rethrow file:(null) line:0 offset:0 return:0 lazy:(null)
  Open Debuginfo file: /usr/lib/debug/usr/lib64/libstdc++.so.6.0.22.debug
  Try to find probe point from debuginfo.
  Matched function: is_open [295df]
  found inline addr: 0x8ca80
  Probe point found: is_open+0
  found inline addr: 0x8ca70
  Probe point found: is_open+0
  found inline addr: 0x8ca60
  Probe point found: is_open+0
  Matched function: is_open [6527f]
  Matched function: is_open [9fe8a]
  Probe point found: is_open+0
  Matched function: is_open [19710b]
  found inline addr: 0xecca9
  Probe point found: stdio_filebuf+57
  found inline addr: 0x0
  Probe point found: swap+0
  Matched function: is_open [19fc9d]
  Probe point found: is_open+0
  Found 7 probe_trace_events.
  p:probe_libstdc++/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
  p:probe_libstdc++/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
  p:probe_libstdc++/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
  p:probe_libstdc++/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
  p:probe_libstdc++/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
  Failed to synthesize probe trace event.
    Error: Failed to add events. Reason: Invalid argument (Code: -22)
  ----
This is because some instances have entry_pc == 0 (see 19710b and
19fc9d). With this fix, those are skipped.

  ----
  $ ./perf probe -x /usr/lib64/libstdc++.so.6 -D is_open
  p:probe_libstdc++/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
  p:probe_libstdc++/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
  p:probe_libstdc++/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
  p:probe_libstdc++/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
  p:probe_libstdc++/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
  ----

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/147464490707.29804.14277897643725143867.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-finder.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 5fe8325e81f2..df4debe564da 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -955,6 +955,11 @@ static int probe_point_inline_cb(Dwarf_Die *in_die, void *data)
 				   dwarf_diename(in_die));
 			return -ENOENT;
 		}
+		if (addr == 0) {
+			pr_debug("%s has no valid entry address. skipped.\n",
+				 dwarf_diename(in_die));
+			return -ENOENT;
+		}
 		pf->addr = addr;
 		pf->addr += pp->offset;
 		pr_debug("found inline addr: 0x%jx\n",
@@ -998,8 +1003,13 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
 	} else if (die_is_func_instance(sp_die)) {
 		/* Instances always have the entry address */
 		dwarf_entrypc(sp_die, &pf->addr);
+		/* But in some case the entry address is 0 */
+		if (pf->addr == 0) {
+			pr_debug("%s has no entry PC. Skipped\n",
+				 dwarf_diename(sp_die));
+			param->retval = 0;
 		/* Real function */
-		if (pp->lazy_line)
+		} else if (pp->lazy_line)
 			param->retval = find_probe_point_lazy(sp_die, pf);
 		else {
 			skip_prologue(sp_die, pf);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 25/27] perf probe: Fix to cut off incompatible chars from group name
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (23 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 24/27] perf probe: Skip if the function address is 0 Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 26/27] perf probe: Match linkage name with mangled name Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Masami Hiramatsu, David Ahern,
	Namhyung Kim, Peter Zijlstra, Thomas Gleixner,
	Arnaldo Carvalho de Melo

From: Masami Hiramatsu <mhiramat@kernel.org>

Cut off the characters which can not use for group name of uprobes
when making it based on executable filename.

For example, if the exec name is libstdc++.so, without this fix
perf probe generates "probe_libstdc++" as the group name, but
it is failed to set because '+' can not be used for group name.

With this fix perf accepts only alphabet, number or '_' for group
name, thus perf generates "probe_libstdc" as the group name.

E.g. with this fix, you can see the event name has no "+".
  ----
  $ ./perf probe -x /usr/lib64/libstdc++.so.6 -D is_open
  p:probe_libstdc/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
  p:probe_libstdc/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
  p:probe_libstdc/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
  p:probe_libstdc/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
  p:probe_libstdc/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
  ----

Committer note:

Before this fix:

  # perf probe -x /usr/lib64/libstdc++.so.6 is_open
  Failed to write event: Invalid argument
    Error: Failed to add events.
  #

After the fix:

  # perf probe -x /usr/lib64/libstdc++.so.6 is_open
  Added new events:
    probe_libstdc:is_open (on is_open in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_1 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_2 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_3 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_4 (on is_open in /usr/lib64/libstdc++.so.6.0.22)

  You can now use it in all perf tools, such as:

	  perf record -e probe_libstdc:is_open_4 -aR sleep 1

  # perf probe -l probe_libstdc:*
    probe_libstdc:is_open (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_1 (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_2 (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_3 (on is_open@src/c++98/basic_file.cc in /usr/lib64/libstdc++.so.6.0.22)
    probe_libstdc:is_open_4 (on stdio_filebuf:5@include/ext/stdio_filebuf.h in /usr/lib64/libstdc++.so.6.0.22)
  #

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/147464491667.29804.9553638175441827970.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index bc60ce49720b..fcfbef07b92d 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -213,9 +213,13 @@ static int convert_exec_to_group(const char *exec, char **result)
 		goto out;
 	}
 
-	ptr2 = strpbrk(ptr1, "-._");
-	if (ptr2)
-		*ptr2 = '\0';
+	for (ptr2 = ptr1; ptr2 != '\0'; ptr2++) {
+		if (!isalnum(*ptr2) && *ptr2 != '_') {
+			*ptr2 = '\0';
+			break;
+		}
+	}
+
 	ret = e_snprintf(buf, 64, "%s_%s", PERFPROBE_GROUP, ptr1);
 	if (ret < 0)
 		goto out;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 26/27] perf probe: Match linkage name with mangled name
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (24 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 25/27] perf probe: Fix to cut off incompatible chars from group name Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 14:35 ` [PATCH 27/27] perf tests: Add dwarf unwind test for powerpc Arnaldo Carvalho de Melo
  2016-09-29 17:11 ` [GIT PULL 00/27] perf/core improvements and fixes Ingo Molnar
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Masami Hiramatsu, David Ahern,
	Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Masami Hiramatsu <mhiramat@kernel.org>

Match linkage name with mangled name if exists. The linkage_name is used
for storing mangled name of the object.

Thus, this allows 'perf probe' to find appropriate probe point from
mangled symbol as below.

E.g. without this fix:
  ----
  $ perf probe -x /usr/lib64/libstdc++.so.6 \
    -D _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
  Probe point '_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv'
  not found.
    Error: Failed to add events.
  ----

With this fix, perf probe can find the correct one.
  ----
  $ perf probe -x /usr/lib64/libstdc++.so.6 \
    -D _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
  p:probe_libstdc/_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
  /usr/lib64/libstdc++.so.6.0.22:0x8ca60
  ----

Committer notes:

After the fix, setting it for real (no -D/--definition, that amounts to
a --dry-run):

  # perf probe -x /usr/lib64/libstdc++.so.6 _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
  Added new event:
    probe_libstdc:_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv (on _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv in /usr/lib64/libstdc++.so.6.0.22)

  You can now use it in all perf tools, such as:

	perf record -e probe_libstdc:_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv -aR sleep 1

  # perf probe -l probe_libstdc:*
    probe_libstdc:_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
  #

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/147464493162.29804.16715053505069382443.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dwarf-aux.c | 28 ++++++++++++++++++++++++++--
 tools/perf/util/dwarf-aux.h |  3 +++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index faec899435f2..41e068e94349 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -130,6 +130,22 @@ int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr,
 }
 
 /**
+ * die_get_linkage_name - Get the linkage name of the object
+ * @dw_die: A DIE of the object
+ *
+ * Get the linkage name attiribute of given @dw_die.
+ * For C++ binary, the linkage name will be the mangled symbol.
+ */
+const char *die_get_linkage_name(Dwarf_Die *dw_die)
+{
+	Dwarf_Attribute attr;
+
+	if (dwarf_attr_integrate(dw_die, DW_AT_linkage_name, &attr) == NULL)
+		return NULL;
+	return dwarf_formstring(&attr);
+}
+
+/**
  * die_compare_name - Compare diename and tname
  * @dw_die: a DIE
  * @tname: a string of target name
@@ -145,18 +161,26 @@ bool die_compare_name(Dwarf_Die *dw_die, const char *tname)
 }
 
 /**
- * die_match_name - Match diename and glob
+ * die_match_name - Match diename/linkage name and glob
  * @dw_die: a DIE
  * @glob: a string of target glob pattern
  *
  * Glob matching the name of @dw_die and @glob. Return false if matching fail.
+ * This also match linkage name.
  */
 bool die_match_name(Dwarf_Die *dw_die, const char *glob)
 {
 	const char *name;
 
 	name = dwarf_diename(dw_die);
-	return name ? strglobmatch(name, glob) : false;
+	if (name && strglobmatch(name, glob))
+		return true;
+	/* fall back to check linkage name */
+	name = die_get_linkage_name(dw_die);
+	if (name && strglobmatch(name, glob))
+		return true;
+
+	return false;
 }
 
 /**
diff --git a/tools/perf/util/dwarf-aux.h b/tools/perf/util/dwarf-aux.h
index 8b6d2f83af02..8ac53bf1ec4e 100644
--- a/tools/perf/util/dwarf-aux.h
+++ b/tools/perf/util/dwarf-aux.h
@@ -38,6 +38,9 @@ int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr,
 int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr,
 			 int (*callback)(Dwarf_Die *, void *), void *data);
 
+/* Get DW_AT_linkage_name (should be NULL for C binary) */
+const char *die_get_linkage_name(Dwarf_Die *dw_die);
+
 /* Ensure that this DIE is a subprogram and definition (not declaration) */
 bool die_is_func_def(Dwarf_Die *dw_die);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 27/27] perf tests: Add dwarf unwind test for powerpc
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (25 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 26/27] perf probe: Match linkage name with mangled name Arnaldo Carvalho de Melo
@ 2016-09-29 14:35 ` Arnaldo Carvalho de Melo
  2016-09-29 17:11 ` [GIT PULL 00/27] perf/core improvements and fixes Ingo Molnar
  27 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-29 14:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linux Weekly News, Ravi Bangoria,
	Alexander Shishkin, Anju T Sudhakar, Josh Poimboeuf,
	Masami Hiramatsu, Matt Fleming, Michael Ellerman, Namhyung Kim,
	Peter Zijlstra, Wang Nan, linuxppc-dev, Arnaldo Carvalho de Melo

From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

The user stack dump feature was recently added for powerpc. But there
was no test case available to test it.

This test works same as on other architectures by preparing a stack
frame on the perf test thread and comparing each frame by unwinding it.

  $ ./perf test 50
    50: Test dwarf unwind    : Ok

User stack dump for powerpc: https://lkml.org/lkml/2016/4/28/482

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1474267100-31079-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/powerpc/Build                |  1 +
 tools/perf/arch/powerpc/include/arch-tests.h | 13 ++++
 tools/perf/arch/powerpc/include/perf_regs.h  |  2 +
 tools/perf/arch/powerpc/tests/Build          |  4 ++
 tools/perf/arch/powerpc/tests/arch-tests.c   | 15 +++++
 tools/perf/arch/powerpc/tests/dwarf-unwind.c | 62 ++++++++++++++++++
 tools/perf/arch/powerpc/tests/regs_load.S    | 94 ++++++++++++++++++++++++++++
 tools/perf/tests/Build                       |  2 +-
 tools/perf/tests/dwarf-unwind.c              |  2 +-
 9 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 tools/perf/arch/powerpc/include/arch-tests.h
 create mode 100644 tools/perf/arch/powerpc/tests/Build
 create mode 100644 tools/perf/arch/powerpc/tests/arch-tests.c
 create mode 100644 tools/perf/arch/powerpc/tests/dwarf-unwind.c
 create mode 100644 tools/perf/arch/powerpc/tests/regs_load.S

diff --git a/tools/perf/arch/powerpc/Build b/tools/perf/arch/powerpc/Build
index 54afe4a467e7..db52fa22d3a1 100644
--- a/tools/perf/arch/powerpc/Build
+++ b/tools/perf/arch/powerpc/Build
@@ -1 +1,2 @@
 libperf-y += util/
+libperf-y += tests/
diff --git a/tools/perf/arch/powerpc/include/arch-tests.h b/tools/perf/arch/powerpc/include/arch-tests.h
new file mode 100644
index 000000000000..84d8dedef2ed
--- /dev/null
+++ b/tools/perf/arch/powerpc/include/arch-tests.h
@@ -0,0 +1,13 @@
+#ifndef ARCH_TESTS_H
+#define ARCH_TESTS_H
+
+#ifdef HAVE_DWARF_UNWIND_SUPPORT
+struct thread;
+struct perf_sample;
+int test__arch_unwind_sample(struct perf_sample *sample,
+			     struct thread *thread);
+#endif
+
+extern struct test arch_tests[];
+
+#endif
diff --git a/tools/perf/arch/powerpc/include/perf_regs.h b/tools/perf/arch/powerpc/include/perf_regs.h
index 75de0e92e71e..c12f4e804f66 100644
--- a/tools/perf/arch/powerpc/include/perf_regs.h
+++ b/tools/perf/arch/powerpc/include/perf_regs.h
@@ -5,6 +5,8 @@
 #include <linux/types.h>
 #include <asm/perf_regs.h>
 
+void perf_regs_load(u64 *regs);
+
 #define PERF_REGS_MASK  ((1ULL << PERF_REG_POWERPC_MAX) - 1)
 #define PERF_REGS_MAX   PERF_REG_POWERPC_MAX
 #ifdef __powerpc64__
diff --git a/tools/perf/arch/powerpc/tests/Build b/tools/perf/arch/powerpc/tests/Build
new file mode 100644
index 000000000000..d827ef384b33
--- /dev/null
+++ b/tools/perf/arch/powerpc/tests/Build
@@ -0,0 +1,4 @@
+libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o
+libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
+
+libperf-y += arch-tests.o
diff --git a/tools/perf/arch/powerpc/tests/arch-tests.c b/tools/perf/arch/powerpc/tests/arch-tests.c
new file mode 100644
index 000000000000..e24f46241f40
--- /dev/null
+++ b/tools/perf/arch/powerpc/tests/arch-tests.c
@@ -0,0 +1,15 @@
+#include <string.h>
+#include "tests/tests.h"
+#include "arch-tests.h"
+
+struct test arch_tests[] = {
+#ifdef HAVE_DWARF_UNWIND_SUPPORT
+	{
+		.desc = "Test dwarf unwind",
+		.func = test__dwarf_unwind,
+	},
+#endif
+	{
+		.func = NULL,
+	},
+};
diff --git a/tools/perf/arch/powerpc/tests/dwarf-unwind.c b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
new file mode 100644
index 000000000000..0bac3137ccbd
--- /dev/null
+++ b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
@@ -0,0 +1,62 @@
+#include <string.h>
+#include "perf_regs.h"
+#include "thread.h"
+#include "map.h"
+#include "event.h"
+#include "debug.h"
+#include "tests/tests.h"
+#include "arch-tests.h"
+
+#define STACK_SIZE 8192
+
+static int sample_ustack(struct perf_sample *sample,
+			 struct thread *thread, u64 *regs)
+{
+	struct stack_dump *stack = &sample->user_stack;
+	struct map *map;
+	unsigned long sp;
+	u64 stack_size, *buf;
+
+	buf = malloc(STACK_SIZE);
+	if (!buf) {
+		pr_debug("failed to allocate sample uregs data\n");
+		return -1;
+	}
+
+	sp = (unsigned long) regs[PERF_REG_POWERPC_R1];
+
+	map = map_groups__find(thread->mg, MAP__VARIABLE, (u64) sp);
+	if (!map) {
+		pr_debug("failed to get stack map\n");
+		free(buf);
+		return -1;
+	}
+
+	stack_size = map->end - sp;
+	stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size;
+
+	memcpy(buf, (void *) sp, stack_size);
+	stack->data = (char *) buf;
+	stack->size = stack_size;
+	return 0;
+}
+
+int test__arch_unwind_sample(struct perf_sample *sample,
+			     struct thread *thread)
+{
+	struct regs_dump *regs = &sample->user_regs;
+	u64 *buf;
+
+	buf = calloc(1, sizeof(u64) * PERF_REGS_MAX);
+	if (!buf) {
+		pr_debug("failed to allocate sample uregs data\n");
+		return -1;
+	}
+
+	perf_regs_load(buf);
+	regs->abi  = PERF_SAMPLE_REGS_ABI;
+	regs->regs = buf;
+	regs->mask = PERF_REGS_MASK;
+
+	return sample_ustack(sample, thread, buf);
+}
diff --git a/tools/perf/arch/powerpc/tests/regs_load.S b/tools/perf/arch/powerpc/tests/regs_load.S
new file mode 100644
index 000000000000..d76c9a32f327
--- /dev/null
+++ b/tools/perf/arch/powerpc/tests/regs_load.S
@@ -0,0 +1,94 @@
+#include <linux/linkage.h>
+
+/* Offset is based on macros from arch/powerpc/include/uapi/asm/ptrace.h. */
+#define R0	 0
+#define R1	 1 * 8
+#define R2	 2 * 8
+#define R3	 3 * 8
+#define R4	 4 * 8
+#define R5	 5 * 8
+#define R6	 6 * 8
+#define R7	 7 * 8
+#define R8	 8 * 8
+#define R9	 9 * 8
+#define R10	10 * 8
+#define R11	11 * 8
+#define R12	12 * 8
+#define R13	13 * 8
+#define R14	14 * 8
+#define R15	15 * 8
+#define R16	16 * 8
+#define R17	17 * 8
+#define R18	18 * 8
+#define R19	19 * 8
+#define R20	20 * 8
+#define R21	21 * 8
+#define R22	22 * 8
+#define R23	23 * 8
+#define R24	24 * 8
+#define R25	25 * 8
+#define R26	26 * 8
+#define R27	27 * 8
+#define R28	28 * 8
+#define R29	29 * 8
+#define R30	30 * 8
+#define R31	31 * 8
+#define NIP	32 * 8
+#define CTR	35 * 8
+#define LINK	36 * 8
+#define XER	37 * 8
+
+.globl perf_regs_load
+perf_regs_load:
+	std 0, R0(3)
+	std 1, R1(3)
+	std 2, R2(3)
+	std 3, R3(3)
+	std 4, R4(3)
+	std 5, R5(3)
+	std 6, R6(3)
+	std 7, R7(3)
+	std 8, R8(3)
+	std 9, R9(3)
+	std 10, R10(3)
+	std 11, R11(3)
+	std 12, R12(3)
+	std 13, R13(3)
+	std 14, R14(3)
+	std 15, R15(3)
+	std 16, R16(3)
+	std 17, R17(3)
+	std 18, R18(3)
+	std 19, R19(3)
+	std 20, R20(3)
+	std 21, R21(3)
+	std 22, R22(3)
+	std 23, R23(3)
+	std 24, R24(3)
+	std 25, R25(3)
+	std 26, R26(3)
+	std 27, R27(3)
+	std 28, R28(3)
+	std 29, R29(3)
+	std 30, R30(3)
+	std 31, R31(3)
+
+	/* store NIP */
+	mflr 4
+	std 4, NIP(3)
+
+	/* Store LR */
+	std 4, LINK(3)
+
+	/* Store XER */
+	mfxer 4
+	std 4, XER(3)
+
+	/* Store CTR */
+	mfctr 4
+	std 4, CTR(3)
+
+	/* Restore original value of r4 */
+	ld 4, R4(3)
+
+	blr
diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index dc51bc570e51..8a4ce492f7b2 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -71,7 +71,7 @@ $(OUTPUT)tests/llvm-src-relocation.c: tests/bpf-script-test-relocation.c tests/B
 	$(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
 	$(Q)echo ';' >> $@
 
-ifeq ($(ARCH),$(filter $(ARCH),x86 arm arm64))
+ifeq ($(ARCH),$(filter $(ARCH),x86 arm arm64 powerpc))
 perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
 endif
 
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 8f6eb853aaf7..1046491de4b2 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -11,7 +11,7 @@
 #include "thread.h"
 #include "callchain.h"
 
-#if defined (__x86_64__) || defined (__i386__)
+#if defined (__x86_64__) || defined (__i386__) || defined (__powerpc__)
 #include "arch-tests.h"
 #endif
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 00/27] perf/core improvements and fixes
  2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (26 preceding siblings ...)
  2016-09-29 14:35 ` [PATCH 27/27] perf tests: Add dwarf unwind test for powerpc Arnaldo Carvalho de Melo
@ 2016-09-29 17:11 ` Ingo Molnar
  27 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2016-09-29 17:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Linux Weekly News, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Anju T Sudhakar, Chong Jiang,
	Clark Williams, Daniel Bristot de Oliveira, David Ahern,
	Jiri Olsa, Josh Poimboeuf, linux-arm-kernel, linuxppc-dev,
	Masami Hiramatsu, Mathieu Poirier, Matt Fleming,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra, pi3orama,
	Ravi Bangoria, Simon Que, Steven Rostedt, Thomas Gleixner,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling, more to come soon,
> 
> - Arnaldo
> 
> Build and test results at the end of this message.
> 
> The following changes since commit 6b652de2b27c0a4020ce0e8f277e782b6af76096:
> 
>   Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-23 07:21:38 +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-20160929
> 
> for you to fetch changes up to d18019a53a07e009899ff6b8dc5ec30f249360d9:
> 
>   perf tests: Add dwarf unwind test for powerpc (2016-09-29 11:18:21 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> -------------
> 
> New features:
> 
> - Add support for using symbols in address filters with Intel PT and ARM
>   CoreSight (hardware assisted tracing facilities) (Adrian Hunter, Mathieu Poirier)
> 
> Fixes:
> 
> - Fix MMAP event synthesis for pre-existing threads when no hugetlbfs
>   mount is in place (Adrian Hunter)
> 
> - Don't ignore kernel idle symbols in 'perf script' (Adrian Hunter)
> 
> - Assorted Intel PT fixes (Adrian Hunter)
> 
> Improvements:
> 
> - Fix handling of C++ symbols in 'perf probe' (Masami Hiramatsu)
> 
> - Beautify sched_[gs]et_attr return value in 'perf trace' (Arnaldo Carvalho de Melo)
> 
> Infrastructure:
> ---------------
> 
> New features:
> 
> - Add dwarf unwind 'perf test' for powerpc (Ravi Bangoria)
> 
> Fixes:
> 
> - Fix error paths in 'perf record' (Adrian Hunter)
> 
> Documentation:
> 
> - Update documentation info about quipper, a C++ parser for converting
>   to/from perf.data/chromium profiling format (Simon Que)
> 
> Build Fixes:
> 
>   Fix building in 32 bit platform with libbabeltrace (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (16):
>       perf record: Fix documentation 'event_sources' -> 'event_source'
>       perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
>       perf script: Fix vanished idle symbols
>       perf record: Rename label 'out_symbol_exit'
>       perf record: Fix error paths
>       perf symbols: Add dso__last_symbol()
>       perf record: Add support for using symbols in address filters
>       perf probe: Increase debug level of SDT debug messages
>       perf intel-pt: Fix snapshot overlap detection decoder errors
>       perf intel-pt: Add support for recording the max non-turbo ratio
>       perf intel-pt: Fix missing error codes processing auxtrace_info
>       perf intel-pt: Add a helper function for processing AUXTRACE_INFO
>       perf intel-pt: Record address filter in AUXTRACE_INFO event
>       perf intel-pt: Read address filter from AUXTRACE_INFO event
>       perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
>       perf intel-pt: Fix decoding when there are address filters
> 
> Arnaldo Carvalho de Melo (1):
>       perf trace: Beautify sched_[gs]et_attr return value
> 
> Masami Hiramatsu (4):
>       perf probe: Ignore the error of finding inline instance
>       perf probe: Skip if the function address is 0
>       perf probe: Fix to cut off incompatible chars from group name
>       perf probe: Match linkage name with mangled name
> 
> Mathieu Poirier (3):
>       perf tools: Make perf_evsel__append_filter() generic
>       perf evsel: New tracepoint specific function
>       perf evsel: Add support for address filters
> 
> Ravi Bangoria (1):
>       perf tests: Add dwarf unwind test for powerpc
> 
> Simon Que (1):
>       perf tools: Update documentation info about quipper
> 
> Wang Nan (1):
>       perf data: Fix building in 32 bit platform with libbabeltrace
> 
>  tools/perf/Documentation/perf-record.txt           |  61 +-
>  tools/perf/Documentation/perf.data-file-format.txt |   6 +-
>  tools/perf/arch/powerpc/Build                      |   1 +
>  tools/perf/arch/powerpc/include/arch-tests.h       |  13 +
>  tools/perf/arch/powerpc/include/perf_regs.h        |   2 +
>  tools/perf/arch/powerpc/tests/Build                |   4 +
>  tools/perf/arch/powerpc/tests/arch-tests.c         |  15 +
>  tools/perf/arch/powerpc/tests/dwarf-unwind.c       |  62 ++
>  tools/perf/arch/powerpc/tests/regs_load.S          |  94 +++
>  tools/perf/arch/x86/util/intel-pt.c                |  57 +-
>  tools/perf/builtin-record.c                        |  32 +-
>  tools/perf/builtin-trace.c                         |  10 +-
>  tools/perf/tests/Build                             |   2 +-
>  tools/perf/tests/dwarf-unwind.c                    |   2 +-
>  tools/perf/util/auxtrace.c                         | 737 +++++++++++++++++++++
>  tools/perf/util/auxtrace.h                         |  54 ++
>  tools/perf/util/build-id.c                         |   4 +-
>  tools/perf/util/data-convert-bt.c                  |   2 +-
>  tools/perf/util/dwarf-aux.c                        |  28 +-
>  tools/perf/util/dwarf-aux.h                        |   3 +
>  tools/perf/util/event.c                            |   3 +-
>  tools/perf/util/evsel.c                            |  16 +-
>  tools/perf/util/evsel.h                            |   5 +-
>  tools/perf/util/evsel_fprintf.c                    |   7 +-
>  .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |  30 +
>  .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |   1 +
>  tools/perf/util/intel-pt.c                         | 172 ++++-
>  tools/perf/util/intel-pt.h                         |   4 +-
>  tools/perf/util/parse-events.c                     |  41 +-
>  tools/perf/util/probe-event.c                      |  10 +-
>  tools/perf/util/probe-file.c                       |   2 +-
>  tools/perf/util/probe-finder.c                     |  17 +-
>  tools/perf/util/symbol.c                           |  15 +
>  tools/perf/util/symbol.h                           |   1 +
>  34 files changed, 1451 insertions(+), 62 deletions(-)
>  create mode 100644 tools/perf/arch/powerpc/include/arch-tests.h
>  create mode 100644 tools/perf/arch/powerpc/tests/Build
>  create mode 100644 tools/perf/arch/powerpc/tests/arch-tests.c
>  create mode 100644 tools/perf/arch/powerpc/tests/dwarf-unwind.c
>  create mode 100644 tools/perf/arch/powerpc/tests/regs_load.S
> 
>   # time dm
>    1  alpine:3.4: Ok
>    2 android-ndk:r12b-arm: Ok
>    3 archlinux:latest: Ok
>    4 centos:5: Ok
>    5 centos:6: Ok
>    6 centos:7: Ok
>    7 debian:7: Ok
>    8 debian:8: Ok
>    9 debian:experimental: Ok
>   10 fedora:20: Ok
>   11 fedora:21: Ok
>   12 fedora:22: Ok
>   13 fedora:23: Ok
>   14 fedora:24: Ok
>   15 fedora:24-x-ARC-uClibc: Ok
>   16 fedora:rawhide: Ok
>   17 mageia:5: Ok
>   18 opensuse:13.2: Ok
>   19 opensuse:42.1: Ok
>   20 opensuse:tumbleweed: Ok
>   21 ubuntu:12.04.5: Ok
>   22 ubuntu:14.04: Ok
>   23 ubuntu:14.04.4: Ok
>   24 ubuntu:15.10: Ok
>   25 ubuntu:16.04: Ok
>   26 ubuntu:16.04-x-arm: Ok
>   27 ubuntu:16.04-x-arm64: Ok
>   28 ubuntu:16.04-x-powerpc: Ok
>   29 ubuntu:16.04-x-powerpc64: Ok
>   30 ubuntu:16.04-x-powerpc64el: Ok
>   31 ubuntu:16.04-x-s390: Ok
>   32 ubuntu:16.10: Ok
>   33 2246.21
> 
>   real	37m26.862s
>   user	0m2.148s
>   sys	0m2.256s
>   # 
> 
>   # 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 events tests                                       : Ok
>    6: Validate PERF_RECORD_* events & perf_sample fields       : Ok
>    7: Test perf pmu format parsing                             : Ok
>    8: Test dso data read                                       : Ok
>    9: Test dso data cache                                      : Ok
>   10: Test dso data reopen                                     : Ok
>   11: roundtrip evsel->name check                              : Ok
>   12: Check parsing of sched tracepoints fields                : Ok
>   13: Generate and check syscalls:sys_enter_openat event fields: Ok
>   14: struct perf_event_attr setup                             : Ok
>   15: Test matching and linking multiple hists                 : Ok
>   16: Try 'import perf' in python, checking link problems      : Ok
>   17: Test breakpoint overflow signal handler                  : Ok
>   18: Test breakpoint overflow sampling                        : Ok
>   19: Test number of exit event of a simple workload           : Ok
>   20: Test software clock events have valid period values      : Ok
>   21: Test object code reading                                 : Ok
>   22: Test sample parsing                                      : Ok
>   23: Test using a dummy software event to keep tracking       : Ok
>   24: Test parsing with no sample_id_all bit set               : Ok
>   25: Test filtering hist entries                              : Ok
>   26: Test mmap thread lookup                                  : Ok
>   27: Test thread mg sharing                                   : Ok
>   28: Test output sorting of hist entries                      : Ok
>   29: Test cumulation of child hist entries                    : Ok
>   30: Test tracking 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: Test kmod_path__parse function                           : Ok
>   34: Test thread map                                          : Ok
>   35: Test LLVM searching and compiling                        :
>   35.1: Basic BPF llvm compiling test                          : Ok
>   35.2: Test kbuild searching                                  : Ok
>   35.3: Compile source for BPF prologue generation test        : Ok
>   35.4: Compile source for BPF relocation test                 : Ok
>   36: Test topology in session                                 : Ok
>   37: Test BPF filter                                          :
>   37.1: Test basic BPF filtering                               : Ok
>   37.2: Test BPF prologue generation                           : Ok
>   37.3: Test BPF relocation checker                            : Ok
>   38: Test thread map synthesize                               : Ok
>   39: Test cpu map synthesize                                  : Ok
>   40: Test stat config synthesize                              : Ok
>   41: Test stat synthesize                                     : Ok
>   42: Test stat round synthesize                               : Ok
>   43: Test attr update synthesize                              : Ok
>   44: Test events times                                        : Ok
>   45: Test backward reading from ring buffer                   : Ok
>   46: Test cpu map print                                       : Ok
>   47: Test SDT event probing                                   : Ok
>   48: Test is_printable_array function                         : Ok
>   49: Test bitmap print                                        : Ok
>   50: x86 rdpmc test                                           : Ok
>   51: Test converting perf time to TSC                         : Ok
>   52: Test dwarf unwind                                        : Ok
>   53: Test x86 instruction decoder - new instructions          : Ok
>   54: Test intel cqm nmi context read                          : Skip
>   #
> 
>   $ make -C tools/perf build-test
>   make: Entering directory '/home/acme/git/linux/tools/perf'
>                         tarpkg: ./tests/perf-targz-src-pkg .
>                   make_debug_O: make DEBUG=1
>              make_no_libnuma_O: make NO_LIBNUMA=1
>                make_no_slang_O: make NO_SLANG=1
>             make_no_libaudit_O: make NO_LIBAUDIT=1
>               make_no_libbpf_O: make NO_LIBBPF=1
>    make_install_prefix_slash_O: make install prefix=/tmp/krava/
>                    make_tags_O: make tags
>                     make_doc_O: make doc
>            make_no_libunwind_O: make NO_LIBUNWIND=1
>             make_install_bin_O: make install-bin
>            make_no_libbionic_O: make NO_LIBBIONIC=1
>         make_with_babeltrace_O: make LIBBABELTRACE=1
>             make_no_demangle_O: make NO_DEMANGLE=1
>                  make_perf_o_O: make perf.o
>             make_no_auxtrace_O: make NO_AUXTRACE=1
>              make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
>                    make_pure_O: make
>              make_util_map_o_O: make util/map.o
>   make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
>                 make_no_newt_O: make NO_NEWT=1
>            make_no_libpython_O: make NO_LIBPYTHON=1
>        make_util_pmu_bison_o_O: make util/pmu-bison.o
>                    make_help_O: make help
>          make_install_prefix_O: make install prefix=/tmp/krava
>                  make_static_O: make LDFLAGS=-static
>                   make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
>            make_no_backtrace_O: make NO_BACKTRACE=1
>               make_clean_all_O: make clean all
>                 make_install_O: make install
>               make_no_libelf_O: make NO_LIBELF=1
>              make_no_libperl_O: make NO_LIBPERL=1
>                 make_no_gtk2_O: make NO_GTK2=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
>   OK
>   make: Leaving directory '/home/acme/git/linux/tools/perf'
>   $

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 00/27] perf/core improvements and fixes
@ 2018-09-24 15:02 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-09-24 15:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Clark Williams, linux-kernel, linux-perf-users,
	Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
	Andrew Morton, Jin Yao, Jiri Olsa, John Garry, Josh Poimboeuf,
	Kim Phillips, linux-arm-kernel, linux-trace-devel, Namhyung Kim,
	Sangwon Hong, Sean V Kelley, Steven Rostedt, Tzvetomir Stoyanov,
	William Cohen, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, this is on top of
perf-core-for-mingo-4.20-20180919, that is not yet in tip.

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit 24ef0fd0a1f389b156e6ef0edd71072728831bd9:

  perf python: Use -Wno-redundant-decls to build with PYTHON=python3 (2018-09-19 10:25:13 -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.20-20180919

for you to fetch changes up to 24ef0fd0a1f389b156e6ef0edd71072728831bd9:

  perf python: Use -Wno-redundant-decls to build with PYTHON=python3 (2018-09-19 10:25:13 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

perf test:

- Add watchpoint entry (Ravi Bangoria)

Build fixes:

- Initialize perf_data_file fd field to fix building the CTF (trace format)
  converter with with gcc 4.8.4 on Ubuntu 14.04 (Jérémie Galarneau)

- Use -Wno-redundant-decls to build with PYTHON=python3 to
  build the python binding, fixing the build in systems such
  as Clear Linux (Arnaldo Carvalho de Melo)

Hardware tracing:

- Suppress AUX/OVERWRITE records (Alexander Shishkin)

Infrastructure:

- Adopt PTR_ERR_OR_ZERO from the kernel and use it in
  the bpf-loader instead of open coded equivalent (Ding Xiang)

- Improve the event ordering code to make it clear and fix
  a bug related to freeing of events when using pipe mode
  from 'record' to 'inject' (Jiri Olsa)

- Some prep work to facilitate per-cpu threads to write
  record data to per-cpu files (Jiri Olsa)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------

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, and building with LIBCLANGLLVM=1
(built-in clang) with gcc and clang when clang and its devel libraries
are installed.

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.

The Clear Linux container is building with NO_CLANG=1, the problem preventing
its use when building for python3 has been identified and the next builds will
build in ClearLinux with both gcc and clang. This time around only gcc was
used.

  # 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:3.8                    : Ok   gcc (Alpine 6.4.0) 6.4.0
   6 alpine:edge                   : Ok   gcc (Alpine 6.4.0) 6.4.0
   7 amazonlinux:1                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
   8 amazonlinux:2                 : Ok   gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
   9 android-ndk:r12b-arm          : Ok   arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
  10 android-ndk:r15c-arm          : Ok   arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
  11 centos:5                      : Ok   gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
  12 centos:6                      : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
  13 centos:7                      : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
  14 clearlinux:latest             : Ok   gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502
  15 debian:7                      : Ok   gcc (Debian 4.7.2-5) 4.7.2
  16 debian:8                      : Ok   gcc (Debian 4.9.2-10+deb8u1) 4.9.2
  17 debian:9                      : Ok   gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
  18 debian:experimental           : Ok   gcc (Debian 8.2.0-4) 8.2.0
  19 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc (Debian 8.2.0-4) 8.2.0
  20 debian:experimental-x-mips    : Ok   mips-linux-gnu-gcc (Debian 8.2.0-4) 8.2.0
  21 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc (Debian 8.1.0-12) 8.1.0
  22 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 8.2.0-4) 8.2.0
  23 fedora:20                     : Ok   gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
  24 fedora:21                     : Ok   gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
  25 fedora:22                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  26 fedora:23                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  27 fedora:24                     : Ok   gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  28 fedora:24-x-ARC-uClibc        : Ok   arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
  29 fedora:25                     : Ok   gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
  30 fedora:26                     : Ok   gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
  31 fedora:27                     : Ok   gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6)
  32 fedora:28                     : Ok   gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
  33 fedora:rawhide                : Ok   gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3)
  34 gentoo-stage3-amd64:latest    : Ok   gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0
  35 mageia:5                      : Ok   gcc (GCC) 4.9.2
  36 mageia:6                      : Ok   gcc (Mageia 5.5.0-1.mga6) 5.5.0
  37 opensuse:13.2                 : Ok   gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
  38 opensuse:42.1                 : Ok   gcc (SUSE Linux) 4.8.5
  39 opensuse:42.2                 : Ok   gcc (SUSE Linux) 4.8.5
  40 opensuse:42.3                 : Ok   gcc (SUSE Linux) 4.8.5
  41 opensuse:tumbleweed           : Ok   gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
  42 oraclelinux:6                 : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1)
  43 oraclelinux:7                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28.0.1)
  44 ubuntu:12.04.5                : Ok   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  45 ubuntu:14.04.4                : Ok   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  46 ubuntu:14.04.4-x-linaro-arm64 : Ok   aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0
  47 ubuntu:16.04                  : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  48 ubuntu:16.04-x-arm            : Ok   arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  49 ubuntu:16.04-x-arm64          : Ok   aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  50 ubuntu:16.04-x-powerpc        : Ok   powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  51 ubuntu:16.04-x-powerpc64      : Ok   powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  52 ubuntu:16.04-x-powerpc64el    : Ok   powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  53 ubuntu:16.04-x-s390           : Ok   s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  54 ubuntu:16.10                  : Ok   gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
  55 ubuntu:17.10                  : Ok   gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
  56 ubuntu:18.04                  : Ok   gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  57 ubuntu:18.04-x-arm            : Ok   arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0
  58 ubuntu:18.04-x-arm64          : Ok   aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0
  59 ubuntu:18.04-x-m68k           : Ok   m68k-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  60 ubuntu:18.04-x-powerpc        : Ok   powerpc-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  61 ubuntu:18.04-x-powerpc64      : Ok   powerpc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  62 ubuntu:18.04-x-powerpc64el    : Ok   powerpc64le-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  63 ubuntu:18.04-x-riscv64        : Ok   riscv64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  64 ubuntu:18.04-x-s390           : Ok   s390x-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  65 ubuntu:18.04-x-sh4            : Ok   sh4-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  66 ubuntu:18.04-x-sparc64        : Ok   sparc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  67 ubuntu:18.10                  : Ok   gcc (Ubuntu 8.2.0-4ubuntu1) 8.2.0

  # uname -a
  Linux jouet 4.19.0-rc4-00022-gad3273d5f1b9 #1 SMP Mon Sep 17 17:18:22 -03 2018 x86_64 x86_64 x86_64 GNU/Linux
  # git log --oneline -1
  d35c595bf005 perf vendor events arm64: Revise core JSON events for eMAG
  # perf version --build-options
  perf version 4.19.rc2.gd35c595
                   dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
      dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                   glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
                    gtk2: [ on  ]  # HAVE_GTK2_SUPPORT
           syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                  libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                  libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
                 libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
  numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
                 libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
               libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
                libslang: [ on  ]  # HAVE_SLANG_SUPPORT
               libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
               libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
      libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                    zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                    lzma: [ on  ]  # HAVE_LZMA_SUPPORT
               get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                     bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
  # 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                                 : Ok
  22: Watchpoint                                            :
  22.1: Read Only Watchpoint                                : Skip
  22.2: Write Only Watchpoint                               : Ok
  22.3: Read / Write Watchpoint                             : Ok
  22.4: Modify Watchpoint                                   : Ok
  23: Number of exit events of a simple workload            : Ok
  24: Software clock events period values                   : Ok
  25: Object code reading                                   : Ok
  26: Sample parsing                                        : Ok
  27: Use a dummy software event to keep tracking           : Ok
  28: Parse with no sample_id_all bit set                   : Ok
  29: Filter hist entries                                   : Ok
  30: Lookup mmap thread                                    : Ok
  31: Share thread mg                                       : Ok
  32: Sort output of hist entries                           : Ok
  33: Cumulate child hist entries                           : Ok
  34: Track with sched_switch                               : Ok
  35: Filter fds with revents mask in a fdarray             : Ok
  36: Add fd to a fdarray, making it autogrow               : Ok
  37: kmod_path__parse                                      : Ok
  38: Thread map                                            : Ok
  39: LLVM search and compile                               :
  39.1: Basic BPF llvm compile                              : Ok
  39.2: kbuild searching                                    : Ok
  39.3: Compile source for BPF prologue generation          : Ok
  39.4: Compile source for BPF relocation                   : Ok
  40: Session topology                                      : Ok
  41: BPF filter                                            :
  41.1: Basic BPF filtering                                 : Ok
  41.2: BPF pinning                                         : Ok
  41.3: BPF prologue generation                             : Ok
  41.4: BPF relocation checker                              : Ok
  42: Synthesize thread map                                 : Ok
  43: Remove thread map                                     : Ok
  44: Synthesize cpu map                                    : Ok
  45: Synthesize stat config                                : Ok
  46: Synthesize stat                                       : Ok
  47: Synthesize stat round                                 : Ok
  48: Synthesize attr update                                : Ok
  49: Event times                                           : Ok
  50: Read backward ring buffer                             : Ok
  51: Print cpu map                                         : Ok
  52: Probe SDT events                                      : Ok
  53: is_printable_array                                    : Ok
  54: Print bitmap                                          : Ok
  55: perf hooks                                            : Ok
  56: builtin clang support                                 : Skip (not compiled in)
  57: unit_number__scnprintf                                : Ok
  58: mem2node                                              : Ok
  59: x86 rdpmc                                             : Ok
  60: Convert perf time to TSC                              : Ok
  61: DWARF unwind                                          : Ok
  62: x86 instruction decoder - new instructions            : Ok
  63: x86 bp modify                                         : Ok
  64: Use vfs_getname probe to get syscall args filenames   : Ok
  65: Check open filename arg using perf trace + vfs_getname: Ok
  66: probe libc's inet_pton & backtrace it with ping       : Ok
  67: 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_install_bin_O: make install-bin
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
                make_no_gtk2_O: make NO_GTK2=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_pure_O: make
             make_no_libnuma_O: make NO_LIBNUMA=1
                make_install_O: make install
           make_no_libunwind_O: make NO_LIBUNWIND=1
             make_no_libperl_O: make NO_LIBPERL=1
              make_no_libbpf_O: make NO_LIBBPF=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
                   make_help_O: make help
            make_no_auxtrace_O: make NO_AUXTRACE=1
         make_with_clangllvm_O: make LIBCLANGLLVM=1
               make_no_slang_O: make NO_SLANG=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
              make_clean_all_O: make clean all
       make_util_pmu_bison_o_O: make util/pmu-bison.o
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
            make_no_libaudit_O: make NO_LIBAUDIT=1
             make_util_map_o_O: make util/map.o
                  make_debug_O: make DEBUG=1
           make_no_libpython_O: make NO_LIBPYTHON=1
           make_no_backtrace_O: make NO_BACKTRACE=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
            make_no_demangle_O: make NO_DEMANGLE=1
                   make_tags_O: make tags
                 make_static_O: make LDFLAGS=-static
                 make_perf_o_O: make perf.o
              make_no_libelf_O: make NO_LIBELF=1
                    make_doc_O: make doc
                make_no_newt_O: make NO_NEWT=1
         make_install_prefix_O: make install prefix=/tmp/krava
  OK
  make: Leaving directory '/home/acme/git/perf/tools/perf'
  $ 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 00/27] perf/core improvements and fixes
  2018-07-25 17:59 Arnaldo Carvalho de Melo
@ 2018-07-25 20:34 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2018-07-25 20:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Clark Williams, linux-kernel, linux-perf-users, Adrian Hunter,
	Alexander Shishkin, Alexei Starovoitov, Alexey Budankov,
	Andi Kleen, Christian Borntraeger, David Ahern,
	David Carrillo-Cisneros, Daniel Borkmann, Heiko Carstens,
	Hendrik Brueckner, Jiri Olsa, Kan Liang, kernel-team,
	Kim Phillips, Leo Yan, linux-arm-kernel, Lukasz Odzioba,
	Martin Schwidefsky, Mathieu Poirier, Maynard Johnson,
	Michael Ellerman, Mike Leach, Milian Wolff, Namhyung Kim,
	Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Robert Walker,
	Sandipan Das, Sangwon Hong, stable, Stefan Raspl,
	Stephane Eranian, Sukadev Bhattiprolu, Thomas Richter, Wang Nan,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling, I'm now investigating why these failed:
> 
>   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                   : FAILED!
>   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                              : FAILED!
> 
> 	I think these failures are not related to changes in this patch
> kit. Details about the test environment, versions, etc.

Ok!

> The following changes since commit 1d59d16e9b4d5be80c9786a8b129c0f2af0e9522:
> 
>   Merge remote-tracking branch 'tip/perf/urgent' into perf/core (2018-07-24 14:34:32 -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.19-20180725

>  52 files changed, 1456 insertions(+), 109 deletions(-)

Pulled, thanks a lot Arnaldo!

Could we please also fix these before v4.18 is released, which trigger in 
perf/urgent:

Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/unistd.h' differs from latest version at 'arch/powerpc/include/uapi/asm/unistd.h'
Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'

?

Thanks!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 00/27] perf/core improvements and fixes
@ 2018-07-25 17:59 Arnaldo Carvalho de Melo
  2018-07-25 20:34 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-07-25 17:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Clark Williams, linux-kernel, linux-perf-users,
	Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin,
	Alexei Starovoitov, Alexey Budankov, Andi Kleen,
	Christian Borntraeger, David Ahern, David Carrillo-Cisneros,
	Daniel Borkmann, Heiko Carstens, Hendrik Brueckner, Jiri Olsa,
	Kan Liang, kernel-team, Kim Phillips, Leo Yan, linux-arm-kernel,
	Lukasz Odzioba, Martin Schwidefsky, Mathieu Poirier,
	Maynard Johnson, Michael Ellerman, Mike Leach, Milian Wolff,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Robert Walker, Sandipan Das, Sangwon Hong, stable, Stefan Raspl,
	Stephane Eranian, Sukadev Bhattiprolu, Thomas Richter, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, I'm now investigating why these failed:

  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                   : FAILED!
  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                              : FAILED!

	I think these failures are not related to changes in this patch
kit. Details about the test environment, versions, etc.

Regards,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit 1d59d16e9b4d5be80c9786a8b129c0f2af0e9522:

  Merge remote-tracking branch 'tip/perf/urgent' into perf/core (2018-07-24 14:34:32 -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.19-20180725

for you to fetch changes up to 9ef0112442bdddef5fb55adf20b3a5464b33de75:

  perf test: Fix subtest number when showing results (2018-07-24 14:55:51 -0300)

----------------------------------------------------------------
perf/cores fixes and improvements:

Tools:

top:

- Fix 'struct comm_str' removal crash race, detected with refcount_t
  debugging (Jiri Olsa)

- Use last_match threads cache only in single threaded mode, fixing
  a crash (Jiri Olsa)

record:

- Synthesize GROUP_DESC feature in pipe mode fixing display of
  event groups (Jiri Olsa)

stat:

- Get rid of extra clock display function (Jiri Olsa)

perf script:

- Show correct offsets for DWARF-based unwinding (Sandipan Das)

test:

- Check that complex event name is parsed correctly (Alexey Budankov)

- Fix subtest number when showing results (Thomas Richter)

Arch specific:

arm64:

- Generate syscall table from the kernel sources (asm/unistd.h) like
  other arches do, speeding up the support for new system calls in
  tools such as 'perf trace' (Kim Phillips)

arm:

- Bail out immediatelly on CoreSight hardware tracing instruction sample failure (Leo Yan)

PowerPC:

- Fix record+probe_libc_inet_pton.sh 'perf test' entry (Sandipan Das)

- Callchain IP filtering fixes (Sandipan Das)

S/390:

- Add support for detailed S/390 PMU event description in 'perf list' (Thomas Richter)

- Add transaction flag (-T) support in 'perf stat' for S/390 (Thomas Richter)

- Fix 'perf kvm' S/390 subcommands (Thomas Richter)

Infrastructure:

hists:

- Clarify callchain disabling when available (Arnaldo Carvalho de Melo)

evsel:

- Use perf_evsel__match instead of open coded equivalent (Jiri Olsa)

Documentation:

- Add missing documentation for 'perf list' --desc and --debug options (Sangwon Hong)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Alexey Budankov (1):
      perf tests: Check that complex event name is parsed correctly

Arnaldo Carvalho de Melo (1):
      perf hists: Clarify callchain disabling when available

Jiri Olsa (7):
      perf tools: Synthesize GROUP_DESC feature in pipe mode
      perf machine: Add threads__get_last_match function
      perf machine: Add threads__set_last_match function
      perf machine: Use last_match threads cache only in single thread mode
      perf tools: Fix struct comm_str removal crash
      perf tools: Use perf_evsel__match instead of open coded equivalent
      perf stat: Get rid of extra clock display function

Kim Phillips (3):
      tools include: Grab copies of arm64 dependent unistd.h files
      perf arm64: Generate system call table from asm/unistd.h
      perf trace arm64: Use generated syscall table

Leo Yan (2):
      perf cs-etm: Introduce invalid address macro
      perf cs-etm: Bail out immediately for instruction sample failure

Sandipan Das (6):
      perf powerpc: Fix callchain ip filtering
      perf powerpc: Fix callchain ip filtering when return address is in a register
      perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64
      perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups
      perf tests: Fix record+probe_libc_inet_pton.sh when event exists
      perf script: Show correct offsets for DWARF-based unwinding

Sangwon Hong (1):
      perf list: Add missing documentation for --desc and --debug options

Thomas Richter (6):
      Revert "perf list: Add s390 support for detailed/verbose PMU event description"
      perf list: Add s390 support for detailed PMU event description
      perf json: Add s390 transaction counter definition
      perf stat: Add transaction flag (-T) support for s390
      perf kvm: Fix subcommands on s390
      perf test: Fix subtest number when showing results

 tools/arch/arm64/include/uapi/asm/unistd.h         |  20 +
 tools/include/uapi/asm-generic/unistd.h            | 783 +++++++++++++++++++++
 tools/perf/Documentation/perf-list.txt             |   8 +-
 tools/perf/Makefile.config                         |   2 +
 tools/perf/arch/arm64/Makefile                     |  21 +
 tools/perf/arch/arm64/entry/syscalls/mksyscalltbl  |  62 ++
 tools/perf/arch/powerpc/util/skip-callchain-idx.c  |  10 +-
 tools/perf/arch/s390/util/kvm-stat.c               |   2 +-
 tools/perf/builtin-c2c.c                           |   4 +-
 tools/perf/builtin-diff.c                          |   2 +-
 tools/perf/builtin-report.c                        |   4 +-
 tools/perf/builtin-stat.c                          |  60 +-
 tools/perf/builtin-top.c                           |   2 +-
 tools/perf/check-headers.sh                        |   2 +
 tools/perf/pmu-events/arch/s390/cf_z10/basic.json  |  12 +
 tools/perf/pmu-events/arch/s390/cf_z10/crypto.json |  16 +
 .../perf/pmu-events/arch/s390/cf_z10/extended.json |  18 +
 tools/perf/pmu-events/arch/s390/cf_z13/basic.json  |  12 +
 tools/perf/pmu-events/arch/s390/cf_z13/crypto.json |  16 +
 .../perf/pmu-events/arch/s390/cf_z13/extended.json |  56 ++
 .../pmu-events/arch/s390/cf_z13/transaction.json   |   7 +
 tools/perf/pmu-events/arch/s390/cf_z14/basic.json  |   8 +
 tools/perf/pmu-events/arch/s390/cf_z14/crypto.json |  16 +
 .../perf/pmu-events/arch/s390/cf_z14/extended.json |  53 ++
 .../pmu-events/arch/s390/cf_z14/transaction.json   |   7 +
 tools/perf/pmu-events/arch/s390/cf_z196/basic.json |  12 +
 .../perf/pmu-events/arch/s390/cf_z196/crypto.json  |  16 +
 .../pmu-events/arch/s390/cf_z196/extended.json     |  24 +
 .../perf/pmu-events/arch/s390/cf_zec12/basic.json  |  12 +
 .../perf/pmu-events/arch/s390/cf_zec12/crypto.json |  16 +
 .../pmu-events/arch/s390/cf_zec12/extended.json    |  35 +
 .../pmu-events/arch/s390/cf_zec12/transaction.json |   7 +
 tools/perf/pmu-events/jevents.c                    |   2 +
 tools/perf/tests/builtin-test.c                    |   2 +-
 tools/perf/tests/parse-events.c                    |  18 +
 .../tests/shell/record+probe_libc_inet_pton.sh     |  36 +-
 tools/perf/ui/stdio/hist.c                         |   8 +-
 tools/perf/util/comm.c                             |  16 +-
 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c    |  10 +-
 tools/perf/util/cs-etm.c                           |   3 +
 tools/perf/util/evsel.c                            |  11 +
 tools/perf/util/evsel.h                            |   9 +-
 tools/perf/util/header.c                           |   2 +-
 tools/perf/util/hist.h                             |   2 +-
 tools/perf/util/machine.c                          |  79 ++-
 tools/perf/util/metricgroup.c                      |  22 +
 tools/perf/util/metricgroup.h                      |   1 +
 tools/perf/util/pmu.c                              |   6 -
 tools/perf/util/stat-shadow.c                      |   5 +-
 tools/perf/util/syscalltbl.c                       |   4 +
 tools/perf/util/unwind-libdw.c                     |   2 +-
 tools/perf/util/unwind-libunwind-local.c           |   2 +-
 52 files changed, 1456 insertions(+), 109 deletions(-)
 create mode 100644 tools/arch/arm64/include/uapi/asm/unistd.h
 create mode 100644 tools/include/uapi/asm-generic/unistd.h
 create mode 100755 tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z13/transaction.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z14/transaction.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_zec12/transaction.json

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, and building with LIBCLANGLLVM=1
(built-in clang) with gcc and clang when clang and its devel libraries
are installed.

The objtool and samples/bpf/ builds are disabled now that I'm switching from
using the sources in a local volume to fetching them from a http server to
build it inside the container, to make it easier to build in a container cluster.
Those will come back later.

Several are cross builds, the ones with -x-ARCH and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.

The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.

Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.

  # dm
   1 alpine:3.4                    : Ok   gcc (Alpine 5.3.0) 5.3.0
   2 alpine:3.5                    : Ok   gcc (Alpine 6.2.1) 6.2.1 20160822
   3 alpine:3.6                    : Ok   gcc (Alpine 6.3.0) 6.3.0
   4 alpine: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.3.1 20180303 (Red Hat 7.3.1-5)
   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-28)
  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.3.0-15) 7.3.0
  17 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc (Debian 7.3.0-15) 7.3.0
  18 debian:experimental-x-mips    : Ok   mips-linux-gnu-gcc (Debian 7.3.0-19) 7.3.0
  19 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc (Debian 7.3.0-18) 7.3.0
  20 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 7.3.0-20) 7.3.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:28                     : Ok   gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
  31 fedora:rawhide                : Ok   gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
  32 gentoo-stage3-amd64:latest    : Ok   gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0
  33 mageia:5                      : Ok   gcc (GCC) 4.9.2
  34 mageia:6                      : Ok   gcc (Mageia 5.5.0-1.mga6) 5.5.0
  35 opensuse:42.1                 : Ok   gcc (SUSE Linux) 4.8.5
  36 opensuse:42.2                 : Ok   gcc (SUSE Linux) 4.8.5
  37 opensuse:42.3                 : Ok   gcc (SUSE Linux) 4.8.5
  38 opensuse:tumbleweed           : Ok   gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
  39 oraclelinux:6                 : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1)
  40 oraclelinux:7                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28.0.1)
  41 ubuntu:12.04.5                : Ok   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  42 ubuntu:14.04.4                : Ok   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  43 ubuntu:14.04.4-x-linaro-arm64 : Ok   aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404
  44 ubuntu:15.04                  : Ok   gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
  45 ubuntu:16.04                  : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  46 ubuntu:16.04-x-arm            : Ok   arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  47 ubuntu:16.04-x-arm64          : Ok   aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  48 ubuntu:16.04-x-powerpc        : Ok   powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  49 ubuntu:16.04-x-powerpc64      : Ok   powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  50 ubuntu:16.04-x-powerpc64el    : Ok   powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  51 ubuntu:16.04-x-s390           : Ok   s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
  52 ubuntu:16.10                  : Ok   gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
  53 ubuntu:17.04                  : Ok   gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
  54 ubuntu:17.10                  : Ok   gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
  55 ubuntu:18.04                  : Ok   gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
  #

  Investigation is underway for the BPF related failures below.

  # git log --oneline -1
  9ef0112442bd (HEAD -> perf/core, jouet/perf/core) perf test: Fix subtest number when showing results
  # perf version --build-options
  perf version 4.18.rc6.g9ef0112
                   dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
      dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                   glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
                    gtk2: [ on  ]  # HAVE_GTK2_SUPPORT
           syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                  libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                  libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
                 libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
  numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
                 libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
               libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
                libslang: [ on  ]  # HAVE_SLANG_SUPPORT
               libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
               libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
      libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                    zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                    lzma: [ on  ]  # HAVE_LZMA_SUPPORT
               get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                     bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
  # uname -a
  Linux seventh 4.18.0-rc6-00093-g9981b4fb8684 #2 SMP Wed Jul 25 12:31: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                                 : Ok
  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                   : FAILED!
  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                              : FAILED!
  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: probe libc's inet_pton & backtrace it with ping       : Ok
  63: Check open filename arg using perf trace + vfs_getname: Ok
  64: Use vfs_getname probe to get syscall args filenames   : Ok
  65: Add vfs_getname probe to get syscall args filenames   : Ok
  #

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git2/perf/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
        make_with_babeltrace_O: make LIBBABELTRACE=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
              make_clean_all_O: make clean all
           make_no_libunwind_O: make NO_LIBUNWIND=1
             make_util_map_o_O: make util/map.o
            make_no_auxtrace_O: make NO_AUXTRACE=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
                make_install_O: make install
                   make_pure_O: make
                    make_doc_O: make doc
                   make_help_O: make help
                make_no_gtk2_O: make NO_GTK2=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
               make_no_slang_O: make NO_SLANG=1
            make_install_bin_O: make install-bin
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
            make_no_libaudit_O: make NO_LIBAUDIT=1
             make_no_libnuma_O: make NO_LIBNUMA=1
                make_no_newt_O: make NO_NEWT=1
            make_no_demangle_O: make NO_DEMANGLE=1
              make_no_libelf_O: make NO_LIBELF=1
                 make_cscope_O: make cscope
                 make_static_O: make LDFLAGS=-static
                  make_debug_O: make DEBUG=1
                 make_perf_o_O: make perf.o
           make_no_backtrace_O: make NO_BACKTRACE=1
                   make_tags_O: make tags
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
         make_install_prefix_O: make install prefix=/tmp/krava
                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_with_clangllvm_O: make LIBCLANGLLVM=1
              make_no_libbpf_O: make NO_LIBBPF=1
             make_no_libperl_O: make NO_LIBPERL=1
           make_no_libpython_O: make NO_LIBPYTHON=1
  OK
  make: Leaving directory '/home/acme/git2/perf/tools/perf'
  $

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 00/27] perf/core improvements and fixes
  2018-01-10 21:28 Arnaldo Carvalho de Melo
@ 2018-01-11  5:54 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2018-01-11  5:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, linux-perf-users, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, David Ahern, Jin Yao, Jiri Olsa,
	Kan Liang, Namhyung Kim, Peter Zijlstra, Thomas Gleixner,
	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 9128d3ed9de3882c83b927eb553d5d44c84505f5:
> 
>   perf/x86/msr: Clean up the code (2018-01-06 12:18:40 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.16-20180110
> 
> for you to fetch changes up to 5d64db2966e38bfd99114ecf0b54f97d33023dcd:
> 
>   tools headers: Synchronize kernel <-> tooling headers (2018-01-10 12:46:54 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> - The 'perf test bpf' entry hooked a eBPF proggie to the
>   SyS_epoll_wait() kernel function and expected it to be hit when calling
>   the epoll_wait() libc wrapper, which changed recently, in systems such
>   as Fedora 27, with the glibc wrapper calling instead the epoll_pwait()
>   syscall, so switch to epoll_pwait() for both the kernel and libc
>   function, getting it to work both in old and new systems (Arnaldo Carvalho de Melo)
> 
> - Beautify 'gettid' syscall result in 'perf trace', and in doing so
>   noticed that we need to handle namespaces in 'perf trace', will be
>   dealt with in follow up patches where we'll try to figure out if
>   the recent support for namespace in tools/perf/ can be used for this
>   purpose as well. (Arnaldo Carvalho de Melo)
> 
> - Introduce 'perf report --mmaps' and 'perf report --tasks' to show
>   info present in 'perf.data' (Jiri Olsa, Arnaldo Carvalho de Melo)
> 
> - Synchronize kernel <-> tooling headers wrt meltdown/spectre changes
>   (Arnaldo Carvalho de Melo)
> 
> - Fix a wrong offset issue when using /proc/kcore (Jin Yao)
> 
> - Fix bug that prevented annotating symbols in perf.data files
>   generated with 'perf record --branch-any'  (Jin Yao)
> 
> - Add infrastructure to record first and last sample time to the
>   perf.data file header, so that when processing all samples in
>   a 'perf record' session, such as when doing build-id processing,
>   or when specifically requesting that that info be recorded, use
>   that in 'perf report --time', that also got support for percent
>   slices in addition to absolute ones.
> 
>   I.e. now it is possible to ask for the samples in the 10%-20%
>   time slice of a perf.data file (Jin Yao)
> 
> - Enable building with libbabeltrace by default (Jiri Olsa)
> 
> - Display perf_event_attr::namespaces when duping the attributes
>   in verbose mode (Jiri Olsa)
> 
> - Allocate context task_ctx_data for child event (Jiri Olsa)
> 
> - Update comments for PERF_RECORD_ITRACE_START and PERF_RECORD_MISC_* (Jiri Olsa)
> 
> - Add support for showing PERF_RECORD_LOST events in 'perf script' (Jiri Olsa)
> 
> - Add 'perf report --stats' option to display quick statistics about
>   metadata events (PERF_RECORD_*) i.e. what we get at the end of 'perf
>   report -D' (Jiri Olsa)
> 
> - Fix compile error with libunwind x86 (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (6):
>       perf test bpf: Improve message about expected samples
>       perf test bpf: Use designated struct field initializers
>       perf test bpf: Hook on epoll_pwait()
>       perf trace: Beautify 'gettid' syscall result
>       perf report: Introduce --mmaps
>       tools headers: Synchronize kernel <-> tooling headers
> 
> Jin Yao (8):
>       perf report: Fix a wrong offset issue when using /proc/kcore
>       perf report: Fix a no annotate browser displayed issue
>       perf header: Add infrastructure to record first and last sample time
>       perf record: Record the first and last sample time in the header
>       perf tools: Create function to parse time percent
>       perf tools: Create function to perform multiple time range checking
>       perf report: Support time percent and multiple time ranges
>       perf script: Support time percent and multiple time ranges
> 
> Jiri Olsa (12):
>       perf tools: Enable LIBBABELTRACE by default
>       perf tools: Display perf_event_attr::namespaces debug info
>       perf: Allocate context task_ctx_data for child event
>       perf: Add sample_id to PERF_RECORD_ITRACE_START event comment
>       perf: Make perf_callchain function static
>       perf: Return empty callchain instead of NULL
>       perf: Update PERF_RECORD_MISC_* comment for perf_event_header::misc bit 13
>       perf script: Add support to display sample misc field
>       perf script: Add support to display lost events
>       perf tools: Make the tool's warning messages optional
>       perf report: Add --stats option to display quick data statistics
>       perf report: Add --tasks option to display monitored tasks
> 
> Wang Nan (1):
>       perf tools: Fix compile error with libunwind x86
> 
>  include/uapi/linux/perf_event.h                    |  10 +-
>  kernel/events/callchain.c                          |  15 --
>  kernel/events/core.c                               |  54 +++--
>  kernel/events/internal.h                           |   4 -
>  tools/arch/x86/include/asm/cpufeatures.h           |   4 +-
>  tools/arch/x86/include/asm/disabled-features.h     |   8 +-
>  tools/include/uapi/linux/perf_event.h              |  10 +-
>  tools/perf/Documentation/perf-record.txt           |   3 +
>  tools/perf/Documentation/perf-report.txt           |  37 ++-
>  tools/perf/Documentation/perf-script.txt           |  39 +++-
>  tools/perf/Documentation/perf.data-file-format.txt |   4 +
>  tools/perf/Makefile.config                         |   2 +-
>  tools/perf/Makefile.perf                           |   2 +-
>  tools/perf/arch/x86/util/unwind-libunwind.c        |   2 +-
>  tools/perf/builtin-record.c                        |  18 +-
>  tools/perf/builtin-report.c                        | 249 ++++++++++++++++++++-
>  tools/perf/builtin-script.c                        | 136 +++++++++--
>  tools/perf/builtin-trace.c                         |   1 +
>  tools/perf/tests/bpf-script-example.c              |   4 +-
>  tools/perf/tests/bpf.c                             |  65 +++---
>  tools/perf/util/annotate.c                         |   3 +-
>  tools/perf/util/event.c                            |   8 +
>  tools/perf/util/event.h                            |   1 +
>  tools/perf/util/evlist.h                           |   2 +
>  tools/perf/util/evsel.c                            |   2 +
>  tools/perf/util/header.c                           |  60 +++++
>  tools/perf/util/header.h                           |   1 +
>  tools/perf/util/machine.c                          |   2 +-
>  tools/perf/util/map.c                              |   2 +-
>  tools/perf/util/session.c                          |   6 +-
>  tools/perf/util/sort.c                             |  16 +-
>  tools/perf/util/srcline.c                          |   9 +-
>  tools/perf/util/srcline.h                          |   5 +-
>  tools/perf/util/time-utils.c                       | 233 ++++++++++++++++++-
>  tools/perf/util/time-utils.h                       |   6 +
>  tools/perf/util/tool.h                             |   1 +
>  36 files changed, 884 insertions(+), 140 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 00/27] perf/core improvements and fixes
@ 2018-01-10 21:28 Arnaldo Carvalho de Melo
  2018-01-11  5:54 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-01-10 21:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen, David Ahern,
	Jin Yao, Jiri Olsa, Kan Liang, Namhyung Kim, Peter Zijlstra,
	Thomas Gleixner, 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 9128d3ed9de3882c83b927eb553d5d44c84505f5:

  perf/x86/msr: Clean up the code (2018-01-06 12:18:40 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.16-20180110

for you to fetch changes up to 5d64db2966e38bfd99114ecf0b54f97d33023dcd:

  tools headers: Synchronize kernel <-> tooling headers (2018-01-10 12:46:54 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

- The 'perf test bpf' entry hooked a eBPF proggie to the
  SyS_epoll_wait() kernel function and expected it to be hit when calling
  the epoll_wait() libc wrapper, which changed recently, in systems such
  as Fedora 27, with the glibc wrapper calling instead the epoll_pwait()
  syscall, so switch to epoll_pwait() for both the kernel and libc
  function, getting it to work both in old and new systems (Arnaldo Carvalho de Melo)

- Beautify 'gettid' syscall result in 'perf trace', and in doing so
  noticed that we need to handle namespaces in 'perf trace', will be
  dealt with in follow up patches where we'll try to figure out if
  the recent support for namespace in tools/perf/ can be used for this
  purpose as well. (Arnaldo Carvalho de Melo)

- Introduce 'perf report --mmaps' and 'perf report --tasks' to show
  info present in 'perf.data' (Jiri Olsa, Arnaldo Carvalho de Melo)

- Synchronize kernel <-> tooling headers wrt meltdown/spectre changes
  (Arnaldo Carvalho de Melo)

- Fix a wrong offset issue when using /proc/kcore (Jin Yao)

- Fix bug that prevented annotating symbols in perf.data files
  generated with 'perf record --branch-any'  (Jin Yao)

- Add infrastructure to record first and last sample time to the
  perf.data file header, so that when processing all samples in
  a 'perf record' session, such as when doing build-id processing,
  or when specifically requesting that that info be recorded, use
  that in 'perf report --time', that also got support for percent
  slices in addition to absolute ones.

  I.e. now it is possible to ask for the samples in the 10%-20%
  time slice of a perf.data file (Jin Yao)

- Enable building with libbabeltrace by default (Jiri Olsa)

- Display perf_event_attr::namespaces when duping the attributes
  in verbose mode (Jiri Olsa)

- Allocate context task_ctx_data for child event (Jiri Olsa)

- Update comments for PERF_RECORD_ITRACE_START and PERF_RECORD_MISC_* (Jiri Olsa)

- Add support for showing PERF_RECORD_LOST events in 'perf script' (Jiri Olsa)

- Add 'perf report --stats' option to display quick statistics about
  metadata events (PERF_RECORD_*) i.e. what we get at the end of 'perf
  report -D' (Jiri Olsa)

- Fix compile error with libunwind x86 (Wang Nan)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (6):
      perf test bpf: Improve message about expected samples
      perf test bpf: Use designated struct field initializers
      perf test bpf: Hook on epoll_pwait()
      perf trace: Beautify 'gettid' syscall result
      perf report: Introduce --mmaps
      tools headers: Synchronize kernel <-> tooling headers

Jin Yao (8):
      perf report: Fix a wrong offset issue when using /proc/kcore
      perf report: Fix a no annotate browser displayed issue
      perf header: Add infrastructure to record first and last sample time
      perf record: Record the first and last sample time in the header
      perf tools: Create function to parse time percent
      perf tools: Create function to perform multiple time range checking
      perf report: Support time percent and multiple time ranges
      perf script: Support time percent and multiple time ranges

Jiri Olsa (12):
      perf tools: Enable LIBBABELTRACE by default
      perf tools: Display perf_event_attr::namespaces debug info
      perf: Allocate context task_ctx_data for child event
      perf: Add sample_id to PERF_RECORD_ITRACE_START event comment
      perf: Make perf_callchain function static
      perf: Return empty callchain instead of NULL
      perf: Update PERF_RECORD_MISC_* comment for perf_event_header::misc bit 13
      perf script: Add support to display sample misc field
      perf script: Add support to display lost events
      perf tools: Make the tool's warning messages optional
      perf report: Add --stats option to display quick data statistics
      perf report: Add --tasks option to display monitored tasks

Wang Nan (1):
      perf tools: Fix compile error with libunwind x86

 include/uapi/linux/perf_event.h                    |  10 +-
 kernel/events/callchain.c                          |  15 --
 kernel/events/core.c                               |  54 +++--
 kernel/events/internal.h                           |   4 -
 tools/arch/x86/include/asm/cpufeatures.h           |   4 +-
 tools/arch/x86/include/asm/disabled-features.h     |   8 +-
 tools/include/uapi/linux/perf_event.h              |  10 +-
 tools/perf/Documentation/perf-record.txt           |   3 +
 tools/perf/Documentation/perf-report.txt           |  37 ++-
 tools/perf/Documentation/perf-script.txt           |  39 +++-
 tools/perf/Documentation/perf.data-file-format.txt |   4 +
 tools/perf/Makefile.config                         |   2 +-
 tools/perf/Makefile.perf                           |   2 +-
 tools/perf/arch/x86/util/unwind-libunwind.c        |   2 +-
 tools/perf/builtin-record.c                        |  18 +-
 tools/perf/builtin-report.c                        | 249 ++++++++++++++++++++-
 tools/perf/builtin-script.c                        | 136 +++++++++--
 tools/perf/builtin-trace.c                         |   1 +
 tools/perf/tests/bpf-script-example.c              |   4 +-
 tools/perf/tests/bpf.c                             |  65 +++---
 tools/perf/util/annotate.c                         |   3 +-
 tools/perf/util/event.c                            |   8 +
 tools/perf/util/event.h                            |   1 +
 tools/perf/util/evlist.h                           |   2 +
 tools/perf/util/evsel.c                            |   2 +
 tools/perf/util/header.c                           |  60 +++++
 tools/perf/util/header.h                           |   1 +
 tools/perf/util/machine.c                          |   2 +-
 tools/perf/util/map.c                              |   2 +-
 tools/perf/util/session.c                          |   6 +-
 tools/perf/util/sort.c                             |  16 +-
 tools/perf/util/srcline.c                          |   9 +-
 tools/perf/util/srcline.h                          |   5 +-
 tools/perf/util/time-utils.c                       | 233 ++++++++++++++++++-
 tools/perf/util/time-utils.h                       |   6 +
 tools/perf/util/tool.h                             |   1 +
 36 files changed, 884 insertions(+), 140 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.

  # dm
   1 36.42 alpine:3.4                    : Ok   gcc (Alpine 5.3.0) 5.3.0
   2 43.36 alpine:3.5                    : Ok   gcc (Alpine 6.2.1) 6.2.1 20160822
   3 42.02 alpine:3.6                    : Ok   gcc (Alpine 6.3.0) 6.3.0
   4 39.44 alpine:edge                   : Ok   gcc (Alpine 6.4.0) 6.4.0
   5 34.12 amazonlinux:1                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
   6 43.12 amazonlinux:2                 : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
   7 25.83 android-ndk:r12b-arm          : Ok   arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
   8 27.52 android-ndk:r15c-arm          : Ok   arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
   9 21.87 centos:5                      : Ok   gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
  10 31.57 centos:6                      : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
  11 37.87 centos:7                      : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
  12 35.19 debian:7                      : Ok   gcc (Debian 4.7.2-5) 4.7.2
  13 36.66 debian:8                      : Ok   gcc (Debian 4.9.2-10) 4.9.2
  14 60.91 debian:9                      : Ok   gcc (Debian 6.3.0-18) 6.3.0 20170516
  15 63.71 debian:experimental           : Ok   gcc (Debian 7.2.0-18) 7.2.0
  16 41.01 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
  17 37.53 debian:experimental-x-mips    : Ok   mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
  18 35.28 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc (Debian 7.2.0-11) 7.2.0
  19 38.06 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
  20 37.48 fedora:20                     : Ok   gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
  21 40.09 fedora:21                     : Ok   gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
  22 38.66 fedora:22                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  23 38.56 fedora:23                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  24 40.34 fedora:24                     : Ok   gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  25 33.60 fedora:24-x-ARC-uClibc        : Ok   arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
  26 76.30 fedora:25                     : Ok   gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
  27 83.91 fedora:26                     : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
  28 76.94 fedora:27                     : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
  29 84.12 fedora:rawhide                : Ok   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-4)
  30 39.65 gentoo-stage3-amd64:latest    : Ok   gcc (Gentoo 6.4.0 p1.1) 6.4.0
  31 40.31 mageia:5                      : Ok   gcc (GCC) 4.9.2
  32 40.96 mageia:6                      : Ok   gcc (Mageia 5.4.0-5.mga6) 5.4.0
  33 40.56 opensuse:42.1                 : Ok   gcc (SUSE Linux) 4.8.5
  34 44.99 opensuse:42.2                 : Ok   gcc (SUSE Linux) 4.8.5
  35 39.41 opensuse:42.3                 : Ok   gcc (SUSE Linux) 4.8.5
  36 82.57 opensuse:tumbleweed           : Ok   gcc (SUSE Linux) 7.2.1 20171020 [gcc-7-branch revision 253932]
  37 31.39 oraclelinux:6                 : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
  38 37.82 oraclelinux:7                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
  39 29.52 ubuntu:12.04.5                : Ok   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  40 35.32 ubuntu:14.04.4                : Ok   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  41 31.84 ubuntu:14.04.4-x-linaro-arm64 : Ok   aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0
  42 59.60 ubuntu:16.04                  : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
  43 32.43 ubuntu:16.04-x-arm            : Ok   arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  44 30.82 ubuntu:16.04-x-arm64          : Ok   aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  45 30.35 ubuntu:16.04-x-powerpc        : Ok   powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  46 32.15 ubuntu:16.04-x-powerpc64      : Ok   powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
  47 31.77 ubuntu:16.04-x-powerpc64el    : Ok   powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  48 31.49 ubuntu:16.04-x-s390           : Ok   s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  49 62.81 ubuntu:16.10                  : Ok   gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
  50 64.87 ubuntu:17.04                  : Ok   gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
  51 63.93 ubuntu:17.10                  : Ok   gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
  52 64.43 ubuntu:18.04                  : Ok   gcc (Ubuntu 7.2.0-18ubuntu2) 7.2.0
  # 

  # uname -a
  Linux seventh 4.15.0-rc7+ #2 SMP Wed Jan 10 11:53:43 -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: Number of exit events of a simple workload            : Ok
  22: Software clock events period values                   : Ok
  23: Object code reading                                   : Ok
  24: Sample parsing                                        : Ok
  25: Use a dummy software event to keep tracking           : Ok
  26: Parse with no sample_id_all bit set                   : Ok
  27: Filter hist entries                                   : Ok
  28: Lookup mmap thread                                    : Ok
  29: Share thread mg                                       : Ok
  30: Sort output of hist entries                           : Ok
  31: Cumulate child hist entries                           : Ok
  32: Track with sched_switch                               : Ok
  33: Filter fds with revents mask in a fdarray             : Ok
  34: Add fd to a fdarray, making it autogrow               : Ok
  35: kmod_path__parse                                      : Ok
  36: Thread map                                            : Ok
  37: LLVM search and compile                               :
  37.1: Basic BPF llvm compile                              : Ok
  37.2: kbuild searching                                    : Ok
  37.3: Compile source for BPF prologue generation          : Ok
  37.4: Compile source for BPF relocation                   : Ok
  38: Session topology                                      : Ok
  39: BPF filter                                            :
  39.1: Basic BPF filtering                                 : Ok
  39.2: BPF pinning                                         : Ok
  39.3: BPF prologue generation                             : Ok
  39.4: BPF relocation checker                              : Ok
  40: Synthesize thread map                                 : Ok
  41: Remove thread map                                     : Ok
  42: Synthesize cpu map                                    : Ok
  43: Synthesize stat config                                : Ok
  44: Synthesize stat                                       : Ok
  45: Synthesize stat round                                 : Ok
  46: Synthesize attr update                                : Ok
  47: Event times                                           : Ok
  48: Read backward ring buffer                             : Ok
  49: Print cpu map                                         : Ok
  50: Probe SDT events                                      : Ok
  51: is_printable_array                                    : Ok
  52: Print bitmap                                          : Ok
  53: perf hooks                                            : Ok
  54: builtin clang support                                 : Skip (not compiled in)
  55: unit_number__scnprintf                                : Ok
  56: x86 rdpmc                                             : Ok
  57: Convert perf time to TSC                              : Ok
  58: DWARF unwind                                          : Ok
  59: x86 instruction decoder - new instructions            : Ok
  60: Use vfs_getname probe to get syscall args filenames   : Ok
  61: Check open filename arg using perf trace + vfs_getname: Ok
  62: probe libc's inet_pton & backtrace it with ping       : Ok
  63: 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_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
                 make_perf_o_O: make perf.o
                 make_static_O: make LDFLAGS=-static
                    make_doc_O: make doc
             make_no_libperl_O: make NO_LIBPERL=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=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_tags_O: make tags
       make_util_pmu_bison_o_O: make util/pmu-bison.o
         make_install_prefix_O: make install prefix=/tmp/krava
              make_clean_all_O: make clean all
              make_no_libelf_O: make NO_LIBELF=1
           make_no_libunwind_O: make NO_LIBUNWIND=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
                make_no_gtk2_O: make NO_GTK2=1
            make_no_demangle_O: make NO_DEMANGLE=1
           make_no_libpython_O: make NO_LIBPYTHON=1
              make_no_libbpf_O: make NO_LIBBPF=1
             make_util_map_o_O: make util/map.o
                  make_debug_O: make DEBUG=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
           make_no_backtrace_O: make NO_BACKTRACE=1
                   make_help_O: make help
                make_no_newt_O: make NO_NEWT=1
            make_no_auxtrace_O: make NO_AUXTRACE=1
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
                make_install_O: make install
            make_no_libaudit_O: make NO_LIBAUDIT=1
                   make_pure_O: make
             make_no_libnuma_O: make NO_LIBNUMA=1
               make_no_slang_O: make NO_SLANG=1
            make_install_bin_O: make install-bin
         make_with_clangllvm_O: make LIBCLANGLLVM=1
  OK
  make: Leaving directory '/home/acme/git/perf/tools/perf'
  $

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 00/27] perf/core improvements and fixes
  2016-06-23 21:23 Arnaldo Carvalho de Melo
@ 2016-06-26 10:43 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2016-06-26 10:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Brendan Gregg, David Ahern, Ekaterina Tumanova, He Kuang,
	Jiri Olsa, Josh Poimboeuf, Kan Liang, Masami Hiramatsu,
	Milian Wolff, Namhyung Kim, Paolo Bonzini, Pekka Enberg,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu,
	Taeung Song, Wang Nan, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 4330b439bbe16b48dd2fe9a379bd58a07b97aab8:
> 
>   Merge tag 'perf-core-for-mingo-20160621' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-06-22 09:34:19 +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-20160623
> 
> for you to fetch changes up to 4a35b3497c413de8b409f9d75700eeb4772b21b8:
> 
>   perf config: Reimplement show_config() using config_set__for_each (2016-06-23 17:23:00 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Add 'callindent' option to 'perf script -F', to indent the Intel PT
>   call stack, making this output more ftrace-like (Adrian Hunter, Andi Kleen)
> 
> User visible:
> 
> - Enlarge 'pid' column width, to cope with large pids (Jiri Olsa)
> 
> Infrastructure:
> 
> - Cross platform unwind fixes (He Kuang)
> 
> - Make destructors accept NULL, behaving like free() (Arnaldo Carvalho de Melo)
> 
> - Remove reference to perl interpreted in the recently added 'perf script'
>   stackcollapse python script (Arnaldo Carvalho de Melo)
> 
> - Rename CLASS__for_each() macros to CLASS__for_each_entry(), to use the
>   list_for_each_entry() semantics, as most of these class specific loop helpers
>   are list_for_each_entry*() wrappers  (Arnaldo Carvalho de Melo)
> 
> - Expose the hist_browser code, will be used with data structures other
>   than perf_evsel (Jiri Olsa)
> 
> - 'perf config' refactorings (Taeung Song)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (3):
>       perf script: Print sample flags more nicely
>       perf auxtrace: Add option to feed branches to the thread stack
>       perf script: Add callindent option
> 
> Arnaldo Carvalho de Melo (9):
>       perf script stackcollapse: Remove reference to the perl interpreter
>       perf evlist: Destructors should accept NULL
>       perf session: Destructors should accept NULL
>       perf tests time-to-tsc: No need to disable an event before deleting it
>       perf machine: Destructors should accept NULL
>       perf evlist: Rename for_each() macros to for_each_entry()
>       perf tools: Rename strlist_for_each() macros to for_each_entry()
>       perf rb_resort: Rename for_each() macros to for_each_entry()
>       perf intlist: Rename for_each() macros to for_each_entry()
> 
> He Kuang (5):
>       perf tools: Let python use correct gcc for build_ext
>       perf tools: Find right DSO taking into account if binary is 32 or 64-bit
>       perf unwind: Change macro names of perf register
>       perf unwind: Fix wrongly used regs for x86_32 unwind
>       perf unwind: Fix wrongly used regs for aarch64 unwind
> 
> Jiri Olsa (7):
>       perf hists browser: Move hist_browser into header file
>       perf hists browser: Make (new|delete|run) public
>       perf hists browser: Introduce struct hist_browser title callback
>       perf hists browser: Move horizontal scroll init to new()
>       perf hists browser: Introduce perf_evsel_browser constructor
>       perf hists browser: Introduce init()
>       perf hists: Enlarge pid sort entry size
> 
> Taeung Song (3):
>       perf config: Move config declarations from util/cache.h to util/config.h
>       perf config: Introduce new init() and exit()
>       perf config: Reimplement show_config() using config_set__for_each
> 
>  tools/perf/Documentation/perf-script.txt     |  11 ++-
>  tools/perf/Makefile.perf                     |   3 +-
>  tools/perf/arch/x86/tests/perf-time-to-tsc.c |   6 +-
>  tools/perf/arch/x86/util/auxtrace.c          |   2 +-
>  tools/perf/arch/x86/util/intel-bts.c         |   8 +-
>  tools/perf/arch/x86/util/intel-pt.c          |  10 +--
>  tools/perf/builtin-annotate.c                |   2 +-
>  tools/perf/builtin-buildid-cache.c           |  13 ++-
>  tools/perf/builtin-config.c                  |  21 +++--
>  tools/perf/builtin-diff.c                    |  10 +--
>  tools/perf/builtin-evlist.c                  |   2 +-
>  tools/perf/builtin-help.c                    |   2 +-
>  tools/perf/builtin-inject.c                  |   8 +-
>  tools/perf/builtin-kmem.c                    |   4 +-
>  tools/perf/builtin-kvm.c                     |   8 +-
>  tools/perf/builtin-probe.c                   |   4 +-
>  tools/perf/builtin-record.c                  |   3 +-
>  tools/perf/builtin-report.c                  |  12 +--
>  tools/perf/builtin-script.c                  | 115 +++++++++++++++++++++++++--
>  tools/perf/builtin-stat.c                    |  22 ++---
>  tools/perf/builtin-top.c                     |  10 +--
>  tools/perf/builtin-trace.c                   |  10 +--
>  tools/perf/perf.c                            |   4 +-
>  tools/perf/scripts/python/stackcollapse.py   |   2 -
>  tools/perf/tests/backward-ring-buffer.c      |   2 +-
>  tools/perf/tests/event-times.c               |   3 +-
>  tools/perf/tests/evsel-roundtrip-name.c      |   2 +-
>  tools/perf/tests/hists_filter.c              |   4 +-
>  tools/perf/tests/hists_link.c                |   4 +-
>  tools/perf/tests/mmap-basic.c                |   2 +-
>  tools/perf/tests/parse-events.c              |   4 +-
>  tools/perf/tests/parse-no-sample-id-all.c    |   3 +-
>  tools/perf/tests/switch-tracking.c           |   2 +-
>  tools/perf/ui/browser.c                      |   2 +-
>  tools/perf/ui/browsers/annotate.c            |   1 +
>  tools/perf/ui/browsers/hists.c               | 109 ++++++++++++-------------
>  tools/perf/ui/browsers/hists.h               |  32 ++++++++
>  tools/perf/ui/gtk/hists.c                    |   2 +-
>  tools/perf/ui/hist.c                         |   2 +-
>  tools/perf/util/alias.c                      |   1 +
>  tools/perf/util/auxtrace.h                   |   2 +
>  tools/perf/util/cache.h                      |  11 ---
>  tools/perf/util/cgroup.c                     |   4 +-
>  tools/perf/util/color.c                      |   1 +
>  tools/perf/util/config.c                     |  92 ++++++++++-----------
>  tools/perf/util/config.h                     |  40 ++++++++++
>  tools/perf/util/data-convert-bt.c            |   4 +-
>  tools/perf/util/evlist.c                     |  59 +++++++-------
>  tools/perf/util/evlist.h                     |  40 +++++-----
>  tools/perf/util/header.c                     |  18 ++---
>  tools/perf/util/help-unknown-cmd.c           |   1 +
>  tools/perf/util/hist.c                       |   4 +-
>  tools/perf/util/intel-bts.c                  |  24 ++++--
>  tools/perf/util/intel-pt.c                   |  26 +++---
>  tools/perf/util/intlist.h                    |   8 +-
>  tools/perf/util/jitdump.c                    |   2 +-
>  tools/perf/util/libunwind/arm64.c            |   5 ++
>  tools/perf/util/libunwind/x86_32.c           |   6 ++
>  tools/perf/util/llvm-utils.c                 |   1 +
>  tools/perf/util/machine.c                    |   6 +-
>  tools/perf/util/parse-events.c               |   4 +-
>  tools/perf/util/probe-event.c                |  12 ++-
>  tools/perf/util/probe-file.c                 |   8 +-
>  tools/perf/util/python.c                     |   2 +-
>  tools/perf/util/rb_resort.h                  |   4 +-
>  tools/perf/util/record.c                     |   8 +-
>  tools/perf/util/session.c                    |  12 +--
>  tools/perf/util/sort.c                       |  14 ++--
>  tools/perf/util/stat.c                       |   6 +-
>  tools/perf/util/strlist.h                    |   4 +-
>  tools/perf/util/symbol.c                     |   2 +-
>  tools/perf/util/thread-stack.c               |   7 ++
>  tools/perf/util/thread-stack.h               |   1 +
>  tools/perf/util/thread_map.c                 |   4 +-
>  tools/perf/util/unwind-libunwind-local.c     |   6 +-
>  tools/perf/util/unwind.h                     |   9 +++
>  tools/perf/util/vdso.c                       |  40 +++++++++-
>  77 files changed, 606 insertions(+), 358 deletions(-)
>  create mode 100644 tools/perf/ui/browsers/hists.h

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 00/27] perf/core improvements and fixes
@ 2016-06-23 21:23 Arnaldo Carvalho de Melo
  2016-06-26 10:43 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-06-23 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Brendan Gregg, David Ahern,
	Ekaterina Tumanova, He Kuang, Jiri Olsa, Josh Poimboeuf,
	Kan Liang, Masami Hiramatsu, Milian Wolff, Namhyung Kim,
	Paolo Bonzini, Pekka Enberg, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu, Taeung Song, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 4330b439bbe16b48dd2fe9a379bd58a07b97aab8:

  Merge tag 'perf-core-for-mingo-20160621' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-06-22 09:34:19 +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-20160623

for you to fetch changes up to 4a35b3497c413de8b409f9d75700eeb4772b21b8:

  perf config: Reimplement show_config() using config_set__for_each (2016-06-23 17:23:00 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

New features:

- Add 'callindent' option to 'perf script -F', to indent the Intel PT
  call stack, making this output more ftrace-like (Adrian Hunter, Andi Kleen)

User visible:

- Enlarge 'pid' column width, to cope with large pids (Jiri Olsa)

Infrastructure:

- Cross platform unwind fixes (He Kuang)

- Make destructors accept NULL, behaving like free() (Arnaldo Carvalho de Melo)

- Remove reference to perl interpreted in the recently added 'perf script'
  stackcollapse python script (Arnaldo Carvalho de Melo)

- Rename CLASS__for_each() macros to CLASS__for_each_entry(), to use the
  list_for_each_entry() semantics, as most of these class specific loop helpers
  are list_for_each_entry*() wrappers  (Arnaldo Carvalho de Melo)

- Expose the hist_browser code, will be used with data structures other
  than perf_evsel (Jiri Olsa)

- 'perf config' refactorings (Taeung Song)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (3):
      perf script: Print sample flags more nicely
      perf auxtrace: Add option to feed branches to the thread stack
      perf script: Add callindent option

Arnaldo Carvalho de Melo (9):
      perf script stackcollapse: Remove reference to the perl interpreter
      perf evlist: Destructors should accept NULL
      perf session: Destructors should accept NULL
      perf tests time-to-tsc: No need to disable an event before deleting it
      perf machine: Destructors should accept NULL
      perf evlist: Rename for_each() macros to for_each_entry()
      perf tools: Rename strlist_for_each() macros to for_each_entry()
      perf rb_resort: Rename for_each() macros to for_each_entry()
      perf intlist: Rename for_each() macros to for_each_entry()

He Kuang (5):
      perf tools: Let python use correct gcc for build_ext
      perf tools: Find right DSO taking into account if binary is 32 or 64-bit
      perf unwind: Change macro names of perf register
      perf unwind: Fix wrongly used regs for x86_32 unwind
      perf unwind: Fix wrongly used regs for aarch64 unwind

Jiri Olsa (7):
      perf hists browser: Move hist_browser into header file
      perf hists browser: Make (new|delete|run) public
      perf hists browser: Introduce struct hist_browser title callback
      perf hists browser: Move horizontal scroll init to new()
      perf hists browser: Introduce perf_evsel_browser constructor
      perf hists browser: Introduce init()
      perf hists: Enlarge pid sort entry size

Taeung Song (3):
      perf config: Move config declarations from util/cache.h to util/config.h
      perf config: Introduce new init() and exit()
      perf config: Reimplement show_config() using config_set__for_each

 tools/perf/Documentation/perf-script.txt     |  11 ++-
 tools/perf/Makefile.perf                     |   3 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c |   6 +-
 tools/perf/arch/x86/util/auxtrace.c          |   2 +-
 tools/perf/arch/x86/util/intel-bts.c         |   8 +-
 tools/perf/arch/x86/util/intel-pt.c          |  10 +--
 tools/perf/builtin-annotate.c                |   2 +-
 tools/perf/builtin-buildid-cache.c           |  13 ++-
 tools/perf/builtin-config.c                  |  21 +++--
 tools/perf/builtin-diff.c                    |  10 +--
 tools/perf/builtin-evlist.c                  |   2 +-
 tools/perf/builtin-help.c                    |   2 +-
 tools/perf/builtin-inject.c                  |   8 +-
 tools/perf/builtin-kmem.c                    |   4 +-
 tools/perf/builtin-kvm.c                     |   8 +-
 tools/perf/builtin-probe.c                   |   4 +-
 tools/perf/builtin-record.c                  |   3 +-
 tools/perf/builtin-report.c                  |  12 +--
 tools/perf/builtin-script.c                  | 115 +++++++++++++++++++++++++--
 tools/perf/builtin-stat.c                    |  22 ++---
 tools/perf/builtin-top.c                     |  10 +--
 tools/perf/builtin-trace.c                   |  10 +--
 tools/perf/perf.c                            |   4 +-
 tools/perf/scripts/python/stackcollapse.py   |   2 -
 tools/perf/tests/backward-ring-buffer.c      |   2 +-
 tools/perf/tests/event-times.c               |   3 +-
 tools/perf/tests/evsel-roundtrip-name.c      |   2 +-
 tools/perf/tests/hists_filter.c              |   4 +-
 tools/perf/tests/hists_link.c                |   4 +-
 tools/perf/tests/mmap-basic.c                |   2 +-
 tools/perf/tests/parse-events.c              |   4 +-
 tools/perf/tests/parse-no-sample-id-all.c    |   3 +-
 tools/perf/tests/switch-tracking.c           |   2 +-
 tools/perf/ui/browser.c                      |   2 +-
 tools/perf/ui/browsers/annotate.c            |   1 +
 tools/perf/ui/browsers/hists.c               | 109 ++++++++++++-------------
 tools/perf/ui/browsers/hists.h               |  32 ++++++++
 tools/perf/ui/gtk/hists.c                    |   2 +-
 tools/perf/ui/hist.c                         |   2 +-
 tools/perf/util/alias.c                      |   1 +
 tools/perf/util/auxtrace.h                   |   2 +
 tools/perf/util/cache.h                      |  11 ---
 tools/perf/util/cgroup.c                     |   4 +-
 tools/perf/util/color.c                      |   1 +
 tools/perf/util/config.c                     |  92 ++++++++++-----------
 tools/perf/util/config.h                     |  40 ++++++++++
 tools/perf/util/data-convert-bt.c            |   4 +-
 tools/perf/util/evlist.c                     |  59 +++++++-------
 tools/perf/util/evlist.h                     |  40 +++++-----
 tools/perf/util/header.c                     |  18 ++---
 tools/perf/util/help-unknown-cmd.c           |   1 +
 tools/perf/util/hist.c                       |   4 +-
 tools/perf/util/intel-bts.c                  |  24 ++++--
 tools/perf/util/intel-pt.c                   |  26 +++---
 tools/perf/util/intlist.h                    |   8 +-
 tools/perf/util/jitdump.c                    |   2 +-
 tools/perf/util/libunwind/arm64.c            |   5 ++
 tools/perf/util/libunwind/x86_32.c           |   6 ++
 tools/perf/util/llvm-utils.c                 |   1 +
 tools/perf/util/machine.c                    |   6 +-
 tools/perf/util/parse-events.c               |   4 +-
 tools/perf/util/probe-event.c                |  12 ++-
 tools/perf/util/probe-file.c                 |   8 +-
 tools/perf/util/python.c                     |   2 +-
 tools/perf/util/rb_resort.h                  |   4 +-
 tools/perf/util/record.c                     |   8 +-
 tools/perf/util/session.c                    |  12 +--
 tools/perf/util/sort.c                       |  14 ++--
 tools/perf/util/stat.c                       |   6 +-
 tools/perf/util/strlist.h                    |   4 +-
 tools/perf/util/symbol.c                     |   2 +-
 tools/perf/util/thread-stack.c               |   7 ++
 tools/perf/util/thread-stack.h               |   1 +
 tools/perf/util/thread_map.c                 |   4 +-
 tools/perf/util/unwind-libunwind-local.c     |   6 +-
 tools/perf/util/unwind.h                     |   9 +++
 tools/perf/util/vdso.c                       |  40 +++++++++-
 77 files changed, 606 insertions(+), 358 deletions(-)
 create mode 100644 tools/perf/ui/browsers/hists.h

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 00/27] perf/core improvements and fixes
  2014-07-25 15:36 Arnaldo Carvalho de Melo
@ 2014-07-28  8:10 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2014-07-28  8:10 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Corey Ashford,
	David Ahern, Don Zickus, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Michael Ellerman, Mike Galbraith, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 2336ebc32676df5b794acfe0c980583ec6c05f34:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-07-18 12:19:20 +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 dcabb507fd3a2b19aed6b4068e2a954f5fd8de45:
> 
>   perf record: Store PERF_RECORD_FINISHED_ROUND only for nonempty rounds (2014-07-25 12:17:36 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Developer stuff:
> 
> o More prep work to support Intel PT: (Adrian Hunter)
>   - Polishing 'script' BTS output
>   - 'inject' can specify --kallsym
>   - VDSO is per machine, not a global var
>   - Expose data addr lookup functions previously private to 'script'
>   - Large mmap fixes in events processing
> 
> o Fix build on gcc 4.4.7 (Arnaldo Carvalho de Melo)
> 
> o Event ordering fixes (Jiri Olsa)
> 
> o Include standard stringify macros in power pc code (Sukadev Bhattiprolu)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (22):
>       perf tools: Fix incorrect fd error comparison
>       perf tools: Fix jump label always changing during tracing
>       perf script: Improve srcline display for BTS
>       perf script: Do not print dangling '=>' for BTS
>       perf tools: Record whether a dso has data
>       perf tools: Add dso__data_status_seen()
>       perf tools: Add dsos__hit_all()
>       perf tools: Add cpu to struct thread
>       perf machine: Add ability to record the current tid for each cpu
>       perf tools: Move rdtsc() function
>       perf tools: Add dso__data_size()
>       perf tools: Pass machine to vdso__dso_findnew()
>       perf session: Add ability to 'skip' a non-piped event stream
>       perf session: Add ability to skip 4GiB or more
>       perf tools: Group VDSO global variables into a structure
>       perf machine: Fix the lifetime of the VDSO temporary file
>       perf tools: Add vdso__new()
>       perf tools: Separate the VDSO map name from the VDSO dso name
>       perf tools: Add dso__type()
>       perf tools: Add thread parameter to vdso__dso_findnew()
>       perf tools: Expose 'addr' functions so they can be reused
>       perf inject: Add --kallsyms parameter
> 
> Arnaldo Carvalho de Melo (1):
>       perf tools: Fix build on gcc 4.4.7
> 
> Jiri Olsa (3):
>       perf session: Fix accounting of ordered samples queue
>       perf record: Always force PERF_RECORD_FINISHED_ROUND event
>       perf record: Store PERF_RECORD_FINISHED_ROUND only for nonempty rounds
> 
> Sukadev Bhattiprolu (1):
>       perf powerpc: Include util/util.h and remove stringify macros
> 
>  tools/perf/Documentation/perf-inject.txt |  3 +
>  tools/perf/arch/powerpc/util/header.c    |  4 +-
>  tools/perf/arch/x86/util/tsc.c           |  9 +++
>  tools/perf/builtin-inject.c              |  2 +
>  tools/perf/builtin-record.c              |  7 ++-
>  tools/perf/builtin-script.c              | 60 +++++++-------------
>  tools/perf/builtin-trace.c               |  2 +-
>  tools/perf/tests/perf-time-to-tsc.c      |  9 ---
>  tools/perf/util/cloexec.c                |  9 ++-
>  tools/perf/util/dso.c                    | 70 ++++++++++++++++++++---
>  tools/perf/util/dso.h                    | 25 +++++++++
>  tools/perf/util/event.c                  | 42 ++++++++++++++
>  tools/perf/util/event.h                  | 10 ++++
>  tools/perf/util/header.c                 | 51 +++++++++++++++--
>  tools/perf/util/header.h                 |  2 +
>  tools/perf/util/machine.c                | 58 +++++++++++++++++--
>  tools/perf/util/machine.h                |  8 +++
>  tools/perf/util/map.c                    |  9 +--
>  tools/perf/util/map.h                    |  5 +-
>  tools/perf/util/session.c                | 25 +++++----
>  tools/perf/util/symbol-elf.c             | 35 +++++++++++-
>  tools/perf/util/symbol-minimal.c         | 21 +++++++
>  tools/perf/util/symbol.h                 |  2 +
>  tools/perf/util/thread.c                 |  1 +
>  tools/perf/util/thread.h                 |  1 +
>  tools/perf/util/tsc.c                    |  5 ++
>  tools/perf/util/tsc.h                    |  1 +
>  tools/perf/util/vdso.c                   | 96 +++++++++++++++++++++++++-------
>  tools/perf/util/vdso.h                   | 13 ++++-
>  29 files changed, 470 insertions(+), 115 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 00/27] perf/core improvements and fixes
@ 2014-07-25 15:36 Arnaldo Carvalho de Melo
  2014-07-28  8:10 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-25 15:36 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Corey Ashford, David Ahern, Don Zickus,
	Frederic Weisbecker, Jean Pihet, Jiri Olsa, Michael Ellerman,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 2336ebc32676df5b794acfe0c980583ec6c05f34:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-07-18 12:19:20 +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 dcabb507fd3a2b19aed6b4068e2a954f5fd8de45:

  perf record: Store PERF_RECORD_FINISHED_ROUND only for nonempty rounds (2014-07-25 12:17:36 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

Developer stuff:

o More prep work to support Intel PT: (Adrian Hunter)
  - Polishing 'script' BTS output
  - 'inject' can specify --kallsym
  - VDSO is per machine, not a global var
  - Expose data addr lookup functions previously private to 'script'
  - Large mmap fixes in events processing

o Fix build on gcc 4.4.7 (Arnaldo Carvalho de Melo)

o Event ordering fixes (Jiri Olsa)

o Include standard stringify macros in power pc code (Sukadev Bhattiprolu)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (22):
      perf tools: Fix incorrect fd error comparison
      perf tools: Fix jump label always changing during tracing
      perf script: Improve srcline display for BTS
      perf script: Do not print dangling '=>' for BTS
      perf tools: Record whether a dso has data
      perf tools: Add dso__data_status_seen()
      perf tools: Add dsos__hit_all()
      perf tools: Add cpu to struct thread
      perf machine: Add ability to record the current tid for each cpu
      perf tools: Move rdtsc() function
      perf tools: Add dso__data_size()
      perf tools: Pass machine to vdso__dso_findnew()
      perf session: Add ability to 'skip' a non-piped event stream
      perf session: Add ability to skip 4GiB or more
      perf tools: Group VDSO global variables into a structure
      perf machine: Fix the lifetime of the VDSO temporary file
      perf tools: Add vdso__new()
      perf tools: Separate the VDSO map name from the VDSO dso name
      perf tools: Add dso__type()
      perf tools: Add thread parameter to vdso__dso_findnew()
      perf tools: Expose 'addr' functions so they can be reused
      perf inject: Add --kallsyms parameter

Arnaldo Carvalho de Melo (1):
      perf tools: Fix build on gcc 4.4.7

Jiri Olsa (3):
      perf session: Fix accounting of ordered samples queue
      perf record: Always force PERF_RECORD_FINISHED_ROUND event
      perf record: Store PERF_RECORD_FINISHED_ROUND only for nonempty rounds

Sukadev Bhattiprolu (1):
      perf powerpc: Include util/util.h and remove stringify macros

 tools/perf/Documentation/perf-inject.txt |  3 +
 tools/perf/arch/powerpc/util/header.c    |  4 +-
 tools/perf/arch/x86/util/tsc.c           |  9 +++
 tools/perf/builtin-inject.c              |  2 +
 tools/perf/builtin-record.c              |  7 ++-
 tools/perf/builtin-script.c              | 60 +++++++-------------
 tools/perf/builtin-trace.c               |  2 +-
 tools/perf/tests/perf-time-to-tsc.c      |  9 ---
 tools/perf/util/cloexec.c                |  9 ++-
 tools/perf/util/dso.c                    | 70 ++++++++++++++++++++---
 tools/perf/util/dso.h                    | 25 +++++++++
 tools/perf/util/event.c                  | 42 ++++++++++++++
 tools/perf/util/event.h                  | 10 ++++
 tools/perf/util/header.c                 | 51 +++++++++++++++--
 tools/perf/util/header.h                 |  2 +
 tools/perf/util/machine.c                | 58 +++++++++++++++++--
 tools/perf/util/machine.h                |  8 +++
 tools/perf/util/map.c                    |  9 +--
 tools/perf/util/map.h                    |  5 +-
 tools/perf/util/session.c                | 25 +++++----
 tools/perf/util/symbol-elf.c             | 35 +++++++++++-
 tools/perf/util/symbol-minimal.c         | 21 +++++++
 tools/perf/util/symbol.h                 |  2 +
 tools/perf/util/thread.c                 |  1 +
 tools/perf/util/thread.h                 |  1 +
 tools/perf/util/tsc.c                    |  5 ++
 tools/perf/util/tsc.h                    |  1 +
 tools/perf/util/vdso.c                   | 96 +++++++++++++++++++++++++-------
 tools/perf/util/vdso.h                   | 13 ++++-
 29 files changed, 470 insertions(+), 115 deletions(-)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 00/27] perf/core improvements and fixes
  2014-06-01 13:31 Jiri Olsa
@ 2014-06-03 18:23 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2014-06-03 18:23 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo, Arun Sharma,
	David Ahern, Don Zickus, Frederic Weisbecker, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Stephane Eranian


* Jiri Olsa <jolsa@kernel.org> wrote:

> hi Ingo,
> please consider pulling
> 
> thanks,
> jirka
> 
> 
> The following changes since commit e450f90e8c7d0bf70519223c1b848446ae63f313:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-05-22 11:37:40 +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 0506aecce999d4370b979892f88cf1118cfe8dcb:
> 
>   perf tests: Add a test case for cumulating callchains (2014-06-01 14:35:11 +0200)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> . Add support to accumulate hist periods (Namhyung Kim)
> 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> ----------------------------------------------------------------
> Namhyung Kim (27):
>       perf tools: Introduce hists__inc_nr_samples()
>       perf tools: Introduce struct hist_entry_iter
>       perf hists: Add support for accumulated stat of hist entry
>       perf hists: Check if accumulated when adding a hist entry
>       perf hists: Accumulate hist entry stat based on the callchain
>       perf tools: Update cpumode for each cumulative entry
>       perf report: Cache cumulative callchains
>       perf callchain: Add callchain_cursor_snapshot()
>       perf tools: Save callchain info for each cumulative entry
>       perf ui/hist: Add support to accumulated hist stat
>       perf ui/browser: Add support to accumulated hist stat
>       perf ui/gtk: Add support to accumulated hist stat
>       perf tools: Apply percent-limit to cumulative percentage
>       perf tools: Add more hpp helper functions
>       perf report: Add --children option
>       perf report: Add report.children config option
>       perf tools: Do not auto-remove Children column if --fields given
>       perf tools: Add callback function to hist_entry_iter
>       perf top: Convert to hist_entry_iter
>       perf top: Add --children option
>       perf top: Add top.children config option
>       perf tools: Enable --children option by default
>       perf ui/stdio: Fix invalid percentage value of cumulated hist entries
>       perf ui/gtk: Fix callchain display
>       perf tools: Reset output/sort order to default
>       perf tests: Define and use symbolic names for fake symbols
>       perf tests: Add a test case for cumulating callchains
> 
>  tools/perf/Documentation/perf-report.txt |   7 +-
>  tools/perf/Documentation/perf-top.txt    |   8 +-
>  tools/perf/Makefile.perf                 |   1 +
>  tools/perf/builtin-annotate.c            |   5 +-
>  tools/perf/builtin-diff.c                |   2 +-
>  tools/perf/builtin-report.c              | 210 +++------
>  tools/perf/builtin-sched.c               |   2 +-
>  tools/perf/builtin-top.c                 |  90 ++--
>  tools/perf/tests/builtin-test.c          |   4 +
>  tools/perf/tests/hists_common.c          |  52 ++-
>  tools/perf/tests/hists_common.h          |  32 +-
>  tools/perf/tests/hists_cumulate.c        | 726 +++++++++++++++++++++++++++++++
>  tools/perf/tests/hists_filter.c          |  39 +-
>  tools/perf/tests/hists_link.c            |  36 +-
>  tools/perf/tests/hists_output.c          |  31 +-
>  tools/perf/tests/tests.h                 |   1 +
>  tools/perf/ui/browsers/hists.c           |  65 +--
>  tools/perf/ui/gtk/hists.c                |  33 +-
>  tools/perf/ui/hist.c                     | 119 +++++
>  tools/perf/ui/stdio/hist.c               |   8 +-
>  tools/perf/util/callchain.c              |  45 +-
>  tools/perf/util/callchain.h              |  11 +
>  tools/perf/util/hist.c                   | 481 +++++++++++++++++++-
>  tools/perf/util/hist.h                   |  49 ++-
>  tools/perf/util/sort.c                   |   4 +
>  tools/perf/util/sort.h                   |  18 +-
>  tools/perf/util/symbol.c                 |  11 +-
>  tools/perf/util/symbol.h                 |   1 +
>  28 files changed, 1768 insertions(+), 323 deletions(-)
>  create mode 100644 tools/perf/tests/hists_cumulate.c

Pulled, thanks a lot Jiri!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 00/27] perf/core improvements and fixes
@ 2014-06-01 13:31 Jiri Olsa
  2014-06-03 18:23 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Jiri Olsa @ 2014-06-01 13:31 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo, Arun Sharma,
	David Ahern, Don Zickus, Frederic Weisbecker, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Rodrigo Campos, Stephane Eranian,
	Jiri Olsa

hi Ingo,
please consider pulling

thanks,
jirka


The following changes since commit e450f90e8c7d0bf70519223c1b848446ae63f313:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-05-22 11:37:40 +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 0506aecce999d4370b979892f88cf1118cfe8dcb:

  perf tests: Add a test case for cumulating callchains (2014-06-01 14:35:11 +0200)

----------------------------------------------------------------
perf/core improvements and fixes:

. Add support to accumulate hist periods (Namhyung Kim)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>

----------------------------------------------------------------
Namhyung Kim (27):
      perf tools: Introduce hists__inc_nr_samples()
      perf tools: Introduce struct hist_entry_iter
      perf hists: Add support for accumulated stat of hist entry
      perf hists: Check if accumulated when adding a hist entry
      perf hists: Accumulate hist entry stat based on the callchain
      perf tools: Update cpumode for each cumulative entry
      perf report: Cache cumulative callchains
      perf callchain: Add callchain_cursor_snapshot()
      perf tools: Save callchain info for each cumulative entry
      perf ui/hist: Add support to accumulated hist stat
      perf ui/browser: Add support to accumulated hist stat
      perf ui/gtk: Add support to accumulated hist stat
      perf tools: Apply percent-limit to cumulative percentage
      perf tools: Add more hpp helper functions
      perf report: Add --children option
      perf report: Add report.children config option
      perf tools: Do not auto-remove Children column if --fields given
      perf tools: Add callback function to hist_entry_iter
      perf top: Convert to hist_entry_iter
      perf top: Add --children option
      perf top: Add top.children config option
      perf tools: Enable --children option by default
      perf ui/stdio: Fix invalid percentage value of cumulated hist entries
      perf ui/gtk: Fix callchain display
      perf tools: Reset output/sort order to default
      perf tests: Define and use symbolic names for fake symbols
      perf tests: Add a test case for cumulating callchains

 tools/perf/Documentation/perf-report.txt |   7 +-
 tools/perf/Documentation/perf-top.txt    |   8 +-
 tools/perf/Makefile.perf                 |   1 +
 tools/perf/builtin-annotate.c            |   5 +-
 tools/perf/builtin-diff.c                |   2 +-
 tools/perf/builtin-report.c              | 210 +++------
 tools/perf/builtin-sched.c               |   2 +-
 tools/perf/builtin-top.c                 |  90 ++--
 tools/perf/tests/builtin-test.c          |   4 +
 tools/perf/tests/hists_common.c          |  52 ++-
 tools/perf/tests/hists_common.h          |  32 +-
 tools/perf/tests/hists_cumulate.c        | 726 +++++++++++++++++++++++++++++++
 tools/perf/tests/hists_filter.c          |  39 +-
 tools/perf/tests/hists_link.c            |  36 +-
 tools/perf/tests/hists_output.c          |  31 +-
 tools/perf/tests/tests.h                 |   1 +
 tools/perf/ui/browsers/hists.c           |  65 +--
 tools/perf/ui/gtk/hists.c                |  33 +-
 tools/perf/ui/hist.c                     | 119 +++++
 tools/perf/ui/stdio/hist.c               |   8 +-
 tools/perf/util/callchain.c              |  45 +-
 tools/perf/util/callchain.h              |  11 +
 tools/perf/util/hist.c                   | 481 +++++++++++++++++++-
 tools/perf/util/hist.h                   |  49 ++-
 tools/perf/util/sort.c                   |   4 +
 tools/perf/util/sort.h                   |  18 +-
 tools/perf/util/symbol.c                 |  11 +-
 tools/perf/util/symbol.h                 |   1 +
 28 files changed, 1768 insertions(+), 323 deletions(-)
 create mode 100644 tools/perf/tests/hists_cumulate.c

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2018-09-24 15:03 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 14:35 [GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 01/27] perf record: Fix documentation 'event_sources' -> 'event_source' Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 02/27] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 03/27] perf data: Fix building in 32 bit platform with libbabeltrace Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 04/27] perf trace: Beautify sched_[gs]et_attr return value Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 05/27] perf tools: Update documentation info about quipper Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 06/27] perf tools: Make perf_evsel__append_filter() generic Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 07/27] perf evsel: New tracepoint specific function Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 08/27] perf evsel: Add support for address filters Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 09/27] perf script: Fix vanished idle symbols Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 10/27] perf record: Rename label 'out_symbol_exit' Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 11/27] perf record: Fix error paths Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 12/27] perf symbols: Add dso__last_symbol() Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 13/27] perf record: Add support for using symbols in address filters Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 14/27] perf probe: Increase debug level of SDT debug messages Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 15/27] perf intel-pt: Fix snapshot overlap detection decoder errors Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 16/27] perf intel-pt: Add support for recording the max non-turbo ratio Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 17/27] perf intel-pt: Fix missing error codes processing auxtrace_info Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 18/27] perf intel-pt: Add a helper function for processing AUXTRACE_INFO Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 19/27] perf intel-pt: Record address filter in AUXTRACE_INFO event Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 20/27] perf intel-pt: Read address filter from " Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 21/27] perf intel-pt: Enable decoder to handle TIP.PGD with missing IP Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 22/27] perf intel-pt: Fix decoding when there are address filters Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 23/27] perf probe: Ignore the error of finding inline instance Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 24/27] perf probe: Skip if the function address is 0 Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 25/27] perf probe: Fix to cut off incompatible chars from group name Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 26/27] perf probe: Match linkage name with mangled name Arnaldo Carvalho de Melo
2016-09-29 14:35 ` [PATCH 27/27] perf tests: Add dwarf unwind test for powerpc Arnaldo Carvalho de Melo
2016-09-29 17:11 ` [GIT PULL 00/27] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2018-09-24 15:02 Arnaldo Carvalho de Melo
2018-07-25 17:59 Arnaldo Carvalho de Melo
2018-07-25 20:34 ` Ingo Molnar
2018-01-10 21:28 Arnaldo Carvalho de Melo
2018-01-11  5:54 ` Ingo Molnar
2016-06-23 21:23 Arnaldo Carvalho de Melo
2016-06-26 10:43 ` Ingo Molnar
2014-07-25 15:36 Arnaldo Carvalho de Melo
2014-07-28  8:10 ` Ingo Molnar
2014-06-01 13:31 Jiri Olsa
2014-06-03 18:23 ` 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).