aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-03-03 12:20:38 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-12 12:39:46 -0300
commitd10eb1eb76a86266354ecab6e42c1606e3b8bc4c (patch)
treee16a15de7df6ff556375effce15d5ece48c809bd /tools/perf/util/session.c
parentperf ordered_events: Shorten function signatures (diff)
downloadlinux-dev-d10eb1eb76a86266354ecab6e42c1606e3b8bc4c.tar.xz
linux-dev-d10eb1eb76a86266354ecab6e42c1606e3b8bc4c.zip
perf ordered_events: Allow tools to specify a deliver method
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>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c30
1 files changed, 23 insertions, 7 deletions
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;