Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Check the return value of tracing_update_buffers()

In the very unlikely event that tracing_update_buffers() fails in
trace_printk_init_buffers(), report the failure so that it is known.

Link: https://lore.kernel.org/all/20220917020353.3836285-1-floridsleeves@gmail.com/

Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20260107161510.4dc98b15@gandalf.local.home
Suggested-by: Li Zhong <floridsleeves@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+4 -3
+4 -3
kernel/trace/trace.c
··· 3309 3309 pr_warn("**********************************************************\n"); 3310 3310 3311 3311 /* Expand the buffers to set size */ 3312 - tracing_update_buffers(&global_trace); 3313 - 3314 - buffers_allocated = 1; 3312 + if (tracing_update_buffers(&global_trace) < 0) 3313 + pr_err("Failed to expand tracing buffers for trace_printk() calls\n"); 3314 + else 3315 + buffers_allocated = 1; 3315 3316 3316 3317 /* 3317 3318 * trace_printk_init_buffers() can be called by modules.