changeset 776:1448eb85990b

synch: print synch type in releasing-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:53:07 -0400
parents a43e4fe3eb2c
children 8feb558ccf09
files synch.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/synch.c	Sun Aug 11 12:52:40 2019 -0400
+++ b/synch.c	Sun Aug 11 12:53:07 2019 -0400
@@ -273,12 +273,14 @@
 static void error_unlock(struct lock_info *info,
 			 const struct lock_context *where)
 {
-	cmn_err(CE_CRIT, "lockdep: thread is trying to release lock it "
-		"doesn't hold:");
+	const char *type = synch_type_str(info->type);
+
+	cmn_err(CE_CRIT, "lockdep: thread is trying to release %s it "
+		"doesn't hold:", type);
 	print_synch_as(info, where, info->type);
 	cmn_err(CE_CRIT, "lockdep: while holding:");
 	print_held_locks(NULL);
-	panic("lockdep: Aborting - releasing unheld lock");
+	panic("lockdep: Aborting - releasing unheld %s", type);
 }
 
 static void error_condwait_circular(struct cond *cond, struct held_lock *held,