aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2010-06-17 05:39:01 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-06-17 09:20:44 -0400
commita1ac1d3c085420ea8c809ebbee3bb212ed3616bd (patch)
treeaca14b46e24f277fe7601457039ef5e5ef1421f9 /tools/perf/util/header.c
parent70c3856b2f1304e0abc65f1b96a8c60ddfc0fb9e (diff)
perf record: Add option to avoid updating buildid cache
There are situations where there is enough information in the perf.data to process the samples. Updating the buildid cache may add unecessary overhead in terms of disk space and time (copying large elf images). A persistent option to do this already exists via the perfconfig file, simply do: [buildid] dir = /dev/null This patch provides a way to suppress builid cache updates on a per-run basis. It addds a new option, -N, to perf record. Buildids are still generated in the perf.data file. Cc: David S. Miller <davem@davemloft.net> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <4c19ef89.93ecd80a.40dc.fffff8e9@mx.google.com> Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 4a6a4b3a4ab7..d7e67b167ea3 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -16,6 +16,8 @@
16#include "symbol.h" 16#include "symbol.h"
17#include "debug.h" 17#include "debug.h"
18 18
19static bool no_buildid_cache = false;
20
19/* 21/*
20 * Create new perf.data header attribute: 22 * Create new perf.data header attribute:
21 */ 23 */
@@ -470,7 +472,8 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
470 } 472 }
471 buildid_sec->size = lseek(fd, 0, SEEK_CUR) - 473 buildid_sec->size = lseek(fd, 0, SEEK_CUR) -
472 buildid_sec->offset; 474 buildid_sec->offset;
473 perf_session__cache_build_ids(session); 475 if (!no_buildid_cache)
476 perf_session__cache_build_ids(session);
474 } 477 }
475 478
476 lseek(fd, sec_start, SEEK_SET); 479 lseek(fd, sec_start, SEEK_SET);
@@ -1189,3 +1192,8 @@ int event__process_build_id(event_t *self,
1189 session); 1192 session);
1190 return 0; 1193 return 0;
1191} 1194}
1195
1196void disable_buildid_cache(void)
1197{
1198 no_buildid_cache = true;
1199}