Skip to content

Commit 030f4e1

Browse files
committed
ftrace: Fix output of enabled_functions for showing tramp
When showing all tramps registered to a ftrace record in the file enabled_functions, it exits the loop with ops == NULL. But then it is suppose to show the function on the ops->trampoline and add_trampoline_func() is called with the given ops. But because ops is now NULL (to exit the loop), it always shows the static trampoline instead of the one that is really registered to the record. The call to add_trampoline_func() that shows the trampoline for the given ops needs to be called at every iteration. Fixes: 39daa7b "ftrace: Show all tramps registered to a record on ftrace_bug()" Signed-off-by: Steven Rostedt <[email protected]>
1 parent b8ec330 commit 030f4e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kernel/trace/ftrace.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3322,7 +3322,7 @@ static int t_show(struct seq_file *m, void *v)
33223322

33233323
seq_printf(m, "%ps", (void *)rec->ip);
33243324
if (iter->flags & FTRACE_ITER_ENABLED) {
3325-
struct ftrace_ops *ops = NULL;
3325+
struct ftrace_ops *ops;
33263326

33273327
seq_printf(m, " (%ld)%s%s",
33283328
ftrace_rec_count(rec),
@@ -3335,13 +3335,14 @@ static int t_show(struct seq_file *m, void *v)
33353335
seq_printf(m, "\ttramp: %pS (%pS)",
33363336
(void *)ops->trampoline,
33373337
(void *)ops->func);
3338+
add_trampoline_func(m, ops, rec);
33383339
ops = ftrace_find_tramp_ops_next(rec, ops);
33393340
} while (ops);
33403341
} else
33413342
seq_puts(m, "\ttramp: ERROR!");
3342-
3343+
} else {
3344+
add_trampoline_func(m, NULL, rec);
33433345
}
3344-
add_trampoline_func(m, ops, rec);
33453346
}
33463347

33473348
seq_putc(m, '\n');

0 commit comments

Comments
 (0)