diff options
Diffstat (limited to 'kernel/locking')
-rw-r--r-- | kernel/locking/locktorture.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 414ba45d580f..a6049fa2287e 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c | |||
@@ -64,6 +64,7 @@ torture_param(int, stutter, 5, "Number of jiffies to run/halt test, 0=disable"); | |||
64 | torture_param(bool, verbose, true, | 64 | torture_param(bool, verbose, true, |
65 | "Enable verbose debugging printk()s"); | 65 | "Enable verbose debugging printk()s"); |
66 | 66 | ||
67 | static bool debug_lock = false; | ||
67 | static char *torture_type = "spin_lock"; | 68 | static char *torture_type = "spin_lock"; |
68 | module_param(torture_type, charp, 0444); | 69 | module_param(torture_type, charp, 0444); |
69 | MODULE_PARM_DESC(torture_type, | 70 | MODULE_PARM_DESC(torture_type, |
@@ -349,8 +350,9 @@ lock_torture_print_module_parms(struct lock_torture_ops *cur_ops, | |||
349 | const char *tag) | 350 | const char *tag) |
350 | { | 351 | { |
351 | pr_alert("%s" TORTURE_FLAG | 352 | pr_alert("%s" TORTURE_FLAG |
352 | "--- %s: nwriters_stress=%d stat_interval=%d verbose=%d shuffle_interval=%d stutter=%d shutdown_secs=%d onoff_interval=%d onoff_holdoff=%d\n", | 353 | "--- %s%s: nwriters_stress=%d stat_interval=%d verbose=%d shuffle_interval=%d stutter=%d shutdown_secs=%d onoff_interval=%d onoff_holdoff=%d\n", |
353 | torture_type, tag, nrealwriters_stress, stat_interval, verbose, | 354 | torture_type, tag, debug_lock ? " [debug]": "", |
355 | nrealwriters_stress, stat_interval, verbose, | ||
354 | shuffle_interval, stutter, shutdown_secs, | 356 | shuffle_interval, stutter, shutdown_secs, |
355 | onoff_interval, onoff_holdoff); | 357 | onoff_interval, onoff_holdoff); |
356 | } | 358 | } |
@@ -418,6 +420,15 @@ static int __init lock_torture_init(void) | |||
418 | nrealwriters_stress = nwriters_stress; | 420 | nrealwriters_stress = nwriters_stress; |
419 | else | 421 | else |
420 | nrealwriters_stress = 2 * num_online_cpus(); | 422 | nrealwriters_stress = 2 * num_online_cpus(); |
423 | |||
424 | #ifdef CONFIG_DEBUG_MUTEXES | ||
425 | if (strncmp(torture_type, "mutex", 5) == 0) | ||
426 | debug_lock = true; | ||
427 | #endif | ||
428 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
429 | if (strncmp(torture_type, "spin", 4) == 0) | ||
430 | debug_lock = true; | ||
431 | #endif | ||
421 | lock_torture_print_module_parms(cur_ops, "Start of test"); | 432 | lock_torture_print_module_parms(cur_ops, "Start of test"); |
422 | 433 | ||
423 | /* Initialize the statistics so that each run gets its own numbers. */ | 434 | /* Initialize the statistics so that each run gets its own numbers. */ |