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>
This commit is contained in:
Arnaldo Carvalho de Melo
2010-02-03 16:52:05 -02:00
committed by Ingo Molnar
parent 7b2567c1f5
commit 6122e4e4f5
6 changed files with 73 additions and 53 deletions

View File

@ -1076,25 +1076,28 @@ static bool dso__build_id_equal(const struct dso *self, u8 *build_id)
return memcmp(self->build_id, build_id, sizeof(self->build_id)) == 0;
}
static bool __dsos__read_build_ids(struct list_head *head)
static bool __dsos__read_build_ids(struct list_head *head, bool with_hits)
{
bool have_build_id = false;
struct dso *pos;
list_for_each_entry(pos, head, node)
list_for_each_entry(pos, head, node) {
if (with_hits && !pos->hit)
continue;
if (filename__read_build_id(pos->long_name, pos->build_id,
sizeof(pos->build_id)) > 0) {
have_build_id = true;
pos->has_build_id = true;
}
}
return have_build_id;
}
bool dsos__read_build_ids(void)
bool dsos__read_build_ids(bool with_hits)
{
bool kbuildids = __dsos__read_build_ids(&dsos__kernel),
ubuildids = __dsos__read_build_ids(&dsos__user);
bool kbuildids = __dsos__read_build_ids(&dsos__kernel, with_hits),
ubuildids = __dsos__read_build_ids(&dsos__user, with_hits);
return kbuildids || ubuildids;
}