[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211012183310.1016678-6-jim.cromie@gmail.com>
Date: Tue, 12 Oct 2021 12:33:10 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org
Cc: Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH 5/5] dyndbg: no vpr-info on empty queries
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. Also change varname.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
lib/dynamic_debug.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 18235de37f25..eef9ca92b05c 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -520,9 +520,9 @@ static int ddebug_exec_query(char *query_string, const char *modname)
static int ddebug_exec_queries(char *query, const char *modname)
{
char *split;
- int i, errs = 0, exitcode = 0, rc, nfound = 0;
+ int qct, errs = 0, exitcode = 0, rc, nfound = 0;
- for (i = 0; query; query = split) {
+ for (qct = 0; query; query = split) {
split = strpbrk(query, ";\n");
if (split)
*split++ = '\0';
@@ -531,7 +531,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 ?: "*");
+ v2pr_info("query %d: <%s> mod:<%s>\n", qct, query, modname ?: "*");
rc = ddebug_exec_query(query, modname);
if (rc < 0) {
@@ -540,10 +540,11 @@ static int ddebug_exec_queries(char *query, const char *modname)
} else {
nfound += rc;
}
- i++;
+ qct++;
}
- v2pr_info("processed %d queries, with %d matches, %d errs\n",
- i, nfound, errs);
+ if (qct)
+ v2pr_info("processed %d queries, with %d matches, %d errs\n",
+ qct, nfound, errs);
if (exitcode)
return exitcode;
--
2.31.1
Powered by blists - more mailing lists