diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-10-26 13:20:09 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-10-26 13:20:09 -0400 |
commit | b44308f54062a4c1dee2602946f481f03739b76d (patch) | |
tree | d94e0f700473e418d967051b71e052277e9fbd08 /tools | |
parent | 0ab7368f8dad561b6164b3e942cab00f9565bd37 (diff) |
perf scripting: Shut up 'perf record' final status
We want just the script output, not internal details about the record phase.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/perf-record.txt | 4 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 9 | ||||
-rw-r--r-- | tools/perf/util/debug.c | 4 | ||||
-rw-r--r-- | tools/perf/util/debug.h | 2 |
5 files changed, 16 insertions, 7 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 3ee27dccfde9..a91f9f9e6e5c 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt | |||
@@ -83,6 +83,10 @@ OPTIONS | |||
83 | --call-graph:: | 83 | --call-graph:: |
84 | Do call-graph (stack chain/backtrace) recording. | 84 | Do call-graph (stack chain/backtrace) recording. |
85 | 85 | ||
86 | -q:: | ||
87 | --quiet:: | ||
88 | Don't print any message, useful for scripting. | ||
89 | |||
86 | -v:: | 90 | -v:: |
87 | --verbose:: | 91 | --verbose:: |
88 | Be more verbose (show counter open errors, etc). | 92 | Be more verbose (show counter open errors, etc). |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index b530beefd9ad..4e75583ddd6d 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -761,6 +761,9 @@ static int __cmd_record(int argc, const char **argv) | |||
761 | } | 761 | } |
762 | } | 762 | } |
763 | 763 | ||
764 | if (quiet) | ||
765 | return 0; | ||
766 | |||
764 | fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking); | 767 | fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking); |
765 | 768 | ||
766 | /* | 769 | /* |
@@ -820,6 +823,7 @@ static const struct option options[] = { | |||
820 | "do call-graph (stack chain/backtrace) recording"), | 823 | "do call-graph (stack chain/backtrace) recording"), |
821 | OPT_INCR('v', "verbose", &verbose, | 824 | OPT_INCR('v', "verbose", &verbose, |
822 | "be more verbose (show counter open errors, etc)"), | 825 | "be more verbose (show counter open errors, etc)"), |
826 | OPT_BOOLEAN('q', "quiet", &quiet, "don't print any message"), | ||
823 | OPT_BOOLEAN('s', "stat", &inherit_stat, | 827 | OPT_BOOLEAN('s', "stat", &inherit_stat, |
824 | "per thread counts"), | 828 | "per thread counts"), |
825 | OPT_BOOLEAN('d', "data", &sample_address, | 829 | OPT_BOOLEAN('d', "data", &sample_address, |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index deda1a93131e..2f8df45c4dcb 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -625,12 +625,13 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used) | |||
625 | dup2(live_pipe[1], 1); | 625 | dup2(live_pipe[1], 1); |
626 | close(live_pipe[0]); | 626 | close(live_pipe[0]); |
627 | 627 | ||
628 | __argv = malloc(5 * sizeof(const char *)); | 628 | __argv = malloc(6 * sizeof(const char *)); |
629 | __argv[0] = "/bin/sh"; | 629 | __argv[0] = "/bin/sh"; |
630 | __argv[1] = record_script_path; | 630 | __argv[1] = record_script_path; |
631 | __argv[2] = "-o"; | 631 | __argv[2] = "-q"; |
632 | __argv[3] = "-"; | 632 | __argv[3] = "-o"; |
633 | __argv[4] = NULL; | 633 | __argv[4] = "-"; |
634 | __argv[5] = NULL; | ||
634 | 635 | ||
635 | execvp("/bin/sh", (char **)__argv); | 636 | execvp("/bin/sh", (char **)__argv); |
636 | exit(-1); | 637 | exit(-1); |
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index f9c7e3ad1aa7..c8d81b00089d 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c | |||
@@ -12,8 +12,8 @@ | |||
12 | #include "debug.h" | 12 | #include "debug.h" |
13 | #include "util.h" | 13 | #include "util.h" |
14 | 14 | ||
15 | int verbose = 0; | 15 | int verbose; |
16 | bool dump_trace = false; | 16 | bool dump_trace = false, quiet = false; |
17 | 17 | ||
18 | int eprintf(int level, const char *fmt, ...) | 18 | int eprintf(int level, const char *fmt, ...) |
19 | { | 19 | { |
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h index 7a17ee061bcb..7b514082bbaf 100644 --- a/tools/perf/util/debug.h +++ b/tools/perf/util/debug.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "event.h" | 6 | #include "event.h" |
7 | 7 | ||
8 | extern int verbose; | 8 | extern int verbose; |
9 | extern bool dump_trace; | 9 | extern bool quiet, dump_trace; |
10 | 10 | ||
11 | int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); | 11 | int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); |
12 | void trace_event(event_t *event); | 12 | void trace_event(event_t *event); |