Commit-ID: 36522f5cf2ad280c971557e04120d52f9330ed36 Gitweb: http://git.kernel.org/tip/36522f5cf2ad280c971557e04120d52f9330ed36 Author: Jiri Olsa <jolsa@xxxxxxxxxx> AuthorDate: Tue, 10 Jun 2014 22:47:40 +0200 Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> CommitDate: Tue, 12 Aug 2014 12:02:59 -0300 perf tools: Add ordered_events__init function Adding ordered_events__init function for struct ordered_events struct initialization. Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> Acked-by: David Ahern <dsahern@xxxxxxxxx> 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> Link: http://lkml.kernel.org/n/tip-g6dx35hed8g14eh1ygx4uzp6@xxxxxxxxxxxxxx Signed-off-by: Arnaldo Carvalho de Melo <acme@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 be6a48c..7b8923e 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -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; +} diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h index 8309983..62f9945 100644 --- a/tools/perf/util/ordered-events.h +++ b/tools/perf/util/ordered-events.h @@ -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 */ diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 0ccf051..7f5851e 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -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) { -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html