lkml.org 
[lkml]   [2014]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/17] perf tools: Add ordered_events_queue_init function
Date
Adding ordered_events_queue_init function for struct
ordered_events_queue initialization.

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
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>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
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 2d943eb..0ca34ee 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -191,3 +191,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 0548d72..09d1052 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


\
 
 \ /
  Last update: 2014-06-13 03:21    [W:0.106 / U:4.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site