From: Ahmed Atef El-Emary <ahmed.software.engineer1@gmail.com>
To: acme@kernel.org
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
namhyung@kernel.org, irogers@google.com, jolsa@kernel.org,
adrian.hunter@intel.com, ahmed.software.engineer1@gmail.com
Subject: [PATCH] perf trace: Use consistent print_opts formatting in trace__fprintf_callchain()
Date: Tue, 26 Aug 2025 11:08:11 +0300 [thread overview]
Message-ID: <20250826080811.27650-1-ahmed.software.engineer1@gmail.com> (raw)
trace__fprintf_callchain() previously omitted IP and symoffset from its
print_opts, unlike other callchain printers in perf. This resulted in
less detailed and inconsistent callchain output.
Add EVSEL__PRINT_IP and EVSEL__PRINT_SYMOFFSET to make the output more
consistent and informative. The callchain output now includes IP, symbol
offset, DSO, and falls back to the raw address when no symbol is found,
matching the detail level of other perf callchain outputs.
Signed-off-by: Ahmed Atef El-Emary <ahmed.software.engineer1@gmail.com>
---
tools/perf/builtin-trace.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index fe737b3ac6e6..20f3488d4a21 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2892,8 +2892,10 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_sample *sam
{
/* TODO: user-configurable print_opts */
const unsigned int print_opts = EVSEL__PRINT_SYM |
- EVSEL__PRINT_DSO |
- EVSEL__PRINT_UNKNOWN_AS_ADDR;
+ EVSEL__PRINT_DSO |
+ EVSEL__PRINT_UNKNOWN_AS_ADDR |
+ EVSEL__PRINT_IP |
+ EVSEL__PRINT_SYMOFFSET;
return sample__fprintf_callchain(sample, 38, print_opts, get_tls_callchain_cursor(), symbol_conf.bt_stop_list, trace->output);
}
--
2.43.0
reply other threads:[~2025-08-26 8:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250826080811.27650-1-ahmed.software.engineer1@gmail.com \
--to=ahmed.software.engineer1@gmail.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.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;
as well as URLs for NNTP newsgroup(s).