Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147571
b: refs/heads/master
c: be1ac0d
h: refs/heads/master
i:
  147569: d9b63b0
  147567: 6f34086
v: v3
  • Loading branch information
Ingo Molnar committed May 29, 2009
1 parent 44b7494 commit 1e1a156
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 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: 2996f5ddb7ba8889caeeac65edafe48845106eaa
refs/heads/master: be1ac0d81d0e3ab655f8c8ade31fb860ef6aa186
12 changes: 11 additions & 1 deletion trunk/Documentation/perf_counter/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ static const unsigned int default_count[] = {
static __u64 event_res[MAX_COUNTERS][3];
static __u64 event_scaled[MAX_COUNTERS];

static __u64 runtime_nsecs;

static void create_perfstat_counter(int counter)
{
struct perf_counter_hw_event hw_event;
Expand Down Expand Up @@ -165,6 +167,11 @@ static void read_counter(int counter)
((double)count[0] * count[1] / count[2] + 0.5);
}
}
/*
* Save the full runtime - to allow normalization during printout:
*/
if (event_id[counter] == EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK))
runtime_nsecs = count[0];
}

/*
Expand All @@ -190,8 +197,11 @@ static void print_counter(int counter)
fprintf(stderr, " %14.6f %-20s (msecs)",
msecs, event_name(counter));
} else {
fprintf(stderr, " %14Ld %-20s (events)",
fprintf(stderr, " %14Ld %-20s",
count[0], event_name(counter));
if (runtime_nsecs)
fprintf(stderr, " # %12.3f M/sec",
(double)count[0]/runtime_nsecs*1000.0);
}
if (scaled)
fprintf(stderr, " (scaled from %.2f%%)",
Expand Down

0 comments on commit 1e1a156

Please sign in to comment.