diff options
author | Stephane Eranian <eranian@google.com> | 2010-02-01 07:50:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-04 03:59:50 -0500 |
commit | 447a194b393f32699607fd99617a40abd6a95114 (patch) | |
tree | 7d202a6ad8f80c913a4e3d439eedf5ba0abbbf39 /include/linux/perf_event.h | |
parent | fce877e3a429940a986e085a41e8b57f2d922e36 (diff) |
perf_events, x86: Fix bug in hw_perf_enable()
We cannot assume that because hwc->idx == assign[i], we can avoid
reprogramming the counter in hw_perf_enable().
The event may have been scheduled out and another event may have been
programmed into this counter. Thus, we need a more robust way of
verifying if the counter still contains config/data related to an event.
This patch adds a generation number to each counter on each cpu. Using
this mechanism we can verify reliabilty whether the content of a counter
corresponds to an event.
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: 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>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4b66dc67.0b38560a.1635.ffffae18@mx.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 556b0f4a668e..071a7db52549 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -478,9 +478,11 @@ struct hw_perf_event { | |||
478 | union { | 478 | union { |
479 | struct { /* hardware */ | 479 | struct { /* hardware */ |
480 | u64 config; | 480 | u64 config; |
481 | u64 last_tag; | ||
481 | unsigned long config_base; | 482 | unsigned long config_base; |
482 | unsigned long event_base; | 483 | unsigned long event_base; |
483 | int idx; | 484 | int idx; |
485 | int last_cpu; | ||
484 | }; | 486 | }; |
485 | struct { /* software */ | 487 | struct { /* software */ |
486 | s64 remaining; | 488 | s64 remaining; |