perf tools: Add ordered_events__init function
authorJiri Olsa <jolsa@kernel.org>
Tue, 10 Jun 2014 20:47:40 +0000 (22:47 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Aug 2014 15:02:59 +0000 (12:02 -0300)
Adding ordered_events__init function for struct ordered_events struct
initialization.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-g6dx35hed8g14eh1ygx4uzp6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/ordered-events.c
tools/perf/util/ordered-events.h
tools/perf/util/session.c

index be6a48ce3eea3904271e9da1d4e010aa383c0b23..7b8923e12dc7d1d31ac4b5957ebe04f1efd7da12 100644 (file)
@@ -193,3 +193,12 @@ int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
 
        return err;
 }
+
+void ordered_events__init(struct ordered_events *oe)
+{
+       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;
+}
index 8309983bdd7020072ca86dadc7fa8533dc245e6e..62f9945319b64956e8c454d8fea0944f43c60d00 100644 (file)
@@ -38,4 +38,5 @@ 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 perf_session *s, struct perf_tool *tool,
                          enum oe_flush how);
+void ordered_events__init(struct ordered_events *oe);
 #endif /* __ORDERED_EVENTS_H */
index 0ccf051247f629099a7aace8cdf697c78dd0ebb1..7f5851e433bbd901942b6271ff38ba83c734ddf9 100644 (file)
@@ -75,11 +75,7 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
                goto out;
 
        session->repipe = repipe;
-       INIT_LIST_HEAD(&session->ordered_events.events);
-       INIT_LIST_HEAD(&session->ordered_events.cache);
-       INIT_LIST_HEAD(&session->ordered_events.to_free);
-       session->ordered_events.max_alloc_size = (u64) -1;
-       session->ordered_events.cur_alloc_size = 0;
+       ordered_events__init(&session->ordered_events);
        machines__init(&session->machines);
 
        if (file) {