From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: gmx@google.com, namhyung@kernel.org, adrian.hunter@intel.com,
james.clark@linaro.org, jolsa@kernel.org,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
mingo@redhat.com, peterz@infradead.org
Subject: Re: [PATCH v5 1/5] perf sched: Add missing mmap2 handler in timehist
Date: Wed, 6 May 2026 10:22:10 -0300 [thread overview]
Message-ID: <aftAgoXnB6xuYGAt@x1> (raw)
In-Reply-To: <20260506004546.3140141-2-irogers@google.com>
On Tue, May 05, 2026 at 05:45:42PM -0700, Ian Rogers wrote:
> 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().
>
> Assisted-by: Gemini-CLI:Google Gemini 3
> Fixes: 5bbfec0ad93c ("perf sched: Implement timehist option")
I'm picking patches 1 and 2 as they're simple and passed sashiko review,
but:
⬢ [acme@toolbx perf-tools-next2]$ git show 5bbfec0ad93c
fatal: ambiguous argument '5bbfec0ad93c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
⬢ [acme@toolbx perf-tools-next2]$
The right one is:
Fixes: 49394a2a24c78ce0 ("perf sched timehist: Introduce timehist command")
I checked and at the time, mmap2 was already present and it missed
adding this handler.
I fixed it, in case I'm missing something, lemme know,
- Arnaldo
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/builtin-sched.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 555247568e7a..241c2f808f7b 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -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;
> --
> 2.54.0.545.g6539524ca2-goog
next prev parent reply other threads:[~2026-05-06 13:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 22:05 [PATCH v1 1/2] perf inject/aslr: Add aslr tool to remap/obfuscate virtual addresses Ian Rogers
2026-04-24 22:05 ` [PATCH v1 2/2] perf test: Add inject ASLR test Ian Rogers
2026-04-25 2:05 ` [PATCH v2 1/2] perf inject/aslr: Add aslr tool to remap/obfuscate virtual addresses Ian Rogers
2026-04-25 2:05 ` [PATCH v2 2/2] perf test: Add inject ASLR test Ian Rogers
2026-05-04 3:51 ` [PATCH v3 0/4] perf tools: Add inject --aslr feature and prerequisite robustness fixes Ian Rogers
2026-05-04 3:51 ` [PATCH v3 1/4] perf sched: Add missing mmap2 handler in timehist Ian Rogers
2026-05-04 3:51 ` [PATCH v3 2/4] perf tool: Fix missing schedstat delegates and dont_split_sample_group in delegate_tool Ian Rogers
2026-05-04 3:51 ` [PATCH v3 3/4] perf inject/aslr: Add aslr tool to remap/obfuscate virtual addresses Ian Rogers
2026-05-04 3:51 ` [PATCH v3 4/4] perf test: Add inject ASLR test Ian Rogers
2026-05-04 7:29 ` [PATCH v4 0/4] perf tools: Add inject --aslr feature and prerequisite robustness fixes Ian Rogers
2026-05-04 7:29 ` [PATCH v4 1/4] perf sched: Add missing mmap2 handler in timehist Ian Rogers
2026-05-04 7:29 ` [PATCH v4 2/4] perf tool: Fix missing schedstat delegates and dont_split_sample_group in delegate_tool Ian Rogers
2026-05-04 7:29 ` [PATCH v4 3/4] perf inject/aslr: Add aslr tool to remap/obfuscate virtual addresses Ian Rogers
2026-05-04 7:29 ` [PATCH v4 4/4] perf test: Add inject ASLR test Ian Rogers
2026-05-04 8:23 ` [PATCH v4 0/4] perf tools: Add inject --aslr feature and prerequisite robustness fixes Ian Rogers
2026-05-06 0:45 ` [PATCH v5 0/5] " Ian Rogers
2026-05-06 0:45 ` [PATCH v5 1/5] perf sched: Add missing mmap2 handler in timehist Ian Rogers
2026-05-06 13:22 ` Arnaldo Carvalho de Melo [this message]
2026-05-06 0:45 ` [PATCH v5 2/5] perf tool: Fix missing schedstat delegates and dont_split_sample_group in delegate_tool Ian Rogers
2026-05-06 0:45 ` [PATCH v5 3/5] perf symbols: Fix map removal sequence inside dso__process_kernel_symbol() Ian Rogers
2026-05-06 0:45 ` [PATCH v5 4/5] perf inject/aslr: Add aslr tool to remap/obfuscate virtual addresses Ian Rogers
2026-05-06 0:45 ` [PATCH v5 5/5] perf test: Add inject ASLR test Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aftAgoXnB6xuYGAt@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=gmx@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox