Skip to content

Commit dbf83b6

Browse files
committed
scftorture: Flag errors in torture-compatible manner
This commit prints error counts on the statistics line and also adds a "!!!" if any of the counters are non-zero. Allocation failures are (somewhat) forgiven, but all other errors result in a "FAILURE" print at the end of the test. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 4df55bd commit dbf83b6

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

kernel/scftorture.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static atomic_t n_mb_in_errs;
132132
static atomic_t n_mb_out_errs;
133133
static atomic_t n_alloc_errs;
134134
static bool scfdone;
135+
static char *bangstr = "";
135136

136137
DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
137138

@@ -156,12 +157,17 @@ static void scf_torture_stats_print(void)
156157
scfs.n_all += scf_stats_p[i].n_all;
157158
scfs.n_all_wait += scf_stats_p[i].n_all_wait;
158159
}
159-
pr_alert("%s scf_invoked_count %s: %lld single: %lld/%lld single_ofl: %lld/%lld many: %lld/%lld all: %lld/%lld ",
160-
SCFTORT_FLAG, isdone ? "VER" : "ver", invoked_count,
160+
if (atomic_read(&n_errs) || atomic_read(&n_mb_in_errs) ||
161+
atomic_read(&n_mb_out_errs) || atomic_read(&n_alloc_errs))
162+
bangstr = "!!! ";
163+
pr_alert("%s %sscf_invoked_count %s: %lld single: %lld/%lld single_ofl: %lld/%lld many: %lld/%lld all: %lld/%lld ",
164+
SCFTORT_FLAG, bangstr, isdone ? "VER" : "ver", invoked_count,
161165
scfs.n_single, scfs.n_single_wait, scfs.n_single_ofl, scfs.n_single_wait_ofl,
162166
scfs.n_many, scfs.n_many_wait, scfs.n_all, scfs.n_all_wait);
163167
torture_onoff_stats();
164-
pr_cont("\n");
168+
pr_cont("ste: %d stnmie: %d stnmoe: %d staf: %d\n", atomic_read(&n_errs),
169+
atomic_read(&n_mb_in_errs), atomic_read(&n_mb_out_errs),
170+
atomic_read(&n_alloc_errs));
165171
}
166172

167173
// Periodically prints torture statistics, if periodic statistics printing
@@ -431,7 +437,7 @@ static void scf_torture_cleanup(void)
431437
kfree(scf_stats_p); // -After- the last stats print has completed!
432438
scf_stats_p = NULL;
433439

434-
if (atomic_read(&n_errs))
440+
if (atomic_read(&n_errs) || atomic_read(&n_mb_in_errs) || atomic_read(&n_mb_out_errs))
435441
scftorture_print_module_parms("End of test: FAILURE");
436442
else if (torture_onoff_failures())
437443
scftorture_print_module_parms("End of test: LOCK_HOTPLUG");

0 commit comments

Comments
 (0)