All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 00/13] perf/core improvements and fixes
@ 2014-09-08 21:17 Arnaldo Carvalho de Melo
  2014-09-08 21:17 ` [PATCH 01/13] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
                   ` (14 more replies)
  0 siblings, 15 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:17 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexander Yarygin, Anton Blanchard,
	Christian Borntraeger, Corey Ashford, David Ahern,
	Frederic Weisbecker, Jean Pihet, Jiri Olsa, Kyle McMartin,
	Michael Ellerman, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Sukadev Bhattiprolu, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:

  Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:

  perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)

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

User visible:

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

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
  - Build programs to copy 32-bit compatibility VDSOs
  - Add support for 32-bit compatibility VDSOs
  - Let default config be defined for a PMU
  - Add perf_pmu__scan_file()

o Add feature checks to .gitignore (Alexander Shishkin)

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)

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

----------------------------------------------------------------
Adrian Hunter (6):
      perf tools: Let a user specify a PMU event without any config terms
      perf tools: Add perf-with-kcore script
      perf tools: Build programs to copy 32-bit compatibility VDSOs
      perf tools: Add support for 32-bit compatibility VDSOs
      perf tools: Let default config be defined for a PMU
      perf tools: Add perf_pmu__scan_file()

Alexander Shishkin (1):
      perf tools: Add feature checks to .gitignore

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 (1):
      perf tools powerpc: Fix build issue when DWARF support is disabled

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

 tools/perf/.gitignore            |   2 +
 tools/perf/Makefile.perf         |  42 ++++++-
 tools/perf/arch/powerpc/Makefile |   2 +-
 tools/perf/builtin-kvm.c         |  23 ++--
 tools/perf/config/Makefile       |  33 ++++-
 tools/perf/config/Makefile.arch  |   8 ++
 tools/perf/perf-read-vdso.c      |  59 +++++++++
 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/sort.c           |  37 +++++-
 tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
 tools/perf/util/vdso.h           |   4 +-
 17 files changed, 712 insertions(+), 44 deletions(-)
 create mode 100644 tools/perf/perf-read-vdso.c
 create mode 100644 tools/perf/perf-with-kcore.sh

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

* [PATCH 01/13] perf tools: Add +field argument support for --sort option
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2014-09-08 21:17 ` Arnaldo Carvalho de Melo
  2014-09-08 21:17 ` [PATCH 02/13] perf tools powerpc: Fix build issue when DWARF support is disabled Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:17 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] 25+ messages in thread

* [PATCH 02/13] perf tools powerpc: Fix build issue when DWARF support is disabled
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2014-09-08 21:17 ` [PATCH 01/13] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
@ 2014-09-08 21:17 ` Arnaldo Carvalho de Melo
  2014-09-08 21:17 ` [PATCH 03/13] perf kvm stat report: Save pid string in opts.target.pid Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:17 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] 25+ messages in thread

* [PATCH 03/13] perf kvm stat report: Save pid string in opts.target.pid
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2014-09-08 21:17 ` [PATCH 01/13] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
  2014-09-08 21:17 ` [PATCH 02/13] perf tools powerpc: Fix build issue when DWARF support is disabled Arnaldo Carvalho de Melo
@ 2014-09-08 21:17 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 04/13] perf kvm stat report: Enable the target.system_wide flag Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:17 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] 25+ messages in thread

* [PATCH 04/13] perf kvm stat report: Enable the target.system_wide flag
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2014-09-08 21:17 ` [PATCH 03/13] perf kvm stat report: Save pid string in opts.target.pid Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 05/13] perf kvm stat report: Unify the title bar output Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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] 25+ messages in thread

* [PATCH 05/13] perf kvm stat report: Unify the title bar output
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 04/13] perf kvm stat report: Enable the target.system_wide flag Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 06/13] perf tools: Allow to specify lib compile variable for spec usage Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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] 25+ messages in thread

* [PATCH 06/13] perf tools: Allow to specify lib compile variable for spec usage
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 05/13] perf kvm stat report: Unify the title bar output Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 07/13] perf tools: Add feature checks to .gitignore Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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] 25+ messages in thread

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

From: Alexander Shishkin <alexander.shishkin@linux.intel.com>

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.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-25-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 782d86e961b9..0fc74cde02f0 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -24,3 +24,4 @@ config.mak.autogen
 *-flex.*
 *.pyc
 *.pyo
+config/feature-checks/test-*
-- 
1.9.3


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

* [PATCH 08/13] perf tools: Let a user specify a PMU event without any config terms
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 07/13] perf tools: Add feature checks to .gitignore Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 09/13] perf tools: Add perf-with-kcore script Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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] 25+ messages in thread

* [PATCH 09/13] perf tools: Add perf-with-kcore script
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 08/13] perf tools: Let a user specify a PMU event without any config terms Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 10/13] perf tools: Build programs to copy 32-bit compatibility VDSOs Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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 0fc74cde02f0..af50829409e6 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] 25+ messages in thread

* [PATCH 10/13] perf tools: Build programs to copy 32-bit compatibility VDSOs
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 09/13] perf tools: Add perf-with-kcore script Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 11/13] perf tools: Add support for " Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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>

perf tools copy VDSO out of memory.  However, on 64-bit machines there
may be 32-bit compatibility VDOs also.  To copy those requires separate
32-bit executables.  This patch adds to the build additional programs
perf-read-vdso32 and perf-read-vdsox32 for 32-bit and x32 respectively.

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-31-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf        | 37 +++++++++++++++++++++++---
 tools/perf/config/Makefile      | 21 +++++++++++++++
 tools/perf/config/Makefile.arch |  8 ++++++
 tools/perf/perf-read-vdso.c     | 59 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 121 insertions(+), 4 deletions(-)
 create mode 100644 tools/perf/perf-read-vdso.c

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 171f4e65601b..8c57566205f0 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -60,6 +60,12 @@ include config/utilities.mak
 #
 # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
 # for dwarf backtrace post unwind.
+#
+# Define NO_PERF_READ_VDSO32 if you do not want to build perf-read-vdso32
+# for reading the 32-bit compatibility VDSO in 64-bit mode
+#
+# Define NO_PERF_READ_VDSOX32 if you do not want to build perf-read-vdsox32
+# for reading the x32 mode 32-bit compatibility VDSO in 64-bit mode
 
 ifeq ($(srctree),)
 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
@@ -171,11 +177,16 @@ $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
 
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
 
-#
-# Single 'perf' binary right now:
-#
 PROGRAMS += $(OUTPUT)perf
 
+ifndef NO_PERF_READ_VDSO32
+PROGRAMS += $(OUTPUT)perf-read-vdso32
+endif
+
+ifndef NO_PERF_READ_VDSOX32
+PROGRAMS += $(OUTPUT)perf-read-vdsox32
+endif
+
 # what 'all' will build and 'install' will install, in perfexecdir
 ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
 
@@ -731,6 +742,16 @@ $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Uti
 $(OUTPUT)perf-%: %.o $(PERFLIBS)
 	$(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
 
+ifndef NO_PERF_READ_VDSO32
+$(OUTPUT)perf-read-vdso32: perf-read-vdso.c
+	$(QUIET_CC)$(CC) -m32 -Wall -Werror -o $@ perf-read-vdso.c
+endif
+
+ifndef NO_PERF_READ_VDSOX32
+$(OUTPUT)perf-read-vdsox32: perf-read-vdso.c
+	$(QUIET_CC)$(CC) -mx32 -Wall -Werror -o $@ perf-read-vdso.c
+endif
+
 $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
 
@@ -875,6 +896,14 @@ install-bin: all install-gtk
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
 		$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \
 		$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
+ifndef NO_PERF_READ_VDSO32
+	$(call QUIET_INSTALL, perf-read-vdso32) \
+		$(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(bindir_SQ)';
+endif
+ifndef NO_PERF_READ_VDSOX32
+	$(call QUIET_INSTALL, perf-read-vdsox32) \
+		$(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(bindir_SQ)';
+endif
 	$(call QUIET_INSTALL, libexec) \
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
 	$(call QUIET_INSTALL, perf-archive) \
@@ -927,7 +956,7 @@ config-clean:
 
 clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
 	$(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-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
 	$(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
 	$(python-clean)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 58f609198c6d..499601a49d8e 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -622,6 +622,27 @@ ifdef HAVE_KVM_STAT_SUPPORT
     CFLAGS += -DHAVE_KVM_STAT_SUPPORT
 endif
 
+ifeq (${IS_64_BIT}, 1)
+  ifndef NO_PERF_READ_VDSO32
+    CAN_DO := $(shell echo "main() {}" | ${CC} -m32 -x c - >/dev/null 2>/dev/null && echo 1 || echo 0)
+    ifneq (${CAN_DO}, 1)
+      NO_PERF_READ_VDSO32 := 1
+    endif
+  endif
+  ifneq (${IS_X86_64}, 1)
+    NO_PERF_READ_VDSOX32 := 1
+  endif
+  ifndef NO_PERF_READ_VDSOX32
+    CAN_DO := $(shell echo 'main() {}' | ${CC} -mx32 -x c - >/dev/null 2>/dev/null && echo 1 || echo 0)
+    ifneq (${CAN_DO}, 1)
+      NO_PERF_READ_VDSOX32 := 1
+    endif
+  endif
+else
+  NO_PERF_READ_VDSO32 := 1
+  NO_PERF_READ_VDSOX32 := 1
+endif
+
 # Among the variables below, these:
 #   perfexecdir
 #   template_dir
diff --git a/tools/perf/config/Makefile.arch b/tools/perf/config/Makefile.arch
index 4b06719ee984..851cd0172a76 100644
--- a/tools/perf/config/Makefile.arch
+++ b/tools/perf/config/Makefile.arch
@@ -21,3 +21,11 @@ ifeq ($(ARCH),x86_64)
     RAW_ARCH := x86_64
   endif
 endif
+
+ifeq (${IS_X86_64}, 1)
+  IS_64_BIT := 1
+else ifeq ($(ARCH),x86)
+  IS_64_BIT := 0
+else
+  IS_64_BIT := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
+endif
diff --git a/tools/perf/perf-read-vdso.c b/tools/perf/perf-read-vdso.c
new file mode 100644
index 000000000000..a6b49b5c2cf3
--- /dev/null
+++ b/tools/perf/perf-read-vdso.c
@@ -0,0 +1,59 @@
+#include <stdio.h>
+#include <string.h>
+
+#define VDSO__MAP_NAME "[vdso]"
+
+static int find_vdso_map(void **start, void **end)
+{
+	FILE *maps;
+	char line[128];
+	int found = 0;
+
+	maps = fopen("/proc/self/maps", "r");
+	if (!maps) {
+		fprintf(stderr, "vdso: cannot open maps\n");
+		return -1;
+	}
+
+	while (!found && fgets(line, sizeof(line), maps)) {
+		int m = -1;
+
+		/* We care only about private r-x mappings. */
+		if (2 != sscanf(line, "%p-%p r-xp %*x %*x:%*x %*u %n",
+				start, end, &m))
+			continue;
+		if (m < 0)
+			continue;
+
+		if (!strncmp(&line[m], VDSO__MAP_NAME,
+			     sizeof(VDSO__MAP_NAME) - 1))
+			found = 1;
+	}
+
+	fclose(maps);
+	return !found;
+}
+
+int main(void)
+{
+	void *start, *end;
+	size_t size, written;
+
+	if (find_vdso_map(&start, &end))
+		return 1;
+
+	size = end - start;
+
+	while (size) {
+		written = fwrite(start, 1, size, stdout);
+		if (!written)
+			return 1;
+		start += written;
+		size -= written;
+	}
+
+	if (fflush(stdout))
+		return 1;
+
+	return 0;
+}
-- 
1.9.3


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

* [PATCH 11/13] perf tools: Add support for 32-bit compatibility VDSOs
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 10/13] perf tools: Build programs to copy 32-bit compatibility VDSOs Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 12/13] perf tools: Let default config be defined for a PMU Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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>

'perf record' post-processes the event stream  to create a list of
build-ids for object files for which sample events have been recorded.
That results in those object files being recorded in the build-id cache.

In the case of VDSO, perf tools reads it from memory and copies it into
a temporary file, which as decribed above, gets added to the build-id
cache.

Then when the perf.data file is processed by other tools, the build-id
of VDSO is listed in the perf.data file and the VDSO can be read from
the build-id cache.  In that case the name of the map, the short name of
the DSO, and the entry in the build-id cache are all "[vdso]".

However, in the 64-bit case, there also can be 32-bit compatibility
VDSOs.

A previous patch added programs "perf-read-vdso32" and "perf
read-vdsox32".  This patch uses those programs to read the correct VDSO
for a thread and create a temporary file just as for the 64-bit VDSO.
The map name and the entry in the build-id cache are still "[vdso]" but
the DSO short name becomes "[vdso32]" and "[vdsox32]" respectively.

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-32-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/vdso.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/perf/util/vdso.h |   4 +-
 2 files changed, 172 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index adca69384fcc..b721f4caa208 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -12,6 +12,7 @@
 #include "util.h"
 #include "symbol.h"
 #include "machine.h"
+#include "thread.h"
 #include "linux/string.h"
 #include "debug.h"
 
@@ -22,10 +23,15 @@ struct vdso_file {
 	bool error;
 	char temp_file_name[sizeof(VDSO__TEMP_FILE_NAME)];
 	const char *dso_name;
+	const char *read_prog;
 };
 
 struct vdso_info {
 	struct vdso_file vdso;
+#if BITS_PER_LONG == 64
+	struct vdso_file vdso32;
+	struct vdso_file vdsox32;
+#endif
 };
 
 static struct vdso_info *vdso_info__new(void)
@@ -35,6 +41,18 @@ static struct vdso_info *vdso_info__new(void)
 			.temp_file_name = VDSO__TEMP_FILE_NAME,
 			.dso_name = DSO__NAME_VDSO,
 		},
+#if BITS_PER_LONG == 64
+		.vdso32  = {
+			.temp_file_name = VDSO__TEMP_FILE_NAME,
+			.dso_name = DSO__NAME_VDSO32,
+			.read_prog = "perf-read-vdso32",
+		},
+		.vdsox32  = {
+			.temp_file_name = VDSO__TEMP_FILE_NAME,
+			.dso_name = DSO__NAME_VDSOX32,
+			.read_prog = "perf-read-vdsox32",
+		},
+#endif
 	};
 
 	return memdup(&vdso_info_init, sizeof(vdso_info_init));
@@ -117,6 +135,12 @@ void vdso__exit(struct machine *machine)
 
 	if (vdso_info->vdso.found)
 		unlink(vdso_info->vdso.temp_file_name);
+#if BITS_PER_LONG == 64
+	if (vdso_info->vdso32.found)
+		unlink(vdso_info->vdso.temp_file_name);
+	if (vdso_info->vdsox32.found)
+		unlink(vdso_info->vdso.temp_file_name);
+#endif
 
 	zfree(&machine->vdso_info);
 }
@@ -135,6 +159,143 @@ static struct dso *vdso__new(struct machine *machine, const char *short_name,
 	return dso;
 }
 
+#if BITS_PER_LONG == 64
+
+static enum dso_type machine__thread_dso_type(struct machine *machine,
+					      struct thread *thread)
+{
+	enum dso_type dso_type = DSO__TYPE_UNKNOWN;
+	struct map *map;
+	struct dso *dso;
+
+	map = map_groups__first(thread->mg, MAP__FUNCTION);
+	for (; map ; map = map_groups__next(map)) {
+		dso = map->dso;
+		if (!dso || dso->long_name[0] != '/')
+			continue;
+		dso_type = dso__type(dso, machine);
+		if (dso_type != DSO__TYPE_UNKNOWN)
+			break;
+	}
+
+	return dso_type;
+}
+
+static int vdso__do_copy_compat(FILE *f, int fd)
+{
+	char buf[4096];
+	size_t count;
+
+	while (1) {
+		count = fread(buf, 1, sizeof(buf), f);
+		if (ferror(f))
+			return -errno;
+		if (feof(f))
+			break;
+		if (count && writen(fd, buf, count) != (ssize_t)count)
+			return -errno;
+	}
+
+	return 0;
+}
+
+static int vdso__copy_compat(const char *prog, int fd)
+{
+	FILE *f;
+	int err;
+
+	f = popen(prog, "r");
+	if (!f)
+		return -errno;
+
+	err = vdso__do_copy_compat(f, fd);
+
+	if (pclose(f) == -1)
+		return -errno;
+
+	return err;
+}
+
+static int vdso__create_compat_file(const char *prog, char *temp_name)
+{
+	int fd, err;
+
+	fd = mkstemp(temp_name);
+	if (fd < 0)
+		return -errno;
+
+	err = vdso__copy_compat(prog, fd);
+
+	if (close(fd) == -1)
+		return -errno;
+
+	return err;
+}
+
+static const char *vdso__get_compat_file(struct vdso_file *vdso_file)
+{
+	int err;
+
+	if (vdso_file->found)
+		return vdso_file->temp_file_name;
+
+	if (vdso_file->error)
+		return NULL;
+
+	err = vdso__create_compat_file(vdso_file->read_prog,
+				       vdso_file->temp_file_name);
+	if (err) {
+		pr_err("%s failed, error %d\n", vdso_file->read_prog, err);
+		vdso_file->error = true;
+		return NULL;
+	}
+
+	vdso_file->found = true;
+
+	return vdso_file->temp_file_name;
+}
+
+static struct dso *vdso__findnew_compat(struct machine *machine,
+					struct vdso_file *vdso_file)
+{
+	const char *file_name;
+	struct dso *dso;
+
+	dso = dsos__find(&machine->user_dsos, vdso_file->dso_name, true);
+	if (dso)
+		return dso;
+
+	file_name = vdso__get_compat_file(vdso_file);
+	if (!file_name)
+		return NULL;
+
+	return vdso__new(machine, vdso_file->dso_name, file_name);
+}
+
+static int vdso__dso_findnew_compat(struct machine *machine,
+				    struct thread *thread,
+				    struct vdso_info *vdso_info,
+				    struct dso **dso)
+{
+	enum dso_type dso_type;
+
+	dso_type = machine__thread_dso_type(machine, thread);
+	switch (dso_type) {
+	case DSO__TYPE_32BIT:
+		*dso = vdso__findnew_compat(machine, &vdso_info->vdso32);
+		return 1;
+	case DSO__TYPE_X32BIT:
+		*dso = vdso__findnew_compat(machine, &vdso_info->vdsox32);
+		return 1;
+	case DSO__TYPE_UNKNOWN:
+	case DSO__TYPE_64BIT:
+	default:
+		return 0;
+	}
+}
+
+#endif
+
 struct dso *vdso__dso_findnew(struct machine *machine,
 			      struct thread *thread __maybe_unused)
 {
@@ -148,6 +309,11 @@ struct dso *vdso__dso_findnew(struct machine *machine,
 	if (!vdso_info)
 		return NULL;
 
+#if BITS_PER_LONG == 64
+	if (vdso__dso_findnew_compat(machine, thread, vdso_info, &dso))
+		return dso;
+#endif
+
 	dso = dsos__find(&machine->user_dsos, DSO__NAME_VDSO, true);
 	if (!dso) {
 		char *file;
@@ -164,5 +330,7 @@ struct dso *vdso__dso_findnew(struct machine *machine,
 
 bool dso__is_vdso(struct dso *dso)
 {
-	return !strcmp(dso->short_name, DSO__NAME_VDSO);
+	return !strcmp(dso->short_name, DSO__NAME_VDSO) ||
+	       !strcmp(dso->short_name, DSO__NAME_VDSO32) ||
+	       !strcmp(dso->short_name, DSO__NAME_VDSOX32);
 }
diff --git a/tools/perf/util/vdso.h b/tools/perf/util/vdso.h
index af9d6929a215..d97da1616f0c 100644
--- a/tools/perf/util/vdso.h
+++ b/tools/perf/util/vdso.h
@@ -7,7 +7,9 @@
 
 #define VDSO__MAP_NAME "[vdso]"
 
-#define DSO__NAME_VDSO "[vdso]"
+#define DSO__NAME_VDSO    "[vdso]"
+#define DSO__NAME_VDSO32  "[vdso32]"
+#define DSO__NAME_VDSOX32 "[vdsox32]"
 
 static inline bool is_vdso_map(const char *filename)
 {
-- 
1.9.3


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

* [PATCH 12/13] perf tools: Let default config be defined for a PMU
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 11/13] perf tools: Add support for " Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-08 21:18 ` [PATCH 13/13] perf tools: Add perf_pmu__scan_file() Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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] 25+ messages in thread

* [PATCH 13/13] perf tools: Add perf_pmu__scan_file()
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 12/13] perf tools: Let default config be defined for a PMU Arnaldo Carvalho de Melo
@ 2014-09-08 21:18 ` Arnaldo Carvalho de Melo
  2014-09-09  4:59 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
  2014-09-09  8:48 ` Adrian Hunter
  14 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-08 21:18 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] 25+ messages in thread

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2014-09-08 21:18 ` [PATCH 13/13] perf tools: Add perf_pmu__scan_file() Arnaldo Carvalho de Melo
@ 2014-09-09  4:59 ` Ingo Molnar
  2014-09-09  7:14   ` Adrian Hunter
  2014-09-09  8:48 ` Adrian Hunter
  14 siblings, 1 reply; 25+ messages in thread
From: Ingo Molnar @ 2014-09-09  4:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexander Yarygin, Anton Blanchard, Christian Borntraeger,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Kyle McMartin, Michael Ellerman, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
> 
>   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
> 
>   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> o Add +field argument support for --sort option (Jiri Olsa)
> 
> 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
>   - Build programs to copy 32-bit compatibility VDSOs
>   - Add support for 32-bit compatibility VDSOs
>   - Let default config be defined for a PMU
>   - Add perf_pmu__scan_file()
> 
> o Add feature checks to .gitignore (Alexander Shishkin)
> 
> 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)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (6):
>       perf tools: Let a user specify a PMU event without any config terms
>       perf tools: Add perf-with-kcore script
>       perf tools: Build programs to copy 32-bit compatibility VDSOs
>       perf tools: Add support for 32-bit compatibility VDSOs
>       perf tools: Let default config be defined for a PMU
>       perf tools: Add perf_pmu__scan_file()
> 
> Alexander Shishkin (1):
>       perf tools: Add feature checks to .gitignore
> 
> 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 (1):
>       perf tools powerpc: Fix build issue when DWARF support is disabled
> 
> Jiri Olsa (2):
>       perf tools: Add +field argument support for --sort option
>       perf tools: Allow to specify lib compile variable for spec usage
> 
>  tools/perf/.gitignore            |   2 +
>  tools/perf/Makefile.perf         |  42 ++++++-
>  tools/perf/arch/powerpc/Makefile |   2 +-
>  tools/perf/builtin-kvm.c         |  23 ++--
>  tools/perf/config/Makefile       |  33 ++++-
>  tools/perf/config/Makefile.arch  |   8 ++
>  tools/perf/perf-read-vdso.c      |  59 +++++++++
>  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/sort.c           |  37 +++++-
>  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
>  tools/perf/util/vdso.h           |   4 +-
>  17 files changed, 712 insertions(+), 44 deletions(-)
>  create mode 100644 tools/perf/perf-read-vdso.c
>  create mode 100644 tools/perf/perf-with-kcore.sh

Hm, so I'm getting this error, when trying to profile a 32-bit 
ELF binary on a 64-bit kernel, on a testbox:

 $ perf record ~/hackbench  10
 Time: 0.115
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.373 MB perf.data (~16279 samples) ]
 sh: perf-read-vdso32: command not found

comet:~/tip> file ~/hackbench 
/home/mingo/hackbench: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped

64-bit executables work fine:

 $ perf record perf bench sched pipe
 # Running 'sched/pipe' benchmark:
 # Executed 1000000 pipe operations between two processes

      Total time: 13.374 [sec]

       13.374352 usecs/op
           74769 ops/sec
 [ perf record: Woken up 14 times to write data ]
 [ perf record: Captured and wrote 3.602 MB perf.data (~157354 samples) ]

The kernel is an older one:

 $ uname -a
 Linux comet 3.14.17-100.fc19.x86_64 #1 SMP Thu Aug 14 17:17:26 
 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Thanks,

	Ingo

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09  4:59 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
@ 2014-09-09  7:14   ` Adrian Hunter
  2014-09-09  7:45     ` Stephane Eranian
  2014-09-09 14:53     ` Ingo Molnar
  0 siblings, 2 replies; 25+ messages in thread
From: Adrian Hunter @ 2014-09-09  7:14 UTC (permalink / raw)
  To: Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: linux-kernel, Alexander Shishkin, Alexander Yarygin,
	Anton Blanchard, Christian Borntraeger, Corey Ashford,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Kyle McMartin, Michael Ellerman, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu,
	Arnaldo Carvalho de Melo

On 09/09/2014 07:59 AM, Ingo Molnar wrote:
> 
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
>> Hi Ingo,
>>
>> 	Please consider pulling,
>>
>> - Arnaldo
>>
>> The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
>>
>>   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
>>
>>   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
>>
>> ----------------------------------------------------------------
>> perf/core improvements and fixes:
>>
>> User visible:
>>
>> o Add +field argument support for --sort option (Jiri Olsa)
>>
>> 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
>>   - Build programs to copy 32-bit compatibility VDSOs
>>   - Add support for 32-bit compatibility VDSOs
>>   - Let default config be defined for a PMU
>>   - Add perf_pmu__scan_file()
>>
>> o Add feature checks to .gitignore (Alexander Shishkin)
>>
>> 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)
>>
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>>
>> ----------------------------------------------------------------
>> Adrian Hunter (6):
>>       perf tools: Let a user specify a PMU event without any config terms
>>       perf tools: Add perf-with-kcore script
>>       perf tools: Build programs to copy 32-bit compatibility VDSOs
>>       perf tools: Add support for 32-bit compatibility VDSOs
>>       perf tools: Let default config be defined for a PMU
>>       perf tools: Add perf_pmu__scan_file()
>>
>> Alexander Shishkin (1):
>>       perf tools: Add feature checks to .gitignore
>>
>> 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 (1):
>>       perf tools powerpc: Fix build issue when DWARF support is disabled
>>
>> Jiri Olsa (2):
>>       perf tools: Add +field argument support for --sort option
>>       perf tools: Allow to specify lib compile variable for spec usage
>>
>>  tools/perf/.gitignore            |   2 +
>>  tools/perf/Makefile.perf         |  42 ++++++-
>>  tools/perf/arch/powerpc/Makefile |   2 +-
>>  tools/perf/builtin-kvm.c         |  23 ++--
>>  tools/perf/config/Makefile       |  33 ++++-
>>  tools/perf/config/Makefile.arch  |   8 ++
>>  tools/perf/perf-read-vdso.c      |  59 +++++++++
>>  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/sort.c           |  37 +++++-
>>  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
>>  tools/perf/util/vdso.h           |   4 +-
>>  17 files changed, 712 insertions(+), 44 deletions(-)
>>  create mode 100644 tools/perf/perf-read-vdso.c
>>  create mode 100644 tools/perf/perf-with-kcore.sh
> 
> Hm, so I'm getting this error, when trying to profile a 32-bit 
> ELF binary on a 64-bit kernel, on a testbox:
> 
>  $ perf record ~/hackbench  10
>  Time: 0.115
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.373 MB perf.data (~16279 samples) ]
>  sh: perf-read-vdso32: command not found

Presumably perf-read-vdso32 is not in the PATH.  Did you 'make install'?

> 
> comet:~/tip> file ~/hackbench 
> /home/mingo/hackbench: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
> 
> 64-bit executables work fine:
> 
>  $ perf record perf bench sched pipe
>  # Running 'sched/pipe' benchmark:
>  # Executed 1000000 pipe operations between two processes
> 
>       Total time: 13.374 [sec]
> 
>        13.374352 usecs/op
>            74769 ops/sec
>  [ perf record: Woken up 14 times to write data ]
>  [ perf record: Captured and wrote 3.602 MB perf.data (~157354 samples) ]
> 
> The kernel is an older one:
> 
>  $ uname -a
>  Linux comet 3.14.17-100.fc19.x86_64 #1 SMP Thu Aug 14 17:17:26 
>  UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> 
> Thanks,
> 
> 	Ingo
> 
> 


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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09  7:14   ` Adrian Hunter
@ 2014-09-09  7:45     ` Stephane Eranian
  2014-09-09  7:55       ` Adrian Hunter
  2014-09-09 14:53     ` Ingo Molnar
  1 sibling, 1 reply; 25+ messages in thread
From: Stephane Eranian @ 2014-09-09  7:45 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Alexander Shishkin,
	Alexander Yarygin, Anton Blanchard, Christian Borntraeger,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Kyle McMartin, Michael Ellerman, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Sukadev Bhattiprolu,
	Arnaldo Carvalho de Melo

On Tue, Sep 9, 2014 at 9:14 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
> On 09/09/2014 07:59 AM, Ingo Molnar wrote:
>>
>> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>>
>>> Hi Ingo,
>>>
>>>      Please consider pulling,
>>>
>>> - Arnaldo
>>>
>>> The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
>>>
>>>   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
>>>
>>>   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
>>>
>>> ----------------------------------------------------------------
>>> perf/core improvements and fixes:
>>>
>>> User visible:
>>>
>>> o Add +field argument support for --sort option (Jiri Olsa)
>>>
>>> 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
>>>   - Build programs to copy 32-bit compatibility VDSOs
>>>   - Add support for 32-bit compatibility VDSOs
>>>   - Let default config be defined for a PMU
>>>   - Add perf_pmu__scan_file()
>>>
>>> o Add feature checks to .gitignore (Alexander Shishkin)
>>>
>>> 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)
>>>
>>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>>>
>>> ----------------------------------------------------------------
>>> Adrian Hunter (6):
>>>       perf tools: Let a user specify a PMU event without any config terms
>>>       perf tools: Add perf-with-kcore script
>>>       perf tools: Build programs to copy 32-bit compatibility VDSOs
>>>       perf tools: Add support for 32-bit compatibility VDSOs
>>>       perf tools: Let default config be defined for a PMU
>>>       perf tools: Add perf_pmu__scan_file()
>>>
>>> Alexander Shishkin (1):
>>>       perf tools: Add feature checks to .gitignore
>>>
>>> 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 (1):
>>>       perf tools powerpc: Fix build issue when DWARF support is disabled
>>>
>>> Jiri Olsa (2):
>>>       perf tools: Add +field argument support for --sort option
>>>       perf tools: Allow to specify lib compile variable for spec usage
>>>
>>>  tools/perf/.gitignore            |   2 +
>>>  tools/perf/Makefile.perf         |  42 ++++++-
>>>  tools/perf/arch/powerpc/Makefile |   2 +-
>>>  tools/perf/builtin-kvm.c         |  23 ++--
>>>  tools/perf/config/Makefile       |  33 ++++-
>>>  tools/perf/config/Makefile.arch  |   8 ++
>>>  tools/perf/perf-read-vdso.c      |  59 +++++++++
>>>  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/sort.c           |  37 +++++-
>>>  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
>>>  tools/perf/util/vdso.h           |   4 +-
>>>  17 files changed, 712 insertions(+), 44 deletions(-)
>>>  create mode 100644 tools/perf/perf-read-vdso.c
>>>  create mode 100644 tools/perf/perf-with-kcore.sh
>>
>> Hm, so I'm getting this error, when trying to profile a 32-bit
>> ELF binary on a 64-bit kernel, on a testbox:
>>
>>  $ perf record ~/hackbench  10
>>  Time: 0.115
>>  [ perf record: Woken up 1 times to write data ]
>>  [ perf record: Captured and wrote 0.373 MB perf.data (~16279 samples) ]
>>  sh: perf-read-vdso32: command not found
>
> Presumably perf-read-vdso32 is not in the PATH.  Did you 'make install'?
>
Why are we relying on an external command now in perf record?

>>
>> comet:~/tip> file ~/hackbench
>> /home/mingo/hackbench: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
>>
>> 64-bit executables work fine:
>>
>>  $ perf record perf bench sched pipe
>>  # Running 'sched/pipe' benchmark:
>>  # Executed 1000000 pipe operations between two processes
>>
>>       Total time: 13.374 [sec]
>>
>>        13.374352 usecs/op
>>            74769 ops/sec
>>  [ perf record: Woken up 14 times to write data ]
>>  [ perf record: Captured and wrote 3.602 MB perf.data (~157354 samples) ]
>>
>> The kernel is an older one:
>>
>>  $ uname -a
>>  Linux comet 3.14.17-100.fc19.x86_64 #1 SMP Thu Aug 14 17:17:26
>>  UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
>>
>> Thanks,
>>
>>       Ingo
>>
>>
>

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09  7:45     ` Stephane Eranian
@ 2014-09-09  7:55       ` Adrian Hunter
  0 siblings, 0 replies; 25+ messages in thread
From: Adrian Hunter @ 2014-09-09  7:55 UTC (permalink / raw)
  To: Stephane Eranian
  Cc: Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Alexander Shishkin,
	Alexander Yarygin, Anton Blanchard, Christian Borntraeger,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Kyle McMartin, Michael Ellerman, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Sukadev Bhattiprolu,
	Arnaldo Carvalho de Melo

On 09/09/2014 10:45 AM, Stephane Eranian wrote:
> On Tue, Sep 9, 2014 at 9:14 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> On 09/09/2014 07:59 AM, Ingo Molnar wrote:
>>>
>>> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>>>
>>>> Hi Ingo,
>>>>
>>>>      Please consider pulling,
>>>>
>>>> - Arnaldo
>>>>
>>>> The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
>>>>
>>>>   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
>>>>
>>>>   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
>>>>
>>>> ----------------------------------------------------------------
>>>> perf/core improvements and fixes:
>>>>
>>>> User visible:
>>>>
>>>> o Add +field argument support for --sort option (Jiri Olsa)
>>>>
>>>> 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
>>>>   - Build programs to copy 32-bit compatibility VDSOs
>>>>   - Add support for 32-bit compatibility VDSOs
>>>>   - Let default config be defined for a PMU
>>>>   - Add perf_pmu__scan_file()
>>>>
>>>> o Add feature checks to .gitignore (Alexander Shishkin)
>>>>
>>>> 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)
>>>>
>>>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>>>>
>>>> ----------------------------------------------------------------
>>>> Adrian Hunter (6):
>>>>       perf tools: Let a user specify a PMU event without any config terms
>>>>       perf tools: Add perf-with-kcore script
>>>>       perf tools: Build programs to copy 32-bit compatibility VDSOs
>>>>       perf tools: Add support for 32-bit compatibility VDSOs
>>>>       perf tools: Let default config be defined for a PMU
>>>>       perf tools: Add perf_pmu__scan_file()
>>>>
>>>> Alexander Shishkin (1):
>>>>       perf tools: Add feature checks to .gitignore
>>>>
>>>> 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 (1):
>>>>       perf tools powerpc: Fix build issue when DWARF support is disabled
>>>>
>>>> Jiri Olsa (2):
>>>>       perf tools: Add +field argument support for --sort option
>>>>       perf tools: Allow to specify lib compile variable for spec usage
>>>>
>>>>  tools/perf/.gitignore            |   2 +
>>>>  tools/perf/Makefile.perf         |  42 ++++++-
>>>>  tools/perf/arch/powerpc/Makefile |   2 +-
>>>>  tools/perf/builtin-kvm.c         |  23 ++--
>>>>  tools/perf/config/Makefile       |  33 ++++-
>>>>  tools/perf/config/Makefile.arch  |   8 ++
>>>>  tools/perf/perf-read-vdso.c      |  59 +++++++++
>>>>  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/sort.c           |  37 +++++-
>>>>  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
>>>>  tools/perf/util/vdso.h           |   4 +-
>>>>  17 files changed, 712 insertions(+), 44 deletions(-)
>>>>  create mode 100644 tools/perf/perf-read-vdso.c
>>>>  create mode 100644 tools/perf/perf-with-kcore.sh
>>>
>>> Hm, so I'm getting this error, when trying to profile a 32-bit
>>> ELF binary on a 64-bit kernel, on a testbox:
>>>
>>>  $ perf record ~/hackbench  10
>>>  Time: 0.115
>>>  [ perf record: Woken up 1 times to write data ]
>>>  [ perf record: Captured and wrote 0.373 MB perf.data (~16279 samples) ]
>>>  sh: perf-read-vdso32: command not found
>>
>> Presumably perf-read-vdso32 is not in the PATH.  Did you 'make install'?
>>
> Why are we relying on an external command now in perf record?

We are not relying on it in the sense the 'record' works without it.
There is more explanation in "perf tools: Build programs to copy 32-bit
compatibility VDSOs" and "perf tools: Add support for 32-bit compatibility
VDSOs" (although those are the wrong versions of those patches - I will send
another email about that in a moment).

> 
>>>
>>> comet:~/tip> file ~/hackbench
>>> /home/mingo/hackbench: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
>>>
>>> 64-bit executables work fine:
>>>
>>>  $ perf record perf bench sched pipe
>>>  # Running 'sched/pipe' benchmark:
>>>  # Executed 1000000 pipe operations between two processes
>>>
>>>       Total time: 13.374 [sec]
>>>
>>>        13.374352 usecs/op
>>>            74769 ops/sec
>>>  [ perf record: Woken up 14 times to write data ]
>>>  [ perf record: Captured and wrote 3.602 MB perf.data (~157354 samples) ]
>>>
>>> The kernel is an older one:
>>>
>>>  $ uname -a
>>>  Linux comet 3.14.17-100.fc19.x86_64 #1 SMP Thu Aug 14 17:17:26
>>>  UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
>>>
>>> Thanks,
>>>
>>>       Ingo
>>>
>>>
>>
> 
> 


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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2014-09-09  4:59 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
@ 2014-09-09  8:48 ` Adrian Hunter
  2014-09-09 13:12   ` Arnaldo Carvalho de Melo
  2014-09-09 19:08   ` Arnaldo Carvalho de Melo
  14 siblings, 2 replies; 25+ messages in thread
From: Adrian Hunter @ 2014-09-09  8:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Alexander Yarygin,
	Anton Blanchard, Christian Borntraeger, Corey Ashford,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Kyle McMartin, Michael Ellerman, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu

On 09/09/2014 12:17 AM, Arnaldo Carvalho de Melo wrote:
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo

I am very sorry Arnaldo but 2 patches are older versions, namely:

	perf tools: Build programs to copy 32-bit compatibility VDSOs
	perf tools: Add support for 32-bit compatibility VDSOs

Up-to-date versions can be found from 15 August:

	patchwork:

		https://patchwork.kernel.org/patch/4729131/
		https://patchwork.kernel.org/patch/4729111/

	marc.info:

		http://marc.info/?l=linux-kernel&m=140812995414607&w=4
		http://marc.info/?l=linux-kernel&m=140812993814585&w=4

It looks like I reposted older versions by mistake on 31 July.
Very sorry :-(

The originals were changed as described here:

	http://marc.info/?l=linux-kernel&m=140621020918615
	http://marc.info/?l=linux-kernel&m=140618721010170

> 
> The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
> 
>   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
> 
>   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> o Add +field argument support for --sort option (Jiri Olsa)
> 
> 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
>   - Build programs to copy 32-bit compatibility VDSOs
>   - Add support for 32-bit compatibility VDSOs
>   - Let default config be defined for a PMU
>   - Add perf_pmu__scan_file()
> 
> o Add feature checks to .gitignore (Alexander Shishkin)
> 
> 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)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (6):
>       perf tools: Let a user specify a PMU event without any config terms
>       perf tools: Add perf-with-kcore script
>       perf tools: Build programs to copy 32-bit compatibility VDSOs
>       perf tools: Add support for 32-bit compatibility VDSOs
>       perf tools: Let default config be defined for a PMU
>       perf tools: Add perf_pmu__scan_file()
> 
> Alexander Shishkin (1):
>       perf tools: Add feature checks to .gitignore
> 
> 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 (1):
>       perf tools powerpc: Fix build issue when DWARF support is disabled
> 
> Jiri Olsa (2):
>       perf tools: Add +field argument support for --sort option
>       perf tools: Allow to specify lib compile variable for spec usage
> 
>  tools/perf/.gitignore            |   2 +
>  tools/perf/Makefile.perf         |  42 ++++++-
>  tools/perf/arch/powerpc/Makefile |   2 +-
>  tools/perf/builtin-kvm.c         |  23 ++--
>  tools/perf/config/Makefile       |  33 ++++-
>  tools/perf/config/Makefile.arch  |   8 ++
>  tools/perf/perf-read-vdso.c      |  59 +++++++++
>  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/sort.c           |  37 +++++-
>  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
>  tools/perf/util/vdso.h           |   4 +-
>  17 files changed, 712 insertions(+), 44 deletions(-)
>  create mode 100644 tools/perf/perf-read-vdso.c
>  create mode 100644 tools/perf/perf-with-kcore.sh
> 
> 


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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09  8:48 ` Adrian Hunter
@ 2014-09-09 13:12   ` Arnaldo Carvalho de Melo
  2014-09-09 14:54     ` Ingo Molnar
  2014-09-09 19:08   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-09 13:12 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Alexander Yarygin,
	Anton Blanchard, Christian Borntraeger, Corey Ashford,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Kyle McMartin, Michael Ellerman, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu

Em Tue, Sep 09, 2014 at 11:48:20AM +0300, Adrian Hunter escreveu:
> It looks like I reposted older versions by mistake on 31 July.
> Very sorry :-(
> 
> The originals were changed as described here:
> 
> 	http://marc.info/?l=linux-kernel&m=140621020918615
> 	http://marc.info/?l=linux-kernel&m=140618721010170

No problem, the good thing is that we're almost getting it all in. I'll
rework the branch and resubmit, Ingo, is that OK with you? Or have you
already pulled and we should instead send a patch on top, fixing the
problem?

- Arnaldo

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09  7:14   ` Adrian Hunter
  2014-09-09  7:45     ` Stephane Eranian
@ 2014-09-09 14:53     ` Ingo Molnar
  1 sibling, 0 replies; 25+ messages in thread
From: Ingo Molnar @ 2014-09-09 14:53 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Alexander Shishkin,
	Alexander Yarygin, Anton Blanchard, Christian Borntraeger,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Kyle McMartin, Michael Ellerman, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu, Arnaldo Carvalho de Melo


* Adrian Hunter <adrian.hunter@intel.com> wrote:

> On 09/09/2014 07:59 AM, Ingo Molnar wrote:
> > 
> > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > 
> >> Hi Ingo,
> >>
> >> 	Please consider pulling,
> >>
> >> - Arnaldo
> >>
> >> The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
> >>
> >>   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
> >>
> >>   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
> >>
> >> ----------------------------------------------------------------
> >> perf/core improvements and fixes:
> >>
> >> User visible:
> >>
> >> o Add +field argument support for --sort option (Jiri Olsa)
> >>
> >> 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
> >>   - Build programs to copy 32-bit compatibility VDSOs
> >>   - Add support for 32-bit compatibility VDSOs
> >>   - Let default config be defined for a PMU
> >>   - Add perf_pmu__scan_file()
> >>
> >> o Add feature checks to .gitignore (Alexander Shishkin)
> >>
> >> 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)
> >>
> >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >>
> >> ----------------------------------------------------------------
> >> Adrian Hunter (6):
> >>       perf tools: Let a user specify a PMU event without any config terms
> >>       perf tools: Add perf-with-kcore script
> >>       perf tools: Build programs to copy 32-bit compatibility VDSOs
> >>       perf tools: Add support for 32-bit compatibility VDSOs
> >>       perf tools: Let default config be defined for a PMU
> >>       perf tools: Add perf_pmu__scan_file()
> >>
> >> Alexander Shishkin (1):
> >>       perf tools: Add feature checks to .gitignore
> >>
> >> 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 (1):
> >>       perf tools powerpc: Fix build issue when DWARF support is disabled
> >>
> >> Jiri Olsa (2):
> >>       perf tools: Add +field argument support for --sort option
> >>       perf tools: Allow to specify lib compile variable for spec usage
> >>
> >>  tools/perf/.gitignore            |   2 +
> >>  tools/perf/Makefile.perf         |  42 ++++++-
> >>  tools/perf/arch/powerpc/Makefile |   2 +-
> >>  tools/perf/builtin-kvm.c         |  23 ++--
> >>  tools/perf/config/Makefile       |  33 ++++-
> >>  tools/perf/config/Makefile.arch  |   8 ++
> >>  tools/perf/perf-read-vdso.c      |  59 +++++++++
> >>  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/sort.c           |  37 +++++-
> >>  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
> >>  tools/perf/util/vdso.h           |   4 +-
> >>  17 files changed, 712 insertions(+), 44 deletions(-)
> >>  create mode 100644 tools/perf/perf-read-vdso.c
> >>  create mode 100644 tools/perf/perf-with-kcore.sh
> > 
> > Hm, so I'm getting this error, when trying to profile a 32-bit 
> > ELF binary on a 64-bit kernel, on a testbox:
> > 
> >  $ perf record ~/hackbench  10
> >  Time: 0.115
> >  [ perf record: Woken up 1 times to write data ]
> >  [ perf record: Captured and wrote 0.373 MB perf.data (~16279 samples) ]
> >  sh: perf-read-vdso32: command not found
> 
> Presumably perf-read-vdso32 is not in the PATH.  Did you 'make install'?

I did 'make install' as usual - that's the only thing that I type 
to install a new version of perf tooling.

Thanks,

	Ingo

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09 13:12   ` Arnaldo Carvalho de Melo
@ 2014-09-09 14:54     ` Ingo Molnar
  2014-09-09 15:59       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 25+ messages in thread
From: Ingo Molnar @ 2014-09-09 14:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, linux-kernel, Alexander Shishkin,
	Alexander Yarygin, Anton Blanchard, Christian Borntraeger,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Kyle McMartin, Michael Ellerman, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu


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

> Em Tue, Sep 09, 2014 at 11:48:20AM +0300, Adrian Hunter escreveu:
> > It looks like I reposted older versions by mistake on 31 July.
> > Very sorry :-(
> > 
> > The originals were changed as described here:
> > 
> > 	http://marc.info/?l=linux-kernel&m=140621020918615
> > 	http://marc.info/?l=linux-kernel&m=140618721010170
> 
> No problem, the good thing is that we're almost getting it all 
> in. I'll rework the branch and resubmit, Ingo, is that OK with 
> you? [...]

Yeah, that's perfectly OK.

> [...] Or have you already pulled and we should instead send a 
> patch on top, fixing the problem?

I pulled it locally then unpulled as it didn't pass my (very 
simple) tests and it looked like there's something fishy going 
on.

Thanks,

	Ingo

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09 14:54     ` Ingo Molnar
@ 2014-09-09 15:59       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-09 15:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Adrian Hunter, linux-kernel, Alexander Shishkin,
	Alexander Yarygin, Anton Blanchard, Christian Borntraeger,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Kyle McMartin, Michael Ellerman, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu

Em Tue, Sep 09, 2014 at 04:54:49PM +0200, Ingo Molnar escreveu:
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
 
> > Em Tue, Sep 09, 2014 at 11:48:20AM +0300, Adrian Hunter escreveu:
> > > It looks like I reposted older versions by mistake on 31 July.
> > > Very sorry :-(

> > > The originals were changed as described here:

> > > 	http://marc.info/?l=linux-kernel&m=140621020918615
> > > 	http://marc.info/?l=linux-kernel&m=140618721010170

> > No problem, the good thing is that we're almost getting it all 
> > in. I'll rework the branch and resubmit, Ingo, is that OK with 
> > you? [...]

> Yeah, that's perfectly OK.

> > [...] Or have you already pulled and we should instead send a 
> > patch on top, fixing the problem?

> I pulled it locally then unpulled as it didn't pass my (very 
> simple) tests and it looked like there's something fishy going 
> on.

Yeah, I should've tested this more, will make sure I test these things
this time.

Having a requirement that for each new feature we need an entry in 'perf
test' and/or in make -C tools/perf build-test seems a bit harsh, but
would be ideal, hook that to 'git request-pull' and this would hopefully
only happen every celestial aligment nights or so :-\
 
- Arnaldo

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09  8:48 ` Adrian Hunter
  2014-09-09 13:12   ` Arnaldo Carvalho de Melo
@ 2014-09-09 19:08   ` Arnaldo Carvalho de Melo
  2014-09-10 13:19     ` Adrian Hunter
  1 sibling, 1 reply; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-09-09 19:08 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Alexander Yarygin,
	Anton Blanchard, Christian Borntraeger, Corey Ashford,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Kyle McMartin, Michael Ellerman, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu

Em Tue, Sep 09, 2014 at 11:48:20AM +0300, Adrian Hunter escreveu:
> On 09/09/2014 12:17 AM, Arnaldo Carvalho de Melo wrote:
> > Hi Ingo,
> > 
> > 	Please consider pulling,
> > 
> > - Arnaldo
> 
> I am very sorry Arnaldo but 2 patches are older versions, namely:
> 
> 	perf tools: Build programs to copy 32-bit compatibility VDSOs
> 	perf tools: Add support for 32-bit compatibility VDSOs
> 
> Up-to-date versions can be found from 15 August:
> 
> 	patchwork:
> 
> 		https://patchwork.kernel.org/patch/4729131/
> 		https://patchwork.kernel.org/patch/4729111/

Ok, those don't apply, as it expects other stuff, that you sent before,
but were not processed yet, to be in place, I'm fixing it up.

- Arnaldo
 
> 	marc.info:
> 
> 		http://marc.info/?l=linux-kernel&m=140812995414607&w=4
> 		http://marc.info/?l=linux-kernel&m=140812993814585&w=4
> 
> It looks like I reposted older versions by mistake on 31 July.
> Very sorry :-(
> 
> The originals were changed as described here:
> 
> 	http://marc.info/?l=linux-kernel&m=140621020918615
> 	http://marc.info/?l=linux-kernel&m=140618721010170
> 
> > 
> > The following changes since commit 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47:
> > 
> >   Merge branch 'rfc/perf' into perf/core, because it's ready for inclusion (2014-08-24 22:35:42 +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 fa3480cb0a96c8af9ded1a8c836c91bd5704bda1:
> > 
> >   perf tools: Add perf_pmu__scan_file() (2014-09-08 17:16:06 -0300)
> > 
> > ----------------------------------------------------------------
> > perf/core improvements and fixes:
> > 
> > User visible:
> > 
> > o Add +field argument support for --sort option (Jiri Olsa)
> > 
> > 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
> >   - Build programs to copy 32-bit compatibility VDSOs
> >   - Add support for 32-bit compatibility VDSOs
> >   - Let default config be defined for a PMU
> >   - Add perf_pmu__scan_file()
> > 
> > o Add feature checks to .gitignore (Alexander Shishkin)
> > 
> > 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)
> > 
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > 
> > ----------------------------------------------------------------
> > Adrian Hunter (6):
> >       perf tools: Let a user specify a PMU event without any config terms
> >       perf tools: Add perf-with-kcore script
> >       perf tools: Build programs to copy 32-bit compatibility VDSOs
> >       perf tools: Add support for 32-bit compatibility VDSOs
> >       perf tools: Let default config be defined for a PMU
> >       perf tools: Add perf_pmu__scan_file()
> > 
> > Alexander Shishkin (1):
> >       perf tools: Add feature checks to .gitignore
> > 
> > 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 (1):
> >       perf tools powerpc: Fix build issue when DWARF support is disabled
> > 
> > Jiri Olsa (2):
> >       perf tools: Add +field argument support for --sort option
> >       perf tools: Allow to specify lib compile variable for spec usage
> > 
> >  tools/perf/.gitignore            |   2 +
> >  tools/perf/Makefile.perf         |  42 ++++++-
> >  tools/perf/arch/powerpc/Makefile |   2 +-
> >  tools/perf/builtin-kvm.c         |  23 ++--
> >  tools/perf/config/Makefile       |  33 ++++-
> >  tools/perf/config/Makefile.arch  |   8 ++
> >  tools/perf/perf-read-vdso.c      |  59 +++++++++
> >  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/sort.c           |  37 +++++-
> >  tools/perf/util/vdso.c           | 170 ++++++++++++++++++++++++-
> >  tools/perf/util/vdso.h           |   4 +-
> >  17 files changed, 712 insertions(+), 44 deletions(-)
> >  create mode 100644 tools/perf/perf-read-vdso.c
> >  create mode 100644 tools/perf/perf-with-kcore.sh
> > 
> > 

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

* Re: [GIT PULL 00/13] perf/core improvements and fixes
  2014-09-09 19:08   ` Arnaldo Carvalho de Melo
@ 2014-09-10 13:19     ` Adrian Hunter
  0 siblings, 0 replies; 25+ messages in thread
From: Adrian Hunter @ 2014-09-10 13:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Alexander Yarygin,
	Anton Blanchard, Christian Borntraeger, Corey Ashford,
	David Ahern, Frederic Weisbecker, Jean Pihet, Jiri Olsa,
	Kyle McMartin, Michael Ellerman, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Sukadev Bhattiprolu

On 09/09/2014 10:08 PM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Sep 09, 2014 at 11:48:20AM +0300, Adrian Hunter escreveu:
>> On 09/09/2014 12:17 AM, Arnaldo Carvalho de Melo wrote:
>>> Hi Ingo,
>>>
>>> 	Please consider pulling,
>>>
>>> - Arnaldo
>>
>> I am very sorry Arnaldo but 2 patches are older versions, namely:
>>
>> 	perf tools: Build programs to copy 32-bit compatibility VDSOs
>> 	perf tools: Add support for 32-bit compatibility VDSOs
>>
>> Up-to-date versions can be found from 15 August:
>>
>> 	patchwork:
>>
>> 		https://patchwork.kernel.org/patch/4729131/
>> 		https://patchwork.kernel.org/patch/4729111/
> 
> Ok, those don't apply, as it expects other stuff, that you sent before,
> but were not processed yet, to be in place, I'm fixing it up.
> 

Something like this might prevent Ingo's error message:


From: Adrian Hunter <adrian.hunter@intel.com>
Date: Wed, 10 Sep 2014 16:14:50 +0300
Subject: [PATCH] perf tools: Do not attempt to run perf-read-vdso32 if it
 wasn't built

popen() causes an error message to print if perf-read-vdso32
does not run.  Avoid that by not trying to run it if it was
not built.  Ditto perf-read-vdsox32.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/config/Makefile |  8 ++++++--
 tools/perf/util/vdso.c     | 10 ++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 3ba2382..71264e4 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -627,7 +627,9 @@ endif
 ifeq (${IS_64_BIT}, 1)
   ifndef NO_PERF_READ_VDSO32
     $(call feature_check,compile-32)
-    ifneq ($(feature-compile-32), 1)
+    ifeq ($(feature-compile-32), 1)
+      CFLAGS += -DHAVE_PERF_READ_VDSO32
+    else
       NO_PERF_READ_VDSO32 := 1
     endif
   endif
@@ -636,7 +638,9 @@ ifeq (${IS_64_BIT}, 1)
   endif
   ifndef NO_PERF_READ_VDSOX32
     $(call feature_check,compile-x32)
-    ifneq ($(feature-compile-x32), 1)
+    ifeq ($(feature-compile-x32), 1)
+      CFLAGS += -DHAVE_PERF_READ_VDSOX32
+    else
       NO_PERF_READ_VDSOX32 := 1
     endif
   endif
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index 69daef6..5c7dd79 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -255,6 +255,16 @@ static int vdso__dso_findnew_compat(struct machine
*machine,
 	enum dso_type dso_type;

 	dso_type = machine__thread_dso_type(machine, thread);
+
+#ifndef HAVE_PERF_READ_VDSO32
+	if (dso_type == DSO__TYPE_32BIT)
+		return 0;
+#endif
+#ifndef HAVE_PERF_READ_VDSOX32
+	if (dso_type == DSO__TYPE_X32BIT)
+		return 0;
+#endif
+
 	switch (dso_type) {
 	case DSO__TYPE_32BIT:
 		*dso = vdso__findnew_compat(machine, &vdso_info->vdso32);
-- 
1.8.3.2




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

end of thread, other threads:[~2014-09-10 13:21 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 21:17 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-09-08 21:17 ` [PATCH 01/13] perf tools: Add +field argument support for --sort option Arnaldo Carvalho de Melo
2014-09-08 21:17 ` [PATCH 02/13] perf tools powerpc: Fix build issue when DWARF support is disabled Arnaldo Carvalho de Melo
2014-09-08 21:17 ` [PATCH 03/13] perf kvm stat report: Save pid string in opts.target.pid Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 04/13] perf kvm stat report: Enable the target.system_wide flag Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 05/13] perf kvm stat report: Unify the title bar output Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 06/13] perf tools: Allow to specify lib compile variable for spec usage Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 07/13] perf tools: Add feature checks to .gitignore Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 08/13] perf tools: Let a user specify a PMU event without any config terms Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 09/13] perf tools: Add perf-with-kcore script Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 10/13] perf tools: Build programs to copy 32-bit compatibility VDSOs Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 11/13] perf tools: Add support for " Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 12/13] perf tools: Let default config be defined for a PMU Arnaldo Carvalho de Melo
2014-09-08 21:18 ` [PATCH 13/13] perf tools: Add perf_pmu__scan_file() Arnaldo Carvalho de Melo
2014-09-09  4:59 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
2014-09-09  7:14   ` Adrian Hunter
2014-09-09  7:45     ` Stephane Eranian
2014-09-09  7:55       ` Adrian Hunter
2014-09-09 14:53     ` Ingo Molnar
2014-09-09  8:48 ` Adrian Hunter
2014-09-09 13:12   ` Arnaldo Carvalho de Melo
2014-09-09 14:54     ` Ingo Molnar
2014-09-09 15:59       ` Arnaldo Carvalho de Melo
2014-09-09 19:08   ` Arnaldo Carvalho de Melo
2014-09-10 13:19     ` Adrian Hunter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.