[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210915163957.2949166-7-jim.cromie@gmail.com>
Date: Wed, 15 Sep 2021 10:39:47 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
amd-gfx@...ts.freedesktop.org, intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, daniel@...ll.ch
Cc: Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH v8 06/16] 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
pr-info on 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 abc04bf4f765..356c8231175f 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