From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vincent Donnefort <vdonnefort@google.com>,
Joel Fernandes <joel@joelfernandes.org>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
suleiman@google.com, Thomas Gleixner <tglx@linutronix.de>,
Vineeth Pillai <vineeth@bitbyteword.org>,
Youssef Esmat <youssefesmat@google.com>,
Beau Belgrave <beaub@linux.microsoft.com>,
Alexander Graf <graf@amazon.com>, Baoquan He <bhe@redhat.com>,
Borislav Petkov <bp@alien8.de>,
"Paul E. McKenney" <paulmck@kernel.org>,
David Howells <dhowells@redhat.com>,
Mike Rapoport <rppt@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Tony Luck <tony.luck@intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Ross Zwisler <zwisler@google.com>,
Kees Cook <keescook@chromium.org>
Subject: [PATCH v3 13/13] tracing: Add last boot delta offset for stack traces
Date: Thu, 06 Jun 2024 17:17:48 -0400 [thread overview]
Message-ID: <20240606212138.138119709@goodmis.org> (raw)
In-Reply-To: 20240606211735.684785459@goodmis.org
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
The addresses of a stack trace event are relative to the kallsyms. As that
can change between boots, when printing the stack trace from a buffer that
was from the last boot, it needs all the addresses to be added to the
"text_delta" that gives the delta between the addresses of the functions
for the current boot compared to the address of the last boot. Then it can
be passed to kallsyms to find the function name, otherwise it just shows a
useless list of addresses.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
kernel/trace/trace_output.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index b9d2c64c0648..48de93598897 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -1233,6 +1233,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
struct trace_seq *s = &iter->seq;
unsigned long *p;
unsigned long *end;
+ long delta = iter->tr->text_delta;
trace_assign_type(field, iter->ent);
end = (unsigned long *)((long)iter->ent + iter->ent_size);
@@ -1245,7 +1246,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
break;
trace_seq_puts(s, " => ");
- seq_print_ip_sym(s, *p, flags);
+ seq_print_ip_sym(s, (*p) + delta, flags);
trace_seq_putc(s, '\n');
}
--
2.43.0
prev parent reply other threads:[~2024-06-06 21:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 21:17 [PATCH v3 00/13] tracing: Persistent traces across a reboot or crash Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 01/13] ring-buffer: Allow mapped field to be set without mapping Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 02/13] ring-buffer: Add ring_buffer_alloc_range() Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 03/13] ring-buffer: Add ring_buffer_meta data Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 04/13] tracing: Implement creating an instance based on a given memory region Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 05/13] ring-buffer: Add output of ring buffer meta page Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 06/13] ring-buffer: Add test if range of boot buffer is valid Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 07/13] ring-buffer: Validate boot range memory events Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 08/13] tracing: Add option to use memmapped memory for trace boot instance Steven Rostedt
2024-06-06 21:26 ` Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 09/13] ring-buffer: Save text and data locations in mapped meta data Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 10/13] tracing/ring-buffer: Add last_boot_info file to boot instance Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 11/13] tracing: Handle old buffer mappings for event strings and functions Steven Rostedt
2024-06-06 21:17 ` [PATCH v3 12/13] tracing: Update function tracing output for previous boot buffer Steven Rostedt
2024-06-06 21:17 ` Steven Rostedt [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=20240606212138.138119709@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=beaub@linux.microsoft.com \
--cc=bhe@redhat.com \
--cc=bp@alien8.de \
--cc=bristot@redhat.com \
--cc=dave.hansen@linux.intel.com \
--cc=dhowells@redhat.com \
--cc=graf@amazon.com \
--cc=joel@joelfernandes.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=suleiman@google.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=vdonnefort@google.com \
--cc=vineeth@bitbyteword.org \
--cc=youssefesmat@google.com \
--cc=zwisler@google.com \
/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).