mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
tracing: Have function_graph selftest call cond_resched()
When all kernel debugging is enabled (lockdep, KSAN, etc), the function graph enabling and disabling can take several seconds to complete. The function_graph selftest enables and disables function graph tracing several times. With full debugging enabled, the soft lockup watchdog was triggering because the selftest was running without ever scheduling. Add cond_resched() throughout the test to make sure it does not trigger the soft lockup detector. Link: https://lkml.kernel.org/r/20230528051742.1325503-6-rostedt@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
@@ -848,6 +848,12 @@ trace_selftest_startup_function_graph(struct tracer *trace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
|
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
|
||||||
|
/*
|
||||||
|
* These tests can take some time to run. Make sure on non PREEMPT
|
||||||
|
* kernels, we do not trigger the softlockup detector.
|
||||||
|
*/
|
||||||
|
cond_resched();
|
||||||
|
|
||||||
tracing_reset_online_cpus(&tr->array_buffer);
|
tracing_reset_online_cpus(&tr->array_buffer);
|
||||||
set_graph_array(tr);
|
set_graph_array(tr);
|
||||||
|
|
||||||
@@ -869,6 +875,8 @@ trace_selftest_startup_function_graph(struct tracer *trace,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
cond_resched();
|
||||||
|
|
||||||
ret = register_ftrace_graph(&fgraph_ops);
|
ret = register_ftrace_graph(&fgraph_ops);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
warn_failed_init_tracer(trace, ret);
|
warn_failed_init_tracer(trace, ret);
|
||||||
@@ -891,6 +899,8 @@ trace_selftest_startup_function_graph(struct tracer *trace,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
cond_resched();
|
||||||
|
|
||||||
tracing_start();
|
tracing_start();
|
||||||
|
|
||||||
if (!ret && !count) {
|
if (!ret && !count) {
|
||||||
|
Reference in New Issue
Block a user