mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tatsuya S <tatsuya.s2862@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tatsuya S <tatsuya.s2862@gmail.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: [PATCH] ftrace: Hide a extra entry in stack trace
Date: Mon, 23 Sep 2024 12:59:15 +0900	[thread overview]
Message-ID: <20240923035916.6567-1-tatsuya.s2862@gmail.com> (raw)

A extra entry is shown on stack trace(CONFIG_UNWINDER_ORC=y).

    [003] .....   110.171589: vfs_write <-__x64_sys_write
    [003] .....   110.171600: <stack trace>
 => XXXXXXXXX (Wrong function name)
 => vfs_write
 => __x64_sys_write
 => do_syscall_64
 => entry_SYSCALL_64_after_hwframe

To resolve this, increment skip in __ftrace_trace_stack().
The reason why skip is incremented in __ftrace_trace_stack()
is because __ftrace_trace_stack() in stack trace is the only function
that wasn't skipped from anywhere.

Signed-off-by: Tatsuya S <tatsuya.s2862@gmail.com>
---
 kernel/trace/trace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c3b2c7dfadef..e0d98621ff23 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2919,6 +2919,8 @@ static void __ftrace_trace_stack(struct trace_buffer *buffer,
 #ifndef CONFIG_UNWINDER_ORC
 	if (!regs)
 		skip++;
+#else
+	skip++;
 #endif
 
 	preempt_disable_notrace();
-- 
2.46.1


             reply	other threads:[~2024-09-23  3:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23  3:59 Tatsuya S [this message]
2024-09-26  5:05 ` Steven Rostedt
2024-09-26  5:43   ` ts

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=20240923035916.6567-1-tatsuya.s2862@gmail.com \
    --to=tatsuya.s2862@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --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

all inboxes | Powered by JetHome®