Skip to contentSkip to conversation

dynamic debug for -next

PATCH In review Jim Cromie 2 participants 6 messages Oct 13, 2021 – Oct 14, 2021

Subsystems (2)
lore
Share & tools
lore

Jim Cromie

author maintainer
#0 lore raw

cover dynamic debug for -next

hi Greg, Jason,

This cleans up the previous 1-5, dropping the unwanted 2

Jim Cromie (3):
dyndbg: fix spurious log-level change
dyndbg: vpr-info on remove-module complete, not starting
dyndbg: no vpr-info on empty queries

 lib/dynamic_debug.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.31.1
author maintainer
#1 lore raw

PATCH 1/3 dyndbg: fix spurious log-level change

HEAD~recent inadvertently altered a message's verbosity from 1 to 2, restore it.

---
 lib/dynamic_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dynamic_debug.c +1 -1
index dfe1e6a857bc..9dd8efb5a756 100644
@@ -529,7 +529,7 @@ static int ddebug_exec_queries(char *query, const char *modname)
 		if (!query || !*query || *query == '#')
 			continue;
 
-		v2pr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*");
+		vpr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*");
 
 		rc = ddebug_exec_query(query, modname);
 		if (rc < 0) {
Signature · 1 line
2.31.1
#2 lore raw

Re: [PATCH 1/3] dyndbg: fix spurious log-level change

Quoted 1 line · Jim Cromie

HEAD~recent inadvertently altered a message's verbosity from 1 to 2, restore it.

I do not understand this changelog text at all.

And always wrap your changelog text at 72 columns, like your editor is asking you to.

Quoted 2 lines

Please put a proper "Fixes:" tag in here.

thanks,

greg k-h

author maintainer
#3 lore raw

PATCH 1/1 dyndbg: fix spurious vNpr_info change

The cited commit inadvertently altered the verbose level of a vpr_info, restore it to original.

Fixes 216a0fc40897 ("dyndbg: show module in vpr-info in dd-exec-queries")
---
 lib/dynamic_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dynamic_debug.c +1 -1
index dfe1e6a857bc..9dd8efb5a756 100644
@@ -529,7 +529,7 @@ static int ddebug_exec_queries(char *query, const char *modname)
 		if (!query || !*query || *query == '#')
 			continue;
 
-		v2pr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*");
+		vpr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*");
 
 		rc = ddebug_exec_query(query, modname);
 		if (rc < 0) {
Signature · 1 line
2.31.1
author maintainer
#4 lore raw

PATCH 2/3 dyndbg: vpr-info on remove-module complete, not starting

In reply to Jim Cromie

On qemu --smp 3 runs, remove-module can get called 3 times. So don't print on entry; instead print "removed" after entry is found and removed, so just once.

---
 lib/dynamic_debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/dynamic_debug.c +2 -2
index 9dd8efb5a756..bc1ac55ac328 100644
@@ -1028,8 +1028,6 @@ int ddebug_remove_module(const char *mod_name)
 	struct ddebug_table *dt, *nextdt;
 	int ret = -ENOENT;
 
-	v2pr_info("removing module \"%s\"\n", mod_name);
-
 	mutex_lock(&ddebug_lock);
 	list_for_each_entry_safe(dt, nextdt, &ddebug_tables, link) {
 		if (dt->mod_name == mod_name) {
@@ -1039,6 +1037,8 @@ int ddebug_remove_module(const char *mod_name)
 		}
 	}
 	mutex_unlock(&ddebug_lock);
+	if (!ret)
+		v2pr_info("removed module \"%s\"\n", mod_name);
 	return ret;
 }
 
Signature · 1 line
2.31.1
author maintainer
#5 lore raw

PATCH 3/3 dyndbg: no vpr-info on empty queries

In reply to Jim Cromie

when echo $cmd > control contains multiple queries, extra query separators (;\n) can parse as empty statements. This is normal, and a vpr-info on an empty command is just noise.

---
 lib/dynamic_debug.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
lib/dynamic_debug.c +4 -2
index bc1ac55ac328..7744c787e256 100644
@@ -540,8 +540,10 @@ static int ddebug_exec_queries(char *query, const char *modname)
 		}
 		i++;
 	}
-	vpr_info("processed %d queries, with %d matches, %d errs\n",
-		 i, nfound, errs);
+
+	if (i)
+		vpr_info("processed %d queries, with %d matches, %d errs\n",
+			 i, nfound, errs);
 
 	if (exitcode)
 		return exitcode;
Signature · 1 line
2.31.1