Skip to content

Commit 1d8f657

Browse files
zongboxpaul-walmsley-sifive
authored andcommitted
riscv: ftrace: correct the condition logic in function graph tracer
The condition should be logical NOT to assign the hook address to parent address. Because the return value 0 of function_graph_enter upon success. Fixes: e949b6d (riscv/function_graph: Simplify with function_graph_enter()) Signed-off-by: Zong Li <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]> Cc: [email protected] Signed-off-by: Paul Walmsley <[email protected]>
1 parent cfda861 commit 1d8f657

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
142142
*/
143143
old = *parent;
144144

145-
if (function_graph_enter(old, self_addr, frame_pointer, parent))
145+
if (!function_graph_enter(old, self_addr, frame_pointer, parent))
146146
*parent = return_hooker;
147147
}
148148

0 commit comments

Comments
 (0)