symbol.c (d3379ab9050e5522da2aac53d413651fc06be562) symbol.c (e30a3d12ddf04add3268bfceb0e57ffe47f254c6)
1#include "util.h"
2#include "../perf.h"
3#include "string.h"
4#include "symbol.h"
5#include "thread.h"
6
7#include "debug.h"
8

--- 869 unchanged lines hidden (view full) ---

878 dso__fixup_sym_end(self);
879 err = nr;
880out_elf_end:
881 elf_end(elf);
882out_close:
883 return err;
884}
885
1#include "util.h"
2#include "../perf.h"
3#include "string.h"
4#include "symbol.h"
5#include "thread.h"
6
7#include "debug.h"
8

--- 869 unchanged lines hidden (view full) ---

878 dso__fixup_sym_end(self);
879 err = nr;
880out_elf_end:
881 elf_end(elf);
882out_close:
883 return err;
884}
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;
890
889 struct dso *pos;
890
891 list_for_each_entry(pos, &dsos, node) {
892 struct build_id_list *new;
893 struct build_id_event b;
894 size_t len;
891 list_for_each_entry(pos, &dsos, node)
892 if (filename__read_build_id(pos->long_name, pos->build_id,
893 sizeof(pos->build_id)) > 0) {
894 have_build_id = true;
895 pos->has_build_id = true;
896 }
895
897
896 if (filename__read_build_id(pos->long_name,
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
917 return have_buildid;
898 return have_build_id;
918}
919
920int filename__read_build_id(const char *filename, void *bf, size_t size)
921{
922 int fd, err = -1;
923 GElf_Ehdr ehdr;
924 GElf_Shdr shdr;
925 Elf_Data *build_id_data;

--- 539 unchanged lines hidden ---
899}
900
901int filename__read_build_id(const char *filename, void *bf, size_t size)
902{
903 int fd, err = -1;
904 GElf_Ehdr ehdr;
905 GElf_Shdr shdr;
906 Elf_Data *build_id_data;

--- 539 unchanged lines hidden ---