1 #include <linux/perf_event.h>
2 #include <linux/types.h>
9 static const u64 p6_perfmon_event_map[] =
29 [
C(RESULT_ACCESS) ] = 0x0043,
30 [
C(RESULT_MISS) ] = 0x0045,
33 [
C(RESULT_ACCESS) ] = 0,
34 [
C(RESULT_MISS) ] = 0x0f29,
36 [
C(OP_PREFETCH) ] = {
37 [
C(RESULT_ACCESS) ] = 0,
38 [
C(RESULT_MISS) ] = 0,
43 [
C(RESULT_ACCESS) ] = 0x0080,
44 [
C(RESULT_MISS) ] = 0x0f28,
47 [
C(RESULT_ACCESS) ] = -1,
48 [
C(RESULT_MISS) ] = -1,
50 [
C(OP_PREFETCH) ] = {
51 [
C(RESULT_ACCESS) ] = 0,
52 [
C(RESULT_MISS) ] = 0,
57 [
C(RESULT_ACCESS) ] = 0,
58 [
C(RESULT_MISS) ] = 0,
61 [
C(RESULT_ACCESS) ] = 0,
62 [
C(RESULT_MISS) ] = 0x0025,
64 [
C(OP_PREFETCH) ] = {
65 [
C(RESULT_ACCESS) ] = 0,
66 [
C(RESULT_MISS) ] = 0,
71 [
C(RESULT_ACCESS) ] = 0x0043,
72 [
C(RESULT_MISS) ] = 0,
75 [
C(RESULT_ACCESS) ] = 0,
76 [
C(RESULT_MISS) ] = 0,
78 [
C(OP_PREFETCH) ] = {
79 [
C(RESULT_ACCESS) ] = 0,
80 [
C(RESULT_MISS) ] = 0,
85 [
C(RESULT_ACCESS) ] = 0x0080,
86 [
C(RESULT_MISS) ] = 0x0085,
89 [
C(RESULT_ACCESS) ] = -1,
90 [
C(RESULT_MISS) ] = -1,
92 [
C(OP_PREFETCH) ] = {
93 [
C(RESULT_ACCESS) ] = -1,
94 [
C(RESULT_MISS) ] = -1,
99 [
C(RESULT_ACCESS) ] = 0x00c4,
100 [
C(RESULT_MISS) ] = 0x00c5,
103 [
C(RESULT_ACCESS) ] = -1,
104 [
C(RESULT_MISS) ] = -1,
106 [
C(OP_PREFETCH) ] = {
107 [
C(RESULT_ACCESS) ] = -1,
108 [
C(RESULT_MISS) ] = -1,
113 static u64 p6_pmu_event_map(
int hw_event)
115 return p6_perfmon_event_map[hw_event];
124 #define P6_NOP_EVENT 0x0000002EULL
137 static void p6_pmu_disable_all(
void)
147 static void p6_pmu_enable_all(
int added)
163 (
void)wrmsrl_safe(hwc->config_base, val);
166 static void p6_pmu_enable_event(
struct perf_event *event)
180 (
void)wrmsrl_safe(hwc->config_base, val);
190 static struct attribute *intel_p6_formats_attr[] = {
191 &format_attr_event.attr,
192 &format_attr_umask.attr,
193 &format_attr_edge.attr,
194 &format_attr_pc.attr,
195 &format_attr_inv.attr,
196 &format_attr_cmask.attr,
203 .disable_all = p6_pmu_disable_all,
204 .enable_all = p6_pmu_enable_all,
205 .enable = p6_pmu_enable_event,
206 .disable = p6_pmu_disable_event,
211 .event_map = p6_pmu_event_map,
212 .max_events =
ARRAY_SIZE(p6_perfmon_event_map),
214 .max_period = (1ULL << 31) - 1,
227 .event_constraints = p6_event_constraints,
229 .format_attrs = intel_p6_formats_attr,
247 pr_cont(
"unsupported p6 CPU model %d ",