Skip to content

Fix and improve __maps__fixup_overlap_and_insert

Ian Rogers linux-perf-users lkml 1 version Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3perf maps: Fix use after free in __maps__fixup_overlap_and_inserttools/perf/util/maps.c+5 -40 replies
2/3perf maps: Reduce sorting for overlapping mappingstools/perf/util/maps.c+36 -190 replies
3/3perf maps: Add/use a sorted insert for fixup overlap and inserttools/perf/util/maps.c+59 -60 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJames Clark
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/3] Fix and improve __maps__fixup_overlap_and_insert

Fix latent unlikely bugs in __maps__fixup_overlap_and_insert.

Improve __maps__fixup_overlap_and_insert's performance 21x in the case of overlapping mmaps. [email protected] reported slowness opening perf.data files from chromium where the files contained a large number of overlapping mappings. Improve this case primarily by avoiding unnecessary sorting.

Unscientific timing data processing a perf.data file with overlapping mmap events from chromium:

Before:

real    0m9.856s
user    0m9.637s
sys     0m0.204s

After:

real    0m0.675s
user    0m0.454s
sys     0m0.196s

Tested with address/leak sanitizer, invariant checks and validating the before and after output are identical.

Ian Rogers (3):
perf maps: Fix use after free in __maps__fixup_overlap_and_insert perf maps: Reduce sorting for overlapping mappings perf maps: Add/use a sorted insert for fixup overlap and insert

 tools/perf/util/maps.c | 113 +++++++++++++++++++++++++++++++++--------
 1 file changed, 92 insertions(+), 21 deletions(-)
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog