aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index ed3efd728b41..d5facd5ab1f7 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -205,8 +205,11 @@ static int __dsos__write_buildid_table(struct list_head *head, u16 misc, int fd)
205 dsos__for_each_with_build_id(pos, head) { 205 dsos__for_each_with_build_id(pos, head) {
206 int err; 206 int err;
207 struct build_id_event b; 207 struct build_id_event b;
208 size_t len = pos->long_name_len + 1; 208 size_t len;
209 209
210 if (!pos->hit)
211 continue;
212 len = pos->long_name_len + 1;
210 len = ALIGN(len, NAME_ALIGN); 213 len = ALIGN(len, NAME_ALIGN);
211 memset(&b, 0, sizeof(b)); 214 memset(&b, 0, sizeof(b));
212 memcpy(&b.build_id, pos->build_id, sizeof(pos->build_id)); 215 memcpy(&b.build_id, pos->build_id, sizeof(pos->build_id));
@@ -371,7 +374,7 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
371 u64 sec_start; 374 u64 sec_start;
372 int idx = 0, err; 375 int idx = 0, err;
373 376
374 if (dsos__read_build_ids()) 377 if (dsos__read_build_ids(true))
375 perf_header__set_feat(self, HEADER_BUILD_ID); 378 perf_header__set_feat(self, HEADER_BUILD_ID);
376 379
377 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS); 380 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS);