]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf symbols: Remove map from list before updating addresses
authorJames Clark <james.clark@arm.com>
Tue, 7 May 2024 14:12:05 +0000 (15:12 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 9 May 2024 21:48:00 +0000 (18:48 -0300)
commit9fe410a7ef483a9aca08bf620d8ddfd35ac99bc7
tree0f87811bf29b1f41256498745a62873c7be9bbaa
parentd790ead8a60c0f687446f7d8faa96943dc158912
perf symbols: Remove map from list before updating addresses

Make the order of operations remove, update, add. Updating addresses
before the map is removed causes the ordering check to fail when the map
is removed. This can be reproduced when running Perf on an Arm system
with a static kernel and Perf uses kcore rather than other sources:

  $ perf record -- ls
  $ perf report

  util/maps.c:96: check_invariants: Assertion `map__end(prev) <=
    map__start(map) || map__start(prev) == map__start(map)' failed

Fixes: 659ad3492b913c90 ("perf maps: Switch from rbtree to lazily sorted array for addresses")
Signed-off-by: James Clark <james.clark@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240507141210.195939-2-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol.c