summaryrefslogtreecommitdiff
path: root/tools/perf/util/ordered-events.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-03-03 17:48:12 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-11 16:16:50 +0300
commitfa713a4eb9cebe5dec71b1bd11429603e17d841d (patch)
treeb51adc0b21af2b7584d455ae729de4d0c39c8ff5 /tools/perf/util/ordered-events.c
parent94ac003b665fc04f13a7ab3b2be896b9b9503451 (diff)
downloadlinux-fa713a4eb9cebe5dec71b1bd11429603e17d841d.tar.xz
perf ordered_events: Untangle from perf_session
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>
Diffstat (limited to 'tools/perf/util/ordered-events.c')
-rw-r--r--tools/perf/util/ordered-events.c17
1 files changed, 9 insertions, 8 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)