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:
Arnaldo Carvalho de Melo
2012-12-07 09:53:58 -03:00
parent db6d0bb861
commit 417c2ff680
7 changed files with 24 additions and 19 deletions

View File

@@ -1315,21 +1315,21 @@ size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp)
}
size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp,
bool with_hits)
bool (skip)(struct dso *dso, int parm), int parm)
{
return __dsos__fprintf_buildid(&machine->kernel_dsos, fp, with_hits) +
__dsos__fprintf_buildid(&machine->user_dsos, fp, with_hits);
return __dsos__fprintf_buildid(&machine->kernel_dsos, fp, skip, parm) +
__dsos__fprintf_buildid(&machine->user_dsos, fp, skip, parm);
}
size_t machines__fprintf_dsos_buildid(struct rb_root *machines,
FILE *fp, bool with_hits)
size_t machines__fprintf_dsos_buildid(struct rb_root *machines, FILE *fp,
bool (skip)(struct dso *dso, int parm), int parm)
{
struct rb_node *nd;
size_t ret = 0;
for (nd = rb_first(machines); nd; nd = rb_next(nd)) {
struct machine *pos = rb_entry(nd, struct machine, rb_node);
ret += machine__fprintf_dsos_buildid(pos, fp, with_hits);
ret += machine__fprintf_dsos_buildid(pos, fp, skip, parm);
}
return ret;
}