aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.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/symbol.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/symbol.c')
-rw-r--r--tools/perf/util/symbol.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e752837363ee..bfb055459670 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1076,25 +1076,28 @@ static bool dso__build_id_equal(const struct dso *self, u8 *build_id)
1076 return memcmp(self->build_id, build_id, sizeof(self->build_id)) == 0; 1076 return memcmp(self->build_id, build_id, sizeof(self->build_id)) == 0;
1077} 1077}
1078 1078
1079static bool __dsos__read_build_ids(struct list_head *head) 1079static bool __dsos__read_build_ids(struct list_head *head, bool with_hits)
1080{ 1080{
1081 bool have_build_id = false; 1081 bool have_build_id = false;
1082 struct dso *pos; 1082 struct dso *pos;
1083 1083
1084 list_for_each_entry(pos, head, node) 1084 list_for_each_entry(pos, head, node) {
1085 if (with_hits && !pos->hit)
1086 continue;
1085 if (filename__read_build_id(pos->long_name, pos->build_id, 1087 if (filename__read_build_id(pos->long_name, pos->build_id,
1086 sizeof(pos->build_id)) > 0) { 1088 sizeof(pos->build_id)) > 0) {
1087 have_build_id = true; 1089 have_build_id = true;
1088 pos->has_build_id = true; 1090 pos->has_build_id = true;
1089 } 1091 }
1092 }
1090 1093
1091 return have_build_id; 1094 return have_build_id;
1092} 1095}
1093 1096
1094bool dsos__read_build_ids(void) 1097bool dsos__read_build_ids(bool with_hits)
1095{ 1098{
1096 bool kbuildids = __dsos__read_build_ids(&dsos__kernel), 1099 bool kbuildids = __dsos__read_build_ids(&dsos__kernel, with_hits),
1097 ubuildids = __dsos__read_build_ids(&dsos__user); 1100 ubuildids = __dsos__read_build_ids(&dsos__user, with_hits);
1098 return kbuildids || ubuildids; 1101 return kbuildids || ubuildids;
1099} 1102}
1100 1103