aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 594f36a1da8f..946ec319568b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -883,38 +883,19 @@ out_close:
883 return err; 883 return err;
884} 884}
885 885
886bool fetch_build_id_table(struct list_head *head) 886bool dsos__read_build_ids(void)
887{ 887{
888 bool have_buildid = false; 888 bool have_build_id = false;
889 struct dso *pos; 889 struct dso *pos;
890 890
891 list_for_each_entry(pos, &dsos, node) { 891 list_for_each_entry(pos, &dsos, node)
892 struct build_id_list *new; 892 if (filename__read_build_id(pos->long_name, pos->build_id,
893 struct build_id_event b; 893 sizeof(pos->build_id)) > 0) {
894 size_t len; 894 have_build_id = true;
895 895 pos->has_build_id = true;
896 if (filename__read_build_id(pos->long_name, 896 }
897 &b.build_id,
898 sizeof(b.build_id)) < 0)
899 continue;
900 have_buildid = true;
901 memset(&b.header, 0, sizeof(b.header));
902 len = pos->long_name_len + 1;
903 len = ALIGN(len, 64);
904 b.header.size = sizeof(b) + len;
905
906 new = malloc(sizeof(*new));
907 if (!new)
908 die("No memory\n");
909
910 memcpy(&new->event, &b, sizeof(b));
911 new->dso_name = pos->long_name;
912 new->len = len;
913
914 list_add_tail(&new->list, head);
915 }
916 897
917 return have_buildid; 898 return have_build_id;
918} 899}
919 900
920int filename__read_build_id(const char *filename, void *bf, size_t size) 901int filename__read_build_id(const char *filename, void *bf, size_t size)