git: 5a4a83fd0e67 - main - Improve debuggability of VOP_* locking assertions

From: Jason A. Harmening <jah_at_FreeBSD.org>
Date: Thu, 19 Jan 2023 03:58:45 UTC
The branch main has been updated by jah:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a4a83fd0e67a0d7787d2f3e09ef0e5552a1ffb6

commit 5a4a83fd0e67a0d7787d2f3e09ef0e5552a1ffb6
Author:     Jason A. Harmening <jah@FreeBSD.org>
AuthorDate: 2023-01-16 20:07:19 +0000
Commit:     Jason A. Harmening <jah@FreeBSD.org>
CommitDate: 2023-01-19 04:11:05 +0000

    Improve debuggability of VOP_* locking assertions
    
    Include the phase and argument field to make it easier to determine
    at a glance where the failure originated.
    
    Reviewed by:    kib, markj
    Differential Revision: https://reviews.freebsd.org/D38091
---
 sys/tools/vnode_if.awk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk
index 486f0e6b2ce1..415c33c52420 100644
--- a/sys/tools/vnode_if.awk
+++ b/sys/tools/vnode_if.awk
@@ -73,14 +73,14 @@ function add_debug_code(name, arg, pos, ind)
 	else
 		star = "";
 	if (lockdata[name, arg, pos] && (lockdata[name, arg, pos] != "-")) {
-		printc(ind"ASSERT_VI_UNLOCKED("star"a->a_"arg", \""uname"\");");
+		printc(ind"ASSERT_VI_UNLOCKED("star"a->a_"arg", \""uname" "pos" ("arg")\");");
 		# Add assertions for locking
 		if (lockdata[name, arg, pos] == "L")
-			printc(ind"ASSERT_VOP_LOCKED(" star "a->a_"arg", \""uname"\");");
+			printc(ind"ASSERT_VOP_LOCKED(" star "a->a_"arg", \""uname" "pos" ("arg")\");");
 		else if (lockdata[name, arg, pos] == "U")
-			printc(ind"ASSERT_VOP_UNLOCKED(" star "a->a_"arg", \""uname"\");");
+			printc(ind"ASSERT_VOP_UNLOCKED(" star "a->a_"arg", \""uname" "pos" ("arg")\");");
 		else if (lockdata[name, arg, pos] == "E")
-			printc(ind"ASSERT_VOP_ELOCKED(" star "a->a_"arg", \""uname"\");");
+			printc(ind"ASSERT_VOP_ELOCKED(" star "a->a_"arg", \""uname" "pos" ("arg")\");");
 		else if (0) {
 			# XXX More checks!
 		}