rcuperf: Warn on bad perf type for built-in tests
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 8 Jul 2018 01:26:50 +0000 (18:26 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 29 Aug 2018 16:20:48 +0000 (09:20 -0700)
When running a built-in rcuperf test, specifying an invalid perf type
results in what looks like a hard hang, with the error messages hidden
by other boot-time output.  This commit therefore executes a WARN_ON()
in this case so that the splat appears just following the error messages.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/rcuperf.c

index 34244523550e16e498754debe9917b7506c1196f..832ce68fd45fe8345d1a37c728f9dd32d673da3c 100644 (file)
@@ -680,6 +680,7 @@ rcu_perf_init(void)
                for (i = 0; i < ARRAY_SIZE(perf_ops); i++)
                        pr_cont(" %s", perf_ops[i]->name);
                pr_cont("\n");
+               WARN_ON(!IS_MODULE(CONFIG_RCU_PERF_TEST));
                firsterr = -EINVAL;
                goto unwind;
        }