From: Donglin Peng <dolinux.peng@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
pengdonglin <pengdonglin@xiaomi.com>
Subject: [PATCH v1 0/2] Use BTF to trim return values
Date: Sun, 7 Dec 2025 22:27:40 +0800 [thread overview]
Message-ID: <20251207142742.229924-1-dolinux.peng@gmail.com> (raw)
From: pengdonglin <pengdonglin@xiaomi.com>
The current funcgraph-retval implementation has two limitations:
1. It prints a return value even when the traced function returns void.
2. When the return type is narrower than a register, the printed value may
be incorrect because high bits can contain undefined data.
Both issues are addressed by using BTF to obtain the precise return type
of each traced function:
- Return values are now printed only for functions whose return type is
not void.
- The value is truncated to the actual width of the return type, ensuring
correct representation.
These changes make the funcgraph-retval output more accurate and remove
noise from void functions.
pengdonglin (2):
fgraph: use BTF to trim and filter return values
tracing: Update funcgraph-retval documentation
Documentation/trace/ftrace.rst | 74 +++++++++++++++-------------
kernel/trace/trace_functions_graph.c | 64 ++++++++++++++++++++----
2 files changed, 94 insertions(+), 44 deletions(-)
--
2.34.1
next reply other threads:[~2025-12-07 14:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-07 14:27 Donglin Peng [this message]
2025-12-07 14:27 ` [PATCH v1 1/2] fgraph: use BTF to trim and filter return values Donglin Peng
2025-12-07 14:27 ` [PATCH v1 2/2] tracing: Update funcgraph-retval documentation Donglin Peng
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=20251207142742.229924-1-dolinux.peng@gmail.com \
--to=dolinux.peng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=pengdonglin@xiaomi.com \
--cc=rostedt@goodmis.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