diff options
| author | Mark Brown <broonie@kernel.org> | 2020-12-11 17:47:55 +0000 | 
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2020-12-11 17:47:55 +0000 | 
| commit | 031616c434db05ce766f76c62865f55698e0924f (patch) | |
| tree | 7f29aa1ff3e7b51a8058cd570fb785c6e769b245 /tools/perf/util/header.c | |
| parent | 064841ccfc49b2315dc0b797239862d3a343aa07 (diff) | |
| parent | 85a7555575a0e48f9b73db310d0d762a08a46d63 (diff) | |
Merge remote-tracking branch 'asoc/for-5.10' into asoc-linus
Diffstat (limited to 'tools/perf/util/header.c')
| -rw-r--r-- | tools/perf/util/header.c | 15 | 
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 9cf4efdcbbbd..be850e9f8852 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2082,8 +2082,14 @@ static int __event_process_build_id(struct perf_record_header_build_id *bev,  	dso = machine__findnew_dso(machine, filename);  	if (dso != NULL) {  		char sbuild_id[SBUILD_ID_SIZE]; +		struct build_id bid; +		size_t size = BUILD_ID_SIZE; -		dso__set_build_id(dso, &bev->build_id); +		if (bev->header.misc & PERF_RECORD_MISC_BUILD_ID_SIZE) +			size = bev->size; + +		build_id__init(&bid, bev->data, size); +		dso__set_build_id(dso, &bid);  		if (dso_space != DSO_SPACE__USER) {  			struct kmod_path m = { .name = NULL, }; @@ -2095,10 +2101,9 @@ static int __event_process_build_id(struct perf_record_header_build_id *bev,  			free(m.name);  		} -		build_id__sprintf(dso->build_id, sizeof(dso->build_id), -				  sbuild_id); -		pr_debug("build id event received for %s: %s\n", -			 dso->long_name, sbuild_id); +		build_id__sprintf(&dso->bid, sbuild_id); +		pr_debug("build id event received for %s: %s [%zu]\n", +			 dso->long_name, sbuild_id, size);  		dso__put(dso);  	}  | 
