changeset 775:a43e4fe3eb2c

synch: print synch type in destroying-unheld error message Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sun, 11 Aug 2019 12:52:40 -0400
parents e05fd965c1ba
children 1448eb85990b
files synch.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/synch.c	Sun Aug 11 12:00:12 2019 -0400
+++ b/synch.c	Sun Aug 11 12:52:40 2019 -0400
@@ -213,12 +213,14 @@
 static void error_destroy(struct held_lock *held,
 			  const struct lock_context *where)
 {
-	cmn_err(CE_CRIT, "lockdep: thread is trying to destroy a lock it is "
-		"still holding:");
+	const char *type = synch_type_str(held->type);
+
+	cmn_err(CE_CRIT, "lockdep: thread is trying to destroy a %s it is "
+		"still holding:", type);
 	print_synch_as(held->info, where, held->type);
 	cmn_err(CE_CRIT, "lockdep: while holding:");
 	print_held_locks(held);
-	panic("lockdep: Aborting - destroying held lock");
+	panic("lockdep: Aborting - destroying held %s", type);
 }
 
 static void error_lock(struct held_lock *held, struct lock_info *new,