diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-03-03 11:07:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-10 07:23:33 -0500 |
commit | 8db909a7e3c888b5d45aef7650d74ccebe3ce725 (patch) | |
tree | 1f930572b6468fa212f599285e2de772aefdd361 /arch/x86/kernel/cpu/perf_event.c | |
parent | 1676b8a077c352085d52578fb4f29350b58b6e74 (diff) |
perf, x86: Clean up IA32_PERF_CAPABILITIES usage
Saner PERF_CAPABILITIES support, which also exposes pebs_trap. Use that
latter to make PEBS's use of LBR conditional since a fault-like pebs
should already report the correct IP.
( As of this writing there is no known hardware that implements
!pebs_trap )
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: paulus@samba.org
Cc: eranian@google.com
Cc: robert.richter@amd.com
Cc: fweisbec@gmail.com
LKML-Reference: <20100304140100.770650663@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.c')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 5cb4e8dcee4..7b5430b2efe 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -154,6 +154,17 @@ struct cpu_hw_events { | |||
154 | #define for_each_event_constraint(e, c) \ | 154 | #define for_each_event_constraint(e, c) \ |
155 | for ((e) = (c); (e)->cmask; (e)++) | 155 | for ((e) = (c); (e)->cmask; (e)++) |
156 | 156 | ||
157 | union perf_capabilities { | ||
158 | struct { | ||
159 | u64 lbr_format : 6; | ||
160 | u64 pebs_trap : 1; | ||
161 | u64 pebs_arch_reg : 1; | ||
162 | u64 pebs_format : 4; | ||
163 | u64 smm_freeze : 1; | ||
164 | }; | ||
165 | u64 capabilities; | ||
166 | }; | ||
167 | |||
157 | /* | 168 | /* |
158 | * struct x86_pmu - generic x86 pmu | 169 | * struct x86_pmu - generic x86 pmu |
159 | */ | 170 | */ |
@@ -195,7 +206,8 @@ struct x86_pmu { | |||
195 | /* | 206 | /* |
196 | * Intel Arch Perfmon v2+ | 207 | * Intel Arch Perfmon v2+ |
197 | */ | 208 | */ |
198 | u64 intel_ctrl; | 209 | u64 intel_ctrl; |
210 | union perf_capabilities intel_cap; | ||
199 | 211 | ||
200 | /* | 212 | /* |
201 | * Intel DebugStore bits | 213 | * Intel DebugStore bits |
@@ -210,7 +222,6 @@ struct x86_pmu { | |||
210 | */ | 222 | */ |
211 | unsigned long lbr_tos, lbr_from, lbr_to; /* MSR base regs */ | 223 | unsigned long lbr_tos, lbr_from, lbr_to; /* MSR base regs */ |
212 | int lbr_nr; /* hardware stack size */ | 224 | int lbr_nr; /* hardware stack size */ |
213 | int lbr_format; /* hardware format */ | ||
214 | }; | 225 | }; |
215 | 226 | ||
216 | static struct x86_pmu x86_pmu __read_mostly; | 227 | static struct x86_pmu x86_pmu __read_mostly; |