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 <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c
index 2357a66..4fc0d80 100644
--- a/Documentation/perf_counter/builtin-stat.c
+++ b/Documentation/perf_counter/builtin-stat.c
@@ -228,6 +228,7 @@
int counter;
int status;
int pid;
+ int i;
if (!system_wide)
nr_cpus = 1;
@@ -243,14 +244,17 @@
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 @@
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++)