]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
torture: Dump ftrace at shutdown only if requested
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 16 Jun 2020 22:38:24 +0000 (15:38 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 29 Jun 2020 19:01:45 +0000 (12:01 -0700)
If there is a large number of torture tests running concurrently,
all of which are dumping large ftrace buffers at shutdown time, the
resulting dumping can take a very long time, particularly on systems
with rotating-rust storage.  This commit therefore adds a default-off
torture.ftrace_dump_at_shutdown module parameter that enables
shutdown-time ftrace-buffer dumping.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Documentation/admin-guide/kernel-parameters.txt
kernel/torture.c

index a0dcc925c8a2ba840f5e42a34e1b8c6ec6039b57..9f11ff80d4ad82a61ca44806f63460db818dfbdf 100644 (file)
                        Prevent the CPU-hotplug component of torturing
                        until after init has spawned.
 
+       torture.ftrace_dump_at_shutdown= [KNL]
+                       Dump the ftrace buffer at torture-test shutdown,
+                       even if there were no errors.  This can be a
+                       very costly operation when many torture tests
+                       are running concurrently, especially on systems
+                       with rotating-rust storage.
+
        tp720=          [HW,PS2]
 
        tpm_suspend_pcr=[HW,TPM]
index a1a41484ff6d6688bef6def0974d9df9d020b278..1061492f14bd9ee81cc80055188a420a10137891 100644 (file)
@@ -45,6 +45,9 @@ MODULE_AUTHOR("Paul E. McKenney <paulmck@linux.ibm.com>");
 static bool disable_onoff_at_boot;
 module_param(disable_onoff_at_boot, bool, 0444);
 
+static bool ftrace_dump_at_shutdown;
+module_param(ftrace_dump_at_shutdown, bool, 0444);
+
 static char *torture_type;
 static int verbose;
 
@@ -527,7 +530,8 @@ static int torture_shutdown(void *arg)
                torture_shutdown_hook();
        else
                VERBOSE_TOROUT_STRING("No torture_shutdown_hook(), skipping.");
-       rcu_ftrace_dump(DUMP_ALL);
+       if (ftrace_dump_at_shutdown)
+               rcu_ftrace_dump(DUMP_ALL);
        kernel_power_off();     /* Shut down the system. */
        return 0;
 }