From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: James Clark <james.clark@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Leo Yan <leo.yan@arm.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tools: Dump callchain context marker names
Date: Tue, 13 Jan 2026 17:37:13 -0300 [thread overview]
Message-ID: <aWas-QjeSE1iB_Zt@x1> (raw)
In-Reply-To: <aVhJRW9URWItj2fh@google.com>
On Fri, Jan 02, 2026 at 02:40:05PM -0800, Namhyung Kim wrote:
> Hi James,
>
> Happy new year!
>
> On Fri, Jan 02, 2026 at 12:15:43PM +0000, James Clark wrote:
> > These are hard to interpret in the raw output because they are printed
> > as hex but are defined in perf_event.h as decimal. Make it much easier
> > to read the raw callchains by just printing their names.
> >
> > For example:
> >
> > $ perf report -D
> >
> > 1798195372321 0x4638 [0xb0]: PERF_RECORD_SAMPLE(IP, 0x4002): 44922/44922: 0x7c8046dd3400 period: 120218 addr: 0
> > ... FP chain: nr:12
> > ..... 0: fffffffffffffe00 (PERF_CONTEXT_USER)
> > ..... 1: 00007c8046dd3400
> > ..... 2: 00007c8046db86d3
> >
> > Signed-off-by: James Clark <james.clark@linaro.org>
> > ---
> > tools/perf/util/session.c | 25 +++++++++++++++++++++++--
> > 1 file changed, 23 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> > index 4236503c8f6c..e812f8954075 100644
> > --- a/tools/perf/util/session.c
> > +++ b/tools/perf/util/session.c
> > @@ -841,6 +841,26 @@ static void callchain__lbr_callstack_printf(struct perf_sample *sample)
> > }
> > }
> >
> > +static const char *callchain_context_str(u64 ip)
> > +{
> > + switch (ip) {
> > + case PERF_CONTEXT_HV:
> > + return " (PERF_CONTEXT_HV)";
> > + case PERF_CONTEXT_KERNEL:
> > + return " (PERF_CONTEXT_KERNEL)";
> > + case PERF_CONTEXT_USER:
> > + return " (PERF_CONTEXT_USER)";
>
> We now have PERF_CONTEXT_USER_DEFERRED too.
I ammended the patch with:
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e812f89540755f31..65fa9bdff1b8cdf2 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -856,6 +856,8 @@ static const char *callchain_context_str(u64 ip)
return " (PERF_CONTEXT_GUEST_KERNEL)";
case PERF_CONTEXT_GUEST_USER:
return " (PERF_CONTEXT_GUEST_USER)";
+ case PERF_CONTEXT_USER_DEFERRED:
+ return " (PERF_CONTEXT_USER_DEFERRED)";
default:
return "";
}
⬢ [acme@toolbx perf-tools-next]$
And added a note about being Namhyung who made the suggestion, thanks.
- Arnaldo
prev parent reply other threads:[~2026-01-13 20:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 12:15 [PATCH] perf tools: Dump callchain context marker names James Clark
2026-01-02 12:18 ` Ian Rogers
2026-01-13 20:33 ` Arnaldo Carvalho de Melo
2026-01-02 22:40 ` Namhyung Kim
2026-01-13 20:37 ` Arnaldo Carvalho de Melo [this message]
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=aWas-QjeSE1iB_Zt@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.