aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-11-26 16:39:15 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-11-26 16:39:15 -0500
commitbaa2f6cedbfae962f04281a31f08ec29667d31a0 (patch)
tree6a644f86e234a03bf99518b76daec138016e3bca /tools/perf/util/header.c
parentaf86da5318136eb49c0453c2e2be3280ee5d18d9 (diff)
perf record: Add option to disable collecting build-ids
Collecting build-ids for long running sessions may take a long time because it needs to traverse the whole just collected perf.data stream of events, marking the DSOs that had hits and then looking for the .note.gnu.build-id ELF section. For things like the 'trace' tool that records and right away consumes the data on systems where its unlikely that the DSOs being monitored will change while 'trace' runs, it is desirable to remove build id collection, so add a -B/--no-buildid option to perf record to allow such use case. Longer term we'll avoid all this if we, at DSO load time, in the kernel, take advantage of this slow code path to collect the build-id and stash it somewhere, so that we can insert it in the PERF_RECORD_MMAP event. Reported-by: Thomas Gleixner <tglx@linutronix.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> 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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index d7e67b167ea3..f65d7dc127b6 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -152,6 +152,11 @@ void perf_header__set_feat(struct perf_header *self, int feat)
152 set_bit(feat, self->adds_features); 152 set_bit(feat, self->adds_features);
153} 153}
154 154
155void perf_header__clear_feat(struct perf_header *self, int feat)
156{
157 clear_bit(feat, self->adds_features);
158}
159
155bool perf_header__has_feat(const struct perf_header *self, int feat) 160bool perf_header__has_feat(const struct perf_header *self, int feat)
156{ 161{
157 return test_bit(feat, self->adds_features); 162 return test_bit(feat, self->adds_features);
@@ -431,8 +436,10 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
431 int idx = 0, err; 436 int idx = 0, err;
432 437
433 session = container_of(self, struct perf_session, header); 438 session = container_of(self, struct perf_session, header);
434 if (perf_session__read_build_ids(session, true)) 439
435 perf_header__set_feat(self, HEADER_BUILD_ID); 440 if (perf_header__has_feat(self, HEADER_BUILD_ID &&
441 !perf_session__read_build_ids(session, true)))
442 perf_header__clear_feat(self, HEADER_BUILD_ID);
436 443
437 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS); 444 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS);
438 if (!nr_sections) 445 if (!nr_sections)