perf trace: Add --verbose option
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 22 Aug 2013 19:49:54 +0000 (16:49 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 26 Aug 2013 20:25:43 +0000 (17:25 -0300)
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ain6q4u8g3bpnh18yhw24v2x@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-trace.txt
tools/perf/builtin-trace.c

index 4754f11a862b2d51c7dd6a03cd8c03391aaf975c..fe19811faf90ac00c61adca199ed4137a8a482fd 100644 (file)
@@ -49,6 +49,10 @@ OPTIONS
 --uid=::
         Record events in threads owned by uid. Name or number.
 
+-v::
+--verbose=::
+        Verbosity level.
+
 -i::
 --no-inherit::
        Child tasks do not inherit counters.
index 6ab7a7a5e66e14526fe92697e7de30cdcc5c3852..c907e7e41a74bddc81932785ed5e217165fda1b3 100644 (file)
@@ -1,6 +1,7 @@
 #include <traceevent/event-parse.h>
 #include "builtin.h"
 #include "util/color.h"
+#include "util/debug.h"
 #include "util/evlist.h"
 #include "util/machine.h"
 #include "util/thread.h"
@@ -311,10 +312,12 @@ static struct syscall *trace__syscall_info(struct trace *trace,
        return &trace->syscalls.table[id];
 
 out_cant_read:
-       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", trace->output);
+       if (verbose) {
+               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);
+       }
        return NULL;
 }
 
@@ -714,6 +717,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
                     "show only events with duration > N.M ms",
                     trace__set_duration),
        OPT_BOOLEAN(0, "sched", &trace.sched, "show blocking scheduler events"),
+       OPT_INCR('v', "verbose", &verbose, "be more verbose"),
        OPT_END()
        };
        int err;