From adc56ed1e01f1c43fc7bf75340f11f4ad5e11145 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Tue, 10 Jun 2014 22:50:03 +0200 Subject: perf tools: Add ordered_events__free function Adding ordered_events__free function to release all the struct ordered_events data. It's replacement for former perf_session_free_sample_buffers function. Signed-off-by: Jiri Olsa Acked-by: David Ahern Cc: Corey Ashford Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jean Pihet Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-urraa8ccay4o14wambjraws7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/ordered-events.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/perf/util/ordered-events.c') diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index 7b8923e12dc7..381d5fea1131 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -202,3 +202,14 @@ void ordered_events__init(struct ordered_events *oe) oe->max_alloc_size = (u64) -1; oe->cur_alloc_size = 0; } + +void ordered_events__free(struct ordered_events *oe) +{ + while (!list_empty(&oe->to_free)) { + struct ordered_event *event; + + event = list_entry(oe->to_free.next, struct ordered_event, list); + list_del(&event->list); + free(event); + } +} -- cgit v1.2.3