[PATCH 12/18] perf tools: Add ordered_events_queue_init function

From: Jiri Olsa
Date: Wed Jun 18 2014 - 11:04:22 EST


Adding ordered_events_queue_init function for struct
ordered_events_queue initialization.

Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Jean Pihet <jean.pihet@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/perf/util/ordered-events.c | 9 +++++++++
tools/perf/util/ordered-events.h | 1 +
tools/perf/util/session.c | 6 +-----
3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 022be55..42b1bbc 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -192,3 +192,12 @@ int ordered_events_flush(struct perf_session *s, struct perf_tool *tool,

return err;
}
+
+void ordered_events_queue_init(struct ordered_events_queue *q)
+{
+ INIT_LIST_HEAD(&q->events);
+ INIT_LIST_HEAD(&q->cache);
+ INIT_LIST_HEAD(&q->to_free);
+ q->max_alloc_size = (u64) -1;
+ q->cur_alloc_size = 0;
+}
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index c0dc00e..0633b09 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -40,4 +40,5 @@ void ordered_event_put(struct ordered_events_queue *q,
struct ordered_event *iter);
int ordered_events_flush(struct perf_session *s, struct perf_tool *tool,
enum oeq_flush how);
+void ordered_events_queue_init(struct ordered_events_queue *q);
#endif /* __ORDERED_EVENTS_H */
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 2b97ada..59d13a7 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -76,11 +76,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_queue_init(&session->ordered_events);
machines__init(&session->machines);

if (file) {
--
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/