diff options
Diffstat (limited to 'kernel/lockdep.c')
| -rw-r--r-- | kernel/lockdep.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index c088e5542e84..e596525669ed 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/stacktrace.h> | 36 | #include <linux/stacktrace.h> |
| 37 | #include <linux/debug_locks.h> | 37 | #include <linux/debug_locks.h> |
| 38 | #include <linux/irqflags.h> | 38 | #include <linux/irqflags.h> |
| 39 | #include <linux/utsname.h> | ||
| 39 | 40 | ||
| 40 | #include <asm/sections.h> | 41 | #include <asm/sections.h> |
| 41 | 42 | ||
| @@ -121,8 +122,8 @@ static struct list_head chainhash_table[CHAINHASH_SIZE]; | |||
| 121 | * unique. | 122 | * unique. |
| 122 | */ | 123 | */ |
| 123 | #define iterate_chain_key(key1, key2) \ | 124 | #define iterate_chain_key(key1, key2) \ |
| 124 | (((key1) << MAX_LOCKDEP_KEYS_BITS/2) ^ \ | 125 | (((key1) << MAX_LOCKDEP_KEYS_BITS) ^ \ |
| 125 | ((key1) >> (64-MAX_LOCKDEP_KEYS_BITS/2)) ^ \ | 126 | ((key1) >> (64-MAX_LOCKDEP_KEYS_BITS)) ^ \ |
| 126 | (key2)) | 127 | (key2)) |
| 127 | 128 | ||
| 128 | void lockdep_off(void) | 129 | void lockdep_off(void) |
| @@ -515,6 +516,13 @@ print_circular_bug_entry(struct lock_list *target, unsigned int depth) | |||
| 515 | return 0; | 516 | return 0; |
| 516 | } | 517 | } |
| 517 | 518 | ||
| 519 | static void print_kernel_version(void) | ||
| 520 | { | ||
| 521 | printk("%s %.*s\n", system_utsname.release, | ||
| 522 | (int)strcspn(system_utsname.version, " "), | ||
| 523 | system_utsname.version); | ||
| 524 | } | ||
| 525 | |||
| 518 | /* | 526 | /* |
| 519 | * When a circular dependency is detected, print the | 527 | * When a circular dependency is detected, print the |
| 520 | * header first: | 528 | * header first: |
| @@ -531,6 +539,7 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth) | |||
| 531 | 539 | ||
| 532 | printk("\n=======================================================\n"); | 540 | printk("\n=======================================================\n"); |
| 533 | printk( "[ INFO: possible circular locking dependency detected ]\n"); | 541 | printk( "[ INFO: possible circular locking dependency detected ]\n"); |
| 542 | print_kernel_version(); | ||
| 534 | printk( "-------------------------------------------------------\n"); | 543 | printk( "-------------------------------------------------------\n"); |
| 535 | printk("%s/%d is trying to acquire lock:\n", | 544 | printk("%s/%d is trying to acquire lock:\n", |
| 536 | curr->comm, curr->pid); | 545 | curr->comm, curr->pid); |
| @@ -712,6 +721,7 @@ print_bad_irq_dependency(struct task_struct *curr, | |||
| 712 | printk("\n======================================================\n"); | 721 | printk("\n======================================================\n"); |
| 713 | printk( "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n", | 722 | printk( "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n", |
| 714 | irqclass, irqclass); | 723 | irqclass, irqclass); |
| 724 | print_kernel_version(); | ||
| 715 | printk( "------------------------------------------------------\n"); | 725 | printk( "------------------------------------------------------\n"); |
| 716 | printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", | 726 | printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", |
| 717 | curr->comm, curr->pid, | 727 | curr->comm, curr->pid, |
| @@ -793,6 +803,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, | |||
| 793 | 803 | ||
| 794 | printk("\n=============================================\n"); | 804 | printk("\n=============================================\n"); |
| 795 | printk( "[ INFO: possible recursive locking detected ]\n"); | 805 | printk( "[ INFO: possible recursive locking detected ]\n"); |
| 806 | print_kernel_version(); | ||
| 796 | printk( "---------------------------------------------\n"); | 807 | printk( "---------------------------------------------\n"); |
| 797 | printk("%s/%d is trying to acquire lock:\n", | 808 | printk("%s/%d is trying to acquire lock:\n", |
| 798 | curr->comm, curr->pid); | 809 | curr->comm, curr->pid); |
| @@ -1375,6 +1386,7 @@ print_irq_inversion_bug(struct task_struct *curr, struct lock_class *other, | |||
| 1375 | 1386 | ||
| 1376 | printk("\n=========================================================\n"); | 1387 | printk("\n=========================================================\n"); |
| 1377 | printk( "[ INFO: possible irq lock inversion dependency detected ]\n"); | 1388 | printk( "[ INFO: possible irq lock inversion dependency detected ]\n"); |
| 1389 | print_kernel_version(); | ||
| 1378 | printk( "---------------------------------------------------------\n"); | 1390 | printk( "---------------------------------------------------------\n"); |
| 1379 | printk("%s/%d just changed the state of lock:\n", | 1391 | printk("%s/%d just changed the state of lock:\n", |
| 1380 | curr->comm, curr->pid); | 1392 | curr->comm, curr->pid); |
| @@ -1469,6 +1481,7 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, | |||
| 1469 | 1481 | ||
| 1470 | printk("\n=================================\n"); | 1482 | printk("\n=================================\n"); |
| 1471 | printk( "[ INFO: inconsistent lock state ]\n"); | 1483 | printk( "[ INFO: inconsistent lock state ]\n"); |
| 1484 | print_kernel_version(); | ||
| 1472 | printk( "---------------------------------\n"); | 1485 | printk( "---------------------------------\n"); |
| 1473 | 1486 | ||
| 1474 | printk("inconsistent {%s} -> {%s} usage.\n", | 1487 | printk("inconsistent {%s} -> {%s} usage.\n", |
