From: Ingo Molnar Date: Wed, 3 Jun 2009 17:36:07 +0000 (+0200) Subject: perf stat: Print out all arguments X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=44db76c8553c328f4ae02481d77bb3a88ca17645;p=linux-beck.git perf stat: Print out all arguments Before: Performance counter stats for '/home/mingo/hackbench': After: Performance counter stats for '/home/mingo/hackbench 10': Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Corey Ashford Cc: Marcelo Tosatti Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c index 2357a663b675..4fc0d80440e7 100644 --- a/Documentation/perf_counter/builtin-stat.c +++ b/Documentation/perf_counter/builtin-stat.c @@ -228,6 +228,7 @@ static int do_perfstat(int argc, const char **argv) int counter; int status; int pid; + int i; if (!system_wide) nr_cpus = 1; @@ -243,14 +244,17 @@ static int do_perfstat(int argc, const char **argv) if ((pid = fork()) < 0) perror("failed to fork"); + if (!pid) { if (execvp(argv[0], (char **)argv)) { perror(argv[0]); exit(-1); } } + while (wait(&status) >= 0) ; + prctl(PR_TASK_PERF_COUNTERS_DISABLE); t1 = rdclock(); @@ -259,8 +263,12 @@ static int do_perfstat(int argc, const char **argv) fflush(stdout); fprintf(stderr, "\n"); - fprintf(stderr, " Performance counter stats for \'%s\':\n", - argv[0]); + fprintf(stderr, " Performance counter stats for \'%s", argv[0]); + + for (i = 1; i < argc; i++) + fprintf(stderr, " %s", argv[i]); + + fprintf(stderr, "\':\n"); fprintf(stderr, "\n"); for (counter = 0; counter < nr_counters; counter++)