diff options
Diffstat (limited to '')
-rw-r--r-- | tools/perf/util/build-id.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 451d145fa4ed..8982f68e7230 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -277,8 +277,8 @@ static int write_buildid(const char *name, size_t name_len, struct build_id *bid struct perf_record_header_build_id b; size_t len; - len = name_len + 1; - len = PERF_ALIGN(len, NAME_ALIGN); + len = sizeof(b) + name_len + 1; + len = PERF_ALIGN(len, sizeof(u64)); memset(&b, 0, sizeof(b)); memcpy(&b.data, bid->data, bid->size); @@ -286,7 +286,7 @@ static int write_buildid(const char *name, size_t name_len, struct build_id *bid misc |= PERF_RECORD_MISC_BUILD_ID_SIZE; b.pid = pid; b.header.misc = misc; - b.header.size = sizeof(b) + len; + b.header.size = len; err = do_write(fd, &b, sizeof(b)); if (err < 0) |