History

scftorture: Always log error message

Unconditionally log messages corresponding to errors.

Li Zhijian committed 5 years ago

Commit 809da9b1 parent 86e7ed11 file · +4 −5Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/scftorture.c+4−5
@@ -41,8 +41,7 @@ · 40 unmodified lines
41#define VERBOSE_SCFTORTOUT(s, x...) \41#define VERBOSE_SCFTORTOUT(s, x...) \
42 do { if (verbose) pr_alert(SCFTORT_FLAG s "\n", ## x); } while (0)42 do { if (verbose) pr_alert(SCFTORT_FLAG s "\n", ## x); } while (0)
43 43
44#define VERBOSE_SCFTORTOUT_ERRSTRING(s, x...) \44#define SCFTORTOUT_ERRSTRING(s, x...) pr_alert(SCFTORT_FLAG "!!! " s "\n", ## x)
45 do { if (verbose) pr_alert(SCFTORT_FLAG "!!! " s "\n", ## x); } while (0)
46 45
47MODULE_LICENSE("GPL");46MODULE_LICENSE("GPL");
48MODULE_AUTHOR("Paul E. McKenney <paulmck@kernel.org>");47MODULE_AUTHOR("Paul E. McKenney <paulmck@kernel.org>");
@@ -584,14 +583,14 @@ static int __init scf_torture_init(void) · 535 unmodified lines
584 if (weight_resched1 == 0 && weight_single1 == 0 && weight_single_rpc1 == 0 &&583 if (weight_resched1 == 0 && weight_single1 == 0 && weight_single_rpc1 == 0 &&
585 weight_single_wait1 == 0 && weight_many1 == 0 && weight_many_wait1 == 0 &&584 weight_single_wait1 == 0 && weight_many1 == 0 && weight_many_wait1 == 0 &&
586 weight_all1 == 0 && weight_all_wait1 == 0) {585 weight_all1 == 0 && weight_all_wait1 == 0) {
587 VERBOSE_SCFTORTOUT_ERRSTRING("all zero weights makes no sense");586 SCFTORTOUT_ERRSTRING("all zero weights makes no sense");
588 firsterr = -EINVAL;587 firsterr = -EINVAL;
589 goto unwind;588 goto unwind;
590 }589 }
591 if (IS_BUILTIN(CONFIG_SCF_TORTURE_TEST))590 if (IS_BUILTIN(CONFIG_SCF_TORTURE_TEST))
592 scf_sel_add(weight_resched1, SCF_PRIM_RESCHED, false);591 scf_sel_add(weight_resched1, SCF_PRIM_RESCHED, false);
593 else if (weight_resched1)592 else if (weight_resched1)
594 VERBOSE_SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored");593 SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored");
595 scf_sel_add(weight_single1, SCF_PRIM_SINGLE, false);594 scf_sel_add(weight_single1, SCF_PRIM_SINGLE, false);
596 scf_sel_add(weight_single_rpc1, SCF_PRIM_SINGLE_RPC, true);595 scf_sel_add(weight_single_rpc1, SCF_PRIM_SINGLE_RPC, true);
597 scf_sel_add(weight_single_wait1, SCF_PRIM_SINGLE, true);596 scf_sel_add(weight_single_wait1, SCF_PRIM_SINGLE, true);
@@ -622,7 +621,7 @@ static int __init scf_torture_init(void) · 24 unmodified lines
622 nthreads = num_online_cpus();621 nthreads = num_online_cpus();
623 scf_stats_p = kcalloc(nthreads, sizeof(scf_stats_p[0]), GFP_KERNEL);622 scf_stats_p = kcalloc(nthreads, sizeof(scf_stats_p[0]), GFP_KERNEL);
624 if (!scf_stats_p) {623 if (!scf_stats_p) {
625 VERBOSE_SCFTORTOUT_ERRSTRING("out of memory");624 SCFTORTOUT_ERRSTRING("out of memory");
626 firsterr = -ENOMEM;625 firsterr = -ENOMEM;
627 goto unwind;626 goto unwind;
628 }627 }