linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/19] perf/core improvements and fixes
@ 2017-03-14 18:50 Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 01/19] perf report: Hide tip message when -q option is given Arnaldo Carvalho de Melo
                   ` (19 more replies)
  0 siblings, 20 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Andi Kleen,
	Aravinda Prasad, Brendan Gregg, Changbin Du, Daniel Borkmann,
	Eric Biederman, Feng Tang, Hari Bathini, Jiri Olsa, kernel-team,
	linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim,
	Naveen N . Rao, Peter Zijlstra, Sargun Dhillon, Steven Rostedt,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit 84e5b549214f2160c12318aac549de85f600c79a:

  Merge tag 'perf-core-for-mingo-4.11-20170306' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-07 08:14:14 +0100)

are available in the git repository at:

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

for you to fetch changes up to 5f6bee34707973ea7879a7857fd63ddccc92fff3:

  kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL (2017-03-14 15:17:40 -0300)

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

New features:

- Add PERF_RECORD_NAMESPACES so that the kernel can record information
  required to associate samples to namespaces, helping in container
  problem characterization.

  Now the 'perf record has a --namespace' option to ask for such info,
  and when present, it can be used, initially, via a new sort order,
  'cgroup_id', allowing histogram entry bucketization by a (device, inode)
  based cgroup identifier (Hari Bathini)

- Add --next option to 'perf sched timehist', showing what is the next
  thread to run (Brendan Gregg)

Fixes:

- Fix segfault with basic block 'cycles' sort dimension (Changbin Du)

- Add c2c to command-list.txt, making it appear in the 'perf help'
  output (Changbin Du)

- Fix zeroing of 'abs_path' variable in the perf hists browser switch
  file code (Changbin Du)

- Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim)

Infrastructure:

- Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao)

- Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du)

Documentation:

- Document +field style argument support for --field option (Changbin Du)

- Clarify 'perf c2c --stats' help message (Namhyung Kim)

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

----------------------------------------------------------------
Brendan Gregg (1):
      perf sched timehist: Add --next option

Changbin Du (5):
      perf tools: Missing c2c command in command-list
      perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git
      perf sort: Fix segfault with basic block 'cycles' sort dimension
      perf report: Document +field style argument support for --field option
      perf hists browser: Fix typo in function switch_data_file

Hari Bathini (5):
      perf: Add PERF_RECORD_NAMESPACES to include namespaces related info
      perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info
      perf record: Synthesize namespace events for current processes
      perf script: Add script print support for namespace events
      perf tools: Add 'cgroup_id' sort order keyword

Namhyung Kim (3):
      perf report: Hide tip message when -q option is given
      perf c2c: Clarify help message of --stats option
      perf c2c: Fix display bug when using pipe

Naveen N. Rao (5):
      perf probe: Factor out the ftrace README scanning
      perf kretprobes: Offset from reloc_sym if kernel supports it
      perf powerpc: Choose local entry point with kretprobes
      doc: trace/kprobes: add information about NOKPROBE_SYMBOL
      kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL

 Documentation/trace/kprobetrace.txt         |   5 +-
 include/linux/perf_event.h                  |   2 +
 include/uapi/linux/perf_event.h             |  32 +++++-
 kernel/events/core.c                        | 139 ++++++++++++++++++++++++++
 kernel/fork.c                               |   2 +
 kernel/kprobes.c                            |   5 +-
 kernel/nsproxy.c                            |   3 +
 tools/include/uapi/linux/perf_event.h       |  32 +++++-
 tools/perf/.gitignore                       |   2 +
 tools/perf/Documentation/perf-record.txt    |   3 +
 tools/perf/Documentation/perf-report.txt    |   7 +-
 tools/perf/Documentation/perf-sched.txt     |   4 +
 tools/perf/Documentation/perf-script.txt    |   3 +
 tools/perf/arch/powerpc/util/sym-handling.c |  14 ++-
 tools/perf/builtin-annotate.c               |   1 +
 tools/perf/builtin-c2c.c                    |   4 +-
 tools/perf/builtin-diff.c                   |   1 +
 tools/perf/builtin-inject.c                 |  13 +++
 tools/perf/builtin-kmem.c                   |   1 +
 tools/perf/builtin-kvm.c                    |   2 +
 tools/perf/builtin-lock.c                   |   1 +
 tools/perf/builtin-mem.c                    |   1 +
 tools/perf/builtin-record.c                 |  35 ++++++-
 tools/perf/builtin-report.c                 |   4 +-
 tools/perf/builtin-sched.c                  |  26 ++++-
 tools/perf/builtin-script.c                 |  41 ++++++++
 tools/perf/builtin-trace.c                  |   3 +-
 tools/perf/command-list.txt                 |   1 +
 tools/perf/perf.h                           |   1 +
 tools/perf/ui/browsers/hists.c              |   2 +-
 tools/perf/util/Build                       |   1 +
 tools/perf/util/data-convert-bt.c           |   1 +
 tools/perf/util/event.c                     | 150 ++++++++++++++++++++++++++--
 tools/perf/util/event.h                     |  19 ++++
 tools/perf/util/evsel.c                     |   3 +
 tools/perf/util/hist.c                      |   7 ++
 tools/perf/util/hist.h                      |   1 +
 tools/perf/util/machine.c                   |  34 +++++++
 tools/perf/util/machine.h                   |   3 +
 tools/perf/util/namespaces.c                |  36 +++++++
 tools/perf/util/namespaces.h                |  26 +++++
 tools/perf/util/probe-event.c               |  12 +--
 tools/perf/util/probe-file.c                |  77 ++++++++------
 tools/perf/util/probe-file.h                |   1 +
 tools/perf/util/session.c                   |   7 ++
 tools/perf/util/sort.c                      |  46 +++++++++
 tools/perf/util/sort.h                      |   7 ++
 tools/perf/util/thread.c                    |  44 +++++++-
 tools/perf/util/thread.h                    |   6 ++
 tools/perf/util/tool.h                      |   2 +
 50 files changed, 799 insertions(+), 74 deletions(-)
 create mode 100644 tools/perf/util/namespaces.c
 create mode 100644 tools/perf/util/namespaces.h

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

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

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

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

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

  # uname -a
  Linux zoo 4.9.13-100.fc24.x86_64 #1 SMP Mon Feb 27 16:57:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms            : Ok
   2: Detect openat syscall event                : Ok
   3: Detect openat syscall event on all cpus    : Ok
   4: Read samples using the mmap interface      : Ok
   5: Parse event definition strings             : Ok
   6: PERF_RECORD_* events & perf_sample fields  : Ok
   7: Parse perf pmu format                      : Ok
   8: DSO data read                              : Ok
   9: DSO data cache                             : Ok
  10: DSO data reopen                            : Ok
  11: Roundtrip evsel->name                      : Ok
  12: Parse sched tracepoints fields             : Ok
  13: syscalls:sys_enter_openat event fields     : Ok
  14: Setup struct perf_event_attr               : Ok
  15: Match and link multiple hists              : Ok
  16: 'import perf' in python                    : Ok
  17: Breakpoint overflow signal handler         : Ok
  18: Breakpoint overflow sampling               : Ok
  19: Number of exit events of a simple workload : Ok
  20: Software clock events period values        : Ok
  21: Object code reading                        : Ok
  22: Sample parsing                             : Ok
  23: Use a dummy software event to keep tracking: Ok
  24: Parse with no sample_id_all bit set        : Ok
  25: Filter hist entries                        : Ok
  26: Lookup mmap thread                         : Ok
  27: Share thread mg                            : Ok
  28: Sort output of hist entries                : Ok
  29: Cumulate child hist entries                : Ok
  30: Track with sched_switch                    : Ok
  31: Filter fds with revents mask in a fdarray  : Ok
  32: Add fd to a fdarray, making it autogrow    : Ok
  33: kmod_path__parse                           : Ok
  34: Thread map                                 : Ok
  35: LLVM search and compile                    :
  35.1: Basic BPF llvm compile                    : Ok
  35.2: kbuild searching                          : Ok
  35.3: Compile source for BPF prologue generation: Ok
  35.4: Compile source for BPF relocation         : Ok
  36: Session topology                           : Ok
  37: BPF filter                                 :
  37.1: Basic BPF filtering                      : Ok
  37.2: BPF pinning                              : Ok
  37.3: BPF prologue generation                  : Ok
  37.4: BPF relocation checker                   : Ok
  38: Synthesize thread map                      : Ok
  39: Remove thread map                          : Ok
  40: Synthesize cpu map                         : Ok
  41: Synthesize stat config                     : Ok
  42: Synthesize stat                            : Ok
  43: Synthesize stat round                      : Ok
  44: Synthesize attr update                     : Ok
  45: Event times                                : Ok
  46: Read backward ring buffer                  : Ok
  47: Print cpu map                              : Ok
  48: Probe SDT events                           : Ok
  49: is_printable_array                         : Ok
  50: Print bitmap                               : Ok
  51: perf hooks                                 : Ok
  52: builtin clang support                      : Skip (not compiled in)
  53: unit_number__scnprintf                     : Ok
  54: x86 rdpmc                                  : Ok
  55: Convert perf time to TSC                   : Ok
  56: DWARF unwind                               : Ok
  57: x86 instruction decoder - new instructions : Ok
  58: Intel cqm nmi context read                 : Skip
  # 

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

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

* [PATCH 01/19] perf report: Hide tip message when -q option is given
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 02/19] perf c2c: Clarify help message of --stats option Arnaldo Carvalho de Melo
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Jiri Olsa, Peter Zijlstra,
	kernel-team, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

The tip message at the end was printed regardless of the -q option.

Originally, the message suggested only '-s comm,dso' option for higher
level view when no sort option and parent option were given.

Now it shows random help message regardless of the options so the
condition can be simplified to honor the -q option.

Committer notes:

Before:

  $ perf report --stdio -q
    42.77%  ls       ls                [.] _init
    13.21%  ls       ld-2.24.so        [.] match_symbol
    12.55%  ls       libc-2.24.so      [.] __strcoll_l
    11.94%  ls       libc-2.24.so      [.] _init

  #
  # (Tip: Show current config key-value pairs: perf config --list)
  #
  $

After:

  $ perf report --stdio -q
    42.77%  ls       ls                [.] _init
    13.21%  ls       ld-2.24.so        [.] match_symbol
    12.55%  ls       libc-2.24.so      [.] __strcoll_l
    11.94%  ls       libc-2.24.so      [.] _init

  $

We still have those two extra lines tho (that git commit insists in
turning into one, or git commit --amend doesn't make me add), food for
another patch...

Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170307150851.22304-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-report.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0a88670e56f3..f03a5eac2a62 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -394,8 +394,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
 		fprintf(stdout, "\n\n");
 	}
 
-	if (sort_order == NULL &&
-	    parent_pattern == default_parent_pattern)
+	if (!quiet)
 		fprintf(stdout, "#\n# (%s)\n#\n", help);
 
 	if (rep->show_threads) {
-- 
2.9.3

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

* [PATCH 02/19] perf c2c: Clarify help message of --stats option
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 01/19] perf report: Hide tip message when -q option is given Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 03/19] perf c2c: Fix display bug when using pipe Arnaldo Carvalho de Melo
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Peter Zijlstra, kernel-team,
	Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

As it is not strictly asking for only stdio output, but will imply using
it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170307150851.22304-5-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index e2b21723bbf8..3fac30ed92f1 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2536,7 +2536,7 @@ static int perf_c2c__report(int argc, const char **argv)
 	OPT_BOOLEAN(0, "stdio", &c2c.use_stdio, "Use the stdio interface"),
 #endif
 	OPT_BOOLEAN(0, "stats", &c2c.stats_only,
-		    "Use the stdio interface"),
+		    "Display only statistic tables (implies --stdio)"),
 	OPT_BOOLEAN(0, "full-symbols", &c2c.symbol_full,
 		    "Display full length of symbols"),
 	OPT_BOOLEAN(0, "no-source", &no_source,
-- 
2.9.3

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

* [PATCH 03/19] perf c2c: Fix display bug when using pipe
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 01/19] perf report: Hide tip message when -q option is given Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 02/19] perf c2c: Clarify help message of --stats option Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 04/19] perf tools: Missing c2c command in command-list Arnaldo Carvalho de Melo
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Peter Zijlstra, kernel-team,
	Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

Currently 'perf c2c report' determines display mode using the --stdio
option, but it could be a problem if stdout is not a tty since
setup_browser falls back to stdio in this case.

But perf c2c didn't know this and tried to use TUI browser anyway.  It
should check "use_browser" variable instead.

For example, the following command showed nothing and broke terminal
setting.  Now it's fixed..

  $ perf c2c report | head
  =================================================
              Trace Event Information
  =================================================
    Total records                     :        136
    Locked Load/Store Operations      :          6
    Load Operations                   :         62
    Loads - uncacheable               :          0
    Loads - IO                        :          1
    Loads - Miss                      :          7
    Loads - no mapping                :          2

Committer notes:

When trying it without a proper perf.data file it results in a stuck
terminal, just as Namhyung reported above:

  [acme@jouet ~]$ perf c2c report | head
  WARNING: no sample cpu value[acme@jouet ~]$

One has to kill it from some other xterm. Confirm that this patch fixes
it:

After:

  $ perf c2c report | head
  WARNING: no sample cpu value=================================================
              Trace Event Information
  =================================================
    Total records                     :         14
    Locked Load/Store Operations      :          0
    Load Operations                   :          0
    Loads - uncacheable               :          0
    Loads - IO                        :          0
    Loads - Miss                      :          0
    Loads - no mapping                :          0
  $

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170307150851.22304-6-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 3fac30ed92f1..5cd6d7a047b9 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2334,7 +2334,7 @@ static int perf_c2c__hists_browse(struct hists *hists)
 
 static void perf_c2c_display(struct perf_session *session)
 {
-	if (c2c.use_stdio)
+	if (use_browser == 0)
 		perf_c2c__hists_fprintf(stdout, session);
 	else
 		perf_c2c__hists_browse(&c2c.hists.hists);
-- 
2.9.3

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

* [PATCH 04/19] perf tools: Missing c2c command in command-list
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 03/19] perf c2c: Fix display bug when using pipe Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 05/19] perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git Arnaldo Carvalho de Melo
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Changbin Du, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Changbin Du <changbin.du@intel.com>

Add the c2c command to command-list.txt so perf help can list this
command.

Committer notes:

Before:

  # perf help | grep c2c
  #

After:

  # perf help | grep c2c
     c2c             Shared Data C2C/HITM Analyzer.
  #

Signed-off-by: Changbin Du <changbin.du@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170313082845.23373-1-changbin.du@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/command-list.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/command-list.txt b/tools/perf/command-list.txt
index ac3efd396a72..2d0caf20ff3a 100644
--- a/tools/perf/command-list.txt
+++ b/tools/perf/command-list.txt
@@ -9,6 +9,7 @@ perf-buildid-cache		mainporcelain common
 perf-buildid-list		mainporcelain common
 perf-data			mainporcelain common
 perf-diff			mainporcelain common
+perf-c2c			mainporcelain common
 perf-config			mainporcelain common
 perf-evlist			mainporcelain common
 perf-ftrace			mainporcelain common
-- 
2.9.3

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

* [PATCH 05/19] perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 04/19] perf tools: Missing c2c command in command-list Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 06/19] perf sort: Fix segfault with basic block 'cycles' sort dimension Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Changbin Du, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Changbin Du <changbin.du@intel.com>

Ignore two files: pmu-events/{jevents,pmu-events.c} which are generated
during the build.

Committer notes:

Testing it:

  $ make -C tools/perf/
  $ git status
  On branch perf/core
  Untracked files:
  (use "git add <file>..." to include in what will be committed)

	tools/perf/pmu-events/jevents
	tools/perf/pmu-events/pmu-events.c

  nothing added to commit but untracked files present (use "git add" to track)
  $

After the patch:

  $ git status
  On branch perf/core
  nothing to commit, working tree clean
  $

Signed-off-by: Changbin Du <changbin.du@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170313083026.23487-1-changbin.du@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/.gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 3db3db9278be..643cc4ba6872 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -31,3 +31,5 @@ config.mak.autogen
 .config-detected
 util/intel-pt-decoder/inat-tables.c
 arch/*/include/generated/
+pmu-events/pmu-events.c
+pmu-events/jevents
-- 
2.9.3

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

* [PATCH 06/19] perf sort: Fix segfault with basic block 'cycles' sort dimension
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 05/19] perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 07/19] perf report: Document +field style argument support for --field option Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Changbin Du, Andi Kleen, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Changbin Du <changbin.du@intel.com>

Skip the sample which doesn't have branch_info to avoid segmentation
fault:

The fault can be reproduced by:

  perf record -a
  perf report -F cycles

Signed-off-by: Changbin Du <changbin.du@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 0e332f033a82 ("perf tools: Add support for cycles, weight branch_info field")
Link: http://lkml.kernel.org/r/20170313083148.23568-1-changbin.du@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index f8f16c0e20b6..93f755ac60ca 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -846,6 +846,9 @@ static int hist_entry__mispredict_snprintf(struct hist_entry *he, char *bf,
 static int64_t
 sort__cycles_cmp(struct hist_entry *left, struct hist_entry *right)
 {
+	if (!left->branch_info || !right->branch_info)
+		return cmp_null(left->branch_info, right->branch_info);
+
 	return left->branch_info->flags.cycles -
 		right->branch_info->flags.cycles;
 }
@@ -853,6 +856,8 @@ sort__cycles_cmp(struct hist_entry *left, struct hist_entry *right)
 static int hist_entry__cycles_snprintf(struct hist_entry *he, char *bf,
 				    size_t size, unsigned int width)
 {
+	if (!he->branch_info)
+		return scnprintf(bf, size, "%-.*s", width, "N/A");
 	if (he->branch_info->flags.cycles == 0)
 		return repsep_snprintf(bf, size, "%-*s", width, "-");
 	return repsep_snprintf(bf, size, "%-*hd", width,
-- 
2.9.3

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

* [PATCH 07/19] perf report: Document +field style argument support for --field option
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 06/19] perf sort: Fix segfault with basic block 'cycles' sort dimension Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 08/19] perf hists browser: Fix typo in function switch_data_file Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Changbin Du, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Changbin Du <changbin.du@intel.com>

Commit 2f3f9bcf000b ("perf tools: Add +field argument support for
--field option") by Jiri Olsa <jolsa@kernel.org> introduced +field style
argument support for --field option.

This is useful but not updated documentation.  This add a little
description there.

Signed-off-by: Changbin Du <changbin.du@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170313083252.23644-1-changbin.du@intel.com
[ Slightly improved the phrase structure ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-report.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 33f91906f5dc..672b149aa80a 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -173,6 +173,9 @@ OPTIONS
 	By default, every sort keys not specified in -F will be appended
 	automatically.
 
+	If the keys starts with a prefix '+', then it will append the specified
+        field(s) to the default field order. For example: perf report -F +period,sample.
+
 -p::
 --parent=<regex>::
         A regex filter to identify parent. The parent is a caller of this
-- 
2.9.3

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

* [PATCH 08/19] perf hists browser: Fix typo in function switch_data_file
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 07/19] perf report: Document +field style argument support for --field option Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 09/19] perf: Add PERF_RECORD_NAMESPACES to include namespaces related info Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Changbin Du, Feng Tang, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Changbin Du <changbin.du@intel.com>

Should clear buf 'abs_path', not 'options'.

Signed-off-by: Changbin Du <changbin.du@intel.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 341487ab561f ("perf hists browser: Add option for runtime switching perf data file")
Link: http://lkml.kernel.org/r/20170313114652.9207-1-changbin.du@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index fc4fb669ceee..2dc82bec10c0 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2308,7 +2308,7 @@ static int switch_data_file(void)
 		return ret;
 
 	memset(options, 0, sizeof(options));
-	memset(options, 0, sizeof(abs_path));
+	memset(abs_path, 0, sizeof(abs_path));
 
 	while ((dent = readdir(pwd_dir))) {
 		char path[PATH_MAX];
-- 
2.9.3

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

* [PATCH 09/19] perf: Add PERF_RECORD_NAMESPACES to include namespaces related info
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 08/19] perf hists browser: Fix typo in function switch_data_file Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 10/19] perf tools: " Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Hari Bathini, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Aravinda Prasad,
	Brendan Gregg, Daniel Borkmann, Eric Biederman, Sargun Dhillon,
	Steven Rostedt, Arnaldo Carvalho de Melo

From: Hari Bathini <hbathini@linux.vnet.ibm.com>

With the advert of container technologies like docker, that depend on
namespaces for isolation, there is a need for tracing support for
namespaces. This patch introduces new PERF_RECORD_NAMESPACES event for
recording namespaces related info. By recording info for every
namespace, it is left to userspace to take a call on the definition of a
container and trace containers by updating perf tool accordingly.

Each namespace has a combination of device and inode numbers. Though
every namespace has the same device number currently, that may change in
future to avoid the need for a namespace of namespaces. Considering such
possibility, record both device and inode numbers separately for each
namespace.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891929686.25309.2827618988917007768.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 include/linux/perf_event.h      |   2 +
 include/uapi/linux/perf_event.h |  32 ++++++++-
 kernel/events/core.c            | 139 ++++++++++++++++++++++++++++++++++++++++
 kernel/fork.c                   |   2 +
 kernel/nsproxy.c                |   3 +
 5 files changed, 177 insertions(+), 1 deletion(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 000fdb211c7d..f19a82362851 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1112,6 +1112,7 @@ extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks
 
 extern void perf_event_exec(void);
 extern void perf_event_comm(struct task_struct *tsk, bool exec);
+extern void perf_event_namespaces(struct task_struct *tsk);
 extern void perf_event_fork(struct task_struct *tsk);
 
 /* Callchains */
@@ -1315,6 +1316,7 @@ static inline int perf_unregister_guest_info_callbacks
 static inline void perf_event_mmap(struct vm_area_struct *vma)		{ }
 static inline void perf_event_exec(void)				{ }
 static inline void perf_event_comm(struct task_struct *tsk, bool exec)	{ }
+static inline void perf_event_namespaces(struct task_struct *tsk)	{ }
 static inline void perf_event_fork(struct task_struct *tsk)		{ }
 static inline void perf_event_init(void)				{ }
 static inline int  perf_swevent_get_recursion_context(void)		{ return -1; }
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index c66a485a24ac..bec0aad0e15c 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -344,7 +344,8 @@ struct perf_event_attr {
 				use_clockid    :  1, /* use @clockid for time fields */
 				context_switch :  1, /* context switch data */
 				write_backward :  1, /* Write ring buffer from end to beginning */
-				__reserved_1   : 36;
+				namespaces     :  1, /* include namespaces data */
+				__reserved_1   : 35;
 
 	union {
 		__u32		wakeup_events;	  /* wakeup every n events */
@@ -610,6 +611,23 @@ struct perf_event_header {
 	__u16	size;
 };
 
+struct perf_ns_link_info {
+	__u64	dev;
+	__u64	ino;
+};
+
+enum {
+	NET_NS_INDEX		= 0,
+	UTS_NS_INDEX		= 1,
+	IPC_NS_INDEX		= 2,
+	PID_NS_INDEX		= 3,
+	USER_NS_INDEX		= 4,
+	MNT_NS_INDEX		= 5,
+	CGROUP_NS_INDEX		= 6,
+
+	NR_NAMESPACES,		/* number of available namespaces */
+};
+
 enum perf_event_type {
 
 	/*
@@ -862,6 +880,18 @@ enum perf_event_type {
 	 */
 	PERF_RECORD_SWITCH_CPU_WIDE		= 15,
 
+	/*
+	 * struct {
+	 *	struct perf_event_header	header;
+	 *	u32				pid;
+	 *	u32				tid;
+	 *	u64				nr_namespaces;
+	 *	{ u64				dev, inode; } [nr_namespaces];
+	 *	struct sample_id		sample_id;
+	 * };
+	 */
+	PERF_RECORD_NAMESPACES			= 16,
+
 	PERF_RECORD_MAX,			/* non-ABI */
 };
 
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 6f41548f2e32..16c877a121c8 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -48,6 +48,8 @@
 #include <linux/parser.h>
 #include <linux/sched/clock.h>
 #include <linux/sched/mm.h>
+#include <linux/proc_ns.h>
+#include <linux/mount.h>
 
 #include "internal.h"
 
@@ -379,6 +381,7 @@ static DEFINE_PER_CPU(struct pmu_event_list, pmu_sb_events);
 
 static atomic_t nr_mmap_events __read_mostly;
 static atomic_t nr_comm_events __read_mostly;
+static atomic_t nr_namespaces_events __read_mostly;
 static atomic_t nr_task_events __read_mostly;
 static atomic_t nr_freq_events __read_mostly;
 static atomic_t nr_switch_events __read_mostly;
@@ -3991,6 +3994,8 @@ static void unaccount_event(struct perf_event *event)
 		atomic_dec(&nr_mmap_events);
 	if (event->attr.comm)
 		atomic_dec(&nr_comm_events);
+	if (event->attr.namespaces)
+		atomic_dec(&nr_namespaces_events);
 	if (event->attr.task)
 		atomic_dec(&nr_task_events);
 	if (event->attr.freq)
@@ -6491,6 +6496,7 @@ static void perf_event_task(struct task_struct *task,
 void perf_event_fork(struct task_struct *task)
 {
 	perf_event_task(task, NULL, 1);
+	perf_event_namespaces(task);
 }
 
 /*
@@ -6593,6 +6599,132 @@ void perf_event_comm(struct task_struct *task, bool exec)
 }
 
 /*
+ * namespaces tracking
+ */
+
+struct perf_namespaces_event {
+	struct task_struct		*task;
+
+	struct {
+		struct perf_event_header	header;
+
+		u32				pid;
+		u32				tid;
+		u64				nr_namespaces;
+		struct perf_ns_link_info	link_info[NR_NAMESPACES];
+	} event_id;
+};
+
+static int perf_event_namespaces_match(struct perf_event *event)
+{
+	return event->attr.namespaces;
+}
+
+static void perf_event_namespaces_output(struct perf_event *event,
+					 void *data)
+{
+	struct perf_namespaces_event *namespaces_event = data;
+	struct perf_output_handle handle;
+	struct perf_sample_data sample;
+	int ret;
+
+	if (!perf_event_namespaces_match(event))
+		return;
+
+	perf_event_header__init_id(&namespaces_event->event_id.header,
+				   &sample, event);
+	ret = perf_output_begin(&handle, event,
+				namespaces_event->event_id.header.size);
+	if (ret)
+		return;
+
+	namespaces_event->event_id.pid = perf_event_pid(event,
+							namespaces_event->task);
+	namespaces_event->event_id.tid = perf_event_tid(event,
+							namespaces_event->task);
+
+	perf_output_put(&handle, namespaces_event->event_id);
+
+	perf_event__output_id_sample(event, &handle, &sample);
+
+	perf_output_end(&handle);
+}
+
+static void perf_fill_ns_link_info(struct perf_ns_link_info *ns_link_info,
+				   struct task_struct *task,
+				   const struct proc_ns_operations *ns_ops)
+{
+	struct path ns_path;
+	struct inode *ns_inode;
+	void *error;
+
+	error = ns_get_path(&ns_path, task, ns_ops);
+	if (!error) {
+		ns_inode = ns_path.dentry->d_inode;
+		ns_link_info->dev = new_encode_dev(ns_inode->i_sb->s_dev);
+		ns_link_info->ino = ns_inode->i_ino;
+	}
+}
+
+void perf_event_namespaces(struct task_struct *task)
+{
+	struct perf_namespaces_event namespaces_event;
+	struct perf_ns_link_info *ns_link_info;
+
+	if (!atomic_read(&nr_namespaces_events))
+		return;
+
+	namespaces_event = (struct perf_namespaces_event){
+		.task	= task,
+		.event_id  = {
+			.header = {
+				.type = PERF_RECORD_NAMESPACES,
+				.misc = 0,
+				.size = sizeof(namespaces_event.event_id),
+			},
+			/* .pid */
+			/* .tid */
+			.nr_namespaces = NR_NAMESPACES,
+			/* .link_info[NR_NAMESPACES] */
+		},
+	};
+
+	ns_link_info = namespaces_event.event_id.link_info;
+
+	perf_fill_ns_link_info(&ns_link_info[MNT_NS_INDEX],
+			       task, &mntns_operations);
+
+#ifdef CONFIG_USER_NS
+	perf_fill_ns_link_info(&ns_link_info[USER_NS_INDEX],
+			       task, &userns_operations);
+#endif
+#ifdef CONFIG_NET_NS
+	perf_fill_ns_link_info(&ns_link_info[NET_NS_INDEX],
+			       task, &netns_operations);
+#endif
+#ifdef CONFIG_UTS_NS
+	perf_fill_ns_link_info(&ns_link_info[UTS_NS_INDEX],
+			       task, &utsns_operations);
+#endif
+#ifdef CONFIG_IPC_NS
+	perf_fill_ns_link_info(&ns_link_info[IPC_NS_INDEX],
+			       task, &ipcns_operations);
+#endif
+#ifdef CONFIG_PID_NS
+	perf_fill_ns_link_info(&ns_link_info[PID_NS_INDEX],
+			       task, &pidns_operations);
+#endif
+#ifdef CONFIG_CGROUPS
+	perf_fill_ns_link_info(&ns_link_info[CGROUP_NS_INDEX],
+			       task, &cgroupns_operations);
+#endif
+
+	perf_iterate_sb(perf_event_namespaces_output,
+			&namespaces_event,
+			NULL);
+}
+
+/*
  * mmap tracking
  */
 
@@ -9146,6 +9278,8 @@ static void account_event(struct perf_event *event)
 		atomic_inc(&nr_mmap_events);
 	if (event->attr.comm)
 		atomic_inc(&nr_comm_events);
+	if (event->attr.namespaces)
+		atomic_inc(&nr_namespaces_events);
 	if (event->attr.task)
 		atomic_inc(&nr_task_events);
 	if (event->attr.freq)
@@ -9691,6 +9825,11 @@ SYSCALL_DEFINE5(perf_event_open,
 			return -EACCES;
 	}
 
+	if (attr.namespaces) {
+		if (!capable(CAP_SYS_ADMIN))
+			return -EACCES;
+	}
+
 	if (attr.freq) {
 		if (attr.sample_freq > sysctl_perf_event_sample_rate)
 			return -EINVAL;
diff --git a/kernel/fork.c b/kernel/fork.c
index 6c463c80e93d..afa2947286cd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2352,6 +2352,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
 		}
 	}
 
+	perf_event_namespaces(current);
+
 bad_unshare_cleanup_cred:
 	if (new_cred)
 		put_cred(new_cred);
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 782102e59eed..f6c5d330059a 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -26,6 +26,7 @@
 #include <linux/file.h>
 #include <linux/syscalls.h>
 #include <linux/cgroup.h>
+#include <linux/perf_event.h>
 
 static struct kmem_cache *nsproxy_cachep;
 
@@ -262,6 +263,8 @@ SYSCALL_DEFINE2(setns, int, fd, int, nstype)
 		goto out;
 	}
 	switch_task_namespaces(tsk, new_nsproxy);
+
+	perf_event_namespaces(tsk);
 out:
 	fput(file);
 	return err;
-- 
2.9.3

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

* [PATCH 10/19] perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 09/19] perf: Add PERF_RECORD_NAMESPACES to include namespaces related info Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 11/19] perf record: Synthesize namespace events for current processes Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Hari Bathini, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Aravinda Prasad,
	Brendan Gregg, Daniel Borkmann, Eric Biederman, Peter Zijlstra,
	Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo

From: Hari Bathini <hbathini@linux.vnet.ibm.com>

Introduce a new option to record PERF_RECORD_NAMESPACES events emitted
by the kernel when fork, clone, setns or unshare are invoked. And update
perf-record documentation with the new option to record namespace
events.

Committer notes:

Combined it with a later patch to allow printing it via 'perf report -D'
and be able to test the feature introduced in this patch. Had to move
here also perf_ns__name(), that was introduced in another later patch.

Also used PRIu64 and PRIx64 to fix the build in some enfironments wrt:

  util/event.c:1129:39: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'long long unsigned int' [-Werror=format=]
     ret  += fprintf(fp, "%u/%s: %lu/0x%lx%s", idx
                                         ^
Testing it:

  # perf record --namespaces -a
  ^C[ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.083 MB perf.data (423 samples) ]
  #
  # perf report -D
  <SNIP>
  3 2028902078892 0x115140 [0xa0]: PERF_RECORD_NAMESPACES 14783/14783 - nr_namespaces: 7
                [0/net: 3/0xf0000081, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
                 4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]

  0x1151e0 [0x30]: event: 9
  .
  . ... raw event: size 48 bytes
  .  0000:  09 00 00 00 02 00 30 00 c4 71 82 68 0c 7f 00 00  ......0..q.h....
  .  0010:  a9 39 00 00 a9 39 00 00 94 28 fe 63 d8 01 00 00  .9...9...(.c....
  .  0020:  03 00 00 00 00 00 00 00 ce c4 02 00 00 00 00 00  ................
  <SNIP>
        NAMESPACES events:          1
  <SNIP>
  #

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891930386.25309.18412039920746995488.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/uapi/linux/perf_event.h    | 32 +++++++++++++++++-
 tools/perf/Documentation/perf-record.txt |  3 ++
 tools/perf/builtin-annotate.c            |  1 +
 tools/perf/builtin-diff.c                |  1 +
 tools/perf/builtin-inject.c              | 13 ++++++++
 tools/perf/builtin-kmem.c                |  1 +
 tools/perf/builtin-kvm.c                 |  2 ++
 tools/perf/builtin-lock.c                |  1 +
 tools/perf/builtin-mem.c                 |  1 +
 tools/perf/builtin-record.c              |  6 ++++
 tools/perf/builtin-report.c              |  1 +
 tools/perf/builtin-sched.c               |  1 +
 tools/perf/builtin-script.c              |  1 +
 tools/perf/builtin-trace.c               |  3 +-
 tools/perf/perf.h                        |  1 +
 tools/perf/util/Build                    |  1 +
 tools/perf/util/data-convert-bt.c        |  1 +
 tools/perf/util/event.c                  | 56 ++++++++++++++++++++++++++++++++
 tools/perf/util/event.h                  | 13 ++++++++
 tools/perf/util/evsel.c                  |  3 ++
 tools/perf/util/machine.c                | 34 +++++++++++++++++++
 tools/perf/util/machine.h                |  3 ++
 tools/perf/util/namespaces.c             | 36 ++++++++++++++++++++
 tools/perf/util/namespaces.h             | 26 +++++++++++++++
 tools/perf/util/session.c                |  7 ++++
 tools/perf/util/thread.c                 | 44 +++++++++++++++++++++++--
 tools/perf/util/thread.h                 |  6 ++++
 tools/perf/util/tool.h                   |  2 ++
 28 files changed, 296 insertions(+), 4 deletions(-)
 create mode 100644 tools/perf/util/namespaces.c
 create mode 100644 tools/perf/util/namespaces.h

diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index c66a485a24ac..bec0aad0e15c 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -344,7 +344,8 @@ struct perf_event_attr {
 				use_clockid    :  1, /* use @clockid for time fields */
 				context_switch :  1, /* context switch data */
 				write_backward :  1, /* Write ring buffer from end to beginning */
-				__reserved_1   : 36;
+				namespaces     :  1, /* include namespaces data */
+				__reserved_1   : 35;
 
 	union {
 		__u32		wakeup_events;	  /* wakeup every n events */
@@ -610,6 +611,23 @@ struct perf_event_header {
 	__u16	size;
 };
 
+struct perf_ns_link_info {
+	__u64	dev;
+	__u64	ino;
+};
+
+enum {
+	NET_NS_INDEX		= 0,
+	UTS_NS_INDEX		= 1,
+	IPC_NS_INDEX		= 2,
+	PID_NS_INDEX		= 3,
+	USER_NS_INDEX		= 4,
+	MNT_NS_INDEX		= 5,
+	CGROUP_NS_INDEX		= 6,
+
+	NR_NAMESPACES,		/* number of available namespaces */
+};
+
 enum perf_event_type {
 
 	/*
@@ -862,6 +880,18 @@ enum perf_event_type {
 	 */
 	PERF_RECORD_SWITCH_CPU_WIDE		= 15,
 
+	/*
+	 * struct {
+	 *	struct perf_event_header	header;
+	 *	u32				pid;
+	 *	u32				tid;
+	 *	u64				nr_namespaces;
+	 *	{ u64				dev, inode; } [nr_namespaces];
+	 *	struct sample_id		sample_id;
+	 * };
+	 */
+	PERF_RECORD_NAMESPACES			= 16,
+
 	PERF_RECORD_MAX,			/* non-ABI */
 };
 
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index b16003ec14a7..ea3789d05e5e 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -347,6 +347,9 @@ Enable weightened sampling. An additional weight is recorded per sample and can
 displayed with the weight and local_weight sort keys.  This currently works for TSX
 abort events and some memory events in precise mode on modern Intel CPUs.
 
+--namespaces::
+Record events of type PERF_RECORD_NAMESPACES.
+
 --transaction::
 Record transaction flags for transaction related events.
 
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4f52d85f5ebc..e54b1f9fe1ee 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -393,6 +393,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 			.comm	= perf_event__process_comm,
 			.exit	= perf_event__process_exit,
 			.fork	= perf_event__process_fork,
+			.namespaces = perf_event__process_namespaces,
 			.ordered_events = true,
 			.ordering_requires_timestamps = true,
 		},
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 1b96a3122228..5e4803158672 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -364,6 +364,7 @@ static struct perf_tool tool = {
 	.exit	= perf_event__process_exit,
 	.fork	= perf_event__process_fork,
 	.lost	= perf_event__process_lost,
+	.namespaces = perf_event__process_namespaces,
 	.ordered_events = true,
 	.ordering_requires_timestamps = true,
 };
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index b9bc7e39833a..8d1d13b9bab6 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -333,6 +333,18 @@ static int perf_event__repipe_comm(struct perf_tool *tool,
 	return err;
 }
 
+static int perf_event__repipe_namespaces(struct perf_tool *tool,
+					 union perf_event *event,
+					 struct perf_sample *sample,
+					 struct machine *machine)
+{
+	int err = perf_event__process_namespaces(tool, event, sample, machine);
+
+	perf_event__repipe(tool, event, sample, machine);
+
+	return err;
+}
+
 static int perf_event__repipe_exit(struct perf_tool *tool,
 				   union perf_event *event,
 				   struct perf_sample *sample,
@@ -660,6 +672,7 @@ static int __cmd_inject(struct perf_inject *inject)
 		session->itrace_synth_opts = &inject->itrace_synth_opts;
 		inject->itrace_synth_opts.inject = true;
 		inject->tool.comm	    = perf_event__repipe_comm;
+		inject->tool.namespaces	    = perf_event__repipe_namespaces;
 		inject->tool.exit	    = perf_event__repipe_exit;
 		inject->tool.id_index	    = perf_event__repipe_id_index;
 		inject->tool.auxtrace_info  = perf_event__process_auxtrace_info;
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 6da8d083e4e5..d509e74bc6e8 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -964,6 +964,7 @@ static struct perf_tool perf_kmem = {
 	.comm		 = perf_event__process_comm,
 	.mmap		 = perf_event__process_mmap,
 	.mmap2		 = perf_event__process_mmap2,
+	.namespaces	 = perf_event__process_namespaces,
 	.ordered_events	 = true,
 };
 
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 08fa88f62a24..18e6c38864bc 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1044,6 +1044,7 @@ static int read_events(struct perf_kvm_stat *kvm)
 	struct perf_tool eops = {
 		.sample			= process_sample_event,
 		.comm			= perf_event__process_comm,
+		.namespaces		= perf_event__process_namespaces,
 		.ordered_events		= true,
 	};
 	struct perf_data_file file = {
@@ -1348,6 +1349,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
 	kvm->tool.exit   = perf_event__process_exit;
 	kvm->tool.fork   = perf_event__process_fork;
 	kvm->tool.lost   = process_lost_event;
+	kvm->tool.namespaces  = perf_event__process_namespaces;
 	kvm->tool.ordered_events = true;
 	perf_tool__fill_defaults(&kvm->tool);
 
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index ce3bfb48b26f..d750ccaa978f 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -858,6 +858,7 @@ static int __cmd_report(bool display_info)
 	struct perf_tool eops = {
 		.sample		 = process_sample_event,
 		.comm		 = perf_event__process_comm,
+		.namespaces	 = perf_event__process_namespaces,
 		.ordered_events	 = true,
 	};
 	struct perf_data_file file = {
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 6114e07ca613..030a6cfdda59 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -342,6 +342,7 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused)
 			.lost		= perf_event__process_lost,
 			.fork		= perf_event__process_fork,
 			.build_id	= perf_event__process_build_id,
+			.namespaces	= perf_event__process_namespaces,
 			.ordered_events	= true,
 		},
 		.input_name		 = "perf.data",
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index bc84a375295d..99562c7242b6 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -876,6 +876,9 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 	signal(SIGTERM, sig_handler);
 	signal(SIGSEGV, sigsegv_handler);
 
+	if (rec->opts.record_namespaces)
+		tool->namespace_events = true;
+
 	if (rec->opts.auxtrace_snapshot_mode || rec->switch_output.enabled) {
 		signal(SIGUSR2, snapshot_sig_handler);
 		if (rec->opts.auxtrace_snapshot_mode)
@@ -1497,6 +1500,7 @@ static struct record record = {
 		.fork		= perf_event__process_fork,
 		.exit		= perf_event__process_exit,
 		.comm		= perf_event__process_comm,
+		.namespaces	= perf_event__process_namespaces,
 		.mmap		= perf_event__process_mmap,
 		.mmap2		= perf_event__process_mmap2,
 		.ordered_events	= true,
@@ -1611,6 +1615,8 @@ static struct option __record_options[] = {
 			  "opts", "AUX area tracing Snapshot Mode", ""),
 	OPT_UINTEGER(0, "proc-map-timeout", &record.opts.proc_map_timeout,
 			"per thread proc mmap processing timeout in ms"),
+	OPT_BOOLEAN(0, "namespaces", &record.opts.record_namespaces,
+		    "Record namespaces events"),
 	OPT_BOOLEAN(0, "switch-events", &record.opts.record_switch_events,
 		    "Record context switch events"),
 	OPT_BOOLEAN_FLAG(0, "all-kernel", &record.opts.all_kernel,
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f03a5eac2a62..5ab8117c3bfd 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -700,6 +700,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
 			.mmap		 = perf_event__process_mmap,
 			.mmap2		 = perf_event__process_mmap2,
 			.comm		 = perf_event__process_comm,
+			.namespaces	 = perf_event__process_namespaces,
 			.exit		 = perf_event__process_exit,
 			.fork		 = perf_event__process_fork,
 			.lost		 = perf_event__process_lost,
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index b94cf0de715a..16170e9b47e6 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -3272,6 +3272,7 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
 		.tool = {
 			.sample		 = perf_sched__process_tracepoint_sample,
 			.comm		 = perf_event__process_comm,
+			.namespaces	 = perf_event__process_namespaces,
 			.lost		 = perf_event__process_lost,
 			.fork		 = perf_sched__process_fork_event,
 			.ordered_events = true,
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index c0783b4f7b6c..f1ce806a1f31 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2097,6 +2097,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 			.mmap		 = perf_event__process_mmap,
 			.mmap2		 = perf_event__process_mmap2,
 			.comm		 = perf_event__process_comm,
+			.namespaces	 = perf_event__process_namespaces,
 			.exit		 = perf_event__process_exit,
 			.fork		 = perf_event__process_fork,
 			.attr		 = process_attr,
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 256f1fac6f7e..912fedc5b42d 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2415,8 +2415,9 @@ static int trace__replay(struct trace *trace)
 	trace->tool.exit	  = perf_event__process_exit;
 	trace->tool.fork	  = perf_event__process_fork;
 	trace->tool.attr	  = perf_event__process_attr;
-	trace->tool.tracing_data = perf_event__process_tracing_data;
+	trace->tool.tracing_data  = perf_event__process_tracing_data;
 	trace->tool.build_id	  = perf_event__process_build_id;
+	trace->tool.namespaces	  = perf_event__process_namespaces;
 
 	trace->tool.ordered_events = true;
 	trace->tool.ordering_requires_timestamps = true;
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 1c27d947c2fe..806c216a1078 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -50,6 +50,7 @@ struct record_opts {
 	bool	     running_time;
 	bool	     full_auxtrace;
 	bool	     auxtrace_snapshot_mode;
+	bool	     record_namespaces;
 	bool	     record_switch_events;
 	bool	     all_kernel;
 	bool	     all_user;
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 5da376bc1afc..2ea5ee179a3b 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -42,6 +42,7 @@ libperf-y += pstack.o
 libperf-y += session.o
 libperf-$(CONFIG_AUDIT) += syscalltbl.o
 libperf-y += ordered-events.o
+libperf-y += namespaces.o
 libperf-y += comm.o
 libperf-y += thread.o
 libperf-y += thread_map.o
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 4e6cbc99f08e..89ece2445713 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -1468,6 +1468,7 @@ int bt_convert__perf2ctf(const char *input, const char *path,
 			.lost            = perf_event__process_lost,
 			.tracing_data    = perf_event__process_tracing_data,
 			.build_id        = perf_event__process_build_id,
+			.namespaces      = perf_event__process_namespaces,
 			.ordered_events  = true,
 			.ordering_requires_timestamps = true,
 		},
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 4ea7ce72ed9c..fb52819023c7 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -31,6 +31,7 @@ static const char *perf_event__names[] = {
 	[PERF_RECORD_LOST_SAMPLES]		= "LOST_SAMPLES",
 	[PERF_RECORD_SWITCH]			= "SWITCH",
 	[PERF_RECORD_SWITCH_CPU_WIDE]		= "SWITCH_CPU_WIDE",
+	[PERF_RECORD_NAMESPACES]		= "NAMESPACES",
 	[PERF_RECORD_HEADER_ATTR]		= "ATTR",
 	[PERF_RECORD_HEADER_EVENT_TYPE]		= "EVENT_TYPE",
 	[PERF_RECORD_HEADER_TRACING_DATA]	= "TRACING_DATA",
@@ -49,6 +50,16 @@ static const char *perf_event__names[] = {
 	[PERF_RECORD_TIME_CONV]			= "TIME_CONV",
 };
 
+static const char *perf_ns__names[] = {
+	[NET_NS_INDEX]		= "net",
+	[UTS_NS_INDEX]		= "uts",
+	[IPC_NS_INDEX]		= "ipc",
+	[PID_NS_INDEX]		= "pid",
+	[USER_NS_INDEX]		= "user",
+	[MNT_NS_INDEX]		= "mnt",
+	[CGROUP_NS_INDEX]	= "cgroup",
+};
+
 const char *perf_event__name(unsigned int id)
 {
 	if (id >= ARRAY_SIZE(perf_event__names))
@@ -58,6 +69,13 @@ const char *perf_event__name(unsigned int id)
 	return perf_event__names[id];
 }
 
+static const char *perf_ns__name(unsigned int id)
+{
+	if (id >= ARRAY_SIZE(perf_ns__names))
+		return "UNKNOWN";
+	return perf_ns__names[id];
+}
+
 static int perf_tool__process_synth_event(struct perf_tool *tool,
 					  union perf_event *event,
 					  struct machine *machine,
@@ -1008,6 +1026,33 @@ size_t perf_event__fprintf_comm(union perf_event *event, FILE *fp)
 	return fprintf(fp, "%s: %s:%d/%d\n", s, event->comm.comm, event->comm.pid, event->comm.tid);
 }
 
+size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp)
+{
+	size_t ret = 0;
+	struct perf_ns_link_info *ns_link_info;
+	u32 nr_namespaces, idx;
+
+	ns_link_info = event->namespaces.link_info;
+	nr_namespaces = event->namespaces.nr_namespaces;
+
+	ret += fprintf(fp, " %d/%d - nr_namespaces: %u\n\t\t[",
+		       event->namespaces.pid,
+		       event->namespaces.tid,
+		       nr_namespaces);
+
+	for (idx = 0; idx < nr_namespaces; idx++) {
+		if (idx && (idx % 4 == 0))
+			ret += fprintf(fp, "\n\t\t ");
+
+		ret  += fprintf(fp, "%u/%s: %" PRIu64 "/%#" PRIx64 "%s", idx,
+				perf_ns__name(idx), (u64)ns_link_info[idx].dev,
+				(u64)ns_link_info[idx].ino,
+				((idx + 1) != nr_namespaces) ? ", " : "]\n");
+	}
+
+	return ret;
+}
+
 int perf_event__process_comm(struct perf_tool *tool __maybe_unused,
 			     union perf_event *event,
 			     struct perf_sample *sample,
@@ -1016,6 +1061,14 @@ int perf_event__process_comm(struct perf_tool *tool __maybe_unused,
 	return machine__process_comm_event(machine, event, sample);
 }
 
+int perf_event__process_namespaces(struct perf_tool *tool __maybe_unused,
+				   union perf_event *event,
+				   struct perf_sample *sample,
+				   struct machine *machine)
+{
+	return machine__process_namespaces_event(machine, event, sample);
+}
+
 int perf_event__process_lost(struct perf_tool *tool __maybe_unused,
 			     union perf_event *event,
 			     struct perf_sample *sample,
@@ -1196,6 +1249,9 @@ size_t perf_event__fprintf(union perf_event *event, FILE *fp)
 	case PERF_RECORD_MMAP:
 		ret += perf_event__fprintf_mmap(event, fp);
 		break;
+	case PERF_RECORD_NAMESPACES:
+		ret += perf_event__fprintf_namespaces(event, fp);
+		break;
 	case PERF_RECORD_MMAP2:
 		ret += perf_event__fprintf_mmap2(event, fp);
 		break;
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index c735c53a26f8..b39ff795b9a9 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -39,6 +39,13 @@ struct comm_event {
 	char comm[16];
 };
 
+struct namespaces_event {
+	struct perf_event_header header;
+	u32 pid, tid;
+	u64 nr_namespaces;
+	struct perf_ns_link_info link_info[];
+};
+
 struct fork_event {
 	struct perf_event_header header;
 	u32 pid, ppid;
@@ -485,6 +492,7 @@ union perf_event {
 	struct mmap_event		mmap;
 	struct mmap2_event		mmap2;
 	struct comm_event		comm;
+	struct namespaces_event		namespaces;
 	struct fork_event		fork;
 	struct lost_event		lost;
 	struct lost_samples_event	lost_samples;
@@ -587,6 +595,10 @@ int perf_event__process_switch(struct perf_tool *tool,
 			       union perf_event *event,
 			       struct perf_sample *sample,
 			       struct machine *machine);
+int perf_event__process_namespaces(struct perf_tool *tool,
+				   union perf_event *event,
+				   struct perf_sample *sample,
+				   struct machine *machine);
 int perf_event__process_mmap(struct perf_tool *tool,
 			     union perf_event *event,
 			     struct perf_sample *sample,
@@ -653,6 +665,7 @@ size_t perf_event__fprintf_itrace_start(union perf_event *event, FILE *fp);
 size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp);
 size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp);
 size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp);
+size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp);
 size_t perf_event__fprintf(union perf_event *event, FILE *fp);
 
 u64 kallsyms__get_function_start(const char *kallsyms_filename,
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ac59710b79e0..175dc2305aa8 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -932,6 +932,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
 	attr->mmap2 = track && !perf_missing_features.mmap2;
 	attr->comm  = track;
 
+	if (opts->record_namespaces)
+		attr->namespaces  = track;
+
 	if (opts->record_switch_events)
 		attr->context_switch = track;
 
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index b9974fe41bc1..dfc600446586 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -13,6 +13,7 @@
 #include <symbol/kallsyms.h>
 #include "unwind.h"
 #include "linux/hash.h"
+#include "asm/bug.h"
 
 static void __machine__remove_thread(struct machine *machine, struct thread *th, bool lock);
 
@@ -501,6 +502,37 @@ int machine__process_comm_event(struct machine *machine, union perf_event *event
 	return err;
 }
 
+int machine__process_namespaces_event(struct machine *machine __maybe_unused,
+				      union perf_event *event,
+				      struct perf_sample *sample __maybe_unused)
+{
+	struct thread *thread = machine__findnew_thread(machine,
+							event->namespaces.pid,
+							event->namespaces.tid);
+	int err = 0;
+
+	WARN_ONCE(event->namespaces.nr_namespaces > NR_NAMESPACES,
+		  "\nWARNING: kernel seems to support more namespaces than perf"
+		  " tool.\nTry updating the perf tool..\n\n");
+
+	WARN_ONCE(event->namespaces.nr_namespaces < NR_NAMESPACES,
+		  "\nWARNING: perf tool seems to support more namespaces than"
+		  " the kernel.\nTry updating the kernel..\n\n");
+
+	if (dump_trace)
+		perf_event__fprintf_namespaces(event, stdout);
+
+	if (thread == NULL ||
+	    thread__set_namespaces(thread, sample->time, &event->namespaces)) {
+		dump_printf("problem processing PERF_RECORD_NAMESPACES, skipping event.\n");
+		err = -1;
+	}
+
+	thread__put(thread);
+
+	return err;
+}
+
 int machine__process_lost_event(struct machine *machine __maybe_unused,
 				union perf_event *event, struct perf_sample *sample __maybe_unused)
 {
@@ -1538,6 +1570,8 @@ int machine__process_event(struct machine *machine, union perf_event *event,
 		ret = machine__process_comm_event(machine, event, sample); break;
 	case PERF_RECORD_MMAP:
 		ret = machine__process_mmap_event(machine, event, sample); break;
+	case PERF_RECORD_NAMESPACES:
+		ret = machine__process_namespaces_event(machine, event, sample); break;
 	case PERF_RECORD_MMAP2:
 		ret = machine__process_mmap2_event(machine, event, sample); break;
 	case PERF_RECORD_FORK:
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index a28305029711..3cdb1340f917 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -97,6 +97,9 @@ int machine__process_itrace_start_event(struct machine *machine,
 					union perf_event *event);
 int machine__process_switch_event(struct machine *machine,
 				  union perf_event *event);
+int machine__process_namespaces_event(struct machine *machine,
+				      union perf_event *event,
+				      struct perf_sample *sample);
 int machine__process_mmap_event(struct machine *machine, union perf_event *event,
 				struct perf_sample *sample);
 int machine__process_mmap2_event(struct machine *machine, union perf_event *event,
diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c
new file mode 100644
index 000000000000..2de8da64d90c
--- /dev/null
+++ b/tools/perf/util/namespaces.c
@@ -0,0 +1,36 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation.
+ *
+ * Copyright (C) 2017 Hari Bathini, IBM Corporation
+ */
+
+#include "namespaces.h"
+#include "util.h"
+#include "event.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+struct namespaces *namespaces__new(struct namespaces_event *event)
+{
+	struct namespaces *namespaces;
+	u64 link_info_size = ((event ? event->nr_namespaces : NR_NAMESPACES) *
+			      sizeof(struct perf_ns_link_info));
+
+	namespaces = zalloc(sizeof(struct namespaces) + link_info_size);
+	if (!namespaces)
+		return NULL;
+
+	namespaces->end_time = -1;
+
+	if (event)
+		memcpy(namespaces->link_info, event->link_info, link_info_size);
+
+	return namespaces;
+}
+
+void namespaces__free(struct namespaces *namespaces)
+{
+	free(namespaces);
+}
diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
new file mode 100644
index 000000000000..468f1e9a1484
--- /dev/null
+++ b/tools/perf/util/namespaces.h
@@ -0,0 +1,26 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation.
+ *
+ * Copyright (C) 2017 Hari Bathini, IBM Corporation
+ */
+
+#ifndef __PERF_NAMESPACES_H
+#define __PERF_NAMESPACES_H
+
+#include "../perf.h"
+#include <linux/list.h>
+
+struct namespaces_event;
+
+struct namespaces {
+	struct list_head list;
+	u64 end_time;
+	struct perf_ns_link_info link_info[];
+};
+
+struct namespaces *namespaces__new(struct namespaces_event *event);
+void namespaces__free(struct namespaces *namespaces);
+
+#endif  /* __PERF_NAMESPACES_H */
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 1dd617d116b5..ae42e742d461 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1239,6 +1239,8 @@ static int machines__deliver_event(struct machines *machines,
 		return tool->mmap2(tool, event, sample, machine);
 	case PERF_RECORD_COMM:
 		return tool->comm(tool, event, sample, machine);
+	case PERF_RECORD_NAMESPACES:
+		return tool->namespaces(tool, event, sample, machine);
 	case PERF_RECORD_FORK:
 		return tool->fork(tool, event, sample, machine);
 	case PERF_RECORD_EXIT:
@@ -1494,6 +1496,11 @@ int perf_session__register_idle_thread(struct perf_session *session)
 		err = -1;
 	}
 
+	if (thread == NULL || thread__set_namespaces(thread, 0, NULL)) {
+		pr_err("problem inserting idle task.\n");
+		err = -1;
+	}
+
 	/* machine__findnew_thread() got the thread, so put it */
 	thread__put(thread);
 	return err;
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 74e79d26b421..dcdb87a5d0a1 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -7,6 +7,7 @@
 #include "thread-stack.h"
 #include "util.h"
 #include "debug.h"
+#include "namespaces.h"
 #include "comm.h"
 #include "unwind.h"
 
@@ -40,6 +41,7 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 		thread->tid = tid;
 		thread->ppid = -1;
 		thread->cpu = -1;
+		INIT_LIST_HEAD(&thread->namespaces_list);
 		INIT_LIST_HEAD(&thread->comm_list);
 
 		comm_str = malloc(32);
@@ -66,7 +68,8 @@ struct thread *thread__new(pid_t pid, pid_t tid)
 
 void thread__delete(struct thread *thread)
 {
-	struct comm *comm, *tmp;
+	struct namespaces *namespaces, *tmp_namespaces;
+	struct comm *comm, *tmp_comm;
 
 	BUG_ON(!RB_EMPTY_NODE(&thread->rb_node));
 
@@ -76,7 +79,12 @@ void thread__delete(struct thread *thread)
 		map_groups__put(thread->mg);
 		thread->mg = NULL;
 	}
-	list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) {
+	list_for_each_entry_safe(namespaces, tmp_namespaces,
+				 &thread->namespaces_list, list) {
+		list_del(&namespaces->list);
+		namespaces__free(namespaces);
+	}
+	list_for_each_entry_safe(comm, tmp_comm, &thread->comm_list, list) {
 		list_del(&comm->list);
 		comm__free(comm);
 	}
@@ -104,6 +112,38 @@ void thread__put(struct thread *thread)
 	}
 }
 
+struct namespaces *thread__namespaces(const struct thread *thread)
+{
+	if (list_empty(&thread->namespaces_list))
+		return NULL;
+
+	return list_first_entry(&thread->namespaces_list, struct namespaces, list);
+}
+
+int thread__set_namespaces(struct thread *thread, u64 timestamp,
+			   struct namespaces_event *event)
+{
+	struct namespaces *new, *curr = thread__namespaces(thread);
+
+	new = namespaces__new(event);
+	if (!new)
+		return -ENOMEM;
+
+	list_add(&new->list, &thread->namespaces_list);
+
+	if (timestamp && curr) {
+		/*
+		 * setns syscall must have changed few or all the namespaces
+		 * of this thread. Update end time for the namespaces
+		 * previously used.
+		 */
+		curr = list_next_entry(new, list);
+		curr->end_time = timestamp;
+	}
+
+	return 0;
+}
+
 struct comm *thread__comm(const struct thread *thread)
 {
 	if (list_empty(&thread->comm_list))
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index e57188546465..4eb849e9098f 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -28,6 +28,7 @@ struct thread {
 	bool			comm_set;
 	int			comm_len;
 	bool			dead; /* if set thread has exited */
+	struct list_head	namespaces_list;
 	struct list_head	comm_list;
 	u64			db_id;
 
@@ -40,6 +41,7 @@ struct thread {
 };
 
 struct machine;
+struct namespaces;
 struct comm;
 
 struct thread *thread__new(pid_t pid, pid_t tid);
@@ -62,6 +64,10 @@ static inline void thread__exited(struct thread *thread)
 	thread->dead = true;
 }
 
+struct namespaces *thread__namespaces(const struct thread *thread);
+int thread__set_namespaces(struct thread *thread, u64 timestamp,
+			   struct namespaces_event *event);
+
 int __thread__set_comm(struct thread *thread, const char *comm, u64 timestamp,
 		       bool exec);
 static inline int thread__set_comm(struct thread *thread, const char *comm,
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h
index ac2590a3de2d..829471a1c6d7 100644
--- a/tools/perf/util/tool.h
+++ b/tools/perf/util/tool.h
@@ -40,6 +40,7 @@ struct perf_tool {
 	event_op	mmap,
 			mmap2,
 			comm,
+			namespaces,
 			fork,
 			exit,
 			lost,
@@ -66,6 +67,7 @@ struct perf_tool {
 	event_op3	auxtrace;
 	bool		ordered_events;
 	bool		ordering_requires_timestamps;
+	bool		namespace_events;
 };
 
 #endif /* __PERF_TOOL_H */
-- 
2.9.3

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

* [PATCH 11/19] perf record: Synthesize namespace events for current processes
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 10/19] perf tools: " Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 12/19] perf script: Add script print support for namespace events Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Hari Bathini, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Aravinda Prasad,
	Brendan Gregg, Daniel Borkmann, Eric Biederman, Peter Zijlstra,
	Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo

From: Hari Bathini <hbathini@linux.vnet.ibm.com>

Synthesize PERF_RECORD_NAMESPACES events for processes that were running prior
to invocation of perf record. The data for this is taken from /proc/$PID/ns.
These changes make way for analyzing events with regard to namespaces.

Committer notes:

Check if 'tool' is NULL in perf_event__synthesize_namespaces(), as in the
test__mmap_thread_lookup case, i.e. 'perf test Lookup mmap thread".

Testing it:

  # ps axH > /tmp/allthreads
  # perf record -a --namespaces usleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.169 MB perf.data (8 samples) ]
  # perf report -D | grep PERF_RECORD_NAMESPACES | wc -l
  602
  # wc -l /tmp/allthreads
  601 /tmp/allthreads
  # tail /tmp/allthreads
  16951 pts/4    T      0:00 git rebase -i a033bf1bfacdaa25642e6bcc857a7d0f67cc3c92^
  16952 pts/4    T      0:00 /bin/sh /usr/libexec/git-core/git-rebase -i a033bf1bfacdaa25642e6bcc857a7d0f67cc3c92^
  17176 pts/4    T      0:00 git commit --amend --no-post-rewrite
  17204 pts/4    T      0:00 vim /home/acme/git/linux/.git/COMMIT_EDITMSG
  18939 ?        S      0:00 [kworker/2:1]
  18947 ?        S      0:00 [kworker/3:0]
  18974 ?        S      0:00 [kworker/1:0]
  19047 ?        S      0:00 [kworker/0:1]
  19152 pts/6    S+     0:00 weechat
  19153 pts/7    R+     0:00 ps axH
  # perf report -D | grep PERF_RECORD_NAMESPACES | tail
  0 0 0x125068 [0xa0]: PERF_RECORD_NAMESPACES 17176/17176 - nr_namespaces: 7
  0 0 0x1255b8 [0xa0]: PERF_RECORD_NAMESPACES 17204/17204 - nr_namespaces: 7
  0 0 0x125df0 [0xa0]: PERF_RECORD_NAMESPACES 18939/18939 - nr_namespaces: 7
  0 0 0x125f00 [0xa0]: PERF_RECORD_NAMESPACES 18947/18947 - nr_namespaces: 7
  0 0 0x126010 [0xa0]: PERF_RECORD_NAMESPACES 18974/18974 - nr_namespaces: 7
  0 0 0x126120 [0xa0]: PERF_RECORD_NAMESPACES 19047/19047 - nr_namespaces: 7
  0 0 0x126230 [0xa0]: PERF_RECORD_NAMESPACES 19152/19152 - nr_namespaces: 7
  0 0 0x129330 [0xa0]: PERF_RECORD_NAMESPACES 19154/19154 - nr_namespaces: 7
  0 0 0x12a1f8 [0xa0]: PERF_RECORD_NAMESPACES 19155/19155 - nr_namespaces: 7
  0 0 0x12b0b8 [0xa0]: PERF_RECORD_NAMESPACES 19155/19155 - nr_namespaces: 7
  #

Humm, investigate why we got two record for the 19155 pid/tid...

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891931111.25309.11073854609798681633.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c | 29 ++++++++++++--
 tools/perf/util/event.c     | 94 ++++++++++++++++++++++++++++++++++++++++++---
 tools/perf/util/event.h     |  6 +++
 3 files changed, 119 insertions(+), 10 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 99562c7242b6..04faef79a548 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -986,6 +986,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 	 */
 	if (forks) {
 		union perf_event *event;
+		pid_t tgid;
 
 		event = malloc(sizeof(event->comm) + machine->id_hdr_size);
 		if (event == NULL) {
@@ -999,10 +1000,30 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 		 * cannot see a correct process name for those events.
 		 * Synthesize COMM event to prevent it.
 		 */
-		perf_event__synthesize_comm(tool, event,
-					    rec->evlist->workload.pid,
-					    process_synthesized_event,
-					    machine);
+		tgid = perf_event__synthesize_comm(tool, event,
+						   rec->evlist->workload.pid,
+						   process_synthesized_event,
+						   machine);
+		free(event);
+
+		if (tgid == -1)
+			goto out_child;
+
+		event = malloc(sizeof(event->namespaces) +
+			       (NR_NAMESPACES * sizeof(struct perf_ns_link_info)) +
+			       machine->id_hdr_size);
+		if (event == NULL) {
+			err = -ENOMEM;
+			goto out_child;
+		}
+
+		/*
+		 * Synthesize NAMESPACES event for the command specified.
+		 */
+		perf_event__synthesize_namespaces(tool, event,
+						  rec->evlist->workload.pid,
+						  tgid, process_synthesized_event,
+						  machine);
 		free(event);
 
 		perf_evlist__start_workload(rec->evlist);
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index fb52819023c7..d082cb70445d 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -221,6 +221,58 @@ pid_t perf_event__synthesize_comm(struct perf_tool *tool,
 	return tgid;
 }
 
+static void perf_event__get_ns_link_info(pid_t pid, const char *ns,
+					 struct perf_ns_link_info *ns_link_info)
+{
+	struct stat64 st;
+	char proc_ns[128];
+
+	sprintf(proc_ns, "/proc/%u/ns/%s", pid, ns);
+	if (stat64(proc_ns, &st) == 0) {
+		ns_link_info->dev = st.st_dev;
+		ns_link_info->ino = st.st_ino;
+	}
+}
+
+int perf_event__synthesize_namespaces(struct perf_tool *tool,
+				      union perf_event *event,
+				      pid_t pid, pid_t tgid,
+				      perf_event__handler_t process,
+				      struct machine *machine)
+{
+	u32 idx;
+	struct perf_ns_link_info *ns_link_info;
+
+	if (!tool || !tool->namespace_events)
+		return 0;
+
+	memset(&event->namespaces, 0, (sizeof(event->namespaces) +
+	       (NR_NAMESPACES * sizeof(struct perf_ns_link_info)) +
+	       machine->id_hdr_size));
+
+	event->namespaces.pid = tgid;
+	event->namespaces.tid = pid;
+
+	event->namespaces.nr_namespaces = NR_NAMESPACES;
+
+	ns_link_info = event->namespaces.link_info;
+
+	for (idx = 0; idx < event->namespaces.nr_namespaces; idx++)
+		perf_event__get_ns_link_info(pid, perf_ns__name(idx),
+					     &ns_link_info[idx]);
+
+	event->namespaces.header.type = PERF_RECORD_NAMESPACES;
+
+	event->namespaces.header.size = (sizeof(event->namespaces) +
+			(NR_NAMESPACES * sizeof(struct perf_ns_link_info)) +
+			machine->id_hdr_size);
+
+	if (perf_tool__process_synth_event(tool, event, machine, process) != 0)
+		return -1;
+
+	return 0;
+}
+
 static int perf_event__synthesize_fork(struct perf_tool *tool,
 				       union perf_event *event,
 				       pid_t pid, pid_t tgid, pid_t ppid,
@@ -452,8 +504,9 @@ int perf_event__synthesize_modules(struct perf_tool *tool,
 static int __event__synthesize_thread(union perf_event *comm_event,
 				      union perf_event *mmap_event,
 				      union perf_event *fork_event,
+				      union perf_event *namespaces_event,
 				      pid_t pid, int full,
-					  perf_event__handler_t process,
+				      perf_event__handler_t process,
 				      struct perf_tool *tool,
 				      struct machine *machine,
 				      bool mmap_data,
@@ -473,6 +526,11 @@ static int __event__synthesize_thread(union perf_event *comm_event,
 		if (tgid == -1)
 			return -1;
 
+		if (perf_event__synthesize_namespaces(tool, namespaces_event, pid,
+						      tgid, process, machine) < 0)
+			return -1;
+
+
 		return perf_event__synthesize_mmap_events(tool, mmap_event, pid, tgid,
 							  process, machine, mmap_data,
 							  proc_map_timeout);
@@ -506,6 +564,11 @@ static int __event__synthesize_thread(union perf_event *comm_event,
 		if (perf_event__synthesize_fork(tool, fork_event, _pid, tgid,
 						ppid, process, machine) < 0)
 			break;
+
+		if (perf_event__synthesize_namespaces(tool, namespaces_event, _pid,
+						      tgid, process, machine) < 0)
+			break;
+
 		/*
 		 * Send the prepared comm event
 		 */
@@ -534,6 +597,7 @@ int perf_event__synthesize_thread_map(struct perf_tool *tool,
 				      unsigned int proc_map_timeout)
 {
 	union perf_event *comm_event, *mmap_event, *fork_event;
+	union perf_event *namespaces_event;
 	int err = -1, thread, j;
 
 	comm_event = malloc(sizeof(comm_event->comm) + machine->id_hdr_size);
@@ -548,10 +612,16 @@ int perf_event__synthesize_thread_map(struct perf_tool *tool,
 	if (fork_event == NULL)
 		goto out_free_mmap;
 
+	namespaces_event = malloc(sizeof(namespaces_event->namespaces) +
+				  (NR_NAMESPACES * sizeof(struct perf_ns_link_info)) +
+				  machine->id_hdr_size);
+	if (namespaces_event == NULL)
+		goto out_free_fork;
+
 	err = 0;
 	for (thread = 0; thread < threads->nr; ++thread) {
 		if (__event__synthesize_thread(comm_event, mmap_event,
-					       fork_event,
+					       fork_event, namespaces_event,
 					       thread_map__pid(threads, thread), 0,
 					       process, tool, machine,
 					       mmap_data, proc_map_timeout)) {
@@ -577,7 +647,7 @@ int perf_event__synthesize_thread_map(struct perf_tool *tool,
 			/* if not, generate events for it */
 			if (need_leader &&
 			    __event__synthesize_thread(comm_event, mmap_event,
-						       fork_event,
+						       fork_event, namespaces_event,
 						       comm_event->comm.pid, 0,
 						       process, tool, machine,
 						       mmap_data, proc_map_timeout)) {
@@ -586,6 +656,8 @@ int perf_event__synthesize_thread_map(struct perf_tool *tool,
 			}
 		}
 	}
+	free(namespaces_event);
+out_free_fork:
 	free(fork_event);
 out_free_mmap:
 	free(mmap_event);
@@ -605,6 +677,7 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
 	char proc_path[PATH_MAX];
 	struct dirent *dirent;
 	union perf_event *comm_event, *mmap_event, *fork_event;
+	union perf_event *namespaces_event;
 	int err = -1;
 
 	if (machine__is_default_guest(machine))
@@ -622,11 +695,17 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
 	if (fork_event == NULL)
 		goto out_free_mmap;
 
+	namespaces_event = malloc(sizeof(namespaces_event->namespaces) +
+				  (NR_NAMESPACES * sizeof(struct perf_ns_link_info)) +
+				  machine->id_hdr_size);
+	if (namespaces_event == NULL)
+		goto out_free_fork;
+
 	snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir);
 	proc = opendir(proc_path);
 
 	if (proc == NULL)
-		goto out_free_fork;
+		goto out_free_namespaces;
 
 	while ((dirent = readdir(proc)) != NULL) {
 		char *end;
@@ -638,13 +717,16 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
  		 * We may race with exiting thread, so don't stop just because
  		 * one thread couldn't be synthesized.
  		 */
-		__event__synthesize_thread(comm_event, mmap_event, fork_event, pid,
-					   1, process, tool, machine, mmap_data,
+		__event__synthesize_thread(comm_event, mmap_event, fork_event,
+					   namespaces_event, pid, 1, process,
+					   tool, machine, mmap_data,
 					   proc_map_timeout);
 	}
 
 	err = 0;
 	closedir(proc);
+out_free_namespaces:
+	free(namespaces_event);
 out_free_fork:
 	free(fork_event);
 out_free_mmap:
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index b39ff795b9a9..e1d8166ebbd5 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -648,6 +648,12 @@ pid_t perf_event__synthesize_comm(struct perf_tool *tool,
 				  perf_event__handler_t process,
 				  struct machine *machine);
 
+int perf_event__synthesize_namespaces(struct perf_tool *tool,
+				      union perf_event *event,
+				      pid_t pid, pid_t tgid,
+				      perf_event__handler_t process,
+				      struct machine *machine);
+
 int perf_event__synthesize_mmap_events(struct perf_tool *tool,
 				       union perf_event *event,
 				       pid_t pid, pid_t tgid,
-- 
2.9.3

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

* [PATCH 12/19] perf script: Add script print support for namespace events
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 11/19] perf record: Synthesize namespace events for current processes Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 13/19] perf tools: Add 'cgroup_id' sort order keyword Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Hari Bathini, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Aravinda Prasad,
	Brendan Gregg, Daniel Borkmann, Eric Biederman, Peter Zijlstra,
	Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo

From: Hari Bathini <hbathini@linux.vnet.ibm.com>

Introduce a new option to display events of type PERF_RECORD_NAMESPACES
and update perf-script documentation accordingly.

Shown below is output (trimmed) of perf script command with the newly
introduced option, on perf.data generated with perf record command using
--namespaces option.

  $ perf script --show-namespace-events
      swapper   0 [000]     0.000000: PERF_RECORD_NAMESPACES 1/1 - nr_namespaces: 7
                [0/net: 3/0xf000001c, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
                 4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]
      swapper   0 [000]     0.000000: PERF_RECORD_NAMESPACES 2/2 - nr_namespaces: 7
                [0/net: 3/0xf000001c, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
                 4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]

Commiter notes:

Testing it:

Investigating that double PERF_RECORD_NAMESPACES for the 19155
pid/tid... Its more than that, there are two PERF_RECORD_COMM as well,
and with zeroed timestamps, so probably a synthesizing artifact...

  # perf script --show-task --show-namespace
  <SNIP>
      perf     0 [000]     0.000000: PERF_RECORD_COMM: perf:19154/19154
      perf     0 [000]     0.000000: PERF_RECORD_FORK(19155:19155):(19154:19154)
      perf     0 [000]     0.000000: PERF_RECORD_NAMESPACES 19155/19155 - nr_namespaces: 7
          [0/net: 3/0xf0000081, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
           4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]
      perf     0 [000]     0.000000: PERF_RECORD_COMM: perf:19155/19155
      perf     0 [000]     0.000000: PERF_RECORD_COMM: perf:19155/19155
      perf     0 [000]     0.000000: PERF_RECORD_NAMESPACES 19155/19155 - nr_namespaces: 7
          [0/net: 3/0xf0000081, 1/uts: 3/0xeffffffe, 2/ipc: 3/0xefffffff, 3/pid: 3/0xeffffffc,
           4/user: 3/0xeffffffd, 5/mnt: 3/0xf0000000, 6/cgroup: 3/0xeffffffb]
   swapper     0 [000]  3110.881834:          1 cycles:  ffffffffa7060bf6 native_write_msr (/lib/modules/4.11.0-rc1+/build/vmlinux)

  <SNIP>

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891932627.25309.1941587059154176221.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-script.txt |  3 +++
 tools/perf/builtin-script.c              | 40 ++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 4ed5f239ba7d..62c9b0c77a3a 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -248,6 +248,9 @@ OPTIONS
 --show-mmap-events
 	Display mmap related events (e.g. MMAP, MMAP2).
 
+--show-namespace-events
+	Display namespace events i.e. events of type PERF_RECORD_NAMESPACES.
+
 --show-switch-events
 	Display context switch events i.e. events of type PERF_RECORD_SWITCH or
 	PERF_RECORD_SWITCH_CPU_WIDE.
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index f1ce806a1f31..66d62c98dff9 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -830,6 +830,7 @@ struct perf_script {
 	bool			show_task_events;
 	bool			show_mmap_events;
 	bool			show_switch_events;
+	bool			show_namespace_events;
 	bool			allocated;
 	struct cpu_map		*cpus;
 	struct thread_map	*threads;
@@ -1118,6 +1119,41 @@ static int process_comm_event(struct perf_tool *tool,
 	return ret;
 }
 
+static int process_namespaces_event(struct perf_tool *tool,
+				    union perf_event *event,
+				    struct perf_sample *sample,
+				    struct machine *machine)
+{
+	struct thread *thread;
+	struct perf_script *script = container_of(tool, struct perf_script, tool);
+	struct perf_session *session = script->session;
+	struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
+	int ret = -1;
+
+	thread = machine__findnew_thread(machine, event->namespaces.pid,
+					 event->namespaces.tid);
+	if (thread == NULL) {
+		pr_debug("problem processing NAMESPACES event, skipping it.\n");
+		return -1;
+	}
+
+	if (perf_event__process_namespaces(tool, event, sample, machine) < 0)
+		goto out;
+
+	if (!evsel->attr.sample_id_all) {
+		sample->cpu = 0;
+		sample->time = 0;
+		sample->tid = event->namespaces.tid;
+		sample->pid = event->namespaces.pid;
+	}
+	print_sample_start(sample, thread, evsel);
+	perf_event__fprintf(event, stdout);
+	ret = 0;
+out:
+	thread__put(thread);
+	return ret;
+}
+
 static int process_fork_event(struct perf_tool *tool,
 			      union perf_event *event,
 			      struct perf_sample *sample,
@@ -1293,6 +1329,8 @@ static int __cmd_script(struct perf_script *script)
 	}
 	if (script->show_switch_events)
 		script->tool.context_switch = process_switch_event;
+	if (script->show_namespace_events)
+		script->tool.namespaces = process_namespaces_event;
 
 	ret = perf_session__process_events(script->session);
 
@@ -2181,6 +2219,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 		    "Show the mmap events"),
 	OPT_BOOLEAN('\0', "show-switch-events", &script.show_switch_events,
 		    "Show context switch events (if recorded)"),
+	OPT_BOOLEAN('\0', "show-namespace-events", &script.show_namespace_events,
+		    "Show namespace events (if recorded)"),
 	OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
 	OPT_BOOLEAN(0, "ns", &nanosecs,
 		    "Use 9 decimal places when displaying time"),
-- 
2.9.3

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

* [PATCH 13/19] perf tools: Add 'cgroup_id' sort order keyword
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 12/19] perf script: Add script print support for namespace events Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 14/19] perf sched timehist: Add --next option Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Hari Bathini, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Aravinda Prasad,
	Brendan Gregg, Daniel Borkmann, Eric Biederman, Jiri Olsa,
	Peter Zijlstra, Sargun Dhillon, Steven Rostedt,
	Arnaldo Carvalho de Melo

From: Hari Bathini <hbathini@linux.vnet.ibm.com>

This patch introduces a cgroup identifier entry field in perf report to
identify or distinguish data of different cgroups. It uses the device
number and inode number of cgroup namespace, included in perf data with
the new PERF_RECORD_NAMESPACES event, as cgroup identifier.

With the assumption that each container is created with it's own cgroup
namespace,  this allows assessment/analysis of multiple containers at
once.

A simple test for this would be to clone a few processes passing
SIGCHILD & CLONE_NEWCROUP flags to each of them, execute shell and run
different workloads  on each of those contexts,  while running perf
record command with --namespaces option.

Shown below is the output of perf report, sorted with cgroup identifier,
on perf.data generated with the above test scenario, clearly indicating
one context's considerable use of kernel memory in comparison with
others:

	$ perf report -s cgroup_id,sample --stdio
	#
	# Total Lost Samples: 0
	#
	# Samples: 5K of event 'kmem:kmalloc'
	# Event count (approx.): 5965
	#
	# Overhead  cgroup id (dev/inode)       Samples
	# ........  .....................  ............
	#
	    81.27%  3/0xeffffffb                   4848
	    16.24%  3/0xf00000d0                    969
	     1.16%  3/0xf00000ce                     69
	     0.82%  3/0xf00000cf                     49
	     0.50%  0/0x0                            30

While this is a start, there is further scope of improving this. For
example, instead of cgroup namespace's device and inode numbers, dev
and inode numbers of some or all namespaces may be used to distinguish
which processes are running in a given container context.

Also, scripts to map device and inode info to containers sounds
plausible for better tracing of containers.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891933338.25309.756882900782042645.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-report.txt |  4 +++-
 tools/perf/util/hist.c                   |  7 ++++++
 tools/perf/util/hist.h                   |  1 +
 tools/perf/util/sort.c                   | 41 ++++++++++++++++++++++++++++++++
 tools/perf/util/sort.h                   |  7 ++++++
 5 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 672b149aa80a..e9a61f5485eb 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -72,7 +72,8 @@ OPTIONS
 --sort=::
 	Sort histogram entries by given key(s) - multiple keys can be specified
 	in CSV format.  Following sort keys are available:
-	pid, comm, dso, symbol, parent, cpu, socket, srcline, weight, local_weight.
+	pid, comm, dso, symbol, parent, cpu, socket, srcline, weight,
+	local_weight, cgroup_id.
 
 	Each key has following meaning:
 
@@ -92,6 +93,7 @@ OPTIONS
 	- weight: Event specific weight, e.g. memory latency or transaction
 	abort cost. This is the global weight.
 	- local_weight: Local weight version of the weight above.
+	- cgroup_id: ID derived from cgroup namespace device and inode numbers.
 	- transaction: Transaction abort flags.
 	- overhead: Overhead percentage of sample
 	- overhead_sys: Overhead percentage of sample running in system mode
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index eaf72a938fb4..e3b38f629504 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -3,6 +3,7 @@
 #include "hist.h"
 #include "map.h"
 #include "session.h"
+#include "namespaces.h"
 #include "sort.h"
 #include "evlist.h"
 #include "evsel.h"
@@ -169,6 +170,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 		hists__set_unres_dso_col_len(hists, HISTC_MEM_DADDR_DSO);
 	}
 
+	hists__new_col_len(hists, HISTC_CGROUP_ID, 20);
 	hists__new_col_len(hists, HISTC_CPU, 3);
 	hists__new_col_len(hists, HISTC_SOCKET, 6);
 	hists__new_col_len(hists, HISTC_MEM_LOCKED, 6);
@@ -574,9 +576,14 @@ __hists__add_entry(struct hists *hists,
 		   bool sample_self,
 		   struct hist_entry_ops *ops)
 {
+	struct namespaces *ns = thread__namespaces(al->thread);
 	struct hist_entry entry = {
 		.thread	= al->thread,
 		.comm = thread__comm(al->thread),
+		.cgroup_id = {
+			.dev = ns ? ns->link_info[CGROUP_NS_INDEX].dev : 0,
+			.ino = ns ? ns->link_info[CGROUP_NS_INDEX].ino : 0,
+		},
 		.ms = {
 			.map	= al->map,
 			.sym	= al->sym,
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 2e839bf40bdd..ee3670a388df 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -30,6 +30,7 @@ enum hist_column {
 	HISTC_DSO,
 	HISTC_THREAD,
 	HISTC_COMM,
+	HISTC_CGROUP_ID,
 	HISTC_PARENT,
 	HISTC_CPU,
 	HISTC_SOCKET,
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 93f755ac60ca..8b0d4e39f640 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -536,6 +536,46 @@ struct sort_entry sort_cpu = {
 	.se_width_idx	= HISTC_CPU,
 };
 
+/* --sort cgroup_id */
+
+static int64_t _sort__cgroup_dev_cmp(u64 left_dev, u64 right_dev)
+{
+	return (int64_t)(right_dev - left_dev);
+}
+
+static int64_t _sort__cgroup_inode_cmp(u64 left_ino, u64 right_ino)
+{
+	return (int64_t)(right_ino - left_ino);
+}
+
+static int64_t
+sort__cgroup_id_cmp(struct hist_entry *left, struct hist_entry *right)
+{
+	int64_t ret;
+
+	ret = _sort__cgroup_dev_cmp(right->cgroup_id.dev, left->cgroup_id.dev);
+	if (ret != 0)
+		return ret;
+
+	return _sort__cgroup_inode_cmp(right->cgroup_id.ino,
+				       left->cgroup_id.ino);
+}
+
+static int hist_entry__cgroup_id_snprintf(struct hist_entry *he,
+					  char *bf, size_t size,
+					  unsigned int width __maybe_unused)
+{
+	return repsep_snprintf(bf, size, "%lu/0x%lx", he->cgroup_id.dev,
+			       he->cgroup_id.ino);
+}
+
+struct sort_entry sort_cgroup_id = {
+	.se_header      = "cgroup id (dev/inode)",
+	.se_cmp	        = sort__cgroup_id_cmp,
+	.se_snprintf    = hist_entry__cgroup_id_snprintf,
+	.se_width_idx	= HISTC_CGROUP_ID,
+};
+
 /* --sort socket */
 
 static int64_t
@@ -1464,6 +1504,7 @@ static struct sort_dimension common_sort_dimensions[] = {
 	DIM(SORT_TRANSACTION, "transaction", sort_transaction),
 	DIM(SORT_TRACE, "trace", sort_trace),
 	DIM(SORT_SYM_SIZE, "symbol_size", sort_sym_size),
+	DIM(SORT_CGROUP_ID, "cgroup_id", sort_cgroup_id),
 };
 
 #undef DIM
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index f583325a3743..baf20a399f34 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -54,6 +54,11 @@ struct he_stat {
 	u32			nr_events;
 };
 
+struct namespace_id {
+	u64			dev;
+	u64			ino;
+};
+
 struct hist_entry_diff {
 	bool	computed;
 	union {
@@ -91,6 +96,7 @@ struct hist_entry {
 	struct map_symbol	ms;
 	struct thread		*thread;
 	struct comm		*comm;
+	struct namespace_id	cgroup_id;
 	u64			ip;
 	u64			transaction;
 	s32			socket;
@@ -212,6 +218,7 @@ enum sort_type {
 	SORT_TRANSACTION,
 	SORT_TRACE,
 	SORT_SYM_SIZE,
+	SORT_CGROUP_ID,
 
 	/* branch stack specific sort keys */
 	__SORT_BRANCH_STACK,
-- 
2.9.3

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

* [PATCH 14/19] perf sched timehist: Add --next option
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 13/19] perf tools: Add 'cgroup_id' sort order keyword Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 15/19] perf probe: Factor out the ftrace README scanning Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Brendan Gregg, Alexander Shishkin, Namhyung Kim,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Brendan Gregg <bgregg@netflix.com>

The --next option shows the next task for each context switch, providing
more context for the sequence of scheduler events.

  $ perf sched timehist --next | head
  Samples do not have callchains.
       time  cpu task name  waittime schdelay run time
                 [tid/pid]     (msec) (msec) (msec)
  ---------- --- ---------- --------- ------ -----
  374.793792 [0] <idle>         0.000  0.000 0.000 next: rngd[1524]
  374.793801 [0] rngd[1524]     0.000  0.000 0.009 next: swapper/0[0]
  374.794048 [7] <idle>         0.000  0.000 0.000 next: yes[30884]
  374.794066 [7] yes[30884]     0.000  0.000 0.018 next: swapper/7[0]
  374.794126 [2] <idle>         0.000  0.000 0.000 next: rngd[1524]
  374.794140 [2] rngd[1524]     0.325  0.006 0.013 next: swapper/2[0]
  374.794281 [3] <idle>         0.000  0.000 0.000 next: perf[31070]

Signed-off-by: Brendan Gregg <bgregg@netflix.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1489456589-32555-1-git-send-email-bgregg@netflix.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-sched.txt |  4 ++++
 tools/perf/builtin-sched.c              | 25 ++++++++++++++++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt
index d33deddb0146..a092a2499e8f 100644
--- a/tools/perf/Documentation/perf-sched.txt
+++ b/tools/perf/Documentation/perf-sched.txt
@@ -132,6 +132,10 @@ OPTIONS for 'perf sched timehist'
 --migrations::
 	Show migration events.
 
+-n::
+--next::
+	Show next task.
+
 -I::
 --idle-hist::
 	Show idle-related events only.
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 16170e9b47e6..b92c4d97192c 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -221,6 +221,7 @@ struct perf_sched {
 	unsigned int	max_stack;
 	bool		show_cpu_visual;
 	bool		show_wakeups;
+	bool		show_next;
 	bool		show_migrations;
 	bool		show_state;
 	u64		skipped_samples;
@@ -1897,14 +1898,18 @@ static char task_state_char(struct thread *thread, int state)
 }
 
 static void timehist_print_sample(struct perf_sched *sched,
+				  struct perf_evsel *evsel,
 				  struct perf_sample *sample,
 				  struct addr_location *al,
 				  struct thread *thread,
 				  u64 t, int state)
 {
 	struct thread_runtime *tr = thread__priv(thread);
+	const char *next_comm = perf_evsel__strval(evsel, sample, "next_comm");
+	const u32 next_pid = perf_evsel__intval(evsel, sample, "next_pid");
 	u32 max_cpus = sched->max_cpu + 1;
 	char tstr[64];
+	char nstr[30];
 	u64 wait_time;
 
 	timestamp__scnprintf_usec(t, tstr, sizeof(tstr));
@@ -1937,7 +1942,12 @@ static void timehist_print_sample(struct perf_sched *sched,
 	if (sched->show_state)
 		printf(" %5c ", task_state_char(thread, state));
 
-	if (sched->show_wakeups)
+	if (sched->show_next) {
+		snprintf(nstr, sizeof(nstr), "next: %s[%d]", next_comm, next_pid);
+		printf(" %-*s", comm_width, nstr);
+	}
+
+	if (sched->show_wakeups && !sched->show_next)
 		printf("  %-*s", comm_width, "");
 
 	if (thread->tid == 0)
@@ -2531,7 +2541,7 @@ static int timehist_sched_change_event(struct perf_tool *tool,
 	}
 
 	if (!sched->summary_only)
-		timehist_print_sample(sched, sample, &al, thread, t, state);
+		timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
 
 out:
 	if (sched->hist_time.start == 0 && t >= ptime->start)
@@ -3341,6 +3351,7 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_BOOLEAN('S', "with-summary", &sched.summary,
 		    "Show all syscalls and summary with statistics"),
 	OPT_BOOLEAN('w', "wakeups", &sched.show_wakeups, "Show wakeup events"),
+	OPT_BOOLEAN('n', "next", &sched.show_next, "Show next task"),
 	OPT_BOOLEAN('M', "migrations", &sched.show_migrations, "Show migration events"),
 	OPT_BOOLEAN('V', "cpu-visual", &sched.show_cpu_visual, "Add CPU visual"),
 	OPT_BOOLEAN('I', "idle-hist", &sched.idle_hist, "Show idle events only"),
@@ -3438,10 +3449,14 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
 			if (argc)
 				usage_with_options(timehist_usage, timehist_options);
 		}
-		if (sched.show_wakeups && sched.summary_only) {
-			pr_err(" Error: -s and -w are mutually exclusive.\n");
+		if ((sched.show_wakeups || sched.show_next) &&
+		    sched.summary_only) {
+			pr_err(" Error: -s and -[n|w] are mutually exclusive.\n");
 			parse_options_usage(timehist_usage, timehist_options, "s", true);
-			parse_options_usage(NULL, timehist_options, "w", true);
+			if (sched.show_wakeups)
+				parse_options_usage(NULL, timehist_options, "w", true);
+			if (sched.show_next)
+				parse_options_usage(NULL, timehist_options, "n", true);
 			return -EINVAL;
 		}
 
-- 
2.9.3

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

* [PATCH 15/19] perf probe: Factor out the ftrace README scanning
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 14/19] perf sched timehist: Add --next option Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 16/19] perf kretprobes: Offset from reloc_sym if kernel supports it Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Naveen N. Rao, Ananth N Mavinakayanahalli,
	Michael Ellerman, Steven Rostedt, linuxppc-dev,
	Arnaldo Carvalho de Melo

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>

Simplify and separate out the ftrace README scanning logic into a
separate helper. This is used subsequently to scan for all patterns of
interest and to cache the result.

Since we are only interested in availability of probe argument type x,
we will only scan for that.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/6dc30edc747ba82a236593be6cf3a046fa9453b5.1488961018.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-file.c | 70 +++++++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 1a62daceb028..8a219cd831b7 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -877,35 +877,31 @@ int probe_cache__show_all_caches(struct strfilter *filter)
 	return 0;
 }
 
+enum ftrace_readme {
+	FTRACE_README_PROBE_TYPE_X = 0,
+	FTRACE_README_END,
+};
+
 static struct {
 	const char *pattern;
-	bool	avail;
-	bool	checked;
-} probe_type_table[] = {
-#define DEFINE_TYPE(idx, pat, def_avail)	\
-	[idx] = {.pattern = pat, .avail = (def_avail)}
-	DEFINE_TYPE(PROBE_TYPE_U, "* u8/16/32/64,*", true),
-	DEFINE_TYPE(PROBE_TYPE_S, "* s8/16/32/64,*", true),
-	DEFINE_TYPE(PROBE_TYPE_X, "* x8/16/32/64,*", false),
-	DEFINE_TYPE(PROBE_TYPE_STRING, "* string,*", true),
-	DEFINE_TYPE(PROBE_TYPE_BITFIELD,
-		    "* b<bit-width>@<bit-offset>/<container-size>", true),
+	bool avail;
+} ftrace_readme_table[] = {
+#define DEFINE_TYPE(idx, pat)			\
+	[idx] = {.pattern = pat, .avail = false}
+	DEFINE_TYPE(FTRACE_README_PROBE_TYPE_X, "*type: * x8/16/32/64,*"),
 };
 
-bool probe_type_is_available(enum probe_type type)
+static bool scan_ftrace_readme(enum ftrace_readme type)
 {
+	int fd;
 	FILE *fp;
 	char *buf = NULL;
 	size_t len = 0;
-	bool target_line = false;
-	bool ret = probe_type_table[type].avail;
-	int fd;
+	bool ret = false;
+	static bool scanned = false;
 
-	if (type >= PROBE_TYPE_END)
-		return false;
-	/* We don't have to check the type which supported by default */
-	if (ret || probe_type_table[type].checked)
-		return ret;
+	if (scanned)
+		goto result;
 
 	fd = open_trace_file("README", false);
 	if (fd < 0)
@@ -917,21 +913,29 @@ bool probe_type_is_available(enum probe_type type)
 		return ret;
 	}
 
-	while (getline(&buf, &len, fp) > 0 && !ret) {
-		if (!target_line) {
-			target_line = !!strstr(buf, " type: ");
-			if (!target_line)
-				continue;
-		} else if (strstr(buf, "\t          ") != buf)
-			break;
-		ret = strglobmatch(buf, probe_type_table[type].pattern);
-	}
-	/* Cache the result */
-	probe_type_table[type].checked = true;
-	probe_type_table[type].avail = ret;
+	while (getline(&buf, &len, fp) > 0)
+		for (enum ftrace_readme i = 0; i < FTRACE_README_END; i++)
+			if (!ftrace_readme_table[i].avail)
+				ftrace_readme_table[i].avail =
+					strglobmatch(buf, ftrace_readme_table[i].pattern);
+	scanned = true;
 
 	fclose(fp);
 	free(buf);
 
-	return ret;
+result:
+	if (type >= FTRACE_README_END)
+		return false;
+
+	return ftrace_readme_table[type].avail;
+}
+
+bool probe_type_is_available(enum probe_type type)
+{
+	if (type >= PROBE_TYPE_END)
+		return false;
+	else if (type == PROBE_TYPE_X)
+		return scan_ftrace_readme(FTRACE_README_PROBE_TYPE_X);
+
+	return true;
 }
-- 
2.9.3

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

* [PATCH 16/19] perf kretprobes: Offset from reloc_sym if kernel supports it
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 15/19] perf probe: Factor out the ftrace README scanning Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 17/19] perf powerpc: Choose local entry point with kretprobes Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Naveen N. Rao, Ananth N Mavinakayanahalli,
	Michael Ellerman, Steven Rostedt, linuxppc-dev,
	Arnaldo Carvalho de Melo

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>

We indicate support for accepting sym+offset with kretprobes through a
line in ftrace README. Parse the same to identify support and choose the
appropriate format for kprobe_events.

As an example, without this perf patch, but with the ftrace changes:

  naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/tracing/README | grep kretprobe
  place (kretprobe): [<module>:]<symbol>[+<offset>]|<memaddr>
  naveen@ubuntu:~/linux/tools/perf$
  naveen@ubuntu:~/linux/tools/perf$ sudo ./perf probe -v do_open%return
  probe-definition(0): do_open%return
  symbol:do_open file:(null) line:0 offset:0 return:1 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /boot/vmlinux for symbols
  Open Debuginfo file: /boot/vmlinux
  Try to find probe point from debuginfo.
  Matched function: do_open [2d0c7d8]
  Probe point found: do_open+0
  Matched function: do_open [35d76b5]
  found inline addr: 0xc0000000004ba984
  Failed to find "do_open%return",
   because do_open is an inlined function and has no return point.
  An error occurred in debuginfo analysis (-22).
  Trying to use symbols.
  Opening /sys/kernel/debug/tracing//kprobe_events write=1
  Writing event: r:probe/do_open do_open+0
  Writing event: r:probe/do_open_1 do_open+0
  Added new events:
    probe:do_open        (on do_open%return)
    probe:do_open_1      (on do_open%return)

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

	  perf record -e probe:do_open_1 -aR sleep 1

  naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list
  c000000000041370  k  kretprobe_trampoline+0x0    [OPTIMIZED]
  c0000000004433d0  r  do_open+0x0    [DISABLED]
  c0000000004433d0  r  do_open+0x0    [DISABLED]

And after this patch (and the subsequent powerpc patch):

  naveen@ubuntu:~/linux/tools/perf$ sudo ./perf probe -v do_open%return
  probe-definition(0): do_open%return
  symbol:do_open file:(null) line:0 offset:0 return:1 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /boot/vmlinux for symbols
  Open Debuginfo file: /boot/vmlinux
  Try to find probe point from debuginfo.
  Matched function: do_open [2d0c7d8]
  Probe point found: do_open+0
  Matched function: do_open [35d76b5]
  found inline addr: 0xc0000000004ba984
  Failed to find "do_open%return",
   because do_open is an inlined function and has no return point.
  An error occurred in debuginfo analysis (-22).
  Trying to use symbols.
  Opening /sys/kernel/debug/tracing//README write=0
  Opening /sys/kernel/debug/tracing//kprobe_events write=1
  Writing event: r:probe/do_open _text+4469712
  Writing event: r:probe/do_open_1 _text+4956248
  Added new events:
    probe:do_open        (on do_open%return)
    probe:do_open_1      (on do_open%return)

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

	  perf record -e probe:do_open_1 -aR sleep 1

  naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list
  c000000000041370  k  kretprobe_trampoline+0x0    [OPTIMIZED]
  c0000000004433d0  r  do_open+0x0    [DISABLED]
  c0000000004ba058  r  do_open+0x8    [DISABLED]

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/496ef9f33c1ab16286ece9dd62aa672807aef91c.1488961018.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 12 +++++-------
 tools/perf/util/probe-file.c  |  7 +++++++
 tools/perf/util/probe-file.h  |  1 +
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 28fb62c32678..c9bdc9ded0c3 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -757,7 +757,9 @@ post_process_kernel_probe_trace_events(struct probe_trace_event *tevs,
 	}
 
 	for (i = 0; i < ntevs; i++) {
-		if (!tevs[i].point.address || tevs[i].point.retprobe)
+		if (!tevs[i].point.address)
+			continue;
+		if (tevs[i].point.retprobe && !kretprobe_offset_is_supported())
 			continue;
 		/* If we found a wrong one, mark it by NULL symbol */
 		if (kprobe_warn_out_range(tevs[i].point.symbol,
@@ -1528,11 +1530,6 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
 		return -EINVAL;
 	}
 
-	if (pp->retprobe && !pp->function) {
-		semantic_error("Return probe requires an entry function.\n");
-		return -EINVAL;
-	}
-
 	if ((pp->offset || pp->line || pp->lazy_line) && pp->retprobe) {
 		semantic_error("Offset/Line/Lazy pattern can't be used with "
 			       "return probe.\n");
@@ -2841,7 +2838,8 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
 	}
 
 	/* Note that the symbols in the kmodule are not relocated */
-	if (!pev->uprobes && !pp->retprobe && !pev->target) {
+	if (!pev->uprobes && !pev->target &&
+			(!pp->retprobe || kretprobe_offset_is_supported())) {
 		reloc_sym = kernel_get_ref_reloc_sym();
 		if (!reloc_sym) {
 			pr_warning("Relocated base symbol is not found!\n");
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 8a219cd831b7..1542cd0d6799 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -879,6 +879,7 @@ int probe_cache__show_all_caches(struct strfilter *filter)
 
 enum ftrace_readme {
 	FTRACE_README_PROBE_TYPE_X = 0,
+	FTRACE_README_KRETPROBE_OFFSET,
 	FTRACE_README_END,
 };
 
@@ -889,6 +890,7 @@ static struct {
 #define DEFINE_TYPE(idx, pat)			\
 	[idx] = {.pattern = pat, .avail = false}
 	DEFINE_TYPE(FTRACE_README_PROBE_TYPE_X, "*type: * x8/16/32/64,*"),
+	DEFINE_TYPE(FTRACE_README_KRETPROBE_OFFSET, "*place (kretprobe): *"),
 };
 
 static bool scan_ftrace_readme(enum ftrace_readme type)
@@ -939,3 +941,8 @@ bool probe_type_is_available(enum probe_type type)
 
 	return true;
 }
+
+bool kretprobe_offset_is_supported(void)
+{
+	return scan_ftrace_readme(FTRACE_README_KRETPROBE_OFFSET);
+}
diff --git a/tools/perf/util/probe-file.h b/tools/perf/util/probe-file.h
index a17a82eff8a0..dbf95a00864a 100644
--- a/tools/perf/util/probe-file.h
+++ b/tools/perf/util/probe-file.h
@@ -65,6 +65,7 @@ struct probe_cache_entry *probe_cache__find_by_name(struct probe_cache *pcache,
 					const char *group, const char *event);
 int probe_cache__show_all_caches(struct strfilter *filter);
 bool probe_type_is_available(enum probe_type type);
+bool kretprobe_offset_is_supported(void);
 #else	/* ! HAVE_LIBELF_SUPPORT */
 static inline struct probe_cache *probe_cache__new(const char *tgt __maybe_unused)
 {
-- 
2.9.3

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

* [PATCH 17/19] perf powerpc: Choose local entry point with kretprobes
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 16/19] perf kretprobes: Offset from reloc_sym if kernel supports it Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 18/19] doc: trace/kprobes: add information about NOKPROBE_SYMBOL Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Naveen N. Rao, Ananth N Mavinakayanahalli,
	Michael Ellerman, Steven Rostedt, linuxppc-dev,
	Arnaldo Carvalho de Melo

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>

perf now uses an offset from _text/_stext for kretprobes if the kernel
supports it, rather than the actual function name. As such, let's choose
the LEP for powerpc ABIv2 so as to ensure the probe gets hit. Do it only
if the kernel supports specifying offsets with kretprobes.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/7445b5334673ef5404ac1d12609bad4d73d2b567.1488961018.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/powerpc/util/sym-handling.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c
index 1030a6e504bb..39dbe512b9fc 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -10,6 +10,7 @@
 #include "symbol.h"
 #include "map.h"
 #include "probe-event.h"
+#include "probe-file.h"
 
 #ifdef HAVE_LIBELF_SUPPORT
 bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
@@ -79,13 +80,18 @@ void arch__fix_tev_from_maps(struct perf_probe_event *pev,
 	 * However, if the user specifies an offset, we fall back to using the
 	 * GEP since all userspace applications (objdump/readelf) show function
 	 * disassembly with offsets from the GEP.
-	 *
-	 * In addition, we shouldn't specify an offset for kretprobes.
 	 */
-	if (pev->point.offset || (!pev->uprobes && pev->point.retprobe) ||
-	    !map || !sym)
+	if (pev->point.offset || !map || !sym)
 		return;
 
+	/* For kretprobes, add an offset only if the kernel supports it */
+	if (!pev->uprobes && pev->point.retprobe) {
+#ifdef HAVE_LIBELF_SUPPORT
+		if (!kretprobe_offset_is_supported())
+#endif
+			return;
+	}
+
 	lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym);
 
 	if (map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS)
-- 
2.9.3

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

* [PATCH 18/19] doc: trace/kprobes: add information about NOKPROBE_SYMBOL
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 17/19] perf powerpc: Choose local entry point with kretprobes Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-14 18:50 ` [PATCH 19/19] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL Arnaldo Carvalho de Melo
  2017-03-15 18:29 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Naveen N. Rao, Ananth N Mavinakayanahalli,
	Arnaldo Carvalho de Melo

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>

Update kprobe tracer documentation to also mention that
NOKPROBE_SYMBOL() and nokprobe_inline add symbols to the kprobes
blacklist.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/d924e20de099579ace4286e610304f054cd798db.1488991670.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 Documentation/trace/kprobetrace.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt
index 41ef9d8efe95..5ea85059db3b 100644
--- a/Documentation/trace/kprobetrace.txt
+++ b/Documentation/trace/kprobetrace.txt
@@ -8,8 +8,9 @@ Overview
 --------
 These events are similar to tracepoint based events. Instead of Tracepoint,
 this is based on kprobes (kprobe and kretprobe). So it can probe wherever
-kprobes can probe (this means, all functions body except for __kprobes
-functions). Unlike the Tracepoint based event, this can be added and removed
+kprobes can probe (this means, all functions except those with
+__kprobes/nokprobe_inline annotation and those marked NOKPROBE_SYMBOL).
+Unlike the Tracepoint based event, this can be added and removed
 dynamically, on the fly.
 
 To enable this feature, build your kernel with CONFIG_KPROBE_EVENTS=y.
-- 
2.9.3

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

* [PATCH 19/19] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 18/19] doc: trace/kprobes: add information about NOKPROBE_SYMBOL Arnaldo Carvalho de Melo
@ 2017-03-14 18:50 ` Arnaldo Carvalho de Melo
  2017-03-15 18:29 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar
  19 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Naveen N. Rao, Ananth N Mavinakayanahalli,
	Arnaldo Carvalho de Melo

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>

commit fc62d0207ae0 ("kprobes: Introduce weak variant of
kprobe_exceptions_notify()") used the __kprobes annotation to exclude
kprobe_exceptions_notify from being probed. Since NOKPROBE_SYMBOL() is a
better way to do this enabling the symbol to be discovered as being
blacklisted, change over to using NOKPROBE_SYMBOL().

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/3f25bf400da5c222cd9b10eec6ded2d6b58209f8.1488991670.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 kernel/kprobes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 448759d4a263..4780ec236035 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1740,11 +1740,12 @@ void unregister_kprobes(struct kprobe **kps, int num)
 }
 EXPORT_SYMBOL_GPL(unregister_kprobes);
 
-int __weak __kprobes kprobe_exceptions_notify(struct notifier_block *self,
-					      unsigned long val, void *data)
+int __weak kprobe_exceptions_notify(struct notifier_block *self,
+					unsigned long val, void *data)
 {
 	return NOTIFY_DONE;
 }
+NOKPROBE_SYMBOL(kprobe_exceptions_notify);
 
 static struct notifier_block kprobe_exceptions_nb = {
 	.notifier_call = kprobe_exceptions_notify,
-- 
2.9.3

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  2017-03-14 18:50 ` [PATCH 19/19] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL Arnaldo Carvalho de Melo
@ 2017-03-15 18:29 ` Ingo Molnar
  19 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2017-03-15 18:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov,
	Ananth N Mavinakayanahalli, Andi Kleen, Aravinda Prasad,
	Brendan Gregg, Changbin Du, Daniel Borkmann, Eric Biederman,
	Feng Tang, Hari Bathini, Jiri Olsa, kernel-team, linuxppc-dev,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao,
	Peter Zijlstra, Sargun Dhillon, Steven Rostedt,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 84e5b549214f2160c12318aac549de85f600c79a:
> 
>   Merge tag 'perf-core-for-mingo-4.11-20170306' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-07 08:14:14 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170314
> 
> for you to fetch changes up to 5f6bee34707973ea7879a7857fd63ddccc92fff3:
> 
>   kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL (2017-03-14 15:17:40 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Add PERF_RECORD_NAMESPACES so that the kernel can record information
>   required to associate samples to namespaces, helping in container
>   problem characterization.
> 
>   Now the 'perf record has a --namespace' option to ask for such info,
>   and when present, it can be used, initially, via a new sort order,
>   'cgroup_id', allowing histogram entry bucketization by a (device, inode)
>   based cgroup identifier (Hari Bathini)
> 
> - Add --next option to 'perf sched timehist', showing what is the next
>   thread to run (Brendan Gregg)
> 
> Fixes:
> 
> - Fix segfault with basic block 'cycles' sort dimension (Changbin Du)
> 
> - Add c2c to command-list.txt, making it appear in the 'perf help'
>   output (Changbin Du)
> 
> - Fix zeroing of 'abs_path' variable in the perf hists browser switch
>   file code (Changbin Du)
> 
> - Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim)
> 
> Infrastructure:
> 
> - Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao)
> 
> - Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du)
> 
> Documentation:
> 
> - Document +field style argument support for --field option (Changbin Du)
> 
> - Clarify 'perf c2c --stats' help message (Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Brendan Gregg (1):
>       perf sched timehist: Add --next option
> 
> Changbin Du (5):
>       perf tools: Missing c2c command in command-list
>       perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git
>       perf sort: Fix segfault with basic block 'cycles' sort dimension
>       perf report: Document +field style argument support for --field option
>       perf hists browser: Fix typo in function switch_data_file
> 
> Hari Bathini (5):
>       perf: Add PERF_RECORD_NAMESPACES to include namespaces related info
>       perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info
>       perf record: Synthesize namespace events for current processes
>       perf script: Add script print support for namespace events
>       perf tools: Add 'cgroup_id' sort order keyword
> 
> Namhyung Kim (3):
>       perf report: Hide tip message when -q option is given
>       perf c2c: Clarify help message of --stats option
>       perf c2c: Fix display bug when using pipe
> 
> Naveen N. Rao (5):
>       perf probe: Factor out the ftrace README scanning
>       perf kretprobes: Offset from reloc_sym if kernel supports it
>       perf powerpc: Choose local entry point with kretprobes
>       doc: trace/kprobes: add information about NOKPROBE_SYMBOL
>       kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
> 
>  Documentation/trace/kprobetrace.txt         |   5 +-
>  include/linux/perf_event.h                  |   2 +
>  include/uapi/linux/perf_event.h             |  32 +++++-
>  kernel/events/core.c                        | 139 ++++++++++++++++++++++++++
>  kernel/fork.c                               |   2 +
>  kernel/kprobes.c                            |   5 +-
>  kernel/nsproxy.c                            |   3 +
>  tools/include/uapi/linux/perf_event.h       |  32 +++++-
>  tools/perf/.gitignore                       |   2 +
>  tools/perf/Documentation/perf-record.txt    |   3 +
>  tools/perf/Documentation/perf-report.txt    |   7 +-
>  tools/perf/Documentation/perf-sched.txt     |   4 +
>  tools/perf/Documentation/perf-script.txt    |   3 +
>  tools/perf/arch/powerpc/util/sym-handling.c |  14 ++-
>  tools/perf/builtin-annotate.c               |   1 +
>  tools/perf/builtin-c2c.c                    |   4 +-
>  tools/perf/builtin-diff.c                   |   1 +
>  tools/perf/builtin-inject.c                 |  13 +++
>  tools/perf/builtin-kmem.c                   |   1 +
>  tools/perf/builtin-kvm.c                    |   2 +
>  tools/perf/builtin-lock.c                   |   1 +
>  tools/perf/builtin-mem.c                    |   1 +
>  tools/perf/builtin-record.c                 |  35 ++++++-
>  tools/perf/builtin-report.c                 |   4 +-
>  tools/perf/builtin-sched.c                  |  26 ++++-
>  tools/perf/builtin-script.c                 |  41 ++++++++
>  tools/perf/builtin-trace.c                  |   3 +-
>  tools/perf/command-list.txt                 |   1 +
>  tools/perf/perf.h                           |   1 +
>  tools/perf/ui/browsers/hists.c              |   2 +-
>  tools/perf/util/Build                       |   1 +
>  tools/perf/util/data-convert-bt.c           |   1 +
>  tools/perf/util/event.c                     | 150 ++++++++++++++++++++++++++--
>  tools/perf/util/event.h                     |  19 ++++
>  tools/perf/util/evsel.c                     |   3 +
>  tools/perf/util/hist.c                      |   7 ++
>  tools/perf/util/hist.h                      |   1 +
>  tools/perf/util/machine.c                   |  34 +++++++
>  tools/perf/util/machine.h                   |   3 +
>  tools/perf/util/namespaces.c                |  36 +++++++
>  tools/perf/util/namespaces.h                |  26 +++++
>  tools/perf/util/probe-event.c               |  12 +--
>  tools/perf/util/probe-file.c                |  77 ++++++++------
>  tools/perf/util/probe-file.h                |   1 +
>  tools/perf/util/session.c                   |   7 ++
>  tools/perf/util/sort.c                      |  46 +++++++++
>  tools/perf/util/sort.h                      |   7 ++
>  tools/perf/util/thread.c                    |  44 +++++++-
>  tools/perf/util/thread.h                    |   6 ++
>  tools/perf/util/tool.h                      |   2 +
>  50 files changed, 799 insertions(+), 74 deletions(-)
>  create mode 100644 tools/perf/util/namespaces.c
>  create mode 100644 tools/perf/util/namespaces.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2017-11-03 13:54 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Andi Kleen, Andrey Vagin, Andy Lutomirski,
	Changbin Du, Cyrill Gorcunov, David Ahern, Jin Yao, Jiri Olsa,
	kernel-team, Michael Ellerman, Milian Wolff, Namhyung Kim,
	Peter Zijlstra, Wang Nan, yuzhoujian, Arnaldo Carvalho de Melo

Hi Ingo,

	A bit of trivia info is now automatically shown in the container
builds, the gcc version used to build the tools, that gets changed as
the distros update gcc and as I update the container build images :-)

	Please consider pulling,

- Arnaldo

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

The following changes since commit 0d3d73aac2ff05c78387aa9dcc2c8aa3804405e7:

  perf/core: Rewrite event timekeeping (2017-10-27 10:31:59 +0200)

are available in the git repository at:

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

for you to fetch changes up to 7285cf3325b4a1dfb336d31eebc27dfbc30fb9aa:

  perf srcline: Show correct function name for srcline of callchains (2017-11-01 11:44:38 -0300)

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

- Beautify the 'kcmp' and 'prctl' syscall arguments in 'perf trace'
  (Arnaldo Carvalho de Melo)

- Implement a way to print formatted output to per-event files in 'perf script'
  to facilitate generate flamegraphs, elliminating the need to write scripts to
  do that separation (yuzhoujian, Arnaldo Carvalho de Melo)

  Make 'perf stat --per-thread' update shadow stats to show metrics (Jiri Olsa)

- Fix double mapping al->addr in callchain processing for children without self
  period (Namhyung Kim)

- Fix memory leak in addr2inlines() when libbfd is not used (Namhyung Kim)

- Show correct function name for srcline of callchains when libbfd is not used
  (Namhyung Kim)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (11):
      perf script: Add a few missing conversions to fprintf style
      perf script: Use pr_debug where appropriate
      perf script: Use event_format__fprintf()
      perf evsel: Restore evsel->priv as a tool private area
      perf script: Allow creating per-event dump files
      tools include uapi: Grab a copy of linux/prctl.h
      perf trace beauty prctl: Generate 'option' string table from kernel headers
      perf script: Print information about per-event-dump files
      tools include uapi: Grab a copy of linux/kcmp.h
      perf trace beauty: Implement pid_fd beautifier
      perf trace beauty kcmp: Beautify arguments

Jiri Olsa (5):
      perf tools: Rename struct perf_data_file to perf_data
      perf tools: Add struct perf_data_file
      perf tools: Add perf_data_file__write function
      perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats
      perf stat: Make --per-thread update shadow stats to show metrics

Namhyung Kim (3):
      perf callchain: Fix double mapping al->addr for children without self period
      perf srcline: Fix memory leak in addr2inlines()
      perf srcline: Show correct function name for srcline of callchains

 tools/include/uapi/linux/kcmp.h          |  27 +++++
 tools/include/uapi/linux/prctl.h         | 200 +++++++++++++++++++++++++++++++
 tools/perf/Documentation/perf-script.txt |   4 +
 tools/perf/Makefile.perf                 |  22 +++-
 tools/perf/builtin-annotate.c            |  10 +-
 tools/perf/builtin-buildid-cache.c       |   8 +-
 tools/perf/builtin-buildid-list.c        |  16 +--
 tools/perf/builtin-c2c.c                 |  10 +-
 tools/perf/builtin-diff.c                |  18 +--
 tools/perf/builtin-evlist.c              |  12 +-
 tools/perf/builtin-inject.c              |  36 +++---
 tools/perf/builtin-kmem.c                |   8 +-
 tools/perf/builtin-kvm.c                 |  14 ++-
 tools/perf/builtin-lock.c                |  12 +-
 tools/perf/builtin-mem.c                 |  12 +-
 tools/perf/builtin-record.c              |  50 ++++----
 tools/perf/builtin-report.c              |  14 +--
 tools/perf/builtin-sched.c               |  24 ++--
 tools/perf/builtin-script.c              | 169 ++++++++++++++++++++++----
 tools/perf/builtin-stat.c                |  39 +++---
 tools/perf/builtin-timechart.c           |  14 ++-
 tools/perf/builtin-trace.c               |  40 ++++++-
 tools/perf/check-headers.sh              |   2 +
 tools/perf/tests/topology.c              |  22 ++--
 tools/perf/trace/beauty/Build            |   2 +
 tools/perf/trace/beauty/beauty.h         |  18 +++
 tools/perf/trace/beauty/kcmp.c           |  44 +++++++
 tools/perf/trace/beauty/kcmp_type.sh     |  10 ++
 tools/perf/trace/beauty/prctl.c          |  82 +++++++++++++
 tools/perf/trace/beauty/prctl_option.sh  |  17 +++
 tools/perf/util/auxtrace.c               |   4 +-
 tools/perf/util/callchain.c              |   5 +-
 tools/perf/util/data-convert-bt.c        |  12 +-
 tools/perf/util/data.c                   |  94 ++++++++-------
 tools/perf/util/data.h                   |  38 +++---
 tools/perf/util/evsel.h                  |   3 +
 tools/perf/util/header.c                 |  20 ++--
 tools/perf/util/intel-bts.c              |   6 +-
 tools/perf/util/intel-pt.c               |   6 +-
 tools/perf/util/jit.h                    |   2 +-
 tools/perf/util/jitdump.c                |  10 +-
 tools/perf/util/session.c                |  44 +++----
 tools/perf/util/session.h                |   4 +-
 tools/perf/util/srcline.c                | 102 +++++++++-------
 tools/perf/util/stat-shadow.c            |  48 ++++----
 tools/perf/util/stat.c                   |  24 ++--
 tools/perf/util/stat.h                   |   2 +-
 47 files changed, 999 insertions(+), 381 deletions(-)
 create mode 100644 tools/include/uapi/linux/kcmp.h
 create mode 100644 tools/include/uapi/linux/prctl.h
 create mode 100644 tools/perf/trace/beauty/kcmp.c
 create mode 100755 tools/perf/trace/beauty/kcmp_type.sh
 create mode 100644 tools/perf/trace/beauty/prctl.c
 create mode 100755 tools/perf/trace/beauty/prctl_option.sh

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support.  Where clang is available, it is also used to build
perf with/without libelf.

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

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

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

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

  # dm
   1 alpine:3.4: Ok                       gcc (Alpine 5.3.0) 5.3.0
   2 alpine:3.5: Ok                       gcc (Alpine 6.2.1) 6.2.1 20160822
   3 alpine:3.6: Ok                       gcc (Alpine 6.3.0) 6.3.0
   4 alpine:edge: Ok                      gcc (Alpine 6.4.0) 6.4.0
   5 android-ndk:r12b-arm: Ok             arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
   6 android-ndk:r15c-arm: Ok             arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
   7 centos:5: Ok                         gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
   8 centos:6: Ok                         gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
   9 centos:7: Ok                         gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
  10 debian:7: Ok                         gcc (Debian 4.7.2-5) 4.7.2
  11 debian:8: Ok                         gcc (Debian 4.9.2-10) 4.9.2
  12 debian:9: Ok                         gcc (Debian 6.3.0-18) 6.3.0 20170516
  13 debian:experimental: Ok              gcc (Debian 7.2.0-11) 7.2.0
  14 debian:experimental-x-arm64: Ok      aarch64-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0
  15 debian:experimental-x-mips: Ok       mips-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0
  16 debian:experimental-x-mips64: Ok     mips64-linux-gnuabi64-gcc (Debian 7.2.0-6) 7.2.0
  17 debian:experimental-x-mipsel: Ok     mipsel-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0
  18 fedora:20: Ok                        gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
  19 fedora:21: Ok                        gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
  20 fedora:22: Ok                        gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  21 fedora:23: Ok                        gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  22 fedora:24: Ok                        gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  23 fedora:24-x-ARC-uClibc: Ok           arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
  24 fedora:25: Ok                        gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
  25 fedora:26: Ok                        gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
  26 fedora:rawhide: Ok                   gcc (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1)
  27 mageia:5: Ok                         gcc (GCC) 4.9.2
  28 mageia:6: Ok                         gcc (Mageia 5.4.0-5.mga6) 5.4.0
  29 opensuse:42.1: Ok                    gcc (SUSE Linux) 4.8.5
  30 opensuse:42.2: Ok                    gcc (SUSE Linux) 4.8.5
  31 opensuse:42.3: Ok                    gcc (SUSE Linux) 4.8.5
  32 opensuse:tumbleweed: Ok              gcc (SUSE Linux) 7.2.1 20170901 [gcc-7-branch revision 251580]
  33 oraclelinux:6: Ok                    gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
  34 oraclelinux:7: Ok                    gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
  35 ubuntu:12.04.5: Ok                   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  36 ubuntu:14.04.4: Ok                   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  37 ubuntu:14.04.4-x-linaro-arm64: Ok    aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404
  38 ubuntu:15.04: Ok                     gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
  39 ubuntu:15.10: Ok                     gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
  40 ubuntu:16.04: Ok                     gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
  41 ubuntu:16.04-x-arm: Ok               arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  42 ubuntu:16.04-x-arm64: Ok             aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  43 ubuntu:16.04-x-powerpc: Ok           powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  44 ubuntu:16.04-x-powerpc64: Ok         powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
  45 ubuntu:16.04-x-powerpc64el: Ok       powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  46 ubuntu:16.04-x-s390: Ok              s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  47 ubuntu:16.10: Ok                     gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
  48 ubuntu:17.04: Ok                     gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
  49 ubuntu:17.10: Ok                     gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
  # 

  # uname -a
  Linux jouet 4.14.0-rc6+ #1 SMP Tue Oct 31 14:43:51 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms                       : Ok
   2: Detect openat syscall event                           : Ok
   3: Detect openat syscall event on all cpus               : Ok
   4: Read samples using the mmap interface                 : Ok
   5: Test data source output                               : Ok
   6: Parse event definition strings                        : Ok
   7: Simple expression parser                              : Ok
   8: PERF_RECORD_* events & perf_sample fields             : Ok
   9: Parse perf pmu format                                 : Ok
  10: DSO data read                                         : Ok
  11: DSO data cache                                        : Ok
  12: DSO data reopen                                       : Ok
  13: Roundtrip evsel->name                                 : Ok
  14: Parse sched tracepoints fields                        : Ok
  15: syscalls:sys_enter_openat event fields                : Ok
  16: Setup struct perf_event_attr                          : Ok
  17: Match and link multiple hists                         : Ok
  18: 'import perf' in python                               : Ok
  19: Breakpoint overflow signal handler                    : Ok
  20: Breakpoint overflow sampling                          : Ok
  21: Number of exit events of a simple workload            : Ok
  22: Software clock events period values                   : Ok
  23: Object code reading                                   : Ok
  24: Sample parsing                                        : Ok
  25: Use a dummy software event to keep tracking           : Ok
  26: Parse with no sample_id_all bit set                   : Ok
  27: Filter hist entries                                   : Ok
  28: Lookup mmap thread                                    : Ok
  29: Share thread mg                                       : Ok
  30: Sort output of hist entries                           : Ok
  31: Cumulate child hist entries                           : Ok
  32: Track with sched_switch                               : Ok
  33: Filter fds with revents mask in a fdarray             : Ok
  34: Add fd to a fdarray, making it autogrow               : Ok
  35: kmod_path__parse                                      : Ok
  36: Thread map                                            : Ok
  37: LLVM search and compile                               :
  37.1: Basic BPF llvm compile                              : Ok
  37.2: kbuild searching                                    : Ok
  37.3: Compile source for BPF prologue generation          : Ok
  37.4: Compile source for BPF relocation                   : Ok
  38: Session topology                                      : Ok
  39: BPF filter                                            :
  39.1: Basic BPF filtering                                 : Ok
  39.2: BPF pinning                                         : Ok
  39.3: BPF prologue generation                             : Ok
  39.4: BPF relocation checker                              : Ok
  40: Synthesize thread map                                 : Ok
  41: Remove thread map                                     : Ok
  42: Synthesize cpu map                                    : Ok
  43: Synthesize stat config                                : Ok
  44: Synthesize stat                                       : Ok
  45: Synthesize stat round                                 : Ok
  46: Synthesize attr update                                : Ok
  47: Event times                                           : Ok
  48: Read backward ring buffer                             : Ok
  49: Print cpu map                                         : Ok
  50: Probe SDT events                                      : Ok
  51: is_printable_array                                    : Ok
  52: Print bitmap                                          : Ok
  53: perf hooks                                            : Ok
  54: builtin clang support                                 : Skip (not compiled in)
  55: unit_number__scnprintf                                : Ok
  56: x86 rdpmc                                             : Ok
  57: Convert perf time to TSC                              : Ok
  58: DWARF unwind                                          : Ok
  59: x86 instruction decoder - new instructions            : Ok
  60: Use vfs_getname probe to get syscall args filenames   : Ok
  61: probe libc's inet_pton & backtrace it with ping       : Ok
  62: Check open filename arg using perf trace + vfs_getname: Ok
  63: Add vfs_getname probe to get syscall args filenames   : Ok
  # 

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

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2017-08-14 17:39 ` Ingo Molnar
@ 2017-08-14 17:52   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-08-14 17:52 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Kim Phillips, linux-kernel, linux-perf-users, Adrian Hunter,
	Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner,
	Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman,
	Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao,
	Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu,
	Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, acme

Em Mon, Aug 14, 2017 at 07:39:48PM +0200, Ingo Molnar escreveu:
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > Infrastructure:

> > - Add support for shell based tests in 'perf test', add a few that
> >   run 'perf probe', 'perf trace', using kprobes, uprobes to check
> >   the output of those tools and the effects on the system, checking,
> >   for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo)
<SNIP>
> >  create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh
> >  create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh
> >  create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh
> >  create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
> >  create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh
> 
> Pulled, thanks a lot Arnaldo!

Thanks! I'm working with Kim Phillips to fix some issues he noticed
while testing on his ARM systems where 'perf probe' is not available, my
perf/core branch has several fixes to handle this that will be in my
next pull request.

- Arnaldo

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2017-08-14 16:27 Arnaldo Carvalho de Melo
@ 2017-08-14 17:39 ` Ingo Molnar
  2017-08-14 17:52   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 53+ messages in thread
From: Ingo Molnar @ 2017-08-14 17:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen,
	Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa,
	linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan,
	Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke,
	Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter,
	Wang Nan, Yao Jin, Zvonko Kosic, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> 
> The following changes since commit 82119cbe8e1e32cc2a941393e59816e731681310:
> 
>   Merge tag 'perf-core-for-mingo-4.14-20170801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-10 17:07:02 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.14-20170814
> 
> for you to fetch changes up to 8fc375d7d36c72b4c2d55f5c24be022a939295d4:
> 
>   perf test shell: Add uprobes + backtrace ping test (2017-08-11 16:18:49 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Infrastructure:
> 
> - Do not consider empty files as valid srclines (Milian Wolff)
> 
> - Fix wrong size in perf_record_mmap for last kernel module,
>   which resulted in erroneous symbol resolution in at least s390x (Thomas Richter)
> 
> - Add missing newline to expr parser error messages (Andi Kleen)
> 
> - Fix saved values rbtree lookup in 'perf stat' (Andi Kleen)
> 
> - Add support for shell based tests in 'perf test', add a few that
>   run 'perf probe', 'perf trace', using kprobes, uprobes to check
>   the output of those tools and the effects on the system, checking,
>   for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo)
> 
> Arch specific:
> 
> - Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao)
> 
> - Update POWER9 vendor events tables (Sukadev Bhattiprolu)
> 
> - Fix module symbol adjustment for s390x (Thomas Richter)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (2):
>       perf stat: Fix saved values rbtree lookup
>       perf tools: Add missing newline to expr parser error messages
> 
> Arnaldo Carvalho de Melo (10):
>       perf test: Make 'list' subcommand match main 'perf test' numbering/matching
>       perf test: Add 'struct test *' to the test functions
>       perf test: Add infrastructure to run shell based tests
>       perf test: Make 'list' use same filtering code as main 'perf test'
>       perf test shell: Add 'probe_vfs_getname' shell test
>       perf test shell: Install shell tests
>       perf test shell: Move vfs_getname probe function to lib
>       perf test shell: Add test using probe:vfs_getname and verifying results
>       perf test shell: Add test using vfs_getname + 'perf trace'
>       perf test shell: Add uprobes + backtrace ping test
> 
> Milian Wolff (2):
>       perf util: Take elf_name as const string in dso__demangle_sym
>       perf srcline: Do not consider empty files as valid srclines
> 
> Naveen N. Rao (1):
>       perf scripting python: Add ppc64le to audit uname list
> 
> Sukadev Bhattiprolu (2):
>       perf vendor events powerpc: remove suffix in mapfile
>       perf vendor events powerpc: Update POWER9 events
> 
> Thomas Richter (2):
>       perf record: Fix wrong size in perf_record_mmap for last kernel module
>       perf report: Fix module symbol adjustment for s390x
> 
>  tools/perf/Makefile.perf                           |    6 +-
>  tools/perf/arch/s390/util/sym-handling.c           |    7 +
>  tools/perf/arch/x86/include/arch-tests.h           |   11 +-
>  tools/perf/arch/x86/tests/insn-x86.c               |    2 +-
>  tools/perf/arch/x86/tests/intel-cqm.c              |    2 +-
>  tools/perf/arch/x86/tests/perf-time-to-tsc.c       |    2 +-
>  tools/perf/arch/x86/tests/rdpmc.c                  |    2 +-
>  tools/perf/pmu-events/arch/powerpc/mapfile.csv     |   20 +-
>  .../perf/pmu-events/arch/powerpc/power9/cache.json |  191 +-
>  .../arch/powerpc/power9/floating-point.json        |   42 +-
>  .../pmu-events/arch/powerpc/power9/frontend.json   |  517 ++--
>  .../pmu-events/arch/powerpc/power9/marked.json     |  905 +++----
>  .../pmu-events/arch/powerpc/power9/memory.json     |  178 +-
>  .../perf/pmu-events/arch/powerpc/power9/other.json | 2768 ++++++++++++++++----
>  .../pmu-events/arch/powerpc/power9/pipeline.json   |  779 +++---
>  tools/perf/pmu-events/arch/powerpc/power9/pmc.json |  167 +-
>  .../arch/powerpc/power9/translation.json           |  314 +--
>  .../python/Perf-Trace-Util/lib/Perf/Trace/Util.py  |    1 +
>  tools/perf/tests/attr.c                            |    2 +-
>  tools/perf/tests/backward-ring-buffer.c            |    2 +-
>  tools/perf/tests/bitmap.c                          |    2 +-
>  tools/perf/tests/bp_signal.c                       |    2 +-
>  tools/perf/tests/bp_signal_overflow.c              |    2 +-
>  tools/perf/tests/bpf.c                             |    4 +-
>  tools/perf/tests/builtin-test.c                    |  184 +-
>  tools/perf/tests/clang.c                           |    4 +-
>  tools/perf/tests/code-reading.c                    |    2 +-
>  tools/perf/tests/cpumap.c                          |    4 +-
>  tools/perf/tests/dso-data.c                        |    6 +-
>  tools/perf/tests/dwarf-unwind.c                    |    2 +-
>  tools/perf/tests/event-times.c                     |    2 +-
>  tools/perf/tests/event_update.c                    |    2 +-
>  tools/perf/tests/evsel-roundtrip-name.c            |    2 +-
>  tools/perf/tests/evsel-tp-sched.c                  |    2 +-
>  tools/perf/tests/expr.c                            |    2 +-
>  tools/perf/tests/fdarray.c                         |    4 +-
>  tools/perf/tests/hists_cumulate.c                  |    2 +-
>  tools/perf/tests/hists_filter.c                    |    2 +-
>  tools/perf/tests/hists_link.c                      |    2 +-
>  tools/perf/tests/hists_output.c                    |    2 +-
>  tools/perf/tests/is_printable_array.c              |    2 +-
>  tools/perf/tests/keep-tracking.c                   |    2 +-
>  tools/perf/tests/kmod-path.c                       |    2 +-
>  tools/perf/tests/llvm.c                            |    2 +-
>  tools/perf/tests/mmap-basic.c                      |    2 +-
>  tools/perf/tests/mmap-thread-lookup.c              |    2 +-
>  tools/perf/tests/openat-syscall-all-cpus.c         |    2 +-
>  tools/perf/tests/openat-syscall-tp-fields.c        |    2 +-
>  tools/perf/tests/openat-syscall.c                  |    2 +-
>  tools/perf/tests/parse-events.c                    |    2 +-
>  tools/perf/tests/parse-no-sample-id-all.c          |    2 +-
>  tools/perf/tests/perf-hooks.c                      |    2 +-
>  tools/perf/tests/perf-record.c                     |    2 +-
>  tools/perf/tests/pmu.c                             |    2 +-
>  tools/perf/tests/python-use.c                      |    2 +-
>  tools/perf/tests/sample-parsing.c                  |    2 +-
>  tools/perf/tests/sdt.c                             |    4 +-
>  tools/perf/tests/shell/lib/probe_vfs_getname.sh    |   28 +
>  tools/perf/tests/shell/probe_vfs_getname.sh        |   10 +
>  .../tests/shell/record+script_probe_vfs_getname.sh |   37 +
>  .../perf/tests/shell/trace+probe_libc_inet_pton.sh |   40 +
>  tools/perf/tests/shell/trace+probe_vfs_getname.sh  |   31 +
>  tools/perf/tests/stat.c                            |    6 +-
>  tools/perf/tests/sw-clock.c                        |    2 +-
>  tools/perf/tests/switch-tracking.c                 |    2 +-
>  tools/perf/tests/task-exit.c                       |    2 +-
>  tools/perf/tests/tests.h                           |  113 +-
>  tools/perf/tests/thread-map.c                      |    6 +-
>  tools/perf/tests/thread-mg-share.c                 |    2 +-
>  tools/perf/tests/topology.c                        |    2 +-
>  tools/perf/tests/unit_number__scnprintf.c          |    2 +-
>  tools/perf/tests/vmlinux-kallsyms.c                |    2 +-
>  tools/perf/util/expr.y                             |    2 +-
>  tools/perf/util/machine.c                          |    4 +-
>  tools/perf/util/srcline.c                          |    6 +
>  tools/perf/util/stat-shadow.c                      |    6 +-
>  tools/perf/util/symbol-elf.c                       |   12 +-
>  tools/perf/util/symbol-minimal.c                   |    2 +-
>  tools/perf/util/symbol.c                           |   21 +-
>  tools/perf/util/symbol.h                           |    7 +-
>  80 files changed, 4054 insertions(+), 2479 deletions(-)
>  create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh
>  create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh
>  create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh
>  create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
>  create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2017-08-14 16:27 Arnaldo Carvalho de Melo
  2017-08-14 17:39 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-08-14 16:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern,
	Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming,
	Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim,
	Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu,
	Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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


The following changes since commit 82119cbe8e1e32cc2a941393e59816e731681310:

  Merge tag 'perf-core-for-mingo-4.14-20170801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-10 17:07:02 +0200)

are available in the git repository at:

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

for you to fetch changes up to 8fc375d7d36c72b4c2d55f5c24be022a939295d4:

  perf test shell: Add uprobes + backtrace ping test (2017-08-11 16:18:49 -0300)

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

Infrastructure:

- Do not consider empty files as valid srclines (Milian Wolff)

- Fix wrong size in perf_record_mmap for last kernel module,
  which resulted in erroneous symbol resolution in at least s390x (Thomas Richter)

- Add missing newline to expr parser error messages (Andi Kleen)

- Fix saved values rbtree lookup in 'perf stat' (Andi Kleen)

- Add support for shell based tests in 'perf test', add a few that
  run 'perf probe', 'perf trace', using kprobes, uprobes to check
  the output of those tools and the effects on the system, checking,
  for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo)

Arch specific:

- Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao)

- Update POWER9 vendor events tables (Sukadev Bhattiprolu)

- Fix module symbol adjustment for s390x (Thomas Richter)

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

----------------------------------------------------------------
Andi Kleen (2):
      perf stat: Fix saved values rbtree lookup
      perf tools: Add missing newline to expr parser error messages

Arnaldo Carvalho de Melo (10):
      perf test: Make 'list' subcommand match main 'perf test' numbering/matching
      perf test: Add 'struct test *' to the test functions
      perf test: Add infrastructure to run shell based tests
      perf test: Make 'list' use same filtering code as main 'perf test'
      perf test shell: Add 'probe_vfs_getname' shell test
      perf test shell: Install shell tests
      perf test shell: Move vfs_getname probe function to lib
      perf test shell: Add test using probe:vfs_getname and verifying results
      perf test shell: Add test using vfs_getname + 'perf trace'
      perf test shell: Add uprobes + backtrace ping test

Milian Wolff (2):
      perf util: Take elf_name as const string in dso__demangle_sym
      perf srcline: Do not consider empty files as valid srclines

Naveen N. Rao (1):
      perf scripting python: Add ppc64le to audit uname list

Sukadev Bhattiprolu (2):
      perf vendor events powerpc: remove suffix in mapfile
      perf vendor events powerpc: Update POWER9 events

Thomas Richter (2):
      perf record: Fix wrong size in perf_record_mmap for last kernel module
      perf report: Fix module symbol adjustment for s390x

 tools/perf/Makefile.perf                           |    6 +-
 tools/perf/arch/s390/util/sym-handling.c           |    7 +
 tools/perf/arch/x86/include/arch-tests.h           |   11 +-
 tools/perf/arch/x86/tests/insn-x86.c               |    2 +-
 tools/perf/arch/x86/tests/intel-cqm.c              |    2 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c       |    2 +-
 tools/perf/arch/x86/tests/rdpmc.c                  |    2 +-
 tools/perf/pmu-events/arch/powerpc/mapfile.csv     |   20 +-
 .../perf/pmu-events/arch/powerpc/power9/cache.json |  191 +-
 .../arch/powerpc/power9/floating-point.json        |   42 +-
 .../pmu-events/arch/powerpc/power9/frontend.json   |  517 ++--
 .../pmu-events/arch/powerpc/power9/marked.json     |  905 +++----
 .../pmu-events/arch/powerpc/power9/memory.json     |  178 +-
 .../perf/pmu-events/arch/powerpc/power9/other.json | 2768 ++++++++++++++++----
 .../pmu-events/arch/powerpc/power9/pipeline.json   |  779 +++---
 tools/perf/pmu-events/arch/powerpc/power9/pmc.json |  167 +-
 .../arch/powerpc/power9/translation.json           |  314 +--
 .../python/Perf-Trace-Util/lib/Perf/Trace/Util.py  |    1 +
 tools/perf/tests/attr.c                            |    2 +-
 tools/perf/tests/backward-ring-buffer.c            |    2 +-
 tools/perf/tests/bitmap.c                          |    2 +-
 tools/perf/tests/bp_signal.c                       |    2 +-
 tools/perf/tests/bp_signal_overflow.c              |    2 +-
 tools/perf/tests/bpf.c                             |    4 +-
 tools/perf/tests/builtin-test.c                    |  184 +-
 tools/perf/tests/clang.c                           |    4 +-
 tools/perf/tests/code-reading.c                    |    2 +-
 tools/perf/tests/cpumap.c                          |    4 +-
 tools/perf/tests/dso-data.c                        |    6 +-
 tools/perf/tests/dwarf-unwind.c                    |    2 +-
 tools/perf/tests/event-times.c                     |    2 +-
 tools/perf/tests/event_update.c                    |    2 +-
 tools/perf/tests/evsel-roundtrip-name.c            |    2 +-
 tools/perf/tests/evsel-tp-sched.c                  |    2 +-
 tools/perf/tests/expr.c                            |    2 +-
 tools/perf/tests/fdarray.c                         |    4 +-
 tools/perf/tests/hists_cumulate.c                  |    2 +-
 tools/perf/tests/hists_filter.c                    |    2 +-
 tools/perf/tests/hists_link.c                      |    2 +-
 tools/perf/tests/hists_output.c                    |    2 +-
 tools/perf/tests/is_printable_array.c              |    2 +-
 tools/perf/tests/keep-tracking.c                   |    2 +-
 tools/perf/tests/kmod-path.c                       |    2 +-
 tools/perf/tests/llvm.c                            |    2 +-
 tools/perf/tests/mmap-basic.c                      |    2 +-
 tools/perf/tests/mmap-thread-lookup.c              |    2 +-
 tools/perf/tests/openat-syscall-all-cpus.c         |    2 +-
 tools/perf/tests/openat-syscall-tp-fields.c        |    2 +-
 tools/perf/tests/openat-syscall.c                  |    2 +-
 tools/perf/tests/parse-events.c                    |    2 +-
 tools/perf/tests/parse-no-sample-id-all.c          |    2 +-
 tools/perf/tests/perf-hooks.c                      |    2 +-
 tools/perf/tests/perf-record.c                     |    2 +-
 tools/perf/tests/pmu.c                             |    2 +-
 tools/perf/tests/python-use.c                      |    2 +-
 tools/perf/tests/sample-parsing.c                  |    2 +-
 tools/perf/tests/sdt.c                             |    4 +-
 tools/perf/tests/shell/lib/probe_vfs_getname.sh    |   28 +
 tools/perf/tests/shell/probe_vfs_getname.sh        |   10 +
 .../tests/shell/record+script_probe_vfs_getname.sh |   37 +
 .../perf/tests/shell/trace+probe_libc_inet_pton.sh |   40 +
 tools/perf/tests/shell/trace+probe_vfs_getname.sh  |   31 +
 tools/perf/tests/stat.c                            |    6 +-
 tools/perf/tests/sw-clock.c                        |    2 +-
 tools/perf/tests/switch-tracking.c                 |    2 +-
 tools/perf/tests/task-exit.c                       |    2 +-
 tools/perf/tests/tests.h                           |  113 +-
 tools/perf/tests/thread-map.c                      |    6 +-
 tools/perf/tests/thread-mg-share.c                 |    2 +-
 tools/perf/tests/topology.c                        |    2 +-
 tools/perf/tests/unit_number__scnprintf.c          |    2 +-
 tools/perf/tests/vmlinux-kallsyms.c                |    2 +-
 tools/perf/util/expr.y                             |    2 +-
 tools/perf/util/machine.c                          |    4 +-
 tools/perf/util/srcline.c                          |    6 +
 tools/perf/util/stat-shadow.c                      |    6 +-
 tools/perf/util/symbol-elf.c                       |   12 +-
 tools/perf/util/symbol-minimal.c                   |    2 +-
 tools/perf/util/symbol.c                           |   21 +-
 tools/perf/util/symbol.h                           |    7 +-
 80 files changed, 4054 insertions(+), 2479 deletions(-)
 create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh
 create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh
 create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh
 create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
 create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

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

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

The 'perf test'  also runs shell scripts exercising the tools, checking
if they affect the system in certain ways, like setting up kprobes and
uprobes, request callchains for well known programs and check that they
are the expected ones, see if 'perf trace' beautifies system call
arguments correctly, etc.

Additionally, a new set of tests, script based, runs the tools in a live system,
setting probes in place that then gets used by 'perf trace', with its output
compared against expected results.

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

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:3.6: Ok
   4 alpine:edge: Ok
   5 android-ndk:r12b-arm: Ok
   6 archlinux:latest: Ok
   7 centos:5: Ok
   8 centos:6: Ok
   9 centos:7: Ok
  10 debian:7: Ok
  11 debian:8: Ok
  12 debian:9: Ok
  13 debian:experimental: Ok
  14 debian:experimental-x-arm64: Ok
  15 debian:experimental-x-mips: Ok
  16 debian:experimental-x-mips64: Ok
  17 debian:experimental-x-mipsel: Ok
  18 fedora:20: Ok
  19 fedora:21: Ok
  20 fedora:22: Ok
  21 fedora:23: Ok
  22 fedora:24: Ok
  23 fedora:24-x-ARC-uClibc: Ok
  24 fedora:25: Ok
  25 fedora:26: Ok
  26 fedora:rawhide: Ok
  27 mageia:5: Ok
  28 opensuse:13.2: Ok
  29 opensuse:42.1: Ok
  30 opensuse:42.2: Ok
  31 opensuse:tumbleweed: Ok
  32 oraclelinux:6: Ok
  33 oraclelinux:7: Ok
  34 ubuntu:12.04.5: Ok
  35 ubuntu:14.04.4: Ok
  36 ubuntu:14.04.4-x-linaro-arm64: Ok
  37 ubuntu:15.10: Ok
  38 ubuntu:16.04: Ok
  39 ubuntu:16.04-x-arm: Ok
  40 ubuntu:16.04-x-arm64: Ok
  41 ubuntu:16.04-x-powerpc: Ok
  42 ubuntu:16.04-x-powerpc64: Ok
  43 ubuntu:16.04-x-powerpc64el: Ok
  44 ubuntu:16.04-x-s390: Ok
  45 ubuntu:16.10: Ok
  46 ubuntu:17.04: Ok
  47 ubuntu:17.10: Ok
  #
  # uname -a
  Linux jouet 4.13.0-rc4+ #2 SMP Fri Aug 11 12:39:09 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms                       : Ok
   2: Detect openat syscall event                           : Ok
   3: Detect openat syscall event on all cpus               : Ok
   4: Read samples using the mmap interface                 : Ok
   5: Parse event definition strings                        : Ok
   6: Simple expression parser                              : Ok
   7: PERF_RECORD_* events & perf_sample fields             : Ok
   8: Parse perf pmu format                                 : Ok
   9: DSO data read                                         : Ok
  10: DSO data cache                                        : Ok
  11: DSO data reopen                                       : Ok
  12: Roundtrip evsel->name                                 : Ok
  13: Parse sched tracepoints fields                        : Ok
  14: syscalls:sys_enter_openat event fields                : Ok
  15: Setup struct perf_event_attr                          : Ok
  16: Match and link multiple hists                         : Ok
  17: 'import perf' in python                               : Ok
  18: Breakpoint overflow signal handler                    : Ok
  19: Breakpoint overflow sampling                          : Ok
  20: Number of exit events of a simple workload            : Ok
  21: Software clock events period values                   : Ok
  22: Object code reading                                   : Ok
  23: Sample parsing                                        : Ok
  24: Use a dummy software event to keep tracking           : Ok
  25: Parse with no sample_id_all bit set                   : Ok
  26: Filter hist entries                                   : Ok
  27: Lookup mmap thread                                    : Ok
  28: Share thread mg                                       : Ok
  29: Sort output of hist entries                           : Ok
  30: Cumulate child hist entries                           : Ok
  31: Track with sched_switch                               : Ok
  32: Filter fds with revents mask in a fdarray             : Ok
  33: Add fd to a fdarray, making it autogrow               : Ok
  34: kmod_path__parse                                      : Ok
  35: Thread map                                            : Ok
  36: LLVM search and compile                               :
  36.1: Basic BPF llvm compile                              : Ok
  36.2: kbuild searching                                    : Ok
  36.3: Compile source for BPF prologue generation          : Ok
  36.4: Compile source for BPF relocation                   : Ok
  37: Session topology                                      : Ok
  38: BPF filter                                            :
  38.1: Basic BPF filtering                                 : Ok
  38.2: BPF pinning                                         : Ok
  38.3: BPF prologue generation                             : Ok
  38.4: BPF relocation checker                              : Ok
  39: Synthesize thread map                                 : Ok
  40: Remove thread map                                     : Ok
  41: Synthesize cpu map                                    : Ok
  42: Synthesize stat config                                : Ok
  43: Synthesize stat                                       : Ok
  44: Synthesize stat round                                 : Ok
  45: Synthesize attr update                                : Ok
  46: Event times                                           : Ok
  47: Read backward ring buffer                             : Ok
  48: Print cpu map                                         : Ok
  49: Probe SDT events                                      : Ok
  50: is_printable_array                                    : Ok
  51: Print bitmap                                          : Ok
  52: perf hooks                                            : Ok
  53: builtin clang support                                 : Skip (not compiled in)
  54: unit_number__scnprintf                                : Ok
  55: x86 rdpmc                                             : Ok
  56: Convert perf time to TSC                              : Ok
  57: DWARF unwind                                          : Ok
  58: x86 instruction decoder - new instructions            : Ok
  59: Intel cqm nmi context read                            : Skip
  60: Use vfs_getname probe to get syscall args filenames   : Ok
  61: probe libc's inet_pton & backtrace it with ping       : Ok
  62: Check open filename arg using perf trace + vfs_getname: Ok
  63: Add vfs_getname probe to get syscall args filenames   : Ok
  #

  # The static build test works on Fedora 25, is failing on Fedora 26,
  # this issue is being investigated.
  
  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
               make_no_slang_O: make NO_SLANG=1
         make_install_prefix_O: make install prefix=/tmp/krava
            make_install_bin_O: make install-bin
                  make_debug_O: make DEBUG=1
              make_clean_all_O: make clean all
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
            make_no_auxtrace_O: make NO_AUXTRACE=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
                make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
           make_no_libpython_O: make NO_LIBPYTHON=1
            make_no_libaudit_O: make NO_LIBAUDIT=1
                   make_help_O: make help
            make_no_demangle_O: make NO_DEMANGLE=1
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
           make_no_libunwind_O: make NO_LIBUNWIND=1
                make_install_O: make install
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
                make_no_newt_O: make NO_NEWT=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
                 make_perf_o_O: make perf.o
                make_no_gtk2_O: make NO_GTK2=1
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
              make_no_libbpf_O: make NO_LIBBPF=1
         make_with_clangllvm_O: make LIBCLANGLLVM=1
                   make_tags_O: make tags
             make_util_map_o_O: make util/map.o
                   make_pure_O: make
             make_no_libperl_O: make NO_LIBPERL=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
           make_no_backtrace_O: make NO_BACKTRACE=1
             make_no_libnuma_O: make NO_LIBNUMA=1
              make_no_libelf_O: make NO_LIBELF=1
                    make_doc_O: make doc
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-12-01 18:02 Arnaldo Carvalho de Melo
@ 2016-12-02  9:10 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-12-02  9:10 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexei Starovoitov, Chris Ryder, David Ahern, He Kuang,
	Jiri Olsa, Joe Stringer, Kim Phillips, Mark Rutland,
	Namhyung Kim, Pawel Moll, Peter Zijlstra, Wang Nan, Will Deacon,
	Zefan Li, pi3orama, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 2471cece40d61b0035360338569d338f9dea6099:
> 
>   Merge tag 'perf-core-for-mingo-20161125' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-25 18:12:41 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161201
> 
> for you to fetch changes up to 0fcb1da4aba6e6c7b32de5e0948b740b31ad822d:
> 
>   perf annotate: AArch64 support (2016-12-01 13:03:19 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Support AArch64 in the 'annotate' code, native/local and
>   cross-arch/remote (Kim Phillips)
> 
> - Allow considering just events in a given time interval, via the
>   '--time start.s.ms,end.s.ms' command line, added to 'perf kmem',
>   'perf report', 'perf sched timehist' and 'perf script' (David Ahern)
> 
> - Add option to stop printing a callchain at one of a given group of
>   symbol names (David Ahern)
> 
> - Handle cpu migration events in 'perf sched timehist' (David Ahern)
> 
> - Track memory freed in 'perf kmem stat' (David Ahern)
> 
> Infrastructure:
> 
> - Initial support (and perf test entry) for tooling hooks, starting with
>   'record_start' and 'record_end', that will have as its initial user the
>   eBPF infrastructure, where perf_ prefixed functions will be JITed and
>   run when such hooks are called (Wang Nan)
> 
> - Remove redundant "test" and similar strings from 'perf test' descriptions
>   (Arnaldo Carvalho de Melo)
> 
> - libbpf assorted improvements (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (3):
>       perf ui helpline: Provide a printf variant
>       perf annotate: Show invalid jump offset in error message
>       perf test: Remove "test" and similar strings from test descriptions
> 
> David Ahern (10):
>       perf sched timehist: Handle cpu migration events
>       perf trace: Update tid/pid filtering option to leverage symbol_conf
>       perf kmem stat: Track memory freed
>       perf script: Add option to stop printing callchain
>       perf tools: Add time-based utility functions
>       perf tools: Move parse_nsec_time to time-utils.c
>       perf script: Add option to specify time window of interest
>       perf sched timehist: Add option to specify time window of interest
>       perf kmem: Add option to specify time window of interest
>       perf report: Add option to specify time window of interest
> 
> Kim Phillips (2):
>       perf annotate: Use arch->objdump.comment_char in dec__parse()
>       perf annotate: AArch64 support
> 
> Wang Nan (4):
>       tools lib bpf: Add missing BPF functions
>       tools lib bpf: Add private field for bpf_object
>       tools lib bpf: Retrive bpf_map through offset of bpf_map_def
>       perf tools: Introduce perf hooks
> 
>  tools/lib/bpf/bpf.c                           |  56 ++++++++++
>  tools/lib/bpf/bpf.h                           |   7 ++
>  tools/lib/bpf/libbpf.c                        |  35 ++++++
>  tools/lib/bpf/libbpf.h                        |  13 +++
>  tools/perf/Documentation/perf-kmem.txt        |   7 ++
>  tools/perf/Documentation/perf-report.txt      |   7 ++
>  tools/perf/Documentation/perf-sched.txt       |  12 +++
>  tools/perf/Documentation/perf-script.txt      |  10 ++
>  tools/perf/arch/arm64/annotate/instructions.c |  62 +++++++++++
>  tools/perf/arch/x86/tests/arch-tests.c        |  10 +-
>  tools/perf/builtin-kmem.c                     |  36 ++++++-
>  tools/perf/builtin-record.c                   |  11 ++
>  tools/perf/builtin-report.c                   |  14 ++-
>  tools/perf/builtin-sched.c                    | 148 ++++++++++++++++++++++++--
>  tools/perf/builtin-script.c                   |  17 ++-
>  tools/perf/builtin-trace.c                    |  49 ++-------
>  tools/perf/tests/Build                        |   1 +
>  tools/perf/tests/bpf.c                        |   6 +-
>  tools/perf/tests/builtin-test.c               |  96 +++++++++--------
>  tools/perf/tests/llvm.c                       |   8 +-
>  tools/perf/tests/perf-hooks.c                 |  44 ++++++++
>  tools/perf/tests/tests.h                      |   1 +
>  tools/perf/ui/browsers/annotate.c             |   6 +-
>  tools/perf/ui/helpline.c                      |  10 ++
>  tools/perf/ui/helpline.h                      |   1 +
>  tools/perf/util/Build                         |   3 +
>  tools/perf/util/annotate.c                    |   7 +-
>  tools/perf/util/evsel_fprintf.c               |   8 ++
>  tools/perf/util/perf-hooks-list.h             |   3 +
>  tools/perf/util/perf-hooks.c                  |  84 +++++++++++++++
>  tools/perf/util/perf-hooks.h                  |  37 +++++++
>  tools/perf/util/symbol.c                      |   8 ++
>  tools/perf/util/symbol.h                      |   6 +-
>  tools/perf/util/time-utils.c                  | 119 +++++++++++++++++++++
>  tools/perf/util/time-utils.h                  |  14 +++
>  tools/perf/util/util.c                        |  33 ------
>  tools/perf/util/util.h                        |   2 -
>  37 files changed, 842 insertions(+), 149 deletions(-)
>  create mode 100644 tools/perf/arch/arm64/annotate/instructions.c
>  create mode 100644 tools/perf/tests/perf-hooks.c
>  create mode 100644 tools/perf/util/perf-hooks-list.h
>  create mode 100644 tools/perf/util/perf-hooks.c
>  create mode 100644 tools/perf/util/perf-hooks.h
>  create mode 100644 tools/perf/util/time-utils.c
>  create mode 100644 tools/perf/util/time-utils.h
> 
>   # uname -a
>   Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>   # perf test
>    1: vmlinux symtab matches kallsyms            : Ok
>    2: Detect openat syscall event                : Ok
>    3: Detect openat syscall event on all cpus    : Ok
>    4: Read samples using the mmap interface      : Ok
>    5: Parse event definition strings             : Ok
>    6: PERF_RECORD_* events & perf_sample fields  : Ok
>    7: Parse perf pmu format                      : Ok
>    8: DSO data read                              : Ok
>    9: DSO data cache                             : Ok
>   10: DSO data reopen                            : Ok
>   11: Roundtrip evsel->name                      : Ok
>   12: Parse sched tracepoints fields             : Ok
>   13: syscalls:sys_enter_openat event fields     : Ok
>   14: Setup struct perf_event_attr               : Ok
>   15: Match and link multiple hists              : Ok
>   16: 'import perf' in python                    : Ok
>   17: Breakpoint overflow signal handler         : Ok
>   18: Breakpoint overflow sampling               : Ok
>   19: Number of exit events of a simple workload : Ok
>   20: Software clock events period values        : Ok
>   21: Object code reading                        : Ok
>   22: Sample parsing                             : Ok
>   23: Use a dummy software event to keep tracking: Ok
>   24: Parse with no sample_id_all bit set        : Ok
>   25: Filter hist entries                        : Ok
>   26: Lookup mmap thread                         : Ok
>   27: Share thread mg                            : Ok
>   28: Sort output of hist entries                : Ok
>   29: Cumulate child hist entries                : Ok
>   30: Track with sched_switch                    : Ok
>   31: Filter fds with revents mask in a fdarray  : Ok
>   32: Add fd to a fdarray, making it autogrow    : Ok
>   33: kmod_path__parse                           : Ok
>   34: Thread map                                 : Ok
>   35: LLVM search and compile                    :
>   35.1: Basic BPF llvm compile                    : Ok
>   35.2: kbuild searching                          : Ok
>   35.3: Compile source for BPF prologue generation: Ok
>   35.4: Compile source for BPF relocation         : Ok
>   36: Session topology                           : Ok
>   37: BPF filter                                 :
>   37.1: Basic BPF filtering                      : Ok
>   37.2: BPF prologue generation                  : Ok
>   37.3: BPF relocation checker                   : Ok
>   38: Synthesize thread map                      : Ok
>   39: Synthesize cpu map                         : Ok
>   40: Synthesize stat config                     : Ok
>   41: Synthesize stat                            : Ok
>   42: Synthesize stat round                      : Ok
>   43: Synthesize attr update                     : Ok
>   44: Event times                                : Ok
>   45: Read backward ring buffer                  : Ok
>   46: Print cpu map                              : Ok
>   47: Probe SDT events                           : Ok
>   48: is_printable_array                         : Ok
>   49: Print bitmap                               : Ok
>   50: perf hooks                                 : Ok
>   51: x86 rdpmc                                  : Ok
>   52: Convert perf time to TSC                   : Ok
>   53: DWARF unwind                               : Ok
>   54: x86 instruction decoder - new instructions : Ok
>   55: Intel cqm nmi context read                 : Skip
>   # 
>   # uname -a
>   Linux zoo 4.7.3-200.fc24.x86_64 #1 SMP Wed Sep 7 17:31:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>   # dm
>    1 alpine:3.4: Ok
>    2 android-ndk:r12b-arm: Ok
>    3 archlinux:latest: Ok
>    4 centos:5: Ok
>    5 centos:6: Ok
>    6 centos:7: Ok
>    7 debian:7: Ok
>    8 debian:8: Ok
>    9 debian:experimental: Ok
>   10 fedora:20: Ok
>   11 fedora:21: Ok
>   12 fedora:22: Ok
>   13 fedora:23: Ok
>   14 fedora:24: Ok
>   15 fedora:24-x-ARC-uClibc: Ok
>   16 fedora:rawhide: Ok
>   17 mageia:5: Ok
>   18 opensuse:13.2: Ok
>   19 opensuse:42.1: Ok
>   20 opensuse:tumbleweed: Ok
>   21 ubuntu:12.04.5: Ok
>   22 ubuntu:14.04: Ok
>   23 ubuntu:14.04.4: Ok
>   24 ubuntu:15.10: Ok
>   25 ubuntu:16.04: Ok
>   26 ubuntu:16.04-x-arm: Ok
>   27 ubuntu:16.04-x-arm64: Ok
>   28 ubuntu:16.04-x-powerpc: Ok
>   29 ubuntu:16.04-x-powerpc64: Ok
>   30 ubuntu:16.04-x-powerpc64el: Ok
>   31 ubuntu:16.04-x-s390: Ok
>   32 ubuntu:16.10: Ok
>   #
>   $ grep PRETTY_NAME /etc/os-release 
>   PRETTY_NAME="Fedora 25 (Workstation Edition)"
>   $ 
>   $ perf stat make -C tools/perf build-test
>   make: Entering directory '/home/acme/git/linux/tools/perf'
>   - tarpkg: ./tests/perf-targz-src-pkg .
>                make_no_slang_O: make NO_SLANG=1
>              make_util_map_o_O: make util/map.o
>                  make_static_O: make LDFLAGS=-static
>   make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
>                  make_perf_o_O: make perf.o
>            make_no_libunwind_O: make NO_LIBUNWIND=1
>               make_no_libelf_O: make NO_LIBELF=1
>        make_util_pmu_bison_o_O: make util/pmu-bison.o
>            make_no_backtrace_O: make NO_BACKTRACE=1
>                   make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
>             make_no_demangle_O: make NO_DEMANGLE=1
>              make_no_libperl_O: make NO_LIBPERL=1
>                    make_tags_O: make tags
>              make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
>    make_install_prefix_slash_O: make install prefix=/tmp/krava/
>             make_no_auxtrace_O: make NO_AUXTRACE=1
>              make_no_libnuma_O: make NO_LIBNUMA=1
>             make_install_bin_O: make install-bin
>                 make_no_newt_O: make NO_NEWT=1
>                    make_pure_O: make
>                 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
>               make_clean_all_O: make clean all
>                 make_no_gtk2_O: make NO_GTK2=1
>            make_no_libbionic_O: make NO_LIBBIONIC=1
>          make_install_prefix_O: make install prefix=/tmp/krava
>               make_no_libbpf_O: make NO_LIBBPF=1
>             make_no_libaudit_O: make NO_LIBAUDIT=1
>         make_with_babeltrace_O: make LIBBABELTRACE=1
>            make_no_libpython_O: make NO_LIBPYTHON=1
>                    make_help_O: make help
>                     make_doc_O: make doc
>                   make_debug_O: make DEBUG=1
>                 make_install_O: make install
>   OK
>   make: Leaving directory '/home/acme/git/linux/tools/perf'
>   $ 
>   

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-12-01 18:02 Arnaldo Carvalho de Melo
  2016-12-02  9:10 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-01 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexei Starovoitov, Chris Ryder, David Ahern,
	He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, Mark Rutland,
	Namhyung Kim, Pawel Moll, Peter Zijlstra, Wang Nan, Will Deacon,
	Zefan Li, pi3orama, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit 2471cece40d61b0035360338569d338f9dea6099:

  Merge tag 'perf-core-for-mingo-20161125' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-25 18:12:41 +0100)

are available in the git repository at:

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

for you to fetch changes up to 0fcb1da4aba6e6c7b32de5e0948b740b31ad822d:

  perf annotate: AArch64 support (2016-12-01 13:03:19 -0300)

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

New features:

- Support AArch64 in the 'annotate' code, native/local and
  cross-arch/remote (Kim Phillips)

- Allow considering just events in a given time interval, via the
  '--time start.s.ms,end.s.ms' command line, added to 'perf kmem',
  'perf report', 'perf sched timehist' and 'perf script' (David Ahern)

- Add option to stop printing a callchain at one of a given group of
  symbol names (David Ahern)

- Handle cpu migration events in 'perf sched timehist' (David Ahern)

- Track memory freed in 'perf kmem stat' (David Ahern)

Infrastructure:

- Initial support (and perf test entry) for tooling hooks, starting with
  'record_start' and 'record_end', that will have as its initial user the
  eBPF infrastructure, where perf_ prefixed functions will be JITed and
  run when such hooks are called (Wang Nan)

- Remove redundant "test" and similar strings from 'perf test' descriptions
  (Arnaldo Carvalho de Melo)

- libbpf assorted improvements (Wang Nan)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
      perf ui helpline: Provide a printf variant
      perf annotate: Show invalid jump offset in error message
      perf test: Remove "test" and similar strings from test descriptions

David Ahern (10):
      perf sched timehist: Handle cpu migration events
      perf trace: Update tid/pid filtering option to leverage symbol_conf
      perf kmem stat: Track memory freed
      perf script: Add option to stop printing callchain
      perf tools: Add time-based utility functions
      perf tools: Move parse_nsec_time to time-utils.c
      perf script: Add option to specify time window of interest
      perf sched timehist: Add option to specify time window of interest
      perf kmem: Add option to specify time window of interest
      perf report: Add option to specify time window of interest

Kim Phillips (2):
      perf annotate: Use arch->objdump.comment_char in dec__parse()
      perf annotate: AArch64 support

Wang Nan (4):
      tools lib bpf: Add missing BPF functions
      tools lib bpf: Add private field for bpf_object
      tools lib bpf: Retrive bpf_map through offset of bpf_map_def
      perf tools: Introduce perf hooks

 tools/lib/bpf/bpf.c                           |  56 ++++++++++
 tools/lib/bpf/bpf.h                           |   7 ++
 tools/lib/bpf/libbpf.c                        |  35 ++++++
 tools/lib/bpf/libbpf.h                        |  13 +++
 tools/perf/Documentation/perf-kmem.txt        |   7 ++
 tools/perf/Documentation/perf-report.txt      |   7 ++
 tools/perf/Documentation/perf-sched.txt       |  12 +++
 tools/perf/Documentation/perf-script.txt      |  10 ++
 tools/perf/arch/arm64/annotate/instructions.c |  62 +++++++++++
 tools/perf/arch/x86/tests/arch-tests.c        |  10 +-
 tools/perf/builtin-kmem.c                     |  36 ++++++-
 tools/perf/builtin-record.c                   |  11 ++
 tools/perf/builtin-report.c                   |  14 ++-
 tools/perf/builtin-sched.c                    | 148 ++++++++++++++++++++++++--
 tools/perf/builtin-script.c                   |  17 ++-
 tools/perf/builtin-trace.c                    |  49 ++-------
 tools/perf/tests/Build                        |   1 +
 tools/perf/tests/bpf.c                        |   6 +-
 tools/perf/tests/builtin-test.c               |  96 +++++++++--------
 tools/perf/tests/llvm.c                       |   8 +-
 tools/perf/tests/perf-hooks.c                 |  44 ++++++++
 tools/perf/tests/tests.h                      |   1 +
 tools/perf/ui/browsers/annotate.c             |   6 +-
 tools/perf/ui/helpline.c                      |  10 ++
 tools/perf/ui/helpline.h                      |   1 +
 tools/perf/util/Build                         |   3 +
 tools/perf/util/annotate.c                    |   7 +-
 tools/perf/util/evsel_fprintf.c               |   8 ++
 tools/perf/util/perf-hooks-list.h             |   3 +
 tools/perf/util/perf-hooks.c                  |  84 +++++++++++++++
 tools/perf/util/perf-hooks.h                  |  37 +++++++
 tools/perf/util/symbol.c                      |   8 ++
 tools/perf/util/symbol.h                      |   6 +-
 tools/perf/util/time-utils.c                  | 119 +++++++++++++++++++++
 tools/perf/util/time-utils.h                  |  14 +++
 tools/perf/util/util.c                        |  33 ------
 tools/perf/util/util.h                        |   2 -
 37 files changed, 842 insertions(+), 149 deletions(-)
 create mode 100644 tools/perf/arch/arm64/annotate/instructions.c
 create mode 100644 tools/perf/tests/perf-hooks.c
 create mode 100644 tools/perf/util/perf-hooks-list.h
 create mode 100644 tools/perf/util/perf-hooks.c
 create mode 100644 tools/perf/util/perf-hooks.h
 create mode 100644 tools/perf/util/time-utils.c
 create mode 100644 tools/perf/util/time-utils.h

  # uname -a
  Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms            : Ok
   2: Detect openat syscall event                : Ok
   3: Detect openat syscall event on all cpus    : Ok
   4: Read samples using the mmap interface      : Ok
   5: Parse event definition strings             : Ok
   6: PERF_RECORD_* events & perf_sample fields  : Ok
   7: Parse perf pmu format                      : Ok
   8: DSO data read                              : Ok
   9: DSO data cache                             : Ok
  10: DSO data reopen                            : Ok
  11: Roundtrip evsel->name                      : Ok
  12: Parse sched tracepoints fields             : Ok
  13: syscalls:sys_enter_openat event fields     : Ok
  14: Setup struct perf_event_attr               : Ok
  15: Match and link multiple hists              : Ok
  16: 'import perf' in python                    : Ok
  17: Breakpoint overflow signal handler         : Ok
  18: Breakpoint overflow sampling               : Ok
  19: Number of exit events of a simple workload : Ok
  20: Software clock events period values        : Ok
  21: Object code reading                        : Ok
  22: Sample parsing                             : Ok
  23: Use a dummy software event to keep tracking: Ok
  24: Parse with no sample_id_all bit set        : Ok
  25: Filter hist entries                        : Ok
  26: Lookup mmap thread                         : Ok
  27: Share thread mg                            : Ok
  28: Sort output of hist entries                : Ok
  29: Cumulate child hist entries                : Ok
  30: Track with sched_switch                    : Ok
  31: Filter fds with revents mask in a fdarray  : Ok
  32: Add fd to a fdarray, making it autogrow    : Ok
  33: kmod_path__parse                           : Ok
  34: Thread map                                 : Ok
  35: LLVM search and compile                    :
  35.1: Basic BPF llvm compile                    : Ok
  35.2: kbuild searching                          : Ok
  35.3: Compile source for BPF prologue generation: Ok
  35.4: Compile source for BPF relocation         : Ok
  36: Session topology                           : Ok
  37: BPF filter                                 :
  37.1: Basic BPF filtering                      : Ok
  37.2: BPF prologue generation                  : Ok
  37.3: BPF relocation checker                   : Ok
  38: Synthesize thread map                      : Ok
  39: Synthesize cpu map                         : Ok
  40: Synthesize stat config                     : Ok
  41: Synthesize stat                            : Ok
  42: Synthesize stat round                      : Ok
  43: Synthesize attr update                     : Ok
  44: Event times                                : Ok
  45: Read backward ring buffer                  : Ok
  46: Print cpu map                              : Ok
  47: Probe SDT events                           : Ok
  48: is_printable_array                         : Ok
  49: Print bitmap                               : Ok
  50: perf hooks                                 : Ok
  51: x86 rdpmc                                  : Ok
  52: Convert perf time to TSC                   : Ok
  53: DWARF unwind                               : Ok
  54: x86 instruction decoder - new instructions : Ok
  55: Intel cqm nmi context read                 : Skip
  # 
  # uname -a
  Linux zoo 4.7.3-200.fc24.x86_64 #1 SMP Wed Sep 7 17:31:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  # dm
   1 alpine:3.4: Ok
   2 android-ndk:r12b-arm: Ok
   3 archlinux:latest: Ok
   4 centos:5: Ok
   5 centos:6: Ok
   6 centos:7: Ok
   7 debian:7: Ok
   8 debian:8: Ok
   9 debian:experimental: Ok
  10 fedora:20: Ok
  11 fedora:21: Ok
  12 fedora:22: Ok
  13 fedora:23: Ok
  14 fedora:24: Ok
  15 fedora:24-x-ARC-uClibc: Ok
  16 fedora:rawhide: Ok
  17 mageia:5: Ok
  18 opensuse:13.2: Ok
  19 opensuse:42.1: Ok
  20 opensuse:tumbleweed: Ok
  21 ubuntu:12.04.5: Ok
  22 ubuntu:14.04: Ok
  23 ubuntu:14.04.4: Ok
  24 ubuntu:15.10: Ok
  25 ubuntu:16.04: Ok
  26 ubuntu:16.04-x-arm: Ok
  27 ubuntu:16.04-x-arm64: Ok
  28 ubuntu:16.04-x-powerpc: Ok
  29 ubuntu:16.04-x-powerpc64: Ok
  30 ubuntu:16.04-x-powerpc64el: Ok
  31 ubuntu:16.04-x-s390: Ok
  32 ubuntu:16.10: Ok
  #
  $ grep PRETTY_NAME /etc/os-release 
  PRETTY_NAME="Fedora 25 (Workstation Edition)"
  $ 
  $ perf stat make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
               make_no_slang_O: make NO_SLANG=1
             make_util_map_o_O: make util/map.o
                 make_static_O: make LDFLAGS=-static
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
                 make_perf_o_O: make perf.o
           make_no_libunwind_O: make NO_LIBUNWIND=1
              make_no_libelf_O: make NO_LIBELF=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
           make_no_backtrace_O: make NO_BACKTRACE=1
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
            make_no_demangle_O: make NO_DEMANGLE=1
             make_no_libperl_O: make NO_LIBPERL=1
                   make_tags_O: make tags
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
            make_no_auxtrace_O: make NO_AUXTRACE=1
             make_no_libnuma_O: make NO_LIBNUMA=1
            make_install_bin_O: make install-bin
                make_no_newt_O: make NO_NEWT=1
                   make_pure_O: make
                make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
              make_clean_all_O: make clean all
                make_no_gtk2_O: make NO_GTK2=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
         make_install_prefix_O: make install prefix=/tmp/krava
              make_no_libbpf_O: make NO_LIBBPF=1
            make_no_libaudit_O: make NO_LIBAUDIT=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
           make_no_libpython_O: make NO_LIBPYTHON=1
                   make_help_O: make help
                    make_doc_O: make doc
                  make_debug_O: make DEBUG=1
                make_install_O: make install
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $ 
  

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-09-01 16:45 Arnaldo Carvalho de Melo
@ 2016-09-05 13:16 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-09-05 13:16 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Anton Blanchard,
	David Ahern, Hemant Kumar, Jiri Olsa, Masami Hiramatsu,
	Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao,
	Peter Zijlstra, Ravi Bangoria, Shawn Lin, Wang Nan,
	Yauheni Kaliuta, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 36e674a05164cdbb9d4a5b1b0b279fabae6c13bd:
> 
>   Merge tag 'perf-core-for-mingo-20160823' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-08-24 11:08:10 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160901
> 
> for you to fetch changes up to 6243b9dc4c991fe8bdc53a0e029908aef3ddb101:
> 
>   perf probe: Move dwarf specific functions to dwarf-aux.c (2016-09-01 12:42:26 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Support generating cross arch probes, i.e. if you specify a vmlinux
>   file for different arch than the one in the host machine,
> 
> 	 $ perf probe --definition function_name args
> 
>   will generate the probe definition string needed to append to the
>   target machine /sys/kernel/debug/tracing/kprobes_events file, using
>   scripting (Masami Hiramatsu).
> 
> - Make 'perf probe' skip the function prologue in uprobes if program
>   compiled without optimization, using the same strategy as gdb and
>   systemtap uses, fixing a bug where:
> 
> 	$ perf probe -x ./test 'foo i'
> 
>   When 'foo(42)' was used on the "./test" executable would produce i=0
>   instead of the expected i=42 (Ravi Bangoria)
> 
> - Demangle symbols for synthesized @plt entries too (Millian Wolff)
> 
> Documentation:
> 
> - Show default report configuration in 'perf config' example
>   and docs (Millian Wolff)
> 
> Infrastructure:
> 
> - Make 'perf test vmlinux' tolerate the symbol aliasing pruning done when
>   loading kallsyms and vmlinux (Arnaldo Carvalho de Melo)
> 
> - Improve output of 'perf test vmlinux' test, to help identify on the verbose
>   output which lines are warning and which are errors (Arnaldo Carvalho de Melo)
> 
> - Prep work to stop having to pass symbol_filter_t to lots of functions,
>   simplifying symtab loading routines (Arnaldo Carvalho de Melo)
> 
> - Honor symbol_conf.allow_aliases when loading kallsyms as well, it was using
>   it only when loading vmlinux files (Arnaldo Carvalho de Melo)
> 
> - Fixup symbol->end before doing alias pruning when loading symbol tables
>   (Arnaldo Carvalho de Melo)
> 
> - Fix error handling of lzma kernel module decompression (Shawn Lin)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (8):
>       perf annotate: Initialize the priv are in symbol__new()
>       perf symbols: Rename ->ignore to ->idle
>       perf probe: Do not use map_load filters for function
>       perf test vmlinux: Clarify which -v lines are errors or warning
>       perf test vmlinux: Avoid printing headers for empty lists
>       perf test vmlinux: Tolerate symbol aliases
>       perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
>       perf symbols: Fixup symbol sizes before picking best ones
> 
> Masami Hiramatsu (5):
>       perf probe: Remove unused tracing_dir variable
>       perf probe: Show trace event definition
>       perf probe: Ignore vmlinux buildid if offline kernel is given
>       perf probe: Support probing on offline cross-arch binary
>       perf probe: Ignore vmlinux Build-id when offline vmlinux given
> 
> Milian Wolff (2):
>       perf symbols: Demangle symbols for synthesized @plt entries.
>       perf config: Show default report configuration in example and docs
> 
> Ravi Bangoria (3):
>       perf probe: Add helper function to check if probe with variable
>       perf uprobe: Skip prologue if program compiled without optimization
>       perf probe: Move dwarf specific functions to dwarf-aux.c
> 
> Shawn Lin (1):
>       perf tools: Fix error handling of lzma decompression
> 
>  tools/perf/Documentation/perf-config.txt           |   8 +
>  tools/perf/Documentation/perf-probe.txt            |   9 ++
>  tools/perf/Documentation/perfconfig.example        |   9 ++
>  tools/perf/arch/arm/include/dwarf-regs-table.h     |   9 ++
>  tools/perf/arch/arm64/include/dwarf-regs-table.h   |  13 ++
>  tools/perf/arch/powerpc/include/dwarf-regs-table.h |  27 ++++
>  tools/perf/arch/s390/include/dwarf-regs-table.h    |   8 +
>  tools/perf/arch/sh/include/dwarf-regs-table.h      |  25 +++
>  tools/perf/arch/sparc/include/dwarf-regs-table.h   |  18 +++
>  tools/perf/arch/x86/include/dwarf-regs-table.h     |  14 ++
>  tools/perf/arch/xtensa/include/dwarf-regs-table.h  |   8 +
>  tools/perf/builtin-annotate.c                      |   7 +-
>  tools/perf/builtin-probe.c                         |  35 +++-
>  tools/perf/builtin-report.c                        |   6 +-
>  tools/perf/builtin-top.c                           |   8 +-
>  tools/perf/tests/vmlinux-kallsyms.c                |  44 +++--
>  tools/perf/util/Build                              |   1 +
>  tools/perf/util/annotate.c                         |   7 -
>  tools/perf/util/annotate.h                         |   1 -
>  tools/perf/util/dwarf-aux.c                        | 179 +++++++++++++++++++++
>  tools/perf/util/dwarf-aux.h                        |   8 +
>  tools/perf/util/dwarf-regs.c                       |  59 +++++++
>  tools/perf/util/evsel_fprintf.c                    |   4 +-
>  tools/perf/util/include/dwarf-regs.h               |   6 +
>  tools/perf/util/lzma.c                             |  15 +-
>  tools/perf/util/probe-event.c                      | 101 +++++++++---
>  tools/perf/util/probe-event.h                      |   3 +
>  tools/perf/util/probe-file.c                       |   5 +-
>  tools/perf/util/probe-finder.c                     |  60 +++++--
>  tools/perf/util/probe-finder.h                     |   1 +
>  tools/perf/util/symbol-elf.c                       |  86 ++++++----
>  tools/perf/util/symbol.c                           |  30 +++-
>  tools/perf/util/symbol.h                           |   5 +-
>  33 files changed, 698 insertions(+), 121 deletions(-)
>  create mode 100644 tools/perf/arch/arm/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/arm64/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/powerpc/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/s390/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/sh/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/sparc/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/x86/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/arch/xtensa/include/dwarf-regs-table.h
>  create mode 100644 tools/perf/util/dwarf-regs.c
> 
> Build stats:
> 
>   1 alpine:3.4: Ok
>   2 android-ndk:r12b-arm: Ok
>   3 archlinux:latest: Ok
>   4 centos:5: Ok
>   5 centos:6: Ok
>   6 centos:7: Ok
>   7 debian:7: Ok
>   8 debian:8: Ok
>   9 fedora:20: Ok
>  10 fedora:21: Ok
>  11 fedora:22: Ok
>  12 fedora:23: Ok
>  13 fedora:24: Ok
>  14 fedora:24-x-ARC-uClibc: Ok
>  15 fedora:rawhide: Ok
>  16 mageia:5: Ok
>  17 opensuse:13.2: Ok
>  18 opensuse:42.1: Ok
>  19 opensuse:tumbleweed: Ok
>  20 ubuntu:12.04.5: Ok
>  21 ubuntu:14.04.4: Ok
>  22 ubuntu:15.10: Ok
>  23 ubuntu:16.04: Ok
>  24 ubuntu:16.04-x-arm: Ok
>  25 ubuntu:16.04-x-arm64: Ok
>  26 ubuntu:16.04-x-powerpc64: Ok
>  27 ubuntu:16.04-x-powerpc64el: Ok
>  28 ubuntu:16.10: Ok
>  29 ubuntu:16.10-x-s390: Ok

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-09-01 16:45 Arnaldo Carvalho de Melo
  2016-09-05 13:16 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-01 16:45 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Anton Blanchard, David Ahern, Hemant Kumar,
	Jiri Olsa, Masami Hiramatsu, Michael Petlan, Milian Wolff,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Shawn Lin, Wang Nan, Yauheni Kaliuta, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 36e674a05164cdbb9d4a5b1b0b279fabae6c13bd:

  Merge tag 'perf-core-for-mingo-20160823' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-08-24 11:08:10 +0200)

are available in the git repository at:

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

for you to fetch changes up to 6243b9dc4c991fe8bdc53a0e029908aef3ddb101:

  perf probe: Move dwarf specific functions to dwarf-aux.c (2016-09-01 12:42:26 -0300)

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

User visible:

- Support generating cross arch probes, i.e. if you specify a vmlinux
  file for different arch than the one in the host machine,

	 $ perf probe --definition function_name args

  will generate the probe definition string needed to append to the
  target machine /sys/kernel/debug/tracing/kprobes_events file, using
  scripting (Masami Hiramatsu).

- Make 'perf probe' skip the function prologue in uprobes if program
  compiled without optimization, using the same strategy as gdb and
  systemtap uses, fixing a bug where:

	$ perf probe -x ./test 'foo i'

  When 'foo(42)' was used on the "./test" executable would produce i=0
  instead of the expected i=42 (Ravi Bangoria)

- Demangle symbols for synthesized @plt entries too (Millian Wolff)

Documentation:

- Show default report configuration in 'perf config' example
  and docs (Millian Wolff)

Infrastructure:

- Make 'perf test vmlinux' tolerate the symbol aliasing pruning done when
  loading kallsyms and vmlinux (Arnaldo Carvalho de Melo)

- Improve output of 'perf test vmlinux' test, to help identify on the verbose
  output which lines are warning and which are errors (Arnaldo Carvalho de Melo)

- Prep work to stop having to pass symbol_filter_t to lots of functions,
  simplifying symtab loading routines (Arnaldo Carvalho de Melo)

- Honor symbol_conf.allow_aliases when loading kallsyms as well, it was using
  it only when loading vmlinux files (Arnaldo Carvalho de Melo)

- Fixup symbol->end before doing alias pruning when loading symbol tables
  (Arnaldo Carvalho de Melo)

- Fix error handling of lzma kernel module decompression (Shawn Lin)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (8):
      perf annotate: Initialize the priv are in symbol__new()
      perf symbols: Rename ->ignore to ->idle
      perf probe: Do not use map_load filters for function
      perf test vmlinux: Clarify which -v lines are errors or warning
      perf test vmlinux: Avoid printing headers for empty lists
      perf test vmlinux: Tolerate symbol aliases
      perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
      perf symbols: Fixup symbol sizes before picking best ones

Masami Hiramatsu (5):
      perf probe: Remove unused tracing_dir variable
      perf probe: Show trace event definition
      perf probe: Ignore vmlinux buildid if offline kernel is given
      perf probe: Support probing on offline cross-arch binary
      perf probe: Ignore vmlinux Build-id when offline vmlinux given

Milian Wolff (2):
      perf symbols: Demangle symbols for synthesized @plt entries.
      perf config: Show default report configuration in example and docs

Ravi Bangoria (3):
      perf probe: Add helper function to check if probe with variable
      perf uprobe: Skip prologue if program compiled without optimization
      perf probe: Move dwarf specific functions to dwarf-aux.c

Shawn Lin (1):
      perf tools: Fix error handling of lzma decompression

 tools/perf/Documentation/perf-config.txt           |   8 +
 tools/perf/Documentation/perf-probe.txt            |   9 ++
 tools/perf/Documentation/perfconfig.example        |   9 ++
 tools/perf/arch/arm/include/dwarf-regs-table.h     |   9 ++
 tools/perf/arch/arm64/include/dwarf-regs-table.h   |  13 ++
 tools/perf/arch/powerpc/include/dwarf-regs-table.h |  27 ++++
 tools/perf/arch/s390/include/dwarf-regs-table.h    |   8 +
 tools/perf/arch/sh/include/dwarf-regs-table.h      |  25 +++
 tools/perf/arch/sparc/include/dwarf-regs-table.h   |  18 +++
 tools/perf/arch/x86/include/dwarf-regs-table.h     |  14 ++
 tools/perf/arch/xtensa/include/dwarf-regs-table.h  |   8 +
 tools/perf/builtin-annotate.c                      |   7 +-
 tools/perf/builtin-probe.c                         |  35 +++-
 tools/perf/builtin-report.c                        |   6 +-
 tools/perf/builtin-top.c                           |   8 +-
 tools/perf/tests/vmlinux-kallsyms.c                |  44 +++--
 tools/perf/util/Build                              |   1 +
 tools/perf/util/annotate.c                         |   7 -
 tools/perf/util/annotate.h                         |   1 -
 tools/perf/util/dwarf-aux.c                        | 179 +++++++++++++++++++++
 tools/perf/util/dwarf-aux.h                        |   8 +
 tools/perf/util/dwarf-regs.c                       |  59 +++++++
 tools/perf/util/evsel_fprintf.c                    |   4 +-
 tools/perf/util/include/dwarf-regs.h               |   6 +
 tools/perf/util/lzma.c                             |  15 +-
 tools/perf/util/probe-event.c                      | 101 +++++++++---
 tools/perf/util/probe-event.h                      |   3 +
 tools/perf/util/probe-file.c                       |   5 +-
 tools/perf/util/probe-finder.c                     |  60 +++++--
 tools/perf/util/probe-finder.h                     |   1 +
 tools/perf/util/symbol-elf.c                       |  86 ++++++----
 tools/perf/util/symbol.c                           |  30 +++-
 tools/perf/util/symbol.h                           |   5 +-
 33 files changed, 698 insertions(+), 121 deletions(-)
 create mode 100644 tools/perf/arch/arm/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/arm64/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/powerpc/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/s390/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/sh/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/sparc/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/x86/include/dwarf-regs-table.h
 create mode 100644 tools/perf/arch/xtensa/include/dwarf-regs-table.h
 create mode 100644 tools/perf/util/dwarf-regs.c

Build stats:

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

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-07-14  2:20 Arnaldo Carvalho de Melo
@ 2016-07-14  6:58 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-07-14  6:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov,
	Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern,
	Hemant Kumar, Jiri Olsa, Josh Poimboeuf, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Wang Nan, Zefan Li,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> I've added building objtool to most of the containers in my build test setup:
> 
> [root@jouet ~]# perf stat dm
> alpine:3.4: Ok
> centos:5: Ok
> centos:6: Ok
> centos:7: Ok
> debian:7: Ok
> debian:8: Ok
> debian:experimental: Ok
> fedora:21: Ok
> fedora:22: Ok
> fedora:23: Ok
> fedora:24: Ok
> fedora:rawhide: Ok
> mageia:5: Ok
> opensuse:13.2: Ok
> opensuse:42.1: Ok
> ubuntu:12.04.5: Ok
> ubuntu:14.04.4: Ok
> ubuntu:15.10: Ok
> ubuntu:16.04: Ok
> 
>  Performance counter stats for 'dm':
> 
>        2601.121782      task-clock (msec)         #    0.002 CPUs utilized          
>             86,368      context-switches          #    0.033 M/sec                  
>              5,740      cpu-migrations            #    0.002 M/sec                  
>             53,962      page-faults               #    0.021 M/sec                  
>      7,217,605,183      cycles                    #    2.775 GHz                    
>      6,534,540,119      instructions              #    0.91  insn per cycle         
>      1,408,715,184      branches                  #  541.580 M/sec                  
>         18,523,459      branch-misses             #    1.31% of all branches        
> 
>     1541.746171526 seconds time elapsed
> 
> [root@jouet ~]# 
> 
> - Arnaldo
> 
> The following changes since commit 7b39cafb7aa68ef8e32a9f51fbe737d96084ca74:
> 
>   tools: Work around BITS_PER_LONG related build failure in objtool (2016-07-13 09:37:43 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160713
> 
> for you to fetch changes up to 8e5dc848356ecf6ea8d27d641c4d7ad8d42fe92b:
> 
>   perf test: Add a test case for SDT event (2016-07-13 23:09:10 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Finish merging initial SDT (Statically Defined Traces) support, see
>   cset comments for details about how it all works (Masami Hiramatsu)
> 
> - Support attaching eBPF programs to tracepoints (Wang Nan)
> 
> Infrastructure:
> 
> - Fix up BITS_PER_LONG setting (Arnaldo Carvalho de Melo)
> 
> - Add fallback from ELF_C_READ_MMAP to ELF_C_READ in objtool, fixing
>   the build in libelf implementations lacking that elf_begin() cmd,
>   such as Alpine Linux's (Arnaldo Carvalho de Melo)
> 
> - Avoid checking code drift on busybox's diff in objtool (Arnaldo Carvalho de Melo)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (3):
>       tools: Fix up BITS_PER_LONG setting
>       objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ
>       objtool: Avoid checking code drift on busybox's diff
> 
> Masami Hiramatsu (11):
>       perf probe: Fix to show correct error message for $vars and $params
>       perf probe: Accept %sdt and %cached event name
>       perf probe: Make --list show only available cached events
>       perf probe-cache: Add for_each_probe_cache_entry() wrapper
>       perf probe: Allow wildcard for cached events
>       perf probe: Search SDT/cached event from all probe caches
>       perf list: Show SDT and pre-cached events
>       perf probe: Support @BUILDID or @FILE suffix for SDT events
>       perf probe: Support a special SDT probe format
>       perf build: Add sdt feature detection
>       perf test: Add a test case for SDT event
> 
> Wang Nan (5):
>       tools lib bpf: New API to adjust type of a BPF program
>       tools lib bpf: Report error when kernel doesn't support program type
>       perf event parser: Add const qualifier to evt_name and sys_name
>       perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event()
>       perf bpf: Support BPF program attach to tracepoints
> 
>  tools/build/Makefile.feature            |   3 +-
>  tools/build/feature/Makefile            |   6 +-
>  tools/build/feature/test-all.c          |   5 +
>  tools/build/feature/test-sdt.c          |   7 +
>  tools/include/asm-generic/bitsperlong.h |  24 ++-
>  tools/lib/bpf/libbpf.c                  |  80 +++++++--
>  tools/lib/bpf/libbpf.h                  |  10 ++
>  tools/objtool/Makefile                  |   5 +-
>  tools/objtool/elf.c                     |   7 +
>  tools/perf/Documentation/perf-probe.txt |  11 +-
>  tools/perf/Makefile.perf                |   3 +
>  tools/perf/builtin-list.c               |   6 +-
>  tools/perf/builtin-probe.c              |   2 +-
>  tools/perf/config/Makefile              |  10 ++
>  tools/perf/tests/Build                  |   1 +
>  tools/perf/tests/builtin-test.c         |   4 +
>  tools/perf/tests/make                   |   3 +-
>  tools/perf/tests/sdt.c                  | 115 ++++++++++++
>  tools/perf/tests/tests.h                |   1 +
>  tools/perf/util/bpf-loader.c            |  73 +++++++-
>  tools/perf/util/bpf-loader.h            |  12 +-
>  tools/perf/util/build-id.c              |  76 +++++++-
>  tools/perf/util/build-id.h              |   3 +-
>  tools/perf/util/parse-events.c          | 110 ++++++++++--
>  tools/perf/util/parse-events.h          |   4 +-
>  tools/perf/util/probe-event.c           | 309 +++++++++++++++++++++++++++-----
>  tools/perf/util/probe-event.h           |   1 +
>  tools/perf/util/probe-file.c            |  57 ++++--
>  tools/perf/util/probe-file.h            |  14 ++
>  29 files changed, 850 insertions(+), 112 deletions(-)
>  create mode 100644 tools/build/feature/test-sdt.c
>  create mode 100644 tools/perf/tests/sdt.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-07-14  2:20 Arnaldo Carvalho de Melo
  2016-07-14  6:58 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-07-14  2:20 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Brendan Gregg,
	David Ahern, Hemant Kumar, Jiri Olsa, Josh Poimboeuf,
	Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

I've added building objtool to most of the containers in my build test setup:

[root@jouet ~]# perf stat dm
alpine:3.4: Ok
centos:5: Ok
centos:6: Ok
centos:7: Ok
debian:7: Ok
debian:8: Ok
debian:experimental: Ok
fedora:21: Ok
fedora:22: Ok
fedora:23: Ok
fedora:24: Ok
fedora:rawhide: Ok
mageia:5: Ok
opensuse:13.2: Ok
opensuse:42.1: Ok
ubuntu:12.04.5: Ok
ubuntu:14.04.4: Ok
ubuntu:15.10: Ok
ubuntu:16.04: Ok

 Performance counter stats for 'dm':

       2601.121782      task-clock (msec)         #    0.002 CPUs utilized          
            86,368      context-switches          #    0.033 M/sec                  
             5,740      cpu-migrations            #    0.002 M/sec                  
            53,962      page-faults               #    0.021 M/sec                  
     7,217,605,183      cycles                    #    2.775 GHz                    
     6,534,540,119      instructions              #    0.91  insn per cycle         
     1,408,715,184      branches                  #  541.580 M/sec                  
        18,523,459      branch-misses             #    1.31% of all branches        

    1541.746171526 seconds time elapsed

[root@jouet ~]# 

- Arnaldo

The following changes since commit 7b39cafb7aa68ef8e32a9f51fbe737d96084ca74:

  tools: Work around BITS_PER_LONG related build failure in objtool (2016-07-13 09:37:43 +0200)

are available in the git repository at:

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

for you to fetch changes up to 8e5dc848356ecf6ea8d27d641c4d7ad8d42fe92b:

  perf test: Add a test case for SDT event (2016-07-13 23:09:10 -0300)

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

User visible:

- Finish merging initial SDT (Statically Defined Traces) support, see
  cset comments for details about how it all works (Masami Hiramatsu)

- Support attaching eBPF programs to tracepoints (Wang Nan)

Infrastructure:

- Fix up BITS_PER_LONG setting (Arnaldo Carvalho de Melo)

- Add fallback from ELF_C_READ_MMAP to ELF_C_READ in objtool, fixing
  the build in libelf implementations lacking that elf_begin() cmd,
  such as Alpine Linux's (Arnaldo Carvalho de Melo)

- Avoid checking code drift on busybox's diff in objtool (Arnaldo Carvalho de Melo)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
      tools: Fix up BITS_PER_LONG setting
      objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ
      objtool: Avoid checking code drift on busybox's diff

Masami Hiramatsu (11):
      perf probe: Fix to show correct error message for $vars and $params
      perf probe: Accept %sdt and %cached event name
      perf probe: Make --list show only available cached events
      perf probe-cache: Add for_each_probe_cache_entry() wrapper
      perf probe: Allow wildcard for cached events
      perf probe: Search SDT/cached event from all probe caches
      perf list: Show SDT and pre-cached events
      perf probe: Support @BUILDID or @FILE suffix for SDT events
      perf probe: Support a special SDT probe format
      perf build: Add sdt feature detection
      perf test: Add a test case for SDT event

Wang Nan (5):
      tools lib bpf: New API to adjust type of a BPF program
      tools lib bpf: Report error when kernel doesn't support program type
      perf event parser: Add const qualifier to evt_name and sys_name
      perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event()
      perf bpf: Support BPF program attach to tracepoints

 tools/build/Makefile.feature            |   3 +-
 tools/build/feature/Makefile            |   6 +-
 tools/build/feature/test-all.c          |   5 +
 tools/build/feature/test-sdt.c          |   7 +
 tools/include/asm-generic/bitsperlong.h |  24 ++-
 tools/lib/bpf/libbpf.c                  |  80 +++++++--
 tools/lib/bpf/libbpf.h                  |  10 ++
 tools/objtool/Makefile                  |   5 +-
 tools/objtool/elf.c                     |   7 +
 tools/perf/Documentation/perf-probe.txt |  11 +-
 tools/perf/Makefile.perf                |   3 +
 tools/perf/builtin-list.c               |   6 +-
 tools/perf/builtin-probe.c              |   2 +-
 tools/perf/config/Makefile              |  10 ++
 tools/perf/tests/Build                  |   1 +
 tools/perf/tests/builtin-test.c         |   4 +
 tools/perf/tests/make                   |   3 +-
 tools/perf/tests/sdt.c                  | 115 ++++++++++++
 tools/perf/tests/tests.h                |   1 +
 tools/perf/util/bpf-loader.c            |  73 +++++++-
 tools/perf/util/bpf-loader.h            |  12 +-
 tools/perf/util/build-id.c              |  76 +++++++-
 tools/perf/util/build-id.h              |   3 +-
 tools/perf/util/parse-events.c          | 110 ++++++++++--
 tools/perf/util/parse-events.h          |   4 +-
 tools/perf/util/probe-event.c           | 309 +++++++++++++++++++++++++++-----
 tools/perf/util/probe-event.h           |   1 +
 tools/perf/util/probe-file.c            |  57 ++++--
 tools/perf/util/probe-file.h            |  14 ++
 29 files changed, 850 insertions(+), 112 deletions(-)
 create mode 100644 tools/build/feature/test-sdt.c
 create mode 100644 tools/perf/tests/sdt.c

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-06-16  6:29 ` Jiri Olsa
@ 2016-06-16 19:54   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-06-16 19:54 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Ingo Molnar, linux-kernel, Alexander Shishkin,
	Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang,
	Hemant Kumar, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
	Taeung Song, Wang Nan, Arnaldo Carvalho de Melo

Em Thu, Jun 16, 2016 at 08:29:47AM +0200, Jiri Olsa escreveu:
> On Wed, Jun 15, 2016 at 03:13:09PM -0300, Arnaldo Carvalho de Melo wrote:
> 
> SNIP
> 
> > ----------------------------------------------------------------
> > He Kuang (1):
> >       perf unwind: Fix compile error for static cross build
> > 
> > Jiri Olsa (10):
> >       perf mem: Add --ldlat option
> >       perf tools: Fix Data Object sort entry width index
> >       perf tui: Separate hierarchy and standard headers output
> >       perf stdio: Separate headers output
> >       perf stdio: Separate hierarchy headers output
> >       perf stdio: Separate standard headers output
> >       perf stdio: Do not pass hists in hist_entry__fprintf
> >       perf stdio: Add use_callchain parameter to hists__fprintf
> >       perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
> >       perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback
> hi,
> any reason for skipping this one?:
>   perf tools: Rename __hists__add_entry to hists__add_entry

nope, will apply.

- Arnaldo

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-06-15 18:13 Arnaldo Carvalho de Melo
  2016-06-16  6:29 ` Jiri Olsa
@ 2016-06-16  8:29 ` Ingo Molnar
  1 sibling, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-06-16  8:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli,
	Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa,
	Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song,
	Wang Nan, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a:
> 
>   perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86 (2016-06-14 11:16:59 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160615
> 
> for you to fetch changes up to 2fd457a34525ea3bc609e377b46af759af8a7934:
> 
>   perf probe: Add --cache option to cache the probe definitions (2016-06-15 14:34:42 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Add --ldlat option to 'perf mem' to specify load latency for loads
>   event (e.g. cpu/mem-loads/ ) (Jiri Olsa)
> 
> Build fixes:
> 
> - Fix libunwind related compile error for static cross build (He Kuang)
> 
> Infrastructure:
> 
> - UI refactorings to support headers with multiple lines, non-evsel
>   hists browsers, toggle showing callchains, etc (Jiri Olsa)
> 
> - More prep work for caching probe definitions, paving the way
>   for supporting SDT (Statically Defined Traces) userspace probes (Masami Hiramatsu)
> 
> - Handle NULL at perf_config_set__delete() (Taeung Song)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> He Kuang (1):
>       perf unwind: Fix compile error for static cross build
> 
> Jiri Olsa (10):
>       perf mem: Add --ldlat option
>       perf tools: Fix Data Object sort entry width index
>       perf tui: Separate hierarchy and standard headers output
>       perf stdio: Separate headers output
>       perf stdio: Separate hierarchy headers output
>       perf stdio: Separate standard headers output
>       perf stdio: Do not pass hists in hist_entry__fprintf
>       perf stdio: Add use_callchain parameter to hists__fprintf
>       perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
>       perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback
> 
> Masami Hiramatsu (7):
>       perf tools: Fix rm_rf() to handle non-regular files correctly
>       perf probe: Fix to add NULL check for strndup
>       perf buildid: Rename and export build_id_cache__cachedir()
>       perf probe: Add perf_probe_event__copy()
>       perf probe: Uncomment and export synthesize_perf_probe_point()
>       perf probe: Introduce perf_cache interfaces
>       perf probe: Add --cache option to cache the probe definitions
> 
> Taeung Song (1):
>       perf config: Handle NULL at perf_config_set__delete()
> 
>  tools/perf/Documentation/perf-mem.txt   |   3 +
>  tools/perf/Documentation/perf-probe.txt |   4 +
>  tools/perf/builtin-diff.c               |   7 +-
>  tools/perf/builtin-mem.c                |   1 +
>  tools/perf/builtin-probe.c              |   1 +
>  tools/perf/builtin-report.c             |   3 +-
>  tools/perf/builtin-top.c                |   2 +-
>  tools/perf/config/Makefile              |   3 +
>  tools/perf/ui/browsers/hists.c          |  39 ++--
>  tools/perf/ui/gtk/hists.c               |   2 +-
>  tools/perf/ui/hist.c                    |  11 +-
>  tools/perf/ui/stdio/hist.c              | 133 +++++++------
>  tools/perf/util/build-id.c              |  12 +-
>  tools/perf/util/build-id.h              |   2 +
>  tools/perf/util/config.c                |   3 +
>  tools/perf/util/hist.c                  |   2 +-
>  tools/perf/util/hist.h                  |   7 +-
>  tools/perf/util/mem-events.c            |  17 +-
>  tools/perf/util/mem-events.h            |   1 +
>  tools/perf/util/probe-event.c           | 128 ++++++++++--
>  tools/perf/util/probe-event.h           |   5 +
>  tools/perf/util/probe-file.c            | 331 ++++++++++++++++++++++++++++++++
>  tools/perf/util/probe-file.h            |  20 ++
>  tools/perf/util/sort.c                  |  14 +-
>  tools/perf/util/util.c                  |  13 +-
>  25 files changed, 640 insertions(+), 124 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-06-15 18:13 Arnaldo Carvalho de Melo
@ 2016-06-16  6:29 ` Jiri Olsa
  2016-06-16 19:54   ` Arnaldo Carvalho de Melo
  2016-06-16  8:29 ` Ingo Molnar
  1 sibling, 1 reply; 53+ messages in thread
From: Jiri Olsa @ 2016-06-16  6:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Alexander Shishkin,
	Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang,
	Hemant Kumar, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra,
	Taeung Song, Wang Nan, Arnaldo Carvalho de Melo

On Wed, Jun 15, 2016 at 03:13:09PM -0300, Arnaldo Carvalho de Melo wrote:

SNIP

> ----------------------------------------------------------------
> He Kuang (1):
>       perf unwind: Fix compile error for static cross build
> 
> Jiri Olsa (10):
>       perf mem: Add --ldlat option
>       perf tools: Fix Data Object sort entry width index
>       perf tui: Separate hierarchy and standard headers output
>       perf stdio: Separate headers output
>       perf stdio: Separate hierarchy headers output
>       perf stdio: Separate standard headers output
>       perf stdio: Do not pass hists in hist_entry__fprintf
>       perf stdio: Add use_callchain parameter to hists__fprintf
>       perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
>       perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback
hi,
any reason for skipping this one?:
  perf tools: Rename __hists__add_entry to hists__add_entry

thanks,
jirka

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-06-15 18:13 Arnaldo Carvalho de Melo
  2016-06-16  6:29 ` Jiri Olsa
  2016-06-16  8:29 ` Ingo Molnar
  0 siblings, 2 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-06-15 18:13 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin,
	Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang,
	Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a:

  perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86 (2016-06-14 11:16:59 +0200)

are available in the git repository at:

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

for you to fetch changes up to 2fd457a34525ea3bc609e377b46af759af8a7934:

  perf probe: Add --cache option to cache the probe definitions (2016-06-15 14:34:42 -0300)

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

User visible:

- Add --ldlat option to 'perf mem' to specify load latency for loads
  event (e.g. cpu/mem-loads/ ) (Jiri Olsa)

Build fixes:

- Fix libunwind related compile error for static cross build (He Kuang)

Infrastructure:

- UI refactorings to support headers with multiple lines, non-evsel
  hists browsers, toggle showing callchains, etc (Jiri Olsa)

- More prep work for caching probe definitions, paving the way
  for supporting SDT (Statically Defined Traces) userspace probes (Masami Hiramatsu)

- Handle NULL at perf_config_set__delete() (Taeung Song)

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

----------------------------------------------------------------
He Kuang (1):
      perf unwind: Fix compile error for static cross build

Jiri Olsa (10):
      perf mem: Add --ldlat option
      perf tools: Fix Data Object sort entry width index
      perf tui: Separate hierarchy and standard headers output
      perf stdio: Separate headers output
      perf stdio: Separate hierarchy headers output
      perf stdio: Separate standard headers output
      perf stdio: Do not pass hists in hist_entry__fprintf
      perf stdio: Add use_callchain parameter to hists__fprintf
      perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
      perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback

Masami Hiramatsu (7):
      perf tools: Fix rm_rf() to handle non-regular files correctly
      perf probe: Fix to add NULL check for strndup
      perf buildid: Rename and export build_id_cache__cachedir()
      perf probe: Add perf_probe_event__copy()
      perf probe: Uncomment and export synthesize_perf_probe_point()
      perf probe: Introduce perf_cache interfaces
      perf probe: Add --cache option to cache the probe definitions

Taeung Song (1):
      perf config: Handle NULL at perf_config_set__delete()

 tools/perf/Documentation/perf-mem.txt   |   3 +
 tools/perf/Documentation/perf-probe.txt |   4 +
 tools/perf/builtin-diff.c               |   7 +-
 tools/perf/builtin-mem.c                |   1 +
 tools/perf/builtin-probe.c              |   1 +
 tools/perf/builtin-report.c             |   3 +-
 tools/perf/builtin-top.c                |   2 +-
 tools/perf/config/Makefile              |   3 +
 tools/perf/ui/browsers/hists.c          |  39 ++--
 tools/perf/ui/gtk/hists.c               |   2 +-
 tools/perf/ui/hist.c                    |  11 +-
 tools/perf/ui/stdio/hist.c              | 133 +++++++------
 tools/perf/util/build-id.c              |  12 +-
 tools/perf/util/build-id.h              |   2 +
 tools/perf/util/config.c                |   3 +
 tools/perf/util/hist.c                  |   2 +-
 tools/perf/util/hist.h                  |   7 +-
 tools/perf/util/mem-events.c            |  17 +-
 tools/perf/util/mem-events.h            |   1 +
 tools/perf/util/probe-event.c           | 128 ++++++++++--
 tools/perf/util/probe-event.h           |   5 +
 tools/perf/util/probe-file.c            | 331 ++++++++++++++++++++++++++++++++
 tools/perf/util/probe-file.h            |  20 ++
 tools/perf/util/sort.c                  |  14 +-
 tools/perf/util/util.c                  |  13 +-
 25 files changed, 640 insertions(+), 124 deletions(-)

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-04-08 13:15 ` Arnaldo Carvalho de Melo
@ 2016-04-13  6:58   ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-04-13  6:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer,
	David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang,
	Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan,
	Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra,
	pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan,
	Arnaldo Carvalho de Melo


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

> Em Thu, Apr 07, 2016 at 05:58:21PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Hi Ingo,
> > 
> > 	Please consider pulling, build tested on:
> 
> Ingo, if you haven't pulled this one, please pull instead
> perf-core-for-mingo-20160408, which has the same tag text and contents +
> a Tested-by tag from Milian for the unwind thread one and a bisection
> fix one liner for the syscall_tbl generation from Wang,

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-04-07 20:58 Arnaldo Carvalho de Melo
@ 2016-04-08 13:15 ` Arnaldo Carvalho de Melo
  2016-04-13  6:58   ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-08 13:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer,
	David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang,
	Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan,
	Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra,
	pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan,
	Arnaldo Carvalho de Melo

Em Thu, Apr 07, 2016 at 05:58:21PM -0300, Arnaldo Carvalho de Melo escreveu:
> Hi Ingo,
> 
> 	Please consider pulling, build tested on:

Ingo, if you haven't pulled this one, please pull instead
perf-core-for-mingo-20160408, which has the same tag text and contents +
a Tested-by tag from Milian for the unwind thread one and a bisection
fix one liner for the syscall_tbl generation from Wang,

Thanks,

- Arnaldo
 
>   # perf stat -e cycles dm
>   alldeps-ubuntu-12.04: Ok
>   minimal-debian-experimental-x-mips64: Ok
>   minimal-debian-experimental-x-mips64el: Ok
>   minimal-debian-experimental-x-mipsel: Ok
>   minimal-ubuntu-x-arm: Ok
>   minimal-ubuntu-x-arm64: Ok
>   minimal-ubuntu-x-ppc64: Ok
>   minimal-ubuntu-x-ppc64el: Ok
>   alldeps-debian: Ok
>   alldeps-mageia: Ok
>   alldeps-rhel7: Ok
>   alldeps-centos: Ok
>   alldeps-opensuse: Ok
>   alldeps-ubuntu: Ok
> 
>    Performance counter stats for 'dm':
> 
>      3,095,685,547      cycles                                                      
> 
>      454.805537820 seconds time elapsed
> 
>   #
> 
> 	'perf test' passes on fedora23 x86_64,
> 
> Thanks,
> 
> - Arnaldo
> 
> The following changes since commit dad38ca64a252144b4ccdfe9730a3fe2b7c61957:
> 
>   Merge tag 'perf-core-for-mingo-20160401' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-06 08:46:23 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160407
> 
> for you to fetch changes up to 98c3d844cd0bc56d33800114e6b6adcd0a5ec381:
> 
>   perf symbols: Adjust symbol for shared objects (2016-04-07 17:17:01 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Beautify more syscall arguments in 'perf trace', using the type column in
>   tracepoint /format fields to attach, for instance, a pid_t resolver to the
>   thread COMM, also attach a mode_t beautifier in the same fashion
>   (Arnaldo Carvalho de Melo)
> 
> - Build the syscall table id <-> name resolver using the same .tbl file
>   used in the kernel to generate headers, to avoid the delay in getting
>   new syscalls supported in the audit-libs external dependency, done so
>   far only for x86_64 (Arnaldo Carvalho de Melo)
> 
> - Improve the documentation of event specifications (Andi Kleen)
> 
> - Process update events in 'perf script', fixing up this use case:
> 
>     # perf stat -a -I 1000 -e cycles record | perf script -s script.py
> 
> - Shared object symbol adjustment fixes, fixing symbol resolution in
>   Android (Wang Nan)
> 
> Infrastructure:
> 
> - Add dedicated unwind addr_space member into thread struct, to allow
>   tools to use thread->priv, noticed while working on having callchains
>   in 'perf trace' (Jiri Olsa)
> 
> Build fixes:
> 
> - Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (1):
>       perf list: Document event specifications better
> 
> Arnaldo Carvalho de Melo (11):
>       perf probe: Check if dwarf_getlocations() is available
>       perf script perl: Do error checking on new backtrace routine
>       perf trace: Beautify sched_setscheduler 'policy' argument
>       perf trace: Beautify wait4/waitid 'options' argument
>       perf trace: Infrastructure to show COMM strings for syscalls returning PIDs
>       perf trace: Beautify set_tid_address, getpid, getppid return values
>       perf trace: Beautify pid_t arguments
>       perf trace: Beautify mode_t arguments
>       perf trace: Move syscall table id <-> name routines to separate class
>       perf tools: Allow generating per-arch syscall table arrays
>       perf tools: Build syscall table .c header from kernel's syscall_64.tbl
> 
> Jiri Olsa (4):
>       perf tools: Remove superfluous ARCH Makefile includes
>       perf tools: Introduce trim function
>       perf tools: Add dedicated unwind addr_space member into thread struct
>       perf script: Process event update events
> 
> Vinson Lee (1):
>       perf config: Fix build with older toolchain.
> 
> Wang Nan (2):
>       perf symbols: Record text offset in dso to calculate objdump address
>       perf symbols: Adjust symbol for shared objects
> 
>  tools/build/Makefile.feature                       |   2 +
>  tools/build/feature/Makefile                       |   4 +
>  tools/build/feature/test-all.c                     |   5 +
>  tools/build/feature/test-dwarf_getlocations.c      |  12 +
>  tools/perf/Documentation/perf-list.txt             | 107 +++++-
>  tools/perf/Makefile.perf                           |  13 +-
>  tools/perf/arch/x86/Makefile                       |  23 ++
>  tools/perf/arch/x86/entry/syscalls/syscall_64.tbl  | 374 +++++++++++++++++++++
>  tools/perf/arch/x86/entry/syscalls/syscalltbl.sh   |  39 +++
>  tools/perf/builtin-script.c                        |   1 +
>  tools/perf/builtin-trace.c                         | 156 +++++----
>  tools/perf/config/Makefile                         |  11 +-
>  tools/perf/trace/beauty/mode_t.c                   |  68 ++++
>  tools/perf/trace/beauty/pid.c                      |  18 +
>  tools/perf/trace/beauty/sched_policy.c             |  44 +++
>  tools/perf/trace/beauty/waitid_options.c           |  26 ++
>  tools/perf/ui/browsers/hists.c                     |   3 +-
>  tools/perf/ui/stdio/hist.c                         |   3 +-
>  tools/perf/util/Build                              |   5 +
>  tools/perf/util/config.c                           |   6 +-
>  tools/perf/util/dwarf-aux.c                        |   9 +
>  tools/perf/util/map.c                              |  14 +
>  .../perf/util/scripting-engines/trace-event-perl.c |  30 +-
>  tools/perf/util/symbol-elf.c                       |  13 +-
>  tools/perf/util/syscalltbl.c                       | 134 ++++++++
>  tools/perf/util/syscalltbl.h                       |  20 ++
>  tools/perf/util/thread.h                           |   6 +
>  tools/perf/util/unwind-libunwind.c                 |  25 +-
>  tools/perf/util/util.h                             |   5 +
>  29 files changed, 1060 insertions(+), 116 deletions(-)
>  create mode 100644 tools/build/feature/test-dwarf_getlocations.c
>  create mode 100644 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
>  create mode 100755 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
>  create mode 100644 tools/perf/trace/beauty/mode_t.c
>  create mode 100644 tools/perf/trace/beauty/pid.c
>  create mode 100644 tools/perf/trace/beauty/sched_policy.c
>  create mode 100644 tools/perf/trace/beauty/waitid_options.c
>  create mode 100644 tools/perf/util/syscalltbl.c
>  create mode 100644 tools/perf/util/syscalltbl.h

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-04-07 20:58 Arnaldo Carvalho de Melo
  2016-04-08 13:15 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-07 20:58 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexei Starovoitov, Andi Kleen,
	Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan,
	Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf,
	Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff,
	Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt,
	Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, build tested on:

  # perf stat -e cycles dm
  alldeps-ubuntu-12.04: Ok
  minimal-debian-experimental-x-mips64: Ok
  minimal-debian-experimental-x-mips64el: Ok
  minimal-debian-experimental-x-mipsel: Ok
  minimal-ubuntu-x-arm: Ok
  minimal-ubuntu-x-arm64: Ok
  minimal-ubuntu-x-ppc64: Ok
  minimal-ubuntu-x-ppc64el: Ok
  alldeps-debian: Ok
  alldeps-mageia: Ok
  alldeps-rhel7: Ok
  alldeps-centos: Ok
  alldeps-opensuse: Ok
  alldeps-ubuntu: Ok

   Performance counter stats for 'dm':

     3,095,685,547      cycles                                                      

     454.805537820 seconds time elapsed

  #

	'perf test' passes on fedora23 x86_64,

Thanks,

- Arnaldo

The following changes since commit dad38ca64a252144b4ccdfe9730a3fe2b7c61957:

  Merge tag 'perf-core-for-mingo-20160401' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-06 08:46:23 +0200)

are available in the git repository at:

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

for you to fetch changes up to 98c3d844cd0bc56d33800114e6b6adcd0a5ec381:

  perf symbols: Adjust symbol for shared objects (2016-04-07 17:17:01 -0300)

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

User visible:

- Beautify more syscall arguments in 'perf trace', using the type column in
  tracepoint /format fields to attach, for instance, a pid_t resolver to the
  thread COMM, also attach a mode_t beautifier in the same fashion
  (Arnaldo Carvalho de Melo)

- Build the syscall table id <-> name resolver using the same .tbl file
  used in the kernel to generate headers, to avoid the delay in getting
  new syscalls supported in the audit-libs external dependency, done so
  far only for x86_64 (Arnaldo Carvalho de Melo)

- Improve the documentation of event specifications (Andi Kleen)

- Process update events in 'perf script', fixing up this use case:

    # perf stat -a -I 1000 -e cycles record | perf script -s script.py

- Shared object symbol adjustment fixes, fixing symbol resolution in
  Android (Wang Nan)

Infrastructure:

- Add dedicated unwind addr_space member into thread struct, to allow
  tools to use thread->priv, noticed while working on having callchains
  in 'perf trace' (Jiri Olsa)

Build fixes:

- Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee)

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

----------------------------------------------------------------
Andi Kleen (1):
      perf list: Document event specifications better

Arnaldo Carvalho de Melo (11):
      perf probe: Check if dwarf_getlocations() is available
      perf script perl: Do error checking on new backtrace routine
      perf trace: Beautify sched_setscheduler 'policy' argument
      perf trace: Beautify wait4/waitid 'options' argument
      perf trace: Infrastructure to show COMM strings for syscalls returning PIDs
      perf trace: Beautify set_tid_address, getpid, getppid return values
      perf trace: Beautify pid_t arguments
      perf trace: Beautify mode_t arguments
      perf trace: Move syscall table id <-> name routines to separate class
      perf tools: Allow generating per-arch syscall table arrays
      perf tools: Build syscall table .c header from kernel's syscall_64.tbl

Jiri Olsa (4):
      perf tools: Remove superfluous ARCH Makefile includes
      perf tools: Introduce trim function
      perf tools: Add dedicated unwind addr_space member into thread struct
      perf script: Process event update events

Vinson Lee (1):
      perf config: Fix build with older toolchain.

Wang Nan (2):
      perf symbols: Record text offset in dso to calculate objdump address
      perf symbols: Adjust symbol for shared objects

 tools/build/Makefile.feature                       |   2 +
 tools/build/feature/Makefile                       |   4 +
 tools/build/feature/test-all.c                     |   5 +
 tools/build/feature/test-dwarf_getlocations.c      |  12 +
 tools/perf/Documentation/perf-list.txt             | 107 +++++-
 tools/perf/Makefile.perf                           |  13 +-
 tools/perf/arch/x86/Makefile                       |  23 ++
 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl  | 374 +++++++++++++++++++++
 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh   |  39 +++
 tools/perf/builtin-script.c                        |   1 +
 tools/perf/builtin-trace.c                         | 156 +++++----
 tools/perf/config/Makefile                         |  11 +-
 tools/perf/trace/beauty/mode_t.c                   |  68 ++++
 tools/perf/trace/beauty/pid.c                      |  18 +
 tools/perf/trace/beauty/sched_policy.c             |  44 +++
 tools/perf/trace/beauty/waitid_options.c           |  26 ++
 tools/perf/ui/browsers/hists.c                     |   3 +-
 tools/perf/ui/stdio/hist.c                         |   3 +-
 tools/perf/util/Build                              |   5 +
 tools/perf/util/config.c                           |   6 +-
 tools/perf/util/dwarf-aux.c                        |   9 +
 tools/perf/util/map.c                              |  14 +
 .../perf/util/scripting-engines/trace-event-perl.c |  30 +-
 tools/perf/util/symbol-elf.c                       |  13 +-
 tools/perf/util/syscalltbl.c                       | 134 ++++++++
 tools/perf/util/syscalltbl.h                       |  20 ++
 tools/perf/util/thread.h                           |   6 +
 tools/perf/util/unwind-libunwind.c                 |  25 +-
 tools/perf/util/util.h                             |   5 +
 29 files changed, 1060 insertions(+), 116 deletions(-)
 create mode 100644 tools/build/feature/test-dwarf_getlocations.c
 create mode 100644 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
 create mode 100755 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
 create mode 100644 tools/perf/trace/beauty/mode_t.c
 create mode 100644 tools/perf/trace/beauty/pid.c
 create mode 100644 tools/perf/trace/beauty/sched_policy.c
 create mode 100644 tools/perf/trace/beauty/waitid_options.c
 create mode 100644 tools/perf/util/syscalltbl.c
 create mode 100644 tools/perf/util/syscalltbl.h

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-03-10 21:04 Arnaldo Carvalho de Melo
@ 2016-03-11  8:43 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-03-11  8:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Borislav Petkov, Chris Phlipot, Colin Ian King, David Ahern,
	Davidlohr Bueso, He Kuang, H . Peter Anvin, Jiri Olsa,
	Mel Gorman, Namhyung Kim, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, Thomas Gleixner, Wang Nan,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 3a99e6db539e53cc9c79282e80f8362b0cb96ac8:
> 
>   perf bench mem: Prepare the x86-64 build for upstream memcpy_mcsafe() changes (2016-03-09 10:40:01 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160310
> 
> for you to fetch changes up to 206cab651d07563d766c7f4cb73f858c5df3dec5:
> 
>   perf stat: Add --metric-only support for -A (2016-03-10 16:50:47 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Implement 'perf stat --metric-only' (Andi Kleen)
> 
> - Fix perf script python database export crash (Chris Phlipot)
> 
> Infrastructure:
> 
> - perf top/report --hierarchy assorted fixes for problems introduced in this
>   perf/core cycle (Namhyung Kim)
> 
> - Support '~' operation in libtraceevent (Steven Rosted)
> 
> Build fixes:
> 
> - Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF
>   devel files are not installed (Arnaldo Carvalho de Melo)
> 
> - Do not try building jitdump on unsupported arches (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (3):
>       perf stat: Document CSV format in manpage
>       perf stat: Implement --metric-only mode
>       perf stat: Add --metric-only support for -A
> 
> Arnaldo Carvalho de Melo (1):
>       perf jitdump: DWARF is also needed
> 
> Chris Phlipot (1):
>       perf tools: Fix perf script python database export crash
> 
> Jiri Olsa (3):
>       perf tools: Pass perf_hpp_list all the way through setup_sort_list
>       perf tools: Omit unnecessary cast in perf_pmu__parse_scale
>       perf jitdump: Build only on supported archs
> 
> Namhyung Kim (10):
>       perf tools: Fix hist_entry__filter() for hierarchy
>       perf tools: Add more sort entry check functions
>       perf tools: Fix command line filters in hierarchy mode
>       perf tools: Remove hist_entry->fmt field
>       perf hists browser: Cleanup hist_browser__fprintf_hierarchy_entry()
>       perf tools: Remove nr_sort_keys field
>       perf tools: Recalc total periods using top-level entries in hierarchy
>       perf tools: Add sort__has_comm variable
>       perf hists browser: Allow thread filtering for comm sort key
>       perf hists browser: Check sort keys before hot key actions
> 
> Steven Rostedt (1):
>       tools lib traceevent: Add '~' operation within arg_num_eval()
> 
>  tools/lib/traceevent/event-parse.c     |   6 +
>  tools/perf/Documentation/perf-stat.txt |  27 ++++
>  tools/perf/arch/arm/Makefile           |   1 +
>  tools/perf/arch/arm64/Makefile         |   1 +
>  tools/perf/arch/powerpc/Makefile       |   1 +
>  tools/perf/arch/x86/Makefile           |   1 +
>  tools/perf/builtin-inject.c            |  12 +-
>  tools/perf/builtin-stat.c              | 244 +++++++++++++++++++++++++++++++--
>  tools/perf/config/Makefile             |   7 +
>  tools/perf/ui/browsers/hists.c         |  73 ++++++----
>  tools/perf/ui/hist.c                   |   3 -
>  tools/perf/util/Build                  |   3 +
>  tools/perf/util/evsel.h                |   6 +-
>  tools/perf/util/hist.c                 | 144 +++++++++++++++++--
>  tools/perf/util/hist.h                 |   6 +-
>  tools/perf/util/pmu.c                  |   4 +-
>  tools/perf/util/sort.c                 | 147 +++++++++-----------
>  tools/perf/util/sort.h                 |   2 +-
>  18 files changed, 542 insertions(+), 146 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-03-10 21:04 Arnaldo Carvalho de Melo
  2016-03-11  8:43 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-03-10 21:04 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Borislav Petkov, Chris Phlipot,
	Colin Ian King, David Ahern, Davidlohr Bueso, He Kuang,
	H . Peter Anvin, Jiri Olsa, Mel Gorman, Namhyung Kim,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt,
	Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 3a99e6db539e53cc9c79282e80f8362b0cb96ac8:

  perf bench mem: Prepare the x86-64 build for upstream memcpy_mcsafe() changes (2016-03-09 10:40:01 +0100)

are available in the git repository at:

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

for you to fetch changes up to 206cab651d07563d766c7f4cb73f858c5df3dec5:

  perf stat: Add --metric-only support for -A (2016-03-10 16:50:47 -0300)

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

User visible:

- Implement 'perf stat --metric-only' (Andi Kleen)

- Fix perf script python database export crash (Chris Phlipot)

Infrastructure:

- perf top/report --hierarchy assorted fixes for problems introduced in this
  perf/core cycle (Namhyung Kim)

- Support '~' operation in libtraceevent (Steven Rosted)

Build fixes:

- Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF
  devel files are not installed (Arnaldo Carvalho de Melo)

- Do not try building jitdump on unsupported arches (Jiri Olsa)

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

----------------------------------------------------------------
Andi Kleen (3):
      perf stat: Document CSV format in manpage
      perf stat: Implement --metric-only mode
      perf stat: Add --metric-only support for -A

Arnaldo Carvalho de Melo (1):
      perf jitdump: DWARF is also needed

Chris Phlipot (1):
      perf tools: Fix perf script python database export crash

Jiri Olsa (3):
      perf tools: Pass perf_hpp_list all the way through setup_sort_list
      perf tools: Omit unnecessary cast in perf_pmu__parse_scale
      perf jitdump: Build only on supported archs

Namhyung Kim (10):
      perf tools: Fix hist_entry__filter() for hierarchy
      perf tools: Add more sort entry check functions
      perf tools: Fix command line filters in hierarchy mode
      perf tools: Remove hist_entry->fmt field
      perf hists browser: Cleanup hist_browser__fprintf_hierarchy_entry()
      perf tools: Remove nr_sort_keys field
      perf tools: Recalc total periods using top-level entries in hierarchy
      perf tools: Add sort__has_comm variable
      perf hists browser: Allow thread filtering for comm sort key
      perf hists browser: Check sort keys before hot key actions

Steven Rostedt (1):
      tools lib traceevent: Add '~' operation within arg_num_eval()

 tools/lib/traceevent/event-parse.c     |   6 +
 tools/perf/Documentation/perf-stat.txt |  27 ++++
 tools/perf/arch/arm/Makefile           |   1 +
 tools/perf/arch/arm64/Makefile         |   1 +
 tools/perf/arch/powerpc/Makefile       |   1 +
 tools/perf/arch/x86/Makefile           |   1 +
 tools/perf/builtin-inject.c            |  12 +-
 tools/perf/builtin-stat.c              | 244 +++++++++++++++++++++++++++++++--
 tools/perf/config/Makefile             |   7 +
 tools/perf/ui/browsers/hists.c         |  73 ++++++----
 tools/perf/ui/hist.c                   |   3 -
 tools/perf/util/Build                  |   3 +
 tools/perf/util/evsel.h                |   6 +-
 tools/perf/util/hist.c                 | 144 +++++++++++++++++--
 tools/perf/util/hist.h                 |   6 +-
 tools/perf/util/pmu.c                  |   4 +-
 tools/perf/util/sort.c                 | 147 +++++++++-----------
 tools/perf/util/sort.h                 |   2 +-
 18 files changed, 542 insertions(+), 146 deletions(-)

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-02-26 23:18 Arnaldo Carvalho de Melo
@ 2016-02-27  9:36 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-02-27  9:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Andi Kleen,
	David Ahern, Jiri Olsa, Kan Liang, Li Zefan, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Stephane Eranian,
	Taeung Song, Wang Nan, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 06466212a69c0511c5dcff7363c207ffc8913731:
> 
>   Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-25 08:20:56 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160226
> 
> for you to fetch changes up to 1d6c9407d45dd622b277ca9f725da3cc9e95b5de:
> 
>   perf trace: Print content of bpf-output event (2016-02-26 19:57:07 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Show extra line telling no entries below --percent-limit are
>   at that --hierarchy level (Namhyung Kim)
> 
> - 'perf report/top --hierarchy' assorted alignment fixes (Namhyung Kim)
> 
> - Handle empty print fmts in 'perf script -s' i.e. when running
>   python or perl scripts (Taeung Song)
> 
> - Improve support for bpf-output events in 'perf trace' (Wang Nan)
> 
> - Fix parsing of pmu events with empty list of modifiers, this
>   cures a perf/core-only regression where '-e intel_pt//' got
>   broken (Arnaldo Carvalho de Melo)
> 
> Infrastructure:
> 
> - Improve missing OpenJDK devel files error message in jvmti
>   Makefile (Stephane Eranian)
> 
> - Remove duplicated code and needless script_spec__findnew() (Taeung Song)
> 
> - Bring perf_default_config to the very beginning at main(), removing
>   the need for each subcommand to do this (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf tools: Use asprintf() for simple string formatting/allocation
>       perf tools: Fix parsing of pmu events with empty list of modifiers
> 
> Namhyung Kim (10):
>       perf hists: Add more helper functions for the hierarchy mode
>       perf report: Show message for percent limit on stdio
>       perf hists browser: Cleanup hist_browser__update_percent_limit()
>       perf hists browser: Show message for percent limit
>       perf report: Show message for percent limit on gtk
>       perf hists: Fix comparing of dynamic entries
>       perf report: Fix indentation of dynamic entries in hierarchy
>       perf report: Left align dynamic entries in hierarchy
>       perf hists: Fix dynamic entry display in hierarchy
>       perf report: Update column width of dynamic entries
> 
> Stephane Eranian (1):
>       perf jvmti: improve error message in Makefile
> 
> Taeung Song (2):
>       perf script: Exception handling when the print fmt is empty
>       perf script: Remove duplicated code and needless script_spec__findnew()
> 
> Wang Nan (4):
>       perf config: Bring perf_default_config to the very beginning at main()
>       perf tools: Only set filter for tracepoints events
>       perf trace: Call bpf__apply_obj_config in 'perf trace'
>       perf trace: Print content of bpf-output event
> 
>  tools/perf/builtin-diff.c                          |   2 -
>  tools/perf/builtin-help.c                          |   2 +-
>  tools/perf/builtin-kmem.c                          |   4 +-
>  tools/perf/builtin-report.c                        |   2 +-
>  tools/perf/builtin-script.c                        |  21 +---
>  tools/perf/builtin-top.c                           |   4 +-
>  tools/perf/builtin-trace.c                         |  46 +++++++-
>  tools/perf/jvmti/Makefile                          |  17 ++-
>  tools/perf/perf.c                                  |  16 ++-
>  tools/perf/tests/llvm.c                            |   8 --
>  tools/perf/ui/browsers/hists.c                     | 128 +++++++++++++++++++--
>  tools/perf/ui/gtk/hists.c                          |  11 ++
>  tools/perf/ui/hist.c                               |  22 ++++
>  tools/perf/ui/stdio/hist.c                         |  49 ++++++--
>  tools/perf/util/color.c                            |   5 +-
>  tools/perf/util/data-convert-bt.c                  |   2 +-
>  tools/perf/util/evlist.c                           |   3 +
>  tools/perf/util/help-unknown-cmd.c                 |   5 +-
>  tools/perf/util/hist.c                             |  48 +++++++-
>  tools/perf/util/hist.h                             |   4 +
>  tools/perf/util/parse-events.y                     |   6 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |   3 +
>  .../util/scripting-engines/trace-event-python.c    |   3 +
>  tools/perf/util/sort.c                             |  30 ++++-
>  tools/perf/util/sort.h                             |   1 +
>  25 files changed, 363 insertions(+), 79 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-02-26 23:18 Arnaldo Carvalho de Melo
  2016-02-27  9:36 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-26 23:18 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, Andi Kleen, David Ahern, Jiri Olsa,
	Kan Liang, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, pi3orama, Stephane Eranian, Taeung Song,
	Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 06466212a69c0511c5dcff7363c207ffc8913731:

  Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-25 08:20:56 +0100)

are available in the git repository at:

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

for you to fetch changes up to 1d6c9407d45dd622b277ca9f725da3cc9e95b5de:

  perf trace: Print content of bpf-output event (2016-02-26 19:57:07 -0300)

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

User visible:

- Show extra line telling no entries below --percent-limit are
  at that --hierarchy level (Namhyung Kim)

- 'perf report/top --hierarchy' assorted alignment fixes (Namhyung Kim)

- Handle empty print fmts in 'perf script -s' i.e. when running
  python or perl scripts (Taeung Song)

- Improve support for bpf-output events in 'perf trace' (Wang Nan)

- Fix parsing of pmu events with empty list of modifiers, this
  cures a perf/core-only regression where '-e intel_pt//' got
  broken (Arnaldo Carvalho de Melo)

Infrastructure:

- Improve missing OpenJDK devel files error message in jvmti
  Makefile (Stephane Eranian)

- Remove duplicated code and needless script_spec__findnew() (Taeung Song)

- Bring perf_default_config to the very beginning at main(), removing
  the need for each subcommand to do this (Wang Nan)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf tools: Use asprintf() for simple string formatting/allocation
      perf tools: Fix parsing of pmu events with empty list of modifiers

Namhyung Kim (10):
      perf hists: Add more helper functions for the hierarchy mode
      perf report: Show message for percent limit on stdio
      perf hists browser: Cleanup hist_browser__update_percent_limit()
      perf hists browser: Show message for percent limit
      perf report: Show message for percent limit on gtk
      perf hists: Fix comparing of dynamic entries
      perf report: Fix indentation of dynamic entries in hierarchy
      perf report: Left align dynamic entries in hierarchy
      perf hists: Fix dynamic entry display in hierarchy
      perf report: Update column width of dynamic entries

Stephane Eranian (1):
      perf jvmti: improve error message in Makefile

Taeung Song (2):
      perf script: Exception handling when the print fmt is empty
      perf script: Remove duplicated code and needless script_spec__findnew()

Wang Nan (4):
      perf config: Bring perf_default_config to the very beginning at main()
      perf tools: Only set filter for tracepoints events
      perf trace: Call bpf__apply_obj_config in 'perf trace'
      perf trace: Print content of bpf-output event

 tools/perf/builtin-diff.c                          |   2 -
 tools/perf/builtin-help.c                          |   2 +-
 tools/perf/builtin-kmem.c                          |   4 +-
 tools/perf/builtin-report.c                        |   2 +-
 tools/perf/builtin-script.c                        |  21 +---
 tools/perf/builtin-top.c                           |   4 +-
 tools/perf/builtin-trace.c                         |  46 +++++++-
 tools/perf/jvmti/Makefile                          |  17 ++-
 tools/perf/perf.c                                  |  16 ++-
 tools/perf/tests/llvm.c                            |   8 --
 tools/perf/ui/browsers/hists.c                     | 128 +++++++++++++++++++--
 tools/perf/ui/gtk/hists.c                          |  11 ++
 tools/perf/ui/hist.c                               |  22 ++++
 tools/perf/ui/stdio/hist.c                         |  49 ++++++--
 tools/perf/util/color.c                            |   5 +-
 tools/perf/util/data-convert-bt.c                  |   2 +-
 tools/perf/util/evlist.c                           |   3 +
 tools/perf/util/help-unknown-cmd.c                 |   5 +-
 tools/perf/util/hist.c                             |  48 +++++++-
 tools/perf/util/hist.h                             |   4 +
 tools/perf/util/parse-events.y                     |   6 +-
 .../perf/util/scripting-engines/trace-event-perl.c |   3 +
 .../util/scripting-engines/trace-event-python.c    |   3 +
 tools/perf/util/sort.c                             |  30 ++++-
 tools/perf/util/sort.h                             |   1 +
 25 files changed, 363 insertions(+), 79 deletions(-)

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2016-02-05 16:25 Arnaldo Carvalho de Melo
@ 2016-02-09  9:40 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2016-02-09  9:40 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Carl Love, David Ahern,
	Jiri Olsa, John McCutchan, Marcin Ślusarz, Namhyung Kim,
	Pawel Moll, Peter Zijlstra, Sonny Rao, Stephane Eranian,
	Sukadev Bhattiprolu, Taeung Song, Wang Nan,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit d3aaf09f889b31f3b424bf9603b163ec1204c361:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-04 08:58:01 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 598b7c6919c7bbcc1243009721a01bc12275ff3e:
> 
>   perf jit: add source line info support (2016-02-05 12:33:09 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible fixes:
> 
> - Handle spaces in file names obtained from /proc/pid/maps (Marcin Ślusarz)
> 
> New features:
> 
> - Improved support for java, using the JVMTI agent library to do jitdumps
>   that then will be inserted in synthesized PERF_RECORD_MMAP2 events via
>   'perf inject' pointed to synthesized ELF files stored in ~/.debug and
>   keyed with build-ids, to allow symbol resolution and even annotation with
>   source line info, see the changeset comments to see how to use it (Stephane Eranian)
> 
> Documentation:
> 
> - Document mmore variables in the 'perf config' man page (Taeung Song)
> 
> Infrastructure:
> 
> - Improve a bit the 'make -C tools/perf build-test' output (Arnaldo Carvalho de Melo)
> 
> - Do 'build-test' in parallell, using 'make -j' (Arnaldo Carvalho de Melo)
> 
> - Fix handling of 'clean' in multi-target make invokations for parallell builds (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (4):
>       perf build tests: Elide "-f Makefile" from make invokation
>       perf build tests: Move the feature related vars to the front of the make cmdline
>       perf build tests: Do parallell builds with 'build-test'
>       perf inject: Make sure mmap records are ordered when injecting build_ids
> 
> Jiri Olsa (1):
>       perf tools: Fix parallel build including 'clean' target
> 
> Marcin Ślusarz (1):
>       perf tools: handle spaces in file names obtained from /proc/pid/maps
> 
> Stephane Eranian (5):
>       perf symbols: add Java demangling support
>       perf build: Add libcrypto feature detection
>       perf inject: Add jitdump mmap injection support
>       perf tools: add JVMTI agent library
>       perf jit: add source line info support
> 
> Taeung Song (8):
>       perf config: Document 'ui.show-headers' variable in man page
>       perf config: Document variables for 'call-graph' section in man page
>       perf config: Document variables for 'report' section in man page
>       perf config: Document 'top.children' variable in man page
>       perf config: Document 'man.viewer' variable in man page
>       perf config: Document 'pager.<subcommand>' variables in man page
>       perf config: Document 'kmem.default' variable in man page
>       perf config: Document 'record.build-id' variable in man page
> 
>  tools/build/Makefile.feature             |   2 +
>  tools/build/feature/Makefile             |   4 +
>  tools/build/feature/test-all.c           |   5 +
>  tools/build/feature/test-libcrypto.c     |  17 +
>  tools/perf/Documentation/perf-config.txt | 143 +++++++
>  tools/perf/Documentation/perf-inject.txt |   7 +
>  tools/perf/Makefile                      |  16 +-
>  tools/perf/Makefile.perf                 |   3 +
>  tools/perf/builtin-inject.c              | 107 ++++-
>  tools/perf/config/Makefile               |  11 +
>  tools/perf/jvmti/Makefile                |  76 ++++
>  tools/perf/jvmti/jvmti_agent.c           | 465 +++++++++++++++++++++
>  tools/perf/jvmti/jvmti_agent.h           |  36 ++
>  tools/perf/jvmti/libjvmti.c              | 304 ++++++++++++++
>  tools/perf/tests/make                    |  11 +-
>  tools/perf/util/Build                    |   6 +
>  tools/perf/util/demangle-java.c          | 199 +++++++++
>  tools/perf/util/demangle-java.h          |  10 +
>  tools/perf/util/event.c                  |   2 +-
>  tools/perf/util/genelf.c                 | 449 +++++++++++++++++++++
>  tools/perf/util/genelf.h                 |  67 +++
>  tools/perf/util/genelf_debug.c           | 610 ++++++++++++++++++++++++++++
>  tools/perf/util/jit.h                    |  15 +
>  tools/perf/util/jitdump.c                | 672 +++++++++++++++++++++++++++++++
>  tools/perf/util/jitdump.h                | 124 ++++++
>  tools/perf/util/symbol-elf.c             |   3 +
>  26 files changed, 3357 insertions(+), 7 deletions(-)
>  create mode 100644 tools/build/feature/test-libcrypto.c
>  create mode 100644 tools/perf/jvmti/Makefile
>  create mode 100644 tools/perf/jvmti/jvmti_agent.c
>  create mode 100644 tools/perf/jvmti/jvmti_agent.h
>  create mode 100644 tools/perf/jvmti/libjvmti.c
>  create mode 100644 tools/perf/util/demangle-java.c
>  create mode 100644 tools/perf/util/demangle-java.h
>  create mode 100644 tools/perf/util/genelf.c
>  create mode 100644 tools/perf/util/genelf.h
>  create mode 100644 tools/perf/util/genelf_debug.c
>  create mode 100644 tools/perf/util/jit.h
>  create mode 100644 tools/perf/util/jitdump.c
>  create mode 100644 tools/perf/util/jitdump.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2016-02-05 16:25 Arnaldo Carvalho de Melo
  2016-02-09  9:40 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan,
	Marcin Ślusarz, Namhyung Kim, Pawel Moll, Peter Zijlstra,
	Sonny Rao, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song,
	Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit d3aaf09f889b31f3b424bf9603b163ec1204c361:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-04 08:58:01 +0100)

are available in the git repository at:

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

for you to fetch changes up to 598b7c6919c7bbcc1243009721a01bc12275ff3e:

  perf jit: add source line info support (2016-02-05 12:33:09 -0300)

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

User visible fixes:

- Handle spaces in file names obtained from /proc/pid/maps (Marcin Ślusarz)

New features:

- Improved support for java, using the JVMTI agent library to do jitdumps
  that then will be inserted in synthesized PERF_RECORD_MMAP2 events via
  'perf inject' pointed to synthesized ELF files stored in ~/.debug and
  keyed with build-ids, to allow symbol resolution and even annotation with
  source line info, see the changeset comments to see how to use it (Stephane Eranian)

Documentation:

- Document mmore variables in the 'perf config' man page (Taeung Song)

Infrastructure:

- Improve a bit the 'make -C tools/perf build-test' output (Arnaldo Carvalho de Melo)

- Do 'build-test' in parallell, using 'make -j' (Arnaldo Carvalho de Melo)

- Fix handling of 'clean' in multi-target make invokations for parallell builds (Jiri Olsa)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (4):
      perf build tests: Elide "-f Makefile" from make invokation
      perf build tests: Move the feature related vars to the front of the make cmdline
      perf build tests: Do parallell builds with 'build-test'
      perf inject: Make sure mmap records are ordered when injecting build_ids

Jiri Olsa (1):
      perf tools: Fix parallel build including 'clean' target

Marcin Ślusarz (1):
      perf tools: handle spaces in file names obtained from /proc/pid/maps

Stephane Eranian (5):
      perf symbols: add Java demangling support
      perf build: Add libcrypto feature detection
      perf inject: Add jitdump mmap injection support
      perf tools: add JVMTI agent library
      perf jit: add source line info support

Taeung Song (8):
      perf config: Document 'ui.show-headers' variable in man page
      perf config: Document variables for 'call-graph' section in man page
      perf config: Document variables for 'report' section in man page
      perf config: Document 'top.children' variable in man page
      perf config: Document 'man.viewer' variable in man page
      perf config: Document 'pager.<subcommand>' variables in man page
      perf config: Document 'kmem.default' variable in man page
      perf config: Document 'record.build-id' variable in man page

 tools/build/Makefile.feature             |   2 +
 tools/build/feature/Makefile             |   4 +
 tools/build/feature/test-all.c           |   5 +
 tools/build/feature/test-libcrypto.c     |  17 +
 tools/perf/Documentation/perf-config.txt | 143 +++++++
 tools/perf/Documentation/perf-inject.txt |   7 +
 tools/perf/Makefile                      |  16 +-
 tools/perf/Makefile.perf                 |   3 +
 tools/perf/builtin-inject.c              | 107 ++++-
 tools/perf/config/Makefile               |  11 +
 tools/perf/jvmti/Makefile                |  76 ++++
 tools/perf/jvmti/jvmti_agent.c           | 465 +++++++++++++++++++++
 tools/perf/jvmti/jvmti_agent.h           |  36 ++
 tools/perf/jvmti/libjvmti.c              | 304 ++++++++++++++
 tools/perf/tests/make                    |  11 +-
 tools/perf/util/Build                    |   6 +
 tools/perf/util/demangle-java.c          | 199 +++++++++
 tools/perf/util/demangle-java.h          |  10 +
 tools/perf/util/event.c                  |   2 +-
 tools/perf/util/genelf.c                 | 449 +++++++++++++++++++++
 tools/perf/util/genelf.h                 |  67 +++
 tools/perf/util/genelf_debug.c           | 610 ++++++++++++++++++++++++++++
 tools/perf/util/jit.h                    |  15 +
 tools/perf/util/jitdump.c                | 672 +++++++++++++++++++++++++++++++
 tools/perf/util/jitdump.h                | 124 ++++++
 tools/perf/util/symbol-elf.c             |   3 +
 26 files changed, 3357 insertions(+), 7 deletions(-)
 create mode 100644 tools/build/feature/test-libcrypto.c
 create mode 100644 tools/perf/jvmti/Makefile
 create mode 100644 tools/perf/jvmti/jvmti_agent.c
 create mode 100644 tools/perf/jvmti/jvmti_agent.h
 create mode 100644 tools/perf/jvmti/libjvmti.c
 create mode 100644 tools/perf/util/demangle-java.c
 create mode 100644 tools/perf/util/demangle-java.h
 create mode 100644 tools/perf/util/genelf.c
 create mode 100644 tools/perf/util/genelf.h
 create mode 100644 tools/perf/util/genelf_debug.c
 create mode 100644 tools/perf/util/jit.h
 create mode 100644 tools/perf/util/jitdump.c
 create mode 100644 tools/perf/util/jitdump.h

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2015-04-08 14:23 Arnaldo Carvalho de Melo
@ 2015-04-08 15:05 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2015-04-08 15:05 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Andrew Morton, Borislav Petkov, David Ahern, Frederic Weisbecker,
	He Kuang, H. Peter Anvin, Jiri Olsa, John Stultz, Joonsoo Kim,
	Kaixu Xia, Kan Liang, Linus Torvalds, linux-mm, Markus T Metzger,
	Masami Hiramatsu, Mathieu Poirier, Mike Galbraith, Minchan Kim,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama,
	Robert Richter, Stephane Eranian, Steven Rostedt,
	Thomas Gleixner, Wang Nan, William Cohen, Yunlong Song, Zefan Li,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
>         Please consider pulling, it is the pull req from yesterday, minus a patch
> that introduced a problem, plus a fex fixes.
> 
>         I am investigating a problem I noticed for another patch that is upstream
> and after that will get back to the removed patch from yesterday's batch,
> 
> - Arnaldo
> 
> The following changes since commit 6645f3187f5beb64f7a40515cfa18f3889264ece:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-04-03 07:00:02 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to a1e12da4796a4ddd0e911687a290eb396d1c64bf:
> 
>   perf tools: Add 'I' event modifier for exclude_idle bit (2015-04-08 11:00:16 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> - Teach about perf_event_attr.clockid to 'perf record' (Peter Zijlstra)
> 
> - perf sched replay improvements for high CPU core count machines (Yunlong Song)
> 
> - Consider PERF_RECORD_ events with cpumode == 0 in 'perf top', removing one
>   cause of long term memory usage buildup, i.e. not processing PERF_RECORD_EXIT
>   events (Arnaldo Carvalho de Melo)
> 
> - Add 'I' event modifier for perf_event_attr.exclude_idle bit (Jiri Olsa)
> 
> - Respect -i option 'in perf kmem' (Jiri Olsa)
> 
> Infrastructure:
> 
> - Honor operator priority in libtraceevent (Namhyung Kim)
> 
> - Merge all perf_event_attr print functions (Peter Zijlstra)
> 
> - Check kmaps access to make code more robust (Wang Nan)
> 
> - Fix inverted logic in perf_mmap__empty() (He Kuang)
> 
> - Fix ARM 32 'perf probe' building error (Wang Nan)
> 
> - Fix perf_event_attr tests (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> He Kuang (1):
>       perf evlist: Fix inverted logic in perf_mmap__empty
> 
> Jiri Olsa (3):
>       perf kmem: Respect -i option
>       perf tests: Fix attr tests
>       perf tools: Add 'I' event modifier for exclude_idle bit
> 
> Namhyung Kim (1):
>       tools lib traceevent: Honor operator priority
> 
> Peter Zijlstra (2):
>       perf record: Add clockid parameter
>       perf tools: Merge all perf_event_attr print functions
> 
> Wang Nan (3):
>       perf kmaps: Check kmaps to make code more robust
>       perf probe: Fix ARM 32 building error
>       perf report: Don't call map__kmap if map is NULL.
> 
> Yunlong Song (9):
>       perf sched replay: Use struct task_desc instead of struct task_task for correct meaning
>       perf sched replay: Increase the MAX_PID value to fix assertion failure problem
>       perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max
>       perf sched replay: Realloc the memory of pid_to_task stepwise to adapt to the different pid_max configurations
>       perf sched replay: Fix the segmentation fault problem caused by pr_err in threads
>       perf sched replay: Handle the dead halt of sem_wait when create_tasks() fails for any task
>       perf sched replay: Fix the EMFILE error caused by the limitation of the maximum open files
>       perf sched replay: Support using -f to override perf.data file ownership
>       perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10
> 
>  tools/lib/traceevent/event-parse.c       |  17 +-
>  tools/perf/Documentation/perf-list.txt   |   1 +
>  tools/perf/Documentation/perf-record.txt |   7 +
>  tools/perf/builtin-kmem.c                |   3 +-
>  tools/perf/builtin-record.c              |  87 +++++++++
>  tools/perf/builtin-report.c              |   2 +-
>  tools/perf/builtin-sched.c               |  67 +++++--
>  tools/perf/perf.h                        |   2 +
>  tools/perf/tests/attr/base-record        |   2 +-
>  tools/perf/tests/attr/base-stat          |   2 +-
>  tools/perf/tests/parse-events.c          |  40 ++++
>  tools/perf/util/evlist.c                 |   2 +-
>  tools/perf/util/evsel.c                  | 325 ++++++++++++++++---------------
>  tools/perf/util/evsel.h                  |   6 +
>  tools/perf/util/header.c                 |  28 +--
>  tools/perf/util/machine.c                |   5 +-
>  tools/perf/util/map.c                    |  20 ++
>  tools/perf/util/map.h                    |   6 +-
>  tools/perf/util/parse-events.c           |   8 +-
>  tools/perf/util/parse-events.l           |   2 +-
>  tools/perf/util/probe-event.c            |   5 +-
>  tools/perf/util/session.c                |   3 +
>  tools/perf/util/symbol-elf.c             |  16 +-
>  tools/perf/util/symbol.c                 |  34 +++-
>  24 files changed, 477 insertions(+), 213 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo


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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2015-04-08 14:23 Arnaldo Carvalho de Melo
  2015-04-08 15:05 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-04-08 14:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Andrew Morton, Borislav Petkov,
	David Ahern, Frederic Weisbecker, He Kuang, H. Peter Anvin,
	Jiri Olsa, John Stultz, Joonsoo Kim, Kaixu Xia, Kan Liang,
	Linus Torvalds, linux-mm, Markus T Metzger, Masami Hiramatsu,
	Mathieu Poirier, Mike Galbraith, Minchan Kim, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, pi3orama, Robert Richter,
	Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan,
	William Cohen, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo

Hi Ingo,

        Please consider pulling, it is the pull req from yesterday, minus a patch
that introduced a problem, plus a fex fixes.

        I am investigating a problem I noticed for another patch that is upstream
and after that will get back to the removed patch from yesterday's batch,

- Arnaldo

The following changes since commit 6645f3187f5beb64f7a40515cfa18f3889264ece:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-04-03 07:00:02 +0200)

are available in the git repository at:


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

for you to fetch changes up to a1e12da4796a4ddd0e911687a290eb396d1c64bf:

  perf tools: Add 'I' event modifier for exclude_idle bit (2015-04-08 11:00:16 -0300)

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

- Teach about perf_event_attr.clockid to 'perf record' (Peter Zijlstra)

- perf sched replay improvements for high CPU core count machines (Yunlong Song)

- Consider PERF_RECORD_ events with cpumode == 0 in 'perf top', removing one
  cause of long term memory usage buildup, i.e. not processing PERF_RECORD_EXIT
  events (Arnaldo Carvalho de Melo)

- Add 'I' event modifier for perf_event_attr.exclude_idle bit (Jiri Olsa)

- Respect -i option 'in perf kmem' (Jiri Olsa)

Infrastructure:

- Honor operator priority in libtraceevent (Namhyung Kim)

- Merge all perf_event_attr print functions (Peter Zijlstra)

- Check kmaps access to make code more robust (Wang Nan)

- Fix inverted logic in perf_mmap__empty() (He Kuang)

- Fix ARM 32 'perf probe' building error (Wang Nan)

- Fix perf_event_attr tests (Jiri Olsa)

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

----------------------------------------------------------------
He Kuang (1):
      perf evlist: Fix inverted logic in perf_mmap__empty

Jiri Olsa (3):
      perf kmem: Respect -i option
      perf tests: Fix attr tests
      perf tools: Add 'I' event modifier for exclude_idle bit

Namhyung Kim (1):
      tools lib traceevent: Honor operator priority

Peter Zijlstra (2):
      perf record: Add clockid parameter
      perf tools: Merge all perf_event_attr print functions

Wang Nan (3):
      perf kmaps: Check kmaps to make code more robust
      perf probe: Fix ARM 32 building error
      perf report: Don't call map__kmap if map is NULL.

Yunlong Song (9):
      perf sched replay: Use struct task_desc instead of struct task_task for correct meaning
      perf sched replay: Increase the MAX_PID value to fix assertion failure problem
      perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max
      perf sched replay: Realloc the memory of pid_to_task stepwise to adapt to the different pid_max configurations
      perf sched replay: Fix the segmentation fault problem caused by pr_err in threads
      perf sched replay: Handle the dead halt of sem_wait when create_tasks() fails for any task
      perf sched replay: Fix the EMFILE error caused by the limitation of the maximum open files
      perf sched replay: Support using -f to override perf.data file ownership
      perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10

 tools/lib/traceevent/event-parse.c       |  17 +-
 tools/perf/Documentation/perf-list.txt   |   1 +
 tools/perf/Documentation/perf-record.txt |   7 +
 tools/perf/builtin-kmem.c                |   3 +-
 tools/perf/builtin-record.c              |  87 +++++++++
 tools/perf/builtin-report.c              |   2 +-
 tools/perf/builtin-sched.c               |  67 +++++--
 tools/perf/perf.h                        |   2 +
 tools/perf/tests/attr/base-record        |   2 +-
 tools/perf/tests/attr/base-stat          |   2 +-
 tools/perf/tests/parse-events.c          |  40 ++++
 tools/perf/util/evlist.c                 |   2 +-
 tools/perf/util/evsel.c                  | 325 ++++++++++++++++---------------
 tools/perf/util/evsel.h                  |   6 +
 tools/perf/util/header.c                 |  28 +--
 tools/perf/util/machine.c                |   5 +-
 tools/perf/util/map.c                    |  20 ++
 tools/perf/util/map.h                    |   6 +-
 tools/perf/util/parse-events.c           |   8 +-
 tools/perf/util/parse-events.l           |   2 +-
 tools/perf/util/probe-event.c            |   5 +-
 tools/perf/util/session.c                |   3 +
 tools/perf/util/symbol-elf.c             |  16 +-
 tools/perf/util/symbol.c                 |  34 +++-
 24 files changed, 477 insertions(+), 213 deletions(-)

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2015-03-21 18:54 Arnaldo Carvalho de Melo
@ 2015-03-22  9:58 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2015-03-22  9:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Borislav Petkov, Corey Ashford,
	David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
	Jiri Olsa, Masami Hiramatsu, Mike Galbraith, Milos Vyletel,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama,
	Stephane Eranian, Steven Rostedt, Wang Nan, Yunlong Song,
	Zefan Li, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, this is on top of my previous pull request,
> 
> Thanks,
> 
> - Arnaldo
> 
> The following changes since commit 0c8c20779c5d56b93b8cb4cd30ba129a927ab437:
> 
>   perf report: Don't allow empty argument for '-t'. (2015-03-19 13:53:28 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-2
> 
> for you to fetch changes up to ca33380adf74afb985bf7aab09ec46707a5d2d57:
> 
>   perf tools: Use kmod_path__parse for machine__new_dso (2015-03-21 14:58:07 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> - Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo)
> 
> - Indicate which callchain entries are annotated in the
>   TUI hists browser (report/top) (Arnaldo Carvalho de Melo)
> 
> - Fix failure to add multiple probes without debuginfo (He Kuang)
> 
> - Fix 'trace' summary_only option (David Ahern)
> 
> - Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel)
> 
> - Don't allow empty argument for field-separator, fixing segfault (Wang Nan)
> 
> Infrastructure:
> 
> - Add destructor for format_field in libtraceevent (David Ahern)
> 
> - Prep work for support lzma compressed kernel modules (Jiri Olsa)
> 
> - Update .gitignore with recently added/renamed feature detection files (Yunlong Song)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf trace: Handle legacy syscalls tracepoints
>       perf hists browser: Indicate which callchain entries are annotated
> 
> David Ahern (2):
>       perf trace: Fix summary_only option
>       tools lib traceevent: Add destructor for format_field
> 
> He Kuang (1):
>       perf probe: Fix failure to add multiple probes without debuginfo
> 
> Jiri Olsa (10):
>       perf build: Fix feature_check name clash
>       perf build: Separate feature make support into config/Makefile.feature
>       perf build: Make features checks directory configurable
>       perf build: Move feature checks code under tools/build
>       tools build: Add feature check for lzma library
>       perf tools: Add lzma decompression support for kernel module
>       perf tools: Add kmod_path__parse function
>       perf tools: Add dsos__addnew function
>       perf tools: Add machine__module_dso function
>       perf tools: Use kmod_path__parse for machine__new_dso
> 
> Milos Vyletel (1):
>       perf tools: Fix race in build_id_cache__add_s()
> 
> Wang Nan (1):
>       perf tools: Don't allow empty argument for field-separator
> 
> Yunlong Song (2):
>       perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file
>       perf build: Add config/feature-checks/*.output to the .gitignore file
> 
>  tools/build/Makefile.feature                       | 171 ++++++++++++++++++++
>  .../feature-checks => build/feature}/.gitignore    |   1 +
>  .../feature-checks => build/feature}/Makefile      |   8 +-
>  .../feature-checks => build/feature}/test-all.c    |   5 +
>  .../feature}/test-backtrace.c                      |   0
>  .../feature-checks => build/feature}/test-bionic.c |   0
>  .../feature}/test-compile.c                        |   0
>  .../feature}/test-cplus-demangle.c                 |   0
>  .../feature-checks => build/feature}/test-dwarf.c  |   0
>  .../feature}/test-fortify-source.c                 |   0
>  .../feature-checks => build/feature}/test-glibc.c  |   0
>  .../feature}/test-gtk2-infobar.c                   |   0
>  .../feature-checks => build/feature}/test-gtk2.c   |   0
>  .../feature-checks => build/feature}/test-hello.c  |   0
>  .../feature}/test-libaudit.c                       |   0
>  .../feature}/test-libbabeltrace.c                  |   0
>  .../feature-checks => build/feature}/test-libbfd.c |   0
>  .../feature}/test-libdw-dwarf-unwind.c             |   0
>  .../feature}/test-libelf-getphdrnum.c              |   0
>  .../feature}/test-libelf-mmap.c                    |   0
>  .../feature-checks => build/feature}/test-libelf.c |   0
>  .../feature}/test-libnuma.c                        |   0
>  .../feature}/test-libperl.c                        |   0
>  .../feature}/test-libpython-version.c              |   0
>  .../feature}/test-libpython.c                      |   0
>  .../feature}/test-libslang.c                       |   0
>  .../feature}/test-libunwind-debug-frame.c          |   0
>  .../feature}/test-libunwind.c                      |   0
>  tools/build/feature/test-lzma.c                    |  10 ++
>  .../feature}/test-pthread-attr-setaffinity-np.c    |   0
>  .../feature}/test-stackprotector-all.c             |   0
>  .../feature}/test-sync-compare-and-swap.c          |   0
>  .../feature}/test-timerfd.c                        |   0
>  .../feature-checks => build/feature}/test-zlib.c   |   0
>  tools/lib/traceevent/event-parse.c                 |  11 +-
>  tools/lib/traceevent/event-parse.h                 |   1 +
>  tools/perf/.gitignore                              |   2 +-
>  tools/perf/Makefile.perf                           |   4 +-
>  tools/perf/builtin-diff.c                          |   2 +-
>  tools/perf/builtin-mem.c                           |   2 +-
>  tools/perf/builtin-trace.c                         |  21 ++-
>  tools/perf/config/Makefile                         | 176 ++-------------------
>  tools/perf/tests/Build                             |   1 +
>  tools/perf/tests/builtin-test.c                    |   4 +
>  tools/perf/tests/kmod-path.c                       |  73 +++++++++
>  tools/perf/tests/tests.h                           |   1 +
>  tools/perf/ui/browsers/hists.c                     |   4 +-
>  tools/perf/util/Build                              |   1 +
>  tools/perf/util/build-id.c                         |   3 +-
>  tools/perf/util/dso.c                              |  90 +++++++++--
>  tools/perf/util/dso.h                              |  15 ++
>  tools/perf/util/lzma.c                             |  95 +++++++++++
>  tools/perf/util/machine.c                          |  83 +++++-----
>  tools/perf/util/probe-event.c                      |   4 +-
>  tools/perf/util/util.h                             |   4 +
>  55 files changed, 557 insertions(+), 235 deletions(-)
>  create mode 100644 tools/build/Makefile.feature
>  rename tools/{perf/config/feature-checks => build/feature}/.gitignore (52%)
>  rename tools/{perf/config/feature-checks => build/feature}/Makefile (96%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-all.c (97%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-backtrace.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-bionic.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-compile.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-cplus-demangle.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-dwarf.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-fortify-source.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-glibc.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-gtk2-infobar.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-gtk2.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-hello.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libaudit.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libbabeltrace.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libbfd.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libdw-dwarf-unwind.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libelf-getphdrnum.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libelf-mmap.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libelf.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libnuma.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libperl.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libpython-version.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libpython.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libslang.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libunwind-debug-frame.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-libunwind.c (100%)
>  create mode 100644 tools/build/feature/test-lzma.c
>  rename tools/{perf/config/feature-checks => build/feature}/test-pthread-attr-setaffinity-np.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-stackprotector-all.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-sync-compare-and-swap.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-timerfd.c (100%)
>  rename tools/{perf/config/feature-checks => build/feature}/test-zlib.c (100%)
>  create mode 100644 tools/perf/tests/kmod-path.c
>  create mode 100644 tools/perf/util/lzma.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2015-03-21 18:54 Arnaldo Carvalho de Melo
  2015-03-22  9:58 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-21 18:54 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, Corey Ashford, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu,
	Mike Galbraith, Milos Vyletel, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt,
	Wang Nan, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, this is on top of my previous pull request,

Thanks,

- Arnaldo

The following changes since commit 0c8c20779c5d56b93b8cb4cd30ba129a927ab437:

  perf report: Don't allow empty argument for '-t'. (2015-03-19 13:53:28 -0300)

are available in the git repository at:

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

for you to fetch changes up to ca33380adf74afb985bf7aab09ec46707a5d2d57:

  perf tools: Use kmod_path__parse for machine__new_dso (2015-03-21 14:58:07 -0300)

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

- Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo)

- Indicate which callchain entries are annotated in the
  TUI hists browser (report/top) (Arnaldo Carvalho de Melo)

- Fix failure to add multiple probes without debuginfo (He Kuang)

- Fix 'trace' summary_only option (David Ahern)

- Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel)

- Don't allow empty argument for field-separator, fixing segfault (Wang Nan)

Infrastructure:

- Add destructor for format_field in libtraceevent (David Ahern)

- Prep work for support lzma compressed kernel modules (Jiri Olsa)

- Update .gitignore with recently added/renamed feature detection files (Yunlong Song)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf trace: Handle legacy syscalls tracepoints
      perf hists browser: Indicate which callchain entries are annotated

David Ahern (2):
      perf trace: Fix summary_only option
      tools lib traceevent: Add destructor for format_field

He Kuang (1):
      perf probe: Fix failure to add multiple probes without debuginfo

Jiri Olsa (10):
      perf build: Fix feature_check name clash
      perf build: Separate feature make support into config/Makefile.feature
      perf build: Make features checks directory configurable
      perf build: Move feature checks code under tools/build
      tools build: Add feature check for lzma library
      perf tools: Add lzma decompression support for kernel module
      perf tools: Add kmod_path__parse function
      perf tools: Add dsos__addnew function
      perf tools: Add machine__module_dso function
      perf tools: Use kmod_path__parse for machine__new_dso

Milos Vyletel (1):
      perf tools: Fix race in build_id_cache__add_s()

Wang Nan (1):
      perf tools: Don't allow empty argument for field-separator

Yunlong Song (2):
      perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file
      perf build: Add config/feature-checks/*.output to the .gitignore file

 tools/build/Makefile.feature                       | 171 ++++++++++++++++++++
 .../feature-checks => build/feature}/.gitignore    |   1 +
 .../feature-checks => build/feature}/Makefile      |   8 +-
 .../feature-checks => build/feature}/test-all.c    |   5 +
 .../feature}/test-backtrace.c                      |   0
 .../feature-checks => build/feature}/test-bionic.c |   0
 .../feature}/test-compile.c                        |   0
 .../feature}/test-cplus-demangle.c                 |   0
 .../feature-checks => build/feature}/test-dwarf.c  |   0
 .../feature}/test-fortify-source.c                 |   0
 .../feature-checks => build/feature}/test-glibc.c  |   0
 .../feature}/test-gtk2-infobar.c                   |   0
 .../feature-checks => build/feature}/test-gtk2.c   |   0
 .../feature-checks => build/feature}/test-hello.c  |   0
 .../feature}/test-libaudit.c                       |   0
 .../feature}/test-libbabeltrace.c                  |   0
 .../feature-checks => build/feature}/test-libbfd.c |   0
 .../feature}/test-libdw-dwarf-unwind.c             |   0
 .../feature}/test-libelf-getphdrnum.c              |   0
 .../feature}/test-libelf-mmap.c                    |   0
 .../feature-checks => build/feature}/test-libelf.c |   0
 .../feature}/test-libnuma.c                        |   0
 .../feature}/test-libperl.c                        |   0
 .../feature}/test-libpython-version.c              |   0
 .../feature}/test-libpython.c                      |   0
 .../feature}/test-libslang.c                       |   0
 .../feature}/test-libunwind-debug-frame.c          |   0
 .../feature}/test-libunwind.c                      |   0
 tools/build/feature/test-lzma.c                    |  10 ++
 .../feature}/test-pthread-attr-setaffinity-np.c    |   0
 .../feature}/test-stackprotector-all.c             |   0
 .../feature}/test-sync-compare-and-swap.c          |   0
 .../feature}/test-timerfd.c                        |   0
 .../feature-checks => build/feature}/test-zlib.c   |   0
 tools/lib/traceevent/event-parse.c                 |  11 +-
 tools/lib/traceevent/event-parse.h                 |   1 +
 tools/perf/.gitignore                              |   2 +-
 tools/perf/Makefile.perf                           |   4 +-
 tools/perf/builtin-diff.c                          |   2 +-
 tools/perf/builtin-mem.c                           |   2 +-
 tools/perf/builtin-trace.c                         |  21 ++-
 tools/perf/config/Makefile                         | 176 ++-------------------
 tools/perf/tests/Build                             |   1 +
 tools/perf/tests/builtin-test.c                    |   4 +
 tools/perf/tests/kmod-path.c                       |  73 +++++++++
 tools/perf/tests/tests.h                           |   1 +
 tools/perf/ui/browsers/hists.c                     |   4 +-
 tools/perf/util/Build                              |   1 +
 tools/perf/util/build-id.c                         |   3 +-
 tools/perf/util/dso.c                              |  90 +++++++++--
 tools/perf/util/dso.h                              |  15 ++
 tools/perf/util/lzma.c                             |  95 +++++++++++
 tools/perf/util/machine.c                          |  83 +++++-----
 tools/perf/util/probe-event.c                      |   4 +-
 tools/perf/util/util.h                             |   4 +
 55 files changed, 557 insertions(+), 235 deletions(-)
 create mode 100644 tools/build/Makefile.feature
 rename tools/{perf/config/feature-checks => build/feature}/.gitignore (52%)
 rename tools/{perf/config/feature-checks => build/feature}/Makefile (96%)
 rename tools/{perf/config/feature-checks => build/feature}/test-all.c (97%)
 rename tools/{perf/config/feature-checks => build/feature}/test-backtrace.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-bionic.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-compile.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-cplus-demangle.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-dwarf.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-fortify-source.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-glibc.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-gtk2-infobar.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-gtk2.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-hello.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libaudit.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libbabeltrace.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libbfd.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libdw-dwarf-unwind.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libelf-getphdrnum.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libelf-mmap.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libelf.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libnuma.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libperl.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libpython-version.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libpython.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libslang.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libunwind-debug-frame.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-libunwind.c (100%)
 create mode 100644 tools/build/feature/test-lzma.c
 rename tools/{perf/config/feature-checks => build/feature}/test-pthread-attr-setaffinity-np.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-stackprotector-all.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-sync-compare-and-swap.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-timerfd.c (100%)
 rename tools/{perf/config/feature-checks => build/feature}/test-zlib.c (100%)
 create mode 100644 tools/perf/tests/kmod-path.c
 create mode 100644 tools/perf/util/lzma.c

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2015-02-27 19:22 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-27 19:22 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, He Kuang, Hemant Kumar,
	Jiri Olsa, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Paul Mackerras, Peter Zijlstra, Wang Nan,
	Yunlong Song, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 0afb1704010f60e7ae85aef0f93fc10f2d99761e:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-02-26 12:25:20 +0100)

are available in the git repository at:


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

for you to fetch changes up to fefd2d9619de3bf0bf02a8622e9f445c3d19cc3f:

  perf report: Fix branch stack mode cannot be set (2015-02-27 15:52:42 -0300)

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

User visible:

- Fix SIGBUS failures due to misaligned accesses in Sparc64 (David Ahern)

- Fix branch stack mode in 'perf report' (He Kuang)

- Fix a 'perf probe' operator precedence bug (He Kuang)

- Fix Support for different binaries with same name in 'perf diff' (Kan Liang)

- Check kprobes blacklist when adding new events via 'perf probe' (Masami Hiramatsu)

- Add --purge FILE to remove all caches of FILE in 'perf buildid-cache' (Masami Hiramatsu)

- Show usage with some incorrect params (Masami Hiramatsu)

- Add new buildid cache if update target is not cached in 'buildid-cache' (Masami Hiramatsu)

- Allow listing events with 'tracepoint' prefix in 'perf list' (Yunlong Song)

- Sort the output of 'perf list' (Yunlong Song)

- Fix bash completion of 'perf --' (Yunlong Song)

Developer Zone:

- Handle strdup() failure path in 'perf probe' (Arnaldo Carvalho de Melo)

- Fix get_real_path to free allocated memory in error path in 'perf probe' (Masami Hiramatsu)

- Use pr_debug instead of verbose && pr_info perf buildid-cache (Masami Hiramatsu)

- Fix building of 'perf data' with some gcc versions due to incorrect array struct
  entry (Yunlong Song)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      perf probe: Handle strdup() failure

David Ahern (1):
      perf trace: Fix SIGBUS failures due to misaligned accesses

He Kuang (2):
      perf probe: Fix a precedence bug
      perf report: Fix branch stack mode cannot be set

Kan Liang (1):
      perf diff: Support for different binaries

Masami Hiramatsu (6):
      perf probe: Check kprobes blacklist when adding new events
      perf probe: Fix get_real_path to free allocated memory in error path
      perf buildid-cache: Add new buildid cache if update target is not cached
      perf buildid-cache: Add --purge FILE to remove all caches of FILE
      perf buildid-cache: Use pr_debug instead of verbose && pr_info
      perf buildid-cache: Show usage with incorrect params

Yunlong Song (8):
      perf data: Fix sentinel setting for data_cmds array
      perf list: Sort the output of 'perf list' to view more clearly
      perf list: Allow listing events with 'tracepoint' prefix
      perf list: Avoid confusion of perf output and the next command prompt
      perf tools: Remove the '--(null)' long_name for --list-opts
      perf list: Clean up the printing functions of hardware/software events
      perf list: Extend raw-dump to certain kind of events
      perf tools: Fix the bash completion problem of 'perf --*'

 tools/perf/Documentation/perf-buildid-cache.txt |  24 ++-
 tools/perf/Documentation/perf-diff.txt          |   5 +
 tools/perf/Documentation/perf-list.txt          |   6 +
 tools/perf/builtin-buildid-cache.c              |  72 ++++++--
 tools/perf/builtin-data.c                       |   2 +-
 tools/perf/builtin-list.c                       |  27 ++-
 tools/perf/builtin-report.c                     |   2 +-
 tools/perf/builtin-trace.c                      |  36 +++-
 tools/perf/perf-completion.sh                   |   6 +-
 tools/perf/perf.c                               |  28 ++++
 tools/perf/util/build-id.c                      | 105 ++++++++++--
 tools/perf/util/build-id.h                      |   4 +
 tools/perf/util/parse-events.c                  | 210 +++++++++++++++++-------
 tools/perf/util/parse-events.h                  |  11 +-
 tools/perf/util/parse-options.c                 |   5 +-
 tools/perf/util/probe-event.c                   | 117 ++++++++++++-
 tools/perf/util/sort.c                          |   9 +
 17 files changed, 542 insertions(+), 127 deletions(-)

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2014-01-17 14:57 Arnaldo Carvalho de Melo
@ 2014-01-19 12:11 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2014-01-19 12:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, David A. Long, Frederic Weisbecker, Jiri Olsa,
	Masami Hiramatsu, Namhyung Kim, Oleg Nesterov, Paul Mackerras,
	Peter Zijlstra, Srikar Dronamraju, Stephane Eranian,
	Steven Rostedt, yrl.pp-manager.tt, Arnaldo Carvalho de Melo


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

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 3e7e09dbd1080de5dcf10092830e39bc2e2932ec:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-16 09:34:01 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 2a29190c040c0b11e39197c67abf6f87e0a61f9a:
> 
>   perf tools: Remove unnecessary callchain cursor state restore on unmatch (2014-01-17 11:25:24 -0300)
> 
> ----------------------------------------------------------------
> Developer stuff:
> 
> . Improve callchain processing by removing unnecessary work. (Frederic Weisbecker)
> 
> . Fix comm override error handling (Frederic Weisbecker)
> 
> . Improve 'perf probe' exit path, release resources (Masami Hiramatsu)
> 
> . Improve libtraceevent plugins exit path, allowing the registering of
>   an unregister handler to be called at exit time (Namhyung Kim)
> 
> . Add an alias to the build test makefile (make -C tools/perf build-test)
>   (Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Frederic Weisbecker (3):
>       perf tools: Do proper comm override error handling
>       perf callchain: Spare double comparison of callchain first entry
>       perf tools: Remove unnecessary callchain cursor state restore on unmatch
> 
> Masami Hiramatsu (3):
>       perf probe: Release allocated probe_trace_event if failed
>       perf probe: Release all dynamically allocated parameters
>       perf symbols: Export elf_section_by_name and reuse
> 
> Namhyung Kim (13):
>       tools lib traceevent: Add pevent_unregister_event_handler()
>       tools lib traceevent: Add pevent_unregister_print_function()
>       tools lib traceevent: Unregister handler when function plugin is unloaded
>       tools lib traceevent: Unregister handler when hrtimer plugin is unloaded
>       tools lib traceevent: Unregister handler when kmem plugin is unloaded
>       tools lib traceevent: Unregister handler when kvm plugin is unloaded
>       tools lib traceevent: Unregister handler when sched_switch plugin is unloaded
>       tools lib traceevent: Unregister handler when mac80211 plugin is unloaded
>       tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded
>       tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded
>       tools lib traceevent: Unregister handler when scsi plugin is unloaded
>       tools lib traceevent: Unregister handler when xen plugin is unloaded
>       perf tools: Add 'build-test' make target
> 
>  tools/lib/traceevent/event-parse.c         | 136 ++++++++++++++++++++++++++---
>  tools/lib/traceevent/event-parse.h         |   5 ++
>  tools/lib/traceevent/plugin_cfg80211.c     |   6 ++
>  tools/lib/traceevent/plugin_function.c     |   3 +
>  tools/lib/traceevent/plugin_hrtimer.c      |  10 +++
>  tools/lib/traceevent/plugin_jbd2.c         |   9 ++
>  tools/lib/traceevent/plugin_kmem.c         |  22 +++++
>  tools/lib/traceevent/plugin_kvm.c          |  29 ++++++
>  tools/lib/traceevent/plugin_mac80211.c     |   7 ++
>  tools/lib/traceevent/plugin_sched_switch.c |  12 +++
>  tools/lib/traceevent/plugin_scsi.c         |   6 ++
>  tools/lib/traceevent/plugin_xen.c          |   6 ++
>  tools/perf/Makefile                        |   6 ++
>  tools/perf/builtin-probe.c                 |  48 ++++++++--
>  tools/perf/util/callchain.c                |  23 +++--
>  tools/perf/util/comm.c                     |  19 ++--
>  tools/perf/util/comm.h                     |   2 +-
>  tools/perf/util/probe-event.c              | 111 +++++++++++++----------
>  tools/perf/util/probe-event.h              |   6 ++
>  tools/perf/util/symbol-elf.c               |   5 +-
>  tools/perf/util/symbol.h                   |   5 ++
>  tools/perf/util/thread.c                   |   5 +-
>  tools/perf/util/unwind.c                   |  20 +----
>  23 files changed, 389 insertions(+), 112 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2014-01-17 14:57 Arnaldo Carvalho de Melo
  2014-01-19 12:11 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-01-17 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, David A. Long, Frederic Weisbecker, Jiri Olsa,
	Masami Hiramatsu, Namhyung Kim, Oleg Nesterov, Paul Mackerras,
	Peter Zijlstra, Srikar Dronamraju, Stephane Eranian,
	Steven Rostedt, yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 3e7e09dbd1080de5dcf10092830e39bc2e2932ec:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-16 09:34:01 +0100)

are available in the git repository at:


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

for you to fetch changes up to 2a29190c040c0b11e39197c67abf6f87e0a61f9a:

  perf tools: Remove unnecessary callchain cursor state restore on unmatch (2014-01-17 11:25:24 -0300)

----------------------------------------------------------------
Developer stuff:

. Improve callchain processing by removing unnecessary work. (Frederic Weisbecker)

. Fix comm override error handling (Frederic Weisbecker)

. Improve 'perf probe' exit path, release resources (Masami Hiramatsu)

. Improve libtraceevent plugins exit path, allowing the registering of
  an unregister handler to be called at exit time (Namhyung Kim)

. Add an alias to the build test makefile (make -C tools/perf build-test)
  (Namhyung Kim)

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

----------------------------------------------------------------
Frederic Weisbecker (3):
      perf tools: Do proper comm override error handling
      perf callchain: Spare double comparison of callchain first entry
      perf tools: Remove unnecessary callchain cursor state restore on unmatch

Masami Hiramatsu (3):
      perf probe: Release allocated probe_trace_event if failed
      perf probe: Release all dynamically allocated parameters
      perf symbols: Export elf_section_by_name and reuse

Namhyung Kim (13):
      tools lib traceevent: Add pevent_unregister_event_handler()
      tools lib traceevent: Add pevent_unregister_print_function()
      tools lib traceevent: Unregister handler when function plugin is unloaded
      tools lib traceevent: Unregister handler when hrtimer plugin is unloaded
      tools lib traceevent: Unregister handler when kmem plugin is unloaded
      tools lib traceevent: Unregister handler when kvm plugin is unloaded
      tools lib traceevent: Unregister handler when sched_switch plugin is unloaded
      tools lib traceevent: Unregister handler when mac80211 plugin is unloaded
      tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded
      tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded
      tools lib traceevent: Unregister handler when scsi plugin is unloaded
      tools lib traceevent: Unregister handler when xen plugin is unloaded
      perf tools: Add 'build-test' make target

 tools/lib/traceevent/event-parse.c         | 136 ++++++++++++++++++++++++++---
 tools/lib/traceevent/event-parse.h         |   5 ++
 tools/lib/traceevent/plugin_cfg80211.c     |   6 ++
 tools/lib/traceevent/plugin_function.c     |   3 +
 tools/lib/traceevent/plugin_hrtimer.c      |  10 +++
 tools/lib/traceevent/plugin_jbd2.c         |   9 ++
 tools/lib/traceevent/plugin_kmem.c         |  22 +++++
 tools/lib/traceevent/plugin_kvm.c          |  29 ++++++
 tools/lib/traceevent/plugin_mac80211.c     |   7 ++
 tools/lib/traceevent/plugin_sched_switch.c |  12 +++
 tools/lib/traceevent/plugin_scsi.c         |   6 ++
 tools/lib/traceevent/plugin_xen.c          |   6 ++
 tools/perf/Makefile                        |   6 ++
 tools/perf/builtin-probe.c                 |  48 ++++++++--
 tools/perf/util/callchain.c                |  23 +++--
 tools/perf/util/comm.c                     |  19 ++--
 tools/perf/util/comm.h                     |   2 +-
 tools/perf/util/probe-event.c              | 111 +++++++++++++----------
 tools/perf/util/probe-event.h              |   6 ++
 tools/perf/util/symbol-elf.c               |   5 +-
 tools/perf/util/symbol.h                   |   5 ++
 tools/perf/util/thread.c                   |   5 +-
 tools/perf/util/unwind.c                   |  20 +----
 23 files changed, 389 insertions(+), 112 deletions(-)

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

* Re: [GIT PULL 00/19] perf/core improvements and fixes
  2012-05-22 17:39 Arnaldo Carvalho de Melo
@ 2012-05-23 15:06 ` Ingo Molnar
  0 siblings, 0 replies; 53+ messages in thread
From: Ingo Molnar @ 2012-05-23 15:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Anshuman Khandual, Corey Ashford, David Ahern,
	Frederic Weisbecker, Frederic Weisbecker, Jiri Olsa,
	Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt, Tom Zanussi,
	arnaldo.melo, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 73787190d04a34e6da745da893b3ae8bedde418f:
> 
>   Merge branch 'perf/parse-events-4' of git://github.com/fweisbec/tracing into perf/core (2012-05-21 10:42:09 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core
> 
> for you to fetch changes up to 26252ea675663d1bc6747125fcaa2b7cc4ed8a03:
> 
>   perf evlist: Show event attribute details (2012-05-22 14:30:11 -0300)
> 
> ----------------------------------------------------------------
> Fixes and improvements for perf/core:
> 
> . Fix perf perl script build fallout from libtraceevent conversion,
>   from Frederic Weisbecker.
> 
> . Libtraceevent Makefile fixes, from Namhyung Kim
> 
> . Pipe mode fixes, from Stephane Eranian
> 
> . Event parsing improvements, from Jiri Olsa.
> 
> . Endianness fixes, from Jiri Olsa
> 
> . Bump the default sampling freq to 4 kHz, requested by Ingo Molnar.
> 
> . Show event attribute details, such as the sampling freq, in the
>   'perf evlist' command.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Anshuman Khandual (1):
>       perf record: Fix documentation for branch stack sampling
> 
> Arnaldo Carvalho de Melo (2):
>       perf tools: Bump default sample freq to 4 kHz
>       perf evlist: Show event attribute details
> 
> Frederic Weisbecker (2):
>       perf script: Explicitly handle known default print arg type
>       perf script: Rename struct event to struct event_format in perl engine
> 
> Jiri Olsa (7):
>       perf test: Move parse event automated tests to separated object
>       perf tools: Add support for displaying event parser debug info
>       perf tools: Use allocated list for each parsed event
>       perf tools: Separate 'mem:' event scanner bits
>       perf tools: Add hardcoded name term for pmu events
>       perf tools: Carry perf_event_attr bitfield throught different endians
>       perf tools: Add union u64_swap type for swapping u64 data
> 
> Namhyung Kim (3):
>       perf tools: Rename libparsevent to libtraceevent in Makefile
>       perf tools: Always try to build libtraceevent
>       perf target: Add cpu flag to sample_type if target has cpu
> 
> Stephane Eranian (4):
>       perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA
>       perf inject: Fix broken perf inject -b
>       perf tools: Fix piped mode read code
>       perf buildid-list: Work better with pipe mode
> 
>  tools/perf/Documentation/perf-evlist.txt           |    8 +
>  tools/perf/Documentation/perf-record.txt           |    2 +-
>  tools/perf/Makefile                                |   37 +-
>  tools/perf/builtin-buildid-list.c                  |    6 +-
>  tools/perf/builtin-evlist.c                        |  103 +++-
>  tools/perf/builtin-inject.c                        |    5 +
>  tools/perf/builtin-record.c                        |    6 +-
>  tools/perf/builtin-test.c                          |  552 +----------------
>  tools/perf/builtin-top.c                           |    5 +-
>  tools/perf/util/build-id.c                         |    2 +
>  tools/perf/util/evsel.c                            |   12 +-
>  tools/perf/util/header.c                           |   10 +-
>  tools/perf/util/header.h                           |    2 +-
>  tools/perf/util/parse-events-test.c                |  625 ++++++++++++++++++++
>  tools/perf/util/parse-events.c                     |   69 ++-
>  tools/perf/util/parse-events.h                     |   20 +-
>  tools/perf/util/parse-events.l                     |   26 +-
>  tools/perf/util/parse-events.y                     |   77 ++-
>  tools/perf/util/pmu.c                              |    4 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |   16 +-
>  tools/perf/util/session.c                          |   68 ++-
>  tools/perf/util/types.h                            |    5 +
>  22 files changed, 1002 insertions(+), 658 deletions(-)
>  create mode 100644 tools/perf/util/parse-events-test.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/19] perf/core improvements and fixes
@ 2012-05-22 17:39 Arnaldo Carvalho de Melo
  2012-05-23 15:06 ` Ingo Molnar
  0 siblings, 1 reply; 53+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-05-22 17:39 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Anshuman Khandual,
	Corey Ashford, David Ahern, Frederic Weisbecker,
	Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, Tom Zanussi, arnaldo.melo,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 73787190d04a34e6da745da893b3ae8bedde418f:

  Merge branch 'perf/parse-events-4' of git://github.com/fweisbec/tracing into perf/core (2012-05-21 10:42:09 +0200)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core

for you to fetch changes up to 26252ea675663d1bc6747125fcaa2b7cc4ed8a03:

  perf evlist: Show event attribute details (2012-05-22 14:30:11 -0300)

----------------------------------------------------------------
Fixes and improvements for perf/core:

. Fix perf perl script build fallout from libtraceevent conversion,
  from Frederic Weisbecker.

. Libtraceevent Makefile fixes, from Namhyung Kim

. Pipe mode fixes, from Stephane Eranian

. Event parsing improvements, from Jiri Olsa.

. Endianness fixes, from Jiri Olsa

. Bump the default sampling freq to 4 kHz, requested by Ingo Molnar.

. Show event attribute details, such as the sampling freq, in the
  'perf evlist' command.

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

----------------------------------------------------------------
Anshuman Khandual (1):
      perf record: Fix documentation for branch stack sampling

Arnaldo Carvalho de Melo (2):
      perf tools: Bump default sample freq to 4 kHz
      perf evlist: Show event attribute details

Frederic Weisbecker (2):
      perf script: Explicitly handle known default print arg type
      perf script: Rename struct event to struct event_format in perl engine

Jiri Olsa (7):
      perf test: Move parse event automated tests to separated object
      perf tools: Add support for displaying event parser debug info
      perf tools: Use allocated list for each parsed event
      perf tools: Separate 'mem:' event scanner bits
      perf tools: Add hardcoded name term for pmu events
      perf tools: Carry perf_event_attr bitfield throught different endians
      perf tools: Add union u64_swap type for swapping u64 data

Namhyung Kim (3):
      perf tools: Rename libparsevent to libtraceevent in Makefile
      perf tools: Always try to build libtraceevent
      perf target: Add cpu flag to sample_type if target has cpu

Stephane Eranian (4):
      perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA
      perf inject: Fix broken perf inject -b
      perf tools: Fix piped mode read code
      perf buildid-list: Work better with pipe mode

 tools/perf/Documentation/perf-evlist.txt           |    8 +
 tools/perf/Documentation/perf-record.txt           |    2 +-
 tools/perf/Makefile                                |   37 +-
 tools/perf/builtin-buildid-list.c                  |    6 +-
 tools/perf/builtin-evlist.c                        |  103 +++-
 tools/perf/builtin-inject.c                        |    5 +
 tools/perf/builtin-record.c                        |    6 +-
 tools/perf/builtin-test.c                          |  552 +----------------
 tools/perf/builtin-top.c                           |    5 +-
 tools/perf/util/build-id.c                         |    2 +
 tools/perf/util/evsel.c                            |   12 +-
 tools/perf/util/header.c                           |   10 +-
 tools/perf/util/header.h                           |    2 +-
 tools/perf/util/parse-events-test.c                |  625 ++++++++++++++++++++
 tools/perf/util/parse-events.c                     |   69 ++-
 tools/perf/util/parse-events.h                     |   20 +-
 tools/perf/util/parse-events.l                     |   26 +-
 tools/perf/util/parse-events.y                     |   77 ++-
 tools/perf/util/pmu.c                              |    4 +-
 .../perf/util/scripting-engines/trace-event-perl.c |   16 +-
 tools/perf/util/session.c                          |   68 ++-
 tools/perf/util/types.h                            |    5 +
 22 files changed, 1002 insertions(+), 658 deletions(-)
 create mode 100644 tools/perf/util/parse-events-test.c

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

end of thread, other threads:[~2017-11-03 13:55 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 18:50 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 01/19] perf report: Hide tip message when -q option is given Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 02/19] perf c2c: Clarify help message of --stats option Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 03/19] perf c2c: Fix display bug when using pipe Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 04/19] perf tools: Missing c2c command in command-list Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 05/19] perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 06/19] perf sort: Fix segfault with basic block 'cycles' sort dimension Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 07/19] perf report: Document +field style argument support for --field option Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 08/19] perf hists browser: Fix typo in function switch_data_file Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 09/19] perf: Add PERF_RECORD_NAMESPACES to include namespaces related info Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 10/19] perf tools: " Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 11/19] perf record: Synthesize namespace events for current processes Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 12/19] perf script: Add script print support for namespace events Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 13/19] perf tools: Add 'cgroup_id' sort order keyword Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 14/19] perf sched timehist: Add --next option Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 15/19] perf probe: Factor out the ftrace README scanning Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 16/19] perf kretprobes: Offset from reloc_sym if kernel supports it Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 17/19] perf powerpc: Choose local entry point with kretprobes Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 18/19] doc: trace/kprobes: add information about NOKPROBE_SYMBOL Arnaldo Carvalho de Melo
2017-03-14 18:50 ` [PATCH 19/19] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL Arnaldo Carvalho de Melo
2017-03-15 18:29 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2017-11-03 13:54 Arnaldo Carvalho de Melo
2017-08-14 16:27 Arnaldo Carvalho de Melo
2017-08-14 17:39 ` Ingo Molnar
2017-08-14 17:52   ` Arnaldo Carvalho de Melo
2016-12-01 18:02 Arnaldo Carvalho de Melo
2016-12-02  9:10 ` Ingo Molnar
2016-09-01 16:45 Arnaldo Carvalho de Melo
2016-09-05 13:16 ` Ingo Molnar
2016-07-14  2:20 Arnaldo Carvalho de Melo
2016-07-14  6:58 ` Ingo Molnar
2016-06-15 18:13 Arnaldo Carvalho de Melo
2016-06-16  6:29 ` Jiri Olsa
2016-06-16 19:54   ` Arnaldo Carvalho de Melo
2016-06-16  8:29 ` Ingo Molnar
2016-04-07 20:58 Arnaldo Carvalho de Melo
2016-04-08 13:15 ` Arnaldo Carvalho de Melo
2016-04-13  6:58   ` Ingo Molnar
2016-03-10 21:04 Arnaldo Carvalho de Melo
2016-03-11  8:43 ` Ingo Molnar
2016-02-26 23:18 Arnaldo Carvalho de Melo
2016-02-27  9:36 ` Ingo Molnar
2016-02-05 16:25 Arnaldo Carvalho de Melo
2016-02-09  9:40 ` Ingo Molnar
2015-04-08 14:23 Arnaldo Carvalho de Melo
2015-04-08 15:05 ` Ingo Molnar
2015-03-21 18:54 Arnaldo Carvalho de Melo
2015-03-22  9:58 ` Ingo Molnar
2015-02-27 19:22 Arnaldo Carvalho de Melo
2014-01-17 14:57 Arnaldo Carvalho de Melo
2014-01-19 12:11 ` Ingo Molnar
2012-05-22 17:39 Arnaldo Carvalho de Melo
2012-05-23 15:06 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).