]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf sched: Add missing mmap2 handler in timehist
authorIan Rogers <irogers@google.com>
Wed, 6 May 2026 00:45:42 +0000 (17:45 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 11 May 2026 18:25:56 +0000 (15:25 -0300)
perf_sched__timehist() registers event handlers for options using the
sched->tool struct. It registers handlers for MMAP, COMM, EXIT, FORK, etc.
but completely omits registering a handler for MMAP2 events.

Failing to register both MMAP and MMAP2 handlers causes modern systems
(which primarily output MMAP2 records) to silently drop VMA map mappings.
This results in uninitialized machine/thread mapping structures, making it
impossible to resolve shared library instruction pointers (IPs) to dynamic
symbols/DSOs during timehist callchain analysis.

Fix this by correctly registering perf_event__process_mmap2 in
sched->tool inside perf_sched__timehist().

Fixes: 49394a2a24c78ce0 ("perf sched timehist: Introduce timehist command")
Assisted-by: Gemini-CLI:Google Gemini 3
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Gabriel Marin <gmx@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-sched.c

index fd679b106582a6d3fd08dd6d62b0746389c8b4fa..53a93aa18853e43476d133c86c11fa4b1bfb5de8 100644 (file)
@@ -3299,6 +3299,7 @@ static int perf_sched__timehist(struct perf_sched *sched)
         */
        sched->tool.sample       = perf_timehist__process_sample;
        sched->tool.mmap         = perf_event__process_mmap;
+       sched->tool.mmap2        = perf_event__process_mmap2;
        sched->tool.comm         = perf_event__process_comm;
        sched->tool.exit         = perf_event__process_exit;
        sched->tool.fork         = perf_event__process_fork;