Skip to content

Commit

Permalink
ftrace: Fix the possible incorrect kernel message
Browse files Browse the repository at this point in the history
commit 08948caebe93482db1adfd2154eba124f66d161d upstream.

If the number of mcount entries is an integer multiple of
ENTRIES_PER_PAGE, the page count showing on the console would be wrong.

Link: https://lkml.kernel.org/r/[email protected]

Cc: <[email protected]>
Cc: <[email protected]>
Cc: [email protected]
Fixes: 5821e1b ("function tracing: fix wrong pos computing when read buffer has been fulfilled")
Signed-off-by: Wang Wensheng <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Wang Wensheng authored and gregkh committed Nov 25, 2022
1 parent 04e9e5e commit 3041fee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6259,7 +6259,7 @@ void __init ftrace_init(void)
}

pr_info("ftrace: allocating %ld entries in %ld pages\n",
count, count / ENTRIES_PER_PAGE + 1);
count, DIV_ROUND_UP(count, ENTRIES_PER_PAGE));

last_ftrace_enabled = ftrace_enabled = 1;

Expand Down

0 comments on commit 3041fee

Please sign in to comment.