aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-11-30 12:49:53 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-11-30 17:04:18 -0500
commit020bb75a6deeca5ebeae531dc7378c157affc8fd (patch)
tree1e103a173a5454adee9235c52558eef22fc24214 /tools/perf/util/session.h
parentfe17420784a6d3602e98f798731369fa05936cbe (diff)
perf session: Cache sample objects
When the sample queue is flushed we free the sample reference objects. Though we need to malloc new objects when we process further. Stop the malloc/free orgy and cache the already allocated object for resuage. Only allocate when the cache is empty. Performance gain: ~ 10% Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20101130163820.338488630@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r--tools/perf/util/session.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index a00f32ed1c79..e4a7ff2ba8d5 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -18,6 +18,7 @@ struct ordered_samples {
18 u64 next_flush; 18 u64 next_flush;
19 u64 max_timestamp; 19 u64 max_timestamp;
20 struct list_head samples; 20 struct list_head samples;
21 struct list_head sample_cache;
21 struct sample_queue *last_sample; 22 struct sample_queue *last_sample;
22}; 23};
23 24