Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147580
b: refs/heads/master
c: d7c2931
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed May 30, 2009
1 parent 3e67803 commit 5e2d154
Show file tree
Hide file tree
Showing 2 changed files with 12 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: c44613a4c1092e85841b78b7ab52a06654fcd321
refs/heads/master: d7c29318c2daa96d64b7312afd8283488c1cb29f
13 changes: 11 additions & 2 deletions trunk/Documentation/perf_counter/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static __u64 event_res[MAX_COUNTERS][3];
static __u64 event_scaled[MAX_COUNTERS];

static __u64 runtime_nsecs;
static __u64 walltime_nsecs;

static void create_perfstat_counter(int counter)
{
Expand Down Expand Up @@ -194,13 +195,19 @@ static void print_counter(int counter)
if (nsec_counter(counter)) {
double msecs = (double)count[0] / 1000000;

fprintf(stderr, " %14.6f %-20s (msecs)",
fprintf(stderr, " %14.6f %-20s",
msecs, event_name(counter));
if (event_id[counter] ==
EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK)) {

fprintf(stderr, " # %11.3f CPU utilization factor",
(double)count[0] / (double)walltime_nsecs);
}
} else {
fprintf(stderr, " %14Ld %-20s",
count[0], event_name(counter));
if (runtime_nsecs)
fprintf(stderr, " # %12.3f M/sec",
fprintf(stderr, " # %11.3f M/sec",
(double)count[0]/runtime_nsecs*1000.0);
}
if (scaled)
Expand Down Expand Up @@ -241,6 +248,8 @@ static int do_perfstat(int argc, const char **argv)
prctl(PR_TASK_PERF_COUNTERS_DISABLE);
t1 = rdclock();

walltime_nsecs = t1 - t0;

fflush(stdout);

fprintf(stderr, "\n");
Expand Down

0 comments on commit 5e2d154

Please sign in to comment.