diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-03-03 10:20:38 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-03-12 11:39:46 -0400 |
commit | d10eb1eb76a86266354ecab6e42c1606e3b8bc4c (patch) | |
tree | e16a15de7df6ff556375effce15d5ece48c809bd /tools/perf/util/ordered-events.c | |
parent | b7b61cbebd789a3dbca522e3fdb727fe5c95593f (diff) |
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/ordered-events.c')
-rw-r--r-- | tools/perf/util/ordered-events.c | 7 |
1 files changed, 4 insertions, 3 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) | |||
181 | if (ret) | 181 | if (ret) |
182 | pr_err("Can't parse sample, err = %d\n", ret); | 182 | pr_err("Can't parse sample, err = %d\n", ret); |
183 | else { | 183 | else { |
184 | ret = machines__deliver_event(oe->machines, oe->evlist, iter->event, | 184 | ret = oe->deliver(oe, iter, &sample); |
185 | &sample, oe->tool, iter->file_offset); | ||
186 | if (ret) | 185 | if (ret) |
187 | return ret; | 186 | return ret; |
188 | } | 187 | } |
@@ -264,7 +263,8 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how) | |||
264 | } | 263 | } |
265 | 264 | ||
266 | void ordered_events__init(struct ordered_events *oe, struct machines *machines, | 265 | void ordered_events__init(struct ordered_events *oe, struct machines *machines, |
267 | struct perf_evlist *evlist, struct perf_tool *tool) | 266 | struct perf_evlist *evlist, struct perf_tool *tool, |
267 | ordered_events__deliver_t deliver) | ||
268 | { | 268 | { |
269 | INIT_LIST_HEAD(&oe->events); | 269 | INIT_LIST_HEAD(&oe->events); |
270 | INIT_LIST_HEAD(&oe->cache); | 270 | INIT_LIST_HEAD(&oe->cache); |
@@ -274,6 +274,7 @@ void ordered_events__init(struct ordered_events *oe, struct machines *machines, | |||
274 | oe->evlist = evlist; | 274 | oe->evlist = evlist; |
275 | oe->machines = machines; | 275 | oe->machines = machines; |
276 | oe->tool = tool; | 276 | oe->tool = tool; |
277 | oe->deliver = deliver; | ||
277 | } | 278 | } |
278 | 279 | ||
279 | void ordered_events__free(struct ordered_events *oe) | 280 | void ordered_events__free(struct ordered_events *oe) |