linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/24] perf/core improvements and fixes
@ 2015-03-12 21:27 Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 01/24] perf ordered_events: Untangle from perf_session Arnaldo Carvalho de Melo
                   ` (24 more replies)
  0 siblings, 25 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, Corey Ashford, David Ahern,
	Don Zickus, Frederic Weisbecker, He Kuang, Jeremie Galarneau,
	Jiri Olsa, Joonsoo Kim, Masami Hiramatsu, Minchan Kim,
	Namhyung Kim, Naohiro Aota, Paul Mackerras, Peter Zijlstra,
	Sebastian Andrzej Siewior, Stephane Eranian, Tom Zanussi,
	Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, more to come, will continue tomorrow,

- Arnaldo

The following changes since commit 94ac003b665fc04f13a7ab3b2be896b9b9503451:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-03-03 07:17:53 +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 7afa95d95b7b4c17f3c648f58f8c8abdcb619b85:

  perf data: Add tracepoint events fields CTF conversion support (2015-03-12 16:10:41 -0300)

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

User visible:

. Fix UI bug after zoom into thread/dso/symbol and another, after fold/unfold,
  in the TUI hists browser (He Kuang)

. Fixes for 'perf probe' handle aliased symbols, for instance in glibc (Masami Hiramatsu, Namhyung Kim)

- 'perf kmem' improvements and fixes: (Namhyung Kim)
  - Fix segfault when invalid sort key is given
  - Allow -v option
  - Fix alignment of slab result table

- 'perf stat' improvements and fixes: (Andi Kleen)
  - Output running time and run/enabled ratio in CSV mode
  - Fix IPC and other formulas with -A
  - Always correctly indent ratio column

. Add tracepoint events fields CTF conversion support to 'perf data' (Sebastian Andrzej Siewior)

Infrastructure:

. Output feature detection's gcc output to a file, to help in debugging (Arnaldo Carvalho de Melo)

. Fix 'perf probe' compiles due to declarations using perf_probe_point (David Ahern)

. Fix possible double free on error in 'perf probe' (He Kuang)

. Remove superfluous thread->comm_set setting (Jiri Olsa)

. Fix libbabeltrace detection (Jiri Olsa)

. More work on separating ordered_events code out of perf_session (Arnaldo Carvalho de Melo)

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

----------------------------------------------------------------
Andi Kleen (3):
      perf stat: Output running time and run/enabled ratio in CSV mode
      perf stat: Fix IPC and other formulas with -A
      perf stat: Always correctly indent ratio column

Arnaldo Carvalho de Melo (6):
      perf ordered_events: Untangle from perf_session
      perf ordered_events: Shorten function signatures
      perf ordered_events: Allow tools to specify a deliver method
      perf tools: tool->finished_round() doesn't need perf_session
      perf ordered_events: Adopt queue() method
      perf tools: Output feature detection's gcc output to a file

David Ahern (1):
      perf probe: Fix compiles due to declarations using perf_probe_point

He Kuang (3):
      perf probe: Fix possible double free on error
      perf hists browser: Fix UI bug after zoom into thread/dso/symbol
      perf hists browser: Fix UI bug after fold/unfold

Jiri Olsa (2):
      perf tools: Remove superfluous thread->comm_set setting
      perf build: Fix libbabeltrace detection

Masami Hiramatsu (3):
      perf probe: Fix to handle aliased symbols in glibc
      perf probe: Fix --line to handle aliased symbols in glibc
      Revert "perf probe: Fix to fall back to find probe point in symbols"

Namhyung Kim (5):
      perf symbols: Allow symbol alias when loading map for symbol name
      perf probe: Allow weak symbols to be probed
      perf kmem: Fix segfault when invalid sort key is given
      perf kmem: Allow -v option
      perf kmem: Fix alignment of slab result table

Sebastian Andrzej Siewior (1):
      perf data: Add tracepoint events fields CTF conversion support

 tools/perf/Documentation/perf-kmem.txt             |   4 +
 tools/perf/Makefile.perf                           |   1 +
 tools/perf/builtin-annotate.c                      |   2 +-
 tools/perf/builtin-buildid-list.c                  |   2 +-
 tools/perf/builtin-diff.c                          |   2 +-
 tools/perf/builtin-inject.c                        |  15 +-
 tools/perf/builtin-kmem.c                          |  17 +-
 tools/perf/builtin-kvm.c                           |  13 +-
 tools/perf/builtin-lock.c                          |   2 +-
 tools/perf/builtin-mem.c                           |   2 +-
 tools/perf/builtin-record.c                        |   4 +-
 tools/perf/builtin-report.c                        |   2 +-
 tools/perf/builtin-sched.c                         |   2 +-
 tools/perf/builtin-script.c                        |   2 +-
 tools/perf/builtin-stat.c                          |  89 ++++----
 tools/perf/builtin-timechart.c                     |   2 +-
 tools/perf/builtin-trace.c                         |   2 +-
 tools/perf/config/Makefile                         |   2 +-
 .../config/feature-checks/test-libbabeltrace.c     |   1 +
 tools/perf/ui/browsers/hists.c                     |  19 ++
 tools/perf/util/data-convert-bt.c                  | 246 ++++++++++++++++++++-
 tools/perf/util/hist.c                             |   1 +
 tools/perf/util/ordered-events.c                   |  57 +++--
 tools/perf/util/ordered-events.h                   |  27 ++-
 tools/perf/util/probe-event.c                      | 194 +++++++++++++---
 tools/perf/util/session.c                          | 140 ++++++------
 tools/perf/util/session.h                          |  16 +-
 tools/perf/util/symbol-elf.c                       |   3 +-
 tools/perf/util/symbol.h                           |   1 +
 tools/perf/util/thread.c                           |   1 -
 tools/perf/util/tool.h                             |   8 +-
 31 files changed, 672 insertions(+), 207 deletions(-)

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

* [PATCH 01/24] perf ordered_events: Untangle from perf_session
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 02/24] perf ordered_events: Shorten function signatures Arnaldo Carvalho de Melo
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 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, Namhyung Kim, Stephane Eranian

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

For use by tools that are not perf.data based, as maybe 'perf trace' in
live mode.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-nedqe7cmii5w82etfi36urfz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ordered-events.c | 17 +++++++++--------
 tools/perf/util/ordered-events.h |  8 +++++---
 tools/perf/util/session.c        | 37 ++++++++++++++++++++++++++-----------
 tools/perf/util/session.h        |  3 ++-
 4 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 077ddd25189f..e6ab630dd374 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -153,10 +153,11 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve
 	free_dup_event(oe, event->event);
 }
 
-static int __ordered_events__flush(struct perf_session *s,
+static int __ordered_events__flush(struct ordered_events *oe,
+				   struct machines *machines,
+				   struct perf_evlist *evlist,
 				   struct perf_tool *tool)
 {
-	struct ordered_events *oe = &s->ordered_events;
 	struct list_head *head = &oe->events;
 	struct ordered_event *tmp, *iter;
 	struct perf_sample sample;
@@ -179,12 +180,12 @@ static int __ordered_events__flush(struct perf_session *s,
 		if (iter->timestamp > limit)
 			break;
 
-		ret = perf_evlist__parse_sample(s->evlist, iter->event, &sample);
+		ret = perf_evlist__parse_sample(evlist, iter->event, &sample);
 		if (ret)
 			pr_err("Can't parse sample, err = %d\n", ret);
 		else {
-			ret = perf_session__deliver_event(s, iter->event, &sample, tool,
-							  iter->file_offset);
+			ret = machines__deliver_event(machines, evlist, iter->event,
+						      &sample, tool, iter->file_offset);
 			if (ret)
 				return ret;
 		}
@@ -204,10 +205,10 @@ static int __ordered_events__flush(struct perf_session *s,
 	return 0;
 }
 
-int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
+int ordered_events__flush(struct ordered_events *oe, struct machines *machines,
+			  struct perf_evlist *evlist, struct perf_tool *tool,
 			  enum oe_flush how)
 {
-	struct ordered_events *oe = &s->ordered_events;
 	static const char * const str[] = {
 		"NONE",
 		"FINAL",
@@ -251,7 +252,7 @@ int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
 		   str[how], oe->nr_events);
 	pr_oe_time(oe->max_timestamp, "max_timestamp\n");
 
-	err = __ordered_events__flush(s, tool);
+	err = __ordered_events__flush(oe, machines, evlist, tool);
 
 	if (!err) {
 		if (how == OE_FLUSH__ROUND)
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index 7b8f9b011f38..e09f2433c6d6 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -2,9 +2,10 @@
 #define __ORDERED_EVENTS_H
 
 #include <linux/types.h>
-#include "tool.h"
 
-struct perf_session;
+struct perf_tool;
+struct perf_evlist;
+struct machines;
 
 struct ordered_event {
 	u64			timestamp;
@@ -40,7 +41,8 @@ struct ordered_events {
 struct ordered_event *ordered_events__new(struct ordered_events *oe, u64 timestamp,
 					  union perf_event *event);
 void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
-int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
+int ordered_events__flush(struct ordered_events *oe, struct machines *machines,
+			  struct perf_evlist *evlist, struct perf_tool *tool,
 			  enum oe_flush how);
 void ordered_events__init(struct ordered_events *oe);
 void ordered_events__free(struct ordered_events *oe);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ed4e5cf2bd9d..23be146bd2fc 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -512,7 +512,11 @@ static int process_finished_round(struct perf_tool *tool,
 				  union perf_event *event __maybe_unused,
 				  struct perf_session *session)
 {
-	return ordered_events__flush(session, tool, OE_FLUSH__ROUND);
+	struct ordered_events *oe = &session->ordered_events;
+	struct perf_evlist *evlist = session->evlist;
+	struct machines *machines = &session->machines;
+
+	return ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__ROUND);
 }
 
 int perf_session_queue_event(struct perf_session *s, union perf_event *event,
@@ -520,6 +524,9 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
 			     u64 file_offset)
 {
 	struct ordered_events *oe = &s->ordered_events;
+	struct perf_evlist *evlist = s->evlist;
+	struct machines *machines = &s->machines;
+
 	u64 timestamp = sample->time;
 	struct ordered_event *new;
 
@@ -536,7 +543,7 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
 
 	new = ordered_events__new(oe, timestamp, event);
 	if (!new) {
-		ordered_events__flush(s, tool, OE_FLUSH__HALF);
+		ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__HALF);
 		new = ordered_events__new(oe, timestamp, event);
 	}
 
@@ -886,12 +893,12 @@ static int
 					    &sample->read.one, machine);
 }
 
-int perf_session__deliver_event(struct perf_session *session,
+int machines__deliver_event(struct machines *machines,
+				struct perf_evlist *evlist,
 				union perf_event *event,
 				struct perf_sample *sample,
 				struct perf_tool *tool, u64 file_offset)
 {
-	struct perf_evlist *evlist = session->evlist;
 	struct perf_evsel *evsel;
 	struct machine *machine;
 
@@ -899,7 +906,7 @@ int perf_session__deliver_event(struct perf_session *session,
 
 	evsel = perf_evlist__id2evsel(evlist, sample->id);
 
-	machine = machines__find_for_cpumode(&session->machines, event, sample);
+	machine = machines__find_for_cpumode(machines, event, sample);
 
 	switch (event->header.type) {
 	case PERF_RECORD_SAMPLE:
@@ -984,12 +991,14 @@ int perf_session__deliver_synth_event(struct perf_session *session,
 				      struct perf_sample *sample,
 				      struct perf_tool *tool)
 {
-	events_stats__inc(&session->evlist->stats, event->header.type);
+	struct perf_evlist *evlist = session->evlist;
+
+	events_stats__inc(&evlist->stats, event->header.type);
 
 	if (event->header.type >= PERF_RECORD_USER_TYPE_START)
 		return perf_session__process_user_event(session, event, tool, 0);
 
-	return perf_session__deliver_event(session, event, sample, tool, 0);
+	return machines__deliver_event(&session->machines, evlist, event, sample, tool, 0);
 }
 
 static void event_swap(union perf_event *event, bool sample_id_all)
@@ -1090,8 +1099,8 @@ static s64 perf_session__process_event(struct perf_session *session,
 			return ret;
 	}
 
-	return perf_session__deliver_event(session, event, &sample, tool,
-					   file_offset);
+	return machines__deliver_event(&session->machines, evlist, event,
+				       &sample, tool, file_offset);
 }
 
 void perf_event_header__bswap(struct perf_event_header *hdr)
@@ -1167,6 +1176,9 @@ volatile int session_done;
 static int __perf_session__process_pipe_events(struct perf_session *session,
 					       struct perf_tool *tool)
 {
+	struct ordered_events *oe = &session->ordered_events;
+	struct perf_evlist *evlist = session->evlist;
+	struct machines *machines = &session->machines;
 	int fd = perf_data_file__fd(session->file);
 	union perf_event *event;
 	uint32_t size, cur_size = 0;
@@ -1246,7 +1258,7 @@ more:
 		goto more;
 done:
 	/* do the final flush for ordered samples */
-	err = ordered_events__flush(session, tool, OE_FLUSH__FINAL);
+	err = ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__FINAL);
 out_err:
 	free(buf);
 	perf_tool__warn_about_errors(tool, &session->evlist->stats);
@@ -1298,6 +1310,9 @@ static int __perf_session__process_events(struct perf_session *session,
 					  u64 data_offset, u64 data_size,
 					  u64 file_size, struct perf_tool *tool)
 {
+	struct ordered_events *oe = &session->ordered_events;
+	struct perf_evlist *evlist = session->evlist;
+	struct machines *machines = &session->machines;
 	int fd = perf_data_file__fd(session->file);
 	u64 head, page_offset, file_offset, file_pos, size;
 	int err, mmap_prot, mmap_flags, map_idx = 0;
@@ -1391,7 +1406,7 @@ more:
 
 out:
 	/* do the final flush for ordered samples */
-	err = ordered_events__flush(session, tool, OE_FLUSH__FINAL);
+	err = ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__FINAL);
 out_err:
 	ui_progress__finish();
 	perf_tool__warn_about_errors(tool, &session->evlist->stats);
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index fe859f379ca7..c08fa6be5bf3 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -57,7 +57,8 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
 
 void perf_tool__fill_defaults(struct perf_tool *tool);
 
-int perf_session__deliver_event(struct perf_session *session,
+int machines__deliver_event(struct machines *machines,
+				struct perf_evlist *evlist,
 				union perf_event *event,
 				struct perf_sample *sample,
 				struct perf_tool *tool, u64 file_offset);
-- 
1.9.3


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

* [PATCH 02/24] perf ordered_events: Shorten function signatures
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 01/24] perf ordered_events: Untangle from perf_session Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 03/24] perf ordered_events: Allow tools to specify a deliver method Arnaldo Carvalho de Melo
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 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, Namhyung Kim, Stephane Eranian

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

By keeping pointers to machines, evlist and tool in ordered_events.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-0c6huyaf59mqtm2ek9pmposl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-annotate.c     |  2 +-
 tools/perf/builtin-buildid-list.c |  2 +-
 tools/perf/builtin-diff.c         |  2 +-
 tools/perf/builtin-inject.c       |  6 ++--
 tools/perf/builtin-kmem.c         |  2 +-
 tools/perf/builtin-kvm.c          |  6 ++--
 tools/perf/builtin-lock.c         |  2 +-
 tools/perf/builtin-mem.c          |  2 +-
 tools/perf/builtin-record.c       |  4 +--
 tools/perf/builtin-report.c       |  2 +-
 tools/perf/builtin-sched.c        |  2 +-
 tools/perf/builtin-script.c       |  2 +-
 tools/perf/builtin-timechart.c    |  2 +-
 tools/perf/builtin-trace.c        |  2 +-
 tools/perf/util/data-convert-bt.c |  4 +--
 tools/perf/util/ordered-events.c  | 23 +++++++-------
 tools/perf/util/ordered-events.h  | 10 +++---
 tools/perf/util/session.c         | 65 ++++++++++++++++-----------------------
 tools/perf/util/session.h         | 11 +++----
 19 files changed, 68 insertions(+), 83 deletions(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 747f86103599..71bf7451c0ca 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -208,7 +208,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
 			goto out;
 	}
 
-	ret = perf_session__process_events(session, &ann->tool);
+	ret = perf_session__process_events(session);
 	if (ret)
 		goto out;
 
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index ed3873b3e238..feb420f74c2d 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -74,7 +74,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits)
 	 * the record stream. Buildids are stored as RECORD_HEADER_BUILD_ID
 	 */
 	if (with_hits || perf_data_file__is_pipe(&file))
-		perf_session__process_events(session, &build_id__mark_dso_hit_ops);
+		perf_session__process_events(session);
 
 	perf_session__fprintf_dsos_buildid(session, stdout, dso__skip_buildid, with_hits);
 	perf_session__delete(session);
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 74aada554b12..f800fc95f5d7 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -747,7 +747,7 @@ static int __cmd_diff(void)
 			goto out_delete;
 		}
 
-		ret = perf_session__process_events(d->session, &tool);
+		ret = perf_session__process_events(d->session);
 		if (ret) {
 			pr_err("Failed to process %s\n", d->file.path);
 			goto out_delete;
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index a13641e066f5..2563f07ec0e5 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -359,8 +359,6 @@ static int __cmd_inject(struct perf_inject *inject)
 	} else if (inject->sched_stat) {
 		struct perf_evsel *evsel;
 
-		inject->tool.ordered_events = true;
-
 		evlist__for_each(session->evlist, evsel) {
 			const char *name = perf_evsel__name(evsel);
 
@@ -379,7 +377,7 @@ static int __cmd_inject(struct perf_inject *inject)
 	if (!file_out->is_pipe)
 		lseek(fd, session->header.data_offset, SEEK_SET);
 
-	ret = perf_session__process_events(session, &inject->tool);
+	ret = perf_session__process_events(session);
 
 	if (!file_out->is_pipe) {
 		if (inject->build_ids)
@@ -458,6 +456,8 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
 		return -1;
 	}
 
+	inject.tool.ordered_events = inject.sched_stat;
+
 	file.path = inject.input_name;
 	inject.session = perf_session__new(&file, true, &inject.tool);
 	if (inject.session == NULL)
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index f295141025bc..62f165a9fa40 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -426,7 +426,7 @@ static int __cmd_kmem(struct perf_session *session)
 	}
 
 	setup_pager();
-	err = perf_session__process_events(session, &perf_kmem);
+	err = perf_session__process_events(session);
 	if (err != 0)
 		goto out;
 	sort_result();
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0894a817f67e..802b8f53fa9a 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -730,9 +730,9 @@ static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx,
 			return -1;
 		}
 
-		err = perf_session_queue_event(kvm->session, event, &kvm->tool, &sample, 0);
+		err = perf_session__queue_event(kvm->session, event, &sample, 0);
 		/*
-		 * FIXME: Here we can't consume the event, as perf_session_queue_event will
+		 * FIXME: Here we can't consume the event, as perf_session__queue_event will
 		 *        point to it, and it'll get possibly overwritten by the kernel.
 		 */
 		perf_evlist__mmap_consume(kvm->evlist, idx);
@@ -1066,7 +1066,7 @@ static int read_events(struct perf_kvm_stat *kvm)
 	if (ret < 0)
 		return ret;
 
-	return perf_session__process_events(kvm->session, &kvm->tool);
+	return perf_session__process_events(kvm->session);
 }
 
 static int parse_target_str(struct perf_kvm_stat *kvm)
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index e7ec71589da6..7893a9bba2a7 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -878,7 +878,7 @@ static int __cmd_report(bool display_info)
 	if (select_key())
 		goto out_delete;
 
-	err = perf_session__process_events(session, &eops);
+	err = perf_session__process_events(session);
 	if (err)
 		goto out_delete;
 
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 9b5663950a4d..46c69318de84 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -141,7 +141,7 @@ static int report_raw_events(struct perf_mem *mem)
 
 	printf("# PID, TID, IP, ADDR, LOCAL WEIGHT, DSRC, SYMBOL\n");
 
-	err = perf_session__process_events(session, &mem->tool);
+	err = perf_session__process_events(session);
 	if (err)
 		return err;
 
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 4fdad06d37db..5a2ff510b75b 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -225,7 +225,7 @@ static int process_buildids(struct record *rec)
 	 */
 	symbol_conf.ignore_vmlinux_buildid = true;
 
-	return perf_session__process_events(session, &rec->tool);
+	return perf_session__process_events(session);
 }
 
 static void perf_event__synthesize_guest_os(struct machine *machine, void *data)
@@ -343,7 +343,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 	signal(SIGINT, sig_handler);
 	signal(SIGTERM, sig_handler);
 
-	session = perf_session__new(file, false, NULL);
+	session = perf_session__new(file, false, tool);
 	if (session == NULL) {
 		pr_err("Perf session creation failed.\n");
 		return -1;
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index fb350343b1d7..52f74e1367e9 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -482,7 +482,7 @@ static int __cmd_report(struct report *rep)
 	if (ret)
 		return ret;
 
-	ret = perf_session__process_events(session, &rep->tool);
+	ret = perf_session__process_events(session);
 	if (ret)
 		return ret;
 
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index a3ebf1d3c29d..3b3a5bb97059 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1467,7 +1467,7 @@ static int perf_sched__read_events(struct perf_sched *sched)
 		goto out_delete;
 
 	if (perf_session__has_traces(session, "record -R")) {
-		int err = perf_session__process_events(session, &sched->tool);
+		int err = perf_session__process_events(session);
 		if (err) {
 			pr_err("Failed to process events, error %d", err);
 			goto out_delete;
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ce304dfd962a..c7e6750923ef 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -800,7 +800,7 @@ static int __cmd_script(struct perf_script *script)
 		script->tool.mmap2 = process_mmap2_event;
 	}
 
-	ret = perf_session__process_events(script->session, &script->tool);
+	ret = perf_session__process_events(script->session);
 
 	if (debug_mode)
 		pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered);
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index f3bb1a4bf060..51440d1fc722 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -1623,7 +1623,7 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name)
 		goto out_delete;
 	}
 
-	ret = perf_session__process_events(session, &tchart->tool);
+	ret = perf_session__process_events(session);
 	if (ret)
 		goto out_delete;
 
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 211614fba217..6969ba98ff2f 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2408,7 +2408,7 @@ static int trace__replay(struct trace *trace)
 
 	setup_pager();
 
-	err = perf_session__process_events(session, &trace->tool);
+	err = perf_session__process_events(session);
 	if (err)
 		pr_err("Failed to process events, error %d", err);
 
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index e372e03ff480..1afd381b2346 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -579,7 +579,7 @@ int bt_convert__perf2ctf(const char *input, const char *path)
 		return -1;
 
 	/* perf.data session */
-	session = perf_session__new(&file, 0, NULL);
+	session = perf_session__new(&file, 0, &c.tool);
 	if (!session)
 		goto free_writer;
 
@@ -591,7 +591,7 @@ int bt_convert__perf2ctf(const char *input, const char *path)
 	if (setup_events(cw, session))
 		goto free_session;
 
-	err = perf_session__process_events(session, &c.tool);
+	err = perf_session__process_events(session);
 	if (!err)
 		err = bt_ctf_stream_flush(cw->stream);
 
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index e6ab630dd374..bad46ce16591 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -153,10 +153,7 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve
 	free_dup_event(oe, event->event);
 }
 
-static int __ordered_events__flush(struct ordered_events *oe,
-				   struct machines *machines,
-				   struct perf_evlist *evlist,
-				   struct perf_tool *tool)
+static int __ordered_events__flush(struct ordered_events *oe)
 {
 	struct list_head *head = &oe->events;
 	struct ordered_event *tmp, *iter;
@@ -180,12 +177,12 @@ static int __ordered_events__flush(struct ordered_events *oe,
 		if (iter->timestamp > limit)
 			break;
 
-		ret = perf_evlist__parse_sample(evlist, iter->event, &sample);
+		ret = perf_evlist__parse_sample(oe->evlist, iter->event, &sample);
 		if (ret)
 			pr_err("Can't parse sample, err = %d\n", ret);
 		else {
-			ret = machines__deliver_event(machines, evlist, iter->event,
-						      &sample, tool, iter->file_offset);
+			ret = machines__deliver_event(oe->machines, oe->evlist, iter->event,
+						      &sample, oe->tool, iter->file_offset);
 			if (ret)
 				return ret;
 		}
@@ -205,9 +202,7 @@ static int __ordered_events__flush(struct ordered_events *oe,
 	return 0;
 }
 
-int ordered_events__flush(struct ordered_events *oe, struct machines *machines,
-			  struct perf_evlist *evlist, struct perf_tool *tool,
-			  enum oe_flush how)
+int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
 {
 	static const char * const str[] = {
 		"NONE",
@@ -252,7 +247,7 @@ int ordered_events__flush(struct ordered_events *oe, struct machines *machines,
 		   str[how], oe->nr_events);
 	pr_oe_time(oe->max_timestamp, "max_timestamp\n");
 
-	err = __ordered_events__flush(oe, machines, evlist, tool);
+	err = __ordered_events__flush(oe);
 
 	if (!err) {
 		if (how == OE_FLUSH__ROUND)
@@ -268,13 +263,17 @@ int ordered_events__flush(struct ordered_events *oe, struct machines *machines,
 	return err;
 }
 
-void ordered_events__init(struct ordered_events *oe)
+void ordered_events__init(struct ordered_events *oe, struct machines *machines,
+			  struct perf_evlist *evlist, struct perf_tool *tool)
 {
 	INIT_LIST_HEAD(&oe->events);
 	INIT_LIST_HEAD(&oe->cache);
 	INIT_LIST_HEAD(&oe->to_free);
 	oe->max_alloc_size = (u64) -1;
 	oe->cur_alloc_size = 0;
+	oe->evlist	   = evlist;
+	oe->machines	   = machines;
+	oe->tool	   = tool;
 }
 
 void ordered_events__free(struct ordered_events *oe)
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index e09f2433c6d6..ef7d73ecb0d0 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -32,6 +32,9 @@ struct ordered_events {
 	struct list_head	to_free;
 	struct ordered_event	*buffer;
 	struct ordered_event	*last;
+	struct machines		*machines;
+	struct perf_evlist	*evlist;
+	struct perf_tool	*tool;
 	int			buffer_idx;
 	unsigned int		nr_events;
 	enum oe_flush		last_flush_type;
@@ -41,10 +44,9 @@ struct ordered_events {
 struct ordered_event *ordered_events__new(struct ordered_events *oe, u64 timestamp,
 					  union perf_event *event);
 void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
-int ordered_events__flush(struct ordered_events *oe, struct machines *machines,
-			  struct perf_evlist *evlist, struct perf_tool *tool,
-			  enum oe_flush how);
-void ordered_events__init(struct ordered_events *oe);
+int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
+void ordered_events__init(struct ordered_events *oe, struct machines *machines,
+			  struct perf_evlist *evlsit, struct perf_tool *tool);
 void ordered_events__free(struct ordered_events *oe);
 
 static inline
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 23be146bd2fc..c6dd89f62fc4 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -95,7 +95,6 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
 		goto out;
 
 	session->repipe = repipe;
-	ordered_events__init(&session->ordered_events);
 	machines__init(&session->machines);
 
 	if (file) {
@@ -126,7 +125,8 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
 	    tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) {
 		dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
 		tool->ordered_events = false;
-	}
+	} else
+		ordered_events__init(&session->ordered_events, &session->machines, session->evlist, tool);
 
 	return session;
 
@@ -508,24 +508,19 @@ static perf_event__swap_op perf_event__swap_ops[] = {
  *      Flush every events below timestamp 7
  *      etc...
  */
-static int process_finished_round(struct perf_tool *tool,
+static int process_finished_round(struct perf_tool *tool __maybe_unused,
 				  union perf_event *event __maybe_unused,
 				  struct perf_session *session)
 {
 	struct ordered_events *oe = &session->ordered_events;
-	struct perf_evlist *evlist = session->evlist;
-	struct machines *machines = &session->machines;
 
-	return ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__ROUND);
+	return ordered_events__flush(oe, OE_FLUSH__ROUND);
 }
 
-int perf_session_queue_event(struct perf_session *s, union perf_event *event,
-			     struct perf_tool *tool, struct perf_sample *sample,
-			     u64 file_offset)
+int perf_session__queue_event(struct perf_session *s, union perf_event *event,
+			      struct perf_sample *sample, u64 file_offset)
 {
 	struct ordered_events *oe = &s->ordered_events;
-	struct perf_evlist *evlist = s->evlist;
-	struct machines *machines = &s->machines;
 
 	u64 timestamp = sample->time;
 	struct ordered_event *new;
@@ -543,7 +538,7 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
 
 	new = ordered_events__new(oe, timestamp, event);
 	if (!new) {
-		ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__HALF);
+		ordered_events__flush(oe, OE_FLUSH__HALF);
 		new = ordered_events__new(oe, timestamp, event);
 	}
 
@@ -948,9 +943,9 @@ int machines__deliver_event(struct machines *machines,
 
 static s64 perf_session__process_user_event(struct perf_session *session,
 					    union perf_event *event,
-					    struct perf_tool *tool,
 					    u64 file_offset)
 {
+	struct perf_tool *tool = session->ordered_events.tool;
 	int fd = perf_data_file__fd(session->file);
 	int err;
 
@@ -988,15 +983,15 @@ static s64 perf_session__process_user_event(struct perf_session *session,
 
 int perf_session__deliver_synth_event(struct perf_session *session,
 				      union perf_event *event,
-				      struct perf_sample *sample,
-				      struct perf_tool *tool)
+				      struct perf_sample *sample)
 {
 	struct perf_evlist *evlist = session->evlist;
+	struct perf_tool *tool = session->ordered_events.tool;
 
 	events_stats__inc(&evlist->stats, event->header.type);
 
 	if (event->header.type >= PERF_RECORD_USER_TYPE_START)
-		return perf_session__process_user_event(session, event, tool, 0);
+		return perf_session__process_user_event(session, event, 0);
 
 	return machines__deliver_event(&session->machines, evlist, event, sample, tool, 0);
 }
@@ -1066,11 +1061,10 @@ out_parse_sample:
 }
 
 static s64 perf_session__process_event(struct perf_session *session,
-				       union perf_event *event,
-				       struct perf_tool *tool,
-				       u64 file_offset)
+				       union perf_event *event, u64 file_offset)
 {
 	struct perf_evlist *evlist = session->evlist;
+	struct perf_tool *tool = session->ordered_events.tool;
 	struct perf_sample sample;
 	int ret;
 
@@ -1083,7 +1077,7 @@ static s64 perf_session__process_event(struct perf_session *session,
 	events_stats__inc(&evlist->stats, event->header.type);
 
 	if (event->header.type >= PERF_RECORD_USER_TYPE_START)
-		return perf_session__process_user_event(session, event, tool, file_offset);
+		return perf_session__process_user_event(session, event, file_offset);
 
 	/*
 	 * For all kernel events we get the sample data
@@ -1093,8 +1087,7 @@ static s64 perf_session__process_event(struct perf_session *session,
 		return ret;
 
 	if (tool->ordered_events) {
-		ret = perf_session_queue_event(session, event, tool, &sample,
-					       file_offset);
+		ret = perf_session__queue_event(session, event, &sample, file_offset);
 		if (ret != -ETIME)
 			return ret;
 	}
@@ -1173,12 +1166,10 @@ static void perf_tool__warn_about_errors(const struct perf_tool *tool,
 
 volatile int session_done;
 
-static int __perf_session__process_pipe_events(struct perf_session *session,
-					       struct perf_tool *tool)
+static int __perf_session__process_pipe_events(struct perf_session *session)
 {
 	struct ordered_events *oe = &session->ordered_events;
-	struct perf_evlist *evlist = session->evlist;
-	struct machines *machines = &session->machines;
+	struct perf_tool *tool = oe->tool;
 	int fd = perf_data_file__fd(session->file);
 	union perf_event *event;
 	uint32_t size, cur_size = 0;
@@ -1242,7 +1233,7 @@ more:
 		}
 	}
 
-	if ((skip = perf_session__process_event(session, event, tool, head)) < 0) {
+	if ((skip = perf_session__process_event(session, event, head)) < 0) {
 		pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
 		       head, event->header.size, event->header.type);
 		err = -EINVAL;
@@ -1258,7 +1249,7 @@ more:
 		goto more;
 done:
 	/* do the final flush for ordered samples */
-	err = ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__FINAL);
+	err = ordered_events__flush(oe, OE_FLUSH__FINAL);
 out_err:
 	free(buf);
 	perf_tool__warn_about_errors(tool, &session->evlist->stats);
@@ -1308,11 +1299,10 @@ fetch_mmaped_event(struct perf_session *session,
 
 static int __perf_session__process_events(struct perf_session *session,
 					  u64 data_offset, u64 data_size,
-					  u64 file_size, struct perf_tool *tool)
+					  u64 file_size)
 {
 	struct ordered_events *oe = &session->ordered_events;
-	struct perf_evlist *evlist = session->evlist;
-	struct machines *machines = &session->machines;
+	struct perf_tool *tool = oe->tool;
 	int fd = perf_data_file__fd(session->file);
 	u64 head, page_offset, file_offset, file_pos, size;
 	int err, mmap_prot, mmap_flags, map_idx = 0;
@@ -1381,8 +1371,7 @@ more:
 	size = event->header.size;
 
 	if (size < sizeof(struct perf_event_header) ||
-	    (skip = perf_session__process_event(session, event, tool, file_pos))
-									< 0) {
+	    (skip = perf_session__process_event(session, event, file_pos)) < 0) {
 		pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
 		       file_offset + head, event->header.size,
 		       event->header.type);
@@ -1406,7 +1395,7 @@ more:
 
 out:
 	/* do the final flush for ordered samples */
-	err = ordered_events__flush(oe, machines, evlist, tool, OE_FLUSH__FINAL);
+	err = ordered_events__flush(oe, OE_FLUSH__FINAL);
 out_err:
 	ui_progress__finish();
 	perf_tool__warn_about_errors(tool, &session->evlist->stats);
@@ -1415,8 +1404,7 @@ out_err:
 	return err;
 }
 
-int perf_session__process_events(struct perf_session *session,
-				 struct perf_tool *tool)
+int perf_session__process_events(struct perf_session *session)
 {
 	u64 size = perf_data_file__size(session->file);
 	int err;
@@ -1427,10 +1415,9 @@ int perf_session__process_events(struct perf_session *session,
 	if (!perf_data_file__is_pipe(session->file))
 		err = __perf_session__process_events(session,
 						     session->header.data_offset,
-						     session->header.data_size,
-						     size, tool);
+						     session->header.data_size, size);
 	else
-		err = __perf_session__process_pipe_events(session, tool);
+		err = __perf_session__process_pipe_events(session);
 
 	return err;
 }
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index c08fa6be5bf3..06e0777e9803 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -48,12 +48,10 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset,
 			     union perf_event **event_ptr,
 			     struct perf_sample *sample);
 
-int perf_session__process_events(struct perf_session *session,
-				 struct perf_tool *tool);
+int perf_session__process_events(struct perf_session *session);
 
-int perf_session_queue_event(struct perf_session *s, union perf_event *event,
-			     struct perf_tool *tool, struct perf_sample *sample,
-			     u64 file_offset);
+int perf_session__queue_event(struct perf_session *s, union perf_event *event,
+			      struct perf_sample *sample, u64 file_offset);
 
 void perf_tool__fill_defaults(struct perf_tool *tool);
 
@@ -126,8 +124,7 @@ extern volatile int session_done;
 
 int perf_session__deliver_synth_event(struct perf_session *session,
 				      union perf_event *event,
-				      struct perf_sample *sample,
-				      struct perf_tool *tool);
+				      struct perf_sample *sample);
 
 int perf_event__process_id_index(struct perf_tool *tool,
 				 union perf_event *event,
-- 
1.9.3


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

* [PATCH 03/24] perf ordered_events: Allow tools to specify a deliver method
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 01/24] perf ordered_events: Untangle from perf_session Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 02/24] perf ordered_events: Shorten function signatures Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 04/24] perf tools: tool->finished_round() doesn't need perf_session Arnaldo Carvalho de Melo
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 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, Namhyung Kim, Stephane Eranian

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

So that we can simplify the deliver method to pass just:

 (ordered_events, ordered_event, sample);

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-j0s4bpxs5qza5tnkvjwom9rw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ordered-events.c |  7 ++++---
 tools/perf/util/ordered-events.h | 11 ++++++++++-
 tools/perf/util/session.c        | 30 +++++++++++++++++++++++-------
 tools/perf/util/session.h        |  6 ------
 4 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index bad46ce16591..0d8cea91d2c9 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -181,8 +181,7 @@ static int __ordered_events__flush(struct ordered_events *oe)
 		if (ret)
 			pr_err("Can't parse sample, err = %d\n", ret);
 		else {
-			ret = machines__deliver_event(oe->machines, oe->evlist, iter->event,
-						      &sample, oe->tool, iter->file_offset);
+			ret = oe->deliver(oe, iter, &sample);
 			if (ret)
 				return ret;
 		}
@@ -264,7 +263,8 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
 }
 
 void ordered_events__init(struct ordered_events *oe, struct machines *machines,
-			  struct perf_evlist *evlist, struct perf_tool *tool)
+			  struct perf_evlist *evlist, struct perf_tool *tool,
+			  ordered_events__deliver_t deliver)
 {
 	INIT_LIST_HEAD(&oe->events);
 	INIT_LIST_HEAD(&oe->cache);
@@ -274,6 +274,7 @@ void ordered_events__init(struct ordered_events *oe, struct machines *machines,
 	oe->evlist	   = evlist;
 	oe->machines	   = machines;
 	oe->tool	   = tool;
+	oe->deliver	   = deliver;
 }
 
 void ordered_events__free(struct ordered_events *oe)
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index ef7d73ecb0d0..c6cf0bafbb2c 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -5,6 +5,7 @@
 
 struct perf_tool;
 struct perf_evlist;
+struct perf_sample;
 struct machines;
 
 struct ordered_event {
@@ -21,6 +22,12 @@ enum oe_flush {
 	OE_FLUSH__HALF,
 };
 
+struct ordered_events;
+
+typedef int (*ordered_events__deliver_t)(struct ordered_events *oe,
+					 struct ordered_event *event,
+					 struct perf_sample *sample);
+
 struct ordered_events {
 	u64			last_flush;
 	u64			next_flush;
@@ -35,6 +42,7 @@ struct ordered_events {
 	struct machines		*machines;
 	struct perf_evlist	*evlist;
 	struct perf_tool	*tool;
+	ordered_events__deliver_t deliver;
 	int			buffer_idx;
 	unsigned int		nr_events;
 	enum oe_flush		last_flush_type;
@@ -46,7 +54,8 @@ struct ordered_event *ordered_events__new(struct ordered_events *oe, u64 timesta
 void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
 int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
 void ordered_events__init(struct ordered_events *oe, struct machines *machines,
-			  struct perf_evlist *evlsit, struct perf_tool *tool);
+			  struct perf_evlist *evlsit, struct perf_tool *tool,
+			  ordered_events__deliver_t deliver);
 void ordered_events__free(struct ordered_events *oe);
 
 static inline
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index c6dd89f62fc4..e2f318a3f17a 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -16,6 +16,12 @@
 #include "perf_regs.h"
 #include "asm/bug.h"
 
+static int machines__deliver_event(struct machines *machines,
+				   struct perf_evlist *evlist,
+				   union perf_event *event,
+				   struct perf_sample *sample,
+				   struct perf_tool *tool, u64 file_offset);
+
 static int perf_session__open(struct perf_session *session)
 {
 	struct perf_data_file *file = session->file;
@@ -86,6 +92,14 @@ static void perf_session__set_comm_exec(struct perf_session *session)
 	machines__set_comm_exec(&session->machines, comm_exec);
 }
 
+static int ordered_events__deliver_event(struct ordered_events *oe,
+					 struct ordered_event *event,
+					 struct perf_sample *sample)
+{
+	return machines__deliver_event(oe->machines, oe->evlist, event->event,
+				       sample, oe->tool, event->file_offset);
+}
+
 struct perf_session *perf_session__new(struct perf_data_file *file,
 				       bool repipe, struct perf_tool *tool)
 {
@@ -125,8 +139,10 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
 	    tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) {
 		dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
 		tool->ordered_events = false;
-	} else
-		ordered_events__init(&session->ordered_events, &session->machines, session->evlist, tool);
+	} else {
+		ordered_events__init(&session->ordered_events, &session->machines,
+				     session->evlist, tool, ordered_events__deliver_event);
+	}
 
 	return session;
 
@@ -888,11 +904,11 @@ static int
 					    &sample->read.one, machine);
 }
 
-int machines__deliver_event(struct machines *machines,
-				struct perf_evlist *evlist,
-				union perf_event *event,
-				struct perf_sample *sample,
-				struct perf_tool *tool, u64 file_offset)
+static int machines__deliver_event(struct machines *machines,
+				   struct perf_evlist *evlist,
+				   union perf_event *event,
+				   struct perf_sample *sample,
+				   struct perf_tool *tool, u64 file_offset)
 {
 	struct perf_evsel *evsel;
 	struct machine *machine;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 06e0777e9803..1310998f8318 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -55,12 +55,6 @@ int perf_session__queue_event(struct perf_session *s, union perf_event *event,
 
 void perf_tool__fill_defaults(struct perf_tool *tool);
 
-int machines__deliver_event(struct machines *machines,
-				struct perf_evlist *evlist,
-				union perf_event *event,
-				struct perf_sample *sample,
-				struct perf_tool *tool, u64 file_offset);
-
 int perf_session__resolve_callchain(struct perf_session *session,
 				    struct perf_evsel *evsel,
 				    struct thread *thread,
-- 
1.9.3


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

* [PATCH 04/24] perf tools: tool->finished_round() doesn't need perf_session
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 03/24] perf ordered_events: Allow tools to specify a deliver method Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 05/24] perf tools: Remove superfluous thread->comm_set setting Arnaldo Carvalho de Melo
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 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, Namhyung Kim, Stephane Eranian

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

It is all about flushing the ordered queue or piping it thru, no need
for a perf_session pointer.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-g47fx3ys0t9271cp0dcabjc7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-inject.c |  9 ++++++++-
 tools/perf/builtin-kvm.c    |  7 +++++--
 tools/perf/util/session.c   | 24 +++++++++++++++---------
 tools/perf/util/tool.h      |  8 ++++++--
 4 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 2563f07ec0e5..ea46df25368c 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -53,6 +53,13 @@ static int perf_event__repipe_synth(struct perf_tool *tool,
 	return 0;
 }
 
+static int perf_event__repipe_oe_synth(struct perf_tool *tool,
+				       union perf_event *event,
+				       struct ordered_events *oe __maybe_unused)
+{
+	return perf_event__repipe_synth(tool, event);
+}
+
 static int perf_event__repipe_op2_synth(struct perf_tool *tool,
 					union perf_event *event,
 					struct perf_session *session
@@ -406,7 +413,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
 			.unthrottle	= perf_event__repipe,
 			.attr		= perf_event__repipe_attr,
 			.tracing_data	= perf_event__repipe_op2_synth,
-			.finished_round	= perf_event__repipe_op2_synth,
+			.finished_round	= perf_event__repipe_oe_synth,
 			.build_id	= perf_event__repipe_op2_synth,
 			.id_index	= perf_event__repipe_op2_synth,
 		},
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 802b8f53fa9a..643722f40075 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -18,6 +18,7 @@
 #include "util/stat.h"
 #include "util/top.h"
 #include "util/data.h"
+#include "util/ordered-events.h"
 
 #include <sys/prctl.h>
 #ifdef HAVE_TIMERFD_SUPPORT
@@ -783,8 +784,10 @@ static int perf_kvm__mmap_read(struct perf_kvm_stat *kvm)
 
 	/* flush queue after each round in which we processed events */
 	if (ntotal) {
-		kvm->session->ordered_events.next_flush = flush_time;
-		err = kvm->tool.finished_round(&kvm->tool, NULL, kvm->session);
+		struct ordered_events *oe = &kvm->session->ordered_events;
+
+		oe->next_flush = flush_time;
+		err = ordered_events__flush(oe, OE_FLUSH__ROUND);
 		if (err) {
 			if (kvm->lost_events)
 				pr_info("\nLost events: %" PRIu64 "\n\n",
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e2f318a3f17a..703a370ae5b6 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -225,10 +225,17 @@ static int process_event_stub(struct perf_tool *tool __maybe_unused,
 	return 0;
 }
 
+static int process_build_id_stub(struct perf_tool *tool __maybe_unused,
+				 union perf_event *event __maybe_unused,
+				 struct perf_session *session __maybe_unused)
+{
+	dump_printf(": unhandled!\n");
+	return 0;
+}
+
 static int process_finished_round_stub(struct perf_tool *tool __maybe_unused,
 				       union perf_event *event __maybe_unused,
-				       struct perf_session *perf_session
-				       __maybe_unused)
+				       struct ordered_events *oe __maybe_unused)
 {
 	dump_printf(": unhandled!\n");
 	return 0;
@@ -236,7 +243,7 @@ static int process_finished_round_stub(struct perf_tool *tool __maybe_unused,
 
 static int process_finished_round(struct perf_tool *tool,
 				  union perf_event *event,
-				  struct perf_session *session);
+				  struct ordered_events *oe);
 
 static int process_id_index_stub(struct perf_tool *tool __maybe_unused,
 				 union perf_event *event __maybe_unused,
@@ -274,7 +281,7 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
 	if (tool->tracing_data == NULL)
 		tool->tracing_data = process_event_synth_tracing_data_stub;
 	if (tool->build_id == NULL)
-		tool->build_id = process_finished_round_stub;
+		tool->build_id = process_build_id_stub;
 	if (tool->finished_round == NULL) {
 		if (tool->ordered_events)
 			tool->finished_round = process_finished_round;
@@ -526,10 +533,8 @@ static perf_event__swap_op perf_event__swap_ops[] = {
  */
 static int process_finished_round(struct perf_tool *tool __maybe_unused,
 				  union perf_event *event __maybe_unused,
-				  struct perf_session *session)
+				  struct ordered_events *oe)
 {
-	struct ordered_events *oe = &session->ordered_events;
-
 	return ordered_events__flush(oe, OE_FLUSH__ROUND);
 }
 
@@ -961,7 +966,8 @@ static s64 perf_session__process_user_event(struct perf_session *session,
 					    union perf_event *event,
 					    u64 file_offset)
 {
-	struct perf_tool *tool = session->ordered_events.tool;
+	struct ordered_events *oe = &session->ordered_events;
+	struct perf_tool *tool = oe->tool;
 	int fd = perf_data_file__fd(session->file);
 	int err;
 
@@ -989,7 +995,7 @@ static s64 perf_session__process_user_event(struct perf_session *session,
 	case PERF_RECORD_HEADER_BUILD_ID:
 		return tool->build_id(tool, event, session);
 	case PERF_RECORD_FINISHED_ROUND:
-		return tool->finished_round(tool, event, session);
+		return tool->finished_round(tool, event, oe);
 	case PERF_RECORD_ID_INDEX:
 		return tool->id_index(tool, event, session);
 	default:
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h
index bb2708bbfaca..51d9e56c0f84 100644
--- a/tools/perf/util/tool.h
+++ b/tools/perf/util/tool.h
@@ -10,6 +10,7 @@ struct perf_evsel;
 struct perf_sample;
 struct perf_tool;
 struct machine;
+struct ordered_events;
 
 typedef int (*event_sample)(struct perf_tool *tool, union perf_event *event,
 			    struct perf_sample *sample,
@@ -25,6 +26,9 @@ typedef int (*event_attr_op)(struct perf_tool *tool,
 typedef int (*event_op2)(struct perf_tool *tool, union perf_event *event,
 			 struct perf_session *session);
 
+typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
+			struct ordered_events *oe);
+
 struct perf_tool {
 	event_sample	sample,
 			read;
@@ -38,8 +42,8 @@ struct perf_tool {
 			unthrottle;
 	event_attr_op	attr;
 	event_op2	tracing_data;
-	event_op2	finished_round,
-			build_id,
+	event_oe	finished_round;
+	event_op2	build_id,
 			id_index;
 	bool		ordered_events;
 	bool		ordering_requires_timestamps;
-- 
1.9.3


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

* [PATCH 05/24] perf tools: Remove superfluous thread->comm_set setting
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 04/24] perf tools: tool->finished_round() doesn't need perf_session Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 06/24] perf ordered_events: Adopt queue() method Arnaldo Carvalho de Melo
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

It is set by calling thread__set_comm right before the removed line.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1425396581-17716-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/thread.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index a5dbba95107f..1c8fbc9588c5 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -206,7 +206,6 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp)
 		err = thread__set_comm(thread, comm, timestamp);
 		if (err)
 			return err;
-		thread->comm_set = true;
 	}
 
 	thread->ppid = parent->tid;
-- 
1.9.3


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

* [PATCH 06/24] perf ordered_events: Adopt queue() method
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 05/24] perf tools: Remove superfluous thread->comm_set setting Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 07/24] perf probe: Fix to handle aliased symbols in glibc Arnaldo Carvalho de Melo
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 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, Namhyung Kim, Stephane Eranian

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

>From perf_session, will be used in 'trace'.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-mfihndzaumx44h6y37ng2irb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ordered-events.c | 34 ++++++++++++++++++++++++++++++++--
 tools/perf/util/ordered-events.h |  4 ++--
 tools/perf/util/session.c        | 28 +---------------------------
 3 files changed, 35 insertions(+), 31 deletions(-)

diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 0d8cea91d2c9..6002fa3fcf77 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -131,8 +131,8 @@ static struct ordered_event *alloc_event(struct ordered_events *oe,
 	return new;
 }
 
-struct ordered_event *
-ordered_events__new(struct ordered_events *oe, u64 timestamp,
+static struct ordered_event *
+ordered_events__new_event(struct ordered_events *oe, u64 timestamp,
 		    union perf_event *event)
 {
 	struct ordered_event *new;
@@ -153,6 +153,36 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve
 	free_dup_event(oe, event->event);
 }
 
+int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
+			  struct perf_sample *sample, u64 file_offset)
+{
+	u64 timestamp = sample->time;
+	struct ordered_event *oevent;
+
+	if (!timestamp || timestamp == ~0ULL)
+		return -ETIME;
+
+	if (timestamp < oe->last_flush) {
+		pr_oe_time(timestamp,      "out of order event\n");
+		pr_oe_time(oe->last_flush, "last flush, last_flush_type %d\n",
+			   oe->last_flush_type);
+
+		oe->evlist->stats.nr_unordered_events++;
+	}
+
+	oevent = ordered_events__new_event(oe, timestamp, event);
+	if (!oevent) {
+		ordered_events__flush(oe, OE_FLUSH__HALF);
+		oevent = ordered_events__new_event(oe, timestamp, event);
+	}
+
+	if (!oevent)
+		return -ENOMEM;
+
+	oevent->file_offset = file_offset;
+	return 0;
+}
+
 static int __ordered_events__flush(struct ordered_events *oe)
 {
 	struct list_head *head = &oe->events;
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index c6cf0bafbb2c..173e13f28c08 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -49,8 +49,8 @@ struct ordered_events {
 	bool                    copy_on_queue;
 };
 
-struct ordered_event *ordered_events__new(struct ordered_events *oe, u64 timestamp,
-					  union perf_event *event);
+int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
+			  struct perf_sample *sample, u64 file_offset);
 void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
 int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
 void ordered_events__init(struct ordered_events *oe, struct machines *machines,
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 703a370ae5b6..adf0740c563b 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -541,33 +541,7 @@ static int process_finished_round(struct perf_tool *tool __maybe_unused,
 int perf_session__queue_event(struct perf_session *s, union perf_event *event,
 			      struct perf_sample *sample, u64 file_offset)
 {
-	struct ordered_events *oe = &s->ordered_events;
-
-	u64 timestamp = sample->time;
-	struct ordered_event *new;
-
-	if (!timestamp || timestamp == ~0ULL)
-		return -ETIME;
-
-	if (timestamp < oe->last_flush) {
-		pr_oe_time(timestamp,      "out of order event\n");
-		pr_oe_time(oe->last_flush, "last flush, last_flush_type %d\n",
-			   oe->last_flush_type);
-
-		s->evlist->stats.nr_unordered_events++;
-	}
-
-	new = ordered_events__new(oe, timestamp, event);
-	if (!new) {
-		ordered_events__flush(oe, OE_FLUSH__HALF);
-		new = ordered_events__new(oe, timestamp, event);
-	}
-
-	if (!new)
-		return -ENOMEM;
-
-	new->file_offset = file_offset;
-	return 0;
+	return ordered_events__queue(&s->ordered_events, event, sample, file_offset);
 }
 
 static void callchain__lbr_callstack_printf(struct perf_sample *sample)
-- 
1.9.3


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

* [PATCH 07/24] perf probe: Fix to handle aliased symbols in glibc
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 06/24] perf ordered_events: Adopt queue() method Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 08/24] perf probe: Fix --line " Arnaldo Carvalho de Melo
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masami Hiramatsu, David Ahern, Jiri Olsa,
	Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Arnaldo Carvalho de Melo

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

Fix perf probe to handle aliased symbols correctly in glibc.  In the
glibc, several symbols are defined as an alias of __libc_XXX, e.g.
malloc is an alias of __libc_malloc.

In such cases, dwarf has no subroutine instances of the alias functions
(e.g. no "malloc" instance), but the map has that symbol and its
address.

Thus, if we search the alieased symbol in debuginfo, we always fail to
find it, but it is in the map.

To solve this problem, this fails back to address-based alternative
search, which searches the symbol in the map, translates its address to
alternative (correct) function name by using debuginfo, and retry to
find the alternative function point from debuginfo.

This adds fail-back process to --vars, --lines and --add options. So,
now you can use those on malloc@libc :)

Without this patch;
  -----
  # ./perf probe -x /usr/lib64/libc-2.17.so -V malloc
  Failed to find the address of malloc
    Error: Failed to show vars.
  # ./perf probe -x /usr/lib64/libc-2.17.so -a "malloc bytes"
  Probe point 'malloc' not found in debuginfo.
    Error: Failed to add events.
  -----

With this patch;
  -----
  # ./perf probe -x /usr/lib64/libc-2.17.so -V malloc
  Available variables at malloc
          @<__libc_malloc+0>
                  size_t  bytes
  # ./perf probe -x /usr/lib64/libc-2.17.so -a "malloc bytes"
  Added new event:
    probe_libc:malloc    (on malloc in /usr/lib64/libc-2.17.so with bytes)

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

          perf record -e probe_libc:malloc -aR sleep 1
  -----

Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150306073120.6904.13779.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 140 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 124 insertions(+), 16 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 1c570c2fa7cc..b8f45782126a 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -178,6 +178,25 @@ static struct map *kernel_get_module_map(const char *module)
 	return NULL;
 }
 
+static struct map *get_target_map(const char *target, bool user)
+{
+	/* Init maps of given executable or kernel */
+	if (user)
+		return dso__new_map(target);
+	else
+		return kernel_get_module_map(target);
+}
+
+static void put_target_map(struct map *map, bool user)
+{
+	if (map && user) {
+		/* Only the user map needs to be released */
+		dso__delete(map->dso);
+		map__delete(map);
+	}
+}
+
+
 static struct dso *kernel_get_module_dso(const char *module)
 {
 	struct dso *dso;
@@ -249,6 +268,13 @@ out:
 	return ret;
 }
 
+static void clear_perf_probe_point(struct perf_probe_point *pp)
+{
+	free(pp->file);
+	free(pp->function);
+	free(pp->lazy_line);
+}
+
 static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
 {
 	int i;
@@ -258,6 +284,74 @@ static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
 }
 
 #ifdef HAVE_DWARF_SUPPORT
+/*
+ * Some binaries like glibc have special symbols which are on the symbol
+ * table, but not in the debuginfo. If we can find the address of the
+ * symbol from map, we can translate the address back to the probe point.
+ */
+static int find_alternative_probe_point(struct debuginfo *dinfo,
+					struct perf_probe_point *pp,
+					struct perf_probe_point *result,
+					const char *target, bool uprobes)
+{
+	struct map *map = NULL;
+	struct symbol *sym;
+	u64 address = 0;
+	int ret = -ENOENT;
+
+	/* This can work only for function-name based one */
+	if (!pp->function || pp->file)
+		return -ENOTSUP;
+
+	map = get_target_map(target, uprobes);
+	if (!map)
+		return -EINVAL;
+
+	/* Find the address of given function */
+	map__for_each_symbol_by_name(map, pp->function, sym) {
+		if (sym->binding == STB_GLOBAL || sym->binding == STB_LOCAL) {
+			address = sym->start;
+			break;
+		}
+	}
+	if (!address) {
+		ret = -ENOENT;
+		goto out;
+	}
+	pr_debug("Symbol %s address found : %lx\n", pp->function, address);
+
+	ret = debuginfo__find_probe_point(dinfo, (unsigned long)address,
+					  result);
+	if (ret <= 0)
+		ret = (!ret) ? -ENOENT : ret;
+	else {
+		result->offset += pp->offset;
+		result->line += pp->line;
+		ret = 0;
+	}
+
+out:
+	put_target_map(map, uprobes);
+	return ret;
+
+}
+
+static int get_alternative_probe_event(struct debuginfo *dinfo,
+				       struct perf_probe_event *pev,
+				       struct perf_probe_point *tmp,
+				       const char *target)
+{
+	int ret;
+
+	memcpy(tmp, &pev->point, sizeof(*tmp));
+	memset(&pev->point, 0, sizeof(pev->point));
+	ret = find_alternative_probe_point(dinfo, tmp, &pev->point,
+					   target, pev->uprobes);
+	if (ret < 0)
+		memcpy(&pev->point, tmp, sizeof(*tmp));
+
+	return ret;
+}
 
 /* Open new debuginfo of given module */
 static struct debuginfo *open_debuginfo(const char *module, bool silent)
@@ -466,6 +560,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 					  int max_tevs, const char *target)
 {
 	bool need_dwarf = perf_probe_event_need_dwarf(pev);
+	struct perf_probe_point tmp;
 	struct debuginfo *dinfo;
 	int ntevs, ret = 0;
 
@@ -482,6 +577,20 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 	/* Searching trace events corresponding to a probe event */
 	ntevs = debuginfo__find_trace_events(dinfo, pev, tevs, max_tevs);
 
+	if (ntevs == 0)	{  /* Not found, retry with an alternative */
+		ret = get_alternative_probe_event(dinfo, pev, &tmp, target);
+		if (!ret) {
+			ntevs = debuginfo__find_trace_events(dinfo, pev,
+							     tevs, max_tevs);
+			/*
+			 * Write back to the original probe_event for
+			 * setting appropriate (user given) event name
+			 */
+			clear_perf_probe_point(&pev->point);
+			memcpy(&pev->point, &tmp, sizeof(tmp));
+		}
+	}
+
 	debuginfo__delete(dinfo);
 
 	if (ntevs > 0) {	/* Succeeded to find trace events */
@@ -719,12 +828,13 @@ int show_line_range(struct line_range *lr, const char *module, bool user)
 static int show_available_vars_at(struct debuginfo *dinfo,
 				  struct perf_probe_event *pev,
 				  int max_vls, struct strfilter *_filter,
-				  bool externs)
+				  bool externs, const char *target)
 {
 	char *buf;
 	int ret, i, nvars;
 	struct str_node *node;
 	struct variable_list *vls = NULL, *vl;
+	struct perf_probe_point tmp;
 	const char *var;
 
 	buf = synthesize_perf_probe_point(&pev->point);
@@ -734,6 +844,15 @@ static int show_available_vars_at(struct debuginfo *dinfo,
 
 	ret = debuginfo__find_available_vars_at(dinfo, pev, &vls,
 						max_vls, externs);
+	if (!ret) {  /* Not found, retry with an alternative */
+		ret = get_alternative_probe_event(dinfo, pev, &tmp, target);
+		if (!ret) {
+			ret = debuginfo__find_available_vars_at(dinfo, pev,
+						&vls, max_vls, externs);
+			/* Release the old probe_point */
+			clear_perf_probe_point(&tmp);
+		}
+	}
 	if (ret <= 0) {
 		if (ret == 0 || ret == -ENOENT) {
 			pr_err("Failed to find the address of %s\n", buf);
@@ -796,7 +915,7 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs,
 
 	for (i = 0; i < npevs && ret >= 0; i++)
 		ret = show_available_vars_at(dinfo, &pevs[i], max_vls, _filter,
-					     externs);
+					     externs, module);
 
 	debuginfo__delete(dinfo);
 out:
@@ -1742,15 +1861,12 @@ static int convert_to_perf_probe_event(struct probe_trace_event *tev,
 
 void clear_perf_probe_event(struct perf_probe_event *pev)
 {
-	struct perf_probe_point *pp = &pev->point;
 	struct perf_probe_arg_field *field, *next;
 	int i;
 
 	free(pev->event);
 	free(pev->group);
-	free(pp->file);
-	free(pp->function);
-	free(pp->lazy_line);
+	clear_perf_probe_point(&pev->point);
 
 	for (i = 0; i < pev->nargs; i++) {
 		free(pev->args[i].name);
@@ -2367,11 +2483,7 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
 	int num_matched_functions;
 	int ret, i;
 
-	/* Init maps of given executable or kernel */
-	if (pev->uprobes)
-		map = dso__new_map(target);
-	else
-		map = kernel_get_module_map(target);
+	map = get_target_map(target, pev->uprobes);
 	if (!map) {
 		ret = -EINVAL;
 		goto out;
@@ -2464,11 +2576,7 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
 	}
 
 out:
-	if (map && pev->uprobes) {
-		/* Only when using uprobe(exec) map needs to be released */
-		dso__delete(map->dso);
-		map__delete(map);
-	}
+	put_target_map(map, pev->uprobes);
 	return ret;
 
 nomem_out:
-- 
1.9.3


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

* [PATCH 08/24] perf probe: Fix --line to handle aliased symbols in glibc
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 07/24] perf probe: Fix to handle aliased symbols in glibc Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 09/24] Revert "perf probe: Fix to fall back to find probe point in symbols" Arnaldo Carvalho de Melo
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masami Hiramatsu, David Ahern, Jiri Olsa,
	Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Arnaldo Carvalho de Melo

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

Fix perf probe --line to handle aliased symbols correctly in glibc.

This makes line_range search failing back to address-based alternative
search as same as --add and --vars.

Without this patch;
  -----
  # ./perf probe -x /usr/lib64/libc-2.17.so -L malloc
  Specified source line is not found.
    Error: Failed to show lines.
  -----

With this patch;
  -----
  # ./perf probe -x /usr/lib64/libc-2.17.so -L malloc
  <__libc_malloc@/usr/src/debug/glibc-2.17-c758a686/malloc/malloc.c:0>
        0  __libc_malloc(size_t bytes)
        1  {
             mstate ar_ptr;
             void *victim;

             __malloc_ptr_t (*hook) (size_t, const __malloc_ptr_t)
        6      = force_reg (__malloc_hook);
        7    if (__builtin_expect (hook != NULL, 0))
        8      return (*hook)(bytes, RETURN_ADDRESS (0));

       10    arena_lookup(ar_ptr);

       12    arena_lock(ar_ptr, bytes);
  -----

Note that this actually shows __libc_malloc, since it is the real
instance of malloc. User can use both __libc_malloc and malloc for
--line.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150306073122.6904.18540.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index b8f45782126a..4cfd1211a2ae 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -353,6 +353,31 @@ static int get_alternative_probe_event(struct debuginfo *dinfo,
 	return ret;
 }
 
+static int get_alternative_line_range(struct debuginfo *dinfo,
+				      struct line_range *lr,
+				      const char *target, bool user)
+{
+	struct perf_probe_point pp = { 0 }, result = { 0 };
+	int ret, len = 0;
+
+	pp.function = lr->function;
+	pp.file = lr->file;
+	pp.line = lr->start;
+	if (lr->end != INT_MAX)
+		len = lr->end - lr->start;
+	ret = find_alternative_probe_point(dinfo, &pp, &result,
+					   target, user);
+	if (!ret) {
+		lr->function = result.function;
+		lr->file = result.file;
+		lr->start = result.line;
+		if (lr->end != INT_MAX)
+			lr->end = lr->start + len;
+		clear_perf_probe_point(&pp);
+	}
+	return ret;
+}
+
 /* Open new debuginfo of given module */
 static struct debuginfo *open_debuginfo(const char *module, bool silent)
 {
@@ -734,7 +759,8 @@ static int _show_one_line(FILE *fp, int l, bool skip, bool show_num)
  * Show line-range always requires debuginfo to find source file and
  * line number.
  */
-static int __show_line_range(struct line_range *lr, const char *module)
+static int __show_line_range(struct line_range *lr, const char *module,
+			     bool user)
 {
 	int l = 1;
 	struct int_node *ln;
@@ -750,6 +776,11 @@ static int __show_line_range(struct line_range *lr, const char *module)
 		return -ENOENT;
 
 	ret = debuginfo__find_line_range(dinfo, lr);
+	if (!ret) {	/* Not found, retry with an alternative */
+		ret = get_alternative_line_range(dinfo, lr, module, user);
+		if (!ret)
+			ret = debuginfo__find_line_range(dinfo, lr);
+	}
 	debuginfo__delete(dinfo);
 	if (ret == 0 || ret == -ENOENT) {
 		pr_warning("Specified source line is not found.\n");
@@ -819,7 +850,7 @@ int show_line_range(struct line_range *lr, const char *module, bool user)
 	ret = init_symbol_maps(user);
 	if (ret < 0)
 		return ret;
-	ret = __show_line_range(lr, module);
+	ret = __show_line_range(lr, module, user);
 	exit_symbol_maps();
 
 	return ret;
-- 
1.9.3


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

* [PATCH 09/24] Revert "perf probe: Fix to fall back to find probe point in symbols"
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 08/24] perf probe: Fix --line " Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 10/24] perf symbols: Allow symbol alias when loading map for symbol name Arnaldo Carvalho de Melo
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Masami Hiramatsu, David Ahern, Jiri Olsa,
	Namhyung Kim, Naohiro Aota, Peter Zijlstra,
	Arnaldo Carvalho de Melo

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

This reverts commit 906451b98b67 ("perf probe: Fix to fall back to find probe point in symbols").

Since 'perf probe' now retries with the address of given symbol searched from
map before this path, this fall back routine isn't needed anymore.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150306073124.6904.1751.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 4cfd1211a2ae..c379ea0edfd5 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -630,11 +630,9 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
 	}
 
 	if (ntevs == 0)	{	/* No error but failed to find probe point. */
-		pr_warning("Probe point '%s' not found in debuginfo.\n",
+		pr_warning("Probe point '%s' not found.\n",
 			   synthesize_perf_probe_point(&pev->point));
-		if (need_dwarf)
-			return -ENOENT;
-		return 0;
+		return -ENOENT;
 	}
 	/* Error path : ntevs < 0 */
 	pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
-- 
1.9.3


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

* [PATCH 10/24] perf symbols: Allow symbol alias when loading map for symbol name
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 09/24] Revert "perf probe: Fix to fall back to find probe point in symbols" Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 11/24] perf probe: Allow weak symbols to be probed Arnaldo Carvalho de Melo
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, David Ahern, Jiri Olsa, Naohiro Aota,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

When perf probe tries to add a probe in a binary using symbol name, it
sometimes failed since some symbols were discard during loading dso.

When it resolves an address to symbol, it'd be better to have just one
symbol at given address.  But for finding address from symbol, it'd be
better to keep all names (including aliases).

So allow tools to state that they want to allow aliases via
symbol_conf.allow_aliases.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150306073127.6904.3232.stgit@localhost.localdomain
[ Original patch passwd allow_alias to many functions, use symbol_conf.allow_aliases instead ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 1 +
 tools/perf/util/symbol-elf.c  | 3 ++-
 tools/perf/util/symbol.h      | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index c379ea0edfd5..9feba0e3343e 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -80,6 +80,7 @@ static int init_symbol_maps(bool user_only)
 	int ret;
 
 	symbol_conf.sort_by_name = true;
+	symbol_conf.allow_aliases = true;
 	ret = symbol__init(NULL);
 	if (ret < 0) {
 		pr_debug("Failed to init symbol map.\n");
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index ada16762fac2..62742e46c010 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1048,7 +1048,8 @@ new_symbol:
 	 * For misannotated, zeroed, ASM function sizes.
 	 */
 	if (nr > 0) {
-		symbols__fixup_duplicate(&dso->symbols[map->type]);
+		if (!symbol_conf.allow_aliases)
+			symbols__fixup_duplicate(&dso->symbols[map->type]);
 		symbols__fixup_end(&dso->symbols[map->type]);
 		if (kmap) {
 			/*
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 1650dcb3a67b..efdaaa544041 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -87,6 +87,7 @@ struct symbol_conf {
 			ignore_vmlinux_buildid,
 			show_kernel_path,
 			use_modules,
+			allow_aliases,
 			sort_by_name,
 			show_nr_samples,
 			show_total_period,
-- 
1.9.3


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

* [PATCH 11/24] perf probe: Allow weak symbols to be probed
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (9 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 10/24] perf symbols: Allow symbol alias when loading map for symbol name Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 12/24] perf build: Fix libbabeltrace detection Arnaldo Carvalho de Melo
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, David Ahern, Jiri Olsa, Naohiro Aota,
	Peter Zijlstra, Masami Hiramatsu, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

It currently prevents adding probes in weak symbols.  But there're cases
that given name is an only weak symbol so that we cannot add probe.

  $ perf probe -x /usr/lib/libc.so.6 -a calloc
  Failed to find symbol calloc in /usr/lib/libc-2.21.so
    Error: Failed to add events.

  $ nm /usr/lib/libc.so.6 | grep calloc
  000000000007b1f0 t __calloc
  000000000007b1f0 T __libc_calloc
  000000000007b1f0 W calloc

This change will result in duplicate probes when strong and weak symbols
co-exist in a binary.  But I think it's not a big problem since probes
at the weak symbol will never be hit anyway.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150306073129.6904.41078.stgit@localhost.localdomain
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 9feba0e3343e..8af8e7f55254 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -310,10 +310,8 @@ static int find_alternative_probe_point(struct debuginfo *dinfo,
 
 	/* Find the address of given function */
 	map__for_each_symbol_by_name(map, pp->function, sym) {
-		if (sym->binding == STB_GLOBAL || sym->binding == STB_LOCAL) {
-			address = sym->start;
-			break;
-		}
+		address = sym->start;
+		break;
 	}
 	if (!address) {
 		ret = -ENOENT;
@@ -2485,8 +2483,7 @@ static int find_probe_functions(struct map *map, char *name)
 	struct symbol *sym;
 
 	map__for_each_symbol_by_name(map, name, sym) {
-		if (sym->binding == STB_GLOBAL || sym->binding == STB_LOCAL)
-			found++;
+		found++;
 	}
 
 	return found;
@@ -2846,8 +2843,7 @@ static struct strfilter *available_func_filter;
 static int filter_available_functions(struct map *map __maybe_unused,
 				      struct symbol *sym)
 {
-	if ((sym->binding == STB_GLOBAL || sym->binding == STB_LOCAL) &&
-	    strfilter__compare(available_func_filter, sym->name))
+	if (strfilter__compare(available_func_filter, sym->name))
 		return 0;
 	return 1;
 }
-- 
1.9.3


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

* [PATCH 12/24] perf build: Fix libbabeltrace detection
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (10 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 11/24] perf probe: Allow weak symbols to be probed Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 13/24] perf tools: Output feature detection's gcc output to a file Arnaldo Carvalho de Melo
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Jiri Olsa, David Ahern,
	Frederic Weisbecker, Jeremie Galarneau, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Sebastian Andrzej Siewior,
	Tom Zanussi, Wang Nan, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@redhat.com>

Following patch added -Werror for feature builds:

  b49f1a4be701 perf tools: Improve feature test debuggability

and exposed a problem in the libbabeltrace feature build, because it was
including wrong header and gcc couldn't find the used symbol definition.

Adding proper header and keeping the old one as it is needed also
(libbabeltrace quirk).

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20150310120035.GA4333@krava.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/config/feature-checks/test-libbabeltrace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/config/feature-checks/test-libbabeltrace.c b/tools/perf/config/feature-checks/test-libbabeltrace.c
index 3b7dd68a4d52..9cf802a04885 100644
--- a/tools/perf/config/feature-checks/test-libbabeltrace.c
+++ b/tools/perf/config/feature-checks/test-libbabeltrace.c
@@ -1,5 +1,6 @@
 
 #include <babeltrace/ctf-writer/writer.h>
+#include <babeltrace/ctf-ir/stream-class.h>
 
 int main(void)
 {
-- 
1.9.3


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

* [PATCH 13/24] perf tools: Output feature detection's gcc output to a file
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (11 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 12/24] perf build: Fix libbabeltrace detection Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 14/24] perf probe: Fix possible double free on error Arnaldo Carvalho de Melo
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Jeremie Galarneau, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Sebastian Andrzej Siewior,
	Tom Zanussi, Wang Nan

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

So that we can debug feature detection problems.

It will appear on $(OUTPUT)feature-checks/.make-libbabeltrace.output,
using the libbabeltrace feature test.

Whole process:

  [acme@ssdandy linux]$ make -C tools/perf install-bin
  make: Entering directory `/home/acme/git/linux/tools/perf'
    BUILD:   Doing 'make -j8' parallel build
  config/Makefile:425: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
  config/Makefile:709: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev

  Auto-detecting system features:
  ...                         dwarf: [ on  ]
  ...                         glibc: [ on  ]
  ...                          gtk2: [ on  ]
  ...                      libaudit: [ on  ]
  ...                        libbfd: [ on  ]
  ...                        libelf: [ on  ]
  ...                       libnuma: [ on  ]
  ...                       libperl: [ on  ]
  ...                     libpython: [ on  ]
  ...                      libslang: [ on  ]
  ...                     libunwind: [ OFF ]
  ...            libdw-dwarf-unwind: [ on  ]
  ...                 libbabeltrace: [ OFF ]
  <SNIP>
  [acme@ssdandy linux]$ find tools/perf -name ".make-*.output" | grep lib | tail -5
  tools/perf/config/feature-checks/.make-libdw-dwarf-unwind.output
  tools/perf/config/feature-checks/.make-libbabeltrace.output
  tools/perf/config/feature-checks/.make-zlib.output
  tools/perf/config/feature-checks/.make-liberty.output
  tools/perf/config/feature-checks/.make-liberty-z.output
  [acme@ssdandy linux]$
  [acme@ssdandy linux]$ cat tools/perf/config/feature-checks/.make-libbabeltrace.output
  make[1]: Entering directory `/home/acme/git/linux/tools/perf/config/feature-checks'
  gcc -MD  -Wall -Werror -o test-libbabeltrace.bin test-libbabeltrace.c -Wl,-z,noexecstack  -lbabeltrace-ctf # -lbabeltrace provided by
  test-libbabeltrace.c:2:42: fatal error: babeltrace/ctf-writer/writer.h: No such file or directory
    #include <babeltrace/ctf-writer/writer.h>
                                          ^
  compilation terminated.
  make[1]: *** [test-libbabeltrace.bin] Error 1
  make[1]: Leaving directory `/home/acme/git/linux/tools/perf/config/feature-checks'
  [acme@ssdandy linux]$

So the libbabeltrace feature will not be builtin, but if we do what is required for it
to be built, namely point where we have it installed:

  [acme@ssdandy linux]$ time make -C tools/perf LIBBABELTRACE_DIR=/opt/libbabeltrace install-bin
  make: Entering directory `/home/acme/git/linux/tools/perf'
    BUILD:   Doing 'make -j8' parallel build
  config/Makefile:425: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR

  Auto-detecting system features:
  ...                         dwarf: [ on  ]
  ...                         glibc: [ on  ]
  ...                          gtk2: [ on  ]
  ...                      libaudit: [ on  ]
  ...                        libbfd: [ on  ]
  ...                        libelf: [ on  ]
  ...                       libnuma: [ on  ]
  ...                       libperl: [ on  ]
  ...                     libpython: [ on  ]
  ...                      libslang: [ on  ]
  ...                     libunwind: [ OFF ]
  ...            libdw-dwarf-unwind: [ on  ]
  ...                 libbabeltrace: [ on  ]
  ...                          zlib: [ on  ]
  ...     DWARF post unwind library: libdw
  <SNIP>
  [acme@ssdandy linux]$ find tools/perf -name ".make-libbabel*.output" | grep lib | tail -5
  tools/perf/config/feature-checks/.make-libbabeltrace.output
  [acme@ssdandy linux]$ cat tools/perf/config/feature-checks/.make-libbabeltrace.output
  make[1]: Entering directory `/home/acme/git/linux/tools/perf/config/feature-checks'
  gcc -MD -I/opt/libbabeltrace/include -Wall -Werror -o test-libbabeltrace.bin test-libbabeltrace.c -Wl,-z,noexecstack -L/opt/libbabeltrace/lib -lbabeltrace-ctf # -lbabeltrace provided by
  make[1]: Leaving directory `/home/acme/git/linux/tools/perf/config/feature-checks'
  [acme@ssdandy linux]$

Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-h53xwueqwdeeiqcv9f50nqqb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf   | 1 +
 tools/perf/config/Makefile | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index ec4c063ed9f3..933d70345f87 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -529,6 +529,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean config-clean
 	$(Q)$(RM) .config-detected
 	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
 	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
+	$(call QUIET_CLEAN, feature-detect) $(RM) $(OUTPUT)config/feature-checks/.make-*.output
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
 	$(python-clean)
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index d44c64d64465..bd097187724b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -184,7 +184,7 @@ endif
 
 feature_check = $(eval $(feature_check_code))
 define feature_check_code
-  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
+  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C config/feature-checks test-$1.bin > $(OUTPUT)config/feature-checks/.make-$(1).output 2>&1 && echo 1 || echo 0)
 endef
 
 feature_set = $(eval $(feature_set_code))
-- 
1.9.3


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

* [PATCH 14/24] perf probe: Fix possible double free on error
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (12 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 13/24] perf tools: Output feature detection's gcc output to a file Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 15/24] perf hists browser: Fix UI bug after zoom into thread/dso/symbol Arnaldo Carvalho de Melo
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, He Kuang, Ingo Molnar, Peter Zijlstra, Wang Nan,
	Arnaldo Carvalho de Melo

From: He Kuang <hekuang@huawei.com>

A double free occurred when get source file path failed. If lr->path
failed to assign a new value, it will be freed as the old path and then
be freed again during line_range__clear(), and causes this:

  $ perf probe -L do_execve -k vmlinux
  *** Error in `/usr/bin/perf': double free or corruption (fasttop):
      0x0000000000a9ac50 ***
  ======= Backtrace: =========
  ../lib64/libc.so.6(+0x6eeef)[0x7ffff5e44eef]
  ../lib64/libc.so.6(+0x78cae)[0x7ffff5e4ecae]
  ../lib64/libc.so.6(+0x79987)[0x7ffff5e4f987]
  ../bin/perf[0x4ab41f]
  ...

This patch fix this problem.

Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1425463302-1687-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 8af8e7f55254..e2bf620f98cb 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -790,7 +790,11 @@ static int __show_line_range(struct line_range *lr, const char *module,
 	/* Convert source file path */
 	tmp = lr->path;
 	ret = get_real_path(tmp, lr->comp_dir, &lr->path);
-	free(tmp);	/* Free old path */
+
+	/* Free old path when new path is assigned */
+	if (tmp != lr->path)
+		free(tmp);
+
 	if (ret < 0) {
 		pr_warning("Failed to find source file path.\n");
 		return ret;
-- 
1.9.3


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

* [PATCH 15/24] perf hists browser: Fix UI bug after zoom into thread/dso/symbol
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (13 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 14/24] perf probe: Fix possible double free on error Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 16/24] perf probe: Fix compiles due to declarations using perf_probe_point Arnaldo Carvalho de Melo
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, He Kuang, Jiri Olsa, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo

From: He Kuang <hekuang@huawei.com>

When zoom into thread/dso/symbol, the fold/unfold stat is cleared in
hists__filter_by_thread/dso/symbol(), but h->nr_rows is not cleared. So
if we toggle fold stat on the unfold entires, nr_entries got a wrong
value.

This bug can be reproduced as follows:

$ perf record -g -e syscalls:sys_enter_open ls
$ perf report

    Children      Self  Command  Shared Object            Symbol
  ================================================================
  +   50.00%     0.00%  ls       ld64.so  [.]  _dl_get_ready_to_run
  -   50.00%     0.00%  ls       ld64.so  [.]  _dl_load_shared_library
      _dl_load_shared_library <= [Zoom into thread/dso]
      _dl_get_ready_to_run
      _start
  ...

In the new thread hists, all entries reset to fold, if we unfold the
same entry as we previously unfolded, nr_entries got wrong value, and we
can't move down cursor to bottom row.

                                                         Thread: ls
    Children      Self  Command  Shared Object            Symbol
  ================================================================
  +   50.00%     0.00%  ls       ld64.so  [.]  _dl_get_ready_to_run
  -   50.00%     0.00%  ls       ld64.so  [.]  _dl_load_shared_library
      _dl_load_shared_library
      _dl_get_ready_to_run <= [cursor may stop here, can't move down]
      _start
  ...

This patch clear h->nr_rows to fix this bug.

Signed-off-by: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1426077363-855-2-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 95f5ab707b74..d9a6d35eda17 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1171,6 +1171,7 @@ static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h
 	/* force fold unfiltered entry for simplicity */
 	h->ms.unfolded = false;
 	h->row_offset = 0;
+	h->nr_rows = 0;
 
 	hists->stats.nr_non_filtered_samples += h->stat.nr_events;
 
-- 
1.9.3


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

* [PATCH 16/24] perf probe: Fix compiles due to declarations using perf_probe_point
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (14 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 15/24] perf hists browser: Fix UI bug after zoom into thread/dso/symbol Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 17/24] perf hists browser: Fix UI bug after fold/unfold Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, David Ahern, Masami Hiramatsu, Arnaldo Carvalho de Melo

From: David Ahern <david.ahern@oracle.com>

perf fails to build with gcc "(GCC) 4.4.7 20120313 (Red Hat
4.4.7-4.0.9)" (a.k.a., RHEL6 / CentOS 6 / OL 6):

  cc1: warnings being treated as errors
  util/probe-event.c: In function ‘get_alternative_line_range’:
  util/probe-event.c:359: error: missing initializer
  util/probe-event.c:359: error: (near initialization for ‘pp.file’)
  util/probe-event.c:359: error: missing initializer
  util/probe-event.c:359: error: (near initialization for ‘result.function’)

Fix by bringing in initializers to declaration.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Link: http://lkml.kernel.org/r/1426084580-60780-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index e2bf620f98cb..f272a711ad15 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -356,12 +356,14 @@ static int get_alternative_line_range(struct debuginfo *dinfo,
 				      struct line_range *lr,
 				      const char *target, bool user)
 {
-	struct perf_probe_point pp = { 0 }, result = { 0 };
+	struct perf_probe_point pp = { .function = lr->function,
+				       .file = lr->file,
+				       .line = lr->start };
+	struct perf_probe_point result;
 	int ret, len = 0;
 
-	pp.function = lr->function;
-	pp.file = lr->file;
-	pp.line = lr->start;
+	memset(&result, 0, sizeof(result));
+
 	if (lr->end != INT_MAX)
 		len = lr->end - lr->start;
 	ret = find_alternative_probe_point(dinfo, &pp, &result,
-- 
1.9.3


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

* [PATCH 17/24] perf hists browser: Fix UI bug after fold/unfold
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (15 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 16/24] perf probe: Fix compiles due to declarations using perf_probe_point Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:27 ` [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, He Kuang, Jiri Olsa, Paul Mackerras,
	Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo

From: He Kuang <hekuang@huawei.com>

In perf hists browser, the fold/unfold stat of each hist entry is
recorded but hb->nr_callchain_rows loses its value after zoom out and
zoom in back. This causes a wrong row cursor range that restrict user to
move down anymore.

This bug can be reproduced as follows:

  $ perf record -g -e syscalls:* ls
  $ perf report

    Available samples
  ================================================================
    2 syscalls:sys_enter_mprotect <= [enter one of the entries]
    2 syscalls:sys_exit_mprotect
    13 syscalls:sys_enter_brk
    ...

In the hists brower, unfold some of the items, now the cursor can reach
to any rows:

    Children      Self  Command  Shared Object          Symbol
  ================================================================
  -  100.00%   100.00%  ls       libuClibc-0.9.33.2.so  [.] lstat64
  - lstat64
       16.67% 0x6469702e64
       8.33% 0x646970
       8.33% 0x617461
       8.33% 0x65
  -   16.67%     0.00%  ls       [unknown]              [.]0x6469702e64
     0x6469702e64 <= [cursor can reach to bottom line, everything is ok]

Now, zoom back to "Available samples" and enter again:

    Children      Self  Command  Shared Object          Symbol
  ================================================================
  -  100.00%   100.00%  ls       libuClibc-0.9.33.2.so  [.] lstat64
  - lstat64
       16.67% 0x6469702e64
       8.33% 0x646970
       8.33% 0x617461 <= [cursor may stop here, can't move down anymore]
       8.33% 0x65
  -   16.67%     0.00%  ls       [unknown]              [.]0x6469702e64
     0x6469702e64

This patch recalculates hb->nr_callchain_rows to fix the bug.

Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1426144909-18951-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index ad312d91caed..49eddeb81458 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -48,6 +48,24 @@ static bool hist_browser__has_filter(struct hist_browser *hb)
 	return hists__has_filter(hb->hists) || hb->min_pcnt;
 }
 
+static int hist_browser__get_folding(struct hist_browser *browser)
+{
+	struct rb_node *nd;
+	struct hists *hists = browser->hists;
+	int unfolded_rows = 0;
+
+	for (nd = rb_first(&hists->entries);
+	     (nd = hists__filter_entries(nd, browser->min_pcnt)) != NULL;
+	     nd = rb_next(nd)) {
+		struct hist_entry *he =
+			rb_entry(nd, struct hist_entry, rb_node);
+
+		if (he->ms.unfolded)
+			unfolded_rows += he->nr_rows;
+	}
+	return unfolded_rows;
+}
+
 static u32 hist_browser__nr_entries(struct hist_browser *hb)
 {
 	u32 nr_entries;
@@ -57,6 +75,7 @@ static u32 hist_browser__nr_entries(struct hist_browser *hb)
 	else
 		nr_entries = hb->hists->nr_entries;
 
+	hb->nr_callchain_rows = hist_browser__get_folding(hb);
 	return nr_entries + hb->nr_callchain_rows;
 }
 
-- 
1.9.3


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

* [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (16 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 17/24] perf hists browser: Fix UI bug after fold/unfold Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-13  7:34   ` Ingo Molnar
  2015-03-12 21:27 ` [PATCH 19/24] perf stat: Fix IPC and other formulas with -A Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  24 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

The information how much a counter ran in 'perf stat' can be quite
interesting for other tools to judge how trustworthy a measurement is.

Currently it is only output in non CSV mode.

This patches make perf stat always output the running time and the
enabled/running ratio in CSV mode.

This adds two new fields at the end for each line. I assume that
existing tools ignore new fields at the end, so it's on by default.

Only CSV mode is affected, no difference otherwise.

v2: Add extra print_running function
v3: Avoid printing nan
v4: Remove some elses and add brackets.
v5: Move non CSV case into print_running

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1426083387-17006-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index d28949d210cc..765e2204f6bf 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -769,6 +769,18 @@ static int run_perf_stat(int argc, const char **argv)
 	return ret;
 }
 
+static void print_running(u64 run, u64 ena)
+{
+	if (csv_output) {
+		fprintf(output, "%s%" PRIu64 "%s%.2f",
+					csv_sep,
+					run,
+					csv_sep,
+					ena ? 100.0 * run / ena : 100.0);
+	} else if (run != ena)
+		fprintf(output, "  (%.2f%%)", 100.0 * run / ena);
+}
+
 static void print_noise_pct(double total, double avg)
 {
 	double pct = rel_stddev_stats(total, avg);
@@ -1252,6 +1264,7 @@ static void print_aggr(char *prefix)
 					fprintf(output, "%s%s",
 						csv_sep, counter->cgrp->name);
 
+				print_running(run, ena);
 				fputc('\n', output);
 				continue;
 			}
@@ -1262,13 +1275,10 @@ static void print_aggr(char *prefix)
 			else
 				abs_printout(id, nr, counter, uval);
 
-			if (!csv_output) {
+			if (!csv_output)
 				print_noise(counter, 1.0);
 
-				if (run != ena)
-					fprintf(output, "  (%.2f%%)",
-						100.0 * run / ena);
-			}
+			print_running(run, ena);
 			fputc('\n', output);
 		}
 	}
@@ -1284,6 +1294,10 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
 	double avg = avg_stats(&ps->res_stats[0]);
 	int scaled = counter->counts->scaled;
 	double uval;
+	double avg_enabled, avg_running;
+
+	avg_enabled = avg_stats(&ps->res_stats[1]);
+	avg_running = avg_stats(&ps->res_stats[2]);
 
 	if (prefix)
 		fprintf(output, "%s", prefix);
@@ -1303,6 +1317,7 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
 		if (counter->cgrp)
 			fprintf(output, "%s%s", csv_sep, counter->cgrp->name);
 
+		print_running(avg_running, avg_enabled);
 		fputc('\n', output);
 		return;
 	}
@@ -1316,19 +1331,7 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
 
 	print_noise(counter, avg);
 
-	if (csv_output) {
-		fputc('\n', output);
-		return;
-	}
-
-	if (scaled) {
-		double avg_enabled, avg_running;
-
-		avg_enabled = avg_stats(&ps->res_stats[1]);
-		avg_running = avg_stats(&ps->res_stats[2]);
-
-		fprintf(output, " [%5.2f%%]", 100 * avg_running / avg_enabled);
-	}
+	print_running(avg_running, avg_enabled);
 	fprintf(output, "\n");
 }
 
@@ -1370,6 +1373,7 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
 				fprintf(output, "%s%s",
 					csv_sep, counter->cgrp->name);
 
+			print_running(run, ena);
 			fputc('\n', output);
 			continue;
 		}
@@ -1381,13 +1385,10 @@ static void print_counter(struct perf_evsel *counter, char *prefix)
 		else
 			abs_printout(cpu, 0, counter, uval);
 
-		if (!csv_output) {
+		if (!csv_output)
 			print_noise(counter, 1.0);
+		print_running(run, ena);
 
-			if (run != ena)
-				fprintf(output, "  (%.2f%%)",
-					100.0 * run / ena);
-		}
 		fputc('\n', output);
 	}
 }
-- 
1.9.3


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

* [PATCH 19/24] perf stat: Fix IPC and other formulas with -A
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (17 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode Arnaldo Carvalho de Melo
@ 2015-03-12 21:27 ` Arnaldo Carvalho de Melo
  2015-03-12 21:28 ` [PATCH 20/24] perf stat: Always correctly indent ratio column Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:27 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

perf stat didn't compute the IPC and other formulas for individual CPUs
with -A. Fix this for the easy -A case. As before, --per-core and
--per-socket do not handle it, they simply print nothing.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1426087682-22765-2-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 765e2204f6bf..e78c68df2152 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -353,39 +353,40 @@ static struct perf_evsel *nth_evsel(int n)
  * more semantic information such as miss/hit ratios,
  * instruction rates, etc:
  */
-static void update_shadow_stats(struct perf_evsel *counter, u64 *count)
+static void update_shadow_stats(struct perf_evsel *counter, u64 *count,
+				int cpu)
 {
 	if (perf_evsel__match(counter, SOFTWARE, SW_TASK_CLOCK))
-		update_stats(&runtime_nsecs_stats[0], count[0]);
+		update_stats(&runtime_nsecs_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES))
-		update_stats(&runtime_cycles_stats[0], count[0]);
+		update_stats(&runtime_cycles_stats[cpu], count[0]);
 	else if (transaction_run &&
 		 perf_evsel__cmp(counter, nth_evsel(T_CYCLES_IN_TX)))
-		update_stats(&runtime_cycles_in_tx_stats[0], count[0]);
+		update_stats(&runtime_cycles_in_tx_stats[cpu], count[0]);
 	else if (transaction_run &&
 		 perf_evsel__cmp(counter, nth_evsel(T_TRANSACTION_START)))
-		update_stats(&runtime_transaction_stats[0], count[0]);
+		update_stats(&runtime_transaction_stats[cpu], count[0]);
 	else if (transaction_run &&
 		 perf_evsel__cmp(counter, nth_evsel(T_ELISION_START)))
-		update_stats(&runtime_elision_stats[0], count[0]);
+		update_stats(&runtime_elision_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_FRONTEND))
-		update_stats(&runtime_stalled_cycles_front_stats[0], count[0]);
+		update_stats(&runtime_stalled_cycles_front_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_BACKEND))
-		update_stats(&runtime_stalled_cycles_back_stats[0], count[0]);
+		update_stats(&runtime_stalled_cycles_back_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HARDWARE, HW_BRANCH_INSTRUCTIONS))
-		update_stats(&runtime_branches_stats[0], count[0]);
+		update_stats(&runtime_branches_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HARDWARE, HW_CACHE_REFERENCES))
-		update_stats(&runtime_cacherefs_stats[0], count[0]);
+		update_stats(&runtime_cacherefs_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1D))
-		update_stats(&runtime_l1_dcache_stats[0], count[0]);
+		update_stats(&runtime_l1_dcache_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1I))
-		update_stats(&runtime_l1_icache_stats[0], count[0]);
+		update_stats(&runtime_l1_icache_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_LL))
-		update_stats(&runtime_ll_cache_stats[0], count[0]);
+		update_stats(&runtime_ll_cache_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_DTLB))
-		update_stats(&runtime_dtlb_cache_stats[0], count[0]);
+		update_stats(&runtime_dtlb_cache_stats[cpu], count[0]);
 	else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB))
-		update_stats(&runtime_itlb_cache_stats[0], count[0]);
+		update_stats(&runtime_itlb_cache_stats[cpu], count[0]);
 }
 
 static void zero_per_pkg(struct perf_evsel *counter)
@@ -447,7 +448,8 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int thread __maybe_unused,
 			perf_evsel__compute_deltas(evsel, cpu, count);
 		perf_counts_values__scale(count, scale, NULL);
 		evsel->counts->cpu[cpu] = *count;
-		update_shadow_stats(evsel, count->values);
+		if (aggr_mode == AGGR_NONE)
+			update_shadow_stats(evsel, count->values, cpu);
 		break;
 	case AGGR_GLOBAL:
 		aggr->val += count->val;
@@ -495,7 +497,7 @@ static int read_counter_aggr(struct perf_evsel *counter)
 	/*
 	 * Save the full runtime - to allow normalization during printout:
 	 */
-	update_shadow_stats(counter, count);
+	update_shadow_stats(counter, count, 0);
 
 	return 0;
 }
-- 
1.9.3


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

* [PATCH 20/24] perf stat: Always correctly indent ratio column
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (18 preceding siblings ...)
  2015-03-12 21:27 ` [PATCH 19/24] perf stat: Fix IPC and other formulas with -A Arnaldo Carvalho de Melo
@ 2015-03-12 21:28 ` Arnaldo Carvalho de Melo
  2015-03-13  7:36   ` Ingo Molnar
  2015-03-12 21:28 ` [PATCH 21/24] perf kmem: Fix segfault when invalid sort key is given Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  24 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:28 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo

From: Andi Kleen <ak@linux.intel.com>

When cycles or instructions do not print anything, as in being,
--per-socket or --per-core modi, the ratio column was not correctly
indented for them. This lead to some ratios not lining up with the
others. Always indent correctly when nothing is printed.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index e78c68df2152..41b296fff307 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1093,7 +1093,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
 		if (total) {
 			ratio = avg / total;
 			fprintf(output, " #   %5.2f  insns per cycle        ", ratio);
-		}
+		} else
+			fprintf(output, "                                   ");
 		total = avg_stats(&runtime_stalled_cycles_front_stats[cpu]);
 		total = max(total, avg_stats(&runtime_stalled_cycles_back_stats[cpu]));
 
@@ -1162,7 +1163,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
 		if (total) {
 			ratio = avg / total;
 			fprintf(output, " # %8.3f GHz                    ", ratio);
-		}
+		} else
+			fprintf(output, "                                   ");
 	} else if (transaction_run &&
 		   perf_evsel__cmp(evsel, nth_evsel(T_CYCLES_IN_TX))) {
 		total = avg_stats(&runtime_cycles_stats[cpu]);
-- 
1.9.3


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

* [PATCH 21/24] perf kmem: Fix segfault when invalid sort key is given
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (19 preceding siblings ...)
  2015-03-12 21:28 ` [PATCH 20/24] perf stat: Always correctly indent ratio column Arnaldo Carvalho de Melo
@ 2015-03-12 21:28 ` Arnaldo Carvalho de Melo
  2015-03-12 21:28 ` [PATCH 22/24] perf kmem: Allow -v option Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, David Ahern, Jiri Olsa, Joonsoo Kim,
	Minchan Kim, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

When it tries to free 'str', it was already updated by strsep() - so it
needs to save the original pointer.

  # perf kmem stat -s xxx,hit
    Error: Unknown --sort key: 'xxx'
  *** Error in `perf': free(): invalid pointer: 0x0000000000e9e7b6 ***
  ======= Backtrace: =========
  /usr/lib/libc.so.6(+0x7198e)[0x7fc7e6e0d98e]
  /usr/lib/libc.so.6(+0x76dee)[0x7fc7e6e12dee]
  /usr/lib/libc.so.6(+0x775cb)[0x7fc7e6e135cb]
  ./perf[0x44a1b5]
  ./perf[0x490b20]
  ./perf(parse_options_step+0x173)[0x491773]
  ./perf(parse_options_subcommand+0xa7)[0x491fb7]
  ./perf(cmd_kmem+0x2bc)[0x44ae4c]
  ./perf[0x47aa13]
  ./perf(main+0x60a)[0x427a9a]
  /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7fc7e6dbc800]
  ./perf(_start+0x29)[0x427bb9]

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1426145571-3065-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kmem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 62f165a9fa40..1e69ea57a1cc 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -559,6 +559,7 @@ static int setup_sorting(struct list_head *sort_list, const char *arg)
 {
 	char *tok;
 	char *str = strdup(arg);
+	char *pos = str;
 
 	if (!str) {
 		pr_err("%s: strdup failed\n", __func__);
@@ -566,7 +567,7 @@ static int setup_sorting(struct list_head *sort_list, const char *arg)
 	}
 
 	while (true) {
-		tok = strsep(&str, ",");
+		tok = strsep(&pos, ",");
 		if (!tok)
 			break;
 		if (sort_dimension__add(tok, sort_list) < 0) {
-- 
1.9.3


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

* [PATCH 22/24] perf kmem: Allow -v option
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (20 preceding siblings ...)
  2015-03-12 21:28 ` [PATCH 21/24] perf kmem: Fix segfault when invalid sort key is given Arnaldo Carvalho de Melo
@ 2015-03-12 21:28 ` Arnaldo Carvalho de Melo
  2015-03-12 21:28 ` [PATCH 23/24] perf kmem: Fix alignment of slab result table Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, David Ahern, Jiri Olsa, Joonsoo Kim,
	Minchan Kim, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

Current perf kmem fails when -v option is used.  As it's very useful for
debugging, let's allow it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1426145571-3065-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-kmem.txt | 4 ++++
 tools/perf/builtin-kmem.c              | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/tools/perf/Documentation/perf-kmem.txt b/tools/perf/Documentation/perf-kmem.txt
index 7c8fbbf3f61c..150253cc3c97 100644
--- a/tools/perf/Documentation/perf-kmem.txt
+++ b/tools/perf/Documentation/perf-kmem.txt
@@ -25,6 +25,10 @@ OPTIONS
 --input=<file>::
 	Select the input file (default: perf.data unless stdin is a fifo)
 
+-v::
+--verbose::
+        Be more verbose. (show symbol address, etc)
+
 --caller::
 	Show per-callsite statistics
 
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 1e69ea57a1cc..02b76976b288 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -663,6 +663,8 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
 	const char * const default_sort_order = "frag,hit,bytes";
 	const struct option kmem_options[] = {
 	OPT_STRING('i', "input", &input_name, "file", "input file name"),
+	OPT_INCR('v', "verbose", &verbose,
+		    "be more verbose (show symbol address, etc)"),
 	OPT_CALLBACK_NOOPT(0, "caller", NULL, NULL,
 			   "show per-callsite statistics", parse_caller_opt),
 	OPT_CALLBACK_NOOPT(0, "alloc", NULL, NULL,
-- 
1.9.3


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

* [PATCH 23/24] perf kmem: Fix alignment of slab result table
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (21 preceding siblings ...)
  2015-03-12 21:28 ` [PATCH 22/24] perf kmem: Allow -v option Arnaldo Carvalho de Melo
@ 2015-03-12 21:28 ` Arnaldo Carvalho de Melo
  2015-03-12 21:28 ` [PATCH 24/24] perf data: Add tracepoint events fields CTF conversion support Arnaldo Carvalho de Melo
  2015-03-13 12:34 ` [GIT PULL 00/24] perf/core improvements and fixes Ingo Molnar
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Namhyung Kim, David Ahern, Joonsoo Kim,
	Minchan Kim, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Namhyung Kim <namhyung@kernel.org>

Its table was a bit misaligned.  Fix it.

Before:

  # perf kmem stat --caller -l 10
  ------------------------------------------------------------------------------------------------------
   Callsite                           | Total_alloc/Per | Total_req/Per   | Hit      | Ping-pong | Frag
  ------------------------------------------------------------------------------------------------------
   radeon_cs_parser_init.part.1+11a   |      2080/260   |      1504/188   |        8 |        0 | 27.692%
   radeon_cs_parser_init.part.1+e1    |       384/96    |       288/72    |        4 |        0 | 25.000%
   radeon_cs_parser_init.part.1+93    |       128/32    |        96/24    |        4 |        0 | 25.000%
   load_elf_binary+a39                |       512/512   |       392/392   |        1 |        0 | 23.438%
   __alloc_skb+89                     |      6144/877   |      4800/685   |        7 |        6 | 21.875%
   radeon_fence_emit+5c               |      1152/192   |       912/152   |        6 |        0 | 20.833%
   radeon_cs_parser_relocs+ad         |      8192/2048  |      6624/1656  |        4 |        0 | 19.141%
   radeon_sa_bo_new+78                |      1280/64    |      1120/56    |       20 |        0 | 12.500%
   load_elf_binary+2c4                |        32/32    |        28/28    |        1 |        0 | 12.500%
   anon_vma_prepare+101               |       576/72    |       512/64    |        8 |        0 | 11.111%
   ...                                | ...             | ...             | ...    | ...      | ...
  ------------------------------------------------------------------------------------------------------

After:

  ---------------------------------------------------------------------------------------------------------
   Callsite                           | Total_alloc/Per | Total_req/Per   | Hit      | Ping-pong | Frag
  ---------------------------------------------------------------------------------------------------------
   radeon_cs_parser_init.part.1+11a   |      2080/260   |      1504/188   |        8 |         0 | 27.692%
   radeon_cs_parser_init.part.1+e1    |       384/96    |       288/72    |        4 |         0 | 25.000%
   radeon_cs_parser_init.part.1+93    |       128/32    |        96/24    |        4 |         0 | 25.000%
   load_elf_binary+a39                |       512/512   |       392/392   |        1 |         0 | 23.438%
   __alloc_skb+89                     |      6144/877   |      4800/685   |        7 |         6 | 21.875%
   radeon_fence_emit+5c               |      1152/192   |       912/152   |        6 |         0 | 20.833%
   radeon_cs_parser_relocs+ad         |      8192/2048  |      6624/1656  |        4 |         0 | 19.141%
   radeon_sa_bo_new+78                |      1280/64    |      1120/56    |       20 |         0 | 12.500%
   load_elf_binary+2c4                |        32/32    |        28/28    |        1 |         0 | 12.500%
   anon_vma_prepare+101               |       576/72    |       512/64    |        8 |         0 | 11.111%
   ...                                | ...             | ...             | ...      | ...       | ...
  ---------------------------------------------------------------------------------------------------------

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1426145571-3065-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kmem.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 02b76976b288..8c85aeb3327a 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -275,10 +275,10 @@ static void __print_result(struct rb_root *root, struct perf_session *session,
 	struct rb_node *next;
 	struct machine *machine = &session->machines.host;
 
-	printf("%.102s\n", graph_dotted_line);
+	printf("%.105s\n", graph_dotted_line);
 	printf(" %-34s |",  is_caller ? "Callsite": "Alloc Ptr");
 	printf(" Total_alloc/Per | Total_req/Per   | Hit      | Ping-pong | Frag\n");
-	printf("%.102s\n", graph_dotted_line);
+	printf("%.105s\n", graph_dotted_line);
 
 	next = rb_first(root);
 
@@ -304,7 +304,7 @@ static void __print_result(struct rb_root *root, struct perf_session *session,
 			snprintf(buf, sizeof(buf), "%#" PRIx64 "", addr);
 		printf(" %-34s |", buf);
 
-		printf(" %9llu/%-5lu | %9llu/%-5lu | %8lu | %8lu | %6.3f%%\n",
+		printf(" %9llu/%-5lu | %9llu/%-5lu | %8lu | %9lu | %6.3f%%\n",
 		       (unsigned long long)data->bytes_alloc,
 		       (unsigned long)data->bytes_alloc / data->hit,
 		       (unsigned long long)data->bytes_req,
@@ -317,9 +317,9 @@ static void __print_result(struct rb_root *root, struct perf_session *session,
 	}
 
 	if (n_lines == -1)
-		printf(" ...                                | ...             | ...             | ...    | ...      | ...   \n");
+		printf(" ...                                | ...             | ...             | ...      | ...       | ...   \n");
 
-	printf("%.102s\n", graph_dotted_line);
+	printf("%.105s\n", graph_dotted_line);
 }
 
 static void print_summary(void)
-- 
1.9.3


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

* [PATCH 24/24] perf data: Add tracepoint events fields CTF conversion support
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (22 preceding siblings ...)
  2015-03-12 21:28 ` [PATCH 23/24] perf kmem: Fix alignment of slab result table Arnaldo Carvalho de Melo
@ 2015-03-12 21:28 ` Arnaldo Carvalho de Melo
  2015-03-13 12:34 ` [GIT PULL 00/24] perf/core improvements and fixes Ingo Molnar
  24 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-12 21:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Sebastian Andrzej Siewior, David Ahern,
	Frederic Weisbecker, Jeremie Galarneau, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Tom Zanussi, Wang Nan, Jiri Olsa,
	Arnaldo Carvalho de Melo

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Adding support to convert tracepoint event fields into CTF
event fields.

We parse each tracepoint event for CTF conversion and add
tracepoint fields as regular CTF event fields, so they
appear in babeltrace output like:

  $ babeltrace ./ctf-data/
  ...
  [09:02:00.950703057] (+?.?????????) sched:sched_stat_runtime: { }, { perf_ip = ... SNIP ... common_type = 298, common_flags = 1, \
  common_preempt_count = 0, common_pid = 31813, comm = "perf", pid = 31813, runtime = 458800, vruntime = 52059858071 }
  ...

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1424470628-5969-6-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/data-convert-bt.c | 242 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 242 insertions(+)

diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 1afd381b2346..c6d62268cc2a 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -126,6 +126,177 @@ FUNC_VALUE_SET(s64)
 FUNC_VALUE_SET(u64)
 __FUNC_VALUE_SET(u64_hex, u64)
 
+static struct bt_ctf_field_type*
+get_tracepoint_field_type(struct ctf_writer *cw, struct format_field *field)
+{
+	unsigned long flags = field->flags;
+
+	if (flags & FIELD_IS_STRING)
+		return cw->data.string;
+
+	if (!(flags & FIELD_IS_SIGNED)) {
+		/* unsigned long are mostly pointers */
+		if (flags & FIELD_IS_LONG || flags & FIELD_IS_POINTER)
+			return cw->data.u64_hex;
+	}
+
+	if (flags & FIELD_IS_SIGNED) {
+		if (field->size == 8)
+			return cw->data.s64;
+		else
+			return cw->data.s32;
+	}
+
+	if (field->size == 8)
+		return cw->data.u64;
+	else
+		return cw->data.u32;
+}
+
+static int add_tracepoint_field_value(struct ctf_writer *cw,
+				      struct bt_ctf_event_class *event_class,
+				      struct bt_ctf_event *event,
+				      struct perf_sample *sample,
+				      struct format_field *fmtf)
+{
+	struct bt_ctf_field_type *type;
+	struct bt_ctf_field *array_field;
+	struct bt_ctf_field *field;
+	const char *name = fmtf->name;
+	void *data = sample->raw_data;
+	unsigned long long value_int;
+	unsigned long flags = fmtf->flags;
+	unsigned int n_items;
+	unsigned int i;
+	unsigned int offset;
+	unsigned int len;
+	int ret;
+
+	offset = fmtf->offset;
+	len = fmtf->size;
+	if (flags & FIELD_IS_STRING)
+		flags &= ~FIELD_IS_ARRAY;
+
+	if (flags & FIELD_IS_DYNAMIC) {
+		unsigned long long tmp_val;
+
+		tmp_val = pevent_read_number(fmtf->event->pevent,
+				data + offset, len);
+		offset = tmp_val;
+		len = offset >> 16;
+		offset &= 0xffff;
+	}
+
+	if (flags & FIELD_IS_ARRAY) {
+
+		type = bt_ctf_event_class_get_field_by_name(
+				event_class, name);
+		array_field = bt_ctf_field_create(type);
+		bt_ctf_field_type_put(type);
+		if (!array_field) {
+			pr_err("Failed to create array type %s\n", name);
+			return -1;
+		}
+
+		len = fmtf->size / fmtf->arraylen;
+		n_items = fmtf->arraylen;
+	} else {
+		n_items = 1;
+		array_field = NULL;
+	}
+
+	type = get_tracepoint_field_type(cw, fmtf);
+
+	for (i = 0; i < n_items; i++) {
+		if (!(flags & FIELD_IS_STRING))
+			value_int = pevent_read_number(
+					fmtf->event->pevent,
+					data + offset + i * len, len);
+
+		if (flags & FIELD_IS_ARRAY)
+			field = bt_ctf_field_array_get_field(array_field, i);
+		else
+			field = bt_ctf_field_create(type);
+
+		if (!field) {
+			pr_err("failed to create a field %s\n", name);
+			return -1;
+		}
+
+		if (flags & FIELD_IS_STRING)
+			ret = bt_ctf_field_string_set_value(field,
+					data + offset + i * len);
+		else if (!(flags & FIELD_IS_SIGNED))
+			ret = bt_ctf_field_unsigned_integer_set_value(
+					field, value_int);
+		else
+			ret = bt_ctf_field_signed_integer_set_value(
+					field, value_int);
+		if (ret) {
+			pr_err("failed to set file value %s\n", name);
+			goto err_put_field;
+		}
+		if (!(flags & FIELD_IS_ARRAY)) {
+			ret = bt_ctf_event_set_payload(event, name, field);
+			if (ret) {
+				pr_err("failed to set payload %s\n", name);
+				goto err_put_field;
+			}
+		}
+		bt_ctf_field_put(field);
+	}
+	if (flags & FIELD_IS_ARRAY) {
+		ret = bt_ctf_event_set_payload(event, name, array_field);
+		if (ret) {
+			pr_err("Failed add payload array %s\n", name);
+			return -1;
+		}
+		bt_ctf_field_put(array_field);
+	}
+	return 0;
+
+err_put_field:
+	bt_ctf_field_put(field);
+	return -1;
+}
+
+static int add_tracepoint_fields_values(struct ctf_writer *cw,
+					struct bt_ctf_event_class *event_class,
+					struct bt_ctf_event *event,
+					struct format_field *fields,
+					struct perf_sample *sample)
+{
+	struct format_field *field;
+	int ret;
+
+	for (field = fields; field; field = field->next) {
+		ret = add_tracepoint_field_value(cw, event_class, event, sample,
+				field);
+		if (ret)
+			return -1;
+	}
+	return 0;
+}
+
+static int add_tracepoint_values(struct ctf_writer *cw,
+				 struct bt_ctf_event_class *event_class,
+				 struct bt_ctf_event *event,
+				 struct perf_evsel *evsel,
+				 struct perf_sample *sample)
+{
+	struct format_field *common_fields = evsel->tp_format->format.common_fields;
+	struct format_field *fields        = evsel->tp_format->format.fields;
+	int ret;
+
+	ret = add_tracepoint_fields_values(cw, event_class, event,
+					   common_fields, sample);
+	if (!ret)
+		ret = add_tracepoint_fields_values(cw, event_class, event,
+						   fields, sample);
+
+	return ret;
+}
+
 static int add_generic_values(struct ctf_writer *cw,
 			      struct bt_ctf_event *event,
 			      struct perf_evsel *evsel,
@@ -246,11 +417,76 @@ static int process_sample_event(struct perf_tool *tool,
 	if (ret)
 		return -1;
 
+	if (evsel->attr.type == PERF_TYPE_TRACEPOINT) {
+		ret = add_tracepoint_values(cw, event_class, event,
+					    evsel, sample);
+		if (ret)
+			return -1;
+	}
+
 	bt_ctf_stream_append_event(cw->stream, event);
 	bt_ctf_event_put(event);
 	return 0;
 }
 
+static int add_tracepoint_fields_types(struct ctf_writer *cw,
+				       struct format_field *fields,
+				       struct bt_ctf_event_class *event_class)
+{
+	struct format_field *field;
+	int ret;
+
+	for (field = fields; field; field = field->next) {
+		struct bt_ctf_field_type *type;
+		unsigned long flags = field->flags;
+
+		pr2("  field '%s'\n", field->name);
+
+		type = get_tracepoint_field_type(cw, field);
+		if (!type)
+			return -1;
+
+		/*
+		 * A string is an array of chars. For this we use the string
+		 * type and don't care that it is an array. What we don't
+		 * support is an array of strings.
+		 */
+		if (flags & FIELD_IS_STRING)
+			flags &= ~FIELD_IS_ARRAY;
+
+		if (flags & FIELD_IS_ARRAY)
+			type = bt_ctf_field_type_array_create(type, field->arraylen);
+
+		ret = bt_ctf_event_class_add_field(event_class, type,
+				field->name);
+
+		if (flags & FIELD_IS_ARRAY)
+			bt_ctf_field_type_put(type);
+
+		if (ret) {
+			pr_err("Failed to add field '%s\n", field->name);
+			return -1;
+		}
+	}
+
+	return 0;
+}
+
+static int add_tracepoint_types(struct ctf_writer *cw,
+				struct perf_evsel *evsel,
+				struct bt_ctf_event_class *class)
+{
+	struct format_field *common_fields = evsel->tp_format->format.common_fields;
+	struct format_field *fields        = evsel->tp_format->format.fields;
+	int ret;
+
+	ret = add_tracepoint_fields_types(cw, common_fields, class);
+	if (!ret)
+		ret = add_tracepoint_fields_types(cw, fields, class);
+
+	return ret;
+}
+
 static int add_generic_types(struct ctf_writer *cw, struct perf_evsel *evsel,
 			     struct bt_ctf_event_class *event_class)
 {
@@ -328,6 +564,12 @@ static int add_event(struct ctf_writer *cw, struct perf_evsel *evsel)
 	if (ret)
 		goto err;
 
+	if (evsel->attr.type == PERF_TYPE_TRACEPOINT) {
+		ret = add_tracepoint_types(cw, evsel, event_class);
+		if (ret)
+			goto err;
+	}
+
 	ret = bt_ctf_stream_class_add_event_class(cw->stream_class, event_class);
 	if (ret) {
 		pr("Failed to add event class into stream.\n");
-- 
1.9.3


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

* Re: [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode
  2015-03-12 21:27 ` [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode Arnaldo Carvalho de Melo
@ 2015-03-13  7:34   ` Ingo Molnar
  2015-03-13 10:53     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 48+ messages in thread
From: Ingo Molnar @ 2015-03-13  7:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo


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

> From: Andi Kleen <ak@linux.intel.com>
> 
> The information how much a counter ran in 'perf stat' can be quite
> interesting for other tools to judge how trustworthy a measurement is.
> 
> Currently it is only output in non CSV mode.
> 
> This patches make perf stat always output the running time and the
> enabled/running ratio in CSV mode.
> 
> This adds two new fields at the end for each line. I assume that
> existing tools ignore new fields at the end, so it's on by default.
> 
> Only CSV mode is affected, no difference otherwise.
> 
> v2: Add extra print_running function
> v3: Avoid printing nan
> v4: Remove some elses and add brackets.
> v5: Move non CSV case into print_running
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> Reviewed-by: Jiri Olsa <jolsa@redhat.com>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Link: http://lkml.kernel.org/r/1426083387-17006-1-git-send-email-andi@firstfloor.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/perf/builtin-stat.c | 47 ++++++++++++++++++++++++-----------------------
>  1 file changed, 24 insertions(+), 23 deletions(-)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index d28949d210cc..765e2204f6bf 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -769,6 +769,18 @@ static int run_perf_stat(int argc, const char **argv)
>  	return ret;
>  }
>  
> +static void print_running(u64 run, u64 ena)
> +{
> +	if (csv_output) {
> +		fprintf(output, "%s%" PRIu64 "%s%.2f",
> +					csv_sep,
> +					run,
> +					csv_sep,
> +					ena ? 100.0 * run / ena : 100.0);
> +	} else if (run != ena)
> +		fprintf(output, "  (%.2f%%)", 100.0 * run / ena);

That's not the standard pattern for 'else if' branches, but:

	} else {
		if ()
			...
	}

to make it stand apart more from a simple 'else' branch.

Thanks,

	Ingo

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

* Re: [PATCH 20/24] perf stat: Always correctly indent ratio column
  2015-03-12 21:28 ` [PATCH 20/24] perf stat: Always correctly indent ratio column Arnaldo Carvalho de Melo
@ 2015-03-13  7:36   ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2015-03-13  7:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Andi Kleen, Arnaldo Carvalho de Melo


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

> From: Andi Kleen <ak@linux.intel.com>
> 
> When cycles or instructions do not print anything, as in being,
> --per-socket or --per-core modi, the ratio column was not correctly
> indented for them. This lead to some ratios not lining up with the
> others. Always indent correctly when nothing is printed.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/perf/builtin-stat.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index e78c68df2152..41b296fff307 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -1093,7 +1093,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
>  		if (total) {
>  			ratio = avg / total;
>  			fprintf(output, " #   %5.2f  insns per cycle        ", ratio);
> -		}
> +		} else
> +			fprintf(output, "                                   ");

The standard pattern is symmetric curly braces.

> @@ -1162,7 +1163,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
>  		if (total) {
>  			ratio = avg / total;
>  			fprintf(output, " # %8.3f GHz                    ", ratio);
> -		}
> +		} else
> +			fprintf(output, "                                   ");

Ditto...

Thanks,

	Ingo

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

* Re: [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode
  2015-03-13  7:34   ` Ingo Molnar
@ 2015-03-13 10:53     ` Arnaldo Carvalho de Melo
  2015-03-13 12:31       ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-13 10:53 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andi Kleen, Jiri Olsa

Em Fri, Mar 13, 2015 at 08:34:41AM +0100, Ingo Molnar escreveu:
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > From: Andi Kleen <ak@linux.intel.com>
> > +static void print_running(u64 run, u64 ena)
> > +{
> > +	if (csv_output) {
> > +		fprintf(output, "%s%" PRIu64 "%s%.2f",
> > +					csv_sep,
> > +					run,
> > +					csv_sep,
> > +					ena ? 100.0 * run / ena : 100.0);
> > +	} else if (run != ena)
> > +		fprintf(output, "  (%.2f%%)", 100.0 * run / ena);
 
> That's not the standard pattern for 'else if' branches, but:
> 
> 	} else {
> 		if ()
> 			...
> 	}
> 
> to make it stand apart more from a simple 'else' branch.

I think it is preferred to make it match the if branch if it uses curly
braces, i.e. make it look:

	} else if () {
	}


i.e switch like series of else if, to avoid too much indentation for such
constructs.

Fixed it and the other file, redid the perf-core-for-mingo tag, pushed.

- Arnaldo

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

* Re: [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode
  2015-03-13 10:53     ` Arnaldo Carvalho de Melo
@ 2015-03-13 12:31       ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2015-03-13 12:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, Andi Kleen, Jiri Olsa


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

> Em Fri, Mar 13, 2015 at 08:34:41AM +0100, Ingo Molnar escreveu:
> > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > From: Andi Kleen <ak@linux.intel.com>
> > > +static void print_running(u64 run, u64 ena)
> > > +{
> > > +	if (csv_output) {
> > > +		fprintf(output, "%s%" PRIu64 "%s%.2f",
> > > +					csv_sep,
> > > +					run,
> > > +					csv_sep,
> > > +					ena ? 100.0 * run / ena : 100.0);
> > > +	} else if (run != ena)
> > > +		fprintf(output, "  (%.2f%%)", 100.0 * run / ena);
>  
> > That's not the standard pattern for 'else if' branches, but:
> > 
> > 	} else {
> > 		if ()
> > 			...
> > 	}
> > 
> > to make it stand apart more from a simple 'else' branch.
> 
> I think it is preferred to make it match the if branch if it uses curly
> braces, i.e. make it look:
> 
> 	} else if () {
> 	}
> 
> 
> i.e switch like series of else if, to avoid too much indentation for such
> constructs.
> 
> Fixed it and the other file, redid the perf-core-for-mingo tag, pushed.

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

	Ingo

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (23 preceding siblings ...)
  2015-03-12 21:28 ` [PATCH 24/24] perf data: Add tracepoint events fields CTF conversion support Arnaldo Carvalho de Melo
@ 2015-03-13 12:34 ` Ingo Molnar
  2015-03-13 12:45   ` Jiri Olsa
  24 siblings, 1 reply; 48+ messages in thread
From: Ingo Molnar @ 2015-03-13 12:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
	Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker,
	He Kuang, Jeremie Galarneau, Jiri Olsa, Joonsoo Kim,
	Masami Hiramatsu, Minchan Kim, Namhyung Kim, Naohiro Aota,
	Paul Mackerras, Peter Zijlstra, Sebastian Andrzej Siewior,
	Stephane Eranian, Tom Zanussi, Wang Nan,
	Arnaldo Carvalho de Melo


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

> Infrastructure:

> . Fix libbabeltrace detection (Jiri Olsa)

So this still doesn't seem to work for me:

...                 libbabeltrace: [ OFF ]

it should really not be included in the default build until the 
required library features are more widely available in distros.

I think we should only use library features by default that are 
available in the latest Fedora, SuSE and Ubuntu distros. We want them 
to build and package perf and there's little point in adding features 
that won't work on packaged up perf.

Thanks,

	Ingo

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2015-03-13 12:34 ` [GIT PULL 00/24] perf/core improvements and fixes Ingo Molnar
@ 2015-03-13 12:45   ` Jiri Olsa
  0 siblings, 0 replies; 48+ messages in thread
From: Jiri Olsa @ 2015-03-13 12:45 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Andi Kleen, Borislav Petkov, Corey Ashford, David Ahern,
	Don Zickus, Frederic Weisbecker, He Kuang, Jeremie Galarneau,
	Joonsoo Kim, Masami Hiramatsu, Minchan Kim, Namhyung Kim,
	Naohiro Aota, Paul Mackerras, Peter Zijlstra,
	Sebastian Andrzej Siewior, Stephane Eranian, Tom Zanussi,
	Wang Nan, Arnaldo Carvalho de Melo

On Fri, Mar 13, 2015 at 01:34:51PM +0100, Ingo Molnar wrote:
> 
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > Infrastructure:
> 
> > . Fix libbabeltrace detection (Jiri Olsa)
> 
> So this still doesn't seem to work for me:
> 
> ...                 libbabeltrace: [ OFF ]
> 
> it should really not be included in the default build until the 
> required library features are more widely available in distros.

the patch that moves babeltrace out of default
check wasn't pulled in yet:

http://marc.info/?l=linux-kernel&m=142606453815125&w=2

also note there's another bug in test-all that prevents
the test-all speed up, fixed by this patch:

http://marc.info/?l=linux-kernel&m=142606452415123&w=2

> 
> I think we should only use library features by default that are 
> available in the latest Fedora, SuSE and Ubuntu distros. We want them 
> to build and package perf and there's little point in adding features 
> that won't work on packaged up perf.

I think we should have the possibility to work and commit new
features even if the support is not yet in the main distros

for such features we could:
  - leave those features out of the default features check
    like we'll do for babeltrace
  - maybe use some sort of EXPERIMENTAL config option dependency
    once we have the .config file support ;-)

jirka

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2019-01-21 23:56 Arnaldo Carvalho de Melo
@ 2019-01-22 10:07 ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2019-01-22 10:07 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Clark Williams, linux-kernel, linux-perf-users, Brajeswar Ghosh,
	Jamal Hadi Salim, Rasmus Villemoes, Song Liu, Thomas Richter,
	YueHaibing, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> Regards,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit ad07c8ceb6631a83b62d405a61448bba92adac68:
> 
>   perf/core: Remove unused perf_flags (2019-01-21 11:01:31 +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-5.0-20190121
> 
> for you to fetch changes up to 32e9136e37840a62c659259a394ed3735e3b3c84:
> 
>   perf utils: Move perf_config using routines from color.c to separate object (2019-01-21 17:38:56 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> BPF:
> 
>   Song Liu:
> 
>   - Introduce PERF_RECORD_KSYMBOL to allow tooling to notice the addition
>     of new kernel symbols and be able to resolve samples in such symbols.
> 
>   - Introduce PERF_RECORD_BPF_EVENT to notify tooling about the loading
>     and unloading of BPF programs, making them visible and allowing for
>     the request of further information to allow for things like annotation.
> 
>   - Change the userspace perf tools to handle those new events and to
>     synthesize them for pre-existing loaded BPF programs.
> 
> Kernel:
> 
>   Arnaldo Carvalho de Melo:
> 
>   - Make perf_event_output() propagate the output() return, allowing
>     users to check for -ENOSPC in the ring buffer.
> 
> perf report:
> 
>   Thomas Richter:
> 
>   - Display arch specific diagnostic counter sets, starting with s390
>     diagnostic counter sets.
> 
> perf session:
> 
>   Jiri Olsa:
> 
>   - Introduce a reader object to prep for multithreaded processing
>     of recorded events.
> 
> Misc:
> 
>   Rasmus Villemoes:
> 
>   - Replace automatic const char[] variables by statics, to avoid
>     initializing them at runtime, instead having them in .rodata,
>     reducing code size.
> 
>   YueHaibing:
> 
>   - Remove duplicated workqueue.h include from perf_event.h
> 
>   Brajeswar Ghosh:
> 
>   - Remove some more duplicated headers.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (4):
>       perf: Make perf_event_output() propagate the output() return
>       perf top: Synthesize BPF events for pre-existing loaded BPF programs
>       perf python: Remove -fstack-clash-protection when building with some clang versions
>       perf utils: Move perf_config using routines from color.c to separate object
> 
> Brajeswar Ghosh (1):
>       perf tools: Remove duplicate headers
> 
> Jiri Olsa (6):
>       perf session: Rearrange perf_session__process_events function
>       perf session: Get rid of file_size variable
>       perf session: Add reader object
>       perf session: Add 'data_size' member to reader object
>       perf session: Add 'data_offset' member to reader object
>       perf session: Add reader__process_events function
> 
> Rasmus Villemoes (1):
>       perf tools: Replace automatic const char[] variables by statics
> 
> Song Liu (8):
>       perf, bpf: Introduce PERF_RECORD_KSYMBOL
>       tools headers uapi: Sync tools/include/uapi/linux/perf_event.h
>       perf, bpf: Introduce PERF_RECORD_BPF_EVENT
>       tools headers uapi: Sync tools/include/uapi/linux/perf_event.h
>       perf tools: Handle PERF_RECORD_KSYMBOL
>       perf tools: Handle PERF_RECORD_BPF_EVENT
>       perf tools: Synthesize PERF_RECORD_* for loaded BPF programs
>       bpf: Add module name [bpf] to ksymbols for bpf programs
> 
> Thomas Richter (3):
>       perf report: Display arch specific diagnostic counter sets, starting with s390
>       perf report: Display names in s390 diagnostic counter sets
>       perf report: Dump s390 counter set data to file
> 
> YueHaibing (1):
>       perf: Remove duplicated workqueue.h include from perf_event.h
> 
>  include/linux/filter.h                           |   7 +
>  include/linux/perf_event.h                       |  21 +-
>  include/uapi/linux/perf_event.h                  |  53 ++++-
>  kernel/bpf/core.c                                |   2 +-
>  kernel/bpf/syscall.c                             |   2 +
>  kernel/events/core.c                             | 224 +++++++++++++++++++-
>  kernel/kallsyms.c                                |   2 +-
>  kernel/trace/bpf_trace.c                         |   3 +-
>  tools/include/uapi/linux/perf_event.h            |  53 ++++-
>  tools/perf/builtin-c2c.c                         |   4 +-
>  tools/perf/builtin-kmem.c                        |   4 +-
>  tools/perf/builtin-record.c                      |   7 +
>  tools/perf/builtin-report.c                      |   6 +-
>  tools/perf/builtin-sched.c                       |   2 +-
>  tools/perf/builtin-stat.c                        |   1 -
>  tools/perf/builtin-top.c                         |   7 +
>  tools/perf/examples/bpf/augmented_raw_syscalls.c |   4 +-
>  tools/perf/examples/bpf/augmented_syscalls.c     |  14 +-
>  tools/perf/examples/bpf/etcsnoop.c               |  10 +-
>  tools/perf/perf.h                                |   1 +
>  tools/perf/tests/bp_account.c                    |   1 -
>  tools/perf/ui/browsers/header.c                  |   2 +-
>  tools/perf/ui/browsers/hists.c                   |   4 +-
>  tools/perf/util/Build                            |   5 +
>  tools/perf/util/bpf-event.c                      | 257 +++++++++++++++++++++++
>  tools/perf/util/bpf-event.h                      |  38 ++++
>  tools/perf/util/color.c                          |  39 ----
>  tools/perf/util/color_config.c                   |  47 +++++
>  tools/perf/util/dso.h                            |   1 -
>  tools/perf/util/event.c                          |  41 ++++
>  tools/perf/util/event.h                          |  36 ++++
>  tools/perf/util/evlist.h                         |   4 +-
>  tools/perf/util/evsel.c                          |  19 +-
>  tools/perf/util/evsel.h                          |   2 +
>  tools/perf/util/machine.c                        |  58 +++++
>  tools/perf/util/machine.h                        |   3 +
>  tools/perf/util/s390-cpumcf-kernel.h             |  62 ++++++
>  tools/perf/util/s390-cpumsf.c                    |  77 ++++++-
>  tools/perf/util/s390-sample-raw.c                | 222 ++++++++++++++++++++
>  tools/perf/util/sample-raw.c                     |  18 ++
>  tools/perf/util/sample-raw.h                     |  14 ++
>  tools/perf/util/session.c                        |  98 ++++++---
>  tools/perf/util/setup.py                         |   2 +
>  tools/perf/util/tool.h                           |   5 +-
>  tools/perf/util/zlib.c                           |   1 -
>  45 files changed, 1358 insertions(+), 125 deletions(-)
>  create mode 100644 tools/perf/util/bpf-event.c
>  create mode 100644 tools/perf/util/bpf-event.h
>  create mode 100644 tools/perf/util/color_config.c
>  create mode 100644 tools/perf/util/s390-cpumcf-kernel.h
>  create mode 100644 tools/perf/util/s390-sample-raw.c
>  create mode 100644 tools/perf/util/sample-raw.c
>  create mode 100644 tools/perf/util/sample-raw.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2019-01-21 23:56 Arnaldo Carvalho de Melo
  2019-01-22 10:07 ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-01-21 23:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Clark Williams, linux-kernel, linux-perf-users,
	Arnaldo Carvalho de Melo, Brajeswar Ghosh, Jamal Hadi Salim,
	Rasmus Villemoes, Song Liu, Thomas Richter, YueHaibing,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

Regards,

- Arnaldo

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

The following changes since commit ad07c8ceb6631a83b62d405a61448bba92adac68:

  perf/core: Remove unused perf_flags (2019-01-21 11:01:31 +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-5.0-20190121

for you to fetch changes up to 32e9136e37840a62c659259a394ed3735e3b3c84:

  perf utils: Move perf_config using routines from color.c to separate object (2019-01-21 17:38:56 -0300)

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

BPF:

  Song Liu:

  - Introduce PERF_RECORD_KSYMBOL to allow tooling to notice the addition
    of new kernel symbols and be able to resolve samples in such symbols.

  - Introduce PERF_RECORD_BPF_EVENT to notify tooling about the loading
    and unloading of BPF programs, making them visible and allowing for
    the request of further information to allow for things like annotation.

  - Change the userspace perf tools to handle those new events and to
    synthesize them for pre-existing loaded BPF programs.

Kernel:

  Arnaldo Carvalho de Melo:

  - Make perf_event_output() propagate the output() return, allowing
    users to check for -ENOSPC in the ring buffer.

perf report:

  Thomas Richter:

  - Display arch specific diagnostic counter sets, starting with s390
    diagnostic counter sets.

perf session:

  Jiri Olsa:

  - Introduce a reader object to prep for multithreaded processing
    of recorded events.

Misc:

  Rasmus Villemoes:

  - Replace automatic const char[] variables by statics, to avoid
    initializing them at runtime, instead having them in .rodata,
    reducing code size.

  YueHaibing:

  - Remove duplicated workqueue.h include from perf_event.h

  Brajeswar Ghosh:

  - Remove some more duplicated headers.

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (4):
      perf: Make perf_event_output() propagate the output() return
      perf top: Synthesize BPF events for pre-existing loaded BPF programs
      perf python: Remove -fstack-clash-protection when building with some clang versions
      perf utils: Move perf_config using routines from color.c to separate object

Brajeswar Ghosh (1):
      perf tools: Remove duplicate headers

Jiri Olsa (6):
      perf session: Rearrange perf_session__process_events function
      perf session: Get rid of file_size variable
      perf session: Add reader object
      perf session: Add 'data_size' member to reader object
      perf session: Add 'data_offset' member to reader object
      perf session: Add reader__process_events function

Rasmus Villemoes (1):
      perf tools: Replace automatic const char[] variables by statics

Song Liu (8):
      perf, bpf: Introduce PERF_RECORD_KSYMBOL
      tools headers uapi: Sync tools/include/uapi/linux/perf_event.h
      perf, bpf: Introduce PERF_RECORD_BPF_EVENT
      tools headers uapi: Sync tools/include/uapi/linux/perf_event.h
      perf tools: Handle PERF_RECORD_KSYMBOL
      perf tools: Handle PERF_RECORD_BPF_EVENT
      perf tools: Synthesize PERF_RECORD_* for loaded BPF programs
      bpf: Add module name [bpf] to ksymbols for bpf programs

Thomas Richter (3):
      perf report: Display arch specific diagnostic counter sets, starting with s390
      perf report: Display names in s390 diagnostic counter sets
      perf report: Dump s390 counter set data to file

YueHaibing (1):
      perf: Remove duplicated workqueue.h include from perf_event.h

 include/linux/filter.h                           |   7 +
 include/linux/perf_event.h                       |  21 +-
 include/uapi/linux/perf_event.h                  |  53 ++++-
 kernel/bpf/core.c                                |   2 +-
 kernel/bpf/syscall.c                             |   2 +
 kernel/events/core.c                             | 224 +++++++++++++++++++-
 kernel/kallsyms.c                                |   2 +-
 kernel/trace/bpf_trace.c                         |   3 +-
 tools/include/uapi/linux/perf_event.h            |  53 ++++-
 tools/perf/builtin-c2c.c                         |   4 +-
 tools/perf/builtin-kmem.c                        |   4 +-
 tools/perf/builtin-record.c                      |   7 +
 tools/perf/builtin-report.c                      |   6 +-
 tools/perf/builtin-sched.c                       |   2 +-
 tools/perf/builtin-stat.c                        |   1 -
 tools/perf/builtin-top.c                         |   7 +
 tools/perf/examples/bpf/augmented_raw_syscalls.c |   4 +-
 tools/perf/examples/bpf/augmented_syscalls.c     |  14 +-
 tools/perf/examples/bpf/etcsnoop.c               |  10 +-
 tools/perf/perf.h                                |   1 +
 tools/perf/tests/bp_account.c                    |   1 -
 tools/perf/ui/browsers/header.c                  |   2 +-
 tools/perf/ui/browsers/hists.c                   |   4 +-
 tools/perf/util/Build                            |   5 +
 tools/perf/util/bpf-event.c                      | 257 +++++++++++++++++++++++
 tools/perf/util/bpf-event.h                      |  38 ++++
 tools/perf/util/color.c                          |  39 ----
 tools/perf/util/color_config.c                   |  47 +++++
 tools/perf/util/dso.h                            |   1 -
 tools/perf/util/event.c                          |  41 ++++
 tools/perf/util/event.h                          |  36 ++++
 tools/perf/util/evlist.h                         |   4 +-
 tools/perf/util/evsel.c                          |  19 +-
 tools/perf/util/evsel.h                          |   2 +
 tools/perf/util/machine.c                        |  58 +++++
 tools/perf/util/machine.h                        |   3 +
 tools/perf/util/s390-cpumcf-kernel.h             |  62 ++++++
 tools/perf/util/s390-cpumsf.c                    |  77 ++++++-
 tools/perf/util/s390-sample-raw.c                | 222 ++++++++++++++++++++
 tools/perf/util/sample-raw.c                     |  18 ++
 tools/perf/util/sample-raw.h                     |  14 ++
 tools/perf/util/session.c                        |  98 ++++++---
 tools/perf/util/setup.py                         |   2 +
 tools/perf/util/tool.h                           |   5 +-
 tools/perf/util/zlib.c                           |   1 -
 45 files changed, 1358 insertions(+), 125 deletions(-)
 create mode 100644 tools/perf/util/bpf-event.c
 create mode 100644 tools/perf/util/bpf-event.h
 create mode 100644 tools/perf/util/color_config.c
 create mode 100644 tools/perf/util/s390-cpumcf-kernel.h
 create mode 100644 tools/perf/util/s390-sample-raw.c
 create mode 100644 tools/perf/util/sample-raw.c
 create mode 100644 tools/perf/util/sample-raw.h

Test results:

The first ones are container based builds of tools/perf with and without libelf
support.  Where clang is available, it is also used to build perf with/without
libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang
when clang and its devel libraries are installed.

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

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

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

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

  $ dm
   1 alpine:3.4                    : Ok   gcc (Alpine 5.3.0) 5.3.0
   2 alpine:3.5                    : Ok   gcc (Alpine 6.2.1) 6.2.1 20160822
   3 alpine:3.6                    : Ok   gcc (Alpine 6.3.0) 6.3.0
   4 alpine:3.7                    : Ok   gcc (Alpine 6.4.0) 6.4.0
   5 alpine:3.8                    : Ok   gcc (Alpine 6.4.0) 6.4.0
   6 alpine:edge                   : Ok   gcc (Alpine 8.2.0) 8.2.0
   7 amazonlinux:1                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
   8 amazonlinux:2                 : Ok   gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
   9 android-ndk:r12b-arm          : Ok   gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  10 android-ndk:r15c-arm          : Ok   gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6)
  11 centos:5                      : Ok   gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
  12 centos:6                      : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
  13 centos:7                      : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
  14 clearlinux:latest             : Ok   gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502
  15 debian:7                      : Ok   gcc (Debian 4.7.2-5) 4.7.2
  16 debian:8                      : Ok   gcc (Debian 4.9.2-10+deb8u2) 4.9.2
  17 debian:9                      : Ok   gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
  18 debian:experimental           : Ok   gcc (Debian 8.2.0-13) 8.2.0
  19 debian:experimental-x-arm64   : Ok   gcc (Debian 8.2.0-13) 8.2.0
  20 debian:experimental-x-mips    : Ok   gcc (Debian 8.2.0-13) 8.2.0
  21 debian:experimental-x-mips64  : Ok   gcc (Debian 8.2.0-13) 8.2.0
  22 debian:experimental-x-mipsel  : Ok   gcc (Debian 8.2.0-13) 8.2.0
  23 fedora:20                     : Ok   gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
  24 fedora:22                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  25 fedora:23                     : Ok   gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
  26 fedora:24                     : Ok   gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  27 fedora:24-x-ARC-uClibc        : Ok   gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
  28 fedora:25                     : Ok   gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
  29 fedora:26                     : Ok   gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
  30 fedora:27                     : Ok   gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6)
  31 fedora:28                     : Ok   gcc (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)
  32 fedora:29                     : Ok   gcc (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)
  33 fedora:rawhide                : Ok   gcc (GCC) 8.2.1 20190109 (Red Hat 8.2.1-7)
  34 gentoo-stage3-amd64:latest    : Ok   gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0
  35 mageia:5                      : Ok   gcc (GCC) 4.9.2
  36 mageia:6                      : Ok   gcc (Mageia 5.5.0-1.mga6) 5.5.0
  37 opensuse:13.2                 : Ok   gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
  38 opensuse:15.0                 : Ok   gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
  39 opensuse:42.1                 : Ok   gcc (SUSE Linux) 4.8.5
  40 opensuse:42.2                 : Ok   gcc (SUSE Linux) 4.8.5
  41 opensuse:42.3                 : Ok   gcc (SUSE Linux) 4.8.5
  42 opensuse:tumbleweed           : Ok   gcc (SUSE Linux) 8.2.1 20181108 [gcc-8-branch revision 265914]
  43 oraclelinux:6                 : Ok   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1)
  44 oraclelinux:7                 : Ok   gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)
  45 ubuntu:12.04.5                : Ok   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  46 ubuntu:14.04.4                : Ok   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
  47 ubuntu:14.04.4-x-linaro-arm64 : Ok   gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
  48 ubuntu:16.04                  : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  49 ubuntu:16.04-x-arm            : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  50 ubuntu:16.04-x-arm64          : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  51 ubuntu:16.04-x-powerpc        : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  52 ubuntu:16.04-x-powerpc64      : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  53 ubuntu:16.04-x-powerpc64el    : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  54 ubuntu:16.04-x-s390           : Ok   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
  55 ubuntu:17.10                  : Ok   gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
  56 ubuntu:18.04                  : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  57 ubuntu:18.04-x-arm            : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  58 ubuntu:18.04-x-arm64          : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  59 ubuntu:18.04-x-m68k           : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  60 ubuntu:18.04-x-powerpc        : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  61 ubuntu:18.04-x-powerpc64      : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  62 ubuntu:18.04-x-powerpc64el    : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  63 ubuntu:18.04-x-riscv64        : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  64 ubuntu:18.04-x-s390           : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  65 ubuntu:18.04-x-sh4            : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  66 ubuntu:18.04-x-sparc64        : Ok   gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
  67 ubuntu:18.10                  : Ok   gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0
  68 ubuntu:19.04                  : Ok   gcc (Ubuntu 8.2.0-12ubuntu1) 8.2.0
  69 ubuntu:19.04-x-alpha          : Ok   gcc (Ubuntu 8.2.0-12ubuntu1) 8.2.0
  70 ubuntu:19.04-x-hppa           : Ok   gcc (Ubuntu 8.2.0-12ubuntu1) 8.2.0
  $

  # uname -a
  Linux quaco 5.0.0-rc3+ #16 SMP Mon Jan 21 12:01:36 -03 2019 x86_64 x86_64 x86_64 GNU/Linux
  # git log --oneline -1
  32e9136e3784 perf utils: Move perf_config using routines from color.c to separate object
  # perf version --build-options
  perf version 5.0.rc2.g32e9136
                   dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
      dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                   glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
                    gtk2: [ on  ]  # HAVE_GTK2_SUPPORT
           syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                  libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                  libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
                 libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
  numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
                 libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
               libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
                libslang: [ on  ]  # HAVE_SLANG_SUPPORT
               libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
               libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
      libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                    zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                    lzma: [ on  ]  # HAVE_LZMA_SUPPORT
               get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                     bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
  # perf test
   1: vmlinux symtab matches kallsyms                       : Ok
   2: Detect openat syscall event                           : Ok
   3: Detect openat syscall event on all cpus               : Ok
   4: Read samples using the mmap interface                 : Ok
   5: Test data source output                               : Ok
   6: Parse event definition strings                        : Ok
   7: Simple expression parser                              : Ok
   8: PERF_RECORD_* events & perf_sample fields             : Ok
   9: Parse perf pmu format                                 : Ok
  10: DSO data read                                         : Ok
  11: DSO data cache                                        : Ok
  12: DSO data reopen                                       : Ok
  13: Roundtrip evsel->name                                 : Ok
  14: Parse sched tracepoints fields                        : Ok
  15: syscalls:sys_enter_openat event fields                : Ok
  16: Setup struct perf_event_attr                          : Ok
  17: Match and link multiple hists                         : Ok
  18: 'import perf' in python                               : Ok
  19: Breakpoint overflow signal handler                    : Ok
  20: Breakpoint overflow sampling                          : Ok
  21: Breakpoint accounting                                 : Ok
  22: Watchpoint                                            :
  22.1: Read Only Watchpoint                                : Skip
  22.2: Write Only Watchpoint                               : Ok
  22.3: Read / Write Watchpoint                             : Ok
  22.4: Modify Watchpoint                                   : Ok
  23: Number of exit events of a simple workload            : Ok
  24: Software clock events period values                   : Ok
  25: Object code reading                                   : Ok
  26: Sample parsing                                        : Ok
  27: Use a dummy software event to keep tracking           : Ok
  28: Parse with no sample_id_all bit set                   : Ok
  29: Filter hist entries                                   : Ok
  30: Lookup mmap thread                                    : Ok
  31: Share thread mg                                       : Ok
  32: Sort output of hist entries                           : Ok
  33: Cumulate child hist entries                           : Ok
  34: Track with sched_switch                               : Ok
  35: Filter fds with revents mask in a fdarray             : Ok
  36: Add fd to a fdarray, making it autogrow               : Ok
  37: kmod_path__parse                                      : Ok
  38: Thread map                                            : Ok
  39: LLVM search and compile                               :
  39.1: Basic BPF llvm compile                              : Ok
  39.2: kbuild searching                                    : Ok
  39.3: Compile source for BPF prologue generation          : Ok
  39.4: Compile source for BPF relocation                   : Ok
  40: Session topology                                      : Ok
  41: BPF filter                                            :
  41.1: Basic BPF filtering                                 : Ok
  41.2: BPF pinning                                         : Ok
  41.3: BPF prologue generation                             : Ok
  41.4: BPF relocation checker                              : Ok
  42: Synthesize thread map                                 : Ok
  43: Remove thread map                                     : Ok
  44: Synthesize cpu map                                    : Ok
  45: Synthesize stat config                                : Ok
  46: Synthesize stat                                       : Ok
  47: Synthesize stat round                                 : Ok
  48: Synthesize attr update                                : Ok
  49: Event times                                           : Ok
  50: Read backward ring buffer                             : Ok
  51: Print cpu map                                         : Ok
  52: Probe SDT events                                      : Ok
  53: is_printable_array                                    : Ok
  54: Print bitmap                                          : Ok
  55: perf hooks                                            : Ok
  56: builtin clang support                                 : Skip (not compiled in)
  57: unit_number__scnprintf                                : Ok
  58: mem2node                                              : Ok
  59: x86 rdpmc                                             : Ok
  60: Convert perf time to TSC                              : Ok
  61: DWARF unwind                                          : Ok
  62: x86 instruction decoder - new instructions            : Ok
  63: x86 bp modify                                         : Ok
  64: probe libc's inet_pton & backtrace it with ping       : Ok
  65: Use vfs_getname probe to get syscall args filenames   : Ok
  66: Add vfs_getname probe to get syscall args filenames   : Ok
  67: Check open filename arg using perf trace + vfs_getname: Ok

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

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2017-10-23 23:47 Arnaldo Carvalho de Melo
@ 2017-10-24  9:13 ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2017-10-24  9:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, linux-perf-users, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, Christophe JAILLET, David Ahern,
	Jin Yao, Jiri Olsa, Kan Liang, Li Zhijian, Milian Wolff,
	Namhyung Kim, Peter Zijlstra, Ravi Bangoria, Sukadev Bhattiprolu,
	Wang Nan, yuzhoujian, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, hopefully the next batch will have a
> few other interesting patchkits, from Jin Yao, Kan Liang and Milian
> Wolff.
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit 8776fe75dc0e263ed2056ea9896c2267599dc447:
> 
>   lkdtm, kprobes: Convert from jprobes to kprobes (2017-10-23 13:52:45 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.15-20171023
> 
> for you to fetch changes up to 65db92e0965ab56e8031d5c804f26d5be0e47047:
> 
>   perf vendor events: Add Goldmont Plus V1 event file (2017-10-23 16:30:54 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> - Update vendor events JSON metrics for Intel's Broadwell, Broadwell
>   Server, Haswell, Haswell Server, IvyBridge, IvyTown, JakeTown, Sandy
>   Bridge, Skylake and SkyLake Server (Andi Kleen)
> 
> - Add vendor event file for Intel's Goldmont Plus V1 (Kan Liang)
> 
> - Move perf_mmap methods from 'perf record' and evlist.c to a separate
>   mmap.[ch] pair, to better separate things and pave the way for further
>   work on multithreading tools (Arnaldo Carvalho de Melo)
> 
> - Do not check ABI headers in a detached tarball build, as it the kernel
>   headers from where we copied tools/include/ are by definition not
>   available (Arnaldo Carvalho de Melo)
> 
> - Make 'perf script' use fprintf() like printing, i.e. receiving a FILE
>   pointer so that it gets consistent with other tools/ code and allows
>   for printing to per-event files (Arnaldo Carvalho de Melo)
> 
> - Error handling fixes (resource release on exit) for 'perf script'
>   and 'perf kmem' (Christophe JAILLET)
> 
> - Make some 'perf event attr' tests optional on virtual machines, where
>   tested counters are not available (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (12):
>       perf vendor events: Update JSON metrics for Broadwell
>       perf vendor events: Update JSON metrics for Broadwell Server
>       perf vendor events: Update JSON metrics for Haswell
>       perf vendor events: Update JSON metrics for Haswell Server
>       perf vendor events: Update JSON metrics for IvyBridge
>       perf vendor events: Update JSON metrics for IvyTown
>       perf vendor events: Update JSON metrics for JakeTown
>       perf vendor events: Update JSON metrics for Sandy Bridge
>       perf vendor events: Update JSON metrics for Skylake
>       perf vendor events: Update JSON metrics for Skylake Server
>       perf list: Fix group description in the man page
>       perf vendor events: Fix incorrect cmask syntax for some Intel metrics
> 
> Arnaldo Carvalho de Melo (7):
>       perf mmap: Move perf_mmap and methods to separate mmap.[ch] files
>       perf record: Make record__mmap_read generic
>       perf mmap: Adopt push method from builtin-record.c
>       perf tools: Do not check ABI headers in a detached tarball build
>       perf tools: Introduce binary__fprintf()
>       perf script: Use fprintf like printing uniformly
>       perf namespaces: Add more appropriate set of headers
> 
> Christophe JAILLET (2):
>       perf script: Fix error handling path
>       perf kmem: Perform some cleanup if '--time' is given an invalid value
> 
> Jiri Olsa (2):
>       perf tests attr: Make hw events optional
>       perf annotate: Remove arch::cpuid_parse callback
> 
> Kan Liang (1):
>       perf vendor events: Add Goldmont Plus V1 event file
> 
>  tools/perf/Documentation/perf-list.txt             |    2 +-
>  tools/perf/arch/arm/annotate/instructions.c        |    3 +-
>  tools/perf/arch/arm64/annotate/instructions.c      |    3 +-
>  tools/perf/arch/powerpc/annotate/instructions.c    |    4 +-
>  tools/perf/arch/s390/annotate/instructions.c       |    4 +-
>  tools/perf/arch/x86/annotate/instructions.c        |   14 +
>  tools/perf/builtin-kmem.c                          |    3 +-
>  tools/perf/builtin-record.c                        |  104 +-
>  tools/perf/builtin-script.c                        |  527 +++----
>  tools/perf/builtin-trace.c                         |   14 +-
>  tools/perf/check-headers.sh                        |    5 +
>  .../pmu-events/arch/x86/broadwell/bdw-metrics.json |   18 +-
>  .../arch/x86/broadwellx/bdx-metrics.json           |   18 +-
>  .../pmu-events/arch/x86/goldmontplus/cache.json    | 1453 ++++++++++++++++++++
>  .../pmu-events/arch/x86/goldmontplus/frontend.json |   62 +
>  .../pmu-events/arch/x86/goldmontplus/memory.json   |   38 +
>  .../pmu-events/arch/x86/goldmontplus/other.json    |   98 ++
>  .../pmu-events/arch/x86/goldmontplus/pipeline.json |  544 ++++++++
>  .../arch/x86/goldmontplus/virtual-memory.json      |  218 +++
>  .../pmu-events/arch/x86/haswell/hsw-metrics.json   |   16 +-
>  .../pmu-events/arch/x86/haswellx/hsx-metrics.json  |   16 +-
>  .../pmu-events/arch/x86/ivybridge/ivb-metrics.json |   18 +-
>  .../pmu-events/arch/x86/ivytown/ivt-metrics.json   |   18 +-
>  .../pmu-events/arch/x86/jaketown/jkt-metrics.json  |   12 +-
>  tools/perf/pmu-events/arch/x86/mapfile.csv         |    1 +
>  .../arch/x86/sandybridge/snb-metrics.json          |   12 +-
>  .../pmu-events/arch/x86/skylake/skl-metrics.json   |   20 +-
>  .../pmu-events/arch/x86/skylakex/skx-metrics.json  |   42 +-
>  tools/perf/tests/attr/test-stat-C0                 |    1 +
>  tools/perf/tests/attr/test-stat-basic              |    1 +
>  tools/perf/tests/attr/test-stat-default            |    4 +
>  tools/perf/tests/attr/test-stat-detailed-1         |    8 +
>  tools/perf/tests/attr/test-stat-detailed-2         |   13 +
>  tools/perf/tests/attr/test-stat-detailed-3         |   13 +
>  tools/perf/tests/attr/test-stat-no-inherit         |    1 +
>  tools/perf/util/Build                              |    1 +
>  tools/perf/util/annotate.c                         |   10 +-
>  tools/perf/util/debug.c                            |   31 +-
>  tools/perf/util/evlist.c                           |  248 ----
>  tools/perf/util/evlist.h                           |   76 +-
>  tools/perf/util/mmap.c                             |  352 +++++
>  tools/perf/util/mmap.h                             |   97 ++
>  tools/perf/util/namespaces.h                       |    5 +-
>  tools/perf/util/print_binary.c                     |   30 +-
>  tools/perf/util/print_binary.h                     |   18 +-
>  tools/perf/util/python-ext-sources                 |    1 +
>  46 files changed, 3367 insertions(+), 830 deletions(-)
>  create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/cache.json
>  create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/frontend.json
>  create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/memory.json
>  create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/other.json
>  create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/pipeline.json
>  create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/virtual-memory.json
>  create mode 100644 tools/perf/util/mmap.c
>  create mode 100644 tools/perf/util/mmap.h

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2017-10-23 23:47 Arnaldo Carvalho de Melo
  2017-10-24  9:13 ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-10-23 23:47 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Christophe JAILLET, David Ahern, Jin Yao, Jiri Olsa, Kan Liang,
	Li Zhijian, Milian Wolff, Namhyung Kim, Peter Zijlstra,
	Ravi Bangoria, Sukadev Bhattiprolu, Wang Nan, yuzhoujian,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, hopefully the next batch will have a
few other interesting patchkits, from Jin Yao, Kan Liang and Milian
Wolff.

- Arnaldo

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

The following changes since commit 8776fe75dc0e263ed2056ea9896c2267599dc447:

  lkdtm, kprobes: Convert from jprobes to kprobes (2017-10-23 13:52:45 +0200)

are available in the git repository at:

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

for you to fetch changes up to 65db92e0965ab56e8031d5c804f26d5be0e47047:

  perf vendor events: Add Goldmont Plus V1 event file (2017-10-23 16:30:54 -0300)

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

- Update vendor events JSON metrics for Intel's Broadwell, Broadwell
  Server, Haswell, Haswell Server, IvyBridge, IvyTown, JakeTown, Sandy
  Bridge, Skylake and SkyLake Server (Andi Kleen)

- Add vendor event file for Intel's Goldmont Plus V1 (Kan Liang)

- Move perf_mmap methods from 'perf record' and evlist.c to a separate
  mmap.[ch] pair, to better separate things and pave the way for further
  work on multithreading tools (Arnaldo Carvalho de Melo)

- Do not check ABI headers in a detached tarball build, as it the kernel
  headers from where we copied tools/include/ are by definition not
  available (Arnaldo Carvalho de Melo)

- Make 'perf script' use fprintf() like printing, i.e. receiving a FILE
  pointer so that it gets consistent with other tools/ code and allows
  for printing to per-event files (Arnaldo Carvalho de Melo)

- Error handling fixes (resource release on exit) for 'perf script'
  and 'perf kmem' (Christophe JAILLET)

- Make some 'perf event attr' tests optional on virtual machines, where
  tested counters are not available (Jiri Olsa)

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

----------------------------------------------------------------
Andi Kleen (12):
      perf vendor events: Update JSON metrics for Broadwell
      perf vendor events: Update JSON metrics for Broadwell Server
      perf vendor events: Update JSON metrics for Haswell
      perf vendor events: Update JSON metrics for Haswell Server
      perf vendor events: Update JSON metrics for IvyBridge
      perf vendor events: Update JSON metrics for IvyTown
      perf vendor events: Update JSON metrics for JakeTown
      perf vendor events: Update JSON metrics for Sandy Bridge
      perf vendor events: Update JSON metrics for Skylake
      perf vendor events: Update JSON metrics for Skylake Server
      perf list: Fix group description in the man page
      perf vendor events: Fix incorrect cmask syntax for some Intel metrics

Arnaldo Carvalho de Melo (7):
      perf mmap: Move perf_mmap and methods to separate mmap.[ch] files
      perf record: Make record__mmap_read generic
      perf mmap: Adopt push method from builtin-record.c
      perf tools: Do not check ABI headers in a detached tarball build
      perf tools: Introduce binary__fprintf()
      perf script: Use fprintf like printing uniformly
      perf namespaces: Add more appropriate set of headers

Christophe JAILLET (2):
      perf script: Fix error handling path
      perf kmem: Perform some cleanup if '--time' is given an invalid value

Jiri Olsa (2):
      perf tests attr: Make hw events optional
      perf annotate: Remove arch::cpuid_parse callback

Kan Liang (1):
      perf vendor events: Add Goldmont Plus V1 event file

 tools/perf/Documentation/perf-list.txt             |    2 +-
 tools/perf/arch/arm/annotate/instructions.c        |    3 +-
 tools/perf/arch/arm64/annotate/instructions.c      |    3 +-
 tools/perf/arch/powerpc/annotate/instructions.c    |    4 +-
 tools/perf/arch/s390/annotate/instructions.c       |    4 +-
 tools/perf/arch/x86/annotate/instructions.c        |   14 +
 tools/perf/builtin-kmem.c                          |    3 +-
 tools/perf/builtin-record.c                        |  104 +-
 tools/perf/builtin-script.c                        |  527 +++----
 tools/perf/builtin-trace.c                         |   14 +-
 tools/perf/check-headers.sh                        |    5 +
 .../pmu-events/arch/x86/broadwell/bdw-metrics.json |   18 +-
 .../arch/x86/broadwellx/bdx-metrics.json           |   18 +-
 .../pmu-events/arch/x86/goldmontplus/cache.json    | 1453 ++++++++++++++++++++
 .../pmu-events/arch/x86/goldmontplus/frontend.json |   62 +
 .../pmu-events/arch/x86/goldmontplus/memory.json   |   38 +
 .../pmu-events/arch/x86/goldmontplus/other.json    |   98 ++
 .../pmu-events/arch/x86/goldmontplus/pipeline.json |  544 ++++++++
 .../arch/x86/goldmontplus/virtual-memory.json      |  218 +++
 .../pmu-events/arch/x86/haswell/hsw-metrics.json   |   16 +-
 .../pmu-events/arch/x86/haswellx/hsx-metrics.json  |   16 +-
 .../pmu-events/arch/x86/ivybridge/ivb-metrics.json |   18 +-
 .../pmu-events/arch/x86/ivytown/ivt-metrics.json   |   18 +-
 .../pmu-events/arch/x86/jaketown/jkt-metrics.json  |   12 +-
 tools/perf/pmu-events/arch/x86/mapfile.csv         |    1 +
 .../arch/x86/sandybridge/snb-metrics.json          |   12 +-
 .../pmu-events/arch/x86/skylake/skl-metrics.json   |   20 +-
 .../pmu-events/arch/x86/skylakex/skx-metrics.json  |   42 +-
 tools/perf/tests/attr/test-stat-C0                 |    1 +
 tools/perf/tests/attr/test-stat-basic              |    1 +
 tools/perf/tests/attr/test-stat-default            |    4 +
 tools/perf/tests/attr/test-stat-detailed-1         |    8 +
 tools/perf/tests/attr/test-stat-detailed-2         |   13 +
 tools/perf/tests/attr/test-stat-detailed-3         |   13 +
 tools/perf/tests/attr/test-stat-no-inherit         |    1 +
 tools/perf/util/Build                              |    1 +
 tools/perf/util/annotate.c                         |   10 +-
 tools/perf/util/debug.c                            |   31 +-
 tools/perf/util/evlist.c                           |  248 ----
 tools/perf/util/evlist.h                           |   76 +-
 tools/perf/util/mmap.c                             |  352 +++++
 tools/perf/util/mmap.h                             |   97 ++
 tools/perf/util/namespaces.h                       |    5 +-
 tools/perf/util/print_binary.c                     |   30 +-
 tools/perf/util/print_binary.h                     |   18 +-
 tools/perf/util/python-ext-sources                 |    1 +
 46 files changed, 3367 insertions(+), 830 deletions(-)
 create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/cache.json
 create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/frontend.json
 create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/memory.json
 create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/other.json
 create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/pipeline.json
 create mode 100644 tools/perf/pmu-events/arch/x86/goldmontplus/virtual-memory.json
 create mode 100644 tools/perf/util/mmap.c
 create mode 100644 tools/perf/util/mmap.h

Test results:

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

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

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

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

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

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:3.6: Ok
   4 alpine:edge: Ok
   5 android-ndk:r12b-arm: Ok
   6 android-ndk:r15c-arm: Ok
   7 archlinux:latest: Ok
   8 centos:5: Ok
   9 centos:6: Ok
  10 centos:7: Ok
  11 debian:7: Ok
  12 debian:8: Ok
  13 debian:9: Ok
  14 debian:experimental: Ok
  15 debian:experimental-x-arm64: Ok
  16 debian:experimental-x-mips: Ok
  17 debian:experimental-x-mips64: Ok
  18 debian:experimental-x-mipsel: Ok
  19 fedora:20: Ok
  20 fedora:21: Ok
  21 fedora:22: Ok
  22 fedora:23: Ok
  23 fedora:24: Ok
  24 fedora:24-x-ARC-uClibc: Ok

     Should finally be fixed with the rc2 toolchain + -matomic for
     atomic_cmpchg -> __sync_val_compare_and_swap_4

  25 fedora:25: Ok
  26 fedora:26: Ok
  27 fedora:rawhide: Ok
  28 mageia:5: Ok
  29 opensuse:42.1: Ok
  30 opensuse:42.2: Ok
  31 opensuse:42.3: Ok
  32 opensuse:tumbleweed: Ok
  33 oraclelinux:6: 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.04: 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.10: Ok
  #

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

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

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2016-07-15 20:50 Arnaldo Carvalho de Melo
@ 2016-07-16 20:39 ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2016-07-16 20:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andy Lutomirski, Chris Phlipot,
	David Ahern, He Kuang, H . Peter Anvin, Jiri Olsa,
	Josh Poimboeuf, Masami Hiramatsu, Namhyung Kim, Nilay Vaish,
	Peter Zijlstra, pi3orama, Songshan Gong, Stephen Rothwell,
	Steven Rostedt, Thomas Gleixner, Wang Nan, Zefan Li,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> Test results, with a new target: cross-compiling to Android ARM API 24 (NDK r12b),
> for all except android-ndk:r12b now objtool is tested too, in adition to tools/perf.
> 
>   [root@jouet ~]# 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
>   opensuse:13.2: Ok
>   opensuse:42.1: Ok
>   ubuntu:14.04.4: Ok
>   ubuntu:15.10: Ok
>   ubuntu:16.04: Ok
>   [root@jouet ~]#
> 
> oops, the mageia image din't got rebuilt, will fix that, pretty good coverage
> even so :-)
> 
> - Arnaldo
> 
> The following changes since commit b29c6574699dc475da5dbff8db19297b203aacce:
> 
>   Merge tag 'perf-core-for-mingo-20160713' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-07-14 08:54:13 +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-20160715
> 
> for you to fetch changes up to b49364f36cfdb6d540ac961102d7ffaf84279bb6:
> 
>   objtool: Initialize variable to silence old compiler (2016-07-15 17:32:52 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Allow reading from a backward ring buffer (one setup via sys_perf_event_open
>   with perf_event_attr.write_backward = 1) (Wang Nan)
> 
> Infrastructure:
> 
> - Fix the build on Android NDK r12b (initially just for arm), that is now port
>   of my perf-build container collection and will get tested prior to sending
>   patches upstream (Arnaldo Carvalho de Melo)
> 
> - Add correct header for ipv6 defini
> 
> - Fix bitsperlong.h fallout (Arnaldo Carvalho de Melo, Peter Zijlstra)
> 
> - Use base 0 (auto) in filename__read_ull, so that we can handle hex values too (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (8):
>       tools lib traceevent: Add correct header for ipv6 definitions
>       perf tools: Do not provide dup sched_getcpu() prototype on Android
>       tools: Make "__always_inline" just "inline" on Android
>       perf tools: Just pr_debug() about not being able to read cacheline_size
>       perf tools: Bail out at "--sort dcacheline" and cacheline_size not known
>       perf evlist: Drop redundant evsel->overwrite indicator
>       objtool: Add -I$(srctree)/tools/arch/$(ARCH)/include/uapi
>       objtool: Initialize variable to silence old compiler
> 
> Jiri Olsa (1):
>       tools lib api fs: Use base 0 in filename__read_ull
> 
> Peter Zijlstra (1):
>       tools: Simplify BITS_PER_LONG define
> 
> Wang Nan (14):
>       tools lib fd array: Allow associating a pointer cookie with each entry
>       perf evlist: Update mmap related APIs and helpers
>       perf record: Decouple record__mmap_read() and evlist.
>       perf evlist: Record mmap cookie into fdarray private field
>       perf evlist: Extract common code in mmap failure processing
>       perf evlist: Introduce backward_mmap array for evlist
>       perf evlist: Map backward events to backward_mmap
>       perf evlist: Drop evlist->backward
>       perf evlist: Setup backward mmap state machine
>       perf record: Read from overwritable ring buffer
>       perf evlist: Make {pause,resume} internal helpers
>       perf tools: Enable overwrite settings
>       perf session: Don't warn about out of order event if write_backward is used
>       perf record: Add --tail-synthesize option
> 
>  tools/include/asm-generic/bitsperlong.h  |  23 +--
>  tools/include/linux/compiler.h           |  11 ++
>  tools/lib/api/fd/array.h                 |   1 +
>  tools/lib/api/fs/fs.c                    |   7 +-
>  tools/lib/traceevent/event-parse.c       |   3 +-
>  tools/objtool/Makefile                   |   2 +-
>  tools/objtool/builtin-check.c            |   2 +-
>  tools/perf/Documentation/perf-record.txt |  22 +++
>  tools/perf/builtin-record.c              | 113 ++++++++++---
>  tools/perf/perf.c                        |   2 +-
>  tools/perf/perf.h                        |   2 +
>  tools/perf/tests/backward-ring-buffer.c  |  14 +-
>  tools/perf/util/evlist.c                 | 269 ++++++++++++++++++++++---------
>  tools/perf/util/evlist.h                 |  47 +++++-
>  tools/perf/util/evsel.c                  |  16 +-
>  tools/perf/util/evsel.h                  |   3 +-
>  tools/perf/util/parse-events.c           |  20 ++-
>  tools/perf/util/parse-events.h           |   2 +
>  tools/perf/util/parse-events.l           |   2 +
>  tools/perf/util/session.c                |  22 ++-
>  tools/perf/util/sort.c                   |   8 +-
>  tools/perf/util/util.h                   |   2 +-
>  22 files changed, 441 insertions(+), 152 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2016-07-15 20:50 Arnaldo Carvalho de Melo
  2016-07-16 20:39 ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-07-15 20:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andy Lutomirski, Chris Phlipot, David Ahern, He Kuang,
	H . Peter Anvin, Jiri Olsa, Josh Poimboeuf, Masami Hiramatsu,
	Namhyung Kim, Nilay Vaish, Peter Zijlstra, pi3orama,
	Songshan Gong, Stephen Rothwell, Steven Rostedt, Thomas Gleixner,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

Test results, with a new target: cross-compiling to Android ARM API 24 (NDK r12b),
for all except android-ndk:r12b now objtool is tested too, in adition to tools/perf.

  [root@jouet ~]# 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
  opensuse:13.2: Ok
  opensuse:42.1: Ok
  ubuntu:14.04.4: Ok
  ubuntu:15.10: Ok
  ubuntu:16.04: Ok
  [root@jouet ~]#

oops, the mageia image din't got rebuilt, will fix that, pretty good coverage
even so :-)

- Arnaldo

The following changes since commit b29c6574699dc475da5dbff8db19297b203aacce:

  Merge tag 'perf-core-for-mingo-20160713' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-07-14 08:54:13 +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-20160715

for you to fetch changes up to b49364f36cfdb6d540ac961102d7ffaf84279bb6:

  objtool: Initialize variable to silence old compiler (2016-07-15 17:32:52 -0300)

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

User visible:

- Allow reading from a backward ring buffer (one setup via sys_perf_event_open
  with perf_event_attr.write_backward = 1) (Wang Nan)

Infrastructure:

- Fix the build on Android NDK r12b (initially just for arm), that is now port
  of my perf-build container collection and will get tested prior to sending
  patches upstream (Arnaldo Carvalho de Melo)

- Add correct header for ipv6 defini

- Fix bitsperlong.h fallout (Arnaldo Carvalho de Melo, Peter Zijlstra)

- Use base 0 (auto) in filename__read_ull, so that we can handle hex values too (Jiri Olsa)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (8):
      tools lib traceevent: Add correct header for ipv6 definitions
      perf tools: Do not provide dup sched_getcpu() prototype on Android
      tools: Make "__always_inline" just "inline" on Android
      perf tools: Just pr_debug() about not being able to read cacheline_size
      perf tools: Bail out at "--sort dcacheline" and cacheline_size not known
      perf evlist: Drop redundant evsel->overwrite indicator
      objtool: Add -I$(srctree)/tools/arch/$(ARCH)/include/uapi
      objtool: Initialize variable to silence old compiler

Jiri Olsa (1):
      tools lib api fs: Use base 0 in filename__read_ull

Peter Zijlstra (1):
      tools: Simplify BITS_PER_LONG define

Wang Nan (14):
      tools lib fd array: Allow associating a pointer cookie with each entry
      perf evlist: Update mmap related APIs and helpers
      perf record: Decouple record__mmap_read() and evlist.
      perf evlist: Record mmap cookie into fdarray private field
      perf evlist: Extract common code in mmap failure processing
      perf evlist: Introduce backward_mmap array for evlist
      perf evlist: Map backward events to backward_mmap
      perf evlist: Drop evlist->backward
      perf evlist: Setup backward mmap state machine
      perf record: Read from overwritable ring buffer
      perf evlist: Make {pause,resume} internal helpers
      perf tools: Enable overwrite settings
      perf session: Don't warn about out of order event if write_backward is used
      perf record: Add --tail-synthesize option

 tools/include/asm-generic/bitsperlong.h  |  23 +--
 tools/include/linux/compiler.h           |  11 ++
 tools/lib/api/fd/array.h                 |   1 +
 tools/lib/api/fs/fs.c                    |   7 +-
 tools/lib/traceevent/event-parse.c       |   3 +-
 tools/objtool/Makefile                   |   2 +-
 tools/objtool/builtin-check.c            |   2 +-
 tools/perf/Documentation/perf-record.txt |  22 +++
 tools/perf/builtin-record.c              | 113 ++++++++++---
 tools/perf/perf.c                        |   2 +-
 tools/perf/perf.h                        |   2 +
 tools/perf/tests/backward-ring-buffer.c  |  14 +-
 tools/perf/util/evlist.c                 | 269 ++++++++++++++++++++++---------
 tools/perf/util/evlist.h                 |  47 +++++-
 tools/perf/util/evsel.c                  |  16 +-
 tools/perf/util/evsel.h                  |   3 +-
 tools/perf/util/parse-events.c           |  20 ++-
 tools/perf/util/parse-events.h           |   2 +
 tools/perf/util/parse-events.l           |   2 +
 tools/perf/util/session.c                |  22 ++-
 tools/perf/util/sort.c                   |   8 +-
 tools/perf/util/util.h                   |   2 +-
 22 files changed, 441 insertions(+), 152 deletions(-)

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2016-06-07 23:10 ` Taeung Song
@ 2016-06-08 13:09   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-06-08 13:09 UTC (permalink / raw)
  To: Taeung Song
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, linux-kernel,
	Adrian Hunter, Alexander Shishkin, Andi Kleen, 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

Em Wed, Jun 08, 2016 at 08:10:50AM +0900, Taeung Song escreveu:
> I found something weird about perf/core branch on your repository.
> (I don't know whether it is just my illusion or not)
> 
> I can't pull new commits on top of perf-core-for-mingo-20160606
> by normal way as below

I forgot to push perf/core, having pushed just
perf-core-for-mingo-20160607, which is enough for Ingo to pull what I
sent to him, but not for you to get if you use perf/core, as usual,
instead of perf-core-for-mingo-20160607.

I pushed perf/core now, please update your local repo and all should be
ok now.

- Arnaldo

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2016-06-07 20:04 Arnaldo Carvalho de Melo
  2016-06-07 23:10 ` Taeung Song
@ 2016-06-08  7:43 ` Ingo Molnar
  1 sibling, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2016-06-08  7:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen,
	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, Taeung Song, Wang Nan,
	Zefan Li, Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, this is on top of perf-core-for-mingo-20160606,
> 
> Thanks,
> 
> - Arnaldo
> 
> The following changes since commit 7db91f251056f90fec4121f028680ab3153a0f3c:
> 
>   perf config: Handle the error when config set is NULL at collect_config() (2016-06-06 17:43:19 -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-20160607
> 
> for you to fetch changes up to 057fbfb25cde4a368418f3f720cdc31d48800c4d:
> 
>   perf callchain: Support aarch64 cross-platform (2016-06-07 15:13:35 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Support cross unwinding, i.e. collecting '--call-graph dwarf' perf.data files
>   in one machine and then doing analysis in another machine of a different
>   hardware architecture. This enables, for instance, to do:
> 
> 	perf record -a --call-graph dwarf
> 
>   on a x86-32 or aarch64 system and then do 'perf report' on it on a
>   x86_64 workstation. (He Kuang)
> 
> - Fix crash in build_id_cache__kallsyms_path(), recent regression (Wang Nan)
> 
> Infrastructure:
> 
> - Make tools/lib/bpf use the IS_ERR return facility consistently and also stop
>   using the _get_ term for non-reference count methods (Arnaldo Carvalho de Melo)
> 
> - 'perf config' refactorings (Taeung Song)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (7):
>       tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_private()
>       tools lib bpf: Rename bpf_map__get_name() to bpf_map__name()
>       tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_def()
>       tools lib bpf: Rename bpf_map__get_fd() to bpf_map__fd()
>       tools lib bpf: Remove _get_ from non-refcount method names
>       tools lib bpf: Make bpf_program__get_private() use IS_ERR()
>       tools lib bpf: Rename set_private() to set_priv()
> 
> He Kuang (14):
>       perf unwind: Use LIBUNWIND_DIR for remote libunwind feature check
>       perf unwind: Decouple thread->address_space on libunwind
>       perf unwind: Introduce 'struct unwind_libunwind_ops' for local unwind
>       perf unwind: Move unwind__prepare_access from thread_new into thread__insert_map
>       perf unwind: Don't mix LIBUNWIND_LIBS into LIBUNWIND_LDFLAGS
>       perf unwind: Separate local/remote libunwind config
>       perf unwind: Rename unwind-libunwind.c to unwind-libunwind-local.c
>       perf tools: Extract common API out of unwind-libunwind-local.c
>       perf tools: Export normalize_arch() function
>       perf unwind: Check the target platform before assigning unwind methods
>       perf unwind: Change fixed name of libunwind__arch_reg_id to macro
>       perf unwind: Introduce flag to separate local/remote unwind compilation
>       perf callchain: Support x86 target platform
>       perf callchain: Support aarch64 cross-platform
> 
> Taeung Song (2):
>       perf config: Constructor should free its allocated memory when failing
>       perf config: Use new perf_config_set__init() to initialize config set
> 
> Wang Nan (1):
>       perf tools: Fix crash in build_id_cache__kallsyms_path()
> 
>  tools/lib/bpf/libbpf.c                        |  60 +--
>  tools/lib/bpf/libbpf.h                        |  25 +-
>  tools/perf/arch/arm/util/Build                |   2 +-
>  tools/perf/arch/arm64/util/Build              |   2 +-
>  tools/perf/arch/arm64/util/unwind-libunwind.c |   4 +-
>  tools/perf/arch/common.c                      |   2 +-
>  tools/perf/arch/common.h                      |   1 +
>  tools/perf/arch/x86/util/Build                |   2 +-
>  tools/perf/arch/x86/util/unwind-libunwind.c   |   6 +-
>  tools/perf/config/Makefile                    |  52 +-
>  tools/perf/util/Build                         |   3 +
>  tools/perf/util/bpf-loader.c                  | 132 +++--
>  tools/perf/util/build-id.c                    |  11 +-
>  tools/perf/util/config.c                      |  51 +-
>  tools/perf/util/libunwind/arm64.c             |  35 ++
>  tools/perf/util/libunwind/x86_32.c            |  37 ++
>  tools/perf/util/machine.c                     |  14 +-
>  tools/perf/util/thread.c                      |  13 +-
>  tools/perf/util/thread.h                      |   9 +-
>  tools/perf/util/unwind-libunwind-local.c      | 697 ++++++++++++++++++++++++++
>  tools/perf/util/unwind-libunwind.c            | 688 ++-----------------------
>  tools/perf/util/unwind.h                      |  22 +-
>  22 files changed, 1056 insertions(+), 812 deletions(-)
>  create mode 100644 tools/perf/util/libunwind/arm64.c
>  create mode 100644 tools/perf/util/libunwind/x86_32.c
>  create mode 100644 tools/perf/util/unwind-libunwind-local.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2016-06-07 20:04 Arnaldo Carvalho de Melo
@ 2016-06-07 23:10 ` Taeung Song
  2016-06-08 13:09   ` Arnaldo Carvalho de Melo
  2016-06-08  7:43 ` Ingo Molnar
  1 sibling, 1 reply; 48+ messages in thread
From: Taeung Song @ 2016-06-07 23:10 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
	Adrian Hunter, Alexander Shishkin, Andi Kleen, 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, Arnaldo

I found something weird about perf/core branch on your repository.
(I don't know whether it is just my illusion or not)

I can't pull new commits on top of perf-core-for-mingo-20160606
by normal way as below


# git remote show acme
* remote acme
   Fetch URL: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git


# git log --oneline
edb13ed tools lib bpf: Rename set_private() to set_priv()
be834ff tools lib bpf: Make bpf_program__get_private() use IS_ERR()
...


# git pull acme perf/core
 From git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
  * branch            perf/core  -> FETCH_HEAD
Already up-to-date.


And then nothing changed, I didn't also find new commits
and new tag 'perf-core-for-mingo-20160607'.

However, if using tag perf-core-for-mingo-20160607,
I can get new commits from your repository as below.


# git fetch acme --tags
remote: Counting objects: 4888, done.
remote: Compressing objects: 100% (4800/4800), done.
remote: Total 4888 (delta 266), reused 1212 (delta 59)
Receiving objects: 100% (4888/4888), 21.36 MiB | 3.72 MiB/s, done.
Resolving deltas: 100% (266/266), done.
 From git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
  * [new tag]         perf-core-for-mingo-20160307 -> 
perf-core-for-mingo-20160307
  * [new tag]         perf-core-for-mingo-20160329 -> 
perf-core-for-mingo-20160329
  * [new tag]         perf-core-for-mingo-20160407 -> 
perf-core-for-mingo-20160407
  * [new tag]         perf-core-for-mingo-20160607 -> 
perf-core-for-mingo-20160607
  * [new tag]         perf-ebpf-for-mingo -> perf-ebpf-for-mingo
  * [new tag]         perf-urgent-for-mingo-20160510 -> 
perf-urgent-for-mingo-20160510
  * [new tag]         v2.6.11    -> v2.6.11
  * [new tag]         v2.6.11-tree -> v2.6.11-tree


But there is a strange thing about git branch.
I can't find which branch is that have tag perf-core-for-mingo-20160607 
like below.


# git branch -a --contains perf-core-for-mingo-20160607


As the final outcome, I got new commits on top of 
perf-core-for-mingo-20160606 directly using a tag 
'perf-core-for-mingo-20160607' as below.


# git reset --hard perf-core-for-mingo-20160607
HEAD is now at 057fbfb perf callchain: Support aarch64 cross-platform


But isn't it a problem ?
Just use a tag?


Thanks,
Taeung

On 06/08/2016 05:04 AM, Arnaldo Carvalho de Melo wrote:
> Hi Ingo,
>
> 	Please consider pulling, this is on top of perf-core-for-mingo-20160606,
>
> Thanks,
>
> - Arnaldo
>
> The following changes since commit 7db91f251056f90fec4121f028680ab3153a0f3c:
>
>    perf config: Handle the error when config set is NULL at collect_config() (2016-06-06 17:43:19 -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-20160607
>
> for you to fetch changes up to 057fbfb25cde4a368418f3f720cdc31d48800c4d:
>
>    perf callchain: Support aarch64 cross-platform (2016-06-07 15:13:35 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> User visible:
>
> - Support cross unwinding, i.e. collecting '--call-graph dwarf' perf.data files
>    in one machine and then doing analysis in another machine of a different
>    hardware architecture. This enables, for instance, to do:
>
> 	perf record -a --call-graph dwarf
>
>    on a x86-32 or aarch64 system and then do 'perf report' on it on a
>    x86_64 workstation. (He Kuang)
>
> - Fix crash in build_id_cache__kallsyms_path(), recent regression (Wang Nan)
>
> Infrastructure:
>
> - Make tools/lib/bpf use the IS_ERR return facility consistently and also stop
>    using the _get_ term for non-reference count methods (Arnaldo Carvalho de Melo)
>
> - 'perf config' refactorings (Taeung Song)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (7):
>        tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_private()
>        tools lib bpf: Rename bpf_map__get_name() to bpf_map__name()
>        tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_def()
>        tools lib bpf: Rename bpf_map__get_fd() to bpf_map__fd()
>        tools lib bpf: Remove _get_ from non-refcount method names
>        tools lib bpf: Make bpf_program__get_private() use IS_ERR()
>        tools lib bpf: Rename set_private() to set_priv()
>
> He Kuang (14):
>        perf unwind: Use LIBUNWIND_DIR for remote libunwind feature check
>        perf unwind: Decouple thread->address_space on libunwind
>        perf unwind: Introduce 'struct unwind_libunwind_ops' for local unwind
>        perf unwind: Move unwind__prepare_access from thread_new into thread__insert_map
>        perf unwind: Don't mix LIBUNWIND_LIBS into LIBUNWIND_LDFLAGS
>        perf unwind: Separate local/remote libunwind config
>        perf unwind: Rename unwind-libunwind.c to unwind-libunwind-local.c
>        perf tools: Extract common API out of unwind-libunwind-local.c
>        perf tools: Export normalize_arch() function
>        perf unwind: Check the target platform before assigning unwind methods
>        perf unwind: Change fixed name of libunwind__arch_reg_id to macro
>        perf unwind: Introduce flag to separate local/remote unwind compilation
>        perf callchain: Support x86 target platform
>        perf callchain: Support aarch64 cross-platform
>
> Taeung Song (2):
>        perf config: Constructor should free its allocated memory when failing
>        perf config: Use new perf_config_set__init() to initialize config set
>
> Wang Nan (1):
>        perf tools: Fix crash in build_id_cache__kallsyms_path()
>
>   tools/lib/bpf/libbpf.c                        |  60 +--
>   tools/lib/bpf/libbpf.h                        |  25 +-
>   tools/perf/arch/arm/util/Build                |   2 +-
>   tools/perf/arch/arm64/util/Build              |   2 +-
>   tools/perf/arch/arm64/util/unwind-libunwind.c |   4 +-
>   tools/perf/arch/common.c                      |   2 +-
>   tools/perf/arch/common.h                      |   1 +
>   tools/perf/arch/x86/util/Build                |   2 +-
>   tools/perf/arch/x86/util/unwind-libunwind.c   |   6 +-
>   tools/perf/config/Makefile                    |  52 +-
>   tools/perf/util/Build                         |   3 +
>   tools/perf/util/bpf-loader.c                  | 132 +++--
>   tools/perf/util/build-id.c                    |  11 +-
>   tools/perf/util/config.c                      |  51 +-
>   tools/perf/util/libunwind/arm64.c             |  35 ++
>   tools/perf/util/libunwind/x86_32.c            |  37 ++
>   tools/perf/util/machine.c                     |  14 +-
>   tools/perf/util/thread.c                      |  13 +-
>   tools/perf/util/thread.h                      |   9 +-
>   tools/perf/util/unwind-libunwind-local.c      | 697 ++++++++++++++++++++++++++
>   tools/perf/util/unwind-libunwind.c            | 688 ++-----------------------
>   tools/perf/util/unwind.h                      |  22 +-
>   22 files changed, 1056 insertions(+), 812 deletions(-)
>   create mode 100644 tools/perf/util/libunwind/arm64.c
>   create mode 100644 tools/perf/util/libunwind/x86_32.c
>   create mode 100644 tools/perf/util/unwind-libunwind-local.c
>

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2016-06-07 20:04 Arnaldo Carvalho de Melo
  2016-06-07 23:10 ` Taeung Song
  2016-06-08  7:43 ` Ingo Molnar
  0 siblings, 2 replies; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-06-07 20:04 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Andi Kleen, 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, Taeung Song,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling, this is on top of perf-core-for-mingo-20160606,

Thanks,

- Arnaldo

The following changes since commit 7db91f251056f90fec4121f028680ab3153a0f3c:

  perf config: Handle the error when config set is NULL at collect_config() (2016-06-06 17:43:19 -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-20160607

for you to fetch changes up to 057fbfb25cde4a368418f3f720cdc31d48800c4d:

  perf callchain: Support aarch64 cross-platform (2016-06-07 15:13:35 -0300)

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

User visible:

- Support cross unwinding, i.e. collecting '--call-graph dwarf' perf.data files
  in one machine and then doing analysis in another machine of a different
  hardware architecture. This enables, for instance, to do:

	perf record -a --call-graph dwarf

  on a x86-32 or aarch64 system and then do 'perf report' on it on a
  x86_64 workstation. (He Kuang)

- Fix crash in build_id_cache__kallsyms_path(), recent regression (Wang Nan)

Infrastructure:

- Make tools/lib/bpf use the IS_ERR return facility consistently and also stop
  using the _get_ term for non-reference count methods (Arnaldo Carvalho de Melo)

- 'perf config' refactorings (Taeung Song)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (7):
      tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_private()
      tools lib bpf: Rename bpf_map__get_name() to bpf_map__name()
      tools lib bpf: Use IS_ERR() reporting macros with bpf_map__get_def()
      tools lib bpf: Rename bpf_map__get_fd() to bpf_map__fd()
      tools lib bpf: Remove _get_ from non-refcount method names
      tools lib bpf: Make bpf_program__get_private() use IS_ERR()
      tools lib bpf: Rename set_private() to set_priv()

He Kuang (14):
      perf unwind: Use LIBUNWIND_DIR for remote libunwind feature check
      perf unwind: Decouple thread->address_space on libunwind
      perf unwind: Introduce 'struct unwind_libunwind_ops' for local unwind
      perf unwind: Move unwind__prepare_access from thread_new into thread__insert_map
      perf unwind: Don't mix LIBUNWIND_LIBS into LIBUNWIND_LDFLAGS
      perf unwind: Separate local/remote libunwind config
      perf unwind: Rename unwind-libunwind.c to unwind-libunwind-local.c
      perf tools: Extract common API out of unwind-libunwind-local.c
      perf tools: Export normalize_arch() function
      perf unwind: Check the target platform before assigning unwind methods
      perf unwind: Change fixed name of libunwind__arch_reg_id to macro
      perf unwind: Introduce flag to separate local/remote unwind compilation
      perf callchain: Support x86 target platform
      perf callchain: Support aarch64 cross-platform

Taeung Song (2):
      perf config: Constructor should free its allocated memory when failing
      perf config: Use new perf_config_set__init() to initialize config set

Wang Nan (1):
      perf tools: Fix crash in build_id_cache__kallsyms_path()

 tools/lib/bpf/libbpf.c                        |  60 +--
 tools/lib/bpf/libbpf.h                        |  25 +-
 tools/perf/arch/arm/util/Build                |   2 +-
 tools/perf/arch/arm64/util/Build              |   2 +-
 tools/perf/arch/arm64/util/unwind-libunwind.c |   4 +-
 tools/perf/arch/common.c                      |   2 +-
 tools/perf/arch/common.h                      |   1 +
 tools/perf/arch/x86/util/Build                |   2 +-
 tools/perf/arch/x86/util/unwind-libunwind.c   |   6 +-
 tools/perf/config/Makefile                    |  52 +-
 tools/perf/util/Build                         |   3 +
 tools/perf/util/bpf-loader.c                  | 132 +++--
 tools/perf/util/build-id.c                    |  11 +-
 tools/perf/util/config.c                      |  51 +-
 tools/perf/util/libunwind/arm64.c             |  35 ++
 tools/perf/util/libunwind/x86_32.c            |  37 ++
 tools/perf/util/machine.c                     |  14 +-
 tools/perf/util/thread.c                      |  13 +-
 tools/perf/util/thread.h                      |   9 +-
 tools/perf/util/unwind-libunwind-local.c      | 697 ++++++++++++++++++++++++++
 tools/perf/util/unwind-libunwind.c            | 688 ++-----------------------
 tools/perf/util/unwind.h                      |  22 +-
 22 files changed, 1056 insertions(+), 812 deletions(-)
 create mode 100644 tools/perf/util/libunwind/arm64.c
 create mode 100644 tools/perf/util/libunwind/x86_32.c
 create mode 100644 tools/perf/util/unwind-libunwind-local.c

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2015-06-26 15:44 Arnaldo Carvalho de Melo
@ 2015-06-30  4:48 ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2015-06-30  4:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Flavio Leitner, Frederic Weisbecker, Jiri Olsa, Li Zhang,
	Namhyung Kim, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu


* 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 6eedf416429a32e0216f61b8b690d25577b2b91e:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2015-06-26 10:38:11 +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 36c8bb56a9f718a9a5f35d1834ca9dcec95deb4a:
> 
>   perf symbols: Check access permission when reading symbol files (2015-06-26 12:11:53 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Validate syscall list passed via -e argument to 'perf trace' (Arnaldo Carvalho de Melo)
> 
> - Introduce 'perf stat --per-thread' (Jiri Olsa)
> 
> - Check access permission for --kallsyms and --vmlinux (Li Zhang)
> 
> Infrastructure:
> 
> - Move stuff out of 'perf stat' and into the lib for further use (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       perf trace: Validate syscall list passed via -e argument
> 
> Jiri Olsa (22):
>       perf thread_map: Introduce thread_map__reset function
>       perf thrad_map: Add comm string into array
>       perf tests: Add thread_map object tests
>       perf stat: Introduce perf_counts function
>       perf stat: Use xyarray for cpu evsel counts
>       perf stat: Make stats work over the thread dimension
>       perf stat: Rename struct perf_counts::cpu member to values
>       perf stat: Introduce perf_evlist__reset_stats
>       perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat object
>       perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat object
>       perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object
>       perf stat: Introduce perf_evsel__alloc_stats function
>       perf stat: Introduce perf_evsel__read function
>       perf stat: Introduce read_counters function
>       perf stat: Separate counters reading and processing
>       perf stat: Move zero_per_pkg into counter process code
>       perf stat: Move perf_stat initialization counter process code
>       perf stat: Remove perf_evsel__read_cb function
>       perf stat: Rename print_interval to process_interval
>       perf stat: Using init_stats instead of memset
>       perf stat: Introduce print_counters function
>       perf stat: Introduce --per-thread option
> 
> Li Zhang (1):
>       perf symbols: Check access permission when reading symbol files
> 
>  tools/perf/Documentation/perf-stat.txt     |   4 +
>  tools/perf/builtin-report.c                |  11 +
>  tools/perf/builtin-stat.c                  | 402 +++++++++++++++--------------
>  tools/perf/builtin-trace.c                 |  32 +++
>  tools/perf/tests/Build                     |   1 +
>  tools/perf/tests/builtin-test.c            |   4 +
>  tools/perf/tests/openat-syscall-all-cpus.c |   6 +-
>  tools/perf/tests/openat-syscall.c          |   4 +-
>  tools/perf/tests/tests.h                   |   1 +
>  tools/perf/tests/thread-map.c              |  38 +++
>  tools/perf/util/evlist.h                   |   1 -
>  tools/perf/util/evsel.c                    |  24 +-
>  tools/perf/util/evsel.h                    |  28 +-
>  tools/perf/util/python-ext-sources         |   1 +
>  tools/perf/util/stat.c                     | 132 +++++++++-
>  tools/perf/util/stat.h                     |  47 +++-
>  tools/perf/util/symbol.c                   |   5 +-
>  tools/perf/util/thread_map.c               |  76 +++++-
>  tools/perf/util/thread_map.h               |   8 +
>  19 files changed, 570 insertions(+), 255 deletions(-)
>  create mode 100644 tools/perf/tests/thread-map.c

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2015-06-26 15:44 Arnaldo Carvalho de Melo
  2015-06-30  4:48 ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-26 15:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, Don Zickus,
	Flavio Leitner, Frederic Weisbecker, Jiri Olsa, Li Zhang,
	Namhyung Kim, Peter Zijlstra, Stephane Eranian,
	Sukadev Bhattiprolu

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

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 6eedf416429a32e0216f61b8b690d25577b2b91e:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2015-06-26 10:38:11 +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 36c8bb56a9f718a9a5f35d1834ca9dcec95deb4a:

  perf symbols: Check access permission when reading symbol files (2015-06-26 12:11:53 -0300)

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

User visible:

- Validate syscall list passed via -e argument to 'perf trace' (Arnaldo Carvalho de Melo)

- Introduce 'perf stat --per-thread' (Jiri Olsa)

- Check access permission for --kallsyms and --vmlinux (Li Zhang)

Infrastructure:

- Move stuff out of 'perf stat' and into the lib for further use (Jiri Olsa)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      perf trace: Validate syscall list passed via -e argument

Jiri Olsa (22):
      perf thread_map: Introduce thread_map__reset function
      perf thrad_map: Add comm string into array
      perf tests: Add thread_map object tests
      perf stat: Introduce perf_counts function
      perf stat: Use xyarray for cpu evsel counts
      perf stat: Make stats work over the thread dimension
      perf stat: Rename struct perf_counts::cpu member to values
      perf stat: Introduce perf_evlist__reset_stats
      perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat object
      perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat object
      perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object
      perf stat: Introduce perf_evsel__alloc_stats function
      perf stat: Introduce perf_evsel__read function
      perf stat: Introduce read_counters function
      perf stat: Separate counters reading and processing
      perf stat: Move zero_per_pkg into counter process code
      perf stat: Move perf_stat initialization counter process code
      perf stat: Remove perf_evsel__read_cb function
      perf stat: Rename print_interval to process_interval
      perf stat: Using init_stats instead of memset
      perf stat: Introduce print_counters function
      perf stat: Introduce --per-thread option

Li Zhang (1):
      perf symbols: Check access permission when reading symbol files

 tools/perf/Documentation/perf-stat.txt     |   4 +
 tools/perf/builtin-report.c                |  11 +
 tools/perf/builtin-stat.c                  | 402 +++++++++++++++--------------
 tools/perf/builtin-trace.c                 |  32 +++
 tools/perf/tests/Build                     |   1 +
 tools/perf/tests/builtin-test.c            |   4 +
 tools/perf/tests/openat-syscall-all-cpus.c |   6 +-
 tools/perf/tests/openat-syscall.c          |   4 +-
 tools/perf/tests/tests.h                   |   1 +
 tools/perf/tests/thread-map.c              |  38 +++
 tools/perf/util/evlist.h                   |   1 -
 tools/perf/util/evsel.c                    |  24 +-
 tools/perf/util/evsel.h                    |  28 +-
 tools/perf/util/python-ext-sources         |   1 +
 tools/perf/util/stat.c                     | 132 +++++++++-
 tools/perf/util/stat.h                     |  47 +++-
 tools/perf/util/symbol.c                   |   5 +-
 tools/perf/util/thread_map.c               |  76 +++++-
 tools/perf/util/thread_map.h               |   8 +
 19 files changed, 570 insertions(+), 255 deletions(-)
 create mode 100644 tools/perf/tests/thread-map.c

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2014-10-14 21:04 Arnaldo Carvalho de Melo
@ 2014-10-15  9:56 ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2014-10-15  9:56 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Borislav Petkov, Chuck Ebbert,
	Corey Ashford, David Ahern, Don Zickus, Douglas Hatch,
	Frederic Weisbecker, Jean Pihet, Jiri Olsa, Mike Galbraith,
	Milian Wolff, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Scott J Norton, Stephane Eranian, Waiman Long,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit cc6cd47e7395bc05c5077009808b820633eb3f18:
> 
>   perf/x86: Tone down kernel messages when the PMU check fails in a virtual environment (2014-10-03 06:04:41 +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 2c241bd35e6f626ad6f867dcf9fefdc2315f125f:
> 
>   perf symbols: Make sym->end be the first address after the symbol range (2014-10-14 17:50:58 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> Infrastructure:
> 
> . Do not include a struct hists per perf_evsel, untangling the histogram code
>   from perf_evsel, to pave the way for exporting a minimalistic
>   tools/lib/api/perf/ library usable by tools/perf and initially by the rasd
>   daemon being developed by Borislav Petkov, Robert Richter and Jean Pihet.
>   (Arnaldo Carvalho de Melo)
> 
> . Make perf_evlist__open(evlist, NULL, NULL), i.e. without cpu and thread
>   maps mean syswide monitoring, reducing the boilerplate for tools that
>   only want system wide mode. (Arnaldo Carvalho de Melo)
> 
> . Fix off-by-one bugs in map->end handling (Stephane Eranian)
> 
> . Fix off-by-one bug in maps__find(), also related to map->end handling (Namhyung Kim)
> 
> . Make struct symbol->end be the first addr after the symbol range, to make it
>   match the convention used for struct map->end. (Arnaldo Carvalho de Melo)
> 
> . Fix perf_evlist__add_pollfd() error handling in 'perf kvm stat live' (Jiri Olsa)
> 
> . Fix python test build by moving callchain_param to an object linked into the
>   python binding (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (18):
>       perf sched: Stop updating hists stats, not used
>       perf script: Stop updating hists stats, not used
>       perf evsel: Add hists helper
>       perf session: Don't count per evsel events
>       perf tools: Move events_stats struct to event.h
>       perf ui browsers: Add missing include
>       perf session: Remove last reference to hists struct
>       perf evsel: Subclassing
>       perf callchain: Move the callchain_param extern to callchain.h
>       perf tools: Remove hists from evsel
>       perf thread_map: Create dummy constructor out of open coded equivalent
>       perf evlist: Check that there is a thread_map when preparing a workload
>       perf evlist: Default to syswide target when no thread/cpu maps set
>       perf evsel: Add missing 'target' struct forward declaration
>       perf evsel: Make some exit routines static
>       perf machine: Add missing dsos->root rbtree root initialization
>       perf symbols: Fix map->end fixup
>       perf symbols: Make sym->end be the first address after the symbol range
> 
> Jiri Olsa (4):
>       perf kvm stat live: Fix perf_evlist__add_pollfd error handling
>       perf kvm stat live: Use perf_evlist__add_pollfd return fd position
>       perf kvm stat live: Use fdarray object instead of pollfd
>       perf callchain: Move callchain_param to util object in to fix python test
> 
> Namhyung Kim (1):
>       perf tools: Fixup off-by-one comparision in maps__find
> 
> Stephane Eranian (1):
>       perf tools: fix off-by-one error in maps
> 
>  tools/perf/builtin-annotate.c                      | 14 +++--
>  tools/perf/builtin-diff.c                          | 21 ++++---
>  tools/perf/builtin-kvm.c                           | 22 +++----
>  tools/perf/builtin-record.c                        |  1 +
>  tools/perf/builtin-report.c                        | 24 ++++---
>  tools/perf/builtin-sched.c                         |  3 -
>  tools/perf/builtin-script.c                        |  1 -
>  tools/perf/builtin-top.c                           | 60 ++++++++++--------
>  tools/perf/tests/builtin-test.c                    |  5 ++
>  tools/perf/tests/hists_cumulate.c                  |  8 +--
>  tools/perf/tests/hists_filter.c                    | 23 +++----
>  tools/perf/tests/hists_link.c                      | 23 ++++---
>  tools/perf/tests/hists_output.c                    | 20 +++---
>  tools/perf/ui/browsers/header.c                    |  1 +
>  tools/perf/ui/browsers/hists.c                     | 20 +++---
>  tools/perf/ui/gtk/hists.c                          |  2 +-
>  tools/perf/util/annotate.c                         |  8 +--
>  tools/perf/util/callchain.h                        |  2 +
>  tools/perf/util/event.h                            | 26 ++++++++
>  tools/perf/util/evlist.c                           | 48 +++++++++++++-
>  tools/perf/util/evsel.c                            | 66 ++++++++++++++-----
>  tools/perf/util/evsel.h                            | 14 ++---
>  tools/perf/util/hist.c                             | 73 +++++++++++++++++-----
>  tools/perf/util/hist.h                             | 49 +++++++--------
>  tools/perf/util/machine.c                          | 10 ++-
>  tools/perf/util/map.c                              |  8 +--
>  .../util/scripting-engines/trace-event-python.c    |  1 +
>  tools/perf/util/session.c                          | 23 -------
>  tools/perf/util/session.h                          |  1 -
>  tools/perf/util/sort.c                             |  4 +-
>  tools/perf/util/symbol.c                           |  8 +--
>  tools/perf/util/symbol.h                           |  2 +-
>  tools/perf/util/thread_map.c                       | 21 ++++---
>  tools/perf/util/thread_map.h                       |  1 +
>  tools/perf/util/util.c                             |  8 +++
>  35 files changed, 392 insertions(+), 229 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2014-10-14 21:04 Arnaldo Carvalho de Melo
  2014-10-15  9:56 ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-10-14 21:04 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, Chuck Ebbert, Corey Ashford, David Ahern,
	Don Zickus, Douglas Hatch, Frederic Weisbecker, Jean Pihet,
	Jiri Olsa, Mike Galbraith, Milian Wolff, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Scott J Norton, Stephane Eranian,
	Waiman Long, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit cc6cd47e7395bc05c5077009808b820633eb3f18:

  perf/x86: Tone down kernel messages when the PMU check fails in a virtual environment (2014-10-03 06:04:41 +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 2c241bd35e6f626ad6f867dcf9fefdc2315f125f:

  perf symbols: Make sym->end be the first address after the symbol range (2014-10-14 17:50:58 -0300)

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

Infrastructure:

. Do not include a struct hists per perf_evsel, untangling the histogram code
  from perf_evsel, to pave the way for exporting a minimalistic
  tools/lib/api/perf/ library usable by tools/perf and initially by the rasd
  daemon being developed by Borislav Petkov, Robert Richter and Jean Pihet.
  (Arnaldo Carvalho de Melo)

. Make perf_evlist__open(evlist, NULL, NULL), i.e. without cpu and thread
  maps mean syswide monitoring, reducing the boilerplate for tools that
  only want system wide mode. (Arnaldo Carvalho de Melo)

. Fix off-by-one bugs in map->end handling (Stephane Eranian)

. Fix off-by-one bug in maps__find(), also related to map->end handling (Namhyung Kim)

. Make struct symbol->end be the first addr after the symbol range, to make it
  match the convention used for struct map->end. (Arnaldo Carvalho de Melo)

. Fix perf_evlist__add_pollfd() error handling in 'perf kvm stat live' (Jiri Olsa)

. Fix python test build by moving callchain_param to an object linked into the
  python binding (Jiri Olsa)

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (18):
      perf sched: Stop updating hists stats, not used
      perf script: Stop updating hists stats, not used
      perf evsel: Add hists helper
      perf session: Don't count per evsel events
      perf tools: Move events_stats struct to event.h
      perf ui browsers: Add missing include
      perf session: Remove last reference to hists struct
      perf evsel: Subclassing
      perf callchain: Move the callchain_param extern to callchain.h
      perf tools: Remove hists from evsel
      perf thread_map: Create dummy constructor out of open coded equivalent
      perf evlist: Check that there is a thread_map when preparing a workload
      perf evlist: Default to syswide target when no thread/cpu maps set
      perf evsel: Add missing 'target' struct forward declaration
      perf evsel: Make some exit routines static
      perf machine: Add missing dsos->root rbtree root initialization
      perf symbols: Fix map->end fixup
      perf symbols: Make sym->end be the first address after the symbol range

Jiri Olsa (4):
      perf kvm stat live: Fix perf_evlist__add_pollfd error handling
      perf kvm stat live: Use perf_evlist__add_pollfd return fd position
      perf kvm stat live: Use fdarray object instead of pollfd
      perf callchain: Move callchain_param to util object in to fix python test

Namhyung Kim (1):
      perf tools: Fixup off-by-one comparision in maps__find

Stephane Eranian (1):
      perf tools: fix off-by-one error in maps

 tools/perf/builtin-annotate.c                      | 14 +++--
 tools/perf/builtin-diff.c                          | 21 ++++---
 tools/perf/builtin-kvm.c                           | 22 +++----
 tools/perf/builtin-record.c                        |  1 +
 tools/perf/builtin-report.c                        | 24 ++++---
 tools/perf/builtin-sched.c                         |  3 -
 tools/perf/builtin-script.c                        |  1 -
 tools/perf/builtin-top.c                           | 60 ++++++++++--------
 tools/perf/tests/builtin-test.c                    |  5 ++
 tools/perf/tests/hists_cumulate.c                  |  8 +--
 tools/perf/tests/hists_filter.c                    | 23 +++----
 tools/perf/tests/hists_link.c                      | 23 ++++---
 tools/perf/tests/hists_output.c                    | 20 +++---
 tools/perf/ui/browsers/header.c                    |  1 +
 tools/perf/ui/browsers/hists.c                     | 20 +++---
 tools/perf/ui/gtk/hists.c                          |  2 +-
 tools/perf/util/annotate.c                         |  8 +--
 tools/perf/util/callchain.h                        |  2 +
 tools/perf/util/event.h                            | 26 ++++++++
 tools/perf/util/evlist.c                           | 48 +++++++++++++-
 tools/perf/util/evsel.c                            | 66 ++++++++++++++-----
 tools/perf/util/evsel.h                            | 14 ++---
 tools/perf/util/hist.c                             | 73 +++++++++++++++++-----
 tools/perf/util/hist.h                             | 49 +++++++--------
 tools/perf/util/machine.c                          | 10 ++-
 tools/perf/util/map.c                              |  8 +--
 .../util/scripting-engines/trace-event-python.c    |  1 +
 tools/perf/util/session.c                          | 23 -------
 tools/perf/util/session.h                          |  1 -
 tools/perf/util/sort.c                             |  4 +-
 tools/perf/util/symbol.c                           |  8 +--
 tools/perf/util/symbol.h                           |  2 +-
 tools/perf/util/thread_map.c                       | 21 ++++---
 tools/perf/util/thread_map.h                       |  1 +
 tools/perf/util/util.c                             |  8 +++
 35 files changed, 392 insertions(+), 229 deletions(-)

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2012-08-21  9:32 ` Ingo Molnar
@ 2012-08-21  9:36   ` Jiri Olsa
  0 siblings, 0 replies; 48+ messages in thread
From: Jiri Olsa @ 2012-08-21  9:36 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Andi Kleen,
	Ben Hutchings, Borislav Petkov, Corey Ashford, David Ahern,
	Feng Tang, Frederic Weisbecker, Mike Galbraith, Namhyung Kim,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
	Peter Zijlstra, Robert Richter, Sedat Dilek, Stephane Eranian,
	Steven Rostedt, Thomas Gleixner, Ulrich Drepper, arnaldo.melo,
	Arnaldo Carvalho de Melo

On Tue, Aug 21, 2012 at 11:32:31AM +0200, Ingo Molnar wrote:
> 
> * Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> 

SNIP

> 
> One minor observation, the Makefile tells us:
> 
> Makefile:496: No libunwind found. Please install libunwind >= 0.99
> 
> I guess that should be libunwind-dev[el], right? Plain libunwind 
> is not enough.

right, will fix it

thanks,
jirka

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

* Re: [GIT PULL 00/24] perf/core improvements and fixes
  2012-08-20 16:26 Arnaldo Carvalho de Melo
@ 2012-08-21  9:32 ` Ingo Molnar
  2012-08-21  9:36   ` Jiri Olsa
  0 siblings, 1 reply; 48+ messages in thread
From: Ingo Molnar @ 2012-08-21  9:32 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Andi Kleen, Ben Hutchings, Borislav Petkov,
	Corey Ashford, David Ahern, Feng Tang, Frederic Weisbecker,
	Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim,
	Namhyung Kim, Paul Mackerras, Pekka Enberg, Peter Zijlstra,
	Robert Richter, Sedat Dilek, Stephane Eranian, Steven Rostedt,
	Thomas Gleixner, Ulrich Drepper, arnaldo.melo,
	Arnaldo Carvalho de Melo


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

> Hi Ingo,
> 
> 	Please consider pulling, this is on top of my previous pull requests,
> 
> - Arnaldo
> 
> The following changes since commit 0fe7d7e9761ec7e23350b5543ddac470bb3cde1e:
> 
>   perf symbols: Add description of JIT interface (2012-08-13 14:55:02 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 000078bc3ee69efb1124b8478c7527389a826074:
> 
>   perf hists: Rename and move some functions (2012-08-20 09:47:31 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
>  . Fix include order for bison/flex-generated C files, from Ben Hutchings
> 
>  . Build fixes and documentation corrections from David Ahern
> 
>  . Group parsing support, from Jiri Olsa
> 
>  . UI/gtk refactorings and improvements from Namhyung Kim
> 
>  . NULL deref fix for perf script, from Namhyung Kim
> 
>  . Assorted cleanups from Robert Richter
> 
>  . Let O= makes handle relative paths, from Steven Rostedt
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (3):
>       perf tools: Add missing files to build the python binding
>       perf evlist: Rename __group method to __set_leader
>       perf evlist: Introduce evsel list accessors
> 
> Ben Hutchings (1):
>       perf tools: Fix include order for bison/flex-generated C files
> 
> David Ahern (3):
>       perf script perl/python: Fix libexec scripts path in Documentation
>       perf: silence GTK2 probing errors
>       perf symbols: Fix builds with NO_LIBELF set
> 
> Jiri Olsa (4):
>       perf tools: Add support to parse event group syntax
>       perf tools: Add support to update event modifier
>       perf tools: Enable grouping logic for parsed events
>       perf test: Add automated tests for event group parsing
> 
> Namhyung Kim (8):
>       perf script: Fix a NULL pointer dereference
>       perf ui: Introduce struct ui_helpline
>       perf ui gtk: Implement helpline_fns
>       perf ui/gtk: Use helpline API in browser
>       perf ui gtk: Add perf_gtk__show_helpline() for pr_*
>       perf ui gtk: Ensure not to call gtk_main_quit() twice
>       perf hists: Separate out hist print functions
>       perf hists: Rename and move some functions
> 
> Robert Richter (4):
>       perf tools: Fix type for evsel->ids and add size check for ids
>       perf tools: Report number of pmu type of unknown events
>       perf tools: Rename some variables for better understanding
>       perf tools: Rename global variable 'events' in util/header.c
> 
> Steven Rostedt (1):
>       perf tools: Let O= makes handle relative paths
> 
>  tools/perf/Documentation/perf-script-perl.txt   |    4 +-
>  tools/perf/Documentation/perf-script-python.txt |   10 +-
>  tools/perf/Makefile                             |   20 +-
>  tools/perf/builtin-record.c                     |   17 +-
>  tools/perf/builtin-stat.c                       |   15 +-
>  tools/perf/builtin-test.c                       |   10 +-
>  tools/perf/builtin-top.c                        |   18 +-
>  tools/perf/ui/browsers/hists.c                  |    4 +-
>  tools/perf/ui/gtk/browser.c                     |    5 +-
>  tools/perf/ui/gtk/gtk.h                         |    2 +
>  tools/perf/ui/gtk/helpline.c                    |   56 ++
>  tools/perf/ui/gtk/setup.c                       |    3 +
>  tools/perf/ui/gtk/util.c                        |    5 -
>  tools/perf/ui/helpline.c                        |   56 +-
>  tools/perf/ui/helpline.h                        |   33 +-
>  tools/perf/ui/setup.c                           |    4 +
>  tools/perf/ui/stdio/hist.c                      |  653 ++++++++++++++++++++++
>  tools/perf/ui/tui/helpline.c                    |   57 ++
>  tools/perf/ui/tui/setup.c                       |    2 -
>  tools/perf/util/debug.c                         |    4 +-
>  tools/perf/util/debug.h                         |    8 +-
>  tools/perf/util/evlist.c                        |   73 +--
>  tools/perf/util/evlist.h                        |   27 +-
>  tools/perf/util/evsel.c                         |   52 +-
>  tools/perf/util/evsel.h                         |   20 +-
>  tools/perf/util/header.c                        |   97 ++--
>  tools/perf/util/header.h                        |    2 +-
>  tools/perf/util/hist.c                          |  677 +----------------------
>  tools/perf/util/hist.h                          |    6 +-
>  tools/perf/util/parse-events-test.c             |  387 ++++++++++---
>  tools/perf/util/parse-events.c                  |   93 +++-
>  tools/perf/util/parse-events.h                  |    4 +-
>  tools/perf/util/parse-events.l                  |    2 +
>  tools/perf/util/parse-events.y                  |   93 +++-
>  tools/perf/util/python-ext-sources              |    2 +
>  tools/perf/util/python.c                        |    7 +-
>  tools/perf/util/symbol-elf.c                    |    3 +
>  tools/perf/util/symbol.c                        |    2 +-
>  tools/perf/util/top.c                           |    3 +-
>  tools/perf/util/trace-event-parse.c             |    2 +-
>  tools/scripts/Makefile.include                  |    6 +-
>  41 files changed, 1560 insertions(+), 984 deletions(-)
>  create mode 100644 tools/perf/ui/gtk/helpline.c
>  create mode 100644 tools/perf/ui/stdio/hist.c
>  create mode 100644 tools/perf/ui/tui/helpline.c

Pulled this and the previous two pull requests, thanks a lot 
Arnaldo!

One minor observation, the Makefile tells us:

Makefile:496: No libunwind found. Please install libunwind >= 0.99

I guess that should be libunwind-dev[el], right? Plain libunwind 
is not enough.

Thanks,

	Ingo

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

* [GIT PULL 00/24] perf/core improvements and fixes
@ 2012-08-20 16:26 Arnaldo Carvalho de Melo
  2012-08-21  9:32 ` Ingo Molnar
  0 siblings, 1 reply; 48+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-08-20 16:26 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen,
	Ben Hutchings, Borislav Petkov, Corey Ashford, David Ahern,
	Feng Tang, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
	Namhyung Kim, Namhyung Kim, Namhyung Kim, Paul Mackerras,
	Pekka Enberg, Peter Zijlstra, Robert Richter, Sedat Dilek,
	Stephane Eranian, Steven Rostedt, Thomas Gleixner,
	Ulrich Drepper, arnaldo.melo, Arnaldo Carvalho de Melo

Hi Ingo,

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

- Arnaldo

The following changes since commit 0fe7d7e9761ec7e23350b5543ddac470bb3cde1e:

  perf symbols: Add description of JIT interface (2012-08-13 14:55:02 -0300)

are available in the git repository at:

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

for you to fetch changes up to 000078bc3ee69efb1124b8478c7527389a826074:

  perf hists: Rename and move some functions (2012-08-20 09:47:31 -0300)

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

 . Fix include order for bison/flex-generated C files, from Ben Hutchings

 . Build fixes and documentation corrections from David Ahern

 . Group parsing support, from Jiri Olsa

 . UI/gtk refactorings and improvements from Namhyung Kim

 . NULL deref fix for perf script, from Namhyung Kim

 . Assorted cleanups from Robert Richter

 . Let O= makes handle relative paths, from Steven Rostedt

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

----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
      perf tools: Add missing files to build the python binding
      perf evlist: Rename __group method to __set_leader
      perf evlist: Introduce evsel list accessors

Ben Hutchings (1):
      perf tools: Fix include order for bison/flex-generated C files

David Ahern (3):
      perf script perl/python: Fix libexec scripts path in Documentation
      perf: silence GTK2 probing errors
      perf symbols: Fix builds with NO_LIBELF set

Jiri Olsa (4):
      perf tools: Add support to parse event group syntax
      perf tools: Add support to update event modifier
      perf tools: Enable grouping logic for parsed events
      perf test: Add automated tests for event group parsing

Namhyung Kim (8):
      perf script: Fix a NULL pointer dereference
      perf ui: Introduce struct ui_helpline
      perf ui gtk: Implement helpline_fns
      perf ui/gtk: Use helpline API in browser
      perf ui gtk: Add perf_gtk__show_helpline() for pr_*
      perf ui gtk: Ensure not to call gtk_main_quit() twice
      perf hists: Separate out hist print functions
      perf hists: Rename and move some functions

Robert Richter (4):
      perf tools: Fix type for evsel->ids and add size check for ids
      perf tools: Report number of pmu type of unknown events
      perf tools: Rename some variables for better understanding
      perf tools: Rename global variable 'events' in util/header.c

Steven Rostedt (1):
      perf tools: Let O= makes handle relative paths

 tools/perf/Documentation/perf-script-perl.txt   |    4 +-
 tools/perf/Documentation/perf-script-python.txt |   10 +-
 tools/perf/Makefile                             |   20 +-
 tools/perf/builtin-record.c                     |   17 +-
 tools/perf/builtin-stat.c                       |   15 +-
 tools/perf/builtin-test.c                       |   10 +-
 tools/perf/builtin-top.c                        |   18 +-
 tools/perf/ui/browsers/hists.c                  |    4 +-
 tools/perf/ui/gtk/browser.c                     |    5 +-
 tools/perf/ui/gtk/gtk.h                         |    2 +
 tools/perf/ui/gtk/helpline.c                    |   56 ++
 tools/perf/ui/gtk/setup.c                       |    3 +
 tools/perf/ui/gtk/util.c                        |    5 -
 tools/perf/ui/helpline.c                        |   56 +-
 tools/perf/ui/helpline.h                        |   33 +-
 tools/perf/ui/setup.c                           |    4 +
 tools/perf/ui/stdio/hist.c                      |  653 ++++++++++++++++++++++
 tools/perf/ui/tui/helpline.c                    |   57 ++
 tools/perf/ui/tui/setup.c                       |    2 -
 tools/perf/util/debug.c                         |    4 +-
 tools/perf/util/debug.h                         |    8 +-
 tools/perf/util/evlist.c                        |   73 +--
 tools/perf/util/evlist.h                        |   27 +-
 tools/perf/util/evsel.c                         |   52 +-
 tools/perf/util/evsel.h                         |   20 +-
 tools/perf/util/header.c                        |   97 ++--
 tools/perf/util/header.h                        |    2 +-
 tools/perf/util/hist.c                          |  677 +----------------------
 tools/perf/util/hist.h                          |    6 +-
 tools/perf/util/parse-events-test.c             |  387 ++++++++++---
 tools/perf/util/parse-events.c                  |   93 +++-
 tools/perf/util/parse-events.h                  |    4 +-
 tools/perf/util/parse-events.l                  |    2 +
 tools/perf/util/parse-events.y                  |   93 +++-
 tools/perf/util/python-ext-sources              |    2 +
 tools/perf/util/python.c                        |    7 +-
 tools/perf/util/symbol-elf.c                    |    3 +
 tools/perf/util/symbol.c                        |    2 +-
 tools/perf/util/top.c                           |    3 +-
 tools/perf/util/trace-event-parse.c             |    2 +-
 tools/scripts/Makefile.include                  |    6 +-
 41 files changed, 1560 insertions(+), 984 deletions(-)
 create mode 100644 tools/perf/ui/gtk/helpline.c
 create mode 100644 tools/perf/ui/stdio/hist.c
 create mode 100644 tools/perf/ui/tui/helpline.c

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

end of thread, other threads:[~2019-01-22 10:08 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 01/24] perf ordered_events: Untangle from perf_session Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 02/24] perf ordered_events: Shorten function signatures Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 03/24] perf ordered_events: Allow tools to specify a deliver method Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 04/24] perf tools: tool->finished_round() doesn't need perf_session Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 05/24] perf tools: Remove superfluous thread->comm_set setting Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 06/24] perf ordered_events: Adopt queue() method Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 07/24] perf probe: Fix to handle aliased symbols in glibc Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 08/24] perf probe: Fix --line " Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 09/24] Revert "perf probe: Fix to fall back to find probe point in symbols" Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 10/24] perf symbols: Allow symbol alias when loading map for symbol name Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 11/24] perf probe: Allow weak symbols to be probed Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 12/24] perf build: Fix libbabeltrace detection Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 13/24] perf tools: Output feature detection's gcc output to a file Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 14/24] perf probe: Fix possible double free on error Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 15/24] perf hists browser: Fix UI bug after zoom into thread/dso/symbol Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 16/24] perf probe: Fix compiles due to declarations using perf_probe_point Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 17/24] perf hists browser: Fix UI bug after fold/unfold Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode Arnaldo Carvalho de Melo
2015-03-13  7:34   ` Ingo Molnar
2015-03-13 10:53     ` Arnaldo Carvalho de Melo
2015-03-13 12:31       ` Ingo Molnar
2015-03-12 21:27 ` [PATCH 19/24] perf stat: Fix IPC and other formulas with -A Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 20/24] perf stat: Always correctly indent ratio column Arnaldo Carvalho de Melo
2015-03-13  7:36   ` Ingo Molnar
2015-03-12 21:28 ` [PATCH 21/24] perf kmem: Fix segfault when invalid sort key is given Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 22/24] perf kmem: Allow -v option Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 23/24] perf kmem: Fix alignment of slab result table Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 24/24] perf data: Add tracepoint events fields CTF conversion support Arnaldo Carvalho de Melo
2015-03-13 12:34 ` [GIT PULL 00/24] perf/core improvements and fixes Ingo Molnar
2015-03-13 12:45   ` Jiri Olsa
  -- strict thread matches above, loose matches on Subject: below --
2019-01-21 23:56 Arnaldo Carvalho de Melo
2019-01-22 10:07 ` Ingo Molnar
2017-10-23 23:47 Arnaldo Carvalho de Melo
2017-10-24  9:13 ` Ingo Molnar
2016-07-15 20:50 Arnaldo Carvalho de Melo
2016-07-16 20:39 ` Ingo Molnar
2016-06-07 20:04 Arnaldo Carvalho de Melo
2016-06-07 23:10 ` Taeung Song
2016-06-08 13:09   ` Arnaldo Carvalho de Melo
2016-06-08  7:43 ` Ingo Molnar
2015-06-26 15:44 Arnaldo Carvalho de Melo
2015-06-30  4:48 ` Ingo Molnar
2014-10-14 21:04 Arnaldo Carvalho de Melo
2014-10-15  9:56 ` Ingo Molnar
2012-08-20 16:26 Arnaldo Carvalho de Melo
2012-08-21  9:32 ` Ingo Molnar
2012-08-21  9:36   ` Jiri Olsa

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).