In the function trace__syscall_info(), it explicitly checks verbose
level and print out log with fprintf().  Actually, we can use
pr_debug() to do the same thing for debug logging.

This patch uses pr_debug() instead of fprintf() for debug logging; it
includes a minor fixing for 'space before tab in indent', which
dismisses git warning when apply it.

Signed-off-by: Leo Yan <[email protected]>
---
 tools/perf/builtin-trace.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index bd1f00e7a2eb..5cd74651db4c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1760,12 +1760,11 @@ static struct syscall *trace__syscall_info(struct trace 
*trace,
                 * grep "NR -1 " /t/trace_pipe
                 *
                 * After generating some load on the machine.
-                */
-               if (verbose > 1) {
-                       static u64 n;
-                       fprintf(trace->output, "Invalid syscall %d id, skipping 
(%s, %" PRIu64 ") ...\n",
-                               id, perf_evsel__name(evsel), ++n);
-               }
+                */
+               static u64 n;
+
+               pr_debug("Invalid syscall %d id, skipping (%s, %" PRIu64 ")\n",
+                        id, perf_evsel__name(evsel), ++n);
                return NULL;
        }
 
@@ -1779,12 +1778,10 @@ static struct syscall *trace__syscall_info(struct trace 
*trace,
        return &trace->syscalls.table[id];
 
 out_cant_read:
-       if (verbose > 0) {
-               fprintf(trace->output, "Problems reading syscall %d", id);
-               if (id <= trace->syscalls.max && trace->syscalls.table[id].name 
!= NULL)
-                       fprintf(trace->output, "(%s)", 
trace->syscalls.table[id].name);
-               fputs(" information\n", trace->output);
-       }
+       pr_debug("Problems reading syscall %d", id);
+       if (id <= trace->syscalls.max && trace->syscalls.table[id].name != NULL)
+               pr_debug("(%s)", trace->syscalls.table[id].name);
+       pr_debug(" information\n");
        return NULL;
 }
 
-- 
2.17.1

Reply via email to