Skip to content

Commit 5120d16

Browse files
ThinkerYzu1mhiramat
authored andcommitted
rethook: Remove warning messages printed for finding return address of a frame.
The function rethook_find_ret_addr() prints a warning message and returns 0 when the target task is running and is not the "current" task in order to prevent the incorrect return address, although it still may return an incorrect address. However, the warning message turns into noise when BPF profiling programs call bpf_get_task_stack() on running tasks in a firm with a large number of hosts. The callers should be aware and willing to take the risk of receiving an incorrect return address from a task that is currently running other than the "current" one. A warning is not needed here as the callers are intent on it. Link: https://lore.kernel.org/all/[email protected]/ Acked-by: Andrii Nakryiko <[email protected]> Acked-by: John Fastabend <[email protected]> Signed-off-by: Kui-Feng Lee <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent 73142ca commit 5120d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/rethook.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ unsigned long rethook_find_ret_addr(struct task_struct *tsk, unsigned long frame
248248
if (WARN_ON_ONCE(!cur))
249249
return 0;
250250

251-
if (WARN_ON_ONCE(tsk != current && task_is_running(tsk)))
251+
if (tsk != current && task_is_running(tsk))
252252
return 0;
253253

254254
do {

0 commit comments

Comments
 (0)