Commit 7f8b4e4e0988dadfd22330fd147ad2453e19f510

Authored by Peter Zijlstra
Committed by Ingo Molnar
1 parent 41f95331b9

perf_counter: Add scale information to the mmap control page

Add the needed time scale to the self-profile mmap information.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 2 changed files with 9 additions and 1 deletions Side-by-side Diff

include/linux/perf_counter.h
... ... @@ -232,12 +232,14 @@
232 232 __u32 lock; /* seqlock for synchronization */
233 233 __u32 index; /* hardware counter identifier */
234 234 __s64 offset; /* add to hardware counter value */
  235 + __u64 time_enabled; /* time counter active */
  236 + __u64 time_running; /* time counter on cpu */
235 237  
236 238 /*
237 239 * Hole for extension of the self monitor capabilities
238 240 */
239 241  
240   - __u64 __reserved[125]; /* align to 1k */
  242 + __u64 __reserved[123]; /* align to 1k */
241 243  
242 244 /*
243 245 * Control data for the mmap() data buffer.
kernel/perf_counter.c
... ... @@ -1782,6 +1782,12 @@
1782 1782 if (counter->state == PERF_COUNTER_STATE_ACTIVE)
1783 1783 userpg->offset -= atomic64_read(&counter->hw.prev_count);
1784 1784  
  1785 + userpg->time_enabled = counter->total_time_enabled +
  1786 + atomic64_read(&counter->child_total_time_enabled);
  1787 +
  1788 + userpg->time_running = counter->total_time_running +
  1789 + atomic64_read(&counter->child_total_time_running);
  1790 +
1785 1791 barrier();
1786 1792 ++userpg->lock;
1787 1793 preempt_enable();