linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/20] perf/core improvements and fixes
@ 2014-09-17 21:24 Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 01/20] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
                   ` (20 more replies)
  0 siblings, 21 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Yarygin, Anton Blanchard, Avi Kivity, Chanho Park,
	Christian Borntraeger, Corey Ashford, David Ahern, david lerner,
	Don Zickus, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	John Spencer, Kyle McMartin, linux-perf-users, Masami Hiramatsu,
	Michael Ellerman, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:

  perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +0200)

are available in the git repository at:

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

for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:

  perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)

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

User visible:

o Add +field argument support for --sort option (Jiri Olsa)

o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)

o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)

o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)

o Disable kernel symbol demangling by default (Avi Kivity)

Infrastructure:

o More intel PT prep work, from Adrian Hunter, including:

  - Let a user specify a PMU event without any config terms
  - Add perf-with-kcore script
  - Let default config be defined for a PMU
  - Add perf_pmu__scan_file()

o "perf kvm stat report" improvements by Alexander Yarygin:
  o  Save pid string in opts.target.pid
  o  Enable the target.system_wide flag
  o  Unify the title bar output

o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)

o Allow to specify lib compile variable for spec usage (Jiri Olsa)

o Fix build on ARM (Stephane Eranian)

o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)

o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)

o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)

Chanho Park (1):
  perf tools: define _DEFAULT_SOURCE for glibc_2.20

o Allow to specify lib compile variable for spec usage (Jiri Olsa)

o Fix GNU-only grep usage in Makefile (John Spencer)

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

----------------------------------------------------------------
Adrian Hunter (4):
      perf tools: Let a user specify a PMU event without any config terms
      perf tools: Add perf-with-kcore script
      perf tools: Let default config be defined for a PMU
      perf tools: Add perf_pmu__scan_file()

Alexander Yarygin (3):
      perf kvm stat report: Save pid string in opts.target.pid
      perf kvm stat report: Enable the target.system_wide flag
      perf kvm stat report: Unify the title bar output

Anton Blanchard (3):
      perf tools powerpc: Fix build issue when DWARF support is disabled
      perf symbols: Ignore stripped vmlinux and fallback to kallsyms
      perf symbols: Add path to Ubuntu kernel debuginfo file

Arnaldo Carvalho de Melo (2):
      perf tools: Don't include sys/poll.h directly
      perf record: Use ring buffer consume method to look like other tools

Avi Kivity (1):
      perf tools: Disable kernel symbol demangling by default

Chanho Park (1):
      perf tools: define _DEFAULT_SOURCE for glibc_2.20

Jiri Olsa (2):
      perf tools: Add +field argument support for --sort option
      perf tools: Allow to specify lib compile variable for spec usage

John Spencer (1):
      perf tools: Fix GNU-only grep usage in Makefile

Masami Hiramatsu (2):
      perf probe: Do not access kallsyms when analyzing user binaries
      perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name

Stephane Eranian (1):
      perf tool: fix compilation for ARM

 tools/perf/.gitignore                       |   1 +
 tools/perf/Documentation/perf-probe.txt     |   3 +
 tools/perf/Documentation/perf-report.txt    |   3 +
 tools/perf/Documentation/perf-top.txt       |   3 +
 tools/perf/Makefile.perf                    |   5 +-
 tools/perf/arch/arm/tests/dwarf-unwind.c    |   1 +
 tools/perf/arch/arm/util/unwind-libunwind.c |   1 +
 tools/perf/arch/powerpc/Makefile            |   2 +-
 tools/perf/bench/sched-messaging.c          |   2 +-
 tools/perf/builtin-kvm.c                    |  23 +--
 tools/perf/builtin-probe.c                  |   5 +-
 tools/perf/builtin-record.c                 |   8 +-
 tools/perf/builtin-report.c                 |   2 +
 tools/perf/builtin-top.c                    |   4 +-
 tools/perf/config/Makefile                  |  12 +-
 tools/perf/config/utilities.mak             |   2 +-
 tools/perf/perf-with-kcore.sh               | 259 ++++++++++++++++++++++++++++
 tools/perf/tests/pmu.c                      |   2 +-
 tools/perf/util/kvm-stat.h                  |   1 -
 tools/perf/util/parse-events.c              |  13 +-
 tools/perf/util/parse-events.y              |  10 ++
 tools/perf/util/pmu.c                       |  79 +++++++--
 tools/perf/util/pmu.h                       |  12 +-
 tools/perf/util/probe-event.c               |   9 +-
 tools/perf/util/probe-event.h               |   3 +-
 tools/perf/util/probe-finder.c              |  16 +-
 tools/perf/util/sort.c                      |  37 +++-
 tools/perf/util/symbol-elf.c                |  15 +-
 tools/perf/util/symbol.c                    |   9 +-
 tools/perf/util/symbol.h                    |   1 +
 tools/perf/util/util.h                      |   4 +-
 31 files changed, 487 insertions(+), 60 deletions(-)
 create mode 100644 tools/perf/perf-with-kcore.sh

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

* [PATCH 01/20] perf tools: Add +field argument support for --sort option
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 02/20] perf tools powerpc: Fix build issue when DWARF support is disabled Arnaldo Carvalho de Melo
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Jiri Olsa, Corey Ashford, David Ahern,
	Frederic Weisbecker, Jean Pihet, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@redhat.com>

Adding support to add field(s) to default sort order via using the '+'
prefix, like for report:

  $ perf report
  Samples: 2K of event 'cycles', Event count (approx.): 882172583
  Overhead  Command  Shared Object        Symbol
     7.39%  swapper  [kernel.kallsyms]    [k] intel_idle
     1.97%  firefox  libpthread-2.17.so   [.] pthread_mutex_lock
     1.39%  firefox  [snd_hda_intel]      [k] azx_get_position
     1.11%  firefox  libpthread-2.17.so   [.] pthread_mutex_unlock

  $ perf report -s +cpu
  Samples: 2K of event 'cycles', Event count (approx.): 882172583
  Overhead  Command  Shared Object        Symbol                  CPU
     2.89%  swapper  [kernel.kallsyms]    [k] intel_idle          000
     2.61%  swapper  [kernel.kallsyms]    [k] intel_idle          002
     1.20%  swapper  [kernel.kallsyms]    [k] intel_idle          001
     0.82%  firefox  libpthread-2.17.so   [.] pthread_mutex_lock  002

Works in general for commands using --sort option.

v2 with changes suggested:
  - Use dynamic memory instead static buffer
  - Fix error message typo

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20140823125948.GA1193@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 1958637cf136..289df9d1e65a 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1446,12 +1446,47 @@ static const char *get_default_sort_order(void)
 	return default_sort_orders[sort__mode];
 }
 
+static int setup_sort_order(void)
+{
+	char *new_sort_order;
+
+	/*
+	 * Append '+'-prefixed sort order to the default sort
+	 * order string.
+	 */
+	if (!sort_order || is_strict_order(sort_order))
+		return 0;
+
+	if (sort_order[1] == '\0') {
+		error("Invalid --sort key: `+'");
+		return -EINVAL;
+	}
+
+	/*
+	 * We allocate new sort_order string, but we never free it,
+	 * because it's checked over the rest of the code.
+	 */
+	if (asprintf(&new_sort_order, "%s,%s",
+		     get_default_sort_order(), sort_order + 1) < 0) {
+		error("Not enough memory to set up --sort");
+		return -ENOMEM;
+	}
+
+	sort_order = new_sort_order;
+	return 0;
+}
+
 static int __setup_sorting(void)
 {
 	char *tmp, *tok, *str;
-	const char *sort_keys = sort_order;
+	const char *sort_keys;
 	int ret = 0;
 
+	ret = setup_sort_order();
+	if (ret)
+		return ret;
+
+	sort_keys = sort_order;
 	if (sort_keys == NULL) {
 		if (is_strict_order(field_order)) {
 			/*
-- 
1.9.3


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

* [PATCH 02/20] perf tools powerpc: Fix build issue when DWARF support is disabled
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 01/20] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 03/20] perf kvm stat report: Save pid string in opts.target.pid Arnaldo Carvalho de Melo
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Anton Blanchard, Ingo Molnar, Michael Ellerman,
	Paul Mackerras, Peter Zijlstra, Sukadev Bhattiprolu,
	Arnaldo Carvalho de Melo

From: Anton Blanchard <anton@samba.org>

The powerpc skip callchain code uses DWARF, so we must disable it if
DWARF is disabled.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20140825182506.2be6512d@kryten
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/powerpc/Makefile |  2 +-
 tools/perf/config/Makefile       | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index b92219b1900d..6f7782bea5dd 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -1,6 +1,6 @@
 ifndef NO_DWARF
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
+LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/skip-callchain-idx.o
 endif
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
-LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/skip-callchain-idx.o
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 75d4c237b03d..98c9fd174e98 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -48,10 +48,6 @@ ifneq ($(ARCH),$(filter $(ARCH),x86 arm))
   NO_LIBDW_DWARF_UNWIND := 1
 endif
 
-ifeq ($(ARCH),powerpc)
-  CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
-endif
-
 ifeq ($(LIBUNWIND_LIBS),)
   NO_LIBUNWIND := 1
 else
@@ -378,6 +374,12 @@ ifndef NO_LIBELF
   endif # NO_DWARF
 endif # NO_LIBELF
 
+ifeq ($(ARCH),powerpc)
+  ifndef NO_DWARF
+    CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
+  endif
+endif
+
 ifndef NO_LIBUNWIND
   ifneq ($(feature-libunwind), 1)
     msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
-- 
1.9.3


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

* [PATCH 03/20] perf kvm stat report: Save pid string in opts.target.pid
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 01/20] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 02/20] perf tools powerpc: Fix build issue when DWARF support is disabled Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 04/20] perf kvm stat report: Enable the target.system_wide flag Arnaldo Carvalho de Melo
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Alexander Yarygin, Christian Borntraeger,
	David Ahern, Jiri Olsa, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>

The 'perf kvm stat report' command uses the kvm->pid_str field to keep
the value of the --pid option. Let's use kvm->opts.target.pid instead.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1409579095-12963-2-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c   | 6 +++---
 tools/perf/util/kvm-stat.h | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 1a4ef9cd9d5f..646ec5d5de80 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1085,8 +1085,8 @@ static int read_events(struct perf_kvm_stat *kvm)
 
 static int parse_target_str(struct perf_kvm_stat *kvm)
 {
-	if (kvm->pid_str) {
-		kvm->pid_list = intlist__new(kvm->pid_str);
+	if (kvm->opts.target.pid) {
+		kvm->pid_list = intlist__new(kvm->opts.target.pid);
 		if (kvm->pid_list == NULL) {
 			pr_err("Error parsing process id string\n");
 			return -EINVAL;
@@ -1188,7 +1188,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 		OPT_STRING('k', "key", &kvm->sort_key, "sort-key",
 			    "key for sorting: sample(sort by samples number)"
 			    " time (sort by avg time)"),
-		OPT_STRING('p', "pid", &kvm->pid_str, "pid",
+		OPT_STRING('p', "pid", &kvm->opts.target.pid, "pid",
 			   "analyze events only for given process id(s)"),
 		OPT_END()
 	};
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
index 0b5a8cd2ee79..cf1d7913783b 100644
--- a/tools/perf/util/kvm-stat.h
+++ b/tools/perf/util/kvm-stat.h
@@ -92,7 +92,6 @@ struct perf_kvm_stat {
 	u64 lost_events;
 	u64 duration;
 
-	const char *pid_str;
 	struct intlist *pid_list;
 
 	struct rb_root result;
-- 
1.9.3


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

* [PATCH 04/20] perf kvm stat report: Enable the target.system_wide flag
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 03/20] perf kvm stat report: Save pid string in opts.target.pid Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 05/20] perf kvm stat report: Unify the title bar output Arnaldo Carvalho de Melo
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Alexander Yarygin, Christian Borntraeger,
	David Ahern, Jiri Olsa, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>

The 'perf kvm stat report' command can be used to analyze events either
for system wide or for specific pids.

Let's enable kvm->opts.target.system_wide flag when 'report' command is
running for system-wide analyzing. This helps to sync kvm->opts.target
values in 'report' and 'live' commands.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1409579095-12963-3-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 646ec5d5de80..84295ab6c4e1 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1207,6 +1207,9 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 					   kvm_events_report_options);
 	}
 
+	if (!kvm->opts.target.pid)
+		kvm->opts.target.system_wide = true;
+
 	return kvm_events_report_vcpu(kvm);
 }
 
-- 
1.9.3


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

* [PATCH 05/20] perf kvm stat report: Unify the title bar output
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 04/20] perf kvm stat report: Enable the target.system_wide flag Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 06/20] perf tools: Allow to specify lib compile variable for spec usage Arnaldo Carvalho de Melo
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Alexander Yarygin, Christian Borntraeger,
	David Ahern, Jiri Olsa, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>

The 'live' command prints additional information to the "Analyze events
for " title bar about the current target.  Let's print the same title
for the 'report' command.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1409579095-12963-4-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 84295ab6c4e1..f5d3ae483110 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -543,14 +543,12 @@ static void print_vcpu_info(struct perf_kvm_stat *kvm)
 
 	pr_info("Analyze events for ");
 
-	if (kvm->live) {
-		if (kvm->opts.target.system_wide)
-			pr_info("all VMs, ");
-		else if (kvm->opts.target.pid)
-			pr_info("pid(s) %s, ", kvm->opts.target.pid);
-		else
-			pr_info("dazed and confused on what is monitored, ");
-	}
+	if (kvm->opts.target.system_wide)
+		pr_info("all VMs, ");
+	else if (kvm->opts.target.pid)
+		pr_info("pid(s) %s, ", kvm->opts.target.pid);
+	else
+		pr_info("dazed and confused on what is monitored, ");
 
 	if (vcpu == -1)
 		pr_info("all VCPUs:\n\n");
-- 
1.9.3


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

* [PATCH 06/20] perf tools: Allow to specify lib compile variable for spec usage
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 05/20] perf kvm stat report: Unify the title bar output Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 07/20] perf tools: Let a user specify a PMU event without any config terms Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Corey Ashford, David Ahern,
	Frederic Weisbecker, Kyle McMartin, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

We need a way to specify $(lib) part of the installation path for
traceevent plugin libraries. Currently we use 'lib64' for x86_64 and
'lib' otherwise.

Instead of listing all possible values, this change allows the rpm spec
code to specify the correct $(lib) part based on processed architecture,
like

  $ make ... lib=%{_lib}

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Kyle McMartin <kyle@mcmartin.ca>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1408978552-17131-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/config/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 98c9fd174e98..58f609198c6d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -653,11 +653,13 @@ else
 sysconfdir = $(prefix)/etc
 ETC_PERFCONFIG = etc/perfconfig
 endif
+ifndef lib
 ifeq ($(IS_X86_64),1)
 lib = lib64
 else
 lib = lib
 endif
+endif # lib
 libdir = $(prefix)/$(lib)
 
 # Shell quote (do not use $(call) to accommodate ancient setups);
-- 
1.9.3


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

* [PATCH 07/20] perf tools: Let a user specify a PMU event without any config terms
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 06/20] perf tools: Allow to specify lib compile variable for spec usage Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 08/20] perf tools: Add perf-with-kcore script Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

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

This enables a PMU event to be specified in the form:

	pmu//

which is effectively the same as:

	pmu/config=0/

This patch is a precursor to defining default config for a PMU.

Further explanation extracted from lkml thread:

Imagine that the 'tsc' term did not exist.

Intel PT trace data would not contain TSC packets, and the decoder would
not know how to decode them.

Then imagine that a new version of the hardware adds 'tsc'.

It is such a useful feature that we want it by default, but older
versions of the tools don't know how to decode it, so the kernel cannot
turn it on by default.

It is similar to why the kernel does not select perf_event_attr.mmap2 by
default.

The kernel doesn't know whether the tool supports it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1408129739-17368-6-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c |  6 ++++++
 tools/perf/util/parse-events.y | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e34c81a0bcf3..e75628813968 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -645,6 +645,12 @@ int parse_events_add_pmu(struct list_head *list, int *idx,
 
 	memset(&attr, 0, sizeof(attr));
 
+	if (!head_config) {
+		attr.type = pmu->type;
+		evsel = __add_event(list, idx, &attr, NULL, pmu->cpus);
+		return evsel ? 0 : -ENOMEM;
+	}
+
 	if (perf_pmu__check_alias(pmu, head_config, &unit, &scale))
 		return -EINVAL;
 
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 0bc87ba46bf3..55fab6ad609a 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -210,6 +210,16 @@ PE_NAME '/' event_config '/'
 	parse_events__free_terms($3);
 	$$ = list;
 }
+|
+PE_NAME '/' '/'
+{
+	struct parse_events_evlist *data = _data;
+	struct list_head *list;
+
+	ALLOC_LIST(list);
+	ABORT_ON(parse_events_add_pmu(list, &data->idx, $1, NULL));
+	$$ = list;
+}
 
 value_sym:
 PE_VALUE_SYM_HW
-- 
1.9.3


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

* [PATCH 08/20] perf tools: Add perf-with-kcore script
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 07/20] perf tools: Let a user specify a PMU event without any config terms Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 09/20] perf tools: Let default config be defined for a PMU Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

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

Decoding an Intel PT trace of the kernel requires an accurate kernel
object image.  This is provided by making a copy of kcore.  However the
copy needs to be made under the same conditions as the original
recording, and then it needs to be associated with the perf.data file.
The perf-with-kcore script does that.

The script also checks the permissions on the buildid cache and can be
used to fix them.  That is needed for distributions where root does not
have a home directory and consequently writes to the same buildid cache
as the user, resulting in cached files that the user does not have
access to.

Example:

$ ./perf-with-kcore
Usage: perf-with-kcore <perf sub-command> <perf.data directory> [<sub-command options> [ -- <workload>]]
       <perf sub-command> can be record, script, report or inject
   or: perf-with-kcore fix_buildid_cache_permissions
$ ./perf-with-kcore record pt_uname -e intel_pt// -- uname
Recording
Using /home/ahunter/bin/perf
perf version 3.15.rc3.g4549ba
/home/ahunter/bin/perf record -o pt_uname/perf.data -e intel_pt//  -- uname
Linux
[ perf record: Woken up 3 times to write data ]
[ perf record: Captured and wrote 0.023 MB pt_uname/perf.data ]
Copying kcore
[sudo] password for ahunter:
Done
$ tools/perf/perf-with-kcore.sh script pt_uname | head
Using /home/ahunter/bin/perf
perf version 3.15.rc3.g4549ba
/home/ahunter/bin/perf script -i pt_uname/perf.data --kallsyms=pt_uname/kcore_dir/kallsyms
         swapper     0 [002] 161533.969666: sched:sched_switch: swapper/2:0 [120] R ==> perf:11316 [120]
          :11315 11315 [003] 161533.969704: sched:sched_switch: perf:11315 [120] S ==> swapper/3:0 [120]
          :11316 11316 [002] 161533.969783: sched:sched_switch: perf:11316 [120] R ==> migration/2:33 [0]
             :33    33 [002] 161533.969791: sched:sched_switch: migration/2:33 [0] S ==> swapper/2:0 [120]
         swapper     0 [003] 161533.969792: sched:sched_switch: swapper/3:0 [120] R ==> perf:11316 [120]
          :11316 11316 [003] 161533.970062: branches:                 0 [unknown] ([unknown]) => ffffffff810532fa native_write_msr_safe ([kernel.kallsyms])
          :11316 11316 [003] 161533.970062: branches:  ffffffff810532fd native_write_msr_safe ([kernel.kallsyms]) => ffffffff81035b31 pt_config_start ([kernel.kallsyms])

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1406786474-9306-30-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/.gitignore         |   1 +
 tools/perf/Makefile.perf      |   5 +-
 tools/perf/perf-with-kcore.sh | 259 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 264 insertions(+), 1 deletion(-)
 create mode 100644 tools/perf/perf-with-kcore.sh

diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 782d86e961b9..717221e98450 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -15,6 +15,7 @@ perf.data
 perf.data.old
 output.svg
 perf-archive
+perf-with-kcore
 tags
 TAGS
 cscope*
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 95e832b1bc3c..171f4e65601b 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -126,6 +126,7 @@ PYRF_OBJS =
 SCRIPT_SH =
 
 SCRIPT_SH += perf-archive.sh
+SCRIPT_SH += perf-with-kcore.sh
 
 grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
@@ -878,6 +879,8 @@ install-bin: all install-gtk
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
 	$(call QUIET_INSTALL, perf-archive) \
 		$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
+	$(call QUIET_INSTALL, perf-with-kcore) \
+		$(INSTALL) $(OUTPUT)perf-with-kcore -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
 ifndef NO_LIBPERL
 	$(call QUIET_INSTALL, perl-scripts) \
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
@@ -923,7 +926,7 @@ config-clean:
 	@$(MAKE) -C config/feature-checks clean >/dev/null
 
 clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
-	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
+	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
 	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf
 	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
diff --git a/tools/perf/perf-with-kcore.sh b/tools/perf/perf-with-kcore.sh
new file mode 100644
index 000000000000..c7ff90a90e4e
--- /dev/null
+++ b/tools/perf/perf-with-kcore.sh
@@ -0,0 +1,259 @@
+#!/bin/bash
+# perf-with-kcore: use perf with a copy of kcore
+# Copyright (c) 2014, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+
+set -e
+
+usage()
+{
+        echo "Usage: perf-with-kcore <perf sub-command> <perf.data directory> [<sub-command options> [ -- <workload>]]" >&2
+        echo "       <perf sub-command> can be record, script, report or inject" >&2
+        echo "   or: perf-with-kcore fix_buildid_cache_permissions" >&2
+        exit 1
+}
+
+find_perf()
+{
+	if [ -n "$PERF" ] ; then
+		return
+	fi
+	PERF=`which perf || true`
+	if [ -z "$PERF" ] ; then
+		echo "Failed to find perf" >&2
+	        exit 1
+	fi
+	if [ ! -x "$PERF" ] ; then
+		echo "Failed to find perf" >&2
+	        exit 1
+	fi
+	echo "Using $PERF"
+	"$PERF" version
+}
+
+copy_kcore()
+{
+	echo "Copying kcore"
+
+	if [ $EUID -eq 0 ] ; then
+		SUDO=""
+	else
+		SUDO="sudo"
+	fi
+
+	rm -f perf.data.junk
+	("$PERF" record -o perf.data.junk $PERF_OPTIONS -- sleep 60) >/dev/null 2>/dev/null &
+	PERF_PID=$!
+
+	# Need to make sure that perf has started
+	sleep 1
+
+	KCORE=$(($SUDO "$PERF" buildid-cache -v -f -k /proc/kcore >/dev/null) 2>&1)
+	case "$KCORE" in
+	"kcore added to build-id cache directory "*)
+		KCORE_DIR=${KCORE#"kcore added to build-id cache directory "}
+	;;
+	*)
+		kill $PERF_PID
+		wait >/dev/null 2>/dev/null || true
+		rm perf.data.junk
+		echo "$KCORE"
+		echo "Failed to find kcore" >&2
+		exit 1
+	;;
+	esac
+
+	kill $PERF_PID
+	wait >/dev/null 2>/dev/null || true
+	rm perf.data.junk
+
+	$SUDO cp -a "$KCORE_DIR" "$(pwd)/$PERF_DATA_DIR"
+	$SUDO rm -f "$KCORE_DIR/kcore"
+	$SUDO rm -f "$KCORE_DIR/kallsyms"
+	$SUDO rm -f "$KCORE_DIR/modules"
+	$SUDO rmdir "$KCORE_DIR"
+
+	KCORE_DIR_BASENAME=$(basename "$KCORE_DIR")
+	KCORE_DIR="$(pwd)/$PERF_DATA_DIR/$KCORE_DIR_BASENAME"
+
+	$SUDO chown $UID "$KCORE_DIR"
+	$SUDO chown $UID "$KCORE_DIR/kcore"
+	$SUDO chown $UID "$KCORE_DIR/kallsyms"
+	$SUDO chown $UID "$KCORE_DIR/modules"
+
+	$SUDO chgrp $GROUPS "$KCORE_DIR"
+	$SUDO chgrp $GROUPS "$KCORE_DIR/kcore"
+	$SUDO chgrp $GROUPS "$KCORE_DIR/kallsyms"
+	$SUDO chgrp $GROUPS "$KCORE_DIR/modules"
+
+	ln -s "$KCORE_DIR_BASENAME" "$PERF_DATA_DIR/kcore_dir"
+}
+
+fix_buildid_cache_permissions()
+{
+	if [ $EUID -ne 0 ] ; then
+		echo "This script must be run as root via sudo " >&2
+		exit 1
+	fi
+
+	if [ -z "$SUDO_USER" ] ; then
+		echo "This script must be run via sudo" >&2
+		exit 1
+	fi
+
+	USER_HOME=$(bash <<< "echo ~$SUDO_USER")
+
+	if [ "$HOME" != "$USER_HOME" ] ; then
+		echo "Fix unnecessary because root has a home: $HOME" >&2
+		exit 1
+	fi
+
+	echo "Fixing buildid cache permissions"
+
+	find "$USER_HOME/.debug" -xdev -type d          ! -user "$SUDO_USER" -ls -exec chown    "$SUDO_USER" \{\} \;
+	find "$USER_HOME/.debug" -xdev -type f -links 1 ! -user "$SUDO_USER" -ls -exec chown    "$SUDO_USER" \{\} \;
+	find "$USER_HOME/.debug" -xdev -type l          ! -user "$SUDO_USER" -ls -exec chown -h "$SUDO_USER" \{\} \;
+
+	if [ -n "$SUDO_GID" ] ; then
+		find "$USER_HOME/.debug" -xdev -type d          ! -group "$SUDO_GID" -ls -exec chgrp    "$SUDO_GID" \{\} \;
+		find "$USER_HOME/.debug" -xdev -type f -links 1 ! -group "$SUDO_GID" -ls -exec chgrp    "$SUDO_GID" \{\} \;
+		find "$USER_HOME/.debug" -xdev -type l          ! -group "$SUDO_GID" -ls -exec chgrp -h "$SUDO_GID" \{\} \;
+	fi
+
+	echo "Done"
+}
+
+check_buildid_cache_permissions()
+{
+	if [ $EUID -eq 0 ] ; then
+		return
+	fi
+
+	PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type d          ! -user "$USER" -print -quit)
+	PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type f -links 1 ! -user "$USER" -print -quit)
+	PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type l          ! -user "$USER" -print -quit)
+
+	PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type d          ! -group "$GROUPS" -print -quit)
+	PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type f -links 1 ! -group "$GROUPS" -print -quit)
+	PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type l          ! -group "$GROUPS" -print -quit)
+
+	if [ -n "$PERMISSIONS_OK" ] ; then
+		echo "*** WARNING *** buildid cache permissions may need fixing" >&2
+	fi
+}
+
+record()
+{
+	echo "Recording"
+
+	if [ $EUID -ne 0 ] ; then
+
+		if [ "$(cat /proc/sys/kernel/kptr_restrict)" -ne 0 ] ; then
+			echo "*** WARNING *** /proc/sys/kernel/kptr_restrict prevents access to kernel addresses" >&2
+		fi
+
+		if echo "$PERF_OPTIONS" | grep -q ' -a \|^-a \| -a$\|^-a$\| --all-cpus \|^--all-cpus \| --all-cpus$\|^--all-cpus$' ; then
+			echo "*** WARNING *** system-wide tracing without root access will not be able to read all necessary information from /proc" >&2
+		fi
+
+		if echo "$PERF_OPTIONS" | grep -q 'intel_pt\|intel_bts\| -I\|^-I' ; then
+			if [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -gt -1 ] ; then
+				echo "*** WARNING *** /proc/sys/kernel/perf_event_paranoid restricts buffer size and tracepoint (sched_switch) use" >&2
+			fi
+
+			if echo "$PERF_OPTIONS" | grep -q ' --per-thread \|^--per-thread \| --per-thread$\|^--per-thread$' ; then
+				true
+			elif echo "$PERF_OPTIONS" | grep -q ' -t \|^-t \| -t$\|^-t$' ; then
+				true
+			elif [ ! -r /sys/kernel/debug -o ! -x /sys/kernel/debug ] ; then
+				echo "*** WARNING *** /sys/kernel/debug permissions prevent tracepoint (sched_switch) use" >&2
+			fi
+		fi
+	fi
+
+	if [ -z "$1" ] ; then
+		echo "Workload is required for recording" >&2
+		usage
+	fi
+
+	if [ -e "$PERF_DATA_DIR" ] ; then
+		echo "'$PERF_DATA_DIR' exists" >&2
+		exit 1
+	fi
+
+	find_perf
+
+	mkdir "$PERF_DATA_DIR"
+
+	echo "$PERF record -o $PERF_DATA_DIR/perf.data $PERF_OPTIONS -- $*"
+	"$PERF" record -o "$PERF_DATA_DIR/perf.data" $PERF_OPTIONS -- $* || true
+
+	if rmdir "$PERF_DATA_DIR" > /dev/null 2>/dev/null ; then
+		exit 1
+	fi
+
+	copy_kcore
+
+	echo "Done"
+}
+
+subcommand()
+{
+	find_perf
+	check_buildid_cache_permissions
+	echo "$PERF $PERF_SUB_COMMAND -i $PERF_DATA_DIR/perf.data --kallsyms=$PERF_DATA_DIR/kcore_dir/kallsyms $*"
+	"$PERF" $PERF_SUB_COMMAND -i "$PERF_DATA_DIR/perf.data" "--kallsyms=$PERF_DATA_DIR/kcore_dir/kallsyms" $*
+}
+
+if [ "$1" = "fix_buildid_cache_permissions" ] ; then
+	fix_buildid_cache_permissions
+	exit 0
+fi
+
+PERF_SUB_COMMAND=$1
+PERF_DATA_DIR=$2
+shift || true
+shift || true
+
+if [ -z "$PERF_SUB_COMMAND" ] ; then
+	usage
+fi
+
+if [ -z "$PERF_DATA_DIR" ] ; then
+	usage
+fi
+
+case "$PERF_SUB_COMMAND" in
+"record")
+	while [ "$1" != "--" ] ; do
+		PERF_OPTIONS+="$1 "
+		shift || break
+	done
+	if [ "$1" != "--" ] ; then
+		echo "Options and workload are required for recording" >&2
+		usage
+	fi
+	shift
+	record $*
+;;
+"script")
+	subcommand $*
+;;
+"report")
+	subcommand $*
+;;
+"inject")
+	subcommand $*
+;;
+*)
+	usage
+;;
+esac
-- 
1.9.3


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

* [PATCH 09/20] perf tools: Let default config be defined for a PMU
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 08/20] perf tools: Add perf-with-kcore script Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 10/20] perf tools: Add perf_pmu__scan_file() Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

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

This allows default config terms to be provided for a PMU. So, for
example, when the Intel PT PMU is added, it will be possible to specify:

	intel_pt//

which will be the same as:

	intel_pt/tsc=1,noretcomp=0/

meaning that the trace should contain TSC timestamps and perform 'return
compression'.

An important consideration of this patch is that it must be possible to
overwrite the default values.  That has meant changing the logic so that
a zero value can replace a non-zero value.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1406786474-9306-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/pmu.c         |  2 +-
 tools/perf/util/parse-events.c |  7 ++++++-
 tools/perf/util/pmu.c          | 42 ++++++++++++++++++++++++++----------------
 tools/perf/util/pmu.h          |  9 ++++++++-
 4 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c
index 12b322fa3475..eeb68bb1972d 100644
--- a/tools/perf/tests/pmu.c
+++ b/tools/perf/tests/pmu.c
@@ -152,7 +152,7 @@ int test__pmu(void)
 		if (ret)
 			break;
 
-		ret = perf_pmu__config_terms(&formats, &attr, terms);
+		ret = perf_pmu__config_terms(&formats, &attr, terms, false);
 		if (ret)
 			break;
 
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e75628813968..61be3e695ec2 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -643,7 +643,12 @@ int parse_events_add_pmu(struct list_head *list, int *idx,
 	if (!pmu)
 		return -EINVAL;
 
-	memset(&attr, 0, sizeof(attr));
+	if (pmu->default_config) {
+		memcpy(&attr, pmu->default_config,
+		       sizeof(struct perf_event_attr));
+	} else {
+		memset(&attr, 0, sizeof(attr));
+	}
 
 	if (!head_config) {
 		attr.type = pmu->type;
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 9bf582750561..438bb261f391 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -2,6 +2,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <stdbool.h>
 #include <dirent.h>
 #include <api/fs/fs.h>
 #include <locale.h>
@@ -387,6 +388,12 @@ static struct cpu_map *pmu_cpumask(const char *name)
 	return cpus;
 }
 
+struct perf_event_attr *__attribute__((weak))
+perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
+{
+	return NULL;
+}
+
 static struct perf_pmu *pmu_lookup(const char *name)
 {
 	struct perf_pmu *pmu;
@@ -421,6 +428,9 @@ static struct perf_pmu *pmu_lookup(const char *name)
 	pmu->name = strdup(name);
 	pmu->type = type;
 	list_add_tail(&pmu->list, &pmus);
+
+	pmu->default_config = perf_pmu__get_default_config(pmu);
+
 	return pmu;
 }
 
@@ -479,28 +489,24 @@ pmu_find_format(struct list_head *formats, char *name)
 }
 
 /*
- * Returns value based on the format definition (format parameter)
+ * Sets value based on the format definition (format parameter)
  * and unformated value (value parameter).
- *
- * TODO maybe optimize a little ;)
  */
-static __u64 pmu_format_value(unsigned long *format, __u64 value)
+static void pmu_format_value(unsigned long *format, __u64 value, __u64 *v,
+			     bool zero)
 {
 	unsigned long fbit, vbit;
-	__u64 v = 0;
 
 	for (fbit = 0, vbit = 0; fbit < PERF_PMU_FORMAT_BITS; fbit++) {
 
 		if (!test_bit(fbit, format))
 			continue;
 
-		if (!(value & (1llu << vbit++)))
-			continue;
-
-		v |= (1llu << fbit);
+		if (value & (1llu << vbit++))
+			*v |= (1llu << fbit);
+		else if (zero)
+			*v &= ~(1llu << fbit);
 	}
-
-	return v;
 }
 
 /*
@@ -509,7 +515,8 @@ static __u64 pmu_format_value(unsigned long *format, __u64 value)
  */
 static int pmu_config_term(struct list_head *formats,
 			   struct perf_event_attr *attr,
-			   struct parse_events_term *term)
+			   struct parse_events_term *term,
+			   bool zero)
 {
 	struct perf_pmu_format *format;
 	__u64 *vp;
@@ -548,18 +555,19 @@ static int pmu_config_term(struct list_head *formats,
 	 * non-hardcoded terms, here's the place to translate
 	 * them into value.
 	 */
-	*vp |= pmu_format_value(format->bits, term->val.num);
+	pmu_format_value(format->bits, term->val.num, vp, zero);
 	return 0;
 }
 
 int perf_pmu__config_terms(struct list_head *formats,
 			   struct perf_event_attr *attr,
-			   struct list_head *head_terms)
+			   struct list_head *head_terms,
+			   bool zero)
 {
 	struct parse_events_term *term;
 
 	list_for_each_entry(term, head_terms, list)
-		if (pmu_config_term(formats, attr, term))
+		if (pmu_config_term(formats, attr, term, zero))
 			return -EINVAL;
 
 	return 0;
@@ -573,8 +581,10 @@ int perf_pmu__config_terms(struct list_head *formats,
 int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
 		     struct list_head *head_terms)
 {
+	bool zero = !!pmu->default_config;
+
 	attr->type = pmu->type;
-	return perf_pmu__config_terms(&pmu->format, attr, head_terms);
+	return perf_pmu__config_terms(&pmu->format, attr, head_terms, zero);
 }
 
 static struct perf_pmu_alias *pmu_find_alias(struct perf_pmu *pmu,
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 1c1e2eecbe1f..413b9a63c38d 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -13,9 +13,12 @@ enum {
 
 #define PERF_PMU_FORMAT_BITS 64
 
+struct perf_event_attr;
+
 struct perf_pmu {
 	char *name;
 	__u32 type;
+	struct perf_event_attr *default_config;
 	struct cpu_map *cpus;
 	struct list_head format;  /* HEAD struct perf_pmu_format -> list */
 	struct list_head aliases; /* HEAD struct perf_pmu_alias -> list */
@@ -27,7 +30,8 @@ int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
 		     struct list_head *head_terms);
 int perf_pmu__config_terms(struct list_head *formats,
 			   struct perf_event_attr *attr,
-			   struct list_head *head_terms);
+			   struct list_head *head_terms,
+			   bool zero);
 int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms,
 			  const char **unit, double *scale);
 struct list_head *perf_pmu__alias(struct perf_pmu *pmu,
@@ -46,4 +50,7 @@ void print_pmu_events(const char *event_glob, bool name_only);
 bool pmu_have_event(const char *pname, const char *name);
 
 int perf_pmu__test(void);
+
+struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu);
+
 #endif /* __PMU_H */
-- 
1.9.3


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

* [PATCH 10/20] perf tools: Add perf_pmu__scan_file()
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 09/20] perf tools: Let default config be defined for a PMU Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 11/20] perf tool: fix compilation for ARM Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Adrian Hunter, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Arnaldo Carvalho de Melo

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

Add a function to scan a sysfs file within the pmu device directory.

This will be used to read capability values from the PMU 'caps'
subdirectory.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1406786474-9306-8-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/pmu.c | 37 +++++++++++++++++++++++++++++++++++++
 tools/perf/util/pmu.h |  3 +++
 2 files changed, 40 insertions(+)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 438bb261f391..22a4ad5a927a 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -3,6 +3,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <stdbool.h>
+#include <stdarg.h>
 #include <dirent.h>
 #include <api/fs/fs.h>
 #include <locale.h>
@@ -804,3 +805,39 @@ bool pmu_have_event(const char *pname, const char *name)
 	}
 	return false;
 }
+
+static FILE *perf_pmu__open_file(struct perf_pmu *pmu, const char *name)
+{
+	struct stat st;
+	char path[PATH_MAX];
+	const char *sysfs;
+
+	sysfs = sysfs__mountpoint();
+	if (!sysfs)
+		return NULL;
+
+	snprintf(path, PATH_MAX,
+		 "%s" EVENT_SOURCE_DEVICE_PATH "%s/%s", sysfs, pmu->name, name);
+
+	if (stat(path, &st) < 0)
+		return NULL;
+
+	return fopen(path, "r");
+}
+
+int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt,
+			...)
+{
+	va_list args;
+	FILE *file;
+	int ret = EOF;
+
+	va_start(args, fmt);
+	file = perf_pmu__open_file(pmu, name);
+	if (file) {
+		ret = vfscanf(file, fmt, args);
+		fclose(file);
+	}
+	va_end(args);
+	return ret;
+}
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 413b9a63c38d..0f5c0a88fdc8 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -49,6 +49,9 @@ struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
 void print_pmu_events(const char *event_glob, bool name_only);
 bool pmu_have_event(const char *pname, const char *name);
 
+int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt,
+			...) __attribute__((format(scanf, 3, 4)));
+
 int perf_pmu__test(void);
 
 struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu);
-- 
1.9.3


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

* [PATCH 11/20] perf tool: fix compilation for ARM
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 10/20] perf tools: Add perf_pmu__scan_file() Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 12/20] perf tools: Disable kernel symbol demangling by default Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Stephane Eranian, David Ahern, Ingo Molnar,
	Jiri Olsa, Namhyung Kim, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Stephane Eranian <eranian@google.com>

This patch fixes ARM compile of the perf tool.  The debug.h header file
was missing from a couple of unwind related modules.

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20140905042103.GA3091@quad
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/arm/tests/dwarf-unwind.c    | 1 +
 tools/perf/arch/arm/util/unwind-libunwind.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c
index 9f870d27cb39..62eff847f91c 100644
--- a/tools/perf/arch/arm/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm/tests/dwarf-unwind.c
@@ -3,6 +3,7 @@
 #include "thread.h"
 #include "map.h"
 #include "event.h"
+#include "debug.h"
 #include "tests/tests.h"
 
 #define STACK_SIZE 8192
diff --git a/tools/perf/arch/arm/util/unwind-libunwind.c b/tools/perf/arch/arm/util/unwind-libunwind.c
index 729ed69a6664..62c397ed3d97 100644
--- a/tools/perf/arch/arm/util/unwind-libunwind.c
+++ b/tools/perf/arch/arm/util/unwind-libunwind.c
@@ -3,6 +3,7 @@
 #include <libunwind.h>
 #include "perf_regs.h"
 #include "../../util/unwind.h"
+#include "../../util/debug.h"
 
 int libunwind__arch_reg_id(int regnum)
 {
-- 
1.9.3


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

* [PATCH 12/20] perf tools: Disable kernel symbol demangling by default
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 11/20] perf tool: fix compilation for ARM Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 13/20] perf tools: Fix GNU-only grep usage in Makefile Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Avi Kivity, Jiri Olsa, Arnaldo Carvalho de Melo

From: Avi Kivity <avi@cloudius-systems.com>

Some Linux symbols (for example __vt_event_wait) are interpreted by the
demangler as C++ mangled names, which of course they aren't.

Disable kernel symbol demangling by default to avoid this, and allow
enabling it with a new option --demangle-kernel for those who wish it.

Reported-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1410581705-26968-1-git-send-email-avi@cloudius-systems.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-probe.txt  | 3 +++
 tools/perf/Documentation/perf-report.txt | 3 +++
 tools/perf/Documentation/perf-top.txt    | 3 +++
 tools/perf/builtin-probe.c               | 2 ++
 tools/perf/builtin-report.c              | 2 ++
 tools/perf/builtin-top.c                 | 2 ++
 tools/perf/util/symbol-elf.c             | 7 ++++++-
 tools/perf/util/symbol.c                 | 1 +
 tools/perf/util/symbol.h                 | 1 +
 9 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index 1513935c399b..aaa869be3dc1 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -104,6 +104,9 @@ OPTIONS
 	Specify path to the executable or shared library file for user
 	space tracing. Can also be used with --funcs option.
 
+--demangle-kernel::
+	Demangle kernel symbols.
+
 In absence of -m/-x options, perf probe checks if the first argument after
 the options is an absolute path name. If its an absolute path, perf probe
 uses it as a target module/target user space binary to probe.
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index d561e0214f52..0927bf4e6c2a 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -276,6 +276,9 @@ OPTIONS
 	Demangle symbol names to human readable form. It's enabled by default,
 	disable with --no-demangle.
 
+--demangle-kernel::
+	Demangle kernel symbol names to human readable form (for C++ kernels).
+
 --mem-mode::
 	Use the data addresses of samples in addition to instruction addresses
 	to build the histograms.  To generate meaningful output, the perf.data
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index 28fdee394880..3265b1070518 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -98,6 +98,9 @@ Default is to monitor all CPUS.
 --hide_user_symbols::
         Hide user symbols.
 
+--demangle-kernel::
+        Demangle kernel symbols.
+
 -D::
 --dump-symtab::
         Dump the symbol table used for profiling.
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 347729e29a92..4d6858dbebea 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -376,6 +376,8 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 			"target executable name or path", opt_set_target),
 	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
 		    "Disable symbol demangling"),
+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
 	OPT_END()
 	};
 	int ret;
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3da59a87ec7c..8c0b3f22412a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -680,6 +680,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
 		   "objdump binary to use for disassembly and annotations"),
 	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
 		    "Disable symbol demangling"),
+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
 	OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"),
 	OPT_CALLBACK(0, "percent-limit", &report, "percent",
 		     "Don't show entries under that percent", parse_percent_limit),
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 9848e270b92c..7da2c46ea38f 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1142,6 +1142,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 		    "Interleave source code with assembly code (default)"),
 	OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw,
 		    "Display raw encoding of assembly instructions (default)"),
+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
 	OPT_STRING(0, "objdump", &objdump_path, "path",
 		    "objdump binary to use for disassembly and annotations"),
 	OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 9fb5e9e9f161..9c9b27fbc78d 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -680,6 +680,11 @@ static u64 ref_reloc(struct kmap *kmap)
 	return 0;
 }
 
+static bool want_demangle(bool is_kernel_sym)
+{
+	return is_kernel_sym ? symbol_conf.demangle_kernel : symbol_conf.demangle;
+}
+
 int dso__load_sym(struct dso *dso, struct map *map,
 		  struct symsrc *syms_ss, struct symsrc *runtime_ss,
 		  symbol_filter_t filter, int kmodule)
@@ -938,7 +943,7 @@ new_symbol:
 		 * DWARF DW_compile_unit has this, but we don't always have access
 		 * to it...
 		 */
-		if (symbol_conf.demangle) {
+		if (want_demangle(dso->kernel || kmodule)) {
 			int demangle_flags = DMGL_NO_OPTS;
 			if (verbose)
 				demangle_flags = DMGL_PARAMS | DMGL_ANSI;
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index ac098a3c2a31..1adb143867e3 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -34,6 +34,7 @@ struct symbol_conf symbol_conf = {
 	.try_vmlinux_path	= true,
 	.annotate_src		= true,
 	.demangle		= true,
+	.demangle_kernel	= false,
 	.cumulate_callchain	= true,
 	.show_hist_headers	= true,
 	.symfs			= "",
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 3f95ea0357e3..bec4b7bd09de 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -120,6 +120,7 @@ struct symbol_conf {
 			annotate_src,
 			event_group,
 			demangle,
+			demangle_kernel,
 			filter_relative,
 			show_hist_headers;
 	const char	*vmlinux_name,
-- 
1.9.3


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

* [PATCH 13/20] perf tools: Fix GNU-only grep usage in Makefile
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 12/20] perf tools: Disable kernel symbol demangling by default Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 14/20] perf tools: Don't include sys/poll.h directly Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, John Spencer, Arnaldo Carvalho de Melo

From: John Spencer <maillist-linux@barfooze.de>

This makes it work with non-GNU grep's as well.

Signed-off-by: John Spencer <maillist-linux@barfooze.de>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: http://thread.gmane.org/gmane.linux.kernel.perf.user/1686
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/config/utilities.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/config/utilities.mak b/tools/perf/config/utilities.mak
index 4d985e0f03f5..7076a62d0ff7 100644
--- a/tools/perf/config/utilities.mak
+++ b/tools/perf/config/utilities.mak
@@ -132,7 +132,7 @@ endef
 #
 # Usage: bool-value = $(call is-absolute,path)
 #
-is-absolute = $(shell echo $(shell-sq) | grep ^/ -q && echo y)
+is-absolute = $(shell echo $(shell-sq) | grep -q ^/ && echo y)
 
 # lookup
 #
-- 
1.9.3


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

* [PATCH 14/20] perf tools: Don't include sys/poll.h directly
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 13/20] perf tools: Fix GNU-only grep usage in Makefile Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 15/20] perf tools: define _DEFAULT_SOURCE for glibc_2.20 Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

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

Include poll.h instead.

Fixes the following warning in systems with musl's libc:

  /usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include
  <sys/poll.h> to <poll.h> [-Wcpp]

Reported-by: John Spencer <maillist-linux@barfooze.de>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://thread.gmane.org/gmane.linux.kernel.perf.user/1687/focus=1690
Link: http://lkml.kernel.org/n/tip-k4ocrq1de3fk146oevy346bi@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/bench/sched-messaging.c | 2 +-
 tools/perf/builtin-top.c           | 2 +-
 tools/perf/util/util.h             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 52a56599a543..d7f281c2828d 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -26,7 +26,7 @@
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/time.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <limits.h>
 #include <err.h>
 
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 7da2c46ea38f..e13864be2acb 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -59,7 +59,7 @@
 
 #include <sys/syscall.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/prctl.h>
 #include <sys/wait.h>
 #include <sys/uio.h>
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index d6a79b1fb28c..6ad2b5e3d5bb 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -64,7 +64,7 @@
 #include <regex.h>
 #include <utime.h>
 #include <sys/wait.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <inttypes.h>
-- 
1.9.3


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

* [PATCH 15/20] perf tools: define _DEFAULT_SOURCE for glibc_2.20
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 14/20] perf tools: Don't include sys/poll.h directly Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 16/20] perf symbols: Ignore stripped vmlinux and fallback to kallsyms Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Chanho Park, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Chanho Park <chanho61.park@samsung.com>

_BSD_SOURCE was deprecated in favour of _DEFAULT_SOURCE since glibc
2.20[1]. To avoid build warning on glibc2.20, _DEFAULT_SOURCE should
also be defined.

[1]: https://sourceware.org/glibc/wiki/Release/2.20

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1410487817-13403-1-git-send-email-chanho61.park@samsung.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/util.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 6ad2b5e3d5bb..80bfdaa0e2a4 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -39,6 +39,8 @@
 
 #define _ALL_SOURCE 1
 #define _BSD_SOURCE 1
+/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */
+#define _DEFAULT_SOURCE 1
 #define HAS_BOOL
 
 #include <unistd.h>
-- 
1.9.3


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

* [PATCH 16/20] perf symbols: Ignore stripped vmlinux and fallback to kallsyms
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 15/20] perf tools: define _DEFAULT_SOURCE for glibc_2.20 Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 17/20] perf symbols: Add path to Ubuntu kernel debuginfo file Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Anton Blanchard, Ingo Molnar, Paul Mackerras,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Anton Blanchard <anton@samba.org>

If a vmlinux is stripped, perf will use it and ignore kallsyms. We
end up with useless profiles where everything maps to a few
runtime symbols:

    63.39%       swapper  [kernel.kallsyms]   [k] hcall_real_table
     4.90%      beam.smp  [kernel.kallsyms]   [k] hcall_real_table
     4.44%      beam.smp  [kernel.kallsyms]   [k] __sched_text_start
     3.72%      beam.smp  [kernel.kallsyms]   [k] __run_at_kexec

Detect this case and fallback to using kallsyms. This fixes the issue:

    62.81%       swapper  [kernel.kallsyms]   [k] snooze_loop
     4.44%      beam.smp  [kernel.kallsyms]   [k] __schedule
     0.91%      beam.smp  [kernel.kallsyms]   [k] _switch
     0.73%      beam.smp  [kernel.kallsyms]   [k] put_prev_entity

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20140909085929.4a5a81f0@kryten
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol-elf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 9c9b27fbc78d..2a92e10317c5 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -717,6 +717,14 @@ int dso__load_sym(struct dso *dso, struct map *map,
 		symbols__delete(&dso->symbols[map->type]);
 
 	if (!syms_ss->symtab) {
+		/*
+		 * If the vmlinux is stripped, fail so we will fall back
+		 * to using kallsyms. The vmlinux runtime symbols aren't
+		 * of much use.
+		 */
+		if (dso->kernel)
+			goto out_elf_end;
+
 		syms_ss->symtab  = syms_ss->dynsym;
 		syms_ss->symshdr = syms_ss->dynshdr;
 	}
-- 
1.9.3


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

* [PATCH 17/20] perf symbols: Add path to Ubuntu kernel debuginfo file
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 16/20] perf symbols: Ignore stripped vmlinux and fallback to kallsyms Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 18/20] perf probe: Do not access kallsyms when analyzing user binaries Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Anton Blanchard, Jiri Olsa, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Anton Blanchard <anton@samba.org>

Ubuntu places the kernel debuginfo in /usr/lib/debug/boot/vmlinux-*

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
echo Link: http://lkml.kernel.org/n/tip-`ranpwd -l 24`@git.kernel.org
Link: http://lkml.kernel.org/r/20140909091152.2698c0f7@kryten
[ Adapted it to use the perf.data file kernel version as in 0a7e6d1b6844 ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 1adb143867e3..be84f7a9838b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1757,7 +1757,7 @@ static int vmlinux_path__init(struct perf_session_env *env)
 	char bf[PATH_MAX];
 	char *kernel_version;
 
-	vmlinux_path = malloc(sizeof(char *) * 5);
+	vmlinux_path = malloc(sizeof(char *) * 6);
 	if (vmlinux_path == NULL)
 		return -1;
 
@@ -1788,6 +1788,12 @@ static int vmlinux_path__init(struct perf_session_env *env)
 	if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
 		goto out_fail;
 	++vmlinux_path__nr_entries;
+	snprintf(bf, sizeof(bf), "/usr/lib/debug/boot/vmlinux-%s",
+		 kernel_version);
+	vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
+	if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
+		goto out_fail;
+        ++vmlinux_path__nr_entries;
 	snprintf(bf, sizeof(bf), "/lib/modules/%s/build/vmlinux", kernel_version);
 	vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
 	if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
-- 
1.9.3


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

* [PATCH 18/20] perf probe: Do not access kallsyms when analyzing user binaries
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 17/20] perf symbols: Add path to Ubuntu kernel debuginfo file Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 19/20] perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masami Hiramatsu, david lerner, linux-perf-users,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Do not access kallsyms to show available variables and show source lines
in user binaries.

This behavior always requires the root privilege when sysctl sets
kernel.kptr_restrict=1, but we don't need it just for analyzing user
binaries.

Without this patch (by normal user, kptr_restrict=1):
  ----
  $ perf probe -x ./perf -V add_cmdname
  Failed to init vmlinux path.
    Error: Failed to show vars.
  $ perf probe -x ./perf -L add_cmdname
  Failed to init vmlinux path.
    Error: Failed to show lines.
  ----

With this patch:
  ----
  $ perf probe -x ./perf -V add_cmdname
  Available variables at add_cmdname
          @<perf_unknown_cmd_config+144>
                  (No matched variables)
          @<list_commands_in_dir+160>
                  (No matched variables)
          @<add_cmdname+0>
                  char*   name
                  size_t  len
                  struct cmdnames*        cmds
  $ perf probe -x ./perf -L add_cmdname
  <add_cmdname@/home/fedora/ksrc/linux-3/tools/perf/util/help.c:0>
        0  void add_cmdname(struct cmdnames *cmds, const char *name, size_t len)
        1  {
        2         struct cmdname *ent = malloc(sizeof(*ent) + len + 1);

        4         ent->len = len;
        5         memcpy(ent->name, name, len);
        6         ent->name[len] = 0;
  ...
  ----

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: david lerner <dlernerdroid@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20140917084054.3722.73975.stgit@kbuild-f20.novalocal
[ Added missing 'bool user' argument to the !DWARF show_line_range() stub ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-probe.c    | 3 ++-
 tools/perf/util/probe-event.c | 9 +++++----
 tools/perf/util/probe-event.h | 3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 4d6858dbebea..04412b4770a2 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -472,7 +472,8 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 			usage_with_options(probe_usage, options);
 		}
 
-		ret = show_line_range(&params.line_range, params.target);
+		ret = show_line_range(&params.line_range, params.target,
+				      params.uprobes);
 		if (ret < 0)
 			pr_err_with_code("  Error: Failed to show lines.", ret);
 		return ret;
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index f73595fc0627..be37b5aca335 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -697,11 +697,11 @@ end:
 	return ret;
 }
 
-int show_line_range(struct line_range *lr, const char *module)
+int show_line_range(struct line_range *lr, const char *module, bool user)
 {
 	int ret;
 
-	ret = init_symbol_maps(false);
+	ret = init_symbol_maps(user);
 	if (ret < 0)
 		return ret;
 	ret = __show_line_range(lr, module);
@@ -776,7 +776,7 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs,
 	int i, ret = 0;
 	struct debuginfo *dinfo;
 
-	ret = init_symbol_maps(false);
+	ret = init_symbol_maps(pevs->uprobes);
 	if (ret < 0)
 		return ret;
 
@@ -822,7 +822,8 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 }
 
 int show_line_range(struct line_range *lr __maybe_unused,
-		    const char *module __maybe_unused)
+		    const char *module __maybe_unused,
+		    bool user __maybe_unused)
 {
 	pr_warning("Debuginfo-analysis is not supported.\n");
 	return -ENOSYS;
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index 776c9347a3b6..e01e9943139f 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -128,7 +128,8 @@ extern int add_perf_probe_events(struct perf_probe_event *pevs, int npevs,
 				 bool force_add);
 extern int del_perf_probe_events(struct strlist *dellist);
 extern int show_perf_probe_events(void);
-extern int show_line_range(struct line_range *lr, const char *module);
+extern int show_line_range(struct line_range *lr, const char *module,
+			   bool user);
 extern int show_available_vars(struct perf_probe_event *pevs, int npevs,
 			       int max_probe_points, const char *module,
 			       struct strfilter *filter, bool externs);
-- 
1.9.3


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

* [PATCH 19/20] perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 18/20] perf probe: Do not access kallsyms when analyzing user binaries Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-17 21:24 ` [PATCH 20/20] perf record: Use ring buffer consume method to look like other tools Arnaldo Carvalho de Melo
  2014-09-19  5:15 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masami Hiramatsu, david lerner, linux-perf-user,
	yrl.pp-manager.tt, Arnaldo Carvalho de Melo

From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Do not use dwfl_module_addrsym if dwarf_diename can find the symbol
name, since dwfl_module_addrsym can be failed on shared libraries.

Without this patch
  ----
  $ perf probe -x ../lib/traceevent/libtraceevent.so -V create_arg_op
  Failed to find symbol at 0x11df1
  Failed to find the address of create_arg_op
    Error: Failed to show vars.
  ----
With this patch
  ----
  $ perf probe -x ../lib/traceevent/libtraceevent.so -V create_arg_op
  Available variables at create_arg_op
          @<create_arg_op+0>
                  enum filter_op_type     btype
                  struct filter_arg*      arg
  ----

This bug was reported on linux-perf-users@vger.kernel.org.

Reported-by: david lerner <dlernerdroid@gmail.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: david lerner <dlernerdroid@gmail.com>
Cc: linux-perf-user@vger.kernel.org
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://permalink.gmane.org/gmane.linux.kernel.perf.user/1691
Link: http://lkml.kernel.org/r/20140917084101.3722.25299.stgit@kbuild-f20.novalocal
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-finder.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 9c593561aa71..c7918f83b300 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -609,14 +609,18 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod,
 		return -EINVAL;
 	}
 
-	/* Get an appropriate symbol from symtab */
-	symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
+	symbol = dwarf_diename(sp_die);
 	if (!symbol) {
-		pr_warning("Failed to find symbol at 0x%lx\n",
-			   (unsigned long)paddr);
-		return -ENOENT;
+		/* Try to get the symbol name from symtab */
+		symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
+		if (!symbol) {
+			pr_warning("Failed to find symbol at 0x%lx\n",
+				   (unsigned long)paddr);
+			return -ENOENT;
+		}
+		eaddr = sym.st_value;
 	}
-	tp->offset = (unsigned long)(paddr - sym.st_value);
+	tp->offset = (unsigned long)(paddr - eaddr);
 	tp->address = (unsigned long)paddr;
 	tp->symbol = strdup(symbol);
 	if (!tp->symbol)
-- 
1.9.3


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

* [PATCH 20/20] perf record: Use ring buffer consume method to look like other tools
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 19/20] perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name Arnaldo Carvalho de Melo
@ 2014-09-17 21:24 ` Arnaldo Carvalho de Melo
  2014-09-19  5:15 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
  20 siblings, 0 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-17 21:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

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

All builtins that consume events from perf's ring buffer now end up
calling perf_evlist__mmap_consume(), which will allow unmapping the ring
buffer when all the fds gets closed and all events in the buffer
consumed.

This is in preparation for the patchkit that will notice POLLHUP on
perf events file descriptors.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-8vhaeeoq11ppz0713el4xcps@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 87e28a4e33ba..a1b040394170 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -65,8 +65,9 @@ static int process_synthesized_event(struct perf_tool *tool,
 	return record__write(rec, event, event->header.size);
 }
 
-static int record__mmap_read(struct record *rec, struct perf_mmap *md)
+static int record__mmap_read(struct record *rec, int idx)
 {
+	struct perf_mmap *md = &rec->evlist->mmap[idx];
 	unsigned int head = perf_mmap__read_head(md);
 	unsigned int old = md->prev;
 	unsigned char *data = md->base + page_size;
@@ -102,8 +103,7 @@ static int record__mmap_read(struct record *rec, struct perf_mmap *md)
 	}
 
 	md->prev = old;
-	perf_mmap__write_tail(md, old);
-
+	perf_evlist__mmap_consume(rec->evlist, idx);
 out:
 	return rc;
 }
@@ -245,7 +245,7 @@ static int record__mmap_read_all(struct record *rec)
 
 	for (i = 0; i < rec->evlist->nr_mmaps; i++) {
 		if (rec->evlist->mmap[i].base) {
-			if (record__mmap_read(rec, &rec->evlist->mmap[i]) != 0) {
+			if (record__mmap_read(rec, i) != 0) {
 				rc = -1;
 				goto out;
 			}
-- 
1.9.3


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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (19 preceding siblings ...)
  2014-09-17 21:24 ` [PATCH 20/20] perf record: Use ring buffer consume method to look like other tools Arnaldo Carvalho de Melo
@ 2014-09-19  5:15 ` Ingo Molnar
  20 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2014-09-19  5:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Yarygin, Anton Blanchard,
	Avi Kivity, Chanho Park, Christian Borntraeger, Corey Ashford,
	David Ahern, david lerner, Don Zickus, Frederic Weisbecker,
	Jean Pihet, Jiri Olsa, John Spencer, Kyle McMartin,
	linux-perf-users, Masami Hiramatsu, Michael Ellerman,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Sukadev Bhattiprolu, yrl.pp-manager.tt,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit c88f2096136416b261bd3647cc260935f6e95805:
> 
>   perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path (2014-09-16 10:30:36 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to e5685730e2c620f97bc12380e9370e857e5bd7a7:
> 
>   perf record: Use ring buffer consume method to look like other tools (2014-09-17 18:01:43 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> o Add +field argument support for --sort option (Jiri Olsa)
> 
> o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu)
> 
> o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard)
> 
> o Add path to Ubuntu kernel debuginfo file (Anton Blanchard)
> 
> o Disable kernel symbol demangling by default (Avi Kivity)
> 
> Infrastructure:
> 
> o More intel PT prep work, from Adrian Hunter, including:
> 
>   - Let a user specify a PMU event without any config terms
>   - Add perf-with-kcore script
>   - Let default config be defined for a PMU
>   - Add perf_pmu__scan_file()
> 
> o "perf kvm stat report" improvements by Alexander Yarygin:
>   o  Save pid string in opts.target.pid
>   o  Enable the target.system_wide flag
>   o  Unify the title bar output
> 
> o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard)
> 
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
> 
> o Fix build on ARM (Stephane Eranian)
> 
> o Fix build on powerpc when DWARF support is disabled (Anton Blanchard)
> 
> o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo)
> 
> o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo)
> 
> Chanho Park (1):
>   perf tools: define _DEFAULT_SOURCE for glibc_2.20
> 
> o Allow to specify lib compile variable for spec usage (Jiri Olsa)
> 
> o Fix GNU-only grep usage in Makefile (John Spencer)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (4):
>       perf tools: Let a user specify a PMU event without any config terms
>       perf tools: Add perf-with-kcore script
>       perf tools: Let default config be defined for a PMU
>       perf tools: Add perf_pmu__scan_file()
> 
> Alexander Yarygin (3):
>       perf kvm stat report: Save pid string in opts.target.pid
>       perf kvm stat report: Enable the target.system_wide flag
>       perf kvm stat report: Unify the title bar output
> 
> Anton Blanchard (3):
>       perf tools powerpc: Fix build issue when DWARF support is disabled
>       perf symbols: Ignore stripped vmlinux and fallback to kallsyms
>       perf symbols: Add path to Ubuntu kernel debuginfo file
> 
> Arnaldo Carvalho de Melo (2):
>       perf tools: Don't include sys/poll.h directly
>       perf record: Use ring buffer consume method to look like other tools
> 
> Avi Kivity (1):
>       perf tools: Disable kernel symbol demangling by default
> 
> Chanho Park (1):
>       perf tools: define _DEFAULT_SOURCE for glibc_2.20
> 
> Jiri Olsa (2):
>       perf tools: Add +field argument support for --sort option
>       perf tools: Allow to specify lib compile variable for spec usage
> 
> John Spencer (1):
>       perf tools: Fix GNU-only grep usage in Makefile
> 
> Masami Hiramatsu (2):
>       perf probe: Do not access kallsyms when analyzing user binaries
>       perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name
> 
> Stephane Eranian (1):
>       perf tool: fix compilation for ARM
> 
>  tools/perf/.gitignore                       |   1 +
>  tools/perf/Documentation/perf-probe.txt     |   3 +
>  tools/perf/Documentation/perf-report.txt    |   3 +
>  tools/perf/Documentation/perf-top.txt       |   3 +
>  tools/perf/Makefile.perf                    |   5 +-
>  tools/perf/arch/arm/tests/dwarf-unwind.c    |   1 +
>  tools/perf/arch/arm/util/unwind-libunwind.c |   1 +
>  tools/perf/arch/powerpc/Makefile            |   2 +-
>  tools/perf/bench/sched-messaging.c          |   2 +-
>  tools/perf/builtin-kvm.c                    |  23 +--
>  tools/perf/builtin-probe.c                  |   5 +-
>  tools/perf/builtin-record.c                 |   8 +-
>  tools/perf/builtin-report.c                 |   2 +
>  tools/perf/builtin-top.c                    |   4 +-
>  tools/perf/config/Makefile                  |  12 +-
>  tools/perf/config/utilities.mak             |   2 +-
>  tools/perf/perf-with-kcore.sh               | 259 ++++++++++++++++++++++++++++
>  tools/perf/tests/pmu.c                      |   2 +-
>  tools/perf/util/kvm-stat.h                  |   1 -
>  tools/perf/util/parse-events.c              |  13 +-
>  tools/perf/util/parse-events.y              |  10 ++
>  tools/perf/util/pmu.c                       |  79 +++++++--
>  tools/perf/util/pmu.h                       |  12 +-
>  tools/perf/util/probe-event.c               |   9 +-
>  tools/perf/util/probe-event.h               |   3 +-
>  tools/perf/util/probe-finder.c              |  16 +-
>  tools/perf/util/sort.c                      |  37 +++-
>  tools/perf/util/symbol-elf.c                |  15 +-
>  tools/perf/util/symbol.c                    |   9 +-
>  tools/perf/util/symbol.h                    |   1 +
>  tools/perf/util/util.h                      |   4 +-
>  31 files changed, 487 insertions(+), 60 deletions(-)
>  create mode 100644 tools/perf/perf-with-kcore.sh

Pulled into tip:perf/core, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2017-03-28  1:38 Arnaldo Carvalho de Melo
@ 2017-03-28  5:45 ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2017-03-28  5:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	David Ahern, Jiri Olsa, Kan Liang, Masami Hiramatsu,
	Milian Wolff, Namhyung Kim, Peter Zijlstra, Ravi Bangoria,
	Sukadev Bhattiprolu, Taeung Song, Tommi Rantala, Wang Nan,
	Yao Jin, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92:
> 
>   Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170327
> 
> for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de:
> 
>   perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Handle inline functions in callchains (Jin Yao)
> 
> - Enable sorting by srcline as key (Milian Wolff)
> 
> Fixes:
> 
> - Fix no_size logic in addr_filter__resolve_kernel_syms() in the
>   auxtrace code (Adrian Hunter)
> 
> - Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo)
> 
> - Fix divide by zero when calculating percent for an event in a group in
>   the annotate by source line code (Taeung Song)
> 
> - build-id files now aren't anymore symlinks, their parent directories
>   are, so readlink the later (Taeung Song)
> 
> - Assorted fixes for null termination problems, mostly related to
>   readlink, detected by valgrind (Tommi Rantala)
> 
> Infrastructure:
> 
> - Make vfs_getname probe point logic in 'perf trace' more robust
>   wrt length of pathname (Arnaldo Carvalho de Melo)
> 
> - Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo)
> 
> - Show 'perf list sdt' option in man page (Ravi Bangoria)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (1):
>       perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()
> 
> Arnaldo Carvalho de Melo (4):
>       perf trace: Check for vfs_getname.pathname length
>       perf trace: Fix up error path indentation
>       perf trace: Fixup thread refcounting
>       perf tools: Remove unused 'prefix' from builtin functions
> 
> Jin Yao (5):
>       perf report: Refactor common code in srcline.c
>       perf report: Find the inline stack for a given address
>       perf report: Introduce --inline option
>       perf report: Show inline stack for stdio mode
>       perf report: Show inline stack for browser mode
> 
> Milian Wolff (1):
>       perf report: Enable sorting by srcline as key
> 
> Ravi Bangoria (1):
>       perf list sdt: Show option in man page
> 
> Taeung Song (2):
>       perf annotate: Fix a bug following symbolic link of a build-id file
>       perf annotate: Fix a bug of division by zero when calculating percent
> 
> Tommi Rantala (6):
>       perf buildid: Do not update SDT cache with null filename
>       perf buildid: Do not assume that readlink() returns a null terminated string
>       perf tests: Do not assume that readlink() returns a null terminated string
>       perf utils: use sizeof(buf) - 1 in readlink() call
>       perf utils: Null terminate buf in read_ftrace_printk()
>       perf utils: Readlink /proc/self/exe to find the perf binary
> 
>  tools/perf/Documentation/perf-list.txt   |   4 +-
>  tools/perf/Documentation/perf-report.txt |   5 +
>  tools/perf/bench/bench.h                 |  20 +--
>  tools/perf/bench/futex-hash.c            |   3 +-
>  tools/perf/bench/futex-lock-pi.c         |   3 +-
>  tools/perf/bench/futex-requeue.c         |   3 +-
>  tools/perf/bench/futex-wake-parallel.c   |   3 +-
>  tools/perf/bench/futex-wake.c            |   3 +-
>  tools/perf/bench/mem-functions.c         |   4 +-
>  tools/perf/bench/numa.c                  |   2 +-
>  tools/perf/bench/sched-messaging.c       |   3 +-
>  tools/perf/bench/sched-pipe.c            |   2 +-
>  tools/perf/builtin-annotate.c            |   2 +-
>  tools/perf/builtin-bench.c               |  12 +-
>  tools/perf/builtin-buildid-cache.c       |   3 +-
>  tools/perf/builtin-buildid-list.c        |   3 +-
>  tools/perf/builtin-c2c.c                 |   4 +-
>  tools/perf/builtin-config.c              |   2 +-
>  tools/perf/builtin-data.c                |   9 +-
>  tools/perf/builtin-diff.c                |   2 +-
>  tools/perf/builtin-evlist.c              |   2 +-
>  tools/perf/builtin-ftrace.c              |   2 +-
>  tools/perf/builtin-help.c                |   2 +-
>  tools/perf/builtin-inject.c              |   2 +-
>  tools/perf/builtin-kallsyms.c            |   2 +-
>  tools/perf/builtin-kmem.c                |   4 +-
>  tools/perf/builtin-kvm.c                 |  16 +-
>  tools/perf/builtin-list.c                |   2 +-
>  tools/perf/builtin-lock.c                |   6 +-
>  tools/perf/builtin-mem.c                 |   6 +-
>  tools/perf/builtin-probe.c               |   6 +-
>  tools/perf/builtin-record.c              |   2 +-
>  tools/perf/builtin-report.c              |   4 +-
>  tools/perf/builtin-sched.c               |   6 +-
>  tools/perf/builtin-script.c              |   4 +-
>  tools/perf/builtin-stat.c                |   2 +-
>  tools/perf/builtin-timechart.c           |   7 +-
>  tools/perf/builtin-top.c                 |   2 +-
>  tools/perf/builtin-trace.c               |  25 ++--
>  tools/perf/builtin-version.c             |   3 +-
>  tools/perf/builtin.h                     |  58 ++++----
>  tools/perf/perf.c                        |  11 +-
>  tools/perf/tests/builtin-test.c          |   2 +-
>  tools/perf/tests/sdt.c                   |   2 +-
>  tools/perf/ui/browsers/hists.c           | 181 ++++++++++++++++++++++-
>  tools/perf/ui/stdio/hist.c               |  86 ++++++++++-
>  tools/perf/util/annotate.c               |  23 ++-
>  tools/perf/util/auxtrace.c               |   4 +-
>  tools/perf/util/build-id.c               |   8 +-
>  tools/perf/util/callchain.c              |  52 ++++++-
>  tools/perf/util/callchain.h              |   3 +-
>  tools/perf/util/header.c                 |   8 +-
>  tools/perf/util/hist.c                   |   5 +
>  tools/perf/util/map.c                    |   3 +-
>  tools/perf/util/sort.c                   |  16 +-
>  tools/perf/util/sort.h                   |   1 +
>  tools/perf/util/srcline.c                | 246 +++++++++++++++++++++++++++----
>  tools/perf/util/symbol-elf.c             |   5 +
>  tools/perf/util/symbol-minimal.c         |   7 +
>  tools/perf/util/symbol.h                 |   5 +-
>  tools/perf/util/trace-event-read.c       |   4 +-
>  tools/perf/util/util.h                   |  20 ++-
>  62 files changed, 739 insertions(+), 208 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-28  1:38 Arnaldo Carvalho de Melo
  2017-03-28  5:45 ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-28  1:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, David Ahern, Jiri Olsa,
	Kan Liang, Masami Hiramatsu, Milian Wolff, Namhyung Kim,
	Peter Zijlstra, Ravi Bangoria, Sukadev Bhattiprolu, Taeung Song,
	Tommi Rantala, Wang Nan, Yao Jin, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit e3a6a62400520452fe39740dca90a1d0b94b8f92:

  Merge tag 'perf-core-for-mingo-4.12-20170324' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-24 19:37:40 +0100)

are available in the git repository at:

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

for you to fetch changes up to 55f77128e7652e537d6c226d5b56821cdb5c22de:

  perf utils: Readlink /proc/self/exe to find the perf binary (2017-03-27 15:37:54 -0300)

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

New features:

- Handle inline functions in callchains (Jin Yao)

- Enable sorting by srcline as key (Milian Wolff)

Fixes:

- Fix no_size logic in addr_filter__resolve_kernel_syms() in the
  auxtrace code (Adrian Hunter)

- Fix some thread refcount leaks in 'perf trace' (Arnaldo Carvalho de Melo)

- Fix divide by zero when calculating percent for an event in a group in
  the annotate by source line code (Taeung Song)

- build-id files now aren't anymore symlinks, their parent directories
  are, so readlink the later (Taeung Song)

- Assorted fixes for null termination problems, mostly related to
  readlink, detected by valgrind (Tommi Rantala)

Infrastructure:

- Make vfs_getname probe point logic in 'perf trace' more robust
  wrt length of pathname (Arnaldo Carvalho de Melo)

- Remove unused 'prefix' parameter from builtins main functions (Arnaldo Carvalho de Melo)

- Show 'perf list sdt' option in man page (Ravi Bangoria)

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

----------------------------------------------------------------
Adrian Hunter (1):
      perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()

Arnaldo Carvalho de Melo (4):
      perf trace: Check for vfs_getname.pathname length
      perf trace: Fix up error path indentation
      perf trace: Fixup thread refcounting
      perf tools: Remove unused 'prefix' from builtin functions

Jin Yao (5):
      perf report: Refactor common code in srcline.c
      perf report: Find the inline stack for a given address
      perf report: Introduce --inline option
      perf report: Show inline stack for stdio mode
      perf report: Show inline stack for browser mode

Milian Wolff (1):
      perf report: Enable sorting by srcline as key

Ravi Bangoria (1):
      perf list sdt: Show option in man page

Taeung Song (2):
      perf annotate: Fix a bug following symbolic link of a build-id file
      perf annotate: Fix a bug of division by zero when calculating percent

Tommi Rantala (6):
      perf buildid: Do not update SDT cache with null filename
      perf buildid: Do not assume that readlink() returns a null terminated string
      perf tests: Do not assume that readlink() returns a null terminated string
      perf utils: use sizeof(buf) - 1 in readlink() call
      perf utils: Null terminate buf in read_ftrace_printk()
      perf utils: Readlink /proc/self/exe to find the perf binary

 tools/perf/Documentation/perf-list.txt   |   4 +-
 tools/perf/Documentation/perf-report.txt |   5 +
 tools/perf/bench/bench.h                 |  20 +--
 tools/perf/bench/futex-hash.c            |   3 +-
 tools/perf/bench/futex-lock-pi.c         |   3 +-
 tools/perf/bench/futex-requeue.c         |   3 +-
 tools/perf/bench/futex-wake-parallel.c   |   3 +-
 tools/perf/bench/futex-wake.c            |   3 +-
 tools/perf/bench/mem-functions.c         |   4 +-
 tools/perf/bench/numa.c                  |   2 +-
 tools/perf/bench/sched-messaging.c       |   3 +-
 tools/perf/bench/sched-pipe.c            |   2 +-
 tools/perf/builtin-annotate.c            |   2 +-
 tools/perf/builtin-bench.c               |  12 +-
 tools/perf/builtin-buildid-cache.c       |   3 +-
 tools/perf/builtin-buildid-list.c        |   3 +-
 tools/perf/builtin-c2c.c                 |   4 +-
 tools/perf/builtin-config.c              |   2 +-
 tools/perf/builtin-data.c                |   9 +-
 tools/perf/builtin-diff.c                |   2 +-
 tools/perf/builtin-evlist.c              |   2 +-
 tools/perf/builtin-ftrace.c              |   2 +-
 tools/perf/builtin-help.c                |   2 +-
 tools/perf/builtin-inject.c              |   2 +-
 tools/perf/builtin-kallsyms.c            |   2 +-
 tools/perf/builtin-kmem.c                |   4 +-
 tools/perf/builtin-kvm.c                 |  16 +-
 tools/perf/builtin-list.c                |   2 +-
 tools/perf/builtin-lock.c                |   6 +-
 tools/perf/builtin-mem.c                 |   6 +-
 tools/perf/builtin-probe.c               |   6 +-
 tools/perf/builtin-record.c              |   2 +-
 tools/perf/builtin-report.c              |   4 +-
 tools/perf/builtin-sched.c               |   6 +-
 tools/perf/builtin-script.c              |   4 +-
 tools/perf/builtin-stat.c                |   2 +-
 tools/perf/builtin-timechart.c           |   7 +-
 tools/perf/builtin-top.c                 |   2 +-
 tools/perf/builtin-trace.c               |  25 ++--
 tools/perf/builtin-version.c             |   3 +-
 tools/perf/builtin.h                     |  58 ++++----
 tools/perf/perf.c                        |  11 +-
 tools/perf/tests/builtin-test.c          |   2 +-
 tools/perf/tests/sdt.c                   |   2 +-
 tools/perf/ui/browsers/hists.c           | 181 ++++++++++++++++++++++-
 tools/perf/ui/stdio/hist.c               |  86 ++++++++++-
 tools/perf/util/annotate.c               |  23 ++-
 tools/perf/util/auxtrace.c               |   4 +-
 tools/perf/util/build-id.c               |   8 +-
 tools/perf/util/callchain.c              |  52 ++++++-
 tools/perf/util/callchain.h              |   3 +-
 tools/perf/util/header.c                 |   8 +-
 tools/perf/util/hist.c                   |   5 +
 tools/perf/util/map.c                    |   3 +-
 tools/perf/util/sort.c                   |  16 +-
 tools/perf/util/sort.h                   |   1 +
 tools/perf/util/srcline.c                | 246 +++++++++++++++++++++++++++----
 tools/perf/util/symbol-elf.c             |   5 +
 tools/perf/util/symbol-minimal.c         |   7 +
 tools/perf/util/symbol.h                 |   5 +-
 tools/perf/util/trace-event-read.c       |   4 +-
 tools/perf/util/util.h                   |  20 ++-
 62 files changed, 739 insertions(+), 208 deletions(-)

Test results:

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

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

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

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

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

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

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2017-03-24 14:57 Arnaldo Carvalho de Melo
@ 2017-03-24 18:39 ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2017-03-24 18:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexis Berlemont, Andi Kleen, David Ahern, Hanjun Guo,
	Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Taeung Song, Wang Nan, linux-perf-users,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:
> 
>   Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170324
> 
> for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:
> 
>   perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)
> 
> - Collapse identically named PMU events in 'perf stat', allow
>   not merging it via --no-merge (Andi Kleen)
> 
> Fixes:
> 
> - Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
>   disassembly output to not ditch line:number lines needed by
>   'perf annotate --print-lines' logic (Taeung Song)
> 
> Infrastructure:
> 
> - SDT (Statically Defined Tracing)/uprobes_events arguments improvements
>   (Alexis Berlemont, Ravi Bangoria)
> 
> - Improvements for the handling of JSON described vendor events,
>   including having an expression parser to calculate metrics
>   from multiple vendor events (Andi Kleen)
> 
> - Update Intel JSON vendor event files (Andi Kleen)
> 
> - Restore error reporting in 'perf probe -d' when none of the events
>   requested to be deleted exist. (Kefeng Wang)
> 
> - Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
>   (Ravi Bangoria)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Alexis Berlemont (2):
>       perf sdt: Add scanning of sdt probes arguments
>       perf probe: Add sdt probes arguments into the uprobe cmd string
> 
> Andi Kleen (13):
>       perf stat: Factor out callback for collecting event values
>       perf stat: Collapse identically named events
>       perf stat: Handle partially bad results with merging
>       perf tools: Factor out PMU matching in parser
>       perf pmu: Expand PMU events by prefix match
>       perf pmu: Special case uncore_ prefix
>       perf tools: Add a simple expression parser for JSON
>       perf vendor events intel: Update Intel uncore JSON event files
>       perf pmu: Support MetricExpr header in JSON event list
>       perf stat: Output JSON MetricExpr metric
>       perf list: Support printing MetricExpr with --debug
>       perf pmu: Add support for MetricName JSON attribute
>       perf list: Move extra details printing to new option
> 
> Arnaldo Carvalho de Melo (1):
>       perf annotate: Add comment clarifying how the source code line is parsed
> 
> Kefeng Wang (1):
>       perf probe: Return errno when not hitting any event
> 
> Ravi Bangoria (2):
>       perf probe: Change MAX_CMDLEN
>       perf sdt x86: Add renaming logic for rNN and other registers
> 
> Taeung Song (1):
>       perf annotate: More exactly grep -v of the objdump command
> 
>  tools/perf/Documentation/perf-list.txt             |   4 +
>  tools/perf/Documentation/perf-stat.txt             |   3 +
>  tools/perf/arch/x86/util/perf_regs.c               | 103 +++++++++++
>  tools/perf/builtin-list.c                          |  14 +-
>  tools/perf/builtin-probe.c                         |   6 +-
>  tools/perf/builtin-stat.c                          | 146 ++++++++++++---
>  .../arch/x86/broadwellde/uncore-cache.json         |  28 +--
>  .../arch/x86/broadwellde/uncore-memory.json        |  26 ++-
>  .../arch/x86/broadwellde/uncore-power.json         |  26 ++-
>  .../arch/x86/broadwellx/uncore-cache.json          |  28 +--
>  .../arch/x86/broadwellx/uncore-interconnect.json   |   6 +-
>  .../arch/x86/broadwellx/uncore-memory.json         |  21 ++-
>  .../arch/x86/broadwellx/uncore-power.json          |  26 ++-
>  .../pmu-events/arch/x86/haswellx/uncore-cache.json |  28 +--
>  .../arch/x86/haswellx/uncore-interconnect.json     |   6 +-
>  .../arch/x86/haswellx/uncore-memory.json           |  21 ++-
>  .../pmu-events/arch/x86/haswellx/uncore-power.json |  26 ++-
>  .../pmu-events/arch/x86/ivytown/uncore-cache.json  |  22 +--
>  .../arch/x86/ivytown/uncore-interconnect.json      |  12 +-
>  .../pmu-events/arch/x86/ivytown/uncore-memory.json |  19 +-
>  .../pmu-events/arch/x86/ivytown/uncore-power.json  |  53 ++++--
>  .../pmu-events/arch/x86/jaketown/uncore-cache.json |  13 +-
>  .../arch/x86/jaketown/uncore-interconnect.json     |  12 +-
>  .../arch/x86/jaketown/uncore-memory.json           |  21 ++-
>  .../pmu-events/arch/x86/jaketown/uncore-power.json |  53 ++++--
>  tools/perf/pmu-events/jevents.c                    |  26 ++-
>  tools/perf/pmu-events/jevents.h                    |   3 +-
>  tools/perf/pmu-events/pmu-events.h                 |   2 +
>  tools/perf/tests/Build                             |   1 +
>  tools/perf/tests/builtin-test.c                    |   4 +
>  tools/perf/tests/expr.c                            |  56 ++++++
>  tools/perf/tests/tests.h                           |   1 +
>  tools/perf/util/Build                              |   6 +
>  tools/perf/util/annotate.c                         |   8 +-
>  tools/perf/util/evsel.c                            |   4 +
>  tools/perf/util/evsel.h                            |   5 +
>  tools/perf/util/expr.h                             |  25 +++
>  tools/perf/util/expr.y                             | 173 ++++++++++++++++++
>  tools/perf/util/parse-events.c                     |  78 +++++++-
>  tools/perf/util/parse-events.h                     |  10 +-
>  tools/perf/util/parse-events.y                     |  73 ++++----
>  tools/perf/util/perf_regs.c                        |   6 +
>  tools/perf/util/perf_regs.h                        |   6 +
>  tools/perf/util/pmu.c                              |  32 +++-
>  tools/perf/util/pmu.h                              |   6 +-
>  tools/perf/util/probe-event.c                      |   1 -
>  tools/perf/util/probe-file.c                       | 173 +++++++++++++++++-
>  tools/perf/util/stat-shadow.c                      | 197 +++++++++++++++++++++
>  tools/perf/util/stat.h                             |   2 +
>  tools/perf/util/symbol-elf.c                       |  25 ++-
>  tools/perf/util/symbol.h                           |   1 +
>  51 files changed, 1370 insertions(+), 277 deletions(-)
>  create mode 100644 tools/perf/tests/expr.c
>  create mode 100644 tools/perf/util/expr.h
>  create mode 100644 tools/perf/util/expr.y

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2017-03-24 14:57 Arnaldo Carvalho de Melo
  2017-03-24 18:39 ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-24 14:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexis Berlemont, Andi Kleen, David Ahern,
	Hanjun Guo, Hemant Kumar, Jiri Olsa, John Shortt, Kefeng Wang,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Taeung Song, Wang Nan, linux-perf-users,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit 267dd0a07eefbb37264fcfad984fffc8856898ad:

  Merge tag 'perf-core-for-mingo-4.12-20170320' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-21 07:41:29 +0100)

are available in the git repository at:

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

for you to fetch changes up to bf874fcf9f2fed58510dc83abcee388cee2b427e:

  perf list: Move extra details printing to new option (2017-03-23 11:42:31 -0300)

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

User visible:

- Allow suppressing 'uncore_' when specifying PMU events (Andi Kleen)

- Collapse identically named PMU events in 'perf stat', allow
  not merging it via --no-merge (Andi Kleen)

Fixes:

- Use more precise 'grep -v' to suppress unwanted 'objdump -dS'
  disassembly output to not ditch line:number lines needed by
  'perf annotate --print-lines' logic (Taeung Song)

Infrastructure:

- SDT (Statically Defined Tracing)/uprobes_events arguments improvements
  (Alexis Berlemont, Ravi Bangoria)

- Improvements for the handling of JSON described vendor events,
  including having an expression parser to calculate metrics
  from multiple vendor events (Andi Kleen)

- Update Intel JSON vendor event files (Andi Kleen)

- Restore error reporting in 'perf probe -d' when none of the events
  requested to be deleted exist. (Kefeng Wang)

- Bump MAX_CMDLEN in 'perf probe' to match what the kernel accepts
  (Ravi Bangoria)

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

----------------------------------------------------------------
Alexis Berlemont (2):
      perf sdt: Add scanning of sdt probes arguments
      perf probe: Add sdt probes arguments into the uprobe cmd string

Andi Kleen (13):
      perf stat: Factor out callback for collecting event values
      perf stat: Collapse identically named events
      perf stat: Handle partially bad results with merging
      perf tools: Factor out PMU matching in parser
      perf pmu: Expand PMU events by prefix match
      perf pmu: Special case uncore_ prefix
      perf tools: Add a simple expression parser for JSON
      perf vendor events intel: Update Intel uncore JSON event files
      perf pmu: Support MetricExpr header in JSON event list
      perf stat: Output JSON MetricExpr metric
      perf list: Support printing MetricExpr with --debug
      perf pmu: Add support for MetricName JSON attribute
      perf list: Move extra details printing to new option

Arnaldo Carvalho de Melo (1):
      perf annotate: Add comment clarifying how the source code line is parsed

Kefeng Wang (1):
      perf probe: Return errno when not hitting any event

Ravi Bangoria (2):
      perf probe: Change MAX_CMDLEN
      perf sdt x86: Add renaming logic for rNN and other registers

Taeung Song (1):
      perf annotate: More exactly grep -v of the objdump command

 tools/perf/Documentation/perf-list.txt             |   4 +
 tools/perf/Documentation/perf-stat.txt             |   3 +
 tools/perf/arch/x86/util/perf_regs.c               | 103 +++++++++++
 tools/perf/builtin-list.c                          |  14 +-
 tools/perf/builtin-probe.c                         |   6 +-
 tools/perf/builtin-stat.c                          | 146 ++++++++++++---
 .../arch/x86/broadwellde/uncore-cache.json         |  28 +--
 .../arch/x86/broadwellde/uncore-memory.json        |  26 ++-
 .../arch/x86/broadwellde/uncore-power.json         |  26 ++-
 .../arch/x86/broadwellx/uncore-cache.json          |  28 +--
 .../arch/x86/broadwellx/uncore-interconnect.json   |   6 +-
 .../arch/x86/broadwellx/uncore-memory.json         |  21 ++-
 .../arch/x86/broadwellx/uncore-power.json          |  26 ++-
 .../pmu-events/arch/x86/haswellx/uncore-cache.json |  28 +--
 .../arch/x86/haswellx/uncore-interconnect.json     |   6 +-
 .../arch/x86/haswellx/uncore-memory.json           |  21 ++-
 .../pmu-events/arch/x86/haswellx/uncore-power.json |  26 ++-
 .../pmu-events/arch/x86/ivytown/uncore-cache.json  |  22 +--
 .../arch/x86/ivytown/uncore-interconnect.json      |  12 +-
 .../pmu-events/arch/x86/ivytown/uncore-memory.json |  19 +-
 .../pmu-events/arch/x86/ivytown/uncore-power.json  |  53 ++++--
 .../pmu-events/arch/x86/jaketown/uncore-cache.json |  13 +-
 .../arch/x86/jaketown/uncore-interconnect.json     |  12 +-
 .../arch/x86/jaketown/uncore-memory.json           |  21 ++-
 .../pmu-events/arch/x86/jaketown/uncore-power.json |  53 ++++--
 tools/perf/pmu-events/jevents.c                    |  26 ++-
 tools/perf/pmu-events/jevents.h                    |   3 +-
 tools/perf/pmu-events/pmu-events.h                 |   2 +
 tools/perf/tests/Build                             |   1 +
 tools/perf/tests/builtin-test.c                    |   4 +
 tools/perf/tests/expr.c                            |  56 ++++++
 tools/perf/tests/tests.h                           |   1 +
 tools/perf/util/Build                              |   6 +
 tools/perf/util/annotate.c                         |   8 +-
 tools/perf/util/evsel.c                            |   4 +
 tools/perf/util/evsel.h                            |   5 +
 tools/perf/util/expr.h                             |  25 +++
 tools/perf/util/expr.y                             | 173 ++++++++++++++++++
 tools/perf/util/parse-events.c                     |  78 +++++++-
 tools/perf/util/parse-events.h                     |  10 +-
 tools/perf/util/parse-events.y                     |  73 ++++----
 tools/perf/util/perf_regs.c                        |   6 +
 tools/perf/util/perf_regs.h                        |   6 +
 tools/perf/util/pmu.c                              |  32 +++-
 tools/perf/util/pmu.h                              |   6 +-
 tools/perf/util/probe-event.c                      |   1 -
 tools/perf/util/probe-file.c                       | 173 +++++++++++++++++-
 tools/perf/util/stat-shadow.c                      | 197 +++++++++++++++++++++
 tools/perf/util/stat.h                             |   2 +
 tools/perf/util/symbol-elf.c                       |  25 ++-
 tools/perf/util/symbol.h                           |   1 +
 51 files changed, 1370 insertions(+), 277 deletions(-)
 create mode 100644 tools/perf/tests/expr.c
 create mode 100644 tools/perf/util/expr.h
 create mode 100644 tools/perf/util/expr.y

Test results:

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

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

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

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

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

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

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

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2016-12-05 21:37 Arnaldo Carvalho de Melo
@ 2016-12-06  8:17 ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2016-12-06  8:17 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov,
	Chris Riyder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer,
	Kim Phillips, linuxppc-dev, Markus Trippelsdorf,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao,
	Peter Foley, Peter Zijlstra, Ravi Bangoria, Taeung Song,
	Wang Nan, Zefan Li, pi3orama, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4:
> 
>   Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08:03 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161205
> 
> for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9:
> 
>   perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Fixes:
> 
> - Do not show a bogus target address in 'perf annotate' for targetless powerpc
>   jump instructions such as 'bctr' (Ravi Bangoria)
> 
> - tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa)
> 
> - Fix building objtool with clang (Peter Foley)
> 
> Infrastructure:
> 
> - Support linking perf with clang and LLVM libraries, initially statically, but
>   this limitation will be lifted and shared libraries, when available, will
>   be preferred to the static build, that should, as with other features, be
>   enabled explicitly (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Jiri Olsa (7):
>       tools build: Make fixdep parsing wait for last target
>       tools build: Make the .cmd file more readable
>       tools build: Move tabs to spaces where suitable
>       perf tools: Move install-gtk target into rules area
>       perf tools: Move python/perf.so target into rules area
>       perf tools: Cleanup build directory before each test
>       perf tools: Add non config targets
> 
> Peter Foley (1):
>       tools build: Fix objtool build with clang
> 
> Ravi Bangoria (1):
>       perf annotate: Show raw form for jump instruction with indirect target
> 
> Wang Nan (11):
>       perf tools: Pass context to perf hook functions
>       perf llvm: Extract helpers in llvm-utils.c
>       tools build: Add feature detection for LLVM
>       tools build: Add feature detection for clang
>       perf build: Add clang and llvm compile and linking support
>       perf clang: Add builtin clang support ant test case
>       perf clang: Use real file system for #include
>       perf clang: Allow passing CFLAGS to builtin clang
>       perf clang: Update test case to use real BPF script
>       perf clang: Support compile IR to BPF object and add testcase
>       perf clang: Compile BPF script using builtin clang support
> 
>  tools/build/Build.include          |  20 ++--
>  tools/build/Makefile.feature       | 138 +++++++++++++-------------
>  tools/build/feature/Makefile       | 120 +++++++++++++----------
>  tools/build/feature/test-clang.cpp |  21 ++++
>  tools/build/feature/test-llvm.cpp  |   8 ++
>  tools/build/fixdep.c               |   5 +-
>  tools/perf/Makefile.config         |  62 +++++++++---
>  tools/perf/Makefile.perf           |  56 +++++++----
>  tools/perf/tests/Build             |   1 +
>  tools/perf/tests/builtin-test.c    |   9 ++
>  tools/perf/tests/clang.c           |  46 +++++++++
>  tools/perf/tests/llvm.h            |   7 ++
>  tools/perf/tests/make              |   4 +-
>  tools/perf/tests/perf-hooks.c      |  14 ++-
>  tools/perf/tests/tests.h           |   3 +
>  tools/perf/util/Build              |   2 +
>  tools/perf/util/annotate.c         |   3 +
>  tools/perf/util/bpf-loader.c       |  19 +++-
>  tools/perf/util/c++/Build          |   2 +
>  tools/perf/util/c++/clang-c.h      |  43 ++++++++
>  tools/perf/util/c++/clang-test.cpp |  62 ++++++++++++
>  tools/perf/util/c++/clang.cpp      | 195 +++++++++++++++++++++++++++++++++++++
>  tools/perf/util/c++/clang.h        |  26 +++++
>  tools/perf/util/llvm-utils.c       |  76 +++++++++++----
>  tools/perf/util/llvm-utils.h       |   6 ++
>  tools/perf/util/perf-hooks.c       |  10 +-
>  tools/perf/util/perf-hooks.h       |   6 +-
>  tools/perf/util/util-cxx.h         |  26 +++++
>  28 files changed, 795 insertions(+), 195 deletions(-)
>  create mode 100644 tools/build/feature/test-clang.cpp
>  create mode 100644 tools/build/feature/test-llvm.cpp
>  create mode 100644 tools/perf/tests/clang.c
>  create mode 100644 tools/perf/util/c++/Build
>  create mode 100644 tools/perf/util/c++/clang-c.h
>  create mode 100644 tools/perf/util/c++/clang-test.cpp
>  create mode 100644 tools/perf/util/c++/clang.cpp
>  create mode 100644 tools/perf/util/c++/clang.h
>  create mode 100644 tools/perf/util/util-cxx.h
> 
>   # uname -a
>   Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>   # perf test
>    1: vmlinux symtab matches kallsyms            : Ok
>    2: Detect openat syscall event                : Ok
>    3: Detect openat syscall event on all cpus    : Ok
>    4: Read samples using the mmap interface      : Ok
>    5: Parse event definition strings             : Ok
>    6: PERF_RECORD_* events & perf_sample fields  : Ok
>    7: Parse perf pmu format                      : Ok
>    8: DSO data read                              : Ok
>    9: DSO data cache                             : Ok
>   10: DSO data reopen                            : Ok
>   11: Roundtrip evsel->name                      : Ok
>   12: Parse sched tracepoints fields             : Ok
>   13: syscalls:sys_enter_openat event fields     : Ok
>   14: Setup struct perf_event_attr               : Ok
>   15: Match and link multiple hists              : Ok
>   16: 'import perf' in python                    : Ok
>   17: Breakpoint overflow signal handler         : Ok
>   18: Breakpoint overflow sampling               : Ok
>   19: Number of exit events of a simple workload : Ok
>   20: Software clock events period values        : Ok
>   21: Object code reading                        : Ok
>   22: Sample parsing                             : Ok
>   23: Use a dummy software event to keep tracking: Ok
>   24: Parse with no sample_id_all bit set        : Ok
>   25: Filter hist entries                        : Ok
>   26: Lookup mmap thread                         : Ok
>   27: Share thread mg                            : Ok
>   28: Sort output of hist entries                : Ok
>   29: Cumulate child hist entries                : Ok
>   30: Track with sched_switch                    : Ok
>   31: Filter fds with revents mask in a fdarray  : Ok
>   32: Add fd to a fdarray, making it autogrow    : Ok
>   33: kmod_path__parse                           : Ok
>   34: Thread map                                 : Ok
>   35: LLVM search and compile                    :
>   35.1: Basic BPF llvm compile                    : Ok
>   35.2: kbuild searching                          : Ok
>   35.3: Compile source for BPF prologue generation: Ok
>   35.4: Compile source for BPF relocation         : Ok
>   36: Session topology                           : Ok
>   37: BPF filter                                 :
>   37.1: Basic BPF filtering                      : Ok
>   37.2: BPF prologue generation                  : Ok
>   37.3: BPF relocation checker                   : Ok
>   38: Synthesize thread map                      : Ok
>   39: Synthesize cpu map                         : Ok
>   40: Synthesize stat config                     : Ok
>   41: Synthesize stat                            : Ok
>   42: Synthesize stat round                      : Ok
>   43: Synthesize attr update                     : Ok
>   44: Event times                                : Ok
>   45: Read backward ring buffer                  : Ok
>   46: Print cpu map                              : Ok
>   47: Probe SDT events                           : Ok
>   48: is_printable_array                         : Ok
>   49: Print bitmap                               : Ok
>   50: perf hooks                                 : Ok
>   51: builtin clang support                      : Skip (not compiled in)
>   52: x86 rdpmc                                  : Ok
>   53: Convert perf time to TSC                   : Ok
>   54: DWARF unwind                               : Ok
>   55: x86 instruction decoder - new instructions : Ok
>   56: Intel cqm nmi context read                 : Skip
>   # 
>   # time dm
>    1 alpine:3.4: Ok
>    2 android-ndk:r12b-arm: Ok
>    3 archlinux:latest: Ok
>    4 centos:5: Ok
>    5 centos:6: Ok
>    6 centos:7: Ok
>    7 debian:7: Ok
>    8 debian:8: Ok
>    9 debian:experimental: Ok
>   10 fedora:20: Ok
>   11 fedora:21: Ok
>   12 fedora:22: Ok
>   13 fedora:23: Ok
>   14 fedora:24: Ok
>   15 fedora:24-x-ARC-uClibc: Ok
>   16 fedora:25: Ok
>   17 fedora:rawhide: Ok
>   18 mageia:5: Ok
>   19 opensuse:13.2: Ok
>   20 opensuse:42.1: Ok
>   21 opensuse:tumbleweed: Ok
>   22 ubuntu:12.04.5: Ok
>   23 ubuntu:14.04.4-x-linaro-arm64: Ok
>   24 ubuntu:16.04: Ok
>   25 ubuntu:16.04-x-arm: Ok
>   26 ubuntu:16.04-x-arm64: Ok
>   27 ubuntu:16.04-x-powerpc: Ok
>   28 ubuntu:16.04-x-powerpc64: Ok
>   29 ubuntu:16.04-x-powerpc64el: Ok
>   30 ubuntu:16.04-x-s390: Ok
>   31 ubuntu:16.10: Ok
>   #
>   $ make -C tools/perf build-test
>   make: Entering directory '/home/acme/git/linux/tools/perf'
>   - tarpkg: ./tests/perf-targz-src-pkg .
>            make_no_backtrace_O: make NO_BACKTRACE=1
>                 make_no_gtk2_O: make NO_GTK2=1
>                  make_static_O: make LDFLAGS=-static
>              make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
>                   make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
>                  make_perf_o_O: make perf.o
>                make_no_slang_O: make NO_SLANG=1
>          make_install_prefix_O: make install prefix=/tmp/krava
>            make_no_libpython_O: make NO_LIBPYTHON=1
>                 make_no_newt_O: make NO_NEWT=1
>                   make_debug_O: make DEBUG=1
>                    make_tags_O: make tags
>            make_no_libbionic_O: make NO_LIBBIONIC=1
>                    make_help_O: make help
>                 make_install_O: make install
>            make_no_libunwind_O: make NO_LIBUNWIND=1
>                    make_pure_O: make
>                 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
>              make_no_libperl_O: make NO_LIBPERL=1
>               make_no_libbpf_O: make NO_LIBBPF=1
>   make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
>                     make_doc_O: make doc
>             make_no_libaudit_O: make NO_LIBAUDIT=1
>               make_clean_all_O: make clean all
>         make_with_babeltrace_O: make LIBBABELTRACE=1
>              make_no_libnuma_O: make NO_LIBNUMA=1
>              make_util_map_o_O: make util/map.o
>             make_install_bin_O: make install-bin
>             make_no_demangle_O: make NO_DEMANGLE=1
>               make_no_libelf_O: make NO_LIBELF=1
>             make_no_auxtrace_O: make NO_AUXTRACE=1
>        make_util_pmu_bison_o_O: make util/pmu-bison.o
>    make_install_prefix_slash_O: make install prefix=/tmp/krava/
>          make_with_clangllvm_O: make LIBCLANGLLVM=1
>   OK
>   make: Leaving directory '/home/acme/git/linux/tools/perf'
>   $

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2016-12-05 21:37 Arnaldo Carvalho de Melo
  2016-12-06  8:17 ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-05 21:37 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin,
	Alexei Starovoitov, Chris Riyder, David Ahern, He Kuang,
	Jiri Olsa, Joe Stringer, Kim Phillips, linuxppc-dev,
	Markus Trippelsdorf, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Foley, Peter Zijlstra,
	Ravi Bangoria, Taeung Song, Wang Nan, Zefan Li, pi3orama,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit e7af7b15121ca08c31a0ab9df71a41b4c53365b4:

  Merge tag 'perf-core-for-mingo-20161201' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-12-02 10:08:03 +0100)

are available in the git repository at:

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

for you to fetch changes up to bec60e50af83741cde1786ab475d4bf472aed6f9:

  perf annotate: Show raw form for jump instruction with indirect target (2016-12-05 17:21:57 -0300)

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

Fixes:

- Do not show a bogus target address in 'perf annotate' for targetless powerpc
  jump instructions such as 'bctr' (Ravi Bangoria)

- tools/build fixes related to race conditions with the fixdep utility (Jiri Olsa)

- Fix building objtool with clang (Peter Foley)

Infrastructure:

- Support linking perf with clang and LLVM libraries, initially statically, but
  this limitation will be lifted and shared libraries, when available, will
  be preferred to the static build, that should, as with other features, be
  enabled explicitly (Wang Nan)

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

----------------------------------------------------------------
Jiri Olsa (7):
      tools build: Make fixdep parsing wait for last target
      tools build: Make the .cmd file more readable
      tools build: Move tabs to spaces where suitable
      perf tools: Move install-gtk target into rules area
      perf tools: Move python/perf.so target into rules area
      perf tools: Cleanup build directory before each test
      perf tools: Add non config targets

Peter Foley (1):
      tools build: Fix objtool build with clang

Ravi Bangoria (1):
      perf annotate: Show raw form for jump instruction with indirect target

Wang Nan (11):
      perf tools: Pass context to perf hook functions
      perf llvm: Extract helpers in llvm-utils.c
      tools build: Add feature detection for LLVM
      tools build: Add feature detection for clang
      perf build: Add clang and llvm compile and linking support
      perf clang: Add builtin clang support ant test case
      perf clang: Use real file system for #include
      perf clang: Allow passing CFLAGS to builtin clang
      perf clang: Update test case to use real BPF script
      perf clang: Support compile IR to BPF object and add testcase
      perf clang: Compile BPF script using builtin clang support

 tools/build/Build.include          |  20 ++--
 tools/build/Makefile.feature       | 138 +++++++++++++-------------
 tools/build/feature/Makefile       | 120 +++++++++++++----------
 tools/build/feature/test-clang.cpp |  21 ++++
 tools/build/feature/test-llvm.cpp  |   8 ++
 tools/build/fixdep.c               |   5 +-
 tools/perf/Makefile.config         |  62 +++++++++---
 tools/perf/Makefile.perf           |  56 +++++++----
 tools/perf/tests/Build             |   1 +
 tools/perf/tests/builtin-test.c    |   9 ++
 tools/perf/tests/clang.c           |  46 +++++++++
 tools/perf/tests/llvm.h            |   7 ++
 tools/perf/tests/make              |   4 +-
 tools/perf/tests/perf-hooks.c      |  14 ++-
 tools/perf/tests/tests.h           |   3 +
 tools/perf/util/Build              |   2 +
 tools/perf/util/annotate.c         |   3 +
 tools/perf/util/bpf-loader.c       |  19 +++-
 tools/perf/util/c++/Build          |   2 +
 tools/perf/util/c++/clang-c.h      |  43 ++++++++
 tools/perf/util/c++/clang-test.cpp |  62 ++++++++++++
 tools/perf/util/c++/clang.cpp      | 195 +++++++++++++++++++++++++++++++++++++
 tools/perf/util/c++/clang.h        |  26 +++++
 tools/perf/util/llvm-utils.c       |  76 +++++++++++----
 tools/perf/util/llvm-utils.h       |   6 ++
 tools/perf/util/perf-hooks.c       |  10 +-
 tools/perf/util/perf-hooks.h       |   6 +-
 tools/perf/util/util-cxx.h         |  26 +++++
 28 files changed, 795 insertions(+), 195 deletions(-)
 create mode 100644 tools/build/feature/test-clang.cpp
 create mode 100644 tools/build/feature/test-llvm.cpp
 create mode 100644 tools/perf/tests/clang.c
 create mode 100644 tools/perf/util/c++/Build
 create mode 100644 tools/perf/util/c++/clang-c.h
 create mode 100644 tools/perf/util/c++/clang-test.cpp
 create mode 100644 tools/perf/util/c++/clang.cpp
 create mode 100644 tools/perf/util/c++/clang.h
 create mode 100644 tools/perf/util/util-cxx.h

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

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-10 14:03   ` Arnaldo Carvalho de Melo
@ 2015-03-10 14:37     ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2015-03-10 14:37 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Peter Zijlstra, Stephane Eranian,
	Suzuki K . Poulose, Thomas Gleixner


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

> Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu:
> > So I got this error today:
> > 
> >   ┌─Warning:───────────────────────────┐
> >   │The vmlinux file can't be used.     │
> >   │Kernel samples will not be resolved.│
> >   │                                    │
> >   │                                    │
> >   │Press any key...                    │
> >   └────────────────────────────────────┘
> > 
> > ... and sadly perf is being passive-aggressive again: being negative 
> > but refusing to say why! :-)
> 
> > Is there a way to figure out why it did not like the vmlinux?
> 
> I'll check and improve the message.
> 
> But you must've noticed that perf is going to a therapist, aka 
> improving error messages... ;-)

Absolutely! ;-)

Also, on the positive side, today I was able to build and run perf on 
ancient user-space: a Fedora Core 6 installation, with very few hacks 
(see the attached hacks).

The HAVE_NEW_FLAX hack results in a non-working -e option.

Thanks,

	Ingo

Index: tip/tools/perf/util/parse-events.c
===================================================================
--- tip.orig/tools/perf/util/parse-events.c
+++ tip/tools/perf/util/parse-events.c
@@ -968,6 +968,13 @@ perf_pmu__parse_check(const char *name)
 	return r ? r->type : PMU_EVENT_SYMBOL_ERR;
 }
 
+#ifndef HAVE_NEW_FLEX
+static int parse_events_lex_init_extra(int start_token __maybe_unused, void **scanner __maybe_unused)
+{
+	return -1;
+}
+#endif
+
 static int parse_events__scanner(const char *str, void *data, int start_token)
 {
 	YY_BUFFER_STATE buffer;
Index: tip/tools/perf/util/symbol-elf.c
===================================================================
--- tip.orig/tools/perf/util/symbol-elf.c
+++ tip/tools/perf/util/symbol-elf.c
@@ -53,6 +53,13 @@ static int elf_getphdrnum(Elf *elf, size
 }
 #endif
 
+#ifndef HAVE_ELF_GETPHDRNUM
+static int elf_getphdrnum (Elf *__elf __maybe_unused, size_t *__dst __maybe_unused)
+{
+	return 1;
+}
+#endif
+
 #ifndef NT_GNU_BUILD_ID
 #define NT_GNU_BUILD_ID 3
 #endif

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-10 10:03 ` Ingo Molnar
@ 2015-03-10 14:03   ` Arnaldo Carvalho de Melo
  2015-03-10 14:37     ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-10 14:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Peter Zijlstra, Stephane Eranian,
	Suzuki K . Poulose, Thomas Gleixner

Em Tue, Mar 10, 2015 at 11:03:31AM +0100, Ingo Molnar escreveu:
> So I got this error today:
> 
>   ┌─Warning:───────────────────────────┐
>   │The vmlinux file can't be used.     │
>   │Kernel samples will not be resolved.│
>   │                                    │
>   │                                    │
>   │Press any key...                    │
>   └────────────────────────────────────┘
> 
> ... and sadly perf is being passive-aggressive again: being negative 
> but refusing to say why! :-)

> Is there a way to figure out why it did not like the vmlinux?

I'll check and improve the message.

But you must've noticed that perf is going to a therapist, aka improving
error messages... ;-)

- Arnaldo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-03  3:25 Arnaldo Carvalho de Melo
  2015-03-03  6:20 ` Ingo Molnar
@ 2015-03-10 10:03 ` Ingo Molnar
  2015-03-10 14:03   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2015-03-10 10:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
	David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
	H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
	Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
	Arnaldo Carvalho de Melo


So I got this error today:


                                                                  ┌─Warning:───────────────────────────┐
                                                                  │The vmlinux file can't be used.     │
                                                                  │Kernel samples will not be resolved.│
                                                                  │                                    │
                                                                  │                                    │
                                                                  │Press any key...                    │
                                                                  └────────────────────────────────────┘

... and sadly perf is being passive-aggressive again: being negative 
but refusing to say why! :-)

Is there a way to figure out why it did not like the vmlinux?

Thanks,

	Ingo

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2015-03-03  3:25 Arnaldo Carvalho de Melo
@ 2015-03-03  6:20 ` Ingo Molnar
  2015-03-10 10:03 ` Ingo Molnar
  1 sibling, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2015-03-03  6:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
	David Ahern, Don Zickus, Frederic Weisbecker, He Kuang,
	H . Peter Anvin, Jiri Olsa, Kaixu Xia, Kan Liang,
	Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Stephane Eranian, Suzuki K . Poulose, Thomas Gleixner,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	This one has the thread reference counting, that I tested using 'perf probe':
> 
>   perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid'
>   perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid'
>   perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid'
>   perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top
> 
> 	with that I checked and in the end the refcount reaches zero and
> thread__delete is called, as expected, using 'perf script', looking at the
> callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to
> work.
> 
> 	David, Namhyung, please holler if you find something fishy with this
> thread refcnt stuff, as it is something that is related to previous/current
> work by you guys,
> 
> 	Ah, I also merged perf/urgent so that it is buildable in more systems.o
> 
> 	There is also the revert for that is_power_of_2 "simplification" in perf_mmap,
> that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry
> about that one, should have caught that :-\
> 
> 	Please consider pulling,
> 
> - Arnaldo
> The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301:
> 
>   Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -0300)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to ae536acfacb65a4a9858c32b12361e09f84f4157:
> 
>   perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)
> 
> - 'perf record' Documentation fixes (Namhyung Kim)
> 
> - Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)
> 
> Infrastructure:
> 
> - Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)
> 
> - Reference count struct thread (Arnaldo Carvalho de Melo)
> 
> - No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)
> 
> - Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter)
> 
> - Only include tsc file for x86 (David Ahern)
> 
> - Compare JOBS to 0 after grep (David Ahern)
> 
> - Improve feature detection messages (Ingo Molnar)
> 
> - Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)
> 
> - Remove bias offset to find probe point by address (Masami Hiramatsu)
> 
> - Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (1):
>       perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test
> 
> Arnaldo Carvalho de Melo (3):
>       perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads
>       perf tools: Reference count struct thread
>       perf sched: No need to keep the session around
> 
> David Ahern (2):
>       perf tools: Only include tsc file for x86
>       perf tools: Compare JOBS to 0 after grep
> 
> Ingo Molnar (7):
>       perf tools: Add PERF-FEATURES to the .gitignore file
>       perf tools: Remove annoying extra message from the features build
>       perf tools: Improve Python feature detection messages
>       perf tools: Improve libperl detection message
>       perf tools: Improve libbfd detection message
>       perf tools: Improve feature test debuggability
>       perf tools: Improve 'libbabel' feature check failure message
> 
> Kan Liang (1):
>       Revert "perf: Remove the extra validity check on nr_pages"
> 
> Masami Hiramatsu (2):
>       perf probe: Warn if given uprobe event accesses memory on older kernel
>       perf probe: Remove bias offset to find probe point by address
> 
> Namhyung Kim (3):
>       perf tools: Fix build error on ARCH=i386/x86_64/sparc64
>       perf record: Get rid of -l option from Documentation
>       perf record: Document --group option
> 
> Suzuki K. Poulose (1):
>       perf stat: Report unsupported events properly
> 
>  kernel/events/core.c                               |  2 +-
>  tools/perf/.gitignore                              |  1 +
>  tools/perf/Documentation/perf-record.txt           | 12 ++++--
>  tools/perf/Makefile                                |  2 +-
>  tools/perf/builtin-sched.c                         | 26 +++++--------
>  tools/perf/builtin-stat.c                          |  5 ++-
>  tools/perf/builtin-trace.c                         |  7 +++-
>  tools/perf/config/Makefile                         | 17 ++++-----
>  tools/perf/config/Makefile.arch                    | 27 +++----------
>  tools/perf/config/feature-checks/Makefile          | 16 ++++----
>  .../test-pthread-attr-setaffinity-np.c             |  4 +-
>  tools/perf/config/utilities.mak                    |  3 +-
>  tools/perf/ui/browsers/hists.c                     |  6 +--
>  tools/perf/util/Build                              |  2 +-
>  tools/perf/util/build-id.c                         |  5 ++-
>  tools/perf/util/event.c                            | 34 ++++++++++++-----
>  tools/perf/util/hist.c                             |  2 +
>  tools/perf/util/hist.h                             |  2 +-
>  tools/perf/util/machine.c                          | 44 +++++++++++-----------
>  tools/perf/util/machine.h                          |  1 -
>  tools/perf/util/probe-event.c                      | 23 +++++++++++
>  tools/perf/util/probe-finder.c                     |  5 +--
>  tools/perf/util/session.c                          |  6 ---
>  tools/perf/util/thread.c                           | 14 +++++++
>  tools/perf/util/thread.h                           | 13 +++++++
>  25 files changed, 164 insertions(+), 115 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2015-03-03  3:25 Arnaldo Carvalho de Melo
  2015-03-03  6:20 ` Ingo Molnar
  2015-03-10 10:03 ` Ingo Molnar
  0 siblings, 2 replies; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-03  3:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Frederic Weisbecker, He Kuang, H . Peter Anvin, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Naohiro Aota, Peter Zijlstra, Stephane Eranian,
	Suzuki K . Poulose, Thomas Gleixner, Arnaldo Carvalho de Melo

Hi Ingo,

	This one has the thread reference counting, that I tested using 'perf probe':

  perf probe -x ~/bin/perf 'thread__delete:4 thread refcnt=thread->refcnt tid=thread->tid'
  perf probe -x ~/bin/perf 'thread__get:1 thread refcnt=thread->refcnt tid=thread->tid'
  perf probe -x ~/bin/perf 'thread__put:6 thread refcnt=thread->refcnt tid=thread->tid'
  perf record -o thread_refcnt.data -g -e probe_perf:thread__put,probe_perf:thread__get_1,probe_perf:thread__delete perf top

	with that I checked and in the end the refcount reaches zero and
thread__delete is called, as expected, using 'perf script', looking at the
callchains, etc, did the same for 'perf sched lat' and 'trace' also seems to
work.

	David, Namhyung, please holler if you find something fishy with this
thread refcnt stuff, as it is something that is related to previous/current
work by you guys,

	Ah, I also merged perf/urgent so that it is buildable in more systems.o

	There is also the revert for that is_power_of_2 "simplification" in perf_mmap,
that hasn't made it to perf/urgent nor upstream, its something only in perf/core, sorry
about that one, should have caught that :-\

	Please consider pulling,

- Arnaldo
The following changes since commit 33be4ef116511f1079c4c3bf4b5547faf7439301:

  Merge 'tip/perf/urgent' into perf/core to pick fixes (2015-03-02 11:45:49 -0300)

are available in the git repository at:


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

for you to fetch changes up to ae536acfacb65a4a9858c32b12361e09f84f4157:

  perf sched: No need to keep the session around (2015-03-03 00:17:12 -0300)

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

User visible:

- Warn if given uprobe event accesses memory on older kernel (Masami Hiramatsu)

- 'perf record' Documentation fixes (Namhyung Kim)

- Report unsupported events properly in 'perf stat' (Suzuki K. Poulose)

Infrastructure:

- Avoid FORK after COMM when synthesizing records for pre-existing threads (Arnaldo Carvalho de Melo)

- Reference count struct thread (Arnaldo Carvalho de Melo)

- No need to keep the session around in 'perf sched', thread refcounting removes that need (Arnaldo Carvalho de Melo)

- Initialize cpu set in pthread_attr_setaffinity_np feature test (Adrian Hunter)

- Only include tsc file for x86 (David Ahern)

- Compare JOBS to 0 after grep (David Ahern)

- Improve feature detection messages (Ingo Molnar)

- Revert "perf: Remove the extra validity check on nr_pages" (Kan Liang)

- Remove bias offset to find probe point by address (Masami Hiramatsu)

- Fix build error on ARCH=i386/x86_64/sparc64 )Namhyung Kim)

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

----------------------------------------------------------------
Adrian Hunter (1):
      perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test

Arnaldo Carvalho de Melo (3):
      perf tools: Fix FORK after COMM when synthesizing records for pre-existing threads
      perf tools: Reference count struct thread
      perf sched: No need to keep the session around

David Ahern (2):
      perf tools: Only include tsc file for x86
      perf tools: Compare JOBS to 0 after grep

Ingo Molnar (7):
      perf tools: Add PERF-FEATURES to the .gitignore file
      perf tools: Remove annoying extra message from the features build
      perf tools: Improve Python feature detection messages
      perf tools: Improve libperl detection message
      perf tools: Improve libbfd detection message
      perf tools: Improve feature test debuggability
      perf tools: Improve 'libbabel' feature check failure message

Kan Liang (1):
      Revert "perf: Remove the extra validity check on nr_pages"

Masami Hiramatsu (2):
      perf probe: Warn if given uprobe event accesses memory on older kernel
      perf probe: Remove bias offset to find probe point by address

Namhyung Kim (3):
      perf tools: Fix build error on ARCH=i386/x86_64/sparc64
      perf record: Get rid of -l option from Documentation
      perf record: Document --group option

Suzuki K. Poulose (1):
      perf stat: Report unsupported events properly

 kernel/events/core.c                               |  2 +-
 tools/perf/.gitignore                              |  1 +
 tools/perf/Documentation/perf-record.txt           | 12 ++++--
 tools/perf/Makefile                                |  2 +-
 tools/perf/builtin-sched.c                         | 26 +++++--------
 tools/perf/builtin-stat.c                          |  5 ++-
 tools/perf/builtin-trace.c                         |  7 +++-
 tools/perf/config/Makefile                         | 17 ++++-----
 tools/perf/config/Makefile.arch                    | 27 +++----------
 tools/perf/config/feature-checks/Makefile          | 16 ++++----
 .../test-pthread-attr-setaffinity-np.c             |  4 +-
 tools/perf/config/utilities.mak                    |  3 +-
 tools/perf/ui/browsers/hists.c                     |  6 +--
 tools/perf/util/Build                              |  2 +-
 tools/perf/util/build-id.c                         |  5 ++-
 tools/perf/util/event.c                            | 34 ++++++++++++-----
 tools/perf/util/hist.c                             |  2 +
 tools/perf/util/hist.h                             |  2 +-
 tools/perf/util/machine.c                          | 44 +++++++++++-----------
 tools/perf/util/machine.h                          |  1 -
 tools/perf/util/probe-event.c                      | 23 +++++++++++
 tools/perf/util/probe-finder.c                     |  5 +--
 tools/perf/util/session.c                          |  6 ---
 tools/perf/util/thread.c                           | 14 +++++++
 tools/perf/util/thread.h                           | 13 +++++++
 25 files changed, 164 insertions(+), 115 deletions(-)

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2013-12-13 15:11 Arnaldo Carvalho de Melo
@ 2013-12-16 13:54 ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2013-12-16 13:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian,
	Steven Rostedt, Arnaldo Carvalho de Melo


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

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> Regards,
> 
> - Arnaldo
> 
> The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63:
> 
>   perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c:
> 
>   tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Fixes:
> 
> . Fix inverted error verification bug in thread__fork, from David Ahern.
> 
> New features:
> 
> . Shell completion for 'perf kvm', from Ramkumar Ramachandra.
> 
> Refactorings:
> 
> . Get rid of panic() like calls in libtraceevent, from Namyung Kim.
> 
> . Start carving out symbol parsing routines from perf, just moving routines to
>   topic files in tools/lib/symbol/, tools that want to use it need to integrate
>   it directly, i.e. no tools/lib/symbol/Makefile is provided.
> 
> . Assorted refactoring patches, moving code around and adding
>   utility evlist methods that will be used in the IPT patchset,
>   from Adrian Hunter.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (5):
>       perf tools: Add perf_event_paranoid()
>       perf header: Allow header->data_offset to be predetermined
>       perf evlist: Add can_select_event() method
>       perf tools: Move mem_bswap32/64 to util.c
>       perf evlist: Add perf_evlist__to_front()
> 
> Arnaldo Carvalho de Melo (1):
>       tools lib symbol: Start carving out symbol parsing routines from perf
> 
> David Ahern (1):
>       perf tools: Fix inverted error verification bug in thread__fork
> 
> Namhyung Kim (12):
>       tools lib traceevent: Get rid of malloc_or_die() in show_error()
>       tools lib traceevent: Get rid of die in add_filter_type()
>       tools lib traceevent: Get rid of malloc_or_die() allocate_arg()
>       tools lib traceevent: Get rid of malloc_or_die() in read_token()
>       tools lib traceevent: Get rid of malloc_or_die() in find_event()
>       tools lib traceevent: Get rid of die() in add_right()
>       tools lib traceevent: Make add_left() return pevent_errno
>       tools lib traceevent: Get rid of die() in reparent_op_arg()
>       tools lib traceevent: Refactor create_arg_item()
>       tools lib traceevent: Refactor process_filter()
>       tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno
>       tools lib traceevent: Refactor pevent_filter_match() to get rid of die()
> 
> Ramkumar Ramachandra (1):
>       perf completion: Complete 'perf kvm'
> 
>  tools/lib/symbol/kallsyms.c         |  58 +++++
>  tools/lib/symbol/kallsyms.h         |  24 ++
>  tools/lib/traceevent/event-parse.h  |  43 ++-
>  tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++--------------
>  tools/perf/MANIFEST                 |   2 +
>  tools/perf/Makefile.perf            |   5 +
>  tools/perf/perf-completion.sh       |   4 +
>  tools/perf/util/event.c             |   1 +
>  tools/perf/util/evlist.c            |  20 +-
>  tools/perf/util/evlist.h            |   5 +
>  tools/perf/util/header.c            |   3 +-
>  tools/perf/util/machine.c           |   1 +
>  tools/perf/util/record.c            |  37 +++
>  tools/perf/util/session.c           |  21 --
>  tools/perf/util/session.h           |   2 -
>  tools/perf/util/symbol-elf.c        |   1 +
>  tools/perf/util/symbol.c            |  69 +----
>  tools/perf/util/symbol.h            |   3 -
>  tools/perf/util/thread.c            |   2 +-
>  tools/perf/util/util.c              |  41 +++
>  tools/perf/util/util.h              |   4 +
>  21 files changed, 550 insertions(+), 303 deletions(-)
>  create mode 100644 tools/lib/symbol/kallsyms.c
>  create mode 100644 tools/lib/symbol/kallsyms.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2013-12-13 15:11 Arnaldo Carvalho de Melo
  2013-12-16 13:54 ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-13 15:11 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Frederic Weisbecker,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian,
	Steven Rostedt, Arnaldo Carvalho de Melo

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

Hi Ingo,

	Please consider pulling,

Regards,

- Arnaldo

The following changes since commit c7f2e3cd6c1f4932ccc4135d050eae3f7c7aef63:

  perf: Optimize ring-buffer write by depending on control dependencies (2013-12-11 15:53:22 +0100)

are available in the git repository at:

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

for you to fetch changes up to 41e12e580a7b0c151199f927193548b84d3e874c:

  tools lib traceevent: Refactor pevent_filter_match() to get rid of die() (2013-12-13 10:30:22 -0300)

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

Fixes:

. Fix inverted error verification bug in thread__fork, from David Ahern.

New features:

. Shell completion for 'perf kvm', from Ramkumar Ramachandra.

Refactorings:

. Get rid of panic() like calls in libtraceevent, from Namyung Kim.

. Start carving out symbol parsing routines from perf, just moving routines to
  topic files in tools/lib/symbol/, tools that want to use it need to integrate
  it directly, i.e. no tools/lib/symbol/Makefile is provided.

. Assorted refactoring patches, moving code around and adding
  utility evlist methods that will be used in the IPT patchset,
  from Adrian Hunter.

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

----------------------------------------------------------------
Adrian Hunter (5):
      perf tools: Add perf_event_paranoid()
      perf header: Allow header->data_offset to be predetermined
      perf evlist: Add can_select_event() method
      perf tools: Move mem_bswap32/64 to util.c
      perf evlist: Add perf_evlist__to_front()

Arnaldo Carvalho de Melo (1):
      tools lib symbol: Start carving out symbol parsing routines from perf

David Ahern (1):
      perf tools: Fix inverted error verification bug in thread__fork

Namhyung Kim (12):
      tools lib traceevent: Get rid of malloc_or_die() in show_error()
      tools lib traceevent: Get rid of die in add_filter_type()
      tools lib traceevent: Get rid of malloc_or_die() allocate_arg()
      tools lib traceevent: Get rid of malloc_or_die() in read_token()
      tools lib traceevent: Get rid of malloc_or_die() in find_event()
      tools lib traceevent: Get rid of die() in add_right()
      tools lib traceevent: Make add_left() return pevent_errno
      tools lib traceevent: Get rid of die() in reparent_op_arg()
      tools lib traceevent: Refactor create_arg_item()
      tools lib traceevent: Refactor process_filter()
      tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errno
      tools lib traceevent: Refactor pevent_filter_match() to get rid of die()

Ramkumar Ramachandra (1):
      perf completion: Complete 'perf kvm'

 tools/lib/symbol/kallsyms.c         |  58 +++++
 tools/lib/symbol/kallsyms.h         |  24 ++
 tools/lib/traceevent/event-parse.h  |  43 ++-
 tools/lib/traceevent/parse-filter.c | 507 ++++++++++++++++++++++--------------
 tools/perf/MANIFEST                 |   2 +
 tools/perf/Makefile.perf            |   5 +
 tools/perf/perf-completion.sh       |   4 +
 tools/perf/util/event.c             |   1 +
 tools/perf/util/evlist.c            |  20 +-
 tools/perf/util/evlist.h            |   5 +
 tools/perf/util/header.c            |   3 +-
 tools/perf/util/machine.c           |   1 +
 tools/perf/util/record.c            |  37 +++
 tools/perf/util/session.c           |  21 --
 tools/perf/util/session.h           |   2 -
 tools/perf/util/symbol-elf.c        |   1 +
 tools/perf/util/symbol.c            |  69 +----
 tools/perf/util/symbol.h            |   3 -
 tools/perf/util/thread.c            |   2 +-
 tools/perf/util/util.c              |  41 +++
 tools/perf/util/util.h              |   4 +
 21 files changed, 550 insertions(+), 303 deletions(-)
 create mode 100644 tools/lib/symbol/kallsyms.c
 create mode 100644 tools/lib/symbol/kallsyms.h

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2012-09-11 23:52 Arnaldo Carvalho de Melo
@ 2012-09-13 15:15 ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2012-09-13 15:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David Ahern, Frederic Weisbecker, Irina Tirdea,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Pekka Enberg, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, arnaldo.melo, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> Best Regards,
> 
> - Arnaldo
> 
> The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99:
> 
>   perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes
> 
> . Remove die()/exit() calls from several tools.
> 
> . Add missing perf_regs.h file to MANIFEST
> 
> . Clean up and improve 'perf sched' performance by elliminating lots of
>   needless calls to libtraceevent.
> 
> . More patches to make perf build on Android, from Irina Tirdea
> 
> . Resolve vdso callchains, from Jiri Olsa
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (9):
>       perf test: Remove die() calls
>       perf sched: Remove die() calls
>       perf kmem: Remove die() calls
>       perf tools: Add missing perf_regs.h file to MANIFEST
>       perf sched: Remove unused thread parameter
>       perf sched: Use perf_tool as ancestor
>       perf evsel: Introduce perf_evsel__{str,int}val methods
>       perf sched: Use perf_evsel__{int,str}val
>       perf sched: Don't read all tracepoint variables in advance
> 
> Irina Tirdea (5):
>       perf tools: include wrapper for magic.h
>       perf tools: Update types definitions for Android
>       perf tools: include __WORDSIZE definition
>       perf tools: fix ALIGN redefinition in system headers
>       perf tools: Use __maybe_used for unused variables
> 
> Jiri Olsa (4):
>       perf tools: Do backtrace post unwind only if we regs and stack were captured
>       perf tools: Add memdup function
>       perf symbols: Make dsos__find function globally available
>       perf tools: Back [vdso] DSO with real data
> 
>  tools/lib/traceevent/event-parse.c                 |    8 +-
>  tools/lib/traceevent/event-parse.h                 |    4 +-
>  tools/perf/MANIFEST                                |    1 +
>  tools/perf/Makefile                                |    3 +
>  tools/perf/bench/bench.h                           |    3 +-
>  tools/perf/bench/mem-memcpy.c                      |    2 +-
>  tools/perf/bench/mem-memset.c                      |    2 +-
>  tools/perf/bench/sched-messaging.c                 |    2 +-
>  tools/perf/bench/sched-pipe.c                      |    6 +-
>  tools/perf/builtin-annotate.c                      |    2 +-
>  tools/perf/builtin-bench.c                         |    2 +-
>  tools/perf/builtin-buildid-cache.c                 |   10 +-
>  tools/perf/builtin-buildid-list.c                  |    3 +-
>  tools/perf/builtin-diff.c                          |    4 +-
>  tools/perf/builtin-evlist.c                        |    2 +-
>  tools/perf/builtin-help.c                          |    2 +-
>  tools/perf/builtin-inject.c                        |   24 +-
>  tools/perf/builtin-kmem.c                          |  130 +-
>  tools/perf/builtin-kvm.c                           |    2 +-
>  tools/perf/builtin-list.c                          |    2 +-
>  tools/perf/builtin-lock.c                          |    4 +-
>  tools/perf/builtin-probe.c                         |   24 +-
>  tools/perf/builtin-record.c                        |   10 +-
>  tools/perf/builtin-report.c                        |   11 +-
>  tools/perf/builtin-sched.c                         | 1446 +++++++++-----------
>  tools/perf/builtin-script.c                        |   29 +-
>  tools/perf/builtin-stat.c                          |   40 +-
>  tools/perf/builtin-test.c                          |   23 +-
>  tools/perf/builtin-timechart.c                     |   30 +-
>  tools/perf/builtin-top.c                           |    7 +-
>  tools/perf/ui/browser.c                            |    7 +-
>  tools/perf/ui/browsers/annotate.c                  |    6 +-
>  tools/perf/ui/gtk/browser.c                        |    5 +-
>  tools/perf/ui/gtk/setup.c                          |    2 +-
>  tools/perf/ui/gtk/util.c                           |    4 +-
>  tools/perf/ui/helpline.c                           |    2 +-
>  tools/perf/ui/helpline.h                           |    8 +-
>  tools/perf/ui/hist.c                               |   21 +-
>  tools/perf/ui/tui/setup.c                          |    4 +-
>  tools/perf/util/alias.c                            |    3 +-
>  tools/perf/util/annotate.c                         |    6 +-
>  tools/perf/util/annotate.h                         |   13 +-
>  tools/perf/util/build-id.c                         |   11 +-
>  tools/perf/util/cache.h                            |    6 +-
>  tools/perf/util/callchain.c                        |    6 +-
>  tools/perf/util/cgroup.c                           |    4 +-
>  tools/perf/util/config.c                           |    6 +-
>  tools/perf/util/debug.h                            |    9 +-
>  tools/perf/util/event.c                            |   29 +-
>  tools/perf/util/event.h                            |    2 +-
>  tools/perf/util/evsel.c                            |   35 +
>  tools/perf/util/evsel.h                            |    7 +
>  tools/perf/util/header.c                           |  177 ++-
>  tools/perf/util/header.h                           |    2 +-
>  tools/perf/util/help.c                             |    3 +-
>  tools/perf/util/hist.c                             |    2 +-
>  tools/perf/util/hist.h                             |   32 +-
>  tools/perf/util/include/linux/bitops.h             |    4 +
>  tools/perf/util/include/linux/compiler.h           |    8 +-
>  tools/perf/util/include/linux/kernel.h             |   13 +-
>  tools/perf/util/include/linux/magic.h              |   12 +
>  tools/perf/util/include/linux/string.h             |    2 +
>  tools/perf/util/include/linux/types.h              |    8 +
>  tools/perf/util/intlist.c                          |    4 +-
>  tools/perf/util/map.c                              |   12 +-
>  tools/perf/util/map.h                              |    2 +-
>  tools/perf/util/parse-events-test.c                |    6 +-
>  tools/perf/util/parse-events.c                     |    7 +-
>  tools/perf/util/parse-events.l                     |    2 +-
>  tools/perf/util/parse-events.y                     |    4 +-
>  tools/perf/util/parse-options.c                    |    3 +-
>  tools/perf/util/perf_regs.h                        |    2 +-
>  tools/perf/util/pmu.y                              |    6 +-
>  tools/perf/util/probe-event.c                      |   21 +-
>  tools/perf/util/probe-finder.c                     |    4 +-
>  tools/perf/util/python.c                           |    8 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |    8 +-
>  .../util/scripting-engines/trace-event-python.c    |   10 +-
>  tools/perf/util/session.c                          |   61 +-
>  tools/perf/util/sort.c                             |   14 +-
>  tools/perf/util/string.c                           |   18 +-
>  tools/perf/util/symbol-minimal.c                   |   28 +-
>  tools/perf/util/symbol.c                           |    6 +-
>  tools/perf/util/symbol.h                           |    8 +-
>  tools/perf/util/trace-event-parse.c                |    4 +-
>  tools/perf/util/trace-event-scripting.c            |   33 +-
>  tools/perf/util/unwind.c                           |   36 +-
>  tools/perf/util/unwind.h                           |   11 +-
>  tools/perf/util/util.h                             |    2 +-
>  tools/perf/util/vdso.c                             |  111 ++
>  tools/perf/util/vdso.h                             |   18 +
>  tools/perf/util/wrapper.c                          |    3 +-
>  92 files changed, 1518 insertions(+), 1231 deletions(-)
>  create mode 100644 tools/perf/util/include/linux/magic.h
>  create mode 100644 tools/perf/util/vdso.c
>  create mode 100644 tools/perf/util/vdso.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2012-09-11 23:52 Arnaldo Carvalho de Melo
  2012-09-13 15:15 ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-09-11 23:52 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt, arnaldo.melo,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

Best Regards,

- Arnaldo

The following changes since commit d5cb2aef4fda355fbafe8db4f425b73ea94d2019:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2012-09-09 10:39:14 +0200)

are available in the git repository at:


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

for you to fetch changes up to 9ec3f4e437ede2f3b5087d412abe16a0219b3b99:

  perf sched: Don't read all tracepoint variables in advance (2012-09-11 20:39:19 -0300)

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

. Remove die()/exit() calls from several tools.

. Add missing perf_regs.h file to MANIFEST

. Clean up and improve 'perf sched' performance by elliminating lots of
  needless calls to libtraceevent.

. More patches to make perf build on Android, from Irina Tirdea

. Resolve vdso callchains, from Jiri Olsa

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (9):
      perf test: Remove die() calls
      perf sched: Remove die() calls
      perf kmem: Remove die() calls
      perf tools: Add missing perf_regs.h file to MANIFEST
      perf sched: Remove unused thread parameter
      perf sched: Use perf_tool as ancestor
      perf evsel: Introduce perf_evsel__{str,int}val methods
      perf sched: Use perf_evsel__{int,str}val
      perf sched: Don't read all tracepoint variables in advance

Irina Tirdea (5):
      perf tools: include wrapper for magic.h
      perf tools: Update types definitions for Android
      perf tools: include __WORDSIZE definition
      perf tools: fix ALIGN redefinition in system headers
      perf tools: Use __maybe_used for unused variables

Jiri Olsa (4):
      perf tools: Do backtrace post unwind only if we regs and stack were captured
      perf tools: Add memdup function
      perf symbols: Make dsos__find function globally available
      perf tools: Back [vdso] DSO with real data

 tools/lib/traceevent/event-parse.c                 |    8 +-
 tools/lib/traceevent/event-parse.h                 |    4 +-
 tools/perf/MANIFEST                                |    1 +
 tools/perf/Makefile                                |    3 +
 tools/perf/bench/bench.h                           |    3 +-
 tools/perf/bench/mem-memcpy.c                      |    2 +-
 tools/perf/bench/mem-memset.c                      |    2 +-
 tools/perf/bench/sched-messaging.c                 |    2 +-
 tools/perf/bench/sched-pipe.c                      |    6 +-
 tools/perf/builtin-annotate.c                      |    2 +-
 tools/perf/builtin-bench.c                         |    2 +-
 tools/perf/builtin-buildid-cache.c                 |   10 +-
 tools/perf/builtin-buildid-list.c                  |    3 +-
 tools/perf/builtin-diff.c                          |    4 +-
 tools/perf/builtin-evlist.c                        |    2 +-
 tools/perf/builtin-help.c                          |    2 +-
 tools/perf/builtin-inject.c                        |   24 +-
 tools/perf/builtin-kmem.c                          |  130 +-
 tools/perf/builtin-kvm.c                           |    2 +-
 tools/perf/builtin-list.c                          |    2 +-
 tools/perf/builtin-lock.c                          |    4 +-
 tools/perf/builtin-probe.c                         |   24 +-
 tools/perf/builtin-record.c                        |   10 +-
 tools/perf/builtin-report.c                        |   11 +-
 tools/perf/builtin-sched.c                         | 1446 +++++++++-----------
 tools/perf/builtin-script.c                        |   29 +-
 tools/perf/builtin-stat.c                          |   40 +-
 tools/perf/builtin-test.c                          |   23 +-
 tools/perf/builtin-timechart.c                     |   30 +-
 tools/perf/builtin-top.c                           |    7 +-
 tools/perf/ui/browser.c                            |    7 +-
 tools/perf/ui/browsers/annotate.c                  |    6 +-
 tools/perf/ui/gtk/browser.c                        |    5 +-
 tools/perf/ui/gtk/setup.c                          |    2 +-
 tools/perf/ui/gtk/util.c                           |    4 +-
 tools/perf/ui/helpline.c                           |    2 +-
 tools/perf/ui/helpline.h                           |    8 +-
 tools/perf/ui/hist.c                               |   21 +-
 tools/perf/ui/tui/setup.c                          |    4 +-
 tools/perf/util/alias.c                            |    3 +-
 tools/perf/util/annotate.c                         |    6 +-
 tools/perf/util/annotate.h                         |   13 +-
 tools/perf/util/build-id.c                         |   11 +-
 tools/perf/util/cache.h                            |    6 +-
 tools/perf/util/callchain.c                        |    6 +-
 tools/perf/util/cgroup.c                           |    4 +-
 tools/perf/util/config.c                           |    6 +-
 tools/perf/util/debug.h                            |    9 +-
 tools/perf/util/event.c                            |   29 +-
 tools/perf/util/event.h                            |    2 +-
 tools/perf/util/evsel.c                            |   35 +
 tools/perf/util/evsel.h                            |    7 +
 tools/perf/util/header.c                           |  177 ++-
 tools/perf/util/header.h                           |    2 +-
 tools/perf/util/help.c                             |    3 +-
 tools/perf/util/hist.c                             |    2 +-
 tools/perf/util/hist.h                             |   32 +-
 tools/perf/util/include/linux/bitops.h             |    4 +
 tools/perf/util/include/linux/compiler.h           |    8 +-
 tools/perf/util/include/linux/kernel.h             |   13 +-
 tools/perf/util/include/linux/magic.h              |   12 +
 tools/perf/util/include/linux/string.h             |    2 +
 tools/perf/util/include/linux/types.h              |    8 +
 tools/perf/util/intlist.c                          |    4 +-
 tools/perf/util/map.c                              |   12 +-
 tools/perf/util/map.h                              |    2 +-
 tools/perf/util/parse-events-test.c                |    6 +-
 tools/perf/util/parse-events.c                     |    7 +-
 tools/perf/util/parse-events.l                     |    2 +-
 tools/perf/util/parse-events.y                     |    4 +-
 tools/perf/util/parse-options.c                    |    3 +-
 tools/perf/util/perf_regs.h                        |    2 +-
 tools/perf/util/pmu.y                              |    6 +-
 tools/perf/util/probe-event.c                      |   21 +-
 tools/perf/util/probe-finder.c                     |    4 +-
 tools/perf/util/python.c                           |    8 +-
 .../perf/util/scripting-engines/trace-event-perl.c |    8 +-
 .../util/scripting-engines/trace-event-python.c    |   10 +-
 tools/perf/util/session.c                          |   61 +-
 tools/perf/util/sort.c                             |   14 +-
 tools/perf/util/string.c                           |   18 +-
 tools/perf/util/symbol-minimal.c                   |   28 +-
 tools/perf/util/symbol.c                           |    6 +-
 tools/perf/util/symbol.h                           |    8 +-
 tools/perf/util/trace-event-parse.c                |    4 +-
 tools/perf/util/trace-event-scripting.c            |   33 +-
 tools/perf/util/unwind.c                           |   36 +-
 tools/perf/util/unwind.h                           |   11 +-
 tools/perf/util/util.h                             |    2 +-
 tools/perf/util/vdso.c                             |  111 ++
 tools/perf/util/vdso.h                             |   18 +
 tools/perf/util/wrapper.c                          |    3 +-
 92 files changed, 1518 insertions(+), 1231 deletions(-)
 create mode 100644 tools/perf/util/include/linux/magic.h
 create mode 100644 tools/perf/util/vdso.c
 create mode 100644 tools/perf/util/vdso.h

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

* Re: [GIT PULL 00/20] perf/core improvements and fixes
  2012-07-05 15:44 Arnaldo Carvalho de Melo
@ 2012-07-06  8:22 ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2012-07-06  8:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Borislav Petkov, Corey Ashford, David Ahern,
	Frederic Weisbecker, Jiri Olsa, Johannes Berg, Namhyung Kim,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Huewe,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt, Ulrich Drepper,
	Wolfgang Mauerer, arnaldo.melo, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, this one contains my first 
> merge, a pull request by Namhyung, please check if everything 
> is OK,
> 
> Thanks,
> 
> - Arnaldo
> 
> The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3:
> 
>   perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83:
> 
>   Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300)
> 
> ----------------------------------------------------------------
> 
> perf/core improvements and fixes:
> 
> . Preparatory patches to use hw events in PMU syntax, from Jiri Olsa
> 
> . Remaining backport of trace-cmd's libparseevent, from Namhyung Kim
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core
> 
> Jiri Olsa (4):
>       perf test: Use ARRAY_SIZE in parse events tests
>       perf tools: Add empty rule for new line in event syntax parsing
>       perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
>       perf tools: Split event symbols arrays to hw and sw parts
> 
> Namhyung Kim (10):
>       tools lib traceevent: Fix printk_cmp()
>       tools lib traceevent: Introduce extend_token()
>       tools lib traceevent: Handle strdup failure cases
>       tools lib traceevent: Handle realloc() failure path
>       tools lib traceevent: Pass string type argument to args
>       tools lib traceevent: Do not call add_event() again if allocation failed
>       tools lib traceevent: Fix some comments
>       tools lib traceevent: Check result of malloc() during reading token
>       tools lib traceevent: Check return value of arg_to_str()
>       tools lib traceevent: Cleanup realloc use
> 
> Peter Huewe (1):
>       tools lib traceevent: Add missing break in make_bprint_args
> 
> Steven Rostedt (4):
>       tools lib traceevent: Let filtering numbers by string use function names
>       tools lib traceevent: Add support for "%.*s" in bprintk events
>       tools lib traceevent: Add support to show migrate disable counter
>       tools lib traceevent: Fix %pM print format arg handling
> 
> Wolfgang Mauerer (1):
>       tools lib traceevent: Fix trace_printk for long integers
> 
>  tools/lib/traceevent/event-parse.c  |  287 +++++++++++++++++++++++------------
>  tools/lib/traceevent/parse-filter.c |   86 +++++++----
>  tools/perf/util/parse-events-test.c |   29 ++--
>  tools/perf/util/parse-events.c      |  174 ++++++++++++++-------
>  tools/perf/util/parse-events.l      |    3 +-
>  tools/perf/util/parse-events.y      |   15 +-
>  6 files changed, 391 insertions(+), 203 deletions(-)

Pulled, thanks a lot Arnaldo! The commits from Namhyung Kim are 
looking good as well.

Thanks,

	Ingo

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

* [GIT PULL 00/20] perf/core improvements and fixes
@ 2012-07-05 15:44 Arnaldo Carvalho de Melo
  2012-07-06  8:22 ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-07-05 15:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Borislav Petkov,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jiri Olsa,
	Johannes Berg, Namhyung Kim, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Peter Huewe, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, Ulrich Drepper, Wolfgang Mauerer, arnaldo.melo,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, this one contains my first merge, a pull
request by Namhyung, please check if everything is OK,

Thanks,

- Arnaldo

The following changes since commit 17d7a1123f0f6d532830152564cc812cc73db2f3:

  perf bench: Fix confused variable namings and descriptions in mem subsystem (2012-07-02 14:35:45 -0300)

are available in the git repository at:

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

for you to fetch changes up to 81e9b994bb20716d1f6c47e048e4ae4a43de2f83:

  Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core (2012-07-05 12:16:32 -0300)

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

perf/core improvements and fixes:

. Preparatory patches to use hw events in PMU syntax, from Jiri Olsa

. Remaining backport of trace-cmd's libparseevent, from Namhyung Kim

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      Merge tag 'libtraceevent-core-for-acme' of git://git.kernel.org/.../namhyung/linux-perf into perf/core

Jiri Olsa (4):
      perf test: Use ARRAY_SIZE in parse events tests
      perf tools: Add empty rule for new line in event syntax parsing
      perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokens
      perf tools: Split event symbols arrays to hw and sw parts

Namhyung Kim (10):
      tools lib traceevent: Fix printk_cmp()
      tools lib traceevent: Introduce extend_token()
      tools lib traceevent: Handle strdup failure cases
      tools lib traceevent: Handle realloc() failure path
      tools lib traceevent: Pass string type argument to args
      tools lib traceevent: Do not call add_event() again if allocation failed
      tools lib traceevent: Fix some comments
      tools lib traceevent: Check result of malloc() during reading token
      tools lib traceevent: Check return value of arg_to_str()
      tools lib traceevent: Cleanup realloc use

Peter Huewe (1):
      tools lib traceevent: Add missing break in make_bprint_args

Steven Rostedt (4):
      tools lib traceevent: Let filtering numbers by string use function names
      tools lib traceevent: Add support for "%.*s" in bprintk events
      tools lib traceevent: Add support to show migrate disable counter
      tools lib traceevent: Fix %pM print format arg handling

Wolfgang Mauerer (1):
      tools lib traceevent: Fix trace_printk for long integers

 tools/lib/traceevent/event-parse.c  |  287 +++++++++++++++++++++++------------
 tools/lib/traceevent/parse-filter.c |   86 +++++++----
 tools/perf/util/parse-events-test.c |   29 ++--
 tools/perf/util/parse-events.c      |  174 ++++++++++++++-------
 tools/perf/util/parse-events.l      |    3 +-
 tools/perf/util/parse-events.y      |   15 +-
 6 files changed, 391 insertions(+), 203 deletions(-)

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

end of thread, other threads:[~2017-03-28  5:46 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-17 21:24 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 01/20] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 02/20] perf tools powerpc: Fix build issue when DWARF support is disabled Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 03/20] perf kvm stat report: Save pid string in opts.target.pid Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 04/20] perf kvm stat report: Enable the target.system_wide flag Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 05/20] perf kvm stat report: Unify the title bar output Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 06/20] perf tools: Allow to specify lib compile variable for spec usage Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 07/20] perf tools: Let a user specify a PMU event without any config terms Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 08/20] perf tools: Add perf-with-kcore script Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 09/20] perf tools: Let default config be defined for a PMU Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 10/20] perf tools: Add perf_pmu__scan_file() Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 11/20] perf tool: fix compilation for ARM Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 12/20] perf tools: Disable kernel symbol demangling by default Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 13/20] perf tools: Fix GNU-only grep usage in Makefile Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 14/20] perf tools: Don't include sys/poll.h directly Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 15/20] perf tools: define _DEFAULT_SOURCE for glibc_2.20 Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 16/20] perf symbols: Ignore stripped vmlinux and fallback to kallsyms Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 17/20] perf symbols: Add path to Ubuntu kernel debuginfo file Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 18/20] perf probe: Do not access kallsyms when analyzing user binaries Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 19/20] perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name Arnaldo Carvalho de Melo
2014-09-17 21:24 ` [PATCH 20/20] perf record: Use ring buffer consume method to look like other tools Arnaldo Carvalho de Melo
2014-09-19  5:15 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2017-03-28  1:38 Arnaldo Carvalho de Melo
2017-03-28  5:45 ` Ingo Molnar
2017-03-24 14:57 Arnaldo Carvalho de Melo
2017-03-24 18:39 ` Ingo Molnar
2016-12-05 21:37 Arnaldo Carvalho de Melo
2016-12-06  8:17 ` Ingo Molnar
2015-03-03  3:25 Arnaldo Carvalho de Melo
2015-03-03  6:20 ` Ingo Molnar
2015-03-10 10:03 ` Ingo Molnar
2015-03-10 14:03   ` Arnaldo Carvalho de Melo
2015-03-10 14:37     ` Ingo Molnar
2013-12-13 15:11 Arnaldo Carvalho de Melo
2013-12-16 13:54 ` Ingo Molnar
2012-09-11 23:52 Arnaldo Carvalho de Melo
2012-09-13 15:15 ` Ingo Molnar
2012-07-05 15:44 Arnaldo Carvalho de Melo
2012-07-06  8:22 ` Ingo Molnar

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