Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147633
b: refs/heads/master
c: 44db76c
h: refs/heads/master
i:
  147631: b4e77ef
v: v3
  • Loading branch information
Ingo Molnar committed Jun 3, 2009
1 parent 558acf5 commit efc90d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e98e96fe43ae92fad0930f05fb2b298e49b9f3b5
refs/heads/master: 44db76c8553c328f4ae02481d77bb3a88ca17645
12 changes: 10 additions & 2 deletions trunk/Documentation/perf_counter/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand All @@ -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++)
Expand Down

0 comments on commit efc90d6

Please sign in to comment.