aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/perf_counter/builtin-stat.c12
1 files changed, 10 insertions, 2 deletions
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)
228 int counter; 228 int counter;
229 int status; 229 int status;
230 int pid; 230 int pid;
231 int i;
231 232
232 if (!system_wide) 233 if (!system_wide)
233 nr_cpus = 1; 234 nr_cpus = 1;
@@ -243,14 +244,17 @@ static int do_perfstat(int argc, const char **argv)
243 244
244 if ((pid = fork()) < 0) 245 if ((pid = fork()) < 0)
245 perror("failed to fork"); 246 perror("failed to fork");
247
246 if (!pid) { 248 if (!pid) {
247 if (execvp(argv[0], (char **)argv)) { 249 if (execvp(argv[0], (char **)argv)) {
248 perror(argv[0]); 250 perror(argv[0]);
249 exit(-1); 251 exit(-1);
250 } 252 }
251 } 253 }
254
252 while (wait(&status) >= 0) 255 while (wait(&status) >= 0)
253 ; 256 ;
257
254 prctl(PR_TASK_PERF_COUNTERS_DISABLE); 258 prctl(PR_TASK_PERF_COUNTERS_DISABLE);
255 t1 = rdclock(); 259 t1 = rdclock();
256 260
@@ -259,8 +263,12 @@ static int do_perfstat(int argc, const char **argv)
259 fflush(stdout); 263 fflush(stdout);
260 264
261 fprintf(stderr, "\n"); 265 fprintf(stderr, "\n");
262 fprintf(stderr, " Performance counter stats for \'%s\':\n", 266 fprintf(stderr, " Performance counter stats for \'%s", argv[0]);
263 argv[0]); 267
268 for (i = 1; i < argc; i++)
269 fprintf(stderr, " %s", argv[i]);
270
271 fprintf(stderr, "\':\n");
264 fprintf(stderr, "\n"); 272 fprintf(stderr, "\n");
265 273
266 for (counter = 0; counter < nr_counters; counter++) 274 for (counter = 0; counter < nr_counters; counter++)