mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 16:53:58 -05:00
locktorture,rcutorture,torture: Always log error message
Unconditionally log messages corresponding to errors. Acked-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Li Zhijian <zhijianx.li@intel.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
809da9bf80
commit
81faa4f6fb
4 changed files with 10 additions and 15 deletions
|
@ -38,13 +38,8 @@ do { \
|
||||||
pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); \
|
pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define VERBOSE_TOROUT_ERRSTRING(s) \
|
#define TOROUT_ERRSTRING(s) \
|
||||||
do { \
|
pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s)
|
||||||
if (verbose) { \
|
|
||||||
verbose_torout_sleep(); \
|
|
||||||
pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
void verbose_torout_sleep(void);
|
void verbose_torout_sleep(void);
|
||||||
|
|
||||||
#define torture_init_error(firsterr) \
|
#define torture_init_error(firsterr) \
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ static int __init lock_torture_init(void)
|
||||||
sizeof(writer_tasks[0]),
|
sizeof(writer_tasks[0]),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (writer_tasks == NULL) {
|
if (writer_tasks == NULL) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("writer_tasks: Out of memory");
|
TOROUT_ERRSTRING("writer_tasks: Out of memory");
|
||||||
firsterr = -ENOMEM;
|
firsterr = -ENOMEM;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
@ -1058,7 +1058,7 @@ static int __init lock_torture_init(void)
|
||||||
sizeof(reader_tasks[0]),
|
sizeof(reader_tasks[0]),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (reader_tasks == NULL) {
|
if (reader_tasks == NULL) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("reader_tasks: Out of memory");
|
TOROUT_ERRSTRING("reader_tasks: Out of memory");
|
||||||
kfree(writer_tasks);
|
kfree(writer_tasks);
|
||||||
writer_tasks = NULL;
|
writer_tasks = NULL;
|
||||||
firsterr = -ENOMEM;
|
firsterr = -ENOMEM;
|
||||||
|
|
|
@ -2774,7 +2774,7 @@ static int rcu_torture_read_exit(void *unused)
|
||||||
&trs, "%s",
|
&trs, "%s",
|
||||||
"rcu_torture_read_exit_child");
|
"rcu_torture_read_exit_child");
|
||||||
if (IS_ERR(tsp)) {
|
if (IS_ERR(tsp)) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("out of memory");
|
TOROUT_ERRSTRING("out of memory");
|
||||||
errexit = true;
|
errexit = true;
|
||||||
tsp = NULL;
|
tsp = NULL;
|
||||||
break;
|
break;
|
||||||
|
@ -3101,7 +3101,7 @@ rcu_torture_init(void)
|
||||||
sizeof(fakewriter_tasks[0]),
|
sizeof(fakewriter_tasks[0]),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (fakewriter_tasks == NULL) {
|
if (fakewriter_tasks == NULL) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("out of memory");
|
TOROUT_ERRSTRING("out of memory");
|
||||||
firsterr = -ENOMEM;
|
firsterr = -ENOMEM;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
@ -3117,7 +3117,7 @@ rcu_torture_init(void)
|
||||||
rcu_torture_reader_mbchk = kcalloc(nrealreaders, sizeof(*rcu_torture_reader_mbchk),
|
rcu_torture_reader_mbchk = kcalloc(nrealreaders, sizeof(*rcu_torture_reader_mbchk),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!reader_tasks || !rcu_torture_reader_mbchk) {
|
if (!reader_tasks || !rcu_torture_reader_mbchk) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("out of memory");
|
TOROUT_ERRSTRING("out of memory");
|
||||||
firsterr = -ENOMEM;
|
firsterr = -ENOMEM;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
@ -3136,7 +3136,7 @@ rcu_torture_init(void)
|
||||||
if (nrealnocbers > 0) {
|
if (nrealnocbers > 0) {
|
||||||
nocb_tasks = kcalloc(nrealnocbers, sizeof(nocb_tasks[0]), GFP_KERNEL);
|
nocb_tasks = kcalloc(nrealnocbers, sizeof(nocb_tasks[0]), GFP_KERNEL);
|
||||||
if (nocb_tasks == NULL) {
|
if (nocb_tasks == NULL) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("out of memory");
|
TOROUT_ERRSTRING("out of memory");
|
||||||
firsterr = -ENOMEM;
|
firsterr = -ENOMEM;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
|
@ -570,7 +570,7 @@ int torture_shuffle_init(long shuffint)
|
||||||
shuffle_idle_cpu = -1;
|
shuffle_idle_cpu = -1;
|
||||||
|
|
||||||
if (!alloc_cpumask_var(&shuffle_tmp_mask, GFP_KERNEL)) {
|
if (!alloc_cpumask_var(&shuffle_tmp_mask, GFP_KERNEL)) {
|
||||||
VERBOSE_TOROUT_ERRSTRING("Failed to alloc mask");
|
TOROUT_ERRSTRING("Failed to alloc mask");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -934,7 +934,7 @@ int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m,
|
||||||
*tp = kthread_run(fn, arg, "%s", s);
|
*tp = kthread_run(fn, arg, "%s", s);
|
||||||
if (IS_ERR(*tp)) {
|
if (IS_ERR(*tp)) {
|
||||||
ret = PTR_ERR(*tp);
|
ret = PTR_ERR(*tp);
|
||||||
VERBOSE_TOROUT_ERRSTRING(f);
|
TOROUT_ERRSTRING(f);
|
||||||
*tp = NULL;
|
*tp = NULL;
|
||||||
}
|
}
|
||||||
torture_shuffle_task_register(*tp);
|
torture_shuffle_task_register(*tp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue