perf symbols: Generalize filter in __fprintf_buildid methods
We had that 'with_hits' filter to show just the build ids for DSOs that had samples, make that generic so that we can use it in the upcoming buildid-cache --missing feature, to show just the build ids that are not in the cache. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-9nfesdfpnx7zp96yn3tmfbx0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -44,6 +44,11 @@ static int filename__fprintf_build_id(const char *name, FILE *fp)
|
||||
return fprintf(fp, "%s\n", sbuild_id);
|
||||
}
|
||||
|
||||
static bool dso__skip_buildid(struct dso *dso, int with_hits)
|
||||
{
|
||||
return with_hits && !dso->hit;
|
||||
}
|
||||
|
||||
static int perf_session__list_build_ids(bool force, bool with_hits)
|
||||
{
|
||||
struct perf_session *session;
|
||||
@@ -66,7 +71,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits)
|
||||
if (with_hits || session->fd_pipe)
|
||||
perf_session__process_events(session, &build_id__mark_dso_hit_ops);
|
||||
|
||||
perf_session__fprintf_dsos_buildid(session, stdout, with_hits);
|
||||
perf_session__fprintf_dsos_buildid(session, stdout, dso__skip_buildid, with_hits);
|
||||
perf_session__delete(session);
|
||||
out:
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user