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:58:45 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-11 16:17:09 +0300
commitb7b61cbebd789a3dbca522e3fdb727fe5c95593f (patch)
treeea6757b8b1d85b1562ce10217912c5827a4d2b23 /tools/perf/util/ordered-events.c
parentfa713a4eb9cebe5dec71b1bd11429603e17d841d (diff)
downloadlinux-b7b61cbebd789a3dbca522e3fdb727fe5c95593f.tar.xz
perf ordered_events: Shorten function signatures
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>
Diffstat (limited to 'tools/perf/util/ordered-events.c')
-rw-r--r--tools/perf/util/ordered-events.c23
1 files changed, 11 insertions, 12 deletions
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)