aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-buildid-list.c7
-rw-r--r--tools/perf/util/dso.c4
-rw-r--r--tools/perf/util/dso.h2
-rw-r--r--tools/perf/util/machine.h8
-rw-r--r--tools/perf/util/session.c6
-rw-r--r--tools/perf/util/session.h4
-rw-r--r--tools/perf/util/symbol.c12
7 files changed, 24 insertions, 19 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 4c770d252fd2..e74366a13218 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -44,6 +44,11 @@ static int filename__fprintf_build_id(const char *name, FILE *fp)
44 return fprintf(fp, "%s\n", sbuild_id); 44 return fprintf(fp, "%s\n", sbuild_id);
45} 45}
46 46
47static bool dso__skip_buildid(struct dso *dso, int with_hits)
48{
49 return with_hits && !dso->hit;
50}
51
47static int perf_session__list_build_ids(bool force, bool with_hits) 52static int perf_session__list_build_ids(bool force, bool with_hits)
48{ 53{
49 struct perf_session *session; 54 struct perf_session *session;
@@ -66,7 +71,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits)
66 if (with_hits || session->fd_pipe) 71 if (with_hits || session->fd_pipe)
67 perf_session__process_events(session, &build_id__mark_dso_hit_ops); 72 perf_session__process_events(session, &build_id__mark_dso_hit_ops);
68 73
69 perf_session__fprintf_dsos_buildid(session, stdout, with_hits); 74 perf_session__fprintf_dsos_buildid(session, stdout, dso__skip_buildid, with_hits);
70 perf_session__delete(session); 75 perf_session__delete(session);
71out: 76out:
72 return 0; 77 return 0;
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index be437850edc8..6f7d5a9d6b05 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -539,13 +539,13 @@ struct dso *__dsos__findnew(struct list_head *head, const char *name)
539} 539}
540 540
541size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp, 541size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
542 bool with_hits) 542 bool (skip)(struct dso *dso, int parm), int parm)
543{ 543{
544 struct dso *pos; 544 struct dso *pos;
545 size_t ret = 0; 545 size_t ret = 0;
546 546
547 list_for_each_entry(pos, head, node) { 547 list_for_each_entry(pos, head, node) {
548 if (with_hits && !pos->hit) 548 if (skip && skip(pos, parm))
549 continue; 549 continue;
550 ret += dso__fprintf_buildid(pos, fp); 550 ret += dso__fprintf_buildid(pos, fp);
551 ret += fprintf(fp, " %s\n", pos->long_name); 551 ret += fprintf(fp, " %s\n", pos->long_name);
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index e03276940b99..450199ab51b5 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -138,7 +138,7 @@ struct dso *__dsos__findnew(struct list_head *head, const char *name);
138bool __dsos__read_build_ids(struct list_head *head, bool with_hits); 138bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
139 139
140size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp, 140size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
141 bool with_hits); 141 bool (skip)(struct dso *dso, int parm), int parm);
142size_t __dsos__fprintf(struct list_head *head, FILE *fp); 142size_t __dsos__fprintf(struct list_head *head, FILE *fp);
143 143
144size_t dso__fprintf_buildid(struct dso *dso, FILE *fp); 144size_t dso__fprintf_buildid(struct dso *dso, FILE *fp);
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index b7cde7467d55..646ad13005d3 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -129,11 +129,11 @@ int machine__load_kallsyms(struct machine *machine, const char *filename,
129int machine__load_vmlinux_path(struct machine *machine, enum map_type type, 129int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
130 symbol_filter_t filter); 130 symbol_filter_t filter);
131 131
132size_t machine__fprintf_dsos_buildid(struct machine *machine, 132size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp,
133 FILE *fp, bool with_hits); 133 bool (skip)(struct dso *dso, int parm), int parm);
134size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp); 134size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp);
135size_t machines__fprintf_dsos_buildid(struct rb_root *machines, 135size_t machines__fprintf_dsos_buildid(struct rb_root *machines, FILE *fp,
136 FILE *fp, bool with_hits); 136 bool (skip)(struct dso *dso, int parm), int parm);
137 137
138void machine__destroy_kernel_maps(struct machine *machine); 138void machine__destroy_kernel_maps(struct machine *machine);
139int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel); 139int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index aa5e58255cba..8d04dfbc205c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1552,10 +1552,10 @@ size_t perf_session__fprintf_dsos(struct perf_session *self, FILE *fp)
1552} 1552}
1553 1553
1554size_t perf_session__fprintf_dsos_buildid(struct perf_session *self, FILE *fp, 1554size_t perf_session__fprintf_dsos_buildid(struct perf_session *self, FILE *fp,
1555 bool with_hits) 1555 bool (skip)(struct dso *dso, int parm), int parm)
1556{ 1556{
1557 size_t ret = machine__fprintf_dsos_buildid(&self->host_machine, fp, with_hits); 1557 size_t ret = machine__fprintf_dsos_buildid(&self->host_machine, fp, skip, parm);
1558 return ret + machines__fprintf_dsos_buildid(&self->machines, fp, with_hits); 1558 return ret + machines__fprintf_dsos_buildid(&self->machines, fp, skip, parm);
1559} 1559}
1560 1560
1561size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp) 1561size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp)
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index c18fabdff19b..8c2302504199 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -115,8 +115,8 @@ size_t perf_session__fprintf(struct perf_session *self, FILE *fp);
115 115
116size_t perf_session__fprintf_dsos(struct perf_session *self, FILE *fp); 116size_t perf_session__fprintf_dsos(struct perf_session *self, FILE *fp);
117 117
118size_t perf_session__fprintf_dsos_buildid(struct perf_session *self, 118size_t perf_session__fprintf_dsos_buildid(struct perf_session *session, FILE *fp,
119 FILE *fp, bool with_hits); 119 bool (fn)(struct dso *dso, int parm), int parm);
120 120
121size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp); 121size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp);
122 122
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 295f8d4feedf..e5ba9840ac22 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1315,21 +1315,21 @@ size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp)
1315} 1315}
1316 1316
1317size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp, 1317size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp,
1318 bool with_hits) 1318 bool (skip)(struct dso *dso, int parm), int parm)
1319{ 1319{
1320 return __dsos__fprintf_buildid(&machine->kernel_dsos, fp, with_hits) + 1320 return __dsos__fprintf_buildid(&machine->kernel_dsos, fp, skip, parm) +
1321 __dsos__fprintf_buildid(&machine->user_dsos, fp, with_hits); 1321 __dsos__fprintf_buildid(&machine->user_dsos, fp, skip, parm);
1322} 1322}
1323 1323
1324size_t machines__fprintf_dsos_buildid(struct rb_root *machines, 1324size_t machines__fprintf_dsos_buildid(struct rb_root *machines, FILE *fp,
1325 FILE *fp, bool with_hits) 1325 bool (skip)(struct dso *dso, int parm), int parm)
1326{ 1326{
1327 struct rb_node *nd; 1327 struct rb_node *nd;
1328 size_t ret = 0; 1328 size_t ret = 0;
1329 1329
1330 for (nd = rb_first(machines); nd; nd = rb_next(nd)) { 1330 for (nd = rb_first(machines); nd; nd = rb_next(nd)) {
1331 struct machine *pos = rb_entry(nd, struct machine, rb_node); 1331 struct machine *pos = rb_entry(nd, struct machine, rb_node);
1332 ret += machine__fprintf_dsos_buildid(pos, fp, with_hits); 1332 ret += machine__fprintf_dsos_buildid(pos, fp, skip, parm);
1333 } 1333 }
1334 return ret; 1334 return ret;
1335} 1335}