Skip to content

Commit fd3dc56

Browse files
committed
ftrace/x86: Add back ftrace_expected for ftrace bug reports
After someone reported a bug report with a failed modification due to the expected value not matching what was found, it came to my attention that the ftrace_expected is no longer set when that happens. This makes for debugging the issue a bit more difficult. Set ftrace_expected to the expected code before calling ftrace_bug, so that it shows what was expected and why it failed. Link: https://lore.kernel.org/all/CA+wXwBQ-VhK+hpBtYtyZP-NiX4g8fqRRWithFOHQW-0coQ3vLg@mail.gmail.com/ Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "[email protected]" <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: [email protected] Fixes: 768ae44 ("x86/ftrace: Use text_poke()") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 46a5cd8 commit fd3dc56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kernel/ftrace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ void ftrace_replace_code(int enable)
217217

218218
ret = ftrace_verify_code(rec->ip, old);
219219
if (ret) {
220+
ftrace_expected = old;
220221
ftrace_bug(ret, rec);
222+
ftrace_expected = NULL;
221223
return;
222224
}
223225
}

0 commit comments

Comments
 (0)