mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
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>
This commit is contained in:
parent
df1a132bf3
commit
9e350de37a
4 changed files with 28 additions and 11 deletions
|
@ -366,6 +366,7 @@ struct hw_perf_counter {
|
|||
};
|
||||
atomic64_t prev_count;
|
||||
u64 sample_period;
|
||||
u64 last_period;
|
||||
atomic64_t period_left;
|
||||
u64 interrupts;
|
||||
|
||||
|
@ -606,8 +607,9 @@ extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
|
|||
extern void perf_counter_update_userpage(struct perf_counter *counter);
|
||||
|
||||
struct perf_sample_data {
|
||||
struct pt_regs *regs;
|
||||
u64 addr;
|
||||
struct pt_regs *regs;
|
||||
u64 addr;
|
||||
u64 period;
|
||||
};
|
||||
|
||||
extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue