Skip to content

Commit 8775ab4

Browse files
namhyunggregkh
authored andcommitted
perf record: Cache build-ID of hit DSOs only
[ Upstream commit 6235ce7 ] It post-processes samples to find which DSO has samples. Based on that info, it can save used DSOs in the build-ID cache directory. But for some reason, it saves all DSOs without checking the hit mark. Skipping unused DSOs can give some speedup especially with --buildid-mmap being default. On my idle machine, `time perf record -a sleep 1` goes down from 3 sec to 1.5 sec with this change. Fixes: e29386c ("perf record: Add --buildid-mmap option to enable PERF_RECORD_MMAP2's build id") Reviewed-by: Arnaldo Carvalho de Melo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2c735fc commit 8775ab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/build-id.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static int dso__cache_build_id(struct dso *dso, struct machine *machine,
864864
char *allocated_name = NULL;
865865
int ret = 0;
866866

867-
if (!dso__has_build_id(dso))
867+
if (!dso__has_build_id(dso) || !dso__hit(dso))
868868
return 0;
869869

870870
if (dso__is_kcore(dso)) {

0 commit comments

Comments
 (0)