Skip to content

Commit 7cfeb90

Browse files
committed
tracing: Update function tracing output for previous boot buffer
For a persistent ring buffer that is saved across boots, if function tracing was performed in the previous boot, it only saves the address of the functions and uses "%pS" to print their names. But the current boot, those functions may be in different locations. The persistent meta-data saves the text delta between the two boots and can be used to find the address of the saved function of where it is located in the current boot. Link: https://lkml.kernel.org/r/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Vincent Donnefort <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Daniel Bristot de Oliveira <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vineeth Pillai <[email protected]> Cc: Youssef Esmat <[email protected]> Cc: Beau Belgrave <[email protected]> Cc: Alexander Graf <[email protected]> Cc: Baoquan He <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: David Howells <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Tony Luck <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Ross Zwisler <[email protected]> Cc: Kees Cook <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 07714b4 commit 7cfeb90

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/trace/trace_output.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,11 @@ enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags,
990990
}
991991

992992
static void print_fn_trace(struct trace_seq *s, unsigned long ip,
993-
unsigned long parent_ip, int flags)
993+
unsigned long parent_ip, long delta, int flags)
994994
{
995+
ip += delta;
996+
parent_ip += delta;
997+
995998
seq_print_ip_sym(s, ip, flags);
996999

9971000
if ((flags & TRACE_ITER_PRINT_PARENT) && parent_ip) {
@@ -1009,7 +1012,7 @@ static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags,
10091012

10101013
trace_assign_type(field, iter->ent);
10111014

1012-
print_fn_trace(s, field->ip, field->parent_ip, flags);
1015+
print_fn_trace(s, field->ip, field->parent_ip, iter->tr->text_delta, flags);
10131016
trace_seq_putc(s, '\n');
10141017

10151018
return trace_handle_return(s);
@@ -1674,7 +1677,7 @@ trace_func_repeats_print(struct trace_iterator *iter, int flags,
16741677

16751678
trace_assign_type(field, iter->ent);
16761679

1677-
print_fn_trace(s, field->ip, field->parent_ip, flags);
1680+
print_fn_trace(s, field->ip, field->parent_ip, iter->tr->text_delta, flags);
16781681
trace_seq_printf(s, " (repeats: %u, last_ts:", field->count);
16791682
trace_print_time(s, iter,
16801683
iter->ts - FUNC_REPEATS_GET_DELTA_TS(field));

0 commit comments

Comments
 (0)