Skip to content

Commit ff54373

Browse files
committed
Merge: perf buildid-list sees no hit buildids in perf.data
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6597 JIRA: https://issues.redhat.com/browse/RHEL-83537 Hit buildids have been incorrectly stored in perf.data, thus the `perf buildid-list --with-hits` command showed no hashes, which has broken perf-archive. With this fix, it should be working again. Signed-off-by: Michael Petlan <[email protected]> Approved-by: ashelat <[email protected]> Approved-by: Jerome Marchand <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents 62c72f3 + 621f7e6 commit ff54373

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/perf/util/build-id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static int write_buildid(const char *name, size_t name_len, struct build_id *bid
277277
struct perf_record_header_build_id b;
278278
size_t len;
279279

280-
len = sizeof(b) + name_len + 1;
280+
len = name_len + 1;
281281
len = PERF_ALIGN(len, sizeof(u64));
282282

283283
memset(&b, 0, sizeof(b));
@@ -286,7 +286,7 @@ static int write_buildid(const char *name, size_t name_len, struct build_id *bid
286286
misc |= PERF_RECORD_MISC_BUILD_ID_SIZE;
287287
b.pid = pid;
288288
b.header.misc = misc;
289-
b.header.size = len;
289+
b.header.size = sizeof(b) + len;
290290

291291
err = do_write(fd, &b, sizeof(b));
292292
if (err < 0)

0 commit comments

Comments
 (0)