dyndbg: no vpr-info on empty queries
authorJim Cromie <jim.cromie@gmail.com>
Wed, 13 Oct 2021 22:07:26 +0000 (16:07 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Oct 2021 08:59:14 +0000 (10:59 +0200)
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.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20211013220726.1280565-4-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/dynamic_debug.c

index d706abb..ad80f13 100644 (file)
@@ -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;