Skip to content

Commit 1351148

Browse files
SupremacistLevirostedt
authored andcommitted
ftrace: Use within_module to check rec->ip within specified module.
within_module_core && within_module_init condition is same to within module but it's more readable. Use within_module instead of former condition to check rec->ip within specified module area or not. Link: https://lore.kernel.org/linux-trace-kernel/20230803205236.32201-1-ppbuk5246@gmail.com Signed-off-by: Levi Yun <ppbuk5246@gmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 2933d3c commit 1351148

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/trace/ftrace.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6779,8 +6779,7 @@ void ftrace_release_mod(struct module *mod)
67796779
last_pg = &ftrace_pages_start;
67806780
for (pg = ftrace_pages_start; pg; pg = *last_pg) {
67816781
rec = &pg->records[0];
6782-
if (within_module_core(rec->ip, mod) ||
6783-
within_module_init(rec->ip, mod)) {
6782+
if (within_module(rec->ip, mod)) {
67846783
/*
67856784
* As core pages are first, the first
67866785
* page should never be a module page.
@@ -6852,8 +6851,7 @@ void ftrace_module_enable(struct module *mod)
68526851
* not part of this module, then skip this pg,
68536852
* which the "break" will do.
68546853
*/
6855-
if (!within_module_core(rec->ip, mod) &&
6856-
!within_module_init(rec->ip, mod))
6854+
if (!within_module(rec->ip, mod))
68576855
break;
68586856

68596857
/* Weak functions should still be ignored */

0 commit comments

Comments
 (0)