diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-01-31 10:45:13 -0500 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-04-19 12:27:29 -0400 |
| commit | a5dd63efda3d07b50c0feda6fb4796bece237e61 (patch) | |
| tree | 367cb2be5f9694d6d9eab4cf4394c67f96b225ea /kernel | |
| parent | 5f0d5a3ae7cff0d7fa943c199c3a2e44f23e1fac (diff) | |
lockdep: Use "WARNING" tag on lockdep splats
This commit changes lockdep splats to begin lines with "WARNING" and
to use pr_warn() instead of printk(). This change eases scripted
analysis of kernel console output.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/locking/lockdep.c | 86 | ||||
| -rw-r--r-- | kernel/locking/rtmutex-debug.c | 9 |
2 files changed, 48 insertions, 47 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index a95e5d1f4a9c..e9d4f85b290c 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
| @@ -1144,10 +1144,10 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth, | |||
| 1144 | return 0; | 1144 | return 0; |
| 1145 | 1145 | ||
| 1146 | printk("\n"); | 1146 | printk("\n"); |
| 1147 | printk("======================================================\n"); | 1147 | pr_warn("======================================================\n"); |
| 1148 | printk("[ INFO: possible circular locking dependency detected ]\n"); | 1148 | pr_warn("WARNING: possible circular locking dependency detected\n"); |
| 1149 | print_kernel_ident(); | 1149 | print_kernel_ident(); |
| 1150 | printk("-------------------------------------------------------\n"); | 1150 | pr_warn("------------------------------------------------------\n"); |
| 1151 | printk("%s/%d is trying to acquire lock:\n", | 1151 | printk("%s/%d is trying to acquire lock:\n", |
| 1152 | curr->comm, task_pid_nr(curr)); | 1152 | curr->comm, task_pid_nr(curr)); |
| 1153 | print_lock(check_src); | 1153 | print_lock(check_src); |
| @@ -1482,11 +1482,11 @@ print_bad_irq_dependency(struct task_struct *curr, | |||
| 1482 | return 0; | 1482 | return 0; |
| 1483 | 1483 | ||
| 1484 | printk("\n"); | 1484 | printk("\n"); |
| 1485 | printk("======================================================\n"); | 1485 | pr_warn("=====================================================\n"); |
| 1486 | printk("[ INFO: %s-safe -> %s-unsafe lock order detected ]\n", | 1486 | pr_warn("WARNING: %s-safe -> %s-unsafe lock order detected\n", |
| 1487 | irqclass, irqclass); | 1487 | irqclass, irqclass); |
| 1488 | print_kernel_ident(); | 1488 | print_kernel_ident(); |
| 1489 | printk("------------------------------------------------------\n"); | 1489 | pr_warn("-----------------------------------------------------\n"); |
| 1490 | printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", | 1490 | printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", |
| 1491 | curr->comm, task_pid_nr(curr), | 1491 | curr->comm, task_pid_nr(curr), |
| 1492 | curr->hardirq_context, hardirq_count() >> HARDIRQ_SHIFT, | 1492 | curr->hardirq_context, hardirq_count() >> HARDIRQ_SHIFT, |
| @@ -1711,10 +1711,10 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, | |||
| 1711 | return 0; | 1711 | return 0; |
| 1712 | 1712 | ||
| 1713 | printk("\n"); | 1713 | printk("\n"); |
| 1714 | printk("=============================================\n"); | 1714 | pr_warn("============================================\n"); |
| 1715 | printk("[ INFO: possible recursive locking detected ]\n"); | 1715 | pr_warn("WARNING: possible recursive locking detected\n"); |
| 1716 | print_kernel_ident(); | 1716 | print_kernel_ident(); |
| 1717 | printk("---------------------------------------------\n"); | 1717 | pr_warn("--------------------------------------------\n"); |
| 1718 | printk("%s/%d is trying to acquire lock:\n", | 1718 | printk("%s/%d is trying to acquire lock:\n", |
| 1719 | curr->comm, task_pid_nr(curr)); | 1719 | curr->comm, task_pid_nr(curr)); |
| 1720 | print_lock(next); | 1720 | print_lock(next); |
| @@ -2061,10 +2061,10 @@ static void print_collision(struct task_struct *curr, | |||
| 2061 | struct lock_chain *chain) | 2061 | struct lock_chain *chain) |
| 2062 | { | 2062 | { |
| 2063 | printk("\n"); | 2063 | printk("\n"); |
| 2064 | printk("======================\n"); | 2064 | pr_warn("============================\n"); |
| 2065 | printk("[chain_key collision ]\n"); | 2065 | pr_warn("WARNING: chain_key collision\n"); |
| 2066 | print_kernel_ident(); | 2066 | print_kernel_ident(); |
| 2067 | printk("----------------------\n"); | 2067 | pr_warn("----------------------------\n"); |
| 2068 | printk("%s/%d: ", current->comm, task_pid_nr(current)); | 2068 | printk("%s/%d: ", current->comm, task_pid_nr(current)); |
| 2069 | printk("Hash chain already cached but the contents don't match!\n"); | 2069 | printk("Hash chain already cached but the contents don't match!\n"); |
| 2070 | 2070 | ||
| @@ -2360,10 +2360,10 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, | |||
| 2360 | return 0; | 2360 | return 0; |
| 2361 | 2361 | ||
| 2362 | printk("\n"); | 2362 | printk("\n"); |
| 2363 | printk("=================================\n"); | 2363 | pr_warn("================================\n"); |
| 2364 | printk("[ INFO: inconsistent lock state ]\n"); | 2364 | pr_warn("WARNING: inconsistent lock state\n"); |
| 2365 | print_kernel_ident(); | 2365 | print_kernel_ident(); |
| 2366 | printk("---------------------------------\n"); | 2366 | pr_warn("--------------------------------\n"); |
| 2367 | 2367 | ||
| 2368 | printk("inconsistent {%s} -> {%s} usage.\n", | 2368 | printk("inconsistent {%s} -> {%s} usage.\n", |
| 2369 | usage_str[prev_bit], usage_str[new_bit]); | 2369 | usage_str[prev_bit], usage_str[new_bit]); |
| @@ -2425,10 +2425,10 @@ print_irq_inversion_bug(struct task_struct *curr, | |||
| 2425 | return 0; | 2425 | return 0; |
| 2426 | 2426 | ||
| 2427 | printk("\n"); | 2427 | printk("\n"); |
| 2428 | printk("=========================================================\n"); | 2428 | pr_warn("========================================================\n"); |
| 2429 | printk("[ INFO: possible irq lock inversion dependency detected ]\n"); | 2429 | pr_warn("WARNING: possible irq lock inversion dependency detected\n"); |
| 2430 | print_kernel_ident(); | 2430 | print_kernel_ident(); |
| 2431 | printk("---------------------------------------------------------\n"); | 2431 | pr_warn("--------------------------------------------------------\n"); |
| 2432 | printk("%s/%d just changed the state of lock:\n", | 2432 | printk("%s/%d just changed the state of lock:\n", |
| 2433 | curr->comm, task_pid_nr(curr)); | 2433 | curr->comm, task_pid_nr(curr)); |
| 2434 | print_lock(this); | 2434 | print_lock(this); |
| @@ -3170,10 +3170,10 @@ print_lock_nested_lock_not_held(struct task_struct *curr, | |||
| 3170 | return 0; | 3170 | return 0; |
| 3171 | 3171 | ||
| 3172 | printk("\n"); | 3172 | printk("\n"); |
| 3173 | printk("==================================\n"); | 3173 | pr_warn("==================================\n"); |
| 3174 | printk("[ BUG: Nested lock was not taken ]\n"); | 3174 | pr_warn("WARNING: Nested lock was not taken\n"); |
| 3175 | print_kernel_ident(); | 3175 | print_kernel_ident(); |
| 3176 | printk("----------------------------------\n"); | 3176 | pr_warn("----------------------------------\n"); |
| 3177 | 3177 | ||
| 3178 | printk("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); | 3178 | printk("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); |
| 3179 | print_lock(hlock); | 3179 | print_lock(hlock); |
| @@ -3383,10 +3383,10 @@ print_unlock_imbalance_bug(struct task_struct *curr, struct lockdep_map *lock, | |||
| 3383 | return 0; | 3383 | return 0; |
| 3384 | 3384 | ||
| 3385 | printk("\n"); | 3385 | printk("\n"); |
| 3386 | printk("=====================================\n"); | 3386 | pr_warn("=====================================\n"); |
| 3387 | printk("[ BUG: bad unlock balance detected! ]\n"); | 3387 | pr_warn("WARNING: bad unlock balance detected!\n"); |
| 3388 | print_kernel_ident(); | 3388 | print_kernel_ident(); |
| 3389 | printk("-------------------------------------\n"); | 3389 | pr_warn("-------------------------------------\n"); |
| 3390 | printk("%s/%d is trying to release lock (", | 3390 | printk("%s/%d is trying to release lock (", |
| 3391 | curr->comm, task_pid_nr(curr)); | 3391 | curr->comm, task_pid_nr(curr)); |
| 3392 | print_lockdep_cache(lock); | 3392 | print_lockdep_cache(lock); |
| @@ -3880,10 +3880,10 @@ print_lock_contention_bug(struct task_struct *curr, struct lockdep_map *lock, | |||
| 3880 | return 0; | 3880 | return 0; |
| 3881 | 3881 | ||
| 3882 | printk("\n"); | 3882 | printk("\n"); |
| 3883 | printk("=================================\n"); | 3883 | pr_warn("=================================\n"); |
| 3884 | printk("[ BUG: bad contention detected! ]\n"); | 3884 | pr_warn("WARNING: bad contention detected!\n"); |
| 3885 | print_kernel_ident(); | 3885 | print_kernel_ident(); |
| 3886 | printk("---------------------------------\n"); | 3886 | pr_warn("---------------------------------\n"); |
| 3887 | printk("%s/%d is trying to contend lock (", | 3887 | printk("%s/%d is trying to contend lock (", |
| 3888 | curr->comm, task_pid_nr(curr)); | 3888 | curr->comm, task_pid_nr(curr)); |
| 3889 | print_lockdep_cache(lock); | 3889 | print_lockdep_cache(lock); |
| @@ -4244,10 +4244,10 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from, | |||
| 4244 | return; | 4244 | return; |
| 4245 | 4245 | ||
| 4246 | printk("\n"); | 4246 | printk("\n"); |
| 4247 | printk("=========================\n"); | 4247 | pr_warn("=========================\n"); |
| 4248 | printk("[ BUG: held lock freed! ]\n"); | 4248 | pr_warn("WARNING: held lock freed!\n"); |
| 4249 | print_kernel_ident(); | 4249 | print_kernel_ident(); |
| 4250 | printk("-------------------------\n"); | 4250 | pr_warn("-------------------------\n"); |
| 4251 | printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", | 4251 | printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", |
| 4252 | curr->comm, task_pid_nr(curr), mem_from, mem_to-1); | 4252 | curr->comm, task_pid_nr(curr), mem_from, mem_to-1); |
| 4253 | print_lock(hlock); | 4253 | print_lock(hlock); |
| @@ -4302,11 +4302,11 @@ static void print_held_locks_bug(void) | |||
| 4302 | return; | 4302 | return; |
| 4303 | 4303 | ||
| 4304 | printk("\n"); | 4304 | printk("\n"); |
| 4305 | printk("=====================================\n"); | 4305 | pr_warn("====================================\n"); |
| 4306 | printk("[ BUG: %s/%d still has locks held! ]\n", | 4306 | pr_warn("WARNING: %s/%d still has locks held!\n", |
| 4307 | current->comm, task_pid_nr(current)); | 4307 | current->comm, task_pid_nr(current)); |
| 4308 | print_kernel_ident(); | 4308 | print_kernel_ident(); |
| 4309 | printk("-------------------------------------\n"); | 4309 | pr_warn("------------------------------------\n"); |
| 4310 | lockdep_print_held_locks(current); | 4310 | lockdep_print_held_locks(current); |
| 4311 | printk("\nstack backtrace:\n"); | 4311 | printk("\nstack backtrace:\n"); |
| 4312 | dump_stack(); | 4312 | dump_stack(); |
| @@ -4371,7 +4371,7 @@ retry: | |||
| 4371 | } while_each_thread(g, p); | 4371 | } while_each_thread(g, p); |
| 4372 | 4372 | ||
| 4373 | printk("\n"); | 4373 | printk("\n"); |
| 4374 | printk("=============================================\n\n"); | 4374 | pr_warn("=============================================\n\n"); |
| 4375 | 4375 | ||
| 4376 | if (unlock) | 4376 | if (unlock) |
| 4377 | read_unlock(&tasklist_lock); | 4377 | read_unlock(&tasklist_lock); |
| @@ -4401,10 +4401,10 @@ asmlinkage __visible void lockdep_sys_exit(void) | |||
| 4401 | if (!debug_locks_off()) | 4401 | if (!debug_locks_off()) |
| 4402 | return; | 4402 | return; |
| 4403 | printk("\n"); | 4403 | printk("\n"); |
| 4404 | printk("================================================\n"); | 4404 | pr_warn("================================================\n"); |
| 4405 | printk("[ BUG: lock held when returning to user space! ]\n"); | 4405 | pr_warn("WARNING: lock held when returning to user space!\n"); |
| 4406 | print_kernel_ident(); | 4406 | print_kernel_ident(); |
| 4407 | printk("------------------------------------------------\n"); | 4407 | pr_warn("------------------------------------------------\n"); |
| 4408 | printk("%s/%d is leaving the kernel with locks still held!\n", | 4408 | printk("%s/%d is leaving the kernel with locks still held!\n", |
| 4409 | curr->comm, curr->pid); | 4409 | curr->comm, curr->pid); |
| 4410 | lockdep_print_held_locks(curr); | 4410 | lockdep_print_held_locks(curr); |
| @@ -4421,13 +4421,13 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s) | |||
| 4421 | #endif /* #ifdef CONFIG_PROVE_RCU_REPEATEDLY */ | 4421 | #endif /* #ifdef CONFIG_PROVE_RCU_REPEATEDLY */ |
| 4422 | /* Note: the following can be executed concurrently, so be careful. */ | 4422 | /* Note: the following can be executed concurrently, so be careful. */ |
| 4423 | printk("\n"); | 4423 | printk("\n"); |
| 4424 | pr_err("===============================\n"); | 4424 | pr_warn("=============================\n"); |
| 4425 | pr_err("[ ERR: suspicious RCU usage. ]\n"); | 4425 | pr_warn("WARNING: suspicious RCU usage\n"); |
| 4426 | print_kernel_ident(); | 4426 | print_kernel_ident(); |
| 4427 | pr_err("-------------------------------\n"); | 4427 | pr_warn("-----------------------------\n"); |
| 4428 | pr_err("%s:%d %s!\n", file, line, s); | 4428 | printk("%s:%d %s!\n", file, line, s); |
| 4429 | pr_err("\nother info that might help us debug this:\n\n"); | 4429 | printk("\nother info that might help us debug this:\n\n"); |
| 4430 | pr_err("\n%srcu_scheduler_active = %d, debug_locks = %d\n", | 4430 | printk("\n%srcu_scheduler_active = %d, debug_locks = %d\n", |
| 4431 | !rcu_lockdep_current_cpu_online() | 4431 | !rcu_lockdep_current_cpu_online() |
| 4432 | ? "RCU used illegally from offline CPU!\n" | 4432 | ? "RCU used illegally from offline CPU!\n" |
| 4433 | : !rcu_is_watching() | 4433 | : !rcu_is_watching() |
diff --git a/kernel/locking/rtmutex-debug.c b/kernel/locking/rtmutex-debug.c index 97ee9df32e0f..db4f55211b04 100644 --- a/kernel/locking/rtmutex-debug.c +++ b/kernel/locking/rtmutex-debug.c | |||
| @@ -102,10 +102,11 @@ void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter) | |||
| 102 | return; | 102 | return; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | printk("\n============================================\n"); | 105 | pr_warn("\n"); |
| 106 | printk( "[ BUG: circular locking deadlock detected! ]\n"); | 106 | pr_warn("============================================\n"); |
| 107 | printk("%s\n", print_tainted()); | 107 | pr_warn("WARNING: circular locking deadlock detected!\n"); |
| 108 | printk( "--------------------------------------------\n"); | 108 | pr_warn("%s\n", print_tainted()); |
| 109 | pr_warn("--------------------------------------------\n"); | ||
| 109 | printk("%s/%d is deadlocking current task %s/%d\n\n", | 110 | printk("%s/%d is deadlocking current task %s/%d\n\n", |
| 110 | task->comm, task_pid_nr(task), | 111 | task->comm, task_pid_nr(task), |
| 111 | current->comm, task_pid_nr(current)); | 112 | current->comm, task_pid_nr(current)); |
