aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-02-03 13:52:05 -0500
committerIngo Molnar <mingo@elte.hu>2010-02-04 03:33:27 -0500
commit6122e4e4f5d0913e319ef8a4dc60a47afe4abc0a (patch)
tree77e8995f360f3cb3a8f7c392708ccf58836b0573 /tools/perf/util/header.c
parent7b2567c1f57c059de29d3f2ca03aca84473865c8 (diff)
perf record: Stop intercepting events, use postprocessing to get build-ids
We want to stream events as fast as possible to perf.data, and also in the future we want to have splice working, when no interception will be possible. Using build_id__mark_dso_hit_ops to create the list of DSOs that back MMAPs we also optimize disk usage in the build-id cache by only caching DSOs that had hits. Suggested-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1265223128-11786-6-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index ed3efd728b41..d5facd5ab1f7 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -205,8 +205,11 @@ static int __dsos__write_buildid_table(struct list_head *head, u16 misc, int fd)
205 dsos__for_each_with_build_id(pos, head) { 205 dsos__for_each_with_build_id(pos, head) {
206 int err; 206 int err;
207 struct build_id_event b; 207 struct build_id_event b;
208 size_t len = pos->long_name_len + 1; 208 size_t len;
209 209
210 if (!pos->hit)
211 continue;
212 len = pos->long_name_len + 1;
210 len = ALIGN(len, NAME_ALIGN); 213 len = ALIGN(len, NAME_ALIGN);
211 memset(&b, 0, sizeof(b)); 214 memset(&b, 0, sizeof(b));
212 memcpy(&b.build_id, pos->build_id, sizeof(pos->build_id)); 215 memcpy(&b.build_id, pos->build_id, sizeof(pos->build_id));
@@ -371,7 +374,7 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
371 u64 sec_start; 374 u64 sec_start;
372 int idx = 0, err; 375 int idx = 0, err;
373 376
374 if (dsos__read_build_ids()) 377 if (dsos__read_build_ids(true))
375 perf_header__set_feat(self, HEADER_BUILD_ID); 378 perf_header__set_feat(self, HEADER_BUILD_ID);
376 379
377 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS); 380 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS);