summaryrefslogtreecommitdiff
path: root/tools/perf/util/ordered-events.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2014-06-11 00:50:03 +0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-12 19:03:00 +0400
commitadc56ed1e01f1c43fc7bf75340f11f4ad5e11145 (patch)
tree39363f4edce723513ea514a2b21e0c2caffe12c1 /tools/perf/util/ordered-events.c
parent36522f5cf2ad280c971557e04120d52f9330ed36 (diff)
downloadlinux-adc56ed1e01f1c43fc7bf75340f11f4ad5e11145.tar.xz
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 <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-urraa8ccay4o14wambjraws7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ordered-events.c')
-rw-r--r--tools/perf/util/ordered-events.c11
1 files changed, 11 insertions, 0 deletions
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);
+ }
+}