aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-10 15:34:59 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-10 20:39:02 -0400
commit9e350de37ac9607012fcf9c5314a28fbddf8f43c (patch)
treed0f311bcf49d887e6d488ea72b2913cb00eaf910 /include/linux/perf_counter.h
parentdf1a132bf3d3508f863336c80a27806a2ac947e0 (diff)
perf_counter: Accurate period data
We currently log hw.sample_period for PERF_SAMPLE_PERIOD, however this is incorrect. When we adjust the period, it will only take effect the next cycle but report it for the current cycle. So when we adjust the period for every cycle, we're always wrong. Solve this by keeping track of the last_period. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index d8c0eb480f9a..5b966472b458 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -366,6 +366,7 @@ struct hw_perf_counter {
366 }; 366 };
367 atomic64_t prev_count; 367 atomic64_t prev_count;
368 u64 sample_period; 368 u64 sample_period;
369 u64 last_period;
369 atomic64_t period_left; 370 atomic64_t period_left;
370 u64 interrupts; 371 u64 interrupts;
371 372
@@ -606,8 +607,9 @@ extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
606extern void perf_counter_update_userpage(struct perf_counter *counter); 607extern void perf_counter_update_userpage(struct perf_counter *counter);
607 608
608struct perf_sample_data { 609struct perf_sample_data {
609 struct pt_regs *regs; 610 struct pt_regs *regs;
610 u64 addr; 611 u64 addr;
612 u64 period;
611}; 613};
612 614
613extern int perf_counter_overflow(struct perf_counter *counter, int nmi, 615extern int perf_counter_overflow(struct perf_counter *counter, int nmi,