linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-02-22 18:02 Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 01/15] perf tools: Fix build on older systems Arnaldo Carvalho de Melo
                   ` (15 more replies)
  0 siblings, 16 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, Andi Kleen, Brendan Gregg, Cody P Schafer,
	David Ahern, He Kuang, Jeremie Galarneau, Jiri Olsa,
	Kirill Smelkov, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, pi3orama, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 91e48b7df15196b8ce01f40455219d3ed7889988:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-20 11:52:16 +0100)

are available in the git repository at:

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

for you to fetch changes up to 03e0a7df3efd959e40cd7ff40b1fabddc234ec5a:

  perf tools: Introduce bpf-output event (2016-02-22 14:37:21 -0300)

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

New features:

- Add API to set values of map entries in a BPF object, be it
  individual map slots or ranges (Wang Nan)

- Introduce support for the 'bpf-output' event (Wang Nan)

- Add glue to read perf events in a BPF program (Wang Nan)

Fixes:

- Sort key fixes: Alignment for srcline, file, trace; fix
  segfault for dynamic, trace events related sort keys (Namyung Kim)

Build fixes:

- Remove duplicate typedef config_term_func_t definition,
  fixing the build on older systems (Arnaldo Carvalho de Melo)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf tools: Fix build on older systems
      perf tools: Remove duplicate typedef config_term_func_t definition

Namhyung Kim (5):
      perf tools: Fix segfault on dynamic entries
      perf tools: Update srcline/file if needed
      perf tools: Fix alignment on some sort keys
      perf tools: Fix column width setting on 'trace' sort key
      perf tools: Fix assertion failure on dynamic entry

Wang Nan (8):
      perf bpf: Add API to set values to map entries in a bpf object
      perf tools: Enable BPF object configure syntax
      perf record: Apply config to BPF objects before recording
      perf tools: Enable passing event to BPF object
      perf tools: Support setting different slots in a BPF map separately
      perf tools: Enable indices setting syntax for BPF map
      perf tools: Apply tracepoint event definition options to BPF script
      perf tools: Introduce bpf-output event

 tools/perf/builtin-record.c    |  11 +
 tools/perf/tests/bpf.c         |   2 +-
 tools/perf/ui/hist.c           |   3 +
 tools/perf/util/bpf-loader.c   | 718 +++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/bpf-loader.h   |  59 ++++
 tools/perf/util/evlist.c       |  16 +
 tools/perf/util/evlist.h       |   3 +
 tools/perf/util/evsel.c        |   5 +
 tools/perf/util/evsel.h        |   8 +
 tools/perf/util/hist.c         |   3 +
 tools/perf/util/parse-events.c | 130 +++++++-
 tools/perf/util/parse-events.h |  17 +-
 tools/perf/util/parse-events.l |  16 +-
 tools/perf/util/parse-events.y |  95 +++++-
 tools/perf/util/sort.c         |  90 +++---
 15 files changed, 1112 insertions(+), 64 deletions(-)

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

* [PATCH 01/15] perf tools: Fix build on older systems
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 02/15] perf tools: Remove duplicate typedef config_term_func_t definition Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Jiri Olsa,
	Namhyung Kim, Wang Nan

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

In RHEL 6.7:

  CC       /tmp/build/perf/util/parse-events.o
  cc1: warnings being treated as errors
  util/parse-events.c: In function ‘parse_events_add_cache’:
  util/parse-events.c:366: error: declaration of ‘error’ shadows a global declaration
  util/util.h:136: error: shadowed declaration is here

Rename it to 'err'.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 43d0b97817a4 ("perf tools: Enable config and setting names for legacy cache events")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2996aa4207bd..2b8770821365 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -363,7 +363,7 @@ static int config_attr(struct perf_event_attr *attr,
 
 int parse_events_add_cache(struct list_head *list, int *idx,
 			   char *type, char *op_result1, char *op_result2,
-			   struct parse_events_error *error,
+			   struct parse_events_error *err,
 			   struct list_head *head_config)
 {
 	struct perf_event_attr attr;
@@ -425,7 +425,7 @@ int parse_events_add_cache(struct list_head *list, int *idx,
 	attr.type = PERF_TYPE_HW_CACHE;
 
 	if (head_config) {
-		if (config_attr(&attr, head_config, error,
+		if (config_attr(&attr, head_config, err,
 				config_term_common))
 			return -EINVAL;
 
-- 
2.5.0

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

* [PATCH 02/15] perf tools: Remove duplicate typedef config_term_func_t definition
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 01/15] perf tools: Fix build on older systems Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 03/15] perf tools: Fix segfault on dynamic entries Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Jiri Olsa,
	Namhyung Kim, Wang Nan

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

Older compilers don't like this, for instance, on RHEL6.7:

    CC       /tmp/build/perf/util/parse-events.o
  util/parse-events.c:844: error: redefinition of typedef ‘config_term_func_t’
  util/parse-events.c:353: note: previous declaration of ‘config_term_func_t’ was here

So remove the second definition, that should've been just moved in 43d0b97817a4
("perf tools: Enable config and setting names for legacy cache events"), not copied.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 43d0b97817a4 ("perf tools: Enable config and setting names for legacy cache events")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2b8770821365..b0b329539db5 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -841,10 +841,6 @@ void parse_events__shrink_config_terms(void)
 	config_term_shrinked = true;
 }
 
-typedef int config_term_func_t(struct perf_event_attr *attr,
-			       struct parse_events_term *term,
-			       struct parse_events_error *err);
-
 static int config_term_common(struct perf_event_attr *attr,
 			      struct parse_events_term *term,
 			      struct parse_events_error *err)
-- 
2.5.0

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

* [PATCH 03/15] perf tools: Fix segfault on dynamic entries
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 01/15] perf tools: Fix build on older systems Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 02/15] perf tools: Remove duplicate typedef config_term_func_t definition Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 04/15] perf tools: Update srcline/file if needed Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Andi Kleen, David Ahern,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

A dynamic entry is created for each tracepoint event.  When it sets up
the sort key, it checks with existing keys using ->equal() callback.
But it missed to set the ->equal for dynamic entries.  The following
segfault was due to the missing ->equal() callback.

  (gdb) bt
  #0  0x0000000000140003 in ?? ()
  #1  0x0000000000537769 in fmt_equal (b=0x2106980, a=0x21067a0) at ui/hist.c:548
  #2  perf_hpp__setup_output_field (list=0x8c6d80 <perf_hpp_list>) at ui/hist.c:560
  #3  0x00000000004e927e in setup_sorting (evlist=<optimized out>) at util/sort.c:2642
  #4  0x000000000043cf50 in cmd_report (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>)
      at builtin-report.c:932
  #5  0x00000000004865a1 in run_builtin (p=p@entry=0x8bbce0 <commands+192>, argc=argc@entry=7,
      argv=argv@entry=0x7ffd24d56ce0) at perf.c:390
  #6  0x000000000042dc1f in handle_internal_command (argv=0x7ffd24d56ce0, argc=7) at perf.c:451
  #7  run_argv (argv=0x7ffd24d56a70, argcp=0x7ffd24d56a7c) at perf.c:495
  #8  main (argc=7, argv=0x7ffd24d56ce0) at perf.c:620

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1456064558-13086-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index de715756f281..7daea71691df 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1835,6 +1835,20 @@ bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *fmt)
 	return fmt->cmp == __sort__hde_cmp;
 }
 
+static bool __sort__hde_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
+{
+	struct hpp_dynamic_entry *hde_a;
+	struct hpp_dynamic_entry *hde_b;
+
+	if (!perf_hpp__is_dynamic_entry(a) || !perf_hpp__is_dynamic_entry(b))
+		return false;
+
+	hde_a = container_of(a, struct hpp_dynamic_entry, hpp);
+	hde_b = container_of(b, struct hpp_dynamic_entry, hpp);
+
+	return hde_a->field == hde_b->field;
+}
+
 static void hde_free(struct perf_hpp_fmt *fmt)
 {
 	struct hpp_dynamic_entry *hde;
@@ -1867,6 +1881,7 @@ __alloc_dynamic_entry(struct perf_evsel *evsel, struct format_field *field)
 	hde->hpp.cmp = __sort__hde_cmp;
 	hde->hpp.collapse = __sort__hde_cmp;
 	hde->hpp.sort = __sort__hde_cmp;
+	hde->hpp.equal = __sort__hde_equal;
 	hde->hpp.free = hde_free;
 
 	INIT_LIST_HEAD(&hde->hpp.list);
-- 
2.5.0

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

* [PATCH 04/15] perf tools: Update srcline/file if needed
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 03/15] perf tools: Fix segfault on dynamic entries Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 05/15] perf tools: Fix alignment on some sort keys Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Andi Kleen, David Ahern,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

Normally the hist entry's srcline and/or srcfile is set during sorting.
However sometime it's possible to a hist entry's srcline is not set yet
after the sorting.  This is because the entry is so unique and other
sort keys already make it distinct.  Then the srcline/file sort didn't
have a chance to be called during the sorting.  In that case it has NULL
srcline/srcfile field and shows nothing.

Before:

  $ perf report -s comm,sym,srcline
  ...
  Overhead  Command       Symbol
  -----------------------------------------------------------------
    34.42%  swapper       [k] intel_idle          intel_idle.c:0
     2.44%  perf          [.] __poll_nocancel     (null)
     1.70%  gnome-shell   [k] fw_domains_get      (null)
     1.04%  Xorg          [k] sock_poll           (null)

After:

    34.42%  swapper       [k] intel_idle          intel_idle.c:0
     2.44%  perf          [.] __poll_nocancel     .:0
     1.70%  gnome-shell   [k] fw_domains_get      fw_domains_get+42
     1.04%  Xorg          [k] sock_poll           socket.c:0

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1456101111-14400-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 64 ++++++++++++++++++++++++--------------------------
 1 file changed, 31 insertions(+), 33 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 7daea71691df..6f4605b5beb5 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -286,35 +286,34 @@ struct sort_entry sort_sym = {
 
 /* --sort srcline */
 
+static char *hist_entry__get_srcline(struct hist_entry *he)
+{
+	struct map *map = he->ms.map;
+
+	if (!map)
+		return SRCLINE_UNKNOWN;
+
+	return get_srcline(map->dso, map__rip_2objdump(map, he->ip),
+			   he->ms.sym, true);
+}
+
 static int64_t
 sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right)
 {
-	if (!left->srcline) {
-		if (!left->ms.map)
-			left->srcline = SRCLINE_UNKNOWN;
-		else {
-			struct map *map = left->ms.map;
-			left->srcline = get_srcline(map->dso,
-					   map__rip_2objdump(map, left->ip),
-						    left->ms.sym, true);
-		}
-	}
-	if (!right->srcline) {
-		if (!right->ms.map)
-			right->srcline = SRCLINE_UNKNOWN;
-		else {
-			struct map *map = right->ms.map;
-			right->srcline = get_srcline(map->dso,
-					     map__rip_2objdump(map, right->ip),
-						     right->ms.sym, true);
-		}
-	}
+	if (!left->srcline)
+		left->srcline = hist_entry__get_srcline(left);
+	if (!right->srcline)
+		right->srcline = hist_entry__get_srcline(right);
+
 	return strcmp(right->srcline, left->srcline);
 }
 
 static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
 					size_t size, unsigned int width)
 {
+	if (!he->srcline)
+		he->srcline = hist_entry__get_srcline(he);
+
 	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcline);
 }
 
@@ -329,11 +328,14 @@ struct sort_entry sort_srcline = {
 
 static char no_srcfile[1];
 
-static char *get_srcfile(struct hist_entry *e)
+static char *hist_entry__get_srcfile(struct hist_entry *e)
 {
 	char *sf, *p;
 	struct map *map = e->ms.map;
 
+	if (!map)
+		return no_srcfile;
+
 	sf = __get_srcline(map->dso, map__rip_2objdump(map, e->ip),
 			 e->ms.sym, false, true);
 	if (!strcmp(sf, SRCLINE_UNKNOWN))
@@ -350,24 +352,20 @@ static char *get_srcfile(struct hist_entry *e)
 static int64_t
 sort__srcfile_cmp(struct hist_entry *left, struct hist_entry *right)
 {
-	if (!left->srcfile) {
-		if (!left->ms.map)
-			left->srcfile = no_srcfile;
-		else
-			left->srcfile = get_srcfile(left);
-	}
-	if (!right->srcfile) {
-		if (!right->ms.map)
-			right->srcfile = no_srcfile;
-		else
-			right->srcfile = get_srcfile(right);
-	}
+	if (!left->srcfile)
+		left->srcfile = hist_entry__get_srcfile(left);
+	if (!right->srcfile)
+		right->srcfile = hist_entry__get_srcfile(right);
+
 	return strcmp(right->srcfile, left->srcfile);
 }
 
 static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf,
 					size_t size, unsigned int width)
 {
+	if (!he->srcfile)
+		he->srcfile = hist_entry__get_srcfile(he);
+
 	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcfile);
 }
 
-- 
2.5.0

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

* [PATCH 05/15] perf tools: Fix alignment on some sort keys
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 04/15] perf tools: Update srcline/file if needed Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 06/15] perf tools: Fix column width setting on 'trace' sort key Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Andi Kleen, David Ahern,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

The srcline, srcfile and trace sort keys can have long entries.  With
commit 89fee7094323 ("perf hists: Do column alignment on the format
iterator"), it now aligns output with hist_entry__snprintf_alignment().
So each (possibly long) sort entries don't need to do it themselves.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1456101153-14519-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 6f4605b5beb5..a7d73e503b1b 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -314,7 +314,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
 	if (!he->srcline)
 		he->srcline = hist_entry__get_srcline(he);
 
-	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcline);
+	return repsep_snprintf(bf, size, "%-.*s", width, he->srcline);
 }
 
 struct sort_entry sort_srcline = {
@@ -366,7 +366,7 @@ static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf,
 	if (!he->srcfile)
 		he->srcfile = hist_entry__get_srcfile(he);
 
-	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcfile);
+	return repsep_snprintf(bf, size, "%-.*s", width, he->srcfile);
 }
 
 struct sort_entry sort_srcfile = {
@@ -496,11 +496,11 @@ static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf,
 
 	evsel = hists_to_evsel(he->hists);
 	if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
-		return scnprintf(bf, size, "%-*.*s", width, width, "N/A");
+		return scnprintf(bf, size, "%-.*s", width, "N/A");
 
 	if (he->trace_output == NULL)
 		he->trace_output = get_trace_output(he);
-	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->trace_output);
+	return repsep_snprintf(bf, size, "%-.*s", width, he->trace_output);
 }
 
 struct sort_entry sort_trace = {
-- 
2.5.0

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

* [PATCH 06/15] perf tools: Fix column width setting on 'trace' sort key
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 05/15] perf tools: Fix alignment on some sort keys Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 07/15] perf tools: Fix assertion failure on dynamic entry Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Andi Kleen, David Ahern,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

It missed to update column length of the 'trace' sort key in the
hists__calc_col_len() so it might truncate the output.  It calculated
the column length in the ->cmp() callback originally but it doesn't
guarantee it's called always.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1456064558-13086-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 3 +++
 tools/perf/util/sort.c | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 827c6cbcd05d..017eb5c42c37 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -179,6 +179,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 	if (h->transaction)
 		hists__new_col_len(hists, HISTC_TRANSACTION,
 				   hist_entry__transaction_len());
+
+	if (h->trace_output)
+		hists__new_col_len(hists, HISTC_TRACE, strlen(h->trace_output));
 }
 
 void hists__output_recalc_col_len(struct hists *hists, int max_rows)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index a7d73e503b1b..6d0f85894f38 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -483,9 +483,6 @@ sort__trace_cmp(struct hist_entry *left, struct hist_entry *right)
 	if (right->trace_output == NULL)
 		right->trace_output = get_trace_output(right);
 
-	hists__new_col_len(left->hists, HISTC_TRACE, strlen(left->trace_output));
-	hists__new_col_len(right->hists, HISTC_TRACE, strlen(right->trace_output));
-
 	return strcmp(right->trace_output, left->trace_output);
 }
 
-- 
2.5.0

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

* [PATCH 07/15] perf tools: Fix assertion failure on dynamic entry
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 06/15] perf tools: Fix column width setting on 'trace' sort key Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 08/15] perf bpf: Add API to set values to map entries in a bpf object Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, Andi Kleen, David Ahern,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

The dynamic entry is created for each field in a tracepoint event.
Since they have no fixed hpp format index, it should skip when
perf_hpp__reset_width() is called.

This caused following assertion failure..

  $ perf record -e sched:sched_switch -a sleep 1

  $ perf report -s comm,next_pid --stdio
  perf: ui/hist.c:651: perf_hpp__reset_width:
    Assertion `!(fmt->idx >= PERF_HPP__MAX_INDEX)' failed.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1456064558-13086-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 1ba4117d9c2d..12223d791e9f 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -645,6 +645,9 @@ void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists)
 	if (perf_hpp__is_sort_entry(fmt))
 		return perf_hpp__reset_sort_width(fmt, hists);
 
+	if (perf_hpp__is_dynamic_entry(fmt))
+		return;
+
 	BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX);
 
 	switch (fmt->idx) {
-- 
2.5.0

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

* [PATCH 08/15] perf bpf: Add API to set values to map entries in a bpf object
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 07/15] perf tools: Fix assertion failure on dynamic entry Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 09/15] perf tools: Enable BPF object configure syntax Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Jiri Olsa, Kirill Smelkov, Li Zefan, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

bpf__config_obj() is introduced as a core API to config BPF object after
loading. One configuration option of maps is introduced. After this
patch BPF object can accept assignments like:

  map:my_map.value=1234

(map.my_map.value looks pretty. However, there's a small but hard to fix
problem related to flex's greedy matching. Please see [1].  Choose ':'
to avoid it in a simpler way.)

This patch is more complex than the work it does because the
consideration of extension. In designing BPF map configuration, the
following things should be considered:

 1. Array indices selection: perf should allow user setting different
    value for different slots in an array, with syntax like:
    map:my_map.value[0,3...6]=1234;

 2. A map should be set by different config terms, each for a part
    of it. For example, set each slot to the pid of a thread;

 3. Type of value: integer is not the only valid value type. A perf
    counter can also be put into a map after commit 35578d798400
    ("bpf: Implement function bpf_perf_event_read() that get the
      selected hardware PMU counter")

 4. For a hash table, it should be possible to use a string or other
    value as a key;

 5. It is possible that map configuration is unable to be setup
    during parsing. A perf counter is an example.

Therefore, this patch does the following:

 1. Instead of updating map element during parsing, this patch stores
    map config options in 'struct bpf_map_priv'. Following patches
    will apply those configs at an appropriate time;

 2. Link map operations in a list so a map can have multiple config
    terms attached, so different parts can be configured separately;

 3. Make 'struct bpf_map_priv' extensible so that the following patches
    can add new types of keys and operations;

 4. Use bpf_obj_config__map_funcs array to support more map config options.

Since the patch changing the event parser to parse BPF object config is
relative large, I've put it in another commit. Code in this patch can be
tested after applying the next patch.

[1] http://lkml.kernel.org/g/564ED621.4050500@huawei.com

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-4-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
[ Changes "maps:my_map.value" to "map:my_map.value", improved error messages ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/bpf-loader.c | 276 +++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/bpf-loader.h |  38 ++++++
 2 files changed, 314 insertions(+)

diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 0bdccf423b27..caeef9ec0124 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -739,6 +739,261 @@ int bpf__foreach_tev(struct bpf_object *obj,
 	return 0;
 }
 
+enum bpf_map_op_type {
+	BPF_MAP_OP_SET_VALUE,
+};
+
+enum bpf_map_key_type {
+	BPF_MAP_KEY_ALL,
+};
+
+struct bpf_map_op {
+	struct list_head list;
+	enum bpf_map_op_type op_type;
+	enum bpf_map_key_type key_type;
+	union {
+		u64 value;
+	} v;
+};
+
+struct bpf_map_priv {
+	struct list_head ops_list;
+};
+
+static void
+bpf_map_op__delete(struct bpf_map_op *op)
+{
+	if (!list_empty(&op->list))
+		list_del(&op->list);
+	free(op);
+}
+
+static void
+bpf_map_priv__purge(struct bpf_map_priv *priv)
+{
+	struct bpf_map_op *pos, *n;
+
+	list_for_each_entry_safe(pos, n, &priv->ops_list, list) {
+		list_del_init(&pos->list);
+		bpf_map_op__delete(pos);
+	}
+}
+
+static void
+bpf_map_priv__clear(struct bpf_map *map __maybe_unused,
+		    void *_priv)
+{
+	struct bpf_map_priv *priv = _priv;
+
+	bpf_map_priv__purge(priv);
+	free(priv);
+}
+
+static struct bpf_map_op *
+bpf_map_op__new(void)
+{
+	struct bpf_map_op *op;
+
+	op = zalloc(sizeof(*op));
+	if (!op) {
+		pr_debug("Failed to alloc bpf_map_op\n");
+		return ERR_PTR(-ENOMEM);
+	}
+	INIT_LIST_HEAD(&op->list);
+
+	op->key_type = BPF_MAP_KEY_ALL;
+	return op;
+}
+
+static int
+bpf_map__add_op(struct bpf_map *map, struct bpf_map_op *op)
+{
+	struct bpf_map_priv *priv;
+	const char *map_name;
+	int err;
+
+	map_name = bpf_map__get_name(map);
+	err = bpf_map__get_private(map, (void **)&priv);
+	if (err) {
+		pr_debug("Failed to get private from map %s\n", map_name);
+		return err;
+	}
+
+	if (!priv) {
+		priv = zalloc(sizeof(*priv));
+		if (!priv) {
+			pr_debug("No enough memory to alloc map private\n");
+			return -ENOMEM;
+		}
+		INIT_LIST_HEAD(&priv->ops_list);
+
+		if (bpf_map__set_private(map, priv, bpf_map_priv__clear)) {
+			free(priv);
+			return -BPF_LOADER_ERRNO__INTERNAL;
+		}
+	}
+
+	list_add_tail(&op->list, &priv->ops_list);
+	return 0;
+}
+
+static int
+__bpf_map__config_value(struct bpf_map *map,
+			struct parse_events_term *term)
+{
+	struct bpf_map_def def;
+	struct bpf_map_op *op;
+	const char *map_name;
+	int err;
+
+	map_name = bpf_map__get_name(map);
+
+	err = bpf_map__get_def(map, &def);
+	if (err) {
+		pr_debug("Unable to get map definition from '%s'\n",
+			 map_name);
+		return -BPF_LOADER_ERRNO__INTERNAL;
+	}
+
+	if (def.type != BPF_MAP_TYPE_ARRAY) {
+		pr_debug("Map %s type is not BPF_MAP_TYPE_ARRAY\n",
+			 map_name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE;
+	}
+	if (def.key_size < sizeof(unsigned int)) {
+		pr_debug("Map %s has incorrect key size\n", map_name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_KEYSIZE;
+	}
+	switch (def.value_size) {
+	case 1:
+	case 2:
+	case 4:
+	case 8:
+		break;
+	default:
+		pr_debug("Map %s has incorrect value size\n", map_name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE;
+	}
+
+	op = bpf_map_op__new();
+	if (IS_ERR(op))
+		return PTR_ERR(op);
+	op->op_type = BPF_MAP_OP_SET_VALUE;
+	op->v.value = term->val.num;
+
+	err = bpf_map__add_op(map, op);
+	if (err)
+		bpf_map_op__delete(op);
+	return err;
+}
+
+static int
+bpf_map__config_value(struct bpf_map *map,
+		      struct parse_events_term *term,
+		      struct perf_evlist *evlist __maybe_unused)
+{
+	if (!term->err_val) {
+		pr_debug("Config value not set\n");
+		return -BPF_LOADER_ERRNO__OBJCONF_CONF;
+	}
+
+	if (term->type_val != PARSE_EVENTS__TERM_TYPE_NUM) {
+		pr_debug("ERROR: wrong value type\n");
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE;
+	}
+
+	return __bpf_map__config_value(map, term);
+}
+
+struct bpf_obj_config__map_func {
+	const char *config_opt;
+	int (*config_func)(struct bpf_map *, struct parse_events_term *,
+			   struct perf_evlist *);
+};
+
+struct bpf_obj_config__map_func bpf_obj_config__map_funcs[] = {
+	{"value", bpf_map__config_value},
+};
+
+static int
+bpf__obj_config_map(struct bpf_object *obj,
+		    struct parse_events_term *term,
+		    struct perf_evlist *evlist,
+		    int *key_scan_pos)
+{
+	/* key is "map:<mapname>.<config opt>" */
+	char *map_name = strdup(term->config + sizeof("map:") - 1);
+	struct bpf_map *map;
+	int err = -BPF_LOADER_ERRNO__OBJCONF_OPT;
+	char *map_opt;
+	size_t i;
+
+	if (!map_name)
+		return -ENOMEM;
+
+	map_opt = strchr(map_name, '.');
+	if (!map_opt) {
+		pr_debug("ERROR: Invalid map config: %s\n", map_name);
+		goto out;
+	}
+
+	*map_opt++ = '\0';
+	if (*map_opt == '\0') {
+		pr_debug("ERROR: Invalid map option: %s\n", term->config);
+		goto out;
+	}
+
+	map = bpf_object__get_map_by_name(obj, map_name);
+	if (!map) {
+		pr_debug("ERROR: Map %s doesn't exist\n", map_name);
+		err = -BPF_LOADER_ERRNO__OBJCONF_MAP_NOTEXIST;
+		goto out;
+	}
+
+	*key_scan_pos += map_opt - map_name;
+	for (i = 0; i < ARRAY_SIZE(bpf_obj_config__map_funcs); i++) {
+		struct bpf_obj_config__map_func *func =
+				&bpf_obj_config__map_funcs[i];
+
+		if (strcmp(map_opt, func->config_opt) == 0) {
+			err = func->config_func(map, term, evlist);
+			goto out;
+		}
+	}
+
+	pr_debug("ERROR: Invalid map config option '%s'\n", map_opt);
+	err = -BPF_LOADER_ERRNO__OBJCONF_MAP_OPT;
+out:
+	free(map_name);
+	if (!err)
+		key_scan_pos += strlen(map_opt);
+	return err;
+}
+
+int bpf__config_obj(struct bpf_object *obj,
+		    struct parse_events_term *term,
+		    struct perf_evlist *evlist,
+		    int *error_pos)
+{
+	int key_scan_pos = 0;
+	int err;
+
+	if (!obj || !term || !term->config)
+		return -EINVAL;
+
+	if (!prefixcmp(term->config, "map:")) {
+		key_scan_pos = sizeof("map:") - 1;
+		err = bpf__obj_config_map(obj, term, evlist, &key_scan_pos);
+		goto out;
+	}
+	err = -BPF_LOADER_ERRNO__OBJCONF_OPT;
+out:
+	if (error_pos)
+		*error_pos = key_scan_pos;
+	return err;
+
+}
+
 #define ERRNO_OFFSET(e)		((e) - __BPF_LOADER_ERRNO__START)
 #define ERRCODE_OFFSET(c)	ERRNO_OFFSET(BPF_LOADER_ERRNO__##c)
 #define NR_ERRNO	(__BPF_LOADER_ERRNO__END - __BPF_LOADER_ERRNO__START)
@@ -753,6 +1008,14 @@ static const char *bpf_loader_strerror_table[NR_ERRNO] = {
 	[ERRCODE_OFFSET(PROLOGUE)]	= "Failed to generate prologue",
 	[ERRCODE_OFFSET(PROLOGUE2BIG)]	= "Prologue too big for program",
 	[ERRCODE_OFFSET(PROLOGUEOOB)]	= "Offset out of bound for prologue",
+	[ERRCODE_OFFSET(OBJCONF_OPT)]	= "Invalid object config option",
+	[ERRCODE_OFFSET(OBJCONF_CONF)]	= "Config value not set (missing '=')",
+	[ERRCODE_OFFSET(OBJCONF_MAP_OPT)]	= "Invalid object map config option",
+	[ERRCODE_OFFSET(OBJCONF_MAP_NOTEXIST)]	= "Target map doesn't exist",
+	[ERRCODE_OFFSET(OBJCONF_MAP_VALUE)]	= "Incorrect value type for map",
+	[ERRCODE_OFFSET(OBJCONF_MAP_TYPE)]	= "Incorrect map type",
+	[ERRCODE_OFFSET(OBJCONF_MAP_KEYSIZE)]	= "Incorrect map key size",
+	[ERRCODE_OFFSET(OBJCONF_MAP_VALUESIZE)]	= "Incorrect map value size",
 };
 
 static int
@@ -872,3 +1135,16 @@ int bpf__strerror_load(struct bpf_object *obj,
 	bpf__strerror_end(buf, size);
 	return 0;
 }
+
+int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
+			     struct parse_events_term *term __maybe_unused,
+			     struct perf_evlist *evlist __maybe_unused,
+			     int *error_pos __maybe_unused, int err,
+			     char *buf, size_t size)
+{
+	bpf__strerror_head(err, buf, size);
+	bpf__strerror_entry(BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE,
+			    "Can't use this config term with this map type");
+	bpf__strerror_end(buf, size);
+	return 0;
+}
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index 6fdc0457e2b6..cc46a07b1a62 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <bpf/libbpf.h>
 #include "probe-event.h"
+#include "evlist.h"
 #include "debug.h"
 
 enum bpf_loader_errno {
@@ -24,10 +25,19 @@ enum bpf_loader_errno {
 	BPF_LOADER_ERRNO__PROLOGUE,	/* Failed to generate prologue */
 	BPF_LOADER_ERRNO__PROLOGUE2BIG,	/* Prologue too big for program */
 	BPF_LOADER_ERRNO__PROLOGUEOOB,	/* Offset out of bound for prologue */
+	BPF_LOADER_ERRNO__OBJCONF_OPT,	/* Invalid object config option */
+	BPF_LOADER_ERRNO__OBJCONF_CONF,	/* Config value not set (lost '=')) */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_OPT,	/* Invalid object map config option */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_NOTEXIST,	/* Target map not exist */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE,	/* Incorrect value type for map */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE,	/* Incorrect map type */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_KEYSIZE,	/* Incorrect map key size */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE,/* Incorrect map value size */
 	__BPF_LOADER_ERRNO__END,
 };
 
 struct bpf_object;
+struct parse_events_term;
 #define PERF_BPF_PROBE_GROUP "perf_bpf_probe"
 
 typedef int (*bpf_prog_iter_callback_t)(struct probe_trace_event *tev,
@@ -53,6 +63,14 @@ int bpf__strerror_load(struct bpf_object *obj, int err,
 		       char *buf, size_t size);
 int bpf__foreach_tev(struct bpf_object *obj,
 		     bpf_prog_iter_callback_t func, void *arg);
+
+int bpf__config_obj(struct bpf_object *obj, struct parse_events_term *term,
+		    struct perf_evlist *evlist, int *error_pos);
+int bpf__strerror_config_obj(struct bpf_object *obj,
+			     struct parse_events_term *term,
+			     struct perf_evlist *evlist,
+			     int *error_pos, int err, char *buf,
+			     size_t size);
 #else
 static inline struct bpf_object *
 bpf__prepare_load(const char *filename __maybe_unused,
@@ -84,6 +102,15 @@ bpf__foreach_tev(struct bpf_object *obj __maybe_unused,
 }
 
 static inline int
+bpf__config_obj(struct bpf_object *obj __maybe_unused,
+		struct parse_events_term *term __maybe_unused,
+		struct perf_evlist *evlist __maybe_unused,
+		int *error_pos __maybe_unused)
+{
+	return 0;
+}
+
+static inline int
 __bpf_strerror(char *buf, size_t size)
 {
 	if (!size)
@@ -118,5 +145,16 @@ static inline int bpf__strerror_load(struct bpf_object *obj __maybe_unused,
 {
 	return __bpf_strerror(buf, size);
 }
+
+static inline int
+bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
+			 struct parse_events_term *term __maybe_unused,
+			 struct perf_evlist *evlist __maybe_unused,
+			 int *error_pos __maybe_unused,
+			 int err __maybe_unused,
+			 char *buf, size_t size)
+{
+	return __bpf_strerror(buf, size);
+}
 #endif
 #endif
-- 
2.5.0

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

* [PATCH 09/15] perf tools: Enable BPF object configure syntax
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 08/15] perf bpf: Add API to set values to map entries in a bpf object Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 10/15] perf record: Apply config to BPF objects before recording Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Kirill Smelkov, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

This patch adds the final step for BPF map configuration. A new syntax
is appended into parser so user can config BPF objects through '/' '/'
enclosed config terms.

After this patch, following syntax is available:

  # perf record -e ./test_bpf_map_1.c/map:channel.value=10/ ...

It would takes effect after appling following commits.

Test result:

  # cat ./test_bpf_map_1.c
  /************************ BEGIN **************************/
  #include <uapi/linux/bpf.h>
  #define SEC(NAME) __attribute__((section(NAME), used))
  struct bpf_map_def {
      unsigned int type;
      unsigned int key_size;
      unsigned int value_size;
      unsigned int max_entries;
  };
  static void *(*map_lookup_elem)(struct bpf_map_def *, void *) =
      (void *)BPF_FUNC_map_lookup_elem;
  static int (*trace_printk)(const char *fmt, int fmt_size, ...) =
      (void *)BPF_FUNC_trace_printk;
  struct bpf_map_def SEC("maps") channel = {
      .type = BPF_MAP_TYPE_ARRAY,
      .key_size = sizeof(int),
      .value_size = sizeof(int),
      .max_entries = 1,
  };
  SEC("func=sys_nanosleep")
  int func(void *ctx)
  {
      int key = 0;
      char fmt[] = "%d\n";
      int *pval = map_lookup_elem(&channel, &key);
      if (!pval)
          return 0;
      trace_printk(fmt, sizeof(fmt), *pval);
      return 0;
  }
  char _license[] SEC("license") = "GPL";
  int _version SEC("version") = LINUX_VERSION_CODE;
  /************************* END ***************************/

 - Normal case:
  # ./perf record -e './test_bpf_map_1.c/map:channel.value=10/' usleep 10
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data ]

 - Error case:

  # ./perf record -e './test_bpf_map_1.c/map:channel.value/' usleep 10
  event syntax error: '..ps:channel:value/'
                                   \___ Config value not set (missing '=')
  Hint:	Valid config term:
         map:[<arraymap>]:value=[value]
         (add -v to see detail)
  Run 'perf list' for a list of valid events

  Usage: perf record [<options>] [<command>]
     or: perf record [<options>] -- <command> [<options>]

     -e, --event <event>   event selector. use 'perf list' to list available events

  # ./perf record -e './test_bpf_map_1.c/xmap:channel.value=10/' usleep 10
  event syntax error: '..pf_map_1.c/xmap:channel.value=10/'
                                    \___ Invalid object config option
  [SNIP]

  # ./perf record -e './test_bpf_map_1.c/map:xchannel.value=10/' usleep 10
  event syntax error: '..p_1.c/map:xchannel.value=10/'
                                    \___ Target map not exist
  [SNIP]

  # ./perf record -e './test_bpf_map_1.c/map:channel.xvalue=10/' usleep 10
  event syntax error: '..ps:channel.xvalue=10/'
                                    \___ Invalid object map config option
  [SNIP]

  # ./perf record -e './test_bpf_map_1.c/map:channel.value=x10/' usleep 10
  event syntax error: '..nnel.value=x10/'
                                    \___ Incorrect value type for map
  [SNIP]

  Change BPF_MAP_TYPE_ARRAY to '1' in test_bpf_map_1.c:

  # ./perf record -e './test_bpf_map_1.c/map:channel.value=10/' usleep 10
  event syntax error: '..ps:channel.value=10/'
                                    \___ Can't use this config term to this type of map

  Hint:	Valid config term:
      	map:[<arraymap>].value=[value]
      	(add -v to see detail)

Signed-off-by: Wang Nan <wangnan0@huawei.com>
[for parser part]
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-5-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c | 55 +++++++++++++++++++++++++++++++++++++++---
 tools/perf/util/parse-events.h |  3 ++-
 tools/perf/util/parse-events.l |  2 +-
 tools/perf/util/parse-events.y | 10 +++++---
 4 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index b0b329539db5..a5dd6703a56b 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -672,17 +672,63 @@ errout:
 	return err;
 }
 
+static int
+parse_events_config_bpf(struct parse_events_evlist *data,
+			struct bpf_object *obj,
+			struct list_head *head_config)
+{
+	struct parse_events_term *term;
+	int error_pos;
+
+	if (!head_config || list_empty(head_config))
+		return 0;
+
+	list_for_each_entry(term, head_config, list) {
+		char errbuf[BUFSIZ];
+		int err;
+
+		if (term->type_term != PARSE_EVENTS__TERM_TYPE_USER) {
+			snprintf(errbuf, sizeof(errbuf),
+				 "Invalid config term for BPF object");
+			errbuf[BUFSIZ - 1] = '\0';
+
+			data->error->idx = term->err_term;
+			data->error->str = strdup(errbuf);
+			return -EINVAL;
+		}
+
+		err = bpf__config_obj(obj, term, NULL, &error_pos);
+		if (err) {
+			bpf__strerror_config_obj(obj, term, NULL,
+						 &error_pos, err, errbuf,
+						 sizeof(errbuf));
+			data->error->help = strdup(
+"Hint:\tValid config term:\n"
+"     \tmap:[<arraymap>].value=[value]\n"
+"     \t(add -v to see detail)");
+			data->error->str = strdup(errbuf);
+			if (err == -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE)
+				data->error->idx = term->err_val;
+			else
+				data->error->idx = term->err_term + error_pos;
+			return err;
+		}
+	}
+	return 0;
+}
+
 int parse_events_load_bpf(struct parse_events_evlist *data,
 			  struct list_head *list,
 			  char *bpf_file_name,
-			  bool source)
+			  bool source,
+			  struct list_head *head_config)
 {
 	struct bpf_object *obj;
+	int err;
 
 	obj = bpf__prepare_load(bpf_file_name, source);
 	if (IS_ERR(obj)) {
 		char errbuf[BUFSIZ];
-		int err;
 
 		err = PTR_ERR(obj);
 
@@ -700,7 +746,10 @@ int parse_events_load_bpf(struct parse_events_evlist *data,
 		return err;
 	}
 
-	return parse_events_load_bpf_obj(data, list, obj);
+	err = parse_events_load_bpf_obj(data, list, obj);
+	if (err)
+		return err;
+	return parse_events_config_bpf(data, obj, head_config);
 }
 
 static int
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index d5eb2af78826..c48377ad4e82 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -129,7 +129,8 @@ int parse_events_add_tracepoint(struct list_head *list, int *idx,
 int parse_events_load_bpf(struct parse_events_evlist *data,
 			  struct list_head *list,
 			  char *bpf_file_name,
-			  bool source);
+			  bool source,
+			  struct list_head *head_config);
 /* Provide this function for perf test */
 struct bpf_object;
 int parse_events_load_bpf_obj(struct parse_events_evlist *data,
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 99486e6a8b97..0cc6b84a740a 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -122,7 +122,7 @@ num_dec		[0-9]+
 num_hex		0x[a-fA-F0-9]+
 num_raw_hex	[a-fA-F0-9]+
 name		[a-zA-Z_*?][a-zA-Z0-9_*?.]*
-name_minus	[a-zA-Z_*?][a-zA-Z0-9\-_*?.]*
+name_minus	[a-zA-Z_*?][a-zA-Z0-9\-_*?.:]*
 /* If you add a modifier you need to update check_modifier() */
 modifier_event	[ukhpPGHSDI]+
 modifier_bp	[rwx]{1,3}
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 6a2d006ea77f..0e2d433e4ffa 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -437,24 +437,26 @@ PE_RAW opt_event_config
 }
 
 event_bpf_file:
-PE_BPF_OBJECT
+PE_BPF_OBJECT opt_event_config
 {
 	struct parse_events_evlist *data = _data;
 	struct parse_events_error *error = data->error;
 	struct list_head *list;
 
 	ALLOC_LIST(list);
-	ABORT_ON(parse_events_load_bpf(data, list, $1, false));
+	ABORT_ON(parse_events_load_bpf(data, list, $1, false, $2));
+	parse_events_terms__delete($2);
 	$$ = list;
 }
 |
-PE_BPF_SOURCE
+PE_BPF_SOURCE opt_event_config
 {
 	struct parse_events_evlist *data = _data;
 	struct list_head *list;
 
 	ALLOC_LIST(list);
-	ABORT_ON(parse_events_load_bpf(data, list, $1, true));
+	ABORT_ON(parse_events_load_bpf(data, list, $1, true, $2));
+	parse_events_terms__delete($2);
 	$$ = list;
 }
 
-- 
2.5.0

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

* [PATCH 10/15] perf record: Apply config to BPF objects before recording
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 09/15] perf tools: Enable BPF object configure syntax Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 11/15] perf tools: Enable passing event to BPF object Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Jiri Olsa, Kirill Smelkov, Li Zefan, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

bpf__apply_obj_config() is introduced as the core API to apply object
config options to all BPF objects. This patch also does the real work
for setting values for BPF_MAP_TYPE_PERF_ARRAY maps by inserting value
stored in map's private field into the BPF map.

This patch is required because we are not always able to set all BPF
config during parsing. Further patch will set events created by perf to
BPF_MAP_TYPE_PERF_EVENT_ARRAY maps, which is not exist until
perf_evsel__open().

bpf_map_foreach_key() is introduced to iterate over each key needs to be
configured. This function would be extended to support more map types
and different key settings.

In perf record, before start recording, call bpf__apply_config() to turn
on all BPF config options.

Test result:

  # cat ./test_bpf_map_1.c
  /************************ BEGIN **************************/
  #include <uapi/linux/bpf.h>
  #define SEC(NAME) __attribute__((section(NAME), used))
  struct bpf_map_def {
      unsigned int type;
      unsigned int key_size;
      unsigned int value_size;
      unsigned int max_entries;
  };
  static void *(*map_lookup_elem)(struct bpf_map_def *, void *) =
      (void *)BPF_FUNC_map_lookup_elem;
  static int (*trace_printk)(const char *fmt, int fmt_size, ...) =
      (void *)BPF_FUNC_trace_printk;
  struct bpf_map_def SEC("maps") channel = {
      .type = BPF_MAP_TYPE_ARRAY,
      .key_size = sizeof(int),
      .value_size = sizeof(int),
      .max_entries = 1,
  };
  SEC("func=sys_nanosleep")
  int func(void *ctx)
  {
      int key = 0;
      char fmt[] = "%d\n";
      int *pval = map_lookup_elem(&channel, &key);
      if (!pval)
          return 0;
      trace_printk(fmt, sizeof(fmt), *pval);
      return 0;
  }
  char _license[] SEC("license") = "GPL";
  int _version SEC("version") = LINUX_VERSION_CODE;
  /************************* END ***************************/

  # echo "" > /sys/kernel/debug/tracing/trace
  # ./perf record -e './test_bpf_map_1.c/map:channel.value=11/' usleep 10
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data ]
  # cat /sys/kernel/debug/tracing/trace
  # tracer: nop
  #
  # entries-in-buffer/entries-written: 1/1   #P:8
  [SNIP]
  #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
  #              | |       |   ||||       |         |
             usleep-18593 [007] d... 2394714.395539: : 11
  # ./perf record -e './test_bpf_map_1.c/map:channel.value=101/' usleep 10
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data ]
  # cat /sys/kernel/debug/tracing/trace
  # tracer: nop
  #
  # entries-in-buffer/entries-written: 1/1   #P:8
  [SNIP]
  #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
  #              | |       |   ||||       |         |
             usleep-18593 [007] d... 2394714.395539: : 11
             usleep-19000 [006] d... 2394831.057840: : 101

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-6-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c  |  11 +++
 tools/perf/util/bpf-loader.c | 184 +++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/bpf-loader.h |  15 ++++
 3 files changed, 210 insertions(+)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index cf3a28d83066..7d11162b6c41 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -32,6 +32,7 @@
 #include "util/parse-branch-options.h"
 #include "util/parse-regs-options.h"
 #include "util/llvm-utils.h"
+#include "util/bpf-loader.h"
 
 #include <unistd.h>
 #include <sched.h>
@@ -536,6 +537,16 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 		goto out_child;
 	}
 
+	err = bpf__apply_obj_config();
+	if (err) {
+		char errbuf[BUFSIZ];
+
+		bpf__strerror_apply_obj_config(err, errbuf, sizeof(errbuf));
+		pr_err("ERROR: Apply config to BPF failed: %s\n",
+			 errbuf);
+		goto out_child;
+	}
+
 	/*
 	 * Normally perf_session__new would do this, but it doesn't have the
 	 * evlist.
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index caeef9ec0124..dbbd17ca6d6f 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -7,6 +7,7 @@
 
 #include <linux/bpf.h>
 #include <bpf/libbpf.h>
+#include <bpf/bpf.h>
 #include <linux/err.h>
 #include <linux/string.h>
 #include "perf.h"
@@ -994,6 +995,182 @@ out:
 
 }
 
+typedef int (*map_config_func_t)(const char *name, int map_fd,
+				 struct bpf_map_def *pdef,
+				 struct bpf_map_op *op,
+				 void *pkey, void *arg);
+
+static int
+foreach_key_array_all(map_config_func_t func,
+		      void *arg, const char *name,
+		      int map_fd, struct bpf_map_def *pdef,
+		      struct bpf_map_op *op)
+{
+	unsigned int i;
+	int err;
+
+	for (i = 0; i < pdef->max_entries; i++) {
+		err = func(name, map_fd, pdef, op, &i, arg);
+		if (err) {
+			pr_debug("ERROR: failed to insert value to %s[%u]\n",
+				 name, i);
+			return err;
+		}
+	}
+	return 0;
+}
+
+static int
+bpf_map_config_foreach_key(struct bpf_map *map,
+			   map_config_func_t func,
+			   void *arg)
+{
+	int err, map_fd;
+	const char *name;
+	struct bpf_map_op *op;
+	struct bpf_map_def def;
+	struct bpf_map_priv *priv;
+
+	name = bpf_map__get_name(map);
+
+	err = bpf_map__get_private(map, (void **)&priv);
+	if (err) {
+		pr_debug("ERROR: failed to get private from map %s\n", name);
+		return -BPF_LOADER_ERRNO__INTERNAL;
+	}
+	if (!priv || list_empty(&priv->ops_list)) {
+		pr_debug("INFO: nothing to config for map %s\n", name);
+		return 0;
+	}
+
+	err = bpf_map__get_def(map, &def);
+	if (err) {
+		pr_debug("ERROR: failed to get definition from map %s\n", name);
+		return -BPF_LOADER_ERRNO__INTERNAL;
+	}
+	map_fd = bpf_map__get_fd(map);
+	if (map_fd < 0) {
+		pr_debug("ERROR: failed to get fd from map %s\n", name);
+		return map_fd;
+	}
+
+	list_for_each_entry(op, &priv->ops_list, list) {
+		switch (def.type) {
+		case BPF_MAP_TYPE_ARRAY:
+			switch (op->key_type) {
+			case BPF_MAP_KEY_ALL:
+				err = foreach_key_array_all(func, arg, name,
+							    map_fd, &def, op);
+				if (err)
+					return err;
+				break;
+			default:
+				pr_debug("ERROR: keytype for map '%s' invalid\n",
+					 name);
+				return -BPF_LOADER_ERRNO__INTERNAL;
+			}
+			break;
+		default:
+			pr_debug("ERROR: type of '%s' incorrect\n", name);
+			return -BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE;
+		}
+	}
+
+	return 0;
+}
+
+static int
+apply_config_value_for_key(int map_fd, void *pkey,
+			   size_t val_size, u64 val)
+{
+	int err = 0;
+
+	switch (val_size) {
+	case 1: {
+		u8 _val = (u8)(val);
+		err = bpf_map_update_elem(map_fd, pkey, &_val, BPF_ANY);
+		break;
+	}
+	case 2: {
+		u16 _val = (u16)(val);
+		err = bpf_map_update_elem(map_fd, pkey, &_val, BPF_ANY);
+		break;
+	}
+	case 4: {
+		u32 _val = (u32)(val);
+		err = bpf_map_update_elem(map_fd, pkey, &_val, BPF_ANY);
+		break;
+	}
+	case 8: {
+		err = bpf_map_update_elem(map_fd, pkey, &val, BPF_ANY);
+		break;
+	}
+	default:
+		pr_debug("ERROR: invalid value size\n");
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE;
+	}
+	if (err && errno)
+		err = -errno;
+	return err;
+}
+
+static int
+apply_obj_config_map_for_key(const char *name, int map_fd,
+			     struct bpf_map_def *pdef __maybe_unused,
+			     struct bpf_map_op *op,
+			     void *pkey, void *arg __maybe_unused)
+{
+	int err;
+
+	switch (op->op_type) {
+	case BPF_MAP_OP_SET_VALUE:
+		err = apply_config_value_for_key(map_fd, pkey,
+						 pdef->value_size,
+						 op->v.value);
+		break;
+	default:
+		pr_debug("ERROR: unknown value type for '%s'\n", name);
+		err = -BPF_LOADER_ERRNO__INTERNAL;
+	}
+	return err;
+}
+
+static int
+apply_obj_config_map(struct bpf_map *map)
+{
+	return bpf_map_config_foreach_key(map,
+					  apply_obj_config_map_for_key,
+					  NULL);
+}
+
+static int
+apply_obj_config_object(struct bpf_object *obj)
+{
+	struct bpf_map *map;
+	int err;
+
+	bpf_map__for_each(map, obj) {
+		err = apply_obj_config_map(map);
+		if (err)
+			return err;
+	}
+	return 0;
+}
+
+int bpf__apply_obj_config(void)
+{
+	struct bpf_object *obj, *tmp;
+	int err;
+
+	bpf_object__for_each_safe(obj, tmp) {
+		err = apply_obj_config_object(obj);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
 #define ERRNO_OFFSET(e)		((e) - __BPF_LOADER_ERRNO__START)
 #define ERRCODE_OFFSET(c)	ERRNO_OFFSET(BPF_LOADER_ERRNO__##c)
 #define NR_ERRNO	(__BPF_LOADER_ERRNO__END - __BPF_LOADER_ERRNO__START)
@@ -1148,3 +1325,10 @@ int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
 	bpf__strerror_end(buf, size);
 	return 0;
 }
+
+int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
+{
+	bpf__strerror_head(err, buf, size);
+	bpf__strerror_end(buf, size);
+	return 0;
+}
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index cc46a07b1a62..5d3b931f9baa 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -71,6 +71,8 @@ int bpf__strerror_config_obj(struct bpf_object *obj,
 			     struct perf_evlist *evlist,
 			     int *error_pos, int err, char *buf,
 			     size_t size);
+int bpf__apply_obj_config(void);
+int bpf__strerror_apply_obj_config(int err, char *buf, size_t size);
 #else
 static inline struct bpf_object *
 bpf__prepare_load(const char *filename __maybe_unused,
@@ -111,6 +113,12 @@ bpf__config_obj(struct bpf_object *obj __maybe_unused,
 }
 
 static inline int
+bpf__apply_obj_config(void)
+{
+	return 0;
+}
+
+static inline int
 __bpf_strerror(char *buf, size_t size)
 {
 	if (!size)
@@ -156,5 +164,12 @@ bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
 {
 	return __bpf_strerror(buf, size);
 }
+
+static inline int
+bpf__strerror_apply_obj_config(int err __maybe_unused,
+			       char *buf, size_t size)
+{
+	return __bpf_strerror(buf, size);
+}
 #endif
 #endif
-- 
2.5.0

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

* [PATCH 11/15] perf tools: Enable passing event to BPF object
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 10/15] perf record: Apply config to BPF objects before recording Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 12/15] perf tools: Support setting different slots in a BPF map separately Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Kirill Smelkov, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

A new syntax is added to the parser so that the user can access
predefined perf events in BPF objects.

After this patch, BPF programs for perf are finally able to utilize
bpf_perf_event_read() introduced in commit 35578d798400 ("bpf: Implement
function bpf_perf_event_read() that get the selected hardware PMU
counter").

Test result:

  # cat test_bpf_map_2.c
  /************************ BEGIN **************************/
  #include <uapi/linux/bpf.h>
  #define SEC(NAME) __attribute__((section(NAME), used))
  struct bpf_map_def {
      unsigned int type;
      unsigned int key_size;
      unsigned int value_size;
      unsigned int max_entries;
  };
  static int (*trace_printk)(const char *fmt, int fmt_size, ...) =
      (void *)BPF_FUNC_trace_printk;
  static int (*get_smp_processor_id)(void) =
      (void *)BPF_FUNC_get_smp_processor_id;
  static int (*perf_event_read)(struct bpf_map_def *, int) =
      (void *)BPF_FUNC_perf_event_read;

  struct bpf_map_def SEC("maps") pmu_map = {
      .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
      .key_size = sizeof(int),
      .value_size = sizeof(int),
      .max_entries = __NR_CPUS__,
  };
  SEC("func_write=sys_write")
  int func_write(void *ctx)
  {
      unsigned long long val;
      char fmt[] = "sys_write:        pmu=%llu\n";
      val = perf_event_read(&pmu_map, get_smp_processor_id());
      trace_printk(fmt, sizeof(fmt), val);
      return 0;
  }

  SEC("func_write_return=sys_write%return")
  int func_write_return(void *ctx)
  {
      unsigned long long val = 0;
      char fmt[] = "sys_write_return: pmu=%llu\n";
      val = perf_event_read(&pmu_map, get_smp_processor_id());
      trace_printk(fmt, sizeof(fmt), val);
      return 0;
  }
  char _license[] SEC("license") = "GPL";
  int _version SEC("version") = LINUX_VERSION_CODE;
  /************************* END ***************************/

Normal case:

  # echo "" > /sys/kernel/debug/tracing/trace
  # perf record -i -e cycles -e './test_bpf_map_2.c/map:pmu_map.event=cycles/' ls /
  [SNIP]
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.013 MB perf.data (7 samples) ]
  # cat /sys/kernel/debug/tracing/trace | grep ls
                ls-17066 [000] d... 938449.863301: : sys_write:        pmu=1157327
                ls-17066 [000] dN.. 938449.863342: : sys_write_return: pmu=1225218
                ls-17066 [000] d... 938449.863349: : sys_write:        pmu=1241922
                ls-17066 [000] dN.. 938449.863369: : sys_write_return: pmu=1267445

Normal case (system wide):

  # echo "" > /sys/kernel/debug/tracing/trace
  # perf record -i -e cycles -e './test_bpf_map_2.c/map:pmu_map.event=cycles/' -a
  ^C[ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.811 MB perf.data (120 samples) ]

  # cat /sys/kernel/debug/tracing/trace | grep -v '18446744073709551594' | grep -v perf | head -n 20
  [SNIP]
  #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
  #              | |       |   ||||       |         |
             gmain-30828 [002] d... 2740551.068992: : sys_write:        pmu=84373
             gmain-30828 [002] d... 2740551.068992: : sys_write_return: pmu=87696
             gmain-30828 [002] d... 2740551.068996: : sys_write:        pmu=100658
             gmain-30828 [002] d... 2740551.068997: : sys_write_return: pmu=102572

Error case 1:

  # perf record -e './test_bpf_map_2.c' ls /
  [SNIP]
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.014 MB perf.data ]
  # cat /sys/kernel/debug/tracing/trace | grep ls
                ls-17115 [007] d... 2724279.665625: : sys_write:        pmu=18446744073709551614
                ls-17115 [007] dN.. 2724279.665651: : sys_write_return: pmu=18446744073709551614
                ls-17115 [007] d... 2724279.665658: : sys_write:        pmu=18446744073709551614
                ls-17115 [007] dN.. 2724279.665677: : sys_write_return: pmu=18446744073709551614

  (18446744073709551614 is 0xfffffffffffffffe (-2))

Error case 2:

  # perf record -e cycles -e './test_bpf_map_2.c/map:pmu_map.event=evt/' -a
  event syntax error: '..ps:pmu_map.event=evt/'
                                    \___ Event not found for map setting

  Hint:	Valid config terms:
       	map:[<arraymap>].value=[value]
       	map:[<eventmap>].event=[event]
  [SNIP]

Error case 3:
  # ls /proc/2348/task/
  2348  2505  2506  2507  2508
  # perf record -i -e cycles -e './test_bpf_map_2.c/map:pmu_map.event=cycles/' -p 2348
  ERROR: Apply config to BPF failed: Cannot set event to BPF map in multi-thread tracing

Error case 4:
  # perf record -e cycles -e './test_bpf_map_2.c/map:pmu_map.event=cycles/' ls /
  ERROR: Apply config to BPF failed: Doesn't support inherit event (Hint: use -i to turn off inherit)

Error case 5:
  # perf record -i -e raw_syscalls:sys_enter -e './test_bpf_map_2.c/map:pmu_map.event=raw_syscalls:sys_enter/' ls
  ERROR: Apply config to BPF failed: Can only put raw, hardware and BPF output event into a BPF map

Error case 6:
  # perf record -i -e './test_bpf_map_2.c/map:pmu_map.event=123/' ls /
  event syntax error: '.._map.event=123/'
                                    \___ Incorrect value type for map
  [SNIP]

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-7-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/bpf-loader.c   | 163 +++++++++++++++++++++++++++++++++++++++--
 tools/perf/util/bpf-loader.h   |   5 ++
 tools/perf/util/evlist.c       |  16 ++++
 tools/perf/util/evlist.h       |   3 +
 tools/perf/util/parse-events.c |  15 ++--
 tools/perf/util/parse-events.h |   1 +
 6 files changed, 190 insertions(+), 13 deletions(-)

diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index dbbd17ca6d6f..deacb95f27ec 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -742,6 +742,7 @@ int bpf__foreach_tev(struct bpf_object *obj,
 
 enum bpf_map_op_type {
 	BPF_MAP_OP_SET_VALUE,
+	BPF_MAP_OP_SET_EVSEL,
 };
 
 enum bpf_map_key_type {
@@ -754,6 +755,7 @@ struct bpf_map_op {
 	enum bpf_map_key_type key_type;
 	union {
 		u64 value;
+		struct perf_evsel *evsel;
 	} v;
 };
 
@@ -838,6 +840,24 @@ bpf_map__add_op(struct bpf_map *map, struct bpf_map_op *op)
 	return 0;
 }
 
+static struct bpf_map_op *
+bpf_map__add_newop(struct bpf_map *map)
+{
+	struct bpf_map_op *op;
+	int err;
+
+	op = bpf_map_op__new();
+	if (IS_ERR(op))
+		return op;
+
+	err = bpf_map__add_op(map, op);
+	if (err) {
+		bpf_map_op__delete(op);
+		return ERR_PTR(err);
+	}
+	return op;
+}
+
 static int
 __bpf_map__config_value(struct bpf_map *map,
 			struct parse_events_term *term)
@@ -876,16 +896,12 @@ __bpf_map__config_value(struct bpf_map *map,
 		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE;
 	}
 
-	op = bpf_map_op__new();
+	op = bpf_map__add_newop(map);
 	if (IS_ERR(op))
 		return PTR_ERR(op);
 	op->op_type = BPF_MAP_OP_SET_VALUE;
 	op->v.value = term->val.num;
-
-	err = bpf_map__add_op(map, op);
-	if (err)
-		bpf_map_op__delete(op);
-	return err;
+	return 0;
 }
 
 static int
@@ -899,13 +915,75 @@ bpf_map__config_value(struct bpf_map *map,
 	}
 
 	if (term->type_val != PARSE_EVENTS__TERM_TYPE_NUM) {
-		pr_debug("ERROR: wrong value type\n");
+		pr_debug("ERROR: wrong value type for 'value'\n");
 		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE;
 	}
 
 	return __bpf_map__config_value(map, term);
 }
 
+static int
+__bpf_map__config_event(struct bpf_map *map,
+			struct parse_events_term *term,
+			struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel;
+	struct bpf_map_def def;
+	struct bpf_map_op *op;
+	const char *map_name;
+	int err;
+
+	map_name = bpf_map__get_name(map);
+	evsel = perf_evlist__find_evsel_by_str(evlist, term->val.str);
+	if (!evsel) {
+		pr_debug("Event (for '%s') '%s' doesn't exist\n",
+			 map_name, term->val.str);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_NOEVT;
+	}
+
+	err = bpf_map__get_def(map, &def);
+	if (err) {
+		pr_debug("Unable to get map definition from '%s'\n",
+			 map_name);
+		return err;
+	}
+
+	/*
+	 * No need to check key_size and value_size:
+	 * kernel has already checked them.
+	 */
+	if (def.type != BPF_MAP_TYPE_PERF_EVENT_ARRAY) {
+		pr_debug("Map %s type is not BPF_MAP_TYPE_PERF_EVENT_ARRAY\n",
+			 map_name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE;
+	}
+
+	op = bpf_map__add_newop(map);
+	if (IS_ERR(op))
+		return PTR_ERR(op);
+	op->op_type = BPF_MAP_OP_SET_EVSEL;
+	op->v.evsel = evsel;
+	return 0;
+}
+
+static int
+bpf_map__config_event(struct bpf_map *map,
+		      struct parse_events_term *term,
+		      struct perf_evlist *evlist)
+{
+	if (!term->err_val) {
+		pr_debug("Config value not set\n");
+		return -BPF_LOADER_ERRNO__OBJCONF_CONF;
+	}
+
+	if (term->type_val != PARSE_EVENTS__TERM_TYPE_STR) {
+		pr_debug("ERROR: wrong value type for 'event'\n");
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE;
+	}
+
+	return __bpf_map__config_event(map, term, evlist);
+}
+
 struct bpf_obj_config__map_func {
 	const char *config_opt;
 	int (*config_func)(struct bpf_map *, struct parse_events_term *,
@@ -914,6 +992,7 @@ struct bpf_obj_config__map_func {
 
 struct bpf_obj_config__map_func bpf_obj_config__map_funcs[] = {
 	{"value", bpf_map__config_value},
+	{"event", bpf_map__config_event},
 };
 
 static int
@@ -1057,6 +1136,7 @@ bpf_map_config_foreach_key(struct bpf_map *map,
 	list_for_each_entry(op, &priv->ops_list, list) {
 		switch (def.type) {
 		case BPF_MAP_TYPE_ARRAY:
+		case BPF_MAP_TYPE_PERF_EVENT_ARRAY:
 			switch (op->key_type) {
 			case BPF_MAP_KEY_ALL:
 				err = foreach_key_array_all(func, arg, name,
@@ -1115,6 +1195,60 @@ apply_config_value_for_key(int map_fd, void *pkey,
 }
 
 static int
+apply_config_evsel_for_key(const char *name, int map_fd, void *pkey,
+			   struct perf_evsel *evsel)
+{
+	struct xyarray *xy = evsel->fd;
+	struct perf_event_attr *attr;
+	unsigned int key, events;
+	bool check_pass = false;
+	int *evt_fd;
+	int err;
+
+	if (!xy) {
+		pr_debug("ERROR: evsel not ready for map %s\n", name);
+		return -BPF_LOADER_ERRNO__INTERNAL;
+	}
+
+	if (xy->row_size / xy->entry_size != 1) {
+		pr_debug("ERROR: Dimension of target event is incorrect for map %s\n",
+			 name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM;
+	}
+
+	attr = &evsel->attr;
+	if (attr->inherit) {
+		pr_debug("ERROR: Can't put inherit event into map %s\n", name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH;
+	}
+
+	if (attr->type == PERF_TYPE_RAW)
+		check_pass = true;
+	if (attr->type == PERF_TYPE_HARDWARE)
+		check_pass = true;
+	if (attr->type == PERF_TYPE_SOFTWARE &&
+			attr->config == PERF_COUNT_SW_BPF_OUTPUT)
+		check_pass = true;
+	if (!check_pass) {
+		pr_debug("ERROR: Event type is wrong for map %s\n", name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE;
+	}
+
+	events = xy->entries / (xy->row_size / xy->entry_size);
+	key = *((unsigned int *)pkey);
+	if (key >= events) {
+		pr_debug("ERROR: there is no event %d for map %s\n",
+			 key, name);
+		return -BPF_LOADER_ERRNO__OBJCONF_MAP_MAPSIZE;
+	}
+	evt_fd = xyarray__entry(xy, key, 0);
+	err = bpf_map_update_elem(map_fd, pkey, evt_fd, BPF_ANY);
+	if (err && errno)
+		err = -errno;
+	return err;
+}
+
+static int
 apply_obj_config_map_for_key(const char *name, int map_fd,
 			     struct bpf_map_def *pdef __maybe_unused,
 			     struct bpf_map_op *op,
@@ -1128,6 +1262,10 @@ apply_obj_config_map_for_key(const char *name, int map_fd,
 						 pdef->value_size,
 						 op->v.value);
 		break;
+	case BPF_MAP_OP_SET_EVSEL:
+		err = apply_config_evsel_for_key(name, map_fd, pkey,
+						 op->v.evsel);
+		break;
 	default:
 		pr_debug("ERROR: unknown value type for '%s'\n", name);
 		err = -BPF_LOADER_ERRNO__INTERNAL;
@@ -1193,6 +1331,11 @@ static const char *bpf_loader_strerror_table[NR_ERRNO] = {
 	[ERRCODE_OFFSET(OBJCONF_MAP_TYPE)]	= "Incorrect map type",
 	[ERRCODE_OFFSET(OBJCONF_MAP_KEYSIZE)]	= "Incorrect map key size",
 	[ERRCODE_OFFSET(OBJCONF_MAP_VALUESIZE)]	= "Incorrect map value size",
+	[ERRCODE_OFFSET(OBJCONF_MAP_NOEVT)]	= "Event not found for map setting",
+	[ERRCODE_OFFSET(OBJCONF_MAP_MAPSIZE)]	= "Invalid map size for event setting",
+	[ERRCODE_OFFSET(OBJCONF_MAP_EVTDIM)]	= "Event dimension too large",
+	[ERRCODE_OFFSET(OBJCONF_MAP_EVTINH)]	= "Doesn't support inherit event",
+	[ERRCODE_OFFSET(OBJCONF_MAP_EVTTYPE)]	= "Wrong event type for map",
 };
 
 static int
@@ -1329,6 +1472,12 @@ int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
 int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
 {
 	bpf__strerror_head(err, buf, size);
+	bpf__strerror_entry(BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM,
+			    "Cannot set event to BPF map in multi-thread tracing");
+	bpf__strerror_entry(BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH,
+			    "%s (Hint: use -i to turn off inherit)", emsg);
+	bpf__strerror_entry(BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE,
+			    "Can only put raw, hardware and BPF output event into a BPF map");
 	bpf__strerror_end(buf, size);
 	return 0;
 }
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index 5d3b931f9baa..7c7689f800cf 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -33,6 +33,11 @@ enum bpf_loader_errno {
 	BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE,	/* Incorrect map type */
 	BPF_LOADER_ERRNO__OBJCONF_MAP_KEYSIZE,	/* Incorrect map key size */
 	BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE,/* Incorrect map value size */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_NOEVT,	/* Event not found for map setting */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_MAPSIZE,	/* Invalid map size for event setting */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM,	/* Event dimension too large */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH,	/* Doesn't support inherit event */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE,	/* Wrong event type for map */
 	__BPF_LOADER_ERRNO__END,
 };
 
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 0f577162c699..c42e1967e970 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1741,3 +1741,19 @@ void perf_evlist__set_tracking_event(struct perf_evlist *evlist,
 
 	tracking_evsel->tracking = true;
 }
+
+struct perf_evsel *
+perf_evlist__find_evsel_by_str(struct perf_evlist *evlist,
+			       const char *str)
+{
+	struct perf_evsel *evsel;
+
+	evlist__for_each(evlist, evsel) {
+		if (!evsel->name)
+			continue;
+		if (strcmp(str, evsel->name) == 0)
+			return evsel;
+	}
+
+	return NULL;
+}
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 7c4d9a206776..a0d15221db6e 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -294,4 +294,7 @@ void perf_evlist__set_tracking_event(struct perf_evlist *evlist,
 				     struct perf_evsel *tracking_evsel);
 
 void perf_event_attr__set_max_precise_ip(struct perf_event_attr *attr);
+
+struct perf_evsel *
+perf_evlist__find_evsel_by_str(struct perf_evlist *evlist, const char *str);
 #endif /* __PERF_EVLIST_H */
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index a5dd6703a56b..5909fd2825d5 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -697,14 +697,16 @@ parse_events_config_bpf(struct parse_events_evlist *data,
 			return -EINVAL;
 		}
 
-		err = bpf__config_obj(obj, term, NULL, &error_pos);
+		err = bpf__config_obj(obj, term, data->evlist, &error_pos);
 		if (err) {
-			bpf__strerror_config_obj(obj, term, NULL,
+			bpf__strerror_config_obj(obj, term, data->evlist,
 						 &error_pos, err, errbuf,
 						 sizeof(errbuf));
 			data->error->help = strdup(
-"Hint:\tValid config term:\n"
+"Hint:\tValid config terms:\n"
 "     \tmap:[<arraymap>].value=[value]\n"
+"     \tmap:[<eventmap>].event=[event]\n"
+"\n"
 "     \t(add -v to see detail)");
 			data->error->str = strdup(errbuf);
 			if (err == -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE)
@@ -1530,9 +1532,10 @@ int parse_events(struct perf_evlist *evlist, const char *str,
 		 struct parse_events_error *err)
 {
 	struct parse_events_evlist data = {
-		.list  = LIST_HEAD_INIT(data.list),
-		.idx   = evlist->nr_entries,
-		.error = err,
+		.list   = LIST_HEAD_INIT(data.list),
+		.idx    = evlist->nr_entries,
+		.error  = err,
+		.evlist = evlist,
 	};
 	int ret;
 
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index c48377ad4e82..e0369695870f 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -99,6 +99,7 @@ struct parse_events_evlist {
 	int			   idx;
 	int			   nr_groups;
 	struct parse_events_error *error;
+	struct perf_evlist	  *evlist;
 };
 
 struct parse_events_terms {
-- 
2.5.0

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

* [PATCH 12/15] perf tools: Support setting different slots in a BPF map separately
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 11/15] perf tools: Enable passing event to BPF object Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 13/15] perf tools: Enable indices setting syntax for BPF map Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Jiri Olsa, Kirill Smelkov, Li Zefan, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

This patch introduces basic facilities to support config different slots
in a BPF map one by one.

array.nr_ranges and array.ranges are introduced into 'struct
parse_events_term', where ranges is an array of indices range (start,
length) which will be configured by this config term. nr_ranges is the
size of the array. The array is passed to 'struct bpf_map_priv'.  To
indicate the new type of configuration, BPF_MAP_KEY_RANGES is added as a
new key type. bpf_map_config_foreach_key() is extended to iterate over
those indices instead of all possible keys.

Code in this commit will be enabled by following commit which enables
the indices syntax for array configuration.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-8-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/bpf-loader.c   | 128 ++++++++++++++++++++++++++++++++++++++---
 tools/perf/util/bpf-loader.h   |   1 +
 tools/perf/util/parse-events.c |   7 +++
 tools/perf/util/parse-events.h |  10 ++++
 4 files changed, 137 insertions(+), 9 deletions(-)

diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index deacb95f27ec..44824e3eeaed 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -17,6 +17,7 @@
 #include "llvm-utils.h"
 #include "probe-event.h"
 #include "probe-finder.h" // for MAX_PROBES
+#include "parse-events.h"
 #include "llvm-utils.h"
 
 #define DEFINE_PRINT_FN(name, level) \
@@ -747,6 +748,7 @@ enum bpf_map_op_type {
 
 enum bpf_map_key_type {
 	BPF_MAP_KEY_ALL,
+	BPF_MAP_KEY_RANGES,
 };
 
 struct bpf_map_op {
@@ -754,6 +756,9 @@ struct bpf_map_op {
 	enum bpf_map_op_type op_type;
 	enum bpf_map_key_type key_type;
 	union {
+		struct parse_events_array array;
+	} k;
+	union {
 		u64 value;
 		struct perf_evsel *evsel;
 	} v;
@@ -768,6 +773,8 @@ bpf_map_op__delete(struct bpf_map_op *op)
 {
 	if (!list_empty(&op->list))
 		list_del(&op->list);
+	if (op->key_type == BPF_MAP_KEY_RANGES)
+		parse_events__clear_array(&op->k.array);
 	free(op);
 }
 
@@ -792,10 +799,33 @@ bpf_map_priv__clear(struct bpf_map *map __maybe_unused,
 	free(priv);
 }
 
+static int
+bpf_map_op_setkey(struct bpf_map_op *op, struct parse_events_term *term)
+{
+	op->key_type = BPF_MAP_KEY_ALL;
+	if (!term)
+		return 0;
+
+	if (term->array.nr_ranges) {
+		size_t memsz = term->array.nr_ranges *
+				sizeof(op->k.array.ranges[0]);
+
+		op->k.array.ranges = memdup(term->array.ranges, memsz);
+		if (!op->k.array.ranges) {
+			pr_debug("No enough memory to alloc indices for map\n");
+			return -ENOMEM;
+		}
+		op->key_type = BPF_MAP_KEY_RANGES;
+		op->k.array.nr_ranges = term->array.nr_ranges;
+	}
+	return 0;
+}
+
 static struct bpf_map_op *
-bpf_map_op__new(void)
+bpf_map_op__new(struct parse_events_term *term)
 {
 	struct bpf_map_op *op;
+	int err;
 
 	op = zalloc(sizeof(*op));
 	if (!op) {
@@ -804,7 +834,11 @@ bpf_map_op__new(void)
 	}
 	INIT_LIST_HEAD(&op->list);
 
-	op->key_type = BPF_MAP_KEY_ALL;
+	err = bpf_map_op_setkey(op, term);
+	if (err) {
+		free(op);
+		return ERR_PTR(err);
+	}
 	return op;
 }
 
@@ -841,12 +875,12 @@ bpf_map__add_op(struct bpf_map *map, struct bpf_map_op *op)
 }
 
 static struct bpf_map_op *
-bpf_map__add_newop(struct bpf_map *map)
+bpf_map__add_newop(struct bpf_map *map, struct parse_events_term *term)
 {
 	struct bpf_map_op *op;
 	int err;
 
-	op = bpf_map_op__new();
+	op = bpf_map_op__new(term);
 	if (IS_ERR(op))
 		return op;
 
@@ -896,7 +930,7 @@ __bpf_map__config_value(struct bpf_map *map,
 		return -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE;
 	}
 
-	op = bpf_map__add_newop(map);
+	op = bpf_map__add_newop(map, term);
 	if (IS_ERR(op))
 		return PTR_ERR(op);
 	op->op_type = BPF_MAP_OP_SET_VALUE;
@@ -958,7 +992,7 @@ __bpf_map__config_event(struct bpf_map *map,
 		return -BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE;
 	}
 
-	op = bpf_map__add_newop(map);
+	op = bpf_map__add_newop(map, term);
 	if (IS_ERR(op))
 		return PTR_ERR(op);
 	op->op_type = BPF_MAP_OP_SET_EVSEL;
@@ -996,6 +1030,44 @@ struct bpf_obj_config__map_func bpf_obj_config__map_funcs[] = {
 };
 
 static int
+config_map_indices_range_check(struct parse_events_term *term,
+			       struct bpf_map *map,
+			       const char *map_name)
+{
+	struct parse_events_array *array = &term->array;
+	struct bpf_map_def def;
+	unsigned int i;
+	int err;
+
+	if (!array->nr_ranges)
+		return 0;
+	if (!array->ranges) {
+		pr_debug("ERROR: map %s: array->nr_ranges is %d but range array is NULL\n",
+			 map_name, (int)array->nr_ranges);
+		return -BPF_LOADER_ERRNO__INTERNAL;
+	}
+
+	err = bpf_map__get_def(map, &def);
+	if (err) {
+		pr_debug("ERROR: Unable to get map definition from '%s'\n",
+			 map_name);
+		return -BPF_LOADER_ERRNO__INTERNAL;
+	}
+
+	for (i = 0; i < array->nr_ranges; i++) {
+		unsigned int start = array->ranges[i].start;
+		size_t length = array->ranges[i].length;
+		unsigned int idx = start + length - 1;
+
+		if (idx >= def.max_entries) {
+			pr_debug("ERROR: index %d too large\n", idx);
+			return -BPF_LOADER_ERRNO__OBJCONF_MAP_IDX2BIG;
+		}
+	}
+	return 0;
+}
+
+static int
 bpf__obj_config_map(struct bpf_object *obj,
 		    struct parse_events_term *term,
 		    struct perf_evlist *evlist,
@@ -1030,7 +1102,12 @@ bpf__obj_config_map(struct bpf_object *obj,
 		goto out;
 	}
 
-	*key_scan_pos += map_opt - map_name;
+	*key_scan_pos += strlen(map_opt);
+	err = config_map_indices_range_check(term, map, map_name);
+	if (err)
+		goto out;
+	*key_scan_pos -= strlen(map_opt);
+
 	for (i = 0; i < ARRAY_SIZE(bpf_obj_config__map_funcs); i++) {
 		struct bpf_obj_config__map_func *func =
 				&bpf_obj_config__map_funcs[i];
@@ -1100,6 +1177,33 @@ foreach_key_array_all(map_config_func_t func,
 }
 
 static int
+foreach_key_array_ranges(map_config_func_t func, void *arg,
+			 const char *name, int map_fd,
+			 struct bpf_map_def *pdef,
+			 struct bpf_map_op *op)
+{
+	unsigned int i, j;
+	int err;
+
+	for (i = 0; i < op->k.array.nr_ranges; i++) {
+		unsigned int start = op->k.array.ranges[i].start;
+		size_t length = op->k.array.ranges[i].length;
+
+		for (j = 0; j < length; j++) {
+			unsigned int idx = start + j;
+
+			err = func(name, map_fd, pdef, op, &idx, arg);
+			if (err) {
+				pr_debug("ERROR: failed to insert value to %s[%u]\n",
+					 name, idx);
+				return err;
+			}
+		}
+	}
+	return 0;
+}
+
+static int
 bpf_map_config_foreach_key(struct bpf_map *map,
 			   map_config_func_t func,
 			   void *arg)
@@ -1141,14 +1245,19 @@ bpf_map_config_foreach_key(struct bpf_map *map,
 			case BPF_MAP_KEY_ALL:
 				err = foreach_key_array_all(func, arg, name,
 							    map_fd, &def, op);
-				if (err)
-					return err;
+				break;
+			case BPF_MAP_KEY_RANGES:
+				err = foreach_key_array_ranges(func, arg, name,
+							       map_fd, &def,
+							       op);
 				break;
 			default:
 				pr_debug("ERROR: keytype for map '%s' invalid\n",
 					 name);
 				return -BPF_LOADER_ERRNO__INTERNAL;
 			}
+			if (err)
+				return err;
 			break;
 		default:
 			pr_debug("ERROR: type of '%s' incorrect\n", name);
@@ -1336,6 +1445,7 @@ static const char *bpf_loader_strerror_table[NR_ERRNO] = {
 	[ERRCODE_OFFSET(OBJCONF_MAP_EVTDIM)]	= "Event dimension too large",
 	[ERRCODE_OFFSET(OBJCONF_MAP_EVTINH)]	= "Doesn't support inherit event",
 	[ERRCODE_OFFSET(OBJCONF_MAP_EVTTYPE)]	= "Wrong event type for map",
+	[ERRCODE_OFFSET(OBJCONF_MAP_IDX2BIG)]	= "Index too large",
 };
 
 static int
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index 7c7689f800cf..be4311944e3d 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -38,6 +38,7 @@ enum bpf_loader_errno {
 	BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM,	/* Event dimension too large */
 	BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH,	/* Doesn't support inherit event */
 	BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE,	/* Wrong event type for map */
+	BPF_LOADER_ERRNO__OBJCONF_MAP_IDX2BIG,	/* Index too large */
 	__BPF_LOADER_ERRNO__END,
 };
 
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 5909fd2825d5..697d3506c584 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2211,6 +2211,8 @@ void parse_events_terms__purge(struct list_head *terms)
 	struct parse_events_term *term, *h;
 
 	list_for_each_entry_safe(term, h, terms, list) {
+		if (term->array.nr_ranges)
+			free(term->array.ranges);
 		list_del_init(&term->list);
 		free(term);
 	}
@@ -2224,6 +2226,11 @@ void parse_events_terms__delete(struct list_head *terms)
 	free(terms);
 }
 
+void parse_events__clear_array(struct parse_events_array *a)
+{
+	free(a->ranges);
+}
+
 void parse_events_evlist_error(struct parse_events_evlist *data,
 			       int idx, const char *str)
 {
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index e0369695870f..e4456221f52d 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -72,8 +72,17 @@ enum {
 	__PARSE_EVENTS__TERM_TYPE_NR,
 };
 
+struct parse_events_array {
+	size_t nr_ranges;
+	struct {
+		unsigned int start;
+		size_t length;
+	} *ranges;
+};
+
 struct parse_events_term {
 	char *config;
+	struct parse_events_array array;
 	union {
 		char *str;
 		u64  num;
@@ -120,6 +129,7 @@ int parse_events_term__clone(struct parse_events_term **new,
 			     struct parse_events_term *term);
 void parse_events_terms__delete(struct list_head *terms);
 void parse_events_terms__purge(struct list_head *terms);
+void parse_events__clear_array(struct parse_events_array *a);
 int parse_events__modifier_event(struct list_head *list, char *str, bool add);
 int parse_events__modifier_group(struct list_head *list, char *event_mod);
 int parse_events_name(struct list_head *list, char *name);
-- 
2.5.0

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

* [PATCH 13/15] perf tools: Enable indices setting syntax for BPF map
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 12/15] perf tools: Support setting different slots in a BPF map separately Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:02 ` [PATCH 14/15] perf tools: Apply tracepoint event definition options to BPF script Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Kirill Smelkov, Li Zefan, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

This patch introduces a new syntax to perf event parser:

 # perf record -e './test_bpf_map_3.c/map:channel.value[0,1,2,3...5]=101/' usleep 2

By utilizing the basic facilities in bpf-loader.c which allow setting
different slots in a BPF map separately, the newly introduced syntax
allows perf to control specific elements in a BPF map.

Test result:

  # cat ./test_bpf_map_3.c
  /************************ BEGIN **************************/
  #include <uapi/linux/bpf.h>
  #define SEC(NAME) __attribute__((section(NAME), used))
  struct bpf_map_def {
	unsigned int type;
	unsigned int key_size;
	unsigned int value_size;
	unsigned int max_entries;
  };
  static void *(*map_lookup_elem)(struct bpf_map_def *, void *) =
 	(void *)BPF_FUNC_map_lookup_elem;
  static int (*trace_printk)(const char *fmt, int fmt_size, ...) =
 	(void *)BPF_FUNC_trace_printk;
  struct bpf_map_def SEC("maps") channel = {
 	.type = BPF_MAP_TYPE_ARRAY,
 	.key_size = sizeof(int),
 	.value_size = sizeof(unsigned char),
 	.max_entries = 100,
  };
  SEC("func=hrtimer_nanosleep rqtp->tv_nsec")
  int func(void *ctx, int err, long nsec)
  {
 	char fmt[] = "%ld\n";
 	long usec = nsec * 0x10624dd3 >> 38; // nsec / 1000
 	int key = (int)usec;
 	unsigned char *pval = map_lookup_elem(&channel, &key);

 	if (!pval)
 		return 0;
 	trace_printk(fmt, sizeof(fmt), (unsigned char)*pval);
 	return 0;
  }
  char _license[] SEC("license") = "GPL";
  int _version SEC("version") = LINUX_VERSION_CODE;
  /************************* END ***************************/

Normal case:

  # echo "" > /sys/kernel/debug/tracing/trace
  # ./perf record -e './test_bpf_map_3.c/map:channel.value[0,1,2,3...5]=101/' usleep 2
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data ]
  # cat /sys/kernel/debug/tracing/trace | grep usleep
            usleep-405   [004] d... 2745423.547822: : 101
  # ./perf record -e './test_bpf_map_3.c/map:channel.value[0...9,20...29]=102,map:channel.value[10...19]=103/' usleep 3
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data ]
  # ./perf record -e './test_bpf_map_3.c/map:channel.value[0...9,20...29]=102,map:channel.value[10...19]=103/' usleep 15
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data ]
  # cat /sys/kernel/debug/tracing/trace | grep usleep
            usleep-405   [004] d... 2745423.547822: : 101
            usleep-655   [006] d... 2745434.122814: : 102
            usleep-904   [006] d... 2745439.916264: : 103
  # ./perf record -e './test_bpf_map_3.c/map:channel.value[all]=104/' usleep 99
  # cat /sys/kernel/debug/tracing/trace | grep usleep
            usleep-405   [004] d... 2745423.547822: : 101
            usleep-655   [006] d... 2745434.122814: : 102
            usleep-904   [006] d... 2745439.916264: : 103
            usleep-1537  [003] d... 2745538.053737: : 104

Error case:

  # ./perf record -e './test_bpf_map_3.c/map:channel.value[10...1000]=104/' usleep 99
  event syntax error: '..annel.value[10...1000]=104/'
                                   \___ Index too large
  Hint:	Valid config terms:
      	map:[<arraymap>].value<indices>=[value]
      	map:[<eventmap>].event<indices>=[event]

      	where <indices> is something like [0,3...5] or [all]
      	(add -v to see detail)
  Run 'perf list' for a list of valid events

   Usage: perf record [<options>] [<command>]
      or: perf record [<options>] -- <command> [<options>]

      -e, --event <event>   event selector. use 'perf list' to list available events

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-9-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.c |  5 ++-
 tools/perf/util/parse-events.l | 13 ++++++-
 tools/perf/util/parse-events.y | 85 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 697d3506c584..6e2f20334379 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -704,9 +704,10 @@ parse_events_config_bpf(struct parse_events_evlist *data,
 						 sizeof(errbuf));
 			data->error->help = strdup(
 "Hint:\tValid config terms:\n"
-"     \tmap:[<arraymap>].value=[value]\n"
-"     \tmap:[<eventmap>].event=[event]\n"
+"     \tmap:[<arraymap>].value<indices>=[value]\n"
+"     \tmap:[<eventmap>].event<indices>=[event]\n"
 "\n"
+"     \twhere <indices> is something like [0,3...5] or [all]\n"
 "     \t(add -v to see detail)");
 			data->error->str = strdup(errbuf);
 			if (err == -BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE)
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 0cc6b84a740a..fb85d0311d28 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -9,8 +9,8 @@
 %{
 #include <errno.h>
 #include "../perf.h"
-#include "parse-events-bison.h"
 #include "parse-events.h"
+#include "parse-events-bison.h"
 
 char *parse_events_get_text(yyscan_t yyscanner);
 YYSTYPE *parse_events_get_lval(yyscan_t yyscanner);
@@ -111,6 +111,7 @@ do {							\
 %x mem
 %s config
 %x event
+%x array
 
 group		[^,{}/]*[{][^}]*[}][^,{}/]*
 event_pmu	[^,{}/]+[/][^/]*[/][^,{}/]*
@@ -176,6 +177,14 @@ modifier_bp	[rwx]{1,3}
 
 }
 
+<array>{
+"]"			{ BEGIN(config); return ']'; }
+{num_dec}		{ return value(yyscanner, 10); }
+{num_hex}		{ return value(yyscanner, 16); }
+,			{ return ','; }
+"\.\.\."		{ return PE_ARRAY_RANGE; }
+}
+
 <config>{
 	/*
 	 * Please update config_term_names when new static term is added.
@@ -195,6 +204,8 @@ no-inherit		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NOINHERIT); }
 ,			{ return ','; }
 "/"			{ BEGIN(INITIAL); return '/'; }
 {name_minus}		{ return str(yyscanner, PE_NAME); }
+\[all\]			{ return PE_ARRAY_ALL; }
+"["			{ BEGIN(array); return '['; }
 }
 
 <mem>{
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 0e2d433e4ffa..d1fbcabbe70d 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -48,6 +48,7 @@ static inc_group_count(struct list_head *list,
 %token PE_PREFIX_MEM PE_PREFIX_RAW PE_PREFIX_GROUP
 %token PE_ERROR
 %token PE_PMU_EVENT_PRE PE_PMU_EVENT_SUF PE_KERNEL_PMU_EVENT
+%token PE_ARRAY_ALL PE_ARRAY_RANGE
 %type <num> PE_VALUE
 %type <num> PE_VALUE_SYM_HW
 %type <num> PE_VALUE_SYM_SW
@@ -83,6 +84,9 @@ static inc_group_count(struct list_head *list,
 %type <head> group_def
 %type <head> group
 %type <head> groups
+%type <array> array
+%type <array> array_term
+%type <array> array_terms
 
 %union
 {
@@ -94,6 +98,7 @@ static inc_group_count(struct list_head *list,
 		char *sys;
 		char *event;
 	} tracepoint_name;
+	struct parse_events_array array;
 }
 %%
 
@@ -572,6 +577,86 @@ PE_TERM
 	ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, 1, &@1, NULL));
 	$$ = term;
 }
+|
+PE_NAME array '=' PE_NAME
+{
+	struct parse_events_term *term;
+	int i;
+
+	ABORT_ON(parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER,
+					$1, $4, &@1, &@4));
+
+	term->array = $2;
+	$$ = term;
+}
+|
+PE_NAME array '=' PE_VALUE
+{
+	struct parse_events_term *term;
+
+	ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
+					$1, $4, &@1, &@4));
+	term->array = $2;
+	$$ = term;
+}
+
+array:
+'[' array_terms ']'
+{
+	$$ = $2;
+}
+|
+PE_ARRAY_ALL
+{
+	$$.nr_ranges = 0;
+	$$.ranges = NULL;
+}
+
+array_terms:
+array_terms ',' array_term
+{
+	struct parse_events_array new_array;
+
+	new_array.nr_ranges = $1.nr_ranges + $3.nr_ranges;
+	new_array.ranges = malloc(sizeof(new_array.ranges[0]) *
+				  new_array.nr_ranges);
+	ABORT_ON(!new_array.ranges);
+	memcpy(&new_array.ranges[0], $1.ranges,
+	       $1.nr_ranges * sizeof(new_array.ranges[0]));
+	memcpy(&new_array.ranges[$1.nr_ranges], $3.ranges,
+	       $3.nr_ranges * sizeof(new_array.ranges[0]));
+	free($1.ranges);
+	free($3.ranges);
+	$$ = new_array;
+}
+|
+array_term
+
+array_term:
+PE_VALUE
+{
+	struct parse_events_array array;
+
+	array.nr_ranges = 1;
+	array.ranges = malloc(sizeof(array.ranges[0]));
+	ABORT_ON(!array.ranges);
+	array.ranges[0].start = $1;
+	array.ranges[0].length = 1;
+	$$ = array;
+}
+|
+PE_VALUE PE_ARRAY_RANGE PE_VALUE
+{
+	struct parse_events_array array;
+
+	ABORT_ON($3 < $1);
+	array.nr_ranges = 1;
+	array.ranges = malloc(sizeof(array.ranges[0]));
+	ABORT_ON(!array.ranges);
+	array.ranges[0].start = $1;
+	array.ranges[0].length = $3 - $1 + 1;
+	$$ = array;
+}
 
 sep_dc: ':' |
 
-- 
2.5.0

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

* [PATCH 14/15] perf tools: Apply tracepoint event definition options to BPF script
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 13/15] perf tools: Enable indices setting syntax for BPF map Arnaldo Carvalho de Melo
@ 2016-02-22 18:02 ` Arnaldo Carvalho de Melo
  2016-02-22 18:03 ` [PATCH 15/15] perf tools: Introduce bpf-output event Arnaldo Carvalho de Melo
  2016-02-24  7:21 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Jiri Olsa, Kirill Smelkov, Li Zefan, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

Users can pass options to tracepoints defined in the BPF script.  For
example:

  # perf record -e ./test.c/no-inherit/ bash
  # dd if=/dev/zero of=/dev/null count=10000
  # exit
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.022 MB perf.data (139 samples) ]

  (no-inherit works, only the sys_read issued by bash are captured, at
   least 10000 sys_read issued by dd are skipped.)

test.c:

  #define SEC(NAME) __attribute__((section(NAME), used))
  SEC("func=sys_read")
  int bpf_func__sys_read(void *ctx)
  {
      return 1;
  }
  char _license[] SEC("license") = "GPL";
  int _version SEC("version") = LINUX_VERSION_CODE;

no-inherit is applied to the kprobe event defined in test.c.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-10-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/bpf.c         |  2 +-
 tools/perf/util/parse-events.c | 56 +++++++++++++++++++++++++++++++++++++-----
 tools/perf/util/parse-events.h |  3 ++-
 3 files changed, 53 insertions(+), 8 deletions(-)

diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 4aed5cb4ac2d..199501c71e27 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -112,7 +112,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	parse_evlist.error = &parse_error;
 	INIT_LIST_HEAD(&parse_evlist.list);
 
-	err = parse_events_load_bpf_obj(&parse_evlist, &parse_evlist.list, obj);
+	err = parse_events_load_bpf_obj(&parse_evlist, &parse_evlist.list, obj, NULL);
 	if (err || list_empty(&parse_evlist.list)) {
 		pr_debug("Failed to add events selected by BPF\n");
 		return TEST_FAIL;
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 6e2f20334379..4c19d5e79d8c 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -581,6 +581,7 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx,
 struct __add_bpf_event_param {
 	struct parse_events_evlist *data;
 	struct list_head *list;
+	struct list_head *head_config;
 };
 
 static int add_bpf_event(struct probe_trace_event *tev, int fd,
@@ -597,7 +598,8 @@ static int add_bpf_event(struct probe_trace_event *tev, int fd,
 		 tev->group, tev->event, fd);
 
 	err = parse_events_add_tracepoint(&new_evsels, &evlist->idx, tev->group,
-					  tev->event, evlist->error, NULL);
+					  tev->event, evlist->error,
+					  param->head_config);
 	if (err) {
 		struct perf_evsel *evsel, *tmp;
 
@@ -622,11 +624,12 @@ static int add_bpf_event(struct probe_trace_event *tev, int fd,
 
 int parse_events_load_bpf_obj(struct parse_events_evlist *data,
 			      struct list_head *list,
-			      struct bpf_object *obj)
+			      struct bpf_object *obj,
+			      struct list_head *head_config)
 {
 	int err;
 	char errbuf[BUFSIZ];
-	struct __add_bpf_event_param param = {data, list};
+	struct __add_bpf_event_param param = {data, list, head_config};
 	static bool registered_unprobe_atexit = false;
 
 	if (IS_ERR(obj) || !obj) {
@@ -720,14 +723,47 @@ parse_events_config_bpf(struct parse_events_evlist *data,
 	return 0;
 }
 
+/*
+ * Split config terms:
+ * perf record -e bpf.c/call-graph=fp,map:array.value[0]=1/ ...
+ *  'call-graph=fp' is 'evt config', should be applied to each
+ *  events in bpf.c.
+ * 'map:array.value[0]=1' is 'obj config', should be processed
+ * with parse_events_config_bpf.
+ *
+ * Move object config terms from the first list to obj_head_config.
+ */
+static void
+split_bpf_config_terms(struct list_head *evt_head_config,
+		       struct list_head *obj_head_config)
+{
+	struct parse_events_term *term, *temp;
+
+	/*
+	 * Currectly, all possible user config term
+	 * belong to bpf object. parse_events__is_hardcoded_term()
+	 * happends to be a good flag.
+	 *
+	 * See parse_events_config_bpf() and
+	 * config_term_tracepoint().
+	 */
+	list_for_each_entry_safe(term, temp, evt_head_config, list)
+		if (!parse_events__is_hardcoded_term(term))
+			list_move_tail(&term->list, obj_head_config);
+}
+
 int parse_events_load_bpf(struct parse_events_evlist *data,
 			  struct list_head *list,
 			  char *bpf_file_name,
 			  bool source,
 			  struct list_head *head_config)
 {
-	struct bpf_object *obj;
 	int err;
+	struct bpf_object *obj;
+	LIST_HEAD(obj_head_config);
+
+	if (head_config)
+		split_bpf_config_terms(head_config, &obj_head_config);
 
 	obj = bpf__prepare_load(bpf_file_name, source);
 	if (IS_ERR(obj)) {
@@ -749,10 +785,18 @@ int parse_events_load_bpf(struct parse_events_evlist *data,
 		return err;
 	}
 
-	err = parse_events_load_bpf_obj(data, list, obj);
+	err = parse_events_load_bpf_obj(data, list, obj, head_config);
 	if (err)
 		return err;
-	return parse_events_config_bpf(data, obj, head_config);
+	err = parse_events_config_bpf(data, obj, &obj_head_config);
+
+	/*
+	 * Caller doesn't know anything about obj_head_config,
+	 * so combine them together again before returnning.
+	 */
+	if (head_config)
+		list_splice_tail(&obj_head_config, head_config);
+	return err;
 }
 
 static int
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index e4456221f52d..67e493088e81 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -146,7 +146,8 @@ int parse_events_load_bpf(struct parse_events_evlist *data,
 struct bpf_object;
 int parse_events_load_bpf_obj(struct parse_events_evlist *data,
 			      struct list_head *list,
-			      struct bpf_object *obj);
+			      struct bpf_object *obj,
+			      struct list_head *head_config);
 int parse_events_add_numeric(struct parse_events_evlist *data,
 			     struct list_head *list,
 			     u32 type, u64 config,
-- 
2.5.0

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

* [PATCH 15/15] perf tools: Introduce bpf-output event
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2016-02-22 18:02 ` [PATCH 14/15] perf tools: Apply tracepoint event definition options to BPF script Arnaldo Carvalho de Melo
@ 2016-02-22 18:03 ` Arnaldo Carvalho de Melo
  2016-02-24  7:21 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar
  15 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-22 18:03 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Wang Nan, Adrian Hunter, Alexei Starovoitov,
	Brendan Gregg, Cody P Schafer, He Kuang, Jeremie Galarneau,
	Jiri Olsa, Kirill Smelkov, Li Zefan, Masami Hiramatsu,
	Namhyung Kim, Peter Zijlstra, pi3orama, Arnaldo Carvalho de Melo

From: Wang Nan <wangnan0@huawei.com>

Commit a43eec304259 ("bpf: introduce bpf_perf_event_output() helper")
adds a helper to enable a BPF program to output data to a perf ring
buffer through a new type of perf event, PERF_COUNT_SW_BPF_OUTPUT. This
patch enables perf to create events of that type. Now a perf user can
use the following cmdline to receive output data from BPF programs:

  # perf record -a -e bpf-output/no-inherit,name=evt/ \
                    -e ./test_bpf_output.c/map:channel.event=evt/ ls /
  # perf script
     perf 1560 [004] 347747.086295:  evt: ffffffff811fd201 sys_write ...
     perf 1560 [004] 347747.086300:  evt: ffffffff811fd201 sys_write ...
     perf 1560 [004] 347747.086315:  evt: ffffffff811fd201 sys_write ...
            ...

Test result:

  # cat test_bpf_output.c
  /************************ BEGIN **************************/
  #include <uapi/linux/bpf.h>
  struct bpf_map_def {
 	unsigned int type;
 	unsigned int key_size;
 	unsigned int value_size;
 	unsigned int max_entries;
  };

  #define SEC(NAME) __attribute__((section(NAME), used))
  static u64 (*ktime_get_ns)(void) =
 	(void *)BPF_FUNC_ktime_get_ns;
  static int (*trace_printk)(const char *fmt, int fmt_size, ...) =
 	(void *)BPF_FUNC_trace_printk;
  static int (*get_smp_processor_id)(void) =
 	(void *)BPF_FUNC_get_smp_processor_id;
  static int (*perf_event_output)(void *, struct bpf_map_def *, int, void *, unsigned long) =
 	(void *)BPF_FUNC_perf_event_output;

  struct bpf_map_def SEC("maps") channel = {
 	.type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
 	.key_size = sizeof(int),
 	.value_size = sizeof(u32),
 	.max_entries = __NR_CPUS__,
  };

  SEC("func_write=sys_write")
  int func_write(void *ctx)
  {
 	struct {
 		u64 ktime;
 		int cpuid;
 	} __attribute__((packed)) output_data;
 	char error_data[] = "Error: failed to output: %d\n";

 	output_data.cpuid = get_smp_processor_id();
 	output_data.ktime = ktime_get_ns();
 	int err = perf_event_output(ctx, &channel, get_smp_processor_id(),
 				    &output_data, sizeof(output_data));
 	if (err)
 		trace_printk(error_data, sizeof(error_data), err);
 	return 0;
  }
  char _license[] SEC("license") = "GPL";
  int _version SEC("version") = LINUX_VERSION_CODE;
  /************************ END ***************************/

  # perf record -a -e bpf-output/no-inherit,name=evt/ \
                    -e ./test_bpf_output.c/map:channel.event=evt/ ls /
  # perf script | grep ls
     ls  2242 [003] 347851.557563:   evt: ffffffff811fd201 sys_write ...
     ls  2242 [003] 347851.557571:   evt: ffffffff811fd201 sys_write ...

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cody P Schafer <dev@codyps.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kirill Smelkov <kirr@nexedi.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456132275-98875-11-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/bpf-loader.c   | 5 ++---
 tools/perf/util/evsel.c        | 5 +++++
 tools/perf/util/evsel.h        | 8 ++++++++
 tools/perf/util/parse-events.l | 1 +
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 44824e3eeaed..0967ce601931 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -1331,13 +1331,12 @@ apply_config_evsel_for_key(const char *name, int map_fd, void *pkey,
 		return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH;
 	}
 
+	if (perf_evsel__is_bpf_output(evsel))
+		check_pass = true;
 	if (attr->type == PERF_TYPE_RAW)
 		check_pass = true;
 	if (attr->type == PERF_TYPE_HARDWARE)
 		check_pass = true;
-	if (attr->type == PERF_TYPE_SOFTWARE &&
-			attr->config == PERF_COUNT_SW_BPF_OUTPUT)
-		check_pass = true;
 	if (!check_pass) {
 		pr_debug("ERROR: Event type is wrong for map %s\n", name);
 		return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 6ae20d0056de..0902fe418754 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -225,6 +225,11 @@ struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
 	if (evsel != NULL)
 		perf_evsel__init(evsel, attr, idx);
 
+	if (perf_evsel__is_bpf_output(evsel)) {
+		evsel->attr.sample_type |= PERF_SAMPLE_RAW;
+		evsel->attr.sample_period = 1;
+	}
+
 	return evsel;
 }
 
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 8e75434bd01c..efad78f811ad 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -364,6 +364,14 @@ static inline bool perf_evsel__is_function_event(struct perf_evsel *evsel)
 #undef FUNCTION_EVENT
 }
 
+static inline bool perf_evsel__is_bpf_output(struct perf_evsel *evsel)
+{
+	struct perf_event_attr *attr = &evsel->attr;
+
+	return (attr->config == PERF_COUNT_SW_BPF_OUTPUT) &&
+		(attr->type == PERF_TYPE_SOFTWARE);
+}
+
 struct perf_attr_details {
 	bool freq;
 	bool verbose;
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index fb85d0311d28..1477fbc78993 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -248,6 +248,7 @@ cpu-migrations|migrations			{ return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COU
 alignment-faults				{ return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_ALIGNMENT_FAULTS); }
 emulation-faults				{ return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_EMULATION_FAULTS); }
 dummy						{ return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_DUMMY); }
+bpf-output					{ return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_BPF_OUTPUT); }
 
 	/*
 	 * We have to handle the kernel PMU event cycles-ct/cycles-t/mem-loads/mem-stores separately.
-- 
2.5.0

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2016-02-22 18:03 ` [PATCH 15/15] perf tools: Introduce bpf-output event Arnaldo Carvalho de Melo
@ 2016-02-24  7:21 ` Ingo Molnar
  15 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2016-02-24  7:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Andi Kleen,
	Brendan Gregg, Cody P Schafer, David Ahern, He Kuang,
	Jeremie Galarneau, Jiri Olsa, Kirill Smelkov, Li Zefan,
	Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama,
	Wang Nan, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 91e48b7df15196b8ce01f40455219d3ed7889988:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-20 11:52:16 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 03e0a7df3efd959e40cd7ff40b1fabddc234ec5a:
> 
>   perf tools: Introduce bpf-output event (2016-02-22 14:37:21 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Add API to set values of map entries in a BPF object, be it
>   individual map slots or ranges (Wang Nan)
> 
> - Introduce support for the 'bpf-output' event (Wang Nan)
> 
> - Add glue to read perf events in a BPF program (Wang Nan)
> 
> Fixes:
> 
> - Sort key fixes: Alignment for srcline, file, trace; fix
>   segfault for dynamic, trace events related sort keys (Namyung Kim)
> 
> Build fixes:
> 
> - Remove duplicate typedef config_term_func_t definition,
>   fixing the build on older systems (Arnaldo Carvalho de Melo)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf tools: Fix build on older systems
>       perf tools: Remove duplicate typedef config_term_func_t definition
> 
> Namhyung Kim (5):
>       perf tools: Fix segfault on dynamic entries
>       perf tools: Update srcline/file if needed
>       perf tools: Fix alignment on some sort keys
>       perf tools: Fix column width setting on 'trace' sort key
>       perf tools: Fix assertion failure on dynamic entry
> 
> Wang Nan (8):
>       perf bpf: Add API to set values to map entries in a bpf object
>       perf tools: Enable BPF object configure syntax
>       perf record: Apply config to BPF objects before recording
>       perf tools: Enable passing event to BPF object
>       perf tools: Support setting different slots in a BPF map separately
>       perf tools: Enable indices setting syntax for BPF map
>       perf tools: Apply tracepoint event definition options to BPF script
>       perf tools: Introduce bpf-output event
> 
>  tools/perf/builtin-record.c    |  11 +
>  tools/perf/tests/bpf.c         |   2 +-
>  tools/perf/ui/hist.c           |   3 +
>  tools/perf/util/bpf-loader.c   | 718 +++++++++++++++++++++++++++++++++++++++++
>  tools/perf/util/bpf-loader.h   |  59 ++++
>  tools/perf/util/evlist.c       |  16 +
>  tools/perf/util/evlist.h       |   3 +
>  tools/perf/util/evsel.c        |   5 +
>  tools/perf/util/evsel.h        |   8 +
>  tools/perf/util/hist.c         |   3 +
>  tools/perf/util/parse-events.c | 130 +++++++-
>  tools/perf/util/parse-events.h |  17 +-
>  tools/perf/util/parse-events.l |  16 +-
>  tools/perf/util/parse-events.y |  95 +++++-
>  tools/perf/util/sort.c         |  90 +++---
>  15 files changed, 1112 insertions(+), 64 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2017-08-23 19:35 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-08-23 19:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Andi Kleen, Borislav Petkov, Jiri Olsa,
	Konstantin Khlebnikov, Peter Zijlstra, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit ba63f76e22ee723819c8cec86b31f7ea3182b2ed:

  Merge tag 'perf-core-for-mingo-4.14-20170821' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-22 12:16:39 +0200)

are available in the git repository at:

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

for you to fetch changes up to 60913e005c8d19ec5187a638eafdd088509dfb9e:

  perf tools: Fix static linking with libunwind (2017-08-22 13:24:55 -0300)

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

- Expression parser enhancements for metrics (Andi Kleen)

- Fix buffer overflow while freeing events in 'perf stat' (Andi Kleen)

- Fix static linking with elfutils's libdf and with libunwind
  in Debian/Ubuntu (Konstantin Khlebnikov)

- Tighten detection of BPF events, avoiding matching some other PMU
  events such as 'cpu/uops_executed.core,cmask=1/' as a .c source
  file that ended up being considered a BPF event (Andi Kleen)

- Add Skylake server uncore JSON vendor events (Andi Kleen)

- Add support for printing new mem_info encodings, including
  'perf test' checks (Andi Kleen)

- Really install manpages via 'make install-man' (Konstantin Khlebnikov)

- Fix documentation for perf_event_paranoid and perf_event_mlock_kb
  sysctls (Konstantin Khlebnikov)

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

----------------------------------------------------------------
Andi Kleen (11):
      perf xyarray: Save max_x, max_y
      perf evsel: Fix buffer overflow while freeing events
      perf bpf: Tighten detection of BPF events
      perf tools: Add utility function to detect SMT status
      perf tools: Expression parser enhancements for metrics
      perf tools: Increase maximum number of events in expressions
      perf tools: Dedup events in expression parsing
      perf vendor events: Add core event list for Skylake Server
      perf vendor events: Add Skylake server uncore event list
      perf tools: Add support for printing new mem_info encodings
      perf test: Add test cases for new data source encoding

Konstantin Khlebnikov (4):
      perf tools: Really install manpages via 'make install-man'
      perf: Fix documentation for sysctls perf_event_paranoid and perf_event_mlock_kb
      perf tools: Fix static linking with libdw from elfutils
      perf tools: Fix static linking with libunwind

 Documentation/sysctl/kernel.txt                    |   13 +-
 tools/include/uapi/linux/perf_event.h              |   30 +-
 tools/perf/Documentation/Makefile                  |    2 +-
 tools/perf/Makefile.config                         |   16 +-
 tools/perf/pmu-events/arch/x86/mapfile.csv         |    1 +
 tools/perf/pmu-events/arch/x86/skylakex/cache.json | 1672 ++++++++++++++++++++
 .../arch/x86/skylakex/floating-point.json          |   88 ++
 .../pmu-events/arch/x86/skylakex/frontend.json     |  482 ++++++
 .../perf/pmu-events/arch/x86/skylakex/memory.json  | 1396 ++++++++++++++++
 tools/perf/pmu-events/arch/x86/skylakex/other.json |   72 +
 .../pmu-events/arch/x86/skylakex/pipeline.json     |  950 +++++++++++
 .../arch/x86/skylakex/uncore-memory.json           |  172 ++
 .../pmu-events/arch/x86/skylakex/uncore-other.json | 1156 ++++++++++++++
 .../arch/x86/skylakex/virtual-memory.json          |  284 ++++
 tools/perf/tests/Build                             |    1 +
 tools/perf/tests/builtin-test.c                    |    4 +
 tools/perf/tests/expr.c                            |    5 +
 tools/perf/tests/mem.c                             |   56 +
 tools/perf/tests/openat-syscall-all-cpus.c         |    2 +-
 tools/perf/tests/openat-syscall.c                  |    2 +-
 tools/perf/tests/tests.h                           |    1 +
 tools/perf/util/Build                              |    1 +
 tools/perf/util/evlist.c                           |   12 +-
 tools/perf/util/evsel.c                            |   41 +-
 tools/perf/util/evsel.h                            |    7 +-
 tools/perf/util/expr.h                             |    2 +-
 tools/perf/util/expr.y                             |   74 +-
 tools/perf/util/mem-events.c                       |   43 +-
 tools/perf/util/parse-events.l                     |   23 +-
 tools/perf/util/smt.c                              |   44 +
 tools/perf/util/smt.h                              |    6 +
 tools/perf/util/xyarray.c                          |    2 +
 tools/perf/util/xyarray.h                          |   12 +
 33 files changed, 6607 insertions(+), 65 deletions(-)
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/cache.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/floating-point.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/frontend.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/memory.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/other.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/pipeline.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/uncore-memory.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/uncore-other.json
 create mode 100644 tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json
 create mode 100644 tools/perf/tests/mem.c
 create mode 100644 tools/perf/util/smt.c
 create mode 100644 tools/perf/util/smt.h

Test results:

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

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

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

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

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

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

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

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

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

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2017-07-28 20:00 Arnaldo Carvalho de Melo
@ 2017-07-30  9:31 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2017-07-30  9:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, linux-perf-users, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, David Ahern,
	David Carrillo-Cisneros, Francis Deslauriers,
	Geneviève Bastien, Jiri Olsa, Julien Desfossez,
	Martin Liška, Mathieu Desnoyers, Milian Wolff, Namhyung Kim,
	Paul Turner, Peter Zijlstra, Simon Que, Stephane Eranian,
	Taeung Song, Wang Nan, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit ee438ec8f33c5af0d4a4ffb935c5b9272e8c2680:
> 
>   Merge tag 'perf-core-for-mingo-4.14-20170725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-07-26 19:07:30 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.14-20170728
> 
> for you to fetch changes up to 6b7007af728df7258bb60ed73099be3b59b3030e:
> 
>   perf data: Add doc when no conversion support compiled (2017-07-28 16:30:45 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes for 4.14:
> 
> New features:
> 
> - Add PERF_SAMPLE_CALLCHAIN and PERF_RECORD_MMAP[2] to 'perf data' CTF
>   conversion, allowing CTF trace visualization tools to show callchains
>   and to resolve symbols (Geneviève Bastien)
> 
> Improvements:
> 
> - Use group read for event groups in 'perf stat', reducing overhead when
>   groups are defined in the event specification, i.e. when using {} to
>   enclose a list of events, asking them to be read at the same time,
>   e.g.: "perf stat -e '{cycles,instructions}'" (Jiri Olsa)
> 
> Fixes:
> 
> - Do not overwrite perf_sample->weight in 'perf annotate' when
>   processing samples, use whatever came from the kernel when
>   perf_event_attr.sample_type has PERF_SAMPLE_WEIGHT set or just handle
>   its default value, 0, when that is not set and "weight" is one of the
>   sort orders chosen (Arnaldo Carvalho de Melo)
> 
> - 'perf annotate --show-total-period' fixes:
>    - TUI should show period, not nr_samples
>    - Set appropriate column width for period/percent
>    - Fix the column header to show "Period" when when that is what
>      is being asked for
>   (Taeung Song, Arnaldo Carvalho de Melo)
> 
> - Use default sort if evlist is empty, fixing pipe mode (David Carrillo-Cisneros)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (6):
>       perf annotate: Do not overwrite perf_sample->weight
>       perf annotate stdio: Set enough columns for --show-total-period
>       perf annotate: Fix storing per line sym_hist_entry
>       perf annotate TUI: Use sym_hist_entry in disasm_line_samples
>       perf annotate TUI: Clarify calculation of column header widths
>       perf annotate TUI: Set appropriate column width for period/percent
> 
> David Carrillo-Cisneros (1):
>       perf sort: Use default sort if evlist is empty
> 
> Geneviève Bastien (3):
>       perf data: Add callchain to CTF conversion
>       perf data: Add mmap[2] events to CTF conversion
>       perf data: Add doc when no conversion support compiled
> 
> Jiri Olsa (3):
>       perf tools: Add perf_evsel__read_size function
>       perf evsel: Add read_counter()
>       perf stat: Use group read for event groups
> 
> Taeung Song (2):
>       perf annotate TUI: Fix --show-total-period
>       perf annotate TUI: Fix column header when toggling period/percent
> 
>  tools/perf/builtin-annotate.c     |   2 -
>  tools/perf/builtin-data.c         |   2 +-
>  tools/perf/builtin-stat.c         |  30 +++++++-
>  tools/perf/ui/browsers/annotate.c |  36 +++++-----
>  tools/perf/util/annotate.c        |  11 +--
>  tools/perf/util/counts.h          |   1 +
>  tools/perf/util/data-convert-bt.c | 127 +++++++++++++++++++++++++++++++++-
>  tools/perf/util/evlist.h          |   5 ++
>  tools/perf/util/evsel.c           | 139 +++++++++++++++++++++++++++++++++++++-
>  tools/perf/util/evsel.h           |   2 +
>  tools/perf/util/sort.c            |   2 +-
>  tools/perf/util/stat.c            |   4 ++
>  tools/perf/util/stat.h            |   5 +-
>  13 files changed, 334 insertions(+), 32 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2017-07-28 20:00 Arnaldo Carvalho de Melo
  2017-07-30  9:31 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-07-28 20:00 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen, David Ahern,
	David Carrillo-Cisneros, Francis Deslauriers,
	Geneviève Bastien, Jiri Olsa, Julien Desfossez,
	Martin Liška, Mathieu Desnoyers, Milian Wolff, Namhyung Kim,
	Paul Turner, Peter Zijlstra, Simon Que, Stephane Eranian,
	Taeung Song, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit ee438ec8f33c5af0d4a4ffb935c5b9272e8c2680:

  Merge tag 'perf-core-for-mingo-4.14-20170725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-07-26 19:07:30 +0200)

are available in the git repository at:

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

for you to fetch changes up to 6b7007af728df7258bb60ed73099be3b59b3030e:

  perf data: Add doc when no conversion support compiled (2017-07-28 16:30:45 -0300)

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

New features:

- Add PERF_SAMPLE_CALLCHAIN and PERF_RECORD_MMAP[2] to 'perf data' CTF
  conversion, allowing CTF trace visualization tools to show callchains
  and to resolve symbols (Geneviève Bastien)

Improvements:

- Use group read for event groups in 'perf stat', reducing overhead when
  groups are defined in the event specification, i.e. when using {} to
  enclose a list of events, asking them to be read at the same time,
  e.g.: "perf stat -e '{cycles,instructions}'" (Jiri Olsa)

Fixes:

- Do not overwrite perf_sample->weight in 'perf annotate' when
  processing samples, use whatever came from the kernel when
  perf_event_attr.sample_type has PERF_SAMPLE_WEIGHT set or just handle
  its default value, 0, when that is not set and "weight" is one of the
  sort orders chosen (Arnaldo Carvalho de Melo)

- 'perf annotate --show-total-period' fixes:
   - TUI should show period, not nr_samples
   - Set appropriate column width for period/percent
   - Fix the column header to show "Period" when when that is what
     is being asked for
  (Taeung Song, Arnaldo Carvalho de Melo)

- Use default sort if evlist is empty, fixing pipe mode (David Carrillo-Cisneros)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (6):
      perf annotate: Do not overwrite perf_sample->weight
      perf annotate stdio: Set enough columns for --show-total-period
      perf annotate: Fix storing per line sym_hist_entry
      perf annotate TUI: Use sym_hist_entry in disasm_line_samples
      perf annotate TUI: Clarify calculation of column header widths
      perf annotate TUI: Set appropriate column width for period/percent

David Carrillo-Cisneros (1):
      perf sort: Use default sort if evlist is empty

Geneviève Bastien (3):
      perf data: Add callchain to CTF conversion
      perf data: Add mmap[2] events to CTF conversion
      perf data: Add doc when no conversion support compiled

Jiri Olsa (3):
      perf tools: Add perf_evsel__read_size function
      perf evsel: Add read_counter()
      perf stat: Use group read for event groups

Taeung Song (2):
      perf annotate TUI: Fix --show-total-period
      perf annotate TUI: Fix column header when toggling period/percent

 tools/perf/builtin-annotate.c     |   2 -
 tools/perf/builtin-data.c         |   2 +-
 tools/perf/builtin-stat.c         |  30 +++++++-
 tools/perf/ui/browsers/annotate.c |  36 +++++-----
 tools/perf/util/annotate.c        |  11 +--
 tools/perf/util/counts.h          |   1 +
 tools/perf/util/data-convert-bt.c | 127 +++++++++++++++++++++++++++++++++-
 tools/perf/util/evlist.h          |   5 ++
 tools/perf/util/evsel.c           | 139 +++++++++++++++++++++++++++++++++++++-
 tools/perf/util/evsel.h           |   2 +
 tools/perf/util/sort.c            |   2 +-
 tools/perf/util/stat.c            |   4 ++
 tools/perf/util/stat.h            |   5 +-
 13 files changed, 334 insertions(+), 32 deletions(-)

Test results:

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

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

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

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

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

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

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

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2017-02-14  1:13 Arnaldo Carvalho de Melo
@ 2017-02-14  6:31 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2017-02-14  6:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Clark Williams,
	Daniel Borkmann, David Ahern, David S . Miller, Jiri Olsa,
	Joe Perches, Joe Stringer, Mickaël Salaün,
	Namhyung Kim, netdev, Peter Zijlstra, Steven Rostedt,
	Taeung Song, Wang Nan, Wang YanQing, linux-perf-users,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit f2029b1e47b607619d1dd2cb0bbb77f64ec6b7c2:
> 
>   perf/x86/intel: Add Kaby Lake support (2017-02-11 21:28:23 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.11-20170213
> 
> for you to fetch changes up to a734fb5d60067a73dd7099a58756847c07f9cd68:
> 
>   samples/bpf: Reset global variables (2017-02-13 17:22:53 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New feature:
> 
> - Introduce the 'delta-abs' 'perf diff' compute method, that orders the
>   histogram entries by the absolute value of the percentage delta for a
>   function in two perf.data files, i.e. the functions that changed the
>   most (increase or decrease in samples) comes first (Namhyung Kim)
> 
> User visible:
> 
> - Improve message about tweaking the kernel.perf_event_paranoid setting,
>   telling how to make the change permanent by editing /etc/sysctl.conf
>   (Ingo Molnar)
> 
> Infrastructure:
> 
> - Introduce linux/compiler-gcc.h as a counterpart to the kernel's,
>   initially containing the definition of __fallthrough, more to
>   come (__maybe_unused, etc) (Arnaldo Carvalho de Melo)
> 
> - Fixes for problems uncovered by building tools/perf with clang, such
>   as always true tests of arrays against NULL and variables that sometimes
>   were used without being initialized (Arnaldo Carvalho de Melo, Steven Rostedt)
> 
> - Before loading a new ELF, clear global variables set by the
>   samples/bpf loader (Mickaël Salaün)
> 
> - Ignore already processed ELF sections in the samples/bpf
>   loader (Mickaël Salaün)
> 
> - Fix compile error in the scripting code with some perl5
>   versions (Wang YanQing)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (6):
>       tools include: Introduce linux/compiler-gcc.h
>       tools lib traceevent plugin function: Initialize 'index' variable
>       perf evsel: Inform how to make a sysctl setting permanent
>       perf symbols: No need to check if sym->name is NULL
>       perf tests record: No need to test an array against NULL
>       perf symbols: dso->name is an array, no need to check it against NULL
> 
> Mickaël Salaün (3):
>       samples/bpf: Add missing header
>       samples/bpf: Ignore already processed ELF sections
>       samples/bpf: Reset global variables
> 
> Namhyung Kim (4):
>       perf diff: Add 'delta-abs' compute method
>       perf diff: Add diff.order config option
>       perf diff: Add diff.compute config option
>       perf diff: Change default setting to "delta-abs"
> 
> Steven Rostedt (VMware) (1):
>       tools lib traceevent: Initialize lenght on OLD_RING_BUFFER_TYPE_TIME_STAMP
> 
> Wang YanQing (1):
>       perf scripting perl: Fix compile error with some perl5 versions
> 
>  samples/bpf/bpf_load.c                             |  7 ++
>  samples/bpf/tracex5_kern.c                         |  1 +
>  tools/include/linux/compiler-gcc.h                 | 14 ++++
>  tools/include/linux/compiler.h                     | 10 +--
>  tools/lib/traceevent/kbuffer-parse.c               |  1 +
>  tools/lib/traceevent/plugin_function.c             |  2 +-
>  tools/perf/Documentation/perf-config.txt           | 12 ++++
>  tools/perf/Documentation/perf-diff.txt             | 15 ++++-
>  tools/perf/MANIFEST                                |  1 +
>  tools/perf/builtin-diff.c                          | 78 ++++++++++++++++++++--
>  tools/perf/builtin-kmem.c                          |  4 +-
>  tools/perf/builtin-record.c                        |  2 +-
>  tools/perf/builtin-sched.c                         |  2 +-
>  tools/perf/builtin-stat.c                          |  2 +-
>  tools/perf/builtin-top.c                           |  2 +-
>  tools/perf/tests/perf-record.c                     |  2 +-
>  tools/perf/util/evsel.c                            |  4 +-
>  tools/perf/util/evsel_fprintf.c                    |  1 -
>  tools/perf/util/machine.c                          |  2 +-
>  tools/perf/util/map.c                              |  4 +-
>  tools/perf/util/scripting-engines/Build            |  2 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |  4 +-
>  tools/perf/util/symbol_fprintf.c                   |  2 +-
>  23 files changed, 145 insertions(+), 29 deletions(-)
>  create mode 100644 tools/include/linux/compiler-gcc.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2017-02-14  1:13 Arnaldo Carvalho de Melo
  2017-02-14  6:31 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-02-14  1:13 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, Clark Williams, Daniel Borkmann, David Ahern,
	David S . Miller, Jiri Olsa, Joe Perches, Joe Stringer,
	Mickaël Salaün, Namhyung Kim, netdev, Peter Zijlstra,
	Steven Rostedt, Taeung Song, Wang Nan, Wang YanQing,
	linux-perf-users, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

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

The following changes since commit f2029b1e47b607619d1dd2cb0bbb77f64ec6b7c2:

  perf/x86/intel: Add Kaby Lake support (2017-02-11 21:28:23 +0100)

are available in the git repository at:

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

for you to fetch changes up to a734fb5d60067a73dd7099a58756847c07f9cd68:

  samples/bpf: Reset global variables (2017-02-13 17:22:53 -0300)

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

New feature:

- Introduce the 'delta-abs' 'perf diff' compute method, that orders the
  histogram entries by the absolute value of the percentage delta for a
  function in two perf.data files, i.e. the functions that changed the
  most (increase or decrease in samples) comes first (Namhyung Kim)

User visible:

- Improve message about tweaking the kernel.perf_event_paranoid setting,
  telling how to make the change permanent by editing /etc/sysctl.conf
  (Ingo Molnar)

Infrastructure:

- Introduce linux/compiler-gcc.h as a counterpart to the kernel's,
  initially containing the definition of __fallthrough, more to
  come (__maybe_unused, etc) (Arnaldo Carvalho de Melo)

- Fixes for problems uncovered by building tools/perf with clang, such
  as always true tests of arrays against NULL and variables that sometimes
  were used without being initialized (Arnaldo Carvalho de Melo, Steven Rostedt)

- Before loading a new ELF, clear global variables set by the
  samples/bpf loader (Mickaël Salaün)

- Ignore already processed ELF sections in the samples/bpf
  loader (Mickaël Salaün)

- Fix compile error in the scripting code with some perl5
  versions (Wang YanQing)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (6):
      tools include: Introduce linux/compiler-gcc.h
      tools lib traceevent plugin function: Initialize 'index' variable
      perf evsel: Inform how to make a sysctl setting permanent
      perf symbols: No need to check if sym->name is NULL
      perf tests record: No need to test an array against NULL
      perf symbols: dso->name is an array, no need to check it against NULL

Mickaël Salaün (3):
      samples/bpf: Add missing header
      samples/bpf: Ignore already processed ELF sections
      samples/bpf: Reset global variables

Namhyung Kim (4):
      perf diff: Add 'delta-abs' compute method
      perf diff: Add diff.order config option
      perf diff: Add diff.compute config option
      perf diff: Change default setting to "delta-abs"

Steven Rostedt (VMware) (1):
      tools lib traceevent: Initialize lenght on OLD_RING_BUFFER_TYPE_TIME_STAMP

Wang YanQing (1):
      perf scripting perl: Fix compile error with some perl5 versions

 samples/bpf/bpf_load.c                             |  7 ++
 samples/bpf/tracex5_kern.c                         |  1 +
 tools/include/linux/compiler-gcc.h                 | 14 ++++
 tools/include/linux/compiler.h                     | 10 +--
 tools/lib/traceevent/kbuffer-parse.c               |  1 +
 tools/lib/traceevent/plugin_function.c             |  2 +-
 tools/perf/Documentation/perf-config.txt           | 12 ++++
 tools/perf/Documentation/perf-diff.txt             | 15 ++++-
 tools/perf/MANIFEST                                |  1 +
 tools/perf/builtin-diff.c                          | 78 ++++++++++++++++++++--
 tools/perf/builtin-kmem.c                          |  4 +-
 tools/perf/builtin-record.c                        |  2 +-
 tools/perf/builtin-sched.c                         |  2 +-
 tools/perf/builtin-stat.c                          |  2 +-
 tools/perf/builtin-top.c                           |  2 +-
 tools/perf/tests/perf-record.c                     |  2 +-
 tools/perf/util/evsel.c                            |  4 +-
 tools/perf/util/evsel_fprintf.c                    |  1 -
 tools/perf/util/machine.c                          |  2 +-
 tools/perf/util/map.c                              |  4 +-
 tools/perf/util/scripting-engines/Build            |  2 +-
 .../perf/util/scripting-engines/trace-event-perl.c |  4 +-
 tools/perf/util/symbol_fprintf.c                   |  2 +-
 23 files changed, 145 insertions(+), 29 deletions(-)
 create mode 100644 tools/include/linux/compiler-gcc.h

Test results:

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

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

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

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

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

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

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

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2016-11-15  1:38 Arnaldo Carvalho de Melo
@ 2016-11-15  8:47 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2016-11-15  8:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, David Ahern, He Kuang, Jiri Olsa, Kan Liang,
	Nambong Ha, Namhyung Kim, Peter Zijlstra, Rabin Vincent,
	Stephane Eranian, Taeung Song, Wang Nan, William Cohen,
	Wookje Kwon, Yao Jin


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end.
> 
> The following changes since commit 91a79e5fa696fa626bfbd47f827eaf3eb7d76dc5:
> 
>   Merge tag 'perf-core-for-mingo-20161028' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-10-28 19:37:34 +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-20161114
> 
> for you to fetch changes up to fef51ecd1056b5e090c9fb73e0833bd751389572:
> 
>   perf report: Show branch info in callchain entry for browser mode (2016-11-14 13:34:08 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Allow querying and setting .perfconfig variables (Taeung Song)
> 
> - Show branch information in callchains (predicted, TSX aborts, loop
>   iteractions, etc) (Jin Yao)
> 
> Infrastructure:
> 
> - Support kbuild's CFLAGS_REMOVE_ in tools/build (Jiri Olsa)
> 
> - Plug building jvmti to the main perf Makefile (Jiri Olsa)
> 
> Documentation:
> 
> - Update Intel PT documentation about context switch events (Arnaldo Carvalho de Melo)
> 
> - Fix 'perf record --call-graph dwarf' help/config in builds not linking
>   with a unwind library, mentioning that is a possible record option (Rabin Vincent)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       perf intel-pt: Update documentation about context switch events
> 
> Jin Yao (5):
>       perf report: Add branch flag to callchain cursor node
>       perf report: Create a symbol_conf flag for showing branch flag counting
>       perf report: Calculate and return the branch flag counting
>       perf report: Show branch info in callchain entry for stdio mode
>       perf report: Show branch info in callchain entry for browser mode
> 
> Jiri Olsa (4):
>       tools build: Add CFLAGS_REMOVE_* support
>       tools build: Add jvmti feature detection support
>       perf jvmti: Plug compilation into perf build
>       perf kvmti: Remove unused Makefile file
> 
> Rabin Vincent (1):
>       perf callchain: Fixup help/config for no-unwinding
> 
> Taeung Song (4):
>       perf config: Add support for getting config key-value pairs
>       perf config: Validate config variable arguments before trying use them
>       perf config: Add support setting variables in a config file
>       perf config: Mark where are config items from (user or system)
> 
>  tools/build/Build.include                |   4 +-
>  tools/build/Documentation/Build.txt      |   6 +-
>  tools/build/feature/Makefile             |   6 +-
>  tools/build/feature/test-jvmti.c         |  13 ++
>  tools/perf/Documentation/intel-pt.txt    |  19 ++-
>  tools/perf/Documentation/perf-config.txt |  35 ++++++
>  tools/perf/Makefile.config               |  26 ++++
>  tools/perf/Makefile.perf                 |  24 +++-
>  tools/perf/builtin-config.c              | 137 ++++++++++++++++++++-
>  tools/perf/builtin-report.c              |   3 +
>  tools/perf/jvmti/Build                   |   8 ++
>  tools/perf/jvmti/Makefile                |  89 --------------
>  tools/perf/tests/make                    |   2 +-
>  tools/perf/ui/browsers/hists.c           |  20 ++-
>  tools/perf/ui/stdio/hist.c               |  35 +++++-
>  tools/perf/util/callchain.c              | 205 ++++++++++++++++++++++++++++++-
>  tools/perf/util/callchain.h              |  26 +++-
>  tools/perf/util/config.c                 |  20 +++
>  tools/perf/util/config.h                 |   4 +
>  tools/perf/util/machine.c                |  82 ++++++++++---
>  tools/perf/util/symbol.h                 |   1 +
>  21 files changed, 634 insertions(+), 131 deletions(-)
>  create mode 100644 tools/build/feature/test-jvmti.c
>  create mode 100644 tools/perf/jvmti/Build
>  delete mode 100644 tools/perf/jvmti/Makefile
> 
>   [root@jouet ~]# perf test
>    1: vmlinux symtab matches kallsyms                          : Ok
>    2: detect openat syscall event                              : Ok
>    3: detect openat syscall event on all cpus                  : Ok
>    4: read samples using the mmap interface                    : Ok
>    5: parse events tests                                       : Ok
>    6: Validate PERF_RECORD_* events & perf_sample fields       : Ok
>    7: Test perf pmu format parsing                             : Ok
>    8: Test dso data read                                       : Ok
>    9: Test dso data cache                                      : Ok
>   10: Test dso data reopen                                     : Ok
>   11: roundtrip evsel->name check                              : Ok
>   12: Check parsing of sched tracepoints fields                : Ok
>   13: Generate and check syscalls:sys_enter_openat event fields: Ok
>   14: struct perf_event_attr setup                             : Ok
>   15: Test matching and linking multiple hists                 : Ok
>   16: Try 'import perf' in python, checking link problems      : Ok
>   17: Test breakpoint overflow signal handler                  : Ok
>   18: Test breakpoint overflow sampling                        : Ok
>   19: Test number of exit event of a simple workload           : Ok
>   20: Test software clock events have valid period values      : Ok
>   21: Test object code reading                                 : Ok
>   22: Test sample parsing                                      : Ok
>   23: Test using a dummy software event to keep tracking       : Ok
>   24: Test parsing with no sample_id_all bit set               : Ok
>   25: Test filtering hist entries                              : Ok
>   26: Test mmap thread lookup                                  : Ok
>   27: Test thread mg sharing                                   : Ok
>   28: Test output sorting of hist entries                      : Ok
>   29: Test cumulation of child hist entries                    : Ok
>   30: Test tracking with sched_switch                          : Ok
>   31: Filter fds with revents mask in a fdarray                : Ok
>   32: Add fd to a fdarray, making it autogrow                  : Ok
>   33: Test kmod_path__parse function                           : Ok
>   34: Test thread map                                          : Ok
>   35: Test LLVM searching and compiling                        :
>   35.1: Basic BPF llvm compiling test                          : Ok
>   35.2: Test kbuild searching                                  : Ok
>   35.3: Compile source for BPF prologue generation test        : Ok
>   35.4: Compile source for BPF relocation test                 : Ok
>   36: Test topology in session                                 : Ok
>   37: Test BPF filter                                          :
>   37.1: Test basic BPF filtering                               : Ok
>   37.2: Test BPF prologue generation                           : Ok
>   37.3: Test BPF relocation checker                            : Ok
>   38: Test thread map synthesize                               : Ok
>   39: Test cpu map synthesize                                  : Ok
>   40: Test stat config synthesize                              : Ok
>   41: Test stat synthesize                                     : Ok
>   42: Test stat round synthesize                               : Ok
>   43: Test attr update synthesize                              : Ok
>   44: Test events times                                        : Ok
>   45: Test backward reading from ring buffer                   : Ok
>   46: Test cpu map print                                       : Ok
>   47: Test SDT event probing                                   : Ok
>   48: Test is_printable_array function                         : Ok
>   49: Test bitmap print                                        : Ok
>   50: x86 rdpmc test                                           : Ok
>   51: Test converting perf time to TSC                         : Ok
>   52: Test dwarf unwind                                        : Ok
>   53: Test x86 instruction decoder - new instructions          : Ok
>   54: Test intel cqm nmi context read                          : Skip
>   [root@jouet ~]#
> 
>   [root@zoo ~]# time dm
>    1 alpine:3.4: Ok
>    2 android-ndk:r12b-arm: Ok
>    3 archlinux:latest: Ok
>    4 centos:5: Ok
>    5 centos:6: Ok
>    6 centos:7: Ok
>    7 debian:7: Ok
>    8 debian:8: Ok
>    9 debian:experimental: Ok
>   10 fedora:20: Ok
>   11 fedora:21: Ok
>   12 fedora:22: Ok
>   13 fedora:23: Ok
>   14 fedora:24: Ok
>   15 fedora:24-x-ARC-uClibc: Ok
>   16 fedora:rawhide: Ok
>   17 mageia:5: Ok
>   18 opensuse:13.2: Ok
>   19 opensuse:42.1: Ok
>   20 opensuse:tumbleweed: Ok
>   21 ubuntu:12.04.5: Ok
>   22 ubuntu:14.04: Ok
>   23 ubuntu:14.04.4: Ok
>   24 ubuntu:15.10: Ok
>   25 ubuntu:16.04: Ok
>   26 ubuntu:16.04-x-arm: Ok
>   27 ubuntu:16.04-x-arm64: Ok
>   28 ubuntu:16.04-x-powerpc: Ok
>   29 ubuntu:16.04-x-powerpc64: Ok
>   30 ubuntu:16.04-x-powerpc64el: Ok
>   31 ubuntu:16.04-x-s390: Ok
>   32 ubuntu:16.10: Ok
> 
>   real	61m29.498s
>   user	0m3.969s
>   sys	0m3.525s
>   [root@zoo ~]#
> 
>   [acme@jouet linux]$ perf stat make -C tools/perf build-test
>   make: Entering directory '/home/acme/git/linux/tools/perf'
>   - tarpkg: ./tests/perf-targz-src-pkg .
>            make_no_libbionic_O: make NO_LIBBIONIC=1
>               make_no_libbpf_O: make NO_LIBBPF=1
>            make_no_libunwind_O: make NO_LIBUNWIND=1
>                 make_install_O: make install
>             make_no_libaudit_O: make NO_LIBAUDIT=1
>              make_no_libperl_O: make NO_LIBPERL=1
>    make_install_prefix_slash_O: make install prefix=/tmp/krava/
>                 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
>               make_clean_all_O: make clean all
>                   make_debug_O: make DEBUG=1
>                 make_no_newt_O: make NO_NEWT=1
>                  make_perf_o_O: make perf.o
>             make_no_demangle_O: make NO_DEMANGLE=1
>                     make_doc_O: make doc
>             make_install_bin_O: make install-bin
>                   make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
>          make_install_prefix_O: make install prefix=/tmp/krava
>                make_no_slang_O: make NO_SLANG=1
>               make_no_libelf_O: make NO_LIBELF=1
>                  make_static_O: make LDFLAGS=-static
>              make_util_map_o_O: make util/map.o
>         make_with_babeltrace_O: make LIBBABELTRACE=1
>             make_no_auxtrace_O: make NO_AUXTRACE=1
>              make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
>              make_no_libnuma_O: make NO_LIBNUMA=1
>                    make_pure_O: make
>                    make_help_O: make help
>                 make_no_gtk2_O: make NO_GTK2=1
>            make_no_libpython_O: make NO_LIBPYTHON=1
>            make_no_backtrace_O: make NO_BACKTRACE=1
>                    make_tags_O: make tags
>   make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
>        make_util_pmu_bison_o_O: make util/pmu-bison.o
>   OK
>   make: Leaving directory '/home/acme/git/linux/tools/perf'

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-11-15  1:38 Arnaldo Carvalho de Melo
  2016-11-15  8:47 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-11-15  1:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo,
	Adrian Hunter, Andi Kleen, David Ahern, He Kuang, Jiri Olsa,
	Kan Liang, Linux-kernel, Nambong Ha, Namhyung Kim,
	Peter Zijlstra, Rabin Vincent, Stephane Eranian, Taeung Song,
	Wang Nan, William Cohen, Wookje Kwon, Yao Jin

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end.

The following changes since commit 91a79e5fa696fa626bfbd47f827eaf3eb7d76dc5:

  Merge tag 'perf-core-for-mingo-20161028' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-10-28 19:37:34 +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-20161114

for you to fetch changes up to fef51ecd1056b5e090c9fb73e0833bd751389572:

  perf report: Show branch info in callchain entry for browser mode (2016-11-14 13:34:08 -0300)

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

New features:

- Allow querying and setting .perfconfig variables (Taeung Song)

- Show branch information in callchains (predicted, TSX aborts, loop
  iteractions, etc) (Jin Yao)

Infrastructure:

- Support kbuild's CFLAGS_REMOVE_ in tools/build (Jiri Olsa)

- Plug building jvmti to the main perf Makefile (Jiri Olsa)

Documentation:

- Update Intel PT documentation about context switch events (Arnaldo Carvalho de Melo)

- Fix 'perf record --call-graph dwarf' help/config in builds not linking
  with a unwind library, mentioning that is a possible record option (Rabin Vincent)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      perf intel-pt: Update documentation about context switch events

Jin Yao (5):
      perf report: Add branch flag to callchain cursor node
      perf report: Create a symbol_conf flag for showing branch flag counting
      perf report: Calculate and return the branch flag counting
      perf report: Show branch info in callchain entry for stdio mode
      perf report: Show branch info in callchain entry for browser mode

Jiri Olsa (4):
      tools build: Add CFLAGS_REMOVE_* support
      tools build: Add jvmti feature detection support
      perf jvmti: Plug compilation into perf build
      perf kvmti: Remove unused Makefile file

Rabin Vincent (1):
      perf callchain: Fixup help/config for no-unwinding

Taeung Song (4):
      perf config: Add support for getting config key-value pairs
      perf config: Validate config variable arguments before trying use them
      perf config: Add support setting variables in a config file
      perf config: Mark where are config items from (user or system)

 tools/build/Build.include                |   4 +-
 tools/build/Documentation/Build.txt      |   6 +-
 tools/build/feature/Makefile             |   6 +-
 tools/build/feature/test-jvmti.c         |  13 ++
 tools/perf/Documentation/intel-pt.txt    |  19 ++-
 tools/perf/Documentation/perf-config.txt |  35 ++++++
 tools/perf/Makefile.config               |  26 ++++
 tools/perf/Makefile.perf                 |  24 +++-
 tools/perf/builtin-config.c              | 137 ++++++++++++++++++++-
 tools/perf/builtin-report.c              |   3 +
 tools/perf/jvmti/Build                   |   8 ++
 tools/perf/jvmti/Makefile                |  89 --------------
 tools/perf/tests/make                    |   2 +-
 tools/perf/ui/browsers/hists.c           |  20 ++-
 tools/perf/ui/stdio/hist.c               |  35 +++++-
 tools/perf/util/callchain.c              | 205 ++++++++++++++++++++++++++++++-
 tools/perf/util/callchain.h              |  26 +++-
 tools/perf/util/config.c                 |  20 +++
 tools/perf/util/config.h                 |   4 +
 tools/perf/util/machine.c                |  82 ++++++++++---
 tools/perf/util/symbol.h                 |   1 +
 21 files changed, 634 insertions(+), 131 deletions(-)
 create mode 100644 tools/build/feature/test-jvmti.c
 create mode 100644 tools/perf/jvmti/Build
 delete mode 100644 tools/perf/jvmti/Makefile

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

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

  real	61m29.498s
  user	0m3.969s
  sys	0m3.525s
  [root@zoo ~]#

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

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-10-27 20:40 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-10-27 20:40 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Dave Hansen, David Ahern, Davidlohr Bueso,
	Frederic Weisbecker, Jiri Olsa, Josh Poimboeuf, Namhyung Kim,
	Peter Zijlstra, Sebastian Andrzej Siewior, Thomas Gleixner,
	Tom Zanussi, Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

Build and test stats at the end of the message.

The following changes since commit 76e2d2617d767c445498c4c4b1162eb2201cdd77:

  Merge tag 'perf-core-for-mingo-20161024' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-10-24 20:42: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-20161027

for you to fetch changes up to 97321c8437977490432d470799faa3e5f1227806:

  perf tools: Add missing object file to the python binding linkage list (2016-10-26 19:08:43 -0200)

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

New features:

- Support matching by topic in 'perf list' (Andi Kleen)

User visible:

- Apply cpu color only when there was activity in 'perf sched map' (Namhyung Kim)

- Always show the task's COMM in 'perf sched map -v' (Namhyung Kim)

- Fix hierarchy column counts in the perf hist browser (top, report), avoiding
  showing nothing after pressing the RIGHT key a number of times (Namhyung Kim)

Infrastructure:

- Support cascading options in libsubcmd and use it to share common options in
  'perf sched' subcommands (Namhyung Kim)

- Avoid worker cacheline bouncing in 'perf bench futex' (Davidlohr Bueso)

- Sanitize numeric parameters in 'perf bench futex' (Davidlohr Bueso)

- Update copies of kernel files (Arnaldo Carvalho de Melo)

- Fix scripting (perl, python) setup to avoid leaks (Arnaldo Carvalho de Melo)

- Add missing object file to the python binding linkage list (Arnaldo Carvalho de Melo)

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

----------------------------------------------------------------
Andi Kleen (1):
      perf list: Support matching by topic

Arnaldo Carvalho de Melo (6):
      perf bench mem: Ignore export.h related changes to mem{cpy,set}.S
      tools: Update asm-generic/mman-common.h copy from the kernel
      perf tools: Update x86's syscall_64.tbl, adding pkey_(alloc,free,mprotect)
      perf scripting: Avoid leaking the scripting_context variable
      perf scripting: Don't die if scripting can't be setup, disable it
      perf tools: Add missing object file to the python binding linkage list

Davidlohr Bueso (2):
      perf bench futex: Avoid worker cacheline bouncing
      perf bench futex: Sanitize numeric parameters

Namhyung Kim (6):
      perf hist browser: Fix hierarchy column counts
      tools lib subcmd: Suppport cascading options
      perf sched: Make common options cascading
      perf sched map: Apply cpu color when there's an activity
      perf sched map: Always show task comm with -v
      perf tools: Introduce timestamp_in_usec()

 tools/include/uapi/asm-generic/mman-common.h      |  5 +++
 tools/lib/subcmd/parse-options.c                  | 14 ++++++++
 tools/lib/subcmd/parse-options.h                  |  2 ++
 tools/perf/Makefile.perf                          |  4 +--
 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl |  3 ++
 tools/perf/bench/futex-hash.c                     | 15 +++++----
 tools/perf/bench/futex-lock-pi.c                  |  7 +++-
 tools/perf/bench/futex-requeue.c                  |  2 ++
 tools/perf/bench/futex-wake-parallel.c            |  4 +++
 tools/perf/bench/futex-wake.c                     |  3 ++
 tools/perf/bench/futex.h                          |  4 +++
 tools/perf/builtin-sched.c                        | 37 +++++++++++----------
 tools/perf/builtin-script.c                       |  9 ++++--
 tools/perf/ui/browsers/hists.c                    | 15 ++++++++-
 tools/perf/util/parse-branch-options.c            |  2 +-
 tools/perf/util/pmu.c                             |  4 ++-
 tools/perf/util/python-ext-sources                |  1 +
 tools/perf/util/trace-event-scripting.c           | 39 +++++++++++------------
 tools/perf/util/util.c                            |  9 ++++++
 tools/perf/util/util.h                            |  3 ++
 20 files changed, 130 insertions(+), 52 deletions(-)

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

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

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

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2016-09-22 21:12 Arnaldo Carvalho de Melo
@ 2016-09-23  5:22 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2016-09-23  5:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, David Ahern, Don Zickus,
	Jiri Olsa, Joe Mario, linux-arm-kernel, Mathieu Poirier,
	Namhyung Kim, Peter Zijlstra


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

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 89f1c2c59c4aef8e26edbc7db5175e6ffb0e9ec7:
> 
>   Merge tag 'perf-core-for-mingo-20160920' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-20 23:32:02 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160922
> 
> for you to fetch changes up to 2d831454140f28fa643b78deede4511b9e2c9e5f:
> 
>   perf hists: Make hists__fprintf_headers function global (2016-09-22 13:08:59 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements:
> 
> New features:
> 
> - Add support for interacting with Coresight PMU ETMs/PTMs, that are IP blocks
>   to perform hardware assisted tracing on a ARM CPU core (Mathieu Poirier)
> 
> Infrastructure:
> 
> - Histogram prep work for the upcoming c2c tool (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Jiri Olsa (9):
>       perf evsel: Remove superfluous initialization of weight
>       perf hists: Use bigger buffer for stdio headers
>       perf hists: Add __hist_entry__snprintf function
>       perf tools: Make reset_dimensions global
>       perf tools: Make output_field_add and sort_dimension__add global
>       perf tools: Make several sorting functions global
>       perf tools: Make several display functions global
>       perf hists: Make __hist_entry__snprintf function global
>       perf hists: Make hists__fprintf_headers function global
> 
> Mathieu Poirier (6):
>       perf tools: Confine __get_cpuid() to x86 architecture
>       perf tools: Make coresight PMU listable
>       perf tools: Add coresight etm PMU record capabilities
>       perf pmu: Push configuration down to PMU driver
>       perf tools: Add PMU configuration to tools
>       perf tools: Add sink configuration for cs_etm PMU
> 
>  MAINTAINERS                         |   5 +
>  tools/perf/Makefile.config          |  11 +-
>  tools/perf/arch/arm/util/Build      |   2 +
>  tools/perf/arch/arm/util/auxtrace.c |  54 ++++
>  tools/perf/arch/arm/util/cs-etm.c   | 617 ++++++++++++++++++++++++++++++++++++
>  tools/perf/arch/arm/util/cs-etm.h   |  26 ++
>  tools/perf/arch/arm/util/pmu.c      |  36 +++
>  tools/perf/arch/arm64/util/Build    |   4 +
>  tools/perf/builtin-record.c         |  10 +
>  tools/perf/builtin-stat.c           |   9 +
>  tools/perf/builtin-top.c            |  13 +
>  tools/perf/ui/browsers/hists.c      |   2 +-
>  tools/perf/ui/hist.c                |   2 +-
>  tools/perf/ui/stdio/hist.c          |  14 +-
>  tools/perf/util/Build               |   1 +
>  tools/perf/util/auxtrace.c          |   1 +
>  tools/perf/util/auxtrace.h          |   1 +
>  tools/perf/util/cs-etm.h            |  74 +++++
>  tools/perf/util/drv_configs.c       |  77 +++++
>  tools/perf/util/drv_configs.h       |  26 ++
>  tools/perf/util/evsel.c             |   2 -
>  tools/perf/util/hist.h              |   5 +
>  tools/perf/util/pmu.h               |   2 +
>  tools/perf/util/sort.c              |  16 +-
>  tools/perf/util/sort.h              |  11 +
>  25 files changed, 1001 insertions(+), 20 deletions(-)
>  create mode 100644 tools/perf/arch/arm/util/auxtrace.c
>  create mode 100644 tools/perf/arch/arm/util/cs-etm.c
>  create mode 100644 tools/perf/arch/arm/util/cs-etm.h
>  create mode 100644 tools/perf/arch/arm/util/pmu.c
>  create mode 100644 tools/perf/util/cs-etm.h
>  create mode 100644 tools/perf/util/drv_configs.c
>  create mode 100644 tools/perf/util/drv_configs.h
> 
>   [root@zoo ~]# time dm
>    1  73.911 alpine:3.4: Ok
>    2  26.890 android-ndk:r12b-arm: Ok
>    3  77.833 archlinux:latest: Ok
>    4  40.814 centos:5: Ok
>    5  64.151 centos:6: Ok
>    6  75.720 centos:7: Ok
>    7  68.960 debian:7: Ok
>    8  75.606 debian:8: Ok
>    9  75.127 fedora:20: Ok
>   10  80.186 fedora:21: Ok
>   11  80.157 fedora:22: Ok
>   12  83.273 fedora:23: Ok
>   13  91.566 fedora:24: Ok
>   14  37.720 fedora:24-x-ARC-uClibc: Ok
>   15  98.492 fedora:rawhide: Ok
>   16 100.555 mageia:5: Ok
>   17  94.140 opensuse:13.2: Ok
>   18  95.476 opensuse:42.1: Ok
>   19 106.037 opensuse:tumbleweed: Ok
>   20  75.951 ubuntu:12.04.5: Ok
>   21  52.138 ubuntu:14.04: Ok
>   22  94.814 ubuntu:14.04.4: Ok
>   23  100.525 ubuntu:15.10: Ok
>   24  93.813 ubuntu:16.04: Ok
>   25  85.214 ubuntu:16.04-x-arm: Ok
>   26  83.487 ubuntu:16.04-x-arm64: Ok
>   27  82.918 ubuntu:16.04-x-powerpc64: Ok
>   28  84.189 ubuntu:16.04-x-powerpc64el: Ok
>   29  93.162 ubuntu:16.10: Ok
>   
>   real	38m13.568s
>   user	0m2.379s
>   sys	0m2.402s
>   [root@zoo ~]# 
> 
>   [root@jouet ~]# perf test
>    1: vmlinux symtab matches kallsyms                          : Ok
>    2: detect openat syscall event                              : Ok
>    3: detect openat syscall event on all cpus                  : Ok
>    4: read samples using the mmap interface                    : Ok
>    5: parse events tests                                       : Ok
>    6: Validate PERF_RECORD_* events & perf_sample fields       : Ok
>    7: Test perf pmu format parsing                             : Ok
>    8: Test dso data read                                       : Ok
>    9: Test dso data cache                                      : Ok
>   10: Test dso data reopen                                     : Ok
>   11: roundtrip evsel->name check                              : Ok
>   12: Check parsing of sched tracepoints fields                : Ok
>   13: Generate and check syscalls:sys_enter_openat event fields: Ok
>   14: struct perf_event_attr setup                             : Ok
>   15: Test matching and linking multiple hists                 : Ok
>   16: Try 'import perf' in python, checking link problems      : Ok
>   17: Test breakpoint overflow signal handler                  : Ok
>   18: Test breakpoint overflow sampling                        : Ok
>   19: Test number of exit event of a simple workload           : Ok
>   20: Test software clock events have valid period values      : Ok
>   21: Test object code reading                                 : Ok
>   22: Test sample parsing                                      : Ok
>   23: Test using a dummy software event to keep tracking       : Ok
>   24: Test parsing with no sample_id_all bit set               : Ok
>   25: Test filtering hist entries                              : Ok
>   26: Test mmap thread lookup                                  : Ok
>   27: Test thread mg sharing                                   : Ok
>   28: Test output sorting of hist entries                      : Ok
>   29: Test cumulation of child hist entries                    : Ok
>   30: Test tracking with sched_switch                          : Ok
>   31: Filter fds with revents mask in a fdarray                : Ok
>   32: Add fd to a fdarray, making it autogrow                  : Ok
>   33: Test kmod_path__parse function                           : Ok
>   34: Test thread map                                          : Ok
>   35: Test LLVM searching and compiling                        :
>   35.1: Basic BPF llvm compiling test                          : Ok
>   35.2: Test kbuild searching                                  : Ok
>   35.3: Compile source for BPF prologue generation test        : Ok
>   35.4: Compile source for BPF relocation test                 : Ok
>   36: Test topology in session                                 : Ok
>   37: Test BPF filter                                          :
>   37.1: Test basic BPF filtering                               : Ok
>   37.2: Test BPF prologue generation                           : Ok
>   37.3: Test BPF relocation checker                            : Ok
>   38: Test thread map synthesize                               : Ok
>   39: Test cpu map synthesize                                  : Ok
>   40: Test stat config synthesize                              : Ok
>   41: Test stat synthesize                                     : Ok
>   42: Test stat round synthesize                               : Ok
>   43: Test attr update synthesize                              : Ok
>   44: Test events times                                        : Ok
>   45: Test backward reading from ring buffer                   : Ok
>   46: Test cpu map print                                       : Ok
>   47: Test SDT event probing                                   : Ok
>   48: Test is_printable_array function                         : Ok
>   49: Test bitmap print                                        : Ok
>   50: x86 rdpmc test                                           : Ok
>   51: Test converting perf time to TSC                         : Ok
>   52: Test dwarf unwind                                        : Ok
>   53: Test x86 instruction decoder - new instructions          : Ok
>   54: Test intel cqm nmi context read                          : Skip
>   [root@jouet ~]#

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-09-22 21:12 Arnaldo Carvalho de Melo
  2016-09-23  5:22 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-09-22 21:12 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, David Ahern, Don Zickus,
	Jiri Olsa, Joe Mario, linux-arm-kernel, Mathieu Poirier,
	Namhyung Kim, Peter Zijlstra

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

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 89f1c2c59c4aef8e26edbc7db5175e6ffb0e9ec7:

  Merge tag 'perf-core-for-mingo-20160920' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-09-20 23:32:02 +0200)

are available in the git repository at:

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

for you to fetch changes up to 2d831454140f28fa643b78deede4511b9e2c9e5f:

  perf hists: Make hists__fprintf_headers function global (2016-09-22 13:08:59 -0300)

----------------------------------------------------------------
perf/core improvements:

New features:

- Add support for interacting with Coresight PMU ETMs/PTMs, that are IP blocks
  to perform hardware assisted tracing on a ARM CPU core (Mathieu Poirier)

Infrastructure:

- Histogram prep work for the upcoming c2c tool (Jiri Olsa)

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

----------------------------------------------------------------
Jiri Olsa (9):
      perf evsel: Remove superfluous initialization of weight
      perf hists: Use bigger buffer for stdio headers
      perf hists: Add __hist_entry__snprintf function
      perf tools: Make reset_dimensions global
      perf tools: Make output_field_add and sort_dimension__add global
      perf tools: Make several sorting functions global
      perf tools: Make several display functions global
      perf hists: Make __hist_entry__snprintf function global
      perf hists: Make hists__fprintf_headers function global

Mathieu Poirier (6):
      perf tools: Confine __get_cpuid() to x86 architecture
      perf tools: Make coresight PMU listable
      perf tools: Add coresight etm PMU record capabilities
      perf pmu: Push configuration down to PMU driver
      perf tools: Add PMU configuration to tools
      perf tools: Add sink configuration for cs_etm PMU

 MAINTAINERS                         |   5 +
 tools/perf/Makefile.config          |  11 +-
 tools/perf/arch/arm/util/Build      |   2 +
 tools/perf/arch/arm/util/auxtrace.c |  54 ++++
 tools/perf/arch/arm/util/cs-etm.c   | 617 ++++++++++++++++++++++++++++++++++++
 tools/perf/arch/arm/util/cs-etm.h   |  26 ++
 tools/perf/arch/arm/util/pmu.c      |  36 +++
 tools/perf/arch/arm64/util/Build    |   4 +
 tools/perf/builtin-record.c         |  10 +
 tools/perf/builtin-stat.c           |   9 +
 tools/perf/builtin-top.c            |  13 +
 tools/perf/ui/browsers/hists.c      |   2 +-
 tools/perf/ui/hist.c                |   2 +-
 tools/perf/ui/stdio/hist.c          |  14 +-
 tools/perf/util/Build               |   1 +
 tools/perf/util/auxtrace.c          |   1 +
 tools/perf/util/auxtrace.h          |   1 +
 tools/perf/util/cs-etm.h            |  74 +++++
 tools/perf/util/drv_configs.c       |  77 +++++
 tools/perf/util/drv_configs.h       |  26 ++
 tools/perf/util/evsel.c             |   2 -
 tools/perf/util/hist.h              |   5 +
 tools/perf/util/pmu.h               |   2 +
 tools/perf/util/sort.c              |  16 +-
 tools/perf/util/sort.h              |  11 +
 25 files changed, 1001 insertions(+), 20 deletions(-)
 create mode 100644 tools/perf/arch/arm/util/auxtrace.c
 create mode 100644 tools/perf/arch/arm/util/cs-etm.c
 create mode 100644 tools/perf/arch/arm/util/cs-etm.h
 create mode 100644 tools/perf/arch/arm/util/pmu.c
 create mode 100644 tools/perf/util/cs-etm.h
 create mode 100644 tools/perf/util/drv_configs.c
 create mode 100644 tools/perf/util/drv_configs.h

  [root@zoo ~]# time dm
   1  73.911 alpine:3.4: Ok
   2  26.890 android-ndk:r12b-arm: Ok
   3  77.833 archlinux:latest: Ok
   4  40.814 centos:5: Ok
   5  64.151 centos:6: Ok
   6  75.720 centos:7: Ok
   7  68.960 debian:7: Ok
   8  75.606 debian:8: Ok
   9  75.127 fedora:20: Ok
  10  80.186 fedora:21: Ok
  11  80.157 fedora:22: Ok
  12  83.273 fedora:23: Ok
  13  91.566 fedora:24: Ok
  14  37.720 fedora:24-x-ARC-uClibc: Ok
  15  98.492 fedora:rawhide: Ok
  16 100.555 mageia:5: Ok
  17  94.140 opensuse:13.2: Ok
  18  95.476 opensuse:42.1: Ok
  19 106.037 opensuse:tumbleweed: Ok
  20  75.951 ubuntu:12.04.5: Ok
  21  52.138 ubuntu:14.04: Ok
  22  94.814 ubuntu:14.04.4: Ok
  23  100.525 ubuntu:15.10: Ok
  24  93.813 ubuntu:16.04: Ok
  25  85.214 ubuntu:16.04-x-arm: Ok
  26  83.487 ubuntu:16.04-x-arm64: Ok
  27  82.918 ubuntu:16.04-x-powerpc64: Ok
  28  84.189 ubuntu:16.04-x-powerpc64el: Ok
  29  93.162 ubuntu:16.10: Ok
  
  real	38m13.568s
  user	0m2.379s
  sys	0m2.402s
  [root@zoo ~]# 

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

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2016-07-18 23:33 Arnaldo Carvalho de Melo
@ 2016-07-19  6:46 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2016-07-19  6:46 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Dan Carpenter, David Ahern, He Kuang,
	Jiri Olsa, Jiri Pirko, Josh Poimboeuf, Kan Liang, Mark Rutland,
	Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, Wang Nan


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

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Build stats:
> 
> [root@jouet 5]# perf stat dm
> alpine:3.4: Ok
> android-ndk:r12b: Ok
> centos:5: Ok
> centos:6: Ok
> centos:7: Ok
> debian:7: Ok
> debian:8: Ok
> debian:experimental: Ok
> fedora:21: Ok
> fedora:22: Ok
> fedora:23: Ok
> fedora:24: Ok
> fedora:rawhide: Ok
> mageia:5: Ok
> opensuse:13.2: Ok
> opensuse:42.1: Ok
> ubuntu:14.04.4: Ok
> ubuntu:15.10: Ok
> ubuntu:16.04: Ok
> ubuntu:16.04-x-armhf: Ok
> 
>  Performance counter stats for 'dm':
> 
>        1896.227285      task-clock (msec)         #    0.002 CPUs utilized          
>             76,145      context-switches          #    0.040 M/sec                  
>              9,323      cpu-migrations            #    0.005 M/sec                  
>             53,894      page-faults               #    0.028 M/sec                  
>      5,497,625,679      cycles                    #    2.899 GHz                    
>      5,110,226,458      instructions              #    0.93  insn per cycle         
>        950,036,839      branches                  #  501.014 M/sec                  
>         16,978,253      branch-misses             #    1.79% of all branches        
> 
>      767.910393301 seconds time elapsed
> 
> [root@jouet 5]#
> 
> The following changes since commit 09211e2530ab4905ec16edecc27022d6b247419d:
> 
>   Merge tag 'perf-core-for-mingo-20160715' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-07-16 22:36: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-20160718
> 
> for you to fetch changes up to 988dd774dcbd9151c2a643fc7284c5c3c4d0adb7:
> 
>   perf tests: Add is_printable_array test (2016-07-18 19:50:35 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Properly report when a function wildcard produces no matches in 'perf probe'
>   (Masami Hiramatsu)
> 
> - Balance opening and reading events in 'perf stat', which could cause
>   it to get stuck trying to close invalid file descriptors (Mark Rutland)
> 
> Infrastructure:
> 
> - Copy more headers from the kernel, this time for headers that
>   were just including the contents of its kernel counterparts, should
>   help resolving the problems with linux-next, where some uapi related
>   patches seem to be breaking tools/object/ build.
> 
>   Some more combing will be done, but at least it is possible to build
>   perf out of tree, via a detached tarball (make help | grep perf)
>   without including kernel files in its MANIFEST (Arnaldo Carvalho de Melo)
> 
> - Fix smatch found errors that were not causing problems, but are
>   mistakes nonetheless (Dan Carpenter)
> 
> - Fix string vs byte array resolving in the python script code (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (7):
>       perf tools: Add missing linux/compiler.h include to perf-sys.h
>       perf tools: Remove tools/perf/util/include/asm/byteorder.h
>       perf tools: Remove tools/perf/util/include/linux/const.h
>       Remove: kernel unistd*h files from perf's MANIFEST, not used
>       tools: Copy the bitops files accessed from the kernel and check for drift
>       perf tools: Remove include/linux/list.h from perf's MANIFEST
>       tools: Copy linux/{hash,poison}.h and check for drift
> 
> Dan Carpenter (2):
>       perf jit: Add missing curly braces
>       perf jit: Remove some no-op error handling
> 
> Jiri Olsa (3):
>       perf script python: Fix string vs byte array resolving
>       perf tools: Make is_printable_array global
>       perf tests: Add is_printable_array test
> 
> Mark Rutland (2):
>       perf stat: Balance opening and reading events
>       perf cpu_map: Add more helpers
> 
> Masami Hiramatsu (1):
>       perf probe: Warn unmatched function filter correctly
> 
>  tools/include/asm-generic/bitops/__fls.h           |  44 ++++++++-
>  tools/include/asm-generic/bitops/arch_hweight.h    |  26 ++++-
>  tools/include/asm-generic/bitops/const_hweight.h   |  44 ++++++++-
>  tools/include/asm-generic/bitops/fls.h             |  42 ++++++++-
>  tools/include/asm-generic/bitops/fls64.h           |  37 +++++++-
>  tools/include/linux/hash.h                         | 105 ++++++++++++++++++++-
>  tools/include/linux/poison.h                       |  91 +++++++++++++++++-
>  tools/perf/MANIFEST                                |  13 ---
>  tools/perf/Makefile.perf                           |  18 ++++
>  tools/perf/builtin-stat.c                          |   8 +-
>  tools/perf/jvmti/jvmti_agent.c                     |  10 +-
>  tools/perf/perf-sys.h                              |   1 +
>  tools/perf/tests/Build                             |   1 +
>  tools/perf/tests/builtin-test.c                    |   4 +
>  tools/perf/tests/is_printable_array.c              |  36 +++++++
>  tools/perf/tests/tests.h                           |   1 +
>  tools/perf/util/cpumap.c                           |  14 ++-
>  tools/perf/util/cpumap.h                           |   2 +
>  tools/perf/util/include/asm/byteorder.h            |   2 -
>  tools/perf/util/include/linux/const.h              |   1 -
>  tools/perf/util/map.c                              |   3 +
>  tools/perf/util/probe-event.c                      |  12 ++-
>  tools/perf/util/python.c                           |  12 ---
>  .../util/scripting-engines/trace-event-python.c    |  25 +++--
>  tools/perf/util/util.c                             |  16 ++++
>  tools/perf/util/util.h                             |   1 +
>  26 files changed, 512 insertions(+), 57 deletions(-)
>  create mode 100644 tools/perf/tests/is_printable_array.c
>  delete mode 100644 tools/perf/util/include/asm/byteorder.h
>  delete mode 100644 tools/perf/util/include/linux/const.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-07-18 23:33 Arnaldo Carvalho de Melo
  2016-07-19  6:46 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-07-18 23:33 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Dan Carpenter, David Ahern, He Kuang,
	Jiri Olsa, Jiri Pirko, Josh Poimboeuf, Kan Liang, Mark Rutland,
	Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Stephane Eranian,
	Steven Rostedt, Wang Nan

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

Hi Ingo,

	Please consider pulling,

- Arnaldo

Build stats:

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

 Performance counter stats for 'dm':

       1896.227285      task-clock (msec)         #    0.002 CPUs utilized          
            76,145      context-switches          #    0.040 M/sec                  
             9,323      cpu-migrations            #    0.005 M/sec                  
            53,894      page-faults               #    0.028 M/sec                  
     5,497,625,679      cycles                    #    2.899 GHz                    
     5,110,226,458      instructions              #    0.93  insn per cycle         
       950,036,839      branches                  #  501.014 M/sec                  
        16,978,253      branch-misses             #    1.79% of all branches        

     767.910393301 seconds time elapsed

[root@jouet 5]#

The following changes since commit 09211e2530ab4905ec16edecc27022d6b247419d:

  Merge tag 'perf-core-for-mingo-20160715' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-07-16 22:36: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-20160718

for you to fetch changes up to 988dd774dcbd9151c2a643fc7284c5c3c4d0adb7:

  perf tests: Add is_printable_array test (2016-07-18 19:50:35 -0300)

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

User visible:

- Properly report when a function wildcard produces no matches in 'perf probe'
  (Masami Hiramatsu)

- Balance opening and reading events in 'perf stat', which could cause
  it to get stuck trying to close invalid file descriptors (Mark Rutland)

Infrastructure:

- Copy more headers from the kernel, this time for headers that
  were just including the contents of its kernel counterparts, should
  help resolving the problems with linux-next, where some uapi related
  patches seem to be breaking tools/object/ build.

  Some more combing will be done, but at least it is possible to build
  perf out of tree, via a detached tarball (make help | grep perf)
  without including kernel files in its MANIFEST (Arnaldo Carvalho de Melo)

- Fix smatch found errors that were not causing problems, but are
  mistakes nonetheless (Dan Carpenter)

- Fix string vs byte array resolving in the python script code (Jiri Olsa)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (7):
      perf tools: Add missing linux/compiler.h include to perf-sys.h
      perf tools: Remove tools/perf/util/include/asm/byteorder.h
      perf tools: Remove tools/perf/util/include/linux/const.h
      Remove: kernel unistd*h files from perf's MANIFEST, not used
      tools: Copy the bitops files accessed from the kernel and check for drift
      perf tools: Remove include/linux/list.h from perf's MANIFEST
      tools: Copy linux/{hash,poison}.h and check for drift

Dan Carpenter (2):
      perf jit: Add missing curly braces
      perf jit: Remove some no-op error handling

Jiri Olsa (3):
      perf script python: Fix string vs byte array resolving
      perf tools: Make is_printable_array global
      perf tests: Add is_printable_array test

Mark Rutland (2):
      perf stat: Balance opening and reading events
      perf cpu_map: Add more helpers

Masami Hiramatsu (1):
      perf probe: Warn unmatched function filter correctly

 tools/include/asm-generic/bitops/__fls.h           |  44 ++++++++-
 tools/include/asm-generic/bitops/arch_hweight.h    |  26 ++++-
 tools/include/asm-generic/bitops/const_hweight.h   |  44 ++++++++-
 tools/include/asm-generic/bitops/fls.h             |  42 ++++++++-
 tools/include/asm-generic/bitops/fls64.h           |  37 +++++++-
 tools/include/linux/hash.h                         | 105 ++++++++++++++++++++-
 tools/include/linux/poison.h                       |  91 +++++++++++++++++-
 tools/perf/MANIFEST                                |  13 ---
 tools/perf/Makefile.perf                           |  18 ++++
 tools/perf/builtin-stat.c                          |   8 +-
 tools/perf/jvmti/jvmti_agent.c                     |  10 +-
 tools/perf/perf-sys.h                              |   1 +
 tools/perf/tests/Build                             |   1 +
 tools/perf/tests/builtin-test.c                    |   4 +
 tools/perf/tests/is_printable_array.c              |  36 +++++++
 tools/perf/tests/tests.h                           |   1 +
 tools/perf/util/cpumap.c                           |  14 ++-
 tools/perf/util/cpumap.h                           |   2 +
 tools/perf/util/include/asm/byteorder.h            |   2 -
 tools/perf/util/include/linux/const.h              |   1 -
 tools/perf/util/map.c                              |   3 +
 tools/perf/util/probe-event.c                      |  12 ++-
 tools/perf/util/python.c                           |  12 ---
 .../util/scripting-engines/trace-event-python.c    |  25 +++--
 tools/perf/util/util.c                             |  16 ++++
 tools/perf/util/util.h                             |   1 +
 26 files changed, 512 insertions(+), 57 deletions(-)
 create mode 100644 tools/perf/tests/is_printable_array.c
 delete mode 100644 tools/perf/util/include/asm/byteorder.h
 delete mode 100644 tools/perf/util/include/linux/const.h

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2016-05-10 15:15 Arnaldo Carvalho de Melo
@ 2016-05-10 20:28 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2016-05-10 20:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Chris Phlipot, David Ahern, Ekaterina Tumanova, He Kuang,
	Jiri Olsa, Josh Poimboeuf, Kan Liang, Masami Hiramatsu,
	Milian Wolff, Namhyung Kim, Pekka Enberg, Peter Zijlstra,
	pi3orama, Stephane Eranian, Sukadev Bhattiprolu, Wang Nan,
	Zefan Li, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit ea7c28518943b26a85d73cd76acd03b71962cb18:
> 
>   Merge tag 'perf-core-for-mingo-20160506' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-05-07 06:49:28 +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-20160510
> 
> for you to fetch changes up to 452e84012595d681f254a3a0d733fb0b18ffaf42:
> 
>   perf tools: Remove xrealloc and ALLOC_GROW (2016-05-10 11:58:27 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Recording 'dwarf' callchains do not need DWARF unwinding support (He Kuang)
> 
> - Print recently added perf_event_attr.write_backward bit flag in -vv
>   verbose mode (Arnaldo Carvalho de Melo)
> 
> - Fix incorrect python db-export error message in 'perf script' (Chris Phlipot)
> 
> - Fix handling of zero-length symbols (Chris Phlipot)
> 
> Andi Kleen (1):
>   perf stat: Scale values by unit before metrics
> 
> Infrastructure:
> 
> - Rewrite strbuf not to die(), making tools using it to check its
>   return value instead (Masami Hiramatsu)
> 
> - Support reading from backward ring buffer, add a 'perf test' entry
>   for it (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (1):
>       perf stat: Scale values by unit before metrics
> 
> Arnaldo Carvalho de Melo (1):
>       perf evsel: Print state of perf_event_attr.write_backward
> 
> Chris Phlipot (2):
>       perf script: Fix incorrect python db-export error message
>       perf symbols: Fix handling of zero-length symbols.
> 
> He Kuang (1):
>       perf callchain: Recording 'dwarf' callchains do not need DWARF unwinding support
> 
> Masami Hiramatsu (8):
>       perf tools: Rewrite strbuf not to die()
>       perf probe: Check the return value of strbuf APIs
>       perf help: Make check_emacsclient_version to check strbuf APIs
>       perf tools: Make alias handler to check return value of strbuf
>       perf header: Make topology checkers to check return value of strbuf
>       perf pmu: Make pmu_formats_string to check return value of strbuf
>       perf help: Do not use ALLOC_GROW in add_cmd_list
>       perf tools: Remove xrealloc and ALLOC_GROW
> 
> Wang Nan (2):
>       perf tools: Support reading from backward ring buffer
>       perf tests: Add test to check backward ring buffer
> 
>  tools/perf/builtin-help.c                          |  18 +--
>  tools/perf/perf.c                                  |   8 +-
>  tools/perf/tests/Build                             |   1 +
>  tools/perf/tests/backward-ring-buffer.c            | 151 +++++++++++++++++++++
>  tools/perf/tests/builtin-test.c                    |   4 +
>  tools/perf/tests/tests.h                           |   1 +
>  tools/perf/util/Build                              |   1 -
>  tools/perf/util/cache.h                            |  19 ---
>  tools/perf/util/dwarf-aux.c                        |  52 ++++---
>  tools/perf/util/evlist.c                           |  50 +++++++
>  tools/perf/util/evlist.h                           |   4 +
>  tools/perf/util/evsel.c                            |   1 +
>  tools/perf/util/header.c                           |  31 +++--
>  tools/perf/util/help-unknown-cmd.c                 |  30 ++--
>  tools/perf/util/pmu.c                              |  10 +-
>  tools/perf/util/probe-event.c                      | 143 +++++++++++--------
>  tools/perf/util/probe-finder.c                     |  30 ++--
>  tools/perf/util/quote.c                            |  36 ++---
>  tools/perf/util/quote.h                            |   2 +-
>  .../util/scripting-engines/trace-event-python.c    |   2 +-
>  tools/perf/util/stat.c                             |   4 +-
>  tools/perf/util/strbuf.c                           |  93 +++++++++----
>  tools/perf/util/strbuf.h                           |  25 ++--
>  tools/perf/util/symbol.c                           |   2 +-
>  tools/perf/util/util.c                             |   2 -
>  tools/perf/util/util.h                             |   6 -
>  tools/perf/util/wrapper.c                          |  29 ----
>  27 files changed, 510 insertions(+), 245 deletions(-)
>  create mode 100644 tools/perf/tests/backward-ring-buffer.c
>  delete mode 100644 tools/perf/util/wrapper.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-05-10 15:15 Arnaldo Carvalho de Melo
  2016-05-10 20:28 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-05-10 15:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Chris Phlipot, David Ahern,
	Ekaterina Tumanova, He Kuang, Jiri Olsa, Josh Poimboeuf,
	Kan Liang, Masami Hiramatsu, Milian Wolff, Namhyung Kim,
	Pekka Enberg, Peter Zijlstra, pi3orama, Stephane Eranian,
	Sukadev Bhattiprolu, Wang Nan, Zefan Li,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit ea7c28518943b26a85d73cd76acd03b71962cb18:

  Merge tag 'perf-core-for-mingo-20160506' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-05-07 06:49:28 +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-20160510

for you to fetch changes up to 452e84012595d681f254a3a0d733fb0b18ffaf42:

  perf tools: Remove xrealloc and ALLOC_GROW (2016-05-10 11:58:27 -0300)

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

User visible:

- Recording 'dwarf' callchains do not need DWARF unwinding support (He Kuang)

- Print recently added perf_event_attr.write_backward bit flag in -vv
  verbose mode (Arnaldo Carvalho de Melo)

- Fix incorrect python db-export error message in 'perf script' (Chris Phlipot)

- Fix handling of zero-length symbols (Chris Phlipot)

Andi Kleen (1):
  perf stat: Scale values by unit before metrics

Infrastructure:

- Rewrite strbuf not to die(), making tools using it to check its
  return value instead (Masami Hiramatsu)

- Support reading from backward ring buffer, add a 'perf test' entry
  for it (Wang Nan)

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

----------------------------------------------------------------
Andi Kleen (1):
      perf stat: Scale values by unit before metrics

Arnaldo Carvalho de Melo (1):
      perf evsel: Print state of perf_event_attr.write_backward

Chris Phlipot (2):
      perf script: Fix incorrect python db-export error message
      perf symbols: Fix handling of zero-length symbols.

He Kuang (1):
      perf callchain: Recording 'dwarf' callchains do not need DWARF unwinding support

Masami Hiramatsu (8):
      perf tools: Rewrite strbuf not to die()
      perf probe: Check the return value of strbuf APIs
      perf help: Make check_emacsclient_version to check strbuf APIs
      perf tools: Make alias handler to check return value of strbuf
      perf header: Make topology checkers to check return value of strbuf
      perf pmu: Make pmu_formats_string to check return value of strbuf
      perf help: Do not use ALLOC_GROW in add_cmd_list
      perf tools: Remove xrealloc and ALLOC_GROW

Wang Nan (2):
      perf tools: Support reading from backward ring buffer
      perf tests: Add test to check backward ring buffer

 tools/perf/builtin-help.c                          |  18 +--
 tools/perf/perf.c                                  |   8 +-
 tools/perf/tests/Build                             |   1 +
 tools/perf/tests/backward-ring-buffer.c            | 151 +++++++++++++++++++++
 tools/perf/tests/builtin-test.c                    |   4 +
 tools/perf/tests/tests.h                           |   1 +
 tools/perf/util/Build                              |   1 -
 tools/perf/util/cache.h                            |  19 ---
 tools/perf/util/dwarf-aux.c                        |  52 ++++---
 tools/perf/util/evlist.c                           |  50 +++++++
 tools/perf/util/evlist.h                           |   4 +
 tools/perf/util/evsel.c                            |   1 +
 tools/perf/util/header.c                           |  31 +++--
 tools/perf/util/help-unknown-cmd.c                 |  30 ++--
 tools/perf/util/pmu.c                              |  10 +-
 tools/perf/util/probe-event.c                      | 143 +++++++++++--------
 tools/perf/util/probe-finder.c                     |  30 ++--
 tools/perf/util/quote.c                            |  36 ++---
 tools/perf/util/quote.h                            |   2 +-
 .../util/scripting-engines/trace-event-python.c    |   2 +-
 tools/perf/util/stat.c                             |   4 +-
 tools/perf/util/strbuf.c                           |  93 +++++++++----
 tools/perf/util/strbuf.h                           |  25 ++--
 tools/perf/util/symbol.c                           |   2 +-
 tools/perf/util/util.c                             |   2 -
 tools/perf/util/util.h                             |   6 -
 tools/perf/util/wrapper.c                          |  29 ----
 27 files changed, 510 insertions(+), 245 deletions(-)
 create mode 100644 tools/perf/tests/backward-ring-buffer.c
 delete mode 100644 tools/perf/util/wrapper.c

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2016-03-07 19:44 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-03-07 19:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Borislav Petkov, Colin Ian King,
	David Ahern, Davidlohr Bueso, He Kuang, Jiri Olsa, Mel Gorman,
	Namhyung Kim, Peter Zijlstra, Stephane Eranian, Steven Rostedt,
	Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 009668520ae00d52026ccdb3884864e3473c6b65:

  Merge tag 'perf-core-for-mingo-20160303' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-03-04 12:19:21 +0100)

are available in the git repository at:

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

for you to fetch changes up to b03ae342d9bec460a6c9c327c3f5f758263b0932:

  perf report: Use hierarchy hpp list on gtk (2016-03-07 15:10:41 -0300)

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

User visible:

- Allow grouping multiple sort keys per 'perf report/top --hierarchy'
  level (Namhyung Kim)

- Document 'perf stat --detailed' option (Borislav Petkov)

Infrastructure:

- jitdump prep work for supporting it with Intel PT (Adrian Hunter)

- Use 64-bit shifts with (TSC) time conversion (Adrian Hunter)

Trivial:

- Explicitly declare inc_group_count as a void function (Colin Ian King)

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

----------------------------------------------------------------
Adrian Hunter (5):
      perf inject: Hit all DSOs for AUX data in JIT and other cases
      perf session: Simplify tool stubs
      perf jit: Let jit_process() return errors
      perf jit: Move clockid validation
      perf tools: Use 64-bit shifts with (TSC) time conversion

Borislav Petkov (1):
      perf stat: Document --detailed option

Colin Ian King (1):
      perf tools: Explicitly declare inc_group_count as a void function

Namhyung Kim (8):
      perf hists: Add level field to struct perf_hpp_fmt
      perf hists: Introduce perf_hpp__setup_hists_formats()
      perf hists: Use own hpp_list for hierarchy mode
      perf hists: Support multiple sort keys in a hierarchy level
      perf hists: Fix indent for multiple hierarchy sort key
      perf report: Use hierarchy hpp list on stdio
      perf hists browser: Use hierarchy hpp list
      perf report: Use hierarchy hpp list on gtk

 tools/perf/Documentation/perf-stat.txt |   8 ++
 tools/perf/arch/x86/tests/rdpmc.c      |   2 +-
 tools/perf/builtin-inject.c            |  52 ++++------
 tools/perf/ui/browsers/hists.c         | 147 +++++++++++++++-------------
 tools/perf/ui/gtk/hists.c              |  73 ++++++++------
 tools/perf/ui/hist.c                   |  69 +++++++++++++
 tools/perf/ui/stdio/hist.c             | 171 +++++++++++++++++----------------
 tools/perf/util/hist.c                 |  72 +++++++++-----
 tools/perf/util/hist.h                 |  14 +++
 tools/perf/util/jitdump.c              |  29 +++++-
 tools/perf/util/parse-events.y         |   2 +-
 tools/perf/util/session.c              |  40 ++------
 tools/perf/util/sort.c                 | 146 ++++++++++++++++++++--------
 tools/perf/util/sort.h                 |   1 +
 tools/perf/util/tsc.c                  |   2 +-
 15 files changed, 514 insertions(+), 314 deletions(-)

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-09-14  8:41       ` Ingo Molnar
@ 2015-09-14  9:07         ` Wangnan (F)
  0 siblings, 0 replies; 51+ messages in thread
From: Wangnan (F) @ 2015-09-14  9:07 UTC (permalink / raw)
  To: Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Corey Ashford, David Ahern, Frederic Weisbecker,
	Jan Stancek, Jiri Olsa, Kan Liang, Matt Fleming, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Raphael Beamonte,
	Stephane Eranian, Steven Rostedt



On 2015/9/14 16:41, Ingo Molnar wrote:
> * Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
>
>> Em Tue, Sep 08, 2015 at 04:21:47PM +0200, Ingo Molnar escreveu:
>>> * Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
>>>
>>>> Em Fri, Sep 04, 2015 at 10:06:28PM -0300, Arnaldo Carvalho de Melo escreveu:
>>>>> Hi Ingo,
>>>>>
>>>>> 	Please consider pulling, this is on top of the previous pull request,
>>>>> perf-core-for-mingo.
>>>> 	Ingo, please do not pull this 'perf-core-for-mingo-2' tag, there were
>>>> some misunderstandings about the acks for "Move sw clock metrics
>>>> printout to stat-shadow" and Jiri and Andi are working that out.
>>>>
>>>> 	I'll remove those patches and get a new perf-core-for-mingo-2
>>>> tag in place, before continuing today's batch, which possibly will be
>>>> available as 'perf-core-for-mingo-3'
>>>>
>>>> 	What is in 'perf-core-for-mingo" should be Ok.
>>> Ok!
>> Thanks! I have already removed that problematic changeset and resigned
>> the 'perf-core-for-mingo-2' tag, same contents modulo that cset.
> Hm, so I pulled it (commit 1765d9b26f84), but with an old perf.data I'm getting
> this crash:
>
> triton:~/tip/tools/perf> perf report
> perf: Segmentation fault
> -------- backtrace --------
> perf[0x52bc0b]
> /lib/x86_64-linux-gnu/libc.so.6(+0x352f0)[0x7f51a583c2f0]
> perf[0x42ce95]
> perf[0x4bc6c3]
> perf[0x4bcfa1]
> perf[0x4bf939]
> perf(perf_session__process_events+0x390)[0x4be430]
> perf(cmd_report+0x1070)[0x42e2e0]
> perf[0x478e03]
> perf(main+0x60a)[0x41f1ba]
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f51a5827a40]
> perf(_start+0x29)[0x41f2d9]
> [0x0]
>
> I also re-tested qand it still crashes.
>
> Bisected it to:
>
>    e1e499aba570 perf tools: Add processor socket info to hist_entry and addr_location
>
> Running on Ubuntu, 1 socket box, 12 CPUs.

Hi Ingo,

It seems you met a bug we are discussing these days. Please have a look at
the following discussions:

http://lkml.kernel.org/r/1441630315-189525-1-git-send-email-wangnan0@huawei.com

http://lkml.kernel.org/r/1441828225-667-1-git-send-email-acme@kernel.org

Thank you.

> I went back to perf/core 8f3e5684d3fb and it doesn't crash anymore - so I unpulled
> your tree for now. (Will send you the perf.data privately.)
>
> Thanks,
>
> 	Ingo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-09-08 14:30     ` Arnaldo Carvalho de Melo
@ 2015-09-14  8:41       ` Ingo Molnar
  2015-09-14  9:07         ` Wangnan (F)
  0 siblings, 1 reply; 51+ messages in thread
From: Ingo Molnar @ 2015-09-14  8:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Corey Ashford, David Ahern, Frederic Weisbecker,
	Jan Stancek, Jiri Olsa, Kan Liang, Matt Fleming, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Raphael Beamonte,
	Stephane Eranian, Steven Rostedt


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

> Em Tue, Sep 08, 2015 at 04:21:47PM +0200, Ingo Molnar escreveu:
> > 
> > * Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> > 
> > > Em Fri, Sep 04, 2015 at 10:06:28PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > > Hi Ingo,
> > > > 
> > > > 	Please consider pulling, this is on top of the previous pull request,
> > > > perf-core-for-mingo.
> > > 
> > > 	Ingo, please do not pull this 'perf-core-for-mingo-2' tag, there were
> > > some misunderstandings about the acks for "Move sw clock metrics
> > > printout to stat-shadow" and Jiri and Andi are working that out.
> > > 
> > > 	I'll remove those patches and get a new perf-core-for-mingo-2
> > > tag in place, before continuing today's batch, which possibly will be
> > > available as 'perf-core-for-mingo-3'
> > > 
> > > 	What is in 'perf-core-for-mingo" should be Ok.
> > 
> > Ok!
> 
> Thanks! I have already removed that problematic changeset and resigned
> the 'perf-core-for-mingo-2' tag, same contents modulo that cset.

Hm, so I pulled it (commit 1765d9b26f84), but with an old perf.data I'm getting 
this crash:

triton:~/tip/tools/perf> perf report
perf: Segmentation fault
-------- backtrace --------
perf[0x52bc0b]
/lib/x86_64-linux-gnu/libc.so.6(+0x352f0)[0x7f51a583c2f0]
perf[0x42ce95]
perf[0x4bc6c3]
perf[0x4bcfa1]
perf[0x4bf939]
perf(perf_session__process_events+0x390)[0x4be430]
perf(cmd_report+0x1070)[0x42e2e0]
perf[0x478e03]
perf(main+0x60a)[0x41f1ba]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f51a5827a40]
perf(_start+0x29)[0x41f2d9]
[0x0]

I also re-tested 1765d9b26f84 and it still crashes.

Bisected it to:

  e1e499aba570 perf tools: Add processor socket info to hist_entry and addr_location

Running on Ubuntu, 1 socket box, 12 CPUs.

I went back to perf/core 8f3e5684d3fb and it doesn't crash anymore - so I unpulled 
your tree for now. (Will send you the perf.data privately.)

Thanks,

	Ingo

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-09-08 14:21   ` Ingo Molnar
@ 2015-09-08 14:30     ` Arnaldo Carvalho de Melo
  2015-09-14  8:41       ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-08 14:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Corey Ashford, David Ahern, Frederic Weisbecker,
	Jan Stancek, Jiri Olsa, Kan Liang, Matt Fleming, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Raphael Beamonte,
	Stephane Eranian, Steven Rostedt

Em Tue, Sep 08, 2015 at 04:21:47PM +0200, Ingo Molnar escreveu:
> 
> * Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> 
> > Em Fri, Sep 04, 2015 at 10:06:28PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Hi Ingo,
> > > 
> > > 	Please consider pulling, this is on top of the previous pull request,
> > > perf-core-for-mingo.
> > 
> > 	Ingo, please do not pull this 'perf-core-for-mingo-2' tag, there were
> > some misunderstandings about the acks for "Move sw clock metrics
> > printout to stat-shadow" and Jiri and Andi are working that out.
> > 
> > 	I'll remove those patches and get a new perf-core-for-mingo-2
> > tag in place, before continuing today's batch, which possibly will be
> > available as 'perf-core-for-mingo-3'
> > 
> > 	What is in 'perf-core-for-mingo" should be Ok.
> 
> Ok!

Thanks! I have already removed that problematic changeset and resigned
the 'perf-core-for-mingo-2' tag, same contents modulo that cset.

- Arnaldo

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-09-08 14:09 ` Arnaldo Carvalho de Melo
@ 2015-09-08 14:21   ` Ingo Molnar
  2015-09-08 14:30     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 51+ messages in thread
From: Ingo Molnar @ 2015-09-08 14:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Corey Ashford, David Ahern, Frederic Weisbecker,
	Jan Stancek, Jiri Olsa, Kan Liang, Matt Fleming, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Raphael Beamonte,
	Stephane Eranian, Steven Rostedt


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

> Em Fri, Sep 04, 2015 at 10:06:28PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Hi Ingo,
> > 
> > 	Please consider pulling, this is on top of the previous pull request,
> > perf-core-for-mingo.
> 
> 	Ingo, please do not pull this 'perf-core-for-mingo-2' tag, there were
> some misunderstandings about the acks for "Move sw clock metrics
> printout to stat-shadow" and Jiri and Andi are working that out.
> 
> 	I'll remove those patches and get a new perf-core-for-mingo-2
> tag in place, before continuing today's batch, which possibly will be
> available as 'perf-core-for-mingo-3'
> 
> 	What is in 'perf-core-for-mingo" should be Ok.

Ok!

Thanks,

	Ingo

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-09-05  1:06 Arnaldo Carvalho de Melo
@ 2015-09-08 14:09 ` Arnaldo Carvalho de Melo
  2015-09-08 14:21   ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-08 14:09 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Adrian Hunter, Andi Kleen,
	Corey Ashford, David Ahern, Frederic Weisbecker, Jan Stancek,
	Jiri Olsa, Kan Liang, Matt Fleming, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Raphael Beamonte, Stephane Eranian,
	Steven Rostedt

Em Fri, Sep 04, 2015 at 10:06:28PM -0300, Arnaldo Carvalho de Melo escreveu:
> Hi Ingo,
> 
> 	Please consider pulling, this is on top of the previous pull request,
> perf-core-for-mingo.

	Ingo, please do not pull this 'perf-core-for-mingo-2' tag, there were
some misunderstandings about the acks for "Move sw clock metrics
printout to stat-shadow" and Jiri and Andi are working that out.

	I'll remove those patches and get a new perf-core-for-mingo-2
tag in place, before continuing today's batch, which possibly will be
available as 'perf-core-for-mingo-3'

	What is in 'perf-core-for-mingo" should be Ok.

- Arnaldo
 
> - Arnaldo
> 
> The following changes since commit cf2f33a4e54096f90652cca3511fd6a456ea5abe:
> 
>   perf trace: Add read/write to the file group (2015-09-04 13:22:06 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-2
> 
> for you to fetch changes up to 0959e527b1593e662cb99639a587eac39ea1232d:
> 
>   perf stat: Move sw clock metrics printout to stat-shadow (2015-09-04 20:30:01 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Add 'socket' sort entry, to sort by the processor socket in
>   'perf top' and 'perf report' (Kan Liang)
> 
> - Introduce --socket-filter to 'perf report', for filtering by
>   processor socket (Kan Liang)
> 
> - Add new "Zoom into Processor Socket" operation in the perf hists browser,
>   used in 'perf top' and 'perf report' (Kan Liang)
> 
> Infrastructure:
> 
> - 'perf test' fixes for the object code reading entry (Jan Stancek)
> 
> - Add processor socket and cpu topology 'perf test' entries (Kan Liang)
> 
> - Move sw clock metrics printout to stat-shadow (Andi Kleen)
> 
> - Switch to tracing_patch interface (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (1):
>       perf stat: Move sw clock metrics printout to stat-shadow
> 
> Jan Stancek (4):
>       perf tests: Take into account address of each objdump line
>       perf tests: Make objdump disassemble zero blocks
>       perf tests: Stop reading if objdump output crossed sections
>       perf tests: Print objdump/dso buffers if they don't match
> 
> Jiri Olsa (4):
>       tools lib api fs: Make tracing_path_strerror_open message generic
>       tools lib api fs: Replace debugfs/tracefs objects interface with fs.c
>       tools lib api fs: Remove debugfs, tracefs and findfs objects
>       perf tools: Switch to tracing_path interface on appropriate places
> 
> Kan Liang (6):
>       perf test: Add entry to test cpu topology
>       perf tools: Add processor socket info to hist_entry and addr_location
>       perf tools: Introduce new sort type "socket" for the processor socket
>       perf report: Introduce --socket-filter option
>       perf hists browser: Zoom in/out for processor socket
>       perf test: Add entry for hists socket filter
> 
>  tools/lib/api/fs/Build                     |   3 -
>  tools/lib/api/fs/debugfs.c                 |  77 -------------------
>  tools/lib/api/fs/debugfs.h                 |  23 ------
>  tools/lib/api/fs/findfs.c                  |  63 ----------------
>  tools/lib/api/fs/findfs.h                  |  23 ------
>  tools/lib/api/fs/fs.c                      |   1 -
>  tools/lib/api/fs/tracefs.c                 |  78 -------------------
>  tools/lib/api/fs/tracefs.h                 |  21 ------
>  tools/lib/api/fs/tracing_path.c            |  35 +++++----
>  tools/perf/Documentation/perf-report.txt   |   6 +-
>  tools/perf/builtin-kvm.c                   |   1 -
>  tools/perf/builtin-probe.c                 |   1 -
>  tools/perf/builtin-report.c                |  15 ++++
>  tools/perf/builtin-stat.c                  |   9 ---
>  tools/perf/tests/Build                     |   1 +
>  tools/perf/tests/builtin-test.c            |   4 +
>  tools/perf/tests/code-reading.c            |  74 +++++++++++++++----
>  tools/perf/tests/hists_filter.c            |  55 +++++++++++---
>  tools/perf/tests/openat-syscall-all-cpus.c |  10 +--
>  tools/perf/tests/openat-syscall.c          |  10 +--
>  tools/perf/tests/parse-events.c            |  19 +----
>  tools/perf/tests/tests.h                   |   1 +
>  tools/perf/tests/topology.c                | 115 +++++++++++++++++++++++++++++
>  tools/perf/ui/browsers/hists.c             |  59 ++++++++++++++-
>  tools/perf/util/event.c                    |   1 +
>  tools/perf/util/evsel.c                    |   2 +-
>  tools/perf/util/hist.c                     |  37 ++++++++++
>  tools/perf/util/hist.h                     |   6 +-
>  tools/perf/util/probe-event.c              |   5 +-
>  tools/perf/util/probe-file.c               |  15 +---
>  tools/perf/util/sort.c                     |  22 ++++++
>  tools/perf/util/sort.h                     |   2 +
>  tools/perf/util/stat-shadow.c              |   3 +
>  tools/perf/util/symbol.h                   |   1 +
>  tools/perf/util/util.h                     |   3 +-
>  35 files changed, 409 insertions(+), 392 deletions(-)
>  delete mode 100644 tools/lib/api/fs/debugfs.c
>  delete mode 100644 tools/lib/api/fs/debugfs.h
>  delete mode 100644 tools/lib/api/fs/findfs.c
>  delete mode 100644 tools/lib/api/fs/findfs.h
>  delete mode 100644 tools/lib/api/fs/tracefs.c
>  delete mode 100644 tools/lib/api/fs/tracefs.h
>  create mode 100644 tools/perf/tests/topology.c

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2015-09-05  1:06 Arnaldo Carvalho de Melo
  2015-09-08 14:09 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-05  1:06 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Corey Ashford, David Ahern, Frederic Weisbecker,
	Jan Stancek, Jiri Olsa, Kan Liang, Matt Fleming, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Raphael Beamonte,
	Stephane Eranian, Steven Rostedt, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, this is on top of the previous pull request,
perf-core-for-mingo.

- Arnaldo

The following changes since commit cf2f33a4e54096f90652cca3511fd6a456ea5abe:

  perf trace: Add read/write to the file group (2015-09-04 13:22:06 -0300)

are available in the git repository at:

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

for you to fetch changes up to 0959e527b1593e662cb99639a587eac39ea1232d:

  perf stat: Move sw clock metrics printout to stat-shadow (2015-09-04 20:30:01 -0300)

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

User visible:

- Add 'socket' sort entry, to sort by the processor socket in
  'perf top' and 'perf report' (Kan Liang)

- Introduce --socket-filter to 'perf report', for filtering by
  processor socket (Kan Liang)

- Add new "Zoom into Processor Socket" operation in the perf hists browser,
  used in 'perf top' and 'perf report' (Kan Liang)

Infrastructure:

- 'perf test' fixes for the object code reading entry (Jan Stancek)

- Add processor socket and cpu topology 'perf test' entries (Kan Liang)

- Move sw clock metrics printout to stat-shadow (Andi Kleen)

- Switch to tracing_patch interface (Jiri Olsa)

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

----------------------------------------------------------------
Andi Kleen (1):
      perf stat: Move sw clock metrics printout to stat-shadow

Jan Stancek (4):
      perf tests: Take into account address of each objdump line
      perf tests: Make objdump disassemble zero blocks
      perf tests: Stop reading if objdump output crossed sections
      perf tests: Print objdump/dso buffers if they don't match

Jiri Olsa (4):
      tools lib api fs: Make tracing_path_strerror_open message generic
      tools lib api fs: Replace debugfs/tracefs objects interface with fs.c
      tools lib api fs: Remove debugfs, tracefs and findfs objects
      perf tools: Switch to tracing_path interface on appropriate places

Kan Liang (6):
      perf test: Add entry to test cpu topology
      perf tools: Add processor socket info to hist_entry and addr_location
      perf tools: Introduce new sort type "socket" for the processor socket
      perf report: Introduce --socket-filter option
      perf hists browser: Zoom in/out for processor socket
      perf test: Add entry for hists socket filter

 tools/lib/api/fs/Build                     |   3 -
 tools/lib/api/fs/debugfs.c                 |  77 -------------------
 tools/lib/api/fs/debugfs.h                 |  23 ------
 tools/lib/api/fs/findfs.c                  |  63 ----------------
 tools/lib/api/fs/findfs.h                  |  23 ------
 tools/lib/api/fs/fs.c                      |   1 -
 tools/lib/api/fs/tracefs.c                 |  78 -------------------
 tools/lib/api/fs/tracefs.h                 |  21 ------
 tools/lib/api/fs/tracing_path.c            |  35 +++++----
 tools/perf/Documentation/perf-report.txt   |   6 +-
 tools/perf/builtin-kvm.c                   |   1 -
 tools/perf/builtin-probe.c                 |   1 -
 tools/perf/builtin-report.c                |  15 ++++
 tools/perf/builtin-stat.c                  |   9 ---
 tools/perf/tests/Build                     |   1 +
 tools/perf/tests/builtin-test.c            |   4 +
 tools/perf/tests/code-reading.c            |  74 +++++++++++++++----
 tools/perf/tests/hists_filter.c            |  55 +++++++++++---
 tools/perf/tests/openat-syscall-all-cpus.c |  10 +--
 tools/perf/tests/openat-syscall.c          |  10 +--
 tools/perf/tests/parse-events.c            |  19 +----
 tools/perf/tests/tests.h                   |   1 +
 tools/perf/tests/topology.c                | 115 +++++++++++++++++++++++++++++
 tools/perf/ui/browsers/hists.c             |  59 ++++++++++++++-
 tools/perf/util/event.c                    |   1 +
 tools/perf/util/evsel.c                    |   2 +-
 tools/perf/util/hist.c                     |  37 ++++++++++
 tools/perf/util/hist.h                     |   6 +-
 tools/perf/util/probe-event.c              |   5 +-
 tools/perf/util/probe-file.c               |  15 +---
 tools/perf/util/sort.c                     |  22 ++++++
 tools/perf/util/sort.h                     |   2 +
 tools/perf/util/stat-shadow.c              |   3 +
 tools/perf/util/symbol.h                   |   1 +
 tools/perf/util/util.h                     |   3 +-
 35 files changed, 409 insertions(+), 392 deletions(-)
 delete mode 100644 tools/lib/api/fs/debugfs.c
 delete mode 100644 tools/lib/api/fs/debugfs.h
 delete mode 100644 tools/lib/api/fs/findfs.c
 delete mode 100644 tools/lib/api/fs/findfs.h
 delete mode 100644 tools/lib/api/fs/tracefs.c
 delete mode 100644 tools/lib/api/fs/tracefs.h
 create mode 100644 tools/perf/tests/topology.c

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-06-08 14:17 Arnaldo Carvalho de Melo
@ 2015-06-09  9:47 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2015-06-09  9:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, David Ahern, He Kuang,
	Jiri Olsa, Namhyung Kim, Peter Zijlstra, Stephane Eranian,
	Wang Nan, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, more to come,
> 
> - Arnaldo
> 
> The following changes since commit a3d86542de8850be52e8589da22b24002941dfb7:
> 
>   perf/x86/intel/pebs: Add PEBSv3 decoding (2015-06-07 16:09:16 +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 d3a7c489c7fd2463e3b2c3a2179c7be879dd9cb4:
> 
>   perf tools: Reference count struct dso (2015-06-08 10:31:40 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Fix perf.data size reporting in 'perf record' in no-buildid mode (He Kuang)
> 
> Infrastructure:
> 
> - Protect accesses the dso rbtrees/lists with a rw lock and reference
>   count struct dso instances (Arnaldo Carvalho de Melo)
> 
> - Export dynamic symbols used by traceevent plugins (He Kuang)
> 
> - Add libtrace-dynamic-list file to libtraceevent's .gitignore (He Kuang)
> 
> - Refactor shadow stats code in 'perf stat', prep work for further
>   patchkits (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (3):
>       perf machine: Fix up some more method names
>       perf tools: Protect accesses the dso rbtrees/lists with a rw lock
>       perf tools: Reference count struct dso
> 
> He Kuang (3):
>       tools lib traceevent: Export dynamic symbols used by traceevent plugins
>       tools lib traceevent: Ignore libtrace-dynamic-list file
>       perf record: Fix perf.data size in no-buildid mode
> 
> Jiri Olsa (9):
>       perf stat: Add id into perf_stat struct
>       perf stat: Replace transaction event possition check with id check
>       perf stat: Remove setup_events function
>       perf stat: Remove transaction_run from shadow update/print code
>       perf stat: Introduce reset_shadow_stats function
>       perf stat: Introduce print_shadow_stats function
>       perf stat: Add output file argument to print_shadow_stats function
>       perf stat: Add aggr_mode argument to print_shadow_stats function
>       perf stat: Move shadow stat counters into separate object
> 
>  tools/lib/traceevent/.gitignore |   1 +
>  tools/lib/traceevent/Makefile   |  14 +-
>  tools/perf/Makefile.perf        |  14 +-
>  tools/perf/builtin-record.c     |   6 +-
>  tools/perf/builtin-stat.c       | 506 ++--------------------------------------
>  tools/perf/tests/dso-data.c     |   4 +-
>  tools/perf/tests/hists_common.c |   6 +-
>  tools/perf/util/Build           |   1 +
>  tools/perf/util/dso.c           |  87 +++++--
>  tools/perf/util/dso.h           |  24 +-
>  tools/perf/util/header.c        |   1 +
>  tools/perf/util/machine.c       |  58 +++--
>  tools/perf/util/machine.h       |   4 +-
>  tools/perf/util/map.c           |  11 +-
>  tools/perf/util/probe-event.c   |   2 +-
>  tools/perf/util/probe-finder.c  |   2 +-
>  tools/perf/util/stat-shadow.c   | 434 ++++++++++++++++++++++++++++++++++
>  tools/perf/util/stat.c          |  35 ++-
>  tools/perf/util/stat.h          |  40 ++++
>  tools/perf/util/symbol-elf.c    |   2 +-
>  tools/perf/util/symbol.c        |   4 +-
>  tools/perf/util/vdso.c          |  54 +++--
>  22 files changed, 737 insertions(+), 573 deletions(-)
>  create mode 100644 tools/perf/util/stat-shadow.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2015-06-08 14:17 Arnaldo Carvalho de Melo
  2015-06-09  9:47 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-08 14:17 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, David Ahern, He Kuang, Jiri Olsa, Namhyung Kim,
	Peter Zijlstra, Stephane Eranian, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, more to come,

- Arnaldo

The following changes since commit a3d86542de8850be52e8589da22b24002941dfb7:

  perf/x86/intel/pebs: Add PEBSv3 decoding (2015-06-07 16:09:16 +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 d3a7c489c7fd2463e3b2c3a2179c7be879dd9cb4:

  perf tools: Reference count struct dso (2015-06-08 10:31:40 -0300)

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

User visible:

- Fix perf.data size reporting in 'perf record' in no-buildid mode (He Kuang)

Infrastructure:

- Protect accesses the dso rbtrees/lists with a rw lock and reference
  count struct dso instances (Arnaldo Carvalho de Melo)

- Export dynamic symbols used by traceevent plugins (He Kuang)

- Add libtrace-dynamic-list file to libtraceevent's .gitignore (He Kuang)

- Refactor shadow stats code in 'perf stat', prep work for further
  patchkits (Jiri Olsa)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
      perf machine: Fix up some more method names
      perf tools: Protect accesses the dso rbtrees/lists with a rw lock
      perf tools: Reference count struct dso

He Kuang (3):
      tools lib traceevent: Export dynamic symbols used by traceevent plugins
      tools lib traceevent: Ignore libtrace-dynamic-list file
      perf record: Fix perf.data size in no-buildid mode

Jiri Olsa (9):
      perf stat: Add id into perf_stat struct
      perf stat: Replace transaction event possition check with id check
      perf stat: Remove setup_events function
      perf stat: Remove transaction_run from shadow update/print code
      perf stat: Introduce reset_shadow_stats function
      perf stat: Introduce print_shadow_stats function
      perf stat: Add output file argument to print_shadow_stats function
      perf stat: Add aggr_mode argument to print_shadow_stats function
      perf stat: Move shadow stat counters into separate object

 tools/lib/traceevent/.gitignore |   1 +
 tools/lib/traceevent/Makefile   |  14 +-
 tools/perf/Makefile.perf        |  14 +-
 tools/perf/builtin-record.c     |   6 +-
 tools/perf/builtin-stat.c       | 506 ++--------------------------------------
 tools/perf/tests/dso-data.c     |   4 +-
 tools/perf/tests/hists_common.c |   6 +-
 tools/perf/util/Build           |   1 +
 tools/perf/util/dso.c           |  87 +++++--
 tools/perf/util/dso.h           |  24 +-
 tools/perf/util/header.c        |   1 +
 tools/perf/util/machine.c       |  58 +++--
 tools/perf/util/machine.h       |   4 +-
 tools/perf/util/map.c           |  11 +-
 tools/perf/util/probe-event.c   |   2 +-
 tools/perf/util/probe-finder.c  |   2 +-
 tools/perf/util/stat-shadow.c   | 434 ++++++++++++++++++++++++++++++++++
 tools/perf/util/stat.c          |  35 ++-
 tools/perf/util/stat.h          |  40 ++++
 tools/perf/util/symbol-elf.c    |   2 +-
 tools/perf/util/symbol.c        |   4 +-
 tools/perf/util/vdso.c          |  54 +++--
 22 files changed, 737 insertions(+), 573 deletions(-)
 create mode 100644 tools/perf/util/stat-shadow.c

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2015-04-02 22:28 Arnaldo Carvalho de Melo
@ 2015-04-03  5:02 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2015-04-03  5:02 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern,
	Don Zickus, Frederic Weisbecker, Jiri Olsa, Masami Hiramatsu,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Wang Nan, Yunlong Song, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit e1abf2cc8d5d80b41c4419368ec743ccadbb131e:
> 
>   bpf: Fix the build on BPF_SYSCALL=y && !CONFIG_TRACING kernels, make it more configurable (2015-04-02 16:28:06 +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 bd05954bfa17f03a7bd4454178ba09786b35e383:
> 
>   perf data: Support using -f to override perf.data file ownership for 'convert' (2015-04-02 13:18:52 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Support unnamed union/structure members data collection in 'perf probe' (Masami Hiramatsu)
> 
> - Support missing -f to override perf.data file ownership (Yunlong Song)
> 
> Infrastructure:
> 
> - No need to lookup thread twice when processing samples in 'perf script' (Arnaldo Carvalho de Melo)
> 
> - No need to pass thread twice to the scripting callbacks (Arnaldo Carvalho de Melo)
> 
> - No need to pass thread twice to the db-export facility (Arnaldo Carvalho de Melo)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (4):
>       perf script: No need to lookup thread twice
>       perf scripting: No need to pass thread twice to the scripting callbacks
>       perf db-export: No need to pass thread twice to db_export__sample
>       perf db-export: No need to have ->thread twice in struct export_sample
> 
> Masami Hiramatsu (1):
>       perf probe: Fix to track down unnamed union/structure members
> 
> Yunlong Song (10):
>       perf evlist: Support using -f to override perf.data file ownership
>       perf inject: Support using -f to override perf.data file ownership
>       perf kmem: Support using -f to override perf.data file ownership
>       perf kvm: Support using -f to override perf.data.guest file ownership
>       perf lock: Support using -f to override perf.data file ownership
>       perf mem: Support using -f to override perf.data file ownership
>       perf script: Support using -f to override perf.data file ownership
>       perf timechart: Support using -f to override perf.data file ownership
>       perf trace: Support using -f to override perf.data file ownership
>       perf data: Support using -f to override perf.data file ownership for 'convert'
> 
>  tools/perf/builtin-data.c                          |  4 +++-
>  tools/perf/builtin-evlist.c                        |  2 ++
>  tools/perf/builtin-inject.c                        |  1 +
>  tools/perf/builtin-kmem.c                          |  9 +++++----
>  tools/perf/builtin-kvm.c                           |  2 ++
>  tools/perf/builtin-lock.c                          |  5 +++++
>  tools/perf/builtin-mem.c                           |  3 +++
>  tools/perf/builtin-script.c                        | 23 ++++++++--------------
>  tools/perf/builtin-timechart.c                     |  3 +++
>  tools/perf/builtin-trace.c                         |  3 +++
>  tools/perf/util/data-convert-bt.c                  |  3 ++-
>  tools/perf/util/data-convert-bt.h                  |  2 +-
>  tools/perf/util/db-export.c                        |  4 ++--
>  tools/perf/util/db-export.h                        |  3 +--
>  tools/perf/util/dwarf-aux.c                        | 14 +++++++++----
>  tools/perf/util/evsel.h                            |  1 +
>  tools/perf/util/kvm-stat.h                         |  1 +
>  tools/perf/util/probe-finder.c                     |  8 +++++++-
>  .../perf/util/scripting-engines/trace-event-perl.c |  5 ++---
>  .../util/scripting-engines/trace-event-python.c    | 16 ++++++---------
>  tools/perf/util/trace-event-scripting.c            |  1 -
>  tools/perf/util/trace-event.h                      |  3 +--
>  22 files changed, 69 insertions(+), 47 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2015-04-02 22:28 Arnaldo Carvalho de Melo
  2015-04-03  5:02 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-04-02 22:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, David Ahern, Don Zickus, Frederic Weisbecker,
	Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Wang Nan, Yunlong Song,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit e1abf2cc8d5d80b41c4419368ec743ccadbb131e:

  bpf: Fix the build on BPF_SYSCALL=y && !CONFIG_TRACING kernels, make it more configurable (2015-04-02 16:28:06 +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 bd05954bfa17f03a7bd4454178ba09786b35e383:

  perf data: Support using -f to override perf.data file ownership for 'convert' (2015-04-02 13:18:52 -0300)

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

User visible:

- Support unnamed union/structure members data collection in 'perf probe' (Masami Hiramatsu)

- Support missing -f to override perf.data file ownership (Yunlong Song)

Infrastructure:

- No need to lookup thread twice when processing samples in 'perf script' (Arnaldo Carvalho de Melo)

- No need to pass thread twice to the scripting callbacks (Arnaldo Carvalho de Melo)

- No need to pass thread twice to the db-export facility (Arnaldo Carvalho de Melo)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (4):
      perf script: No need to lookup thread twice
      perf scripting: No need to pass thread twice to the scripting callbacks
      perf db-export: No need to pass thread twice to db_export__sample
      perf db-export: No need to have ->thread twice in struct export_sample

Masami Hiramatsu (1):
      perf probe: Fix to track down unnamed union/structure members

Yunlong Song (10):
      perf evlist: Support using -f to override perf.data file ownership
      perf inject: Support using -f to override perf.data file ownership
      perf kmem: Support using -f to override perf.data file ownership
      perf kvm: Support using -f to override perf.data.guest file ownership
      perf lock: Support using -f to override perf.data file ownership
      perf mem: Support using -f to override perf.data file ownership
      perf script: Support using -f to override perf.data file ownership
      perf timechart: Support using -f to override perf.data file ownership
      perf trace: Support using -f to override perf.data file ownership
      perf data: Support using -f to override perf.data file ownership for 'convert'

 tools/perf/builtin-data.c                          |  4 +++-
 tools/perf/builtin-evlist.c                        |  2 ++
 tools/perf/builtin-inject.c                        |  1 +
 tools/perf/builtin-kmem.c                          |  9 +++++----
 tools/perf/builtin-kvm.c                           |  2 ++
 tools/perf/builtin-lock.c                          |  5 +++++
 tools/perf/builtin-mem.c                           |  3 +++
 tools/perf/builtin-script.c                        | 23 ++++++++--------------
 tools/perf/builtin-timechart.c                     |  3 +++
 tools/perf/builtin-trace.c                         |  3 +++
 tools/perf/util/data-convert-bt.c                  |  3 ++-
 tools/perf/util/data-convert-bt.h                  |  2 +-
 tools/perf/util/db-export.c                        |  4 ++--
 tools/perf/util/db-export.h                        |  3 +--
 tools/perf/util/dwarf-aux.c                        | 14 +++++++++----
 tools/perf/util/evsel.h                            |  1 +
 tools/perf/util/kvm-stat.h                         |  1 +
 tools/perf/util/probe-finder.c                     |  8 +++++++-
 .../perf/util/scripting-engines/trace-event-perl.c |  5 ++---
 .../util/scripting-engines/trace-event-python.c    | 16 ++++++---------
 tools/perf/util/trace-event-scripting.c            |  1 -
 tools/perf/util/trace-event.h                      |  3 +--
 22 files changed, 69 insertions(+), 47 deletions(-)

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2014-10-15 20:52 Arnaldo Carvalho de Melo
@ 2014-10-16  5:18 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2014-10-16  5:18 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Alexander Yarygin, Andi Kleen, Anshuman Khandual,
	Arun Sharma, Christian Borntraeger, Cody P Schafer, David Ahern,
	Frederic Weisbecker, Haren Myneni, Jean Pihet, Jiri Olsa,
	Kan Liang, linuxppc-dev, Masanari Iida, Michael Ellerman,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Randy Dunlap, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song,
	Yasser Shalabi, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, I guess the changes are minor of affect just some
> non-core feature, so it is you call if you prefer to pull it into perf/urgent instead.
> 
> Best Regards,
> 
> - Arnaldo
> 
> The following changes since commit ec4212d88a77eb6caec10777ddd629b702a5ebbd:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-10-15 11:54:14 +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 673d659f5c5918b7ddbafebf1f129c9eb82973b4:
> 
>   perf kvm stat live: Enable events copying (2014-10-15 17:39:03 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> * Add a visual cue for toggle zeroing of samples in 'perf top' (Taeung Song)
> 
> * Fix for double free in 'perf stat' when using some specific invalid
>   command line combo (Yasser Shalabi)
> 
> Infrastructure:
> 
> * Add option to copy events when queuing for sorting across cpu buffers
>   and enable it for 'perf kvm stat live', to avoid having events left
>   in the queue pointing to the ring buffer be rewritten in high volume
>   sessions.  (Alexander Yarygin, improving work done by David Ahern):
> 
> * Document sysfs events/ interfaces (Cody P Schafer)
> 
> * Add support to new style format of kernel PMU event. (Kan Liang)
> 
> * Fix typos in perf/Documentation (Masanari Iida)
> 
> * Improve callchains when using libunwind (Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>   Lines starting with '#' will be ignored.
> 
> ----------------------------------------------------------------
> Alexander Yarygin (2):
>       perf session: Add option to copy events when queueing
>       perf kvm stat live: Enable events copying
> 
> Cody P Schafer (2):
>       perf Documentation: sysfs events/ interfaces
>       perf Documentation: Remove Ruplicated docs for powerpc cpu specific events
> 
> Kan Liang (4):
>       Revert "perf tools: Default to cpu// for events v5"
>       perf tools: Parse the pmu event prefix and suffix
>       perf tools: Add support to new style format of kernel PMU event
>       perf test: Add test case for pmu event new style format
> 
> Masanari Iida (1):
>       perf Documentation: Fix typos in perf/Documentation
> 
> Namhyung Kim (4):
>       perf report: Set callchain_param.record_mode for future use
>       perf callchain: Create an address space per thread
>       perf kvm: Use thread_{,_set}_priv helpers
>       perf trace: Use thread_{,_set}_priv helpers
> 
> Taeung Song (1):
>       perf top: Add a visual cue for toggle zeroing of samples
> 
> Yasser Shalabi (1):
>       perf evlist: Fix for double free in tools/perf stat
> 
>  .../testing/sysfs-bus-event_source-devices-events  | 611 ++-------------------
>  tools/perf/Documentation/perf-diff.txt             |   6 +-
>  tools/perf/Documentation/perf-kvm.txt              |   4 +-
>  tools/perf/Documentation/perf-list.txt             |   2 +-
>  tools/perf/Documentation/perf-record.txt           |   2 +-
>  tools/perf/Documentation/perf-script-perl.txt      |   4 +-
>  tools/perf/Documentation/perf-script-python.txt    |   6 +-
>  tools/perf/Documentation/perf-script.txt           |   2 +-
>  tools/perf/Documentation/perf-test.txt             |   2 +-
>  tools/perf/Documentation/perf-trace.txt            |   2 +-
>  tools/perf/builtin-kvm.c                           |   7 +-
>  tools/perf/builtin-report.c                        |   7 +
>  tools/perf/builtin-trace.c                         |  16 +-
>  tools/perf/tests/dwarf-unwind.c                    |   3 +
>  tools/perf/tests/parse-events.c                    |  36 ++
>  tools/perf/ui/browsers/hists.c                     |  32 +-
>  tools/perf/util/evlist.c                           |   1 +
>  tools/perf/util/include/linux/string.h             |   1 -
>  tools/perf/util/ordered-events.c                   |  49 +-
>  tools/perf/util/ordered-events.h                   |  10 +-
>  tools/perf/util/parse-events.c                     | 133 ++++-
>  tools/perf/util/parse-events.h                     |  14 +
>  tools/perf/util/parse-events.l                     |  30 +-
>  tools/perf/util/parse-events.y                     |  40 ++
>  tools/perf/util/pmu.c                              |  10 -
>  tools/perf/util/pmu.h                              |  10 +
>  tools/perf/util/session.c                          |   5 +-
>  tools/perf/util/string.c                           |  24 -
>  tools/perf/util/thread.c                           |   6 +
>  tools/perf/util/unwind-libunwind.c                 |  37 +-
>  tools/perf/util/unwind.h                           |  17 +
>  31 files changed, 460 insertions(+), 669 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2014-10-15 20:52 Arnaldo Carvalho de Melo
  2014-10-16  5:18 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-10-15 20:52 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Yarygin,
	Andi Kleen, Anshuman Khandual, Arun Sharma,
	Christian Borntraeger, Cody P Schafer, David Ahern,
	Frederic Weisbecker, Haren Myneni, Jean Pihet, Jiri Olsa,
	Kan Liang, linuxppc-dev, Masanari Iida, Michael Ellerman,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Randy Dunlap, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song,
	Yasser Shalabi, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, I guess the changes are minor of affect just some
non-core feature, so it is you call if you prefer to pull it into perf/urgent instead.

Best Regards,

- Arnaldo

The following changes since commit ec4212d88a77eb6caec10777ddd629b702a5ebbd:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2014-10-15 11:54:14 +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 673d659f5c5918b7ddbafebf1f129c9eb82973b4:

  perf kvm stat live: Enable events copying (2014-10-15 17:39:03 -0300)

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

User visible:

* Add a visual cue for toggle zeroing of samples in 'perf top' (Taeung Song)

* Fix for double free in 'perf stat' when using some specific invalid
  command line combo (Yasser Shalabi)

Infrastructure:

* Add option to copy events when queuing for sorting across cpu buffers
  and enable it for 'perf kvm stat live', to avoid having events left
  in the queue pointing to the ring buffer be rewritten in high volume
  sessions.  (Alexander Yarygin, improving work done by David Ahern):

* Document sysfs events/ interfaces (Cody P Schafer)

* Add support to new style format of kernel PMU event. (Kan Liang)

* Fix typos in perf/Documentation (Masanari Iida)

* Improve callchains when using libunwind (Namhyung Kim)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  Lines starting with '#' will be ignored.

----------------------------------------------------------------
Alexander Yarygin (2):
      perf session: Add option to copy events when queueing
      perf kvm stat live: Enable events copying

Cody P Schafer (2):
      perf Documentation: sysfs events/ interfaces
      perf Documentation: Remove Ruplicated docs for powerpc cpu specific events

Kan Liang (4):
      Revert "perf tools: Default to cpu// for events v5"
      perf tools: Parse the pmu event prefix and suffix
      perf tools: Add support to new style format of kernel PMU event
      perf test: Add test case for pmu event new style format

Masanari Iida (1):
      perf Documentation: Fix typos in perf/Documentation

Namhyung Kim (4):
      perf report: Set callchain_param.record_mode for future use
      perf callchain: Create an address space per thread
      perf kvm: Use thread_{,_set}_priv helpers
      perf trace: Use thread_{,_set}_priv helpers

Taeung Song (1):
      perf top: Add a visual cue for toggle zeroing of samples

Yasser Shalabi (1):
      perf evlist: Fix for double free in tools/perf stat

 .../testing/sysfs-bus-event_source-devices-events  | 611 ++-------------------
 tools/perf/Documentation/perf-diff.txt             |   6 +-
 tools/perf/Documentation/perf-kvm.txt              |   4 +-
 tools/perf/Documentation/perf-list.txt             |   2 +-
 tools/perf/Documentation/perf-record.txt           |   2 +-
 tools/perf/Documentation/perf-script-perl.txt      |   4 +-
 tools/perf/Documentation/perf-script-python.txt    |   6 +-
 tools/perf/Documentation/perf-script.txt           |   2 +-
 tools/perf/Documentation/perf-test.txt             |   2 +-
 tools/perf/Documentation/perf-trace.txt            |   2 +-
 tools/perf/builtin-kvm.c                           |   7 +-
 tools/perf/builtin-report.c                        |   7 +
 tools/perf/builtin-trace.c                         |  16 +-
 tools/perf/tests/dwarf-unwind.c                    |   3 +
 tools/perf/tests/parse-events.c                    |  36 ++
 tools/perf/ui/browsers/hists.c                     |  32 +-
 tools/perf/util/evlist.c                           |   1 +
 tools/perf/util/include/linux/string.h             |   1 -
 tools/perf/util/ordered-events.c                   |  49 +-
 tools/perf/util/ordered-events.h                   |  10 +-
 tools/perf/util/parse-events.c                     | 133 ++++-
 tools/perf/util/parse-events.h                     |  14 +
 tools/perf/util/parse-events.l                     |  30 +-
 tools/perf/util/parse-events.y                     |  40 ++
 tools/perf/util/pmu.c                              |  10 -
 tools/perf/util/pmu.h                              |  10 +
 tools/perf/util/session.c                          |   5 +-
 tools/perf/util/string.c                           |  24 -
 tools/perf/util/thread.c                           |   6 +
 tools/perf/util/unwind-libunwind.c                 |  37 +-
 tools/perf/util/unwind.h                           |  17 +
 31 files changed, 460 insertions(+), 669 deletions(-)

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2014-06-09 20:02 Jiri Olsa
@ 2014-06-12 11:54 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2014-06-12 11:54 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo,
	Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker,
	Javi Merino, Jean Pihet, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt


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

> 
> hi Ingo,
> please consider pulling
> 
> thanks,
> jirka
> 
> 
> The following changes since commit 82b897782d10fcc4930c9d4a15b175348fdd2871:
> 
>   perf: Differentiate exec() and non-exec() comm events (2014-06-06 07:56:22 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to a2609f3b0c582d6aaa8f69a61a0eea6c7a98d291:
> 
>   perf tools: Support spark lines in perf stat (2014-06-09 13:34:50 +0200)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> . Bitmask handling and plugin updates (Steven Rostedt)
> 
> . Fix pipe check regression in attr event callback (Jiri Olsa)
> 
> . Prettify the tags/TAGS/cscope targets output (Jiri Olsa)
> 
> . Print array argument as string (Namhyung Kim)
> 
> . Pass protection and flags bits through mmap2 interface (Peter Zijlstra)
> 
> . Update perf tool mmap2 interface with protection and flag bits (Don Zickus)
> 
> . Re-enable mmap interface (Don Zickus)
> 
> . Add mem-mode documentation to report command (Don Zickus)
> 
> . Add sort on dcacheline (Don Zickus)
> 
> . Support spark lines in perf stat (Andi Kleen)
> 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> ----------------------------------------------------------------
> Andi Kleen (1):
>       perf tools: Support spark lines in perf stat
> 
> Don Zickus (6):
>       perf tools: Update mmap2 interface with protection and flag bits
>       Revert "perf: Disable PERF_RECORD_MMAP2 support"
>       perf report: Add mem-mode documentation to report command
>       perf tools: Add cpumode to struct hist_entry
>       perf tools: Add support to dynamically get cacheline size
>       perf tools: Add dcacheline sort
> 
> Jiri Olsa (2):
>       perf tools: Fix pipe check regression in attr event callback
>       perf tools: Prettify the tags/TAGS/cscope targets output
> 
> Namhyung Kim (1):
>       perf script/python: Print array argument as string
> 
> Peter Zijlstra (1):
>       perf: Pass protection and flags bits through mmap2 interface
> 
> Steven Rostedt (1):
>       tools lib traceevent: Add options to plugins
> 
> Steven Rostedt (Red Hat) (3):
>       tools lib traceevent: Add flag to not load event plugins
>       tools lib traceevent: Add options to function plugin
>       tools lib traceevent: Added support for __get_bitmask() macro
> 
>  include/uapi/linux/perf_event.h                    |   1 +
>  kernel/events/core.c                               |  37 +++-
>  tools/lib/traceevent/event-parse.c                 | 113 ++++++++++++
>  tools/lib/traceevent/event-parse.h                 |  25 ++-
>  tools/lib/traceevent/event-plugin.c                | 203 ++++++++++++++++++++-
>  tools/lib/traceevent/plugin_function.c             |  43 ++++-
>  tools/perf/Documentation/perf-report.txt           |  23 +++
>  tools/perf/Documentation/perf-stat.txt             |   4 +
>  tools/perf/Makefile.perf                           |   7 +-
>  tools/perf/builtin-inject.c                        |   2 +-
>  tools/perf/builtin-stat.c                          |  12 ++
>  tools/perf/perf.c                                  |   1 +
>  tools/perf/tests/dwarf-unwind.c                    |   2 +-
>  tools/perf/util/event.c                            |  57 ++++--
>  tools/perf/util/event.h                            |   2 +
>  tools/perf/util/evsel.c                            |   1 +
>  tools/perf/util/hist.c                             |   9 +-
>  tools/perf/util/hist.h                             |   1 +
>  tools/perf/util/machine.c                          |   4 +-
>  tools/perf/util/map.c                              |   4 +-
>  tools/perf/util/map.h                              |   4 +-
>  .../perf/util/scripting-engines/trace-event-perl.c |   1 +
>  .../util/scripting-engines/trace-event-python.c    |   2 +
>  tools/perf/util/sort.c                             | 107 +++++++++++
>  tools/perf/util/sort.h                             |   2 +
>  tools/perf/util/spark.c                            |  31 ++++
>  tools/perf/util/spark.h                            |   4 +
>  tools/perf/util/stat.c                             |  34 ++++
>  tools/perf/util/stat.h                             |  10 +
>  tools/perf/util/util.c                             |   1 +
>  tools/perf/util/util.h                             |   1 +
>  31 files changed, 707 insertions(+), 41 deletions(-)
>  create mode 100644 tools/perf/util/spark.c
>  create mode 100644 tools/perf/util/spark.h

Pulled, thanks a lot Jiri!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2014-06-09 20:02 Jiri Olsa
  2014-06-12 11:54 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Jiri Olsa @ 2014-06-09 20:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo,
	Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker,
	Javi Merino, Jean Pihet, Jiri Olsa, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Steven Rostedt


hi Ingo,
please consider pulling

thanks,
jirka


The following changes since commit 82b897782d10fcc4930c9d4a15b175348fdd2871:

  perf: Differentiate exec() and non-exec() comm events (2014-06-06 07:56:22 +0200)

are available in the git repository at:

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

for you to fetch changes up to a2609f3b0c582d6aaa8f69a61a0eea6c7a98d291:

  perf tools: Support spark lines in perf stat (2014-06-09 13:34:50 +0200)

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

. Bitmask handling and plugin updates (Steven Rostedt)

. Fix pipe check regression in attr event callback (Jiri Olsa)

. Prettify the tags/TAGS/cscope targets output (Jiri Olsa)

. Print array argument as string (Namhyung Kim)

. Pass protection and flags bits through mmap2 interface (Peter Zijlstra)

. Update perf tool mmap2 interface with protection and flag bits (Don Zickus)

. Re-enable mmap interface (Don Zickus)

. Add mem-mode documentation to report command (Don Zickus)

. Add sort on dcacheline (Don Zickus)

. Support spark lines in perf stat (Andi Kleen)

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

----------------------------------------------------------------
Andi Kleen (1):
      perf tools: Support spark lines in perf stat

Don Zickus (6):
      perf tools: Update mmap2 interface with protection and flag bits
      Revert "perf: Disable PERF_RECORD_MMAP2 support"
      perf report: Add mem-mode documentation to report command
      perf tools: Add cpumode to struct hist_entry
      perf tools: Add support to dynamically get cacheline size
      perf tools: Add dcacheline sort

Jiri Olsa (2):
      perf tools: Fix pipe check regression in attr event callback
      perf tools: Prettify the tags/TAGS/cscope targets output

Namhyung Kim (1):
      perf script/python: Print array argument as string

Peter Zijlstra (1):
      perf: Pass protection and flags bits through mmap2 interface

Steven Rostedt (1):
      tools lib traceevent: Add options to plugins

Steven Rostedt (Red Hat) (3):
      tools lib traceevent: Add flag to not load event plugins
      tools lib traceevent: Add options to function plugin
      tools lib traceevent: Added support for __get_bitmask() macro

 include/uapi/linux/perf_event.h                    |   1 +
 kernel/events/core.c                               |  37 +++-
 tools/lib/traceevent/event-parse.c                 | 113 ++++++++++++
 tools/lib/traceevent/event-parse.h                 |  25 ++-
 tools/lib/traceevent/event-plugin.c                | 203 ++++++++++++++++++++-
 tools/lib/traceevent/plugin_function.c             |  43 ++++-
 tools/perf/Documentation/perf-report.txt           |  23 +++
 tools/perf/Documentation/perf-stat.txt             |   4 +
 tools/perf/Makefile.perf                           |   7 +-
 tools/perf/builtin-inject.c                        |   2 +-
 tools/perf/builtin-stat.c                          |  12 ++
 tools/perf/perf.c                                  |   1 +
 tools/perf/tests/dwarf-unwind.c                    |   2 +-
 tools/perf/util/event.c                            |  57 ++++--
 tools/perf/util/event.h                            |   2 +
 tools/perf/util/evsel.c                            |   1 +
 tools/perf/util/hist.c                             |   9 +-
 tools/perf/util/hist.h                             |   1 +
 tools/perf/util/machine.c                          |   4 +-
 tools/perf/util/map.c                              |   4 +-
 tools/perf/util/map.h                              |   4 +-
 .../perf/util/scripting-engines/trace-event-perl.c |   1 +
 .../util/scripting-engines/trace-event-python.c    |   2 +
 tools/perf/util/sort.c                             | 107 +++++++++++
 tools/perf/util/sort.h                             |   2 +
 tools/perf/util/spark.c                            |  31 ++++
 tools/perf/util/spark.h                            |   4 +
 tools/perf/util/stat.c                             |  34 ++++
 tools/perf/util/stat.h                             |  10 +
 tools/perf/util/util.c                             |   1 +
 tools/perf/util/util.h                             |   1 +
 31 files changed, 707 insertions(+), 41 deletions(-)
 create mode 100644 tools/perf/util/spark.c
 create mode 100644 tools/perf/util/spark.h

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2013-08-30 18:58 Arnaldo Carvalho de Melo
@ 2013-08-31  8:08 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2013-08-31  8:08 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Arnaldo Carvalho de Melo


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

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 00e4cb1ced1b17c35465defafe86d156cbd7544e:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-08-29 12:02:34 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to f2935f3e585226b8203ec3861907e1cb16ad3d6a:
> 
>   perf trace: Handle missing HUGEPAGE defines (2013-08-30 15:43:28 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> . Tidy up sample parsing validation, from Adrian Hunter.
> 
> . Make events stream always parsable by adding a new sample_type bit:
>   PERF_SAMPLE_IDENTIFIER, that when requested will be always aat a fixed
>   position in all PERF_RECORD_ records, from Adrian Hunter.
> 
> . Add a sample parsing test, from Adrian Hunter.
> 
> . Add option to 'perf trace' to analyze events in a file versus live,
>   so that one can do:
> 
>  [root@zoo ~]# perf record -a -e raw_syscalls:* sleep 1
>  [ perf record: Woken up 0 times to write data ]
>  [ perf record: Captured and wrote 25.150 MB perf.data (~1098836 samples) ]
>  [root@zoo ~]# perf trace -i perf.data -e futex --duration 1
>     17.799 ( 1.020 ms): 7127 futex(uaddr: 0x7fff3f6c6674, op: 393, val: 1, utime: 0x7fff3f6c6470, ua
>    113.344 (95.429 ms): 7127 futex(uaddr: 0x7fff3f6c6674, op: 393, val: 1, utime: 0x7fff3f6c6470, uaddr2: 0x7fff3f6c6648, val3: 4294967
>    133.778 ( 1.042 ms): 18004 futex(uaddr: 0x7fff3f6c6674, op: 393, val: 1, utime: 0x7fff3f6c6470, uaddr2: 0x7fff3f6c6648, val3: 429496
>  [root@zoo ~]#
> 
>  From David Ahern.
> 
> . Honor target pid / tid options in 'perf trace' when analyzing a file,
>   from David Ahern.
> 
> . Handle missing HUGEPAGE defines in the mmap beautifier in 'perf trace',
>   from David Ahern.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (11):
>       perf tools: change machine__findnew_thread() to set thread pid
>       perf evsel: Tidy up sample parsing overflow checking
>       perf callchain: Remove unnecessary validation
>       perf tools: Remove references to struct ip_event
>       perf: make events stream always parsable
>       perf evlist: Move perf_evlist__config() to a new source file
>       perf tools: Add support for PERF_SAMPLE_IDENTIFIER
>       perf tools: Add missing 'abi' member to 'struct regs_dump'
>       perf tools: Expand perf_event__synthesize_sample()
>       perf tools: Add a function to calculate sample event size
>       perf tests: Add a sample parsing test
> 
> David Ahern (4):
>       perf evlist: Add tracepoint lookup by name
>       perf trace: Add option to analyze events in a file versus live
>       perf trace: Honor target pid / tid options when analyzing a file
>       perf trace: Handle missing HUGEPAGE defines
> 
>  include/uapi/linux/perf_event.h         |  27 ++-
>  kernel/events/core.c                    |  11 +-
>  tools/perf/Documentation/perf-trace.txt |   4 +
>  tools/perf/Makefile                     |   2 +
>  tools/perf/builtin-inject.c             |   8 +-
>  tools/perf/builtin-kmem.c               |   3 +-
>  tools/perf/builtin-kvm.c                |   2 +-
>  tools/perf/builtin-lock.c               |   3 +-
>  tools/perf/builtin-mem.c                |   2 +-
>  tools/perf/builtin-report.c             |   2 +-
>  tools/perf/builtin-sched.c              |  20 +-
>  tools/perf/builtin-script.c             |   3 +-
>  tools/perf/builtin-top.c                |  11 +-
>  tools/perf/builtin-trace.c              | 157 ++++++++++++-
>  tools/perf/tests/builtin-test.c         |   4 +
>  tools/perf/tests/code-reading.c         |   4 +-
>  tools/perf/tests/hists_link.c           |  23 +-
>  tools/perf/tests/mmap-basic.c           |   2 +-
>  tools/perf/tests/sample-parsing.c       | 316 +++++++++++++++++++++++++
>  tools/perf/tests/tests.h                |   1 +
>  tools/perf/util/build-id.c              |  11 +-
>  tools/perf/util/callchain.c             |   8 -
>  tools/perf/util/callchain.h             |   5 -
>  tools/perf/util/event.c                 |   5 +-
>  tools/perf/util/event.h                 |  18 +-
>  tools/perf/util/evlist.c                | 140 +++++++++--
>  tools/perf/util/evlist.h                |  12 +-
>  tools/perf/util/evsel.c                 | 405 ++++++++++++++++++++++++++++----
>  tools/perf/util/evsel.h                 |  14 +-
>  tools/perf/util/machine.c               |  22 +-
>  tools/perf/util/machine.h               |   3 +-
>  tools/perf/util/record.c                | 108 +++++++++
>  tools/perf/util/session.c               |  32 +--
>  33 files changed, 1193 insertions(+), 195 deletions(-)
>  create mode 100644 tools/perf/tests/sample-parsing.c
>  create mode 100644 tools/perf/util/record.c

Pulled, thanks Arnaldo!

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2013-08-30 18:58 Arnaldo Carvalho de Melo
  2013-08-31  8:08 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-08-30 18:58 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Arnaldo Carvalho de Melo

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

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 00e4cb1ced1b17c35465defafe86d156cbd7544e:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-08-29 12:02:34 +0200)

are available in the git repository at:


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

for you to fetch changes up to f2935f3e585226b8203ec3861907e1cb16ad3d6a:

  perf trace: Handle missing HUGEPAGE defines (2013-08-30 15:43:28 -0300)

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

. Tidy up sample parsing validation, from Adrian Hunter.

. Make events stream always parsable by adding a new sample_type bit:
  PERF_SAMPLE_IDENTIFIER, that when requested will be always aat a fixed
  position in all PERF_RECORD_ records, from Adrian Hunter.

. Add a sample parsing test, from Adrian Hunter.

. Add option to 'perf trace' to analyze events in a file versus live,
  so that one can do:

 [root@zoo ~]# perf record -a -e raw_syscalls:* sleep 1
 [ perf record: Woken up 0 times to write data ]
 [ perf record: Captured and wrote 25.150 MB perf.data (~1098836 samples) ]
 [root@zoo ~]# perf trace -i perf.data -e futex --duration 1
    17.799 ( 1.020 ms): 7127 futex(uaddr: 0x7fff3f6c6674, op: 393, val: 1, utime: 0x7fff3f6c6470, ua
   113.344 (95.429 ms): 7127 futex(uaddr: 0x7fff3f6c6674, op: 393, val: 1, utime: 0x7fff3f6c6470, uaddr2: 0x7fff3f6c6648, val3: 4294967
   133.778 ( 1.042 ms): 18004 futex(uaddr: 0x7fff3f6c6674, op: 393, val: 1, utime: 0x7fff3f6c6470, uaddr2: 0x7fff3f6c6648, val3: 429496
 [root@zoo ~]#

 From David Ahern.

. Honor target pid / tid options in 'perf trace' when analyzing a file,
  from David Ahern.

. Handle missing HUGEPAGE defines in the mmap beautifier in 'perf trace',
  from David Ahern.

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

----------------------------------------------------------------
Adrian Hunter (11):
      perf tools: change machine__findnew_thread() to set thread pid
      perf evsel: Tidy up sample parsing overflow checking
      perf callchain: Remove unnecessary validation
      perf tools: Remove references to struct ip_event
      perf: make events stream always parsable
      perf evlist: Move perf_evlist__config() to a new source file
      perf tools: Add support for PERF_SAMPLE_IDENTIFIER
      perf tools: Add missing 'abi' member to 'struct regs_dump'
      perf tools: Expand perf_event__synthesize_sample()
      perf tools: Add a function to calculate sample event size
      perf tests: Add a sample parsing test

David Ahern (4):
      perf evlist: Add tracepoint lookup by name
      perf trace: Add option to analyze events in a file versus live
      perf trace: Honor target pid / tid options when analyzing a file
      perf trace: Handle missing HUGEPAGE defines

 include/uapi/linux/perf_event.h         |  27 ++-
 kernel/events/core.c                    |  11 +-
 tools/perf/Documentation/perf-trace.txt |   4 +
 tools/perf/Makefile                     |   2 +
 tools/perf/builtin-inject.c             |   8 +-
 tools/perf/builtin-kmem.c               |   3 +-
 tools/perf/builtin-kvm.c                |   2 +-
 tools/perf/builtin-lock.c               |   3 +-
 tools/perf/builtin-mem.c                |   2 +-
 tools/perf/builtin-report.c             |   2 +-
 tools/perf/builtin-sched.c              |  20 +-
 tools/perf/builtin-script.c             |   3 +-
 tools/perf/builtin-top.c                |  11 +-
 tools/perf/builtin-trace.c              | 157 ++++++++++++-
 tools/perf/tests/builtin-test.c         |   4 +
 tools/perf/tests/code-reading.c         |   4 +-
 tools/perf/tests/hists_link.c           |  23 +-
 tools/perf/tests/mmap-basic.c           |   2 +-
 tools/perf/tests/sample-parsing.c       | 316 +++++++++++++++++++++++++
 tools/perf/tests/tests.h                |   1 +
 tools/perf/util/build-id.c              |  11 +-
 tools/perf/util/callchain.c             |   8 -
 tools/perf/util/callchain.h             |   5 -
 tools/perf/util/event.c                 |   5 +-
 tools/perf/util/event.h                 |  18 +-
 tools/perf/util/evlist.c                | 140 +++++++++--
 tools/perf/util/evlist.h                |  12 +-
 tools/perf/util/evsel.c                 | 405 ++++++++++++++++++++++++++++----
 tools/perf/util/evsel.h                 |  14 +-
 tools/perf/util/machine.c               |  22 +-
 tools/perf/util/machine.h               |   3 +-
 tools/perf/util/record.c                | 108 +++++++++
 tools/perf/util/session.c               |  32 +--
 33 files changed, 1193 insertions(+), 195 deletions(-)
 create mode 100644 tools/perf/tests/sample-parsing.c
 create mode 100644 tools/perf/util/record.c

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2013-02-28 21:05 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-02-28 21:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Borislav Petkov,
	Corey Ashford, David Ahern, Feng Tang, Frederic Weisbecker,
	Ingo Molnar, Ingo Molnar, Jiri Olsa, liguang, Marcin Slusarz,
	Michael Ellerman, Namhyung Kim, Namhyung Kim, Oleg Nesterov,
	Paul Mackerras, Pekka Enberg, Peter Zijlstra, Steven Rostedt,
	Wu Fengguang, Arnaldo Carvalho de Melo

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

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit e259514eef764a5286873618e34c560ecb6cff13:

  perf/x86/amd: Enable northbridge performance counters on AMD family 15h (2013-02-16 09:37:27 +0100)

are available in the git repository at:

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

for you to fetch changes up to 0e0c6670a333aa884d11799f38a435bdf4c408ed:

  perf report: Fix build with NO_NEWT=1 (2013-02-28 16:51:01 -0300)

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

. Honor parallel jobs, fix from Borislav Petkov

. Introduce tools/lib/lk library, initially with just debugfs handling routines
  shared with tools/vm, more to come, from Borislav Petkov

. Fix handling of -C (cpus) in perf record, from Jiri Olsa

. Add perf_event_attr entries in 'perf test' to check -C handling in 'record'
  and 'stat', from Jiri Olsa.

. Check if -DFORTIFY_SOURCE=2 is allowed, fix from Marcin Slusarz.

. Fix build with NO_NEWT=1, from Michael Ellerman.

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

----------------------------------------------------------------
Borislav Petkov (6):
      perf tools: Remove a write-only variable in the debugfs code
      perf tools: Honor parallel jobs
      perf tools: Correct Makefile.include
      perf tools: Introduce tools/lib/lk library
      perf tools: Extract perf-specific stuff from debugfs.c
      tools/vm: Switch to liblk library

Jiri Olsa (5):
      perf tests: Make attr script verbose friendly
      perf tests: Make attr script test event cpu
      perf tests: Add attr record -C cpu test
      perf tests: Add attr stat -C cpu test
      perf record: Fix -C option

Marcin Slusarz (1):
      perf tools: check if -DFORTIFY_SOURCE=2 is allowed

Michael Ellerman (2):
      perf annotate: Fix build with NO_NEWT=1
      perf report: Fix build with NO_NEWT=1

liguang (1):
      perf tools: Sort command-list.txt alphabetically

 Makefile                              |  4 +-
 tools/Makefile                        | 16 ++++++-
 tools/lib/lk/Makefile                 | 35 +++++++++++++++
 tools/{perf/util => lib/lk}/debugfs.c | 49 ++++++++------------
 tools/lib/lk/debugfs.h                | 29 ++++++++++++
 tools/perf/MANIFEST                   |  1 +
 tools/perf/Makefile                   | 42 +++++++++++++----
 tools/perf/builtin-kvm.c              |  2 +-
 tools/perf/builtin-probe.c            |  2 +-
 tools/perf/builtin-record.c           |  6 ++-
 tools/perf/command-list.txt           | 14 +++---
 tools/perf/perf.c                     |  8 ++--
 tools/perf/tests/attr.c               |  9 +++-
 tools/perf/tests/attr.py              |  5 ++-
 tools/perf/tests/attr/base-record     |  1 +
 tools/perf/tests/attr/base-stat       |  1 +
 tools/perf/tests/attr/test-record-C0  | 13 ++++++
 tools/perf/tests/attr/test-stat-C0    |  9 ++++
 tools/perf/tests/parse-events.c       |  2 +-
 tools/perf/util/debugfs.h             | 12 -----
 tools/perf/util/evlist.c              |  2 +-
 tools/perf/util/evsel.c               |  2 +-
 tools/perf/util/hist.h                |  5 ++-
 tools/perf/util/parse-events.c        |  2 +-
 tools/perf/util/probe-event.c         |  2 +-
 tools/perf/util/python-ext-sources    |  1 -
 tools/perf/util/setup.py              |  3 +-
 tools/perf/util/trace-event-info.c    |  4 +-
 tools/perf/util/util.c                | 27 +++++++++++
 tools/perf/util/util.h                |  7 ++-
 tools/scripts/Makefile.include        |  6 ++-
 tools/vm/Makefile                     | 17 +++++--
 tools/vm/page-types.c                 | 85 +++--------------------------------
 33 files changed, 253 insertions(+), 170 deletions(-)
 create mode 100644 tools/lib/lk/Makefile
 rename tools/{perf/util => lib/lk}/debugfs.c (68%)
 create mode 100644 tools/lib/lk/debugfs.h
 create mode 100644 tools/perf/tests/attr/test-record-C0
 create mode 100644 tools/perf/tests/attr/test-stat-C0
 delete mode 100644 tools/perf/util/debugfs.h

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

* Re: [GIT PULL 00/15] perf/core improvements and fixes
  2011-12-23 21:53 Arnaldo Carvalho de Melo
@ 2011-12-29 20:28 ` Ingo Molnar
  0 siblings, 0 replies; 51+ messages in thread
From: Ingo Molnar @ 2011-12-29 20:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David Ahern, Frederic Weisbecker, Namhyung Kim,
	Nelson Elhage, Paul Mackerras, Peter Zijlstra, Robert Richter,
	Stephane Eranian, arnaldo.melo


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

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://github.com/acmel/linux.git perf/core
> 
> Regards,
> 
> - Arnaldo
> 
> David Ahern (3):
>   perf tools: Fix comm for processes with named threads
>   perf tools: Look up thread names for system wide profiling
>   perf script: look up thread using tid instead of pid
> 
> Ingo Molnar (1):
>   perf tools: Fix truncated annotation
> 
> Namhyung Kim (1):
>   perf report: Fix usage string
> 
> Nelson Elhage (2):
>   perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
>   perf: builtin-record: Document and check that mmap_pages must be a power of two.
> 
> Robert Richter (8):
>   perf tools: Improve macros for struct feature_ops
>   perf tools: Continue processing header on unknown features
>   perf tools: Fix out-of-bound access to struct perf_session
>   perf tools: Moving code in some files
>   perf report: Accept fifos as input file
>   perf tools: Unify handling of features when writing feature section
>   perf tools: Use for_each_set_bit() to iterate over feature flags
>   perf script: Add generic perl handler to process events
> 
>  tools/perf/Documentation/perf-annotate.txt         |    2 +-
>  tools/perf/Documentation/perf-buildid-list.txt     |    2 +-
>  tools/perf/Documentation/perf-evlist.txt           |    2 +-
>  tools/perf/Documentation/perf-kmem.txt             |    2 +-
>  tools/perf/Documentation/perf-lock.txt             |    2 +-
>  tools/perf/Documentation/perf-record.txt           |    2 +-
>  tools/perf/Documentation/perf-report.txt           |    2 +-
>  tools/perf/Documentation/perf-sched.txt            |    2 +-
>  tools/perf/Documentation/perf-script.txt           |    2 +-
>  tools/perf/Documentation/perf-timechart.txt        |    2 +-
>  tools/perf/builtin-annotate.c                      |    3 +-
>  tools/perf/builtin-buildid-list.c                  |   53 +-
>  tools/perf/builtin-evlist.c                        |    2 +-
>  tools/perf/builtin-kmem.c                          |    2 +-
>  tools/perf/builtin-lock.c                          |    2 +-
>  tools/perf/builtin-record.c                        |   19 +-
>  tools/perf/builtin-report.c                        |   15 +-
>  tools/perf/builtin-sched.c                         |    2 +-
>  tools/perf/builtin-script.c                        |    6 +-
>  tools/perf/builtin-timechart.c                     |    4 +-
>  tools/perf/util/annotate.c                         |    2 +-
>  tools/perf/util/event.c                            |  112 +++-
>  tools/perf/util/evlist.c                           |    2 +
>  tools/perf/util/header.c                           |  663 +++++++++-----------
>  tools/perf/util/header.h                           |    6 +-
>  tools/perf/util/include/linux/bitops.h             |  118 ++++
>  .../perf/util/scripting-engines/trace-event-perl.c |   73 ++-
>  tools/perf/util/session.c                          |   15 +-
>  tools/perf/util/session.h                          |    2 +-
>  tools/perf/util/util.h                             |   11 +
>  30 files changed, 676 insertions(+), 456 deletions(-)

Pulled, thanks a lot Arnaldo!

FYI, i fixed a trivial build failure, in:

 f2328062726d: perf tools: Fix feature-bits rework fallout, remove unused variable

Thanks,

	Ingo

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

* [GIT PULL 00/15] perf/core improvements and fixes
@ 2011-12-23 21:53 Arnaldo Carvalho de Melo
  2011-12-29 20:28 ` Ingo Molnar
  0 siblings, 1 reply; 51+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-12-23 21:53 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Namhyung Kim, Nelson Elhage, Paul Mackerras,
	Peter Zijlstra, Robert Richter, Stephane Eranian, arnaldo.melo

Hi Ingo,

        Please consider pulling from:

git://github.com/acmel/linux.git perf/core

Regards,

- Arnaldo

David Ahern (3):
  perf tools: Fix comm for processes with named threads
  perf tools: Look up thread names for system wide profiling
  perf script: look up thread using tid instead of pid

Ingo Molnar (1):
  perf tools: Fix truncated annotation

Namhyung Kim (1):
  perf report: Fix usage string

Nelson Elhage (2):
  perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
  perf: builtin-record: Document and check that mmap_pages must be a power of two.

Robert Richter (8):
  perf tools: Improve macros for struct feature_ops
  perf tools: Continue processing header on unknown features
  perf tools: Fix out-of-bound access to struct perf_session
  perf tools: Moving code in some files
  perf report: Accept fifos as input file
  perf tools: Unify handling of features when writing feature section
  perf tools: Use for_each_set_bit() to iterate over feature flags
  perf script: Add generic perl handler to process events

 tools/perf/Documentation/perf-annotate.txt         |    2 +-
 tools/perf/Documentation/perf-buildid-list.txt     |    2 +-
 tools/perf/Documentation/perf-evlist.txt           |    2 +-
 tools/perf/Documentation/perf-kmem.txt             |    2 +-
 tools/perf/Documentation/perf-lock.txt             |    2 +-
 tools/perf/Documentation/perf-record.txt           |    2 +-
 tools/perf/Documentation/perf-report.txt           |    2 +-
 tools/perf/Documentation/perf-sched.txt            |    2 +-
 tools/perf/Documentation/perf-script.txt           |    2 +-
 tools/perf/Documentation/perf-timechart.txt        |    2 +-
 tools/perf/builtin-annotate.c                      |    3 +-
 tools/perf/builtin-buildid-list.c                  |   53 +-
 tools/perf/builtin-evlist.c                        |    2 +-
 tools/perf/builtin-kmem.c                          |    2 +-
 tools/perf/builtin-lock.c                          |    2 +-
 tools/perf/builtin-record.c                        |   19 +-
 tools/perf/builtin-report.c                        |   15 +-
 tools/perf/builtin-sched.c                         |    2 +-
 tools/perf/builtin-script.c                        |    6 +-
 tools/perf/builtin-timechart.c                     |    4 +-
 tools/perf/util/annotate.c                         |    2 +-
 tools/perf/util/event.c                            |  112 +++-
 tools/perf/util/evlist.c                           |    2 +
 tools/perf/util/header.c                           |  663 +++++++++-----------
 tools/perf/util/header.h                           |    6 +-
 tools/perf/util/include/linux/bitops.h             |  118 ++++
 .../perf/util/scripting-engines/trace-event-perl.c |   73 ++-
 tools/perf/util/session.c                          |   15 +-
 tools/perf/util/session.h                          |    2 +-
 tools/perf/util/util.h                             |   11 +
 30 files changed, 676 insertions(+), 456 deletions(-)

-- 
1.7.8.rc0.35.gee6df


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

end of thread, other threads:[~2017-08-23 19:36 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 01/15] perf tools: Fix build on older systems Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 02/15] perf tools: Remove duplicate typedef config_term_func_t definition Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 03/15] perf tools: Fix segfault on dynamic entries Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 04/15] perf tools: Update srcline/file if needed Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 05/15] perf tools: Fix alignment on some sort keys Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 06/15] perf tools: Fix column width setting on 'trace' sort key Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 07/15] perf tools: Fix assertion failure on dynamic entry Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 08/15] perf bpf: Add API to set values to map entries in a bpf object Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 09/15] perf tools: Enable BPF object configure syntax Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 10/15] perf record: Apply config to BPF objects before recording Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 11/15] perf tools: Enable passing event to BPF object Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 12/15] perf tools: Support setting different slots in a BPF map separately Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 13/15] perf tools: Enable indices setting syntax for BPF map Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 14/15] perf tools: Apply tracepoint event definition options to BPF script Arnaldo Carvalho de Melo
2016-02-22 18:03 ` [PATCH 15/15] perf tools: Introduce bpf-output event Arnaldo Carvalho de Melo
2016-02-24  7:21 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2017-08-23 19:35 Arnaldo Carvalho de Melo
2017-07-28 20:00 Arnaldo Carvalho de Melo
2017-07-30  9:31 ` Ingo Molnar
2017-02-14  1:13 Arnaldo Carvalho de Melo
2017-02-14  6:31 ` Ingo Molnar
2016-11-15  1:38 Arnaldo Carvalho de Melo
2016-11-15  8:47 ` Ingo Molnar
2016-10-27 20:40 Arnaldo Carvalho de Melo
2016-09-22 21:12 Arnaldo Carvalho de Melo
2016-09-23  5:22 ` Ingo Molnar
2016-07-18 23:33 Arnaldo Carvalho de Melo
2016-07-19  6:46 ` Ingo Molnar
2016-05-10 15:15 Arnaldo Carvalho de Melo
2016-05-10 20:28 ` Ingo Molnar
2016-03-07 19:44 Arnaldo Carvalho de Melo
2015-09-05  1:06 Arnaldo Carvalho de Melo
2015-09-08 14:09 ` Arnaldo Carvalho de Melo
2015-09-08 14:21   ` Ingo Molnar
2015-09-08 14:30     ` Arnaldo Carvalho de Melo
2015-09-14  8:41       ` Ingo Molnar
2015-09-14  9:07         ` Wangnan (F)
2015-06-08 14:17 Arnaldo Carvalho de Melo
2015-06-09  9:47 ` Ingo Molnar
2015-04-02 22:28 Arnaldo Carvalho de Melo
2015-04-03  5:02 ` Ingo Molnar
2014-10-15 20:52 Arnaldo Carvalho de Melo
2014-10-16  5:18 ` Ingo Molnar
2014-06-09 20:02 Jiri Olsa
2014-06-12 11:54 ` Ingo Molnar
2013-08-30 18:58 Arnaldo Carvalho de Melo
2013-08-31  8:08 ` Ingo Molnar
2013-02-28 21:05 Arnaldo Carvalho de Melo
2011-12-23 21:53 Arnaldo Carvalho de Melo
2011-12-29 20:28 ` Ingo Molnar

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