diff options
Diffstat (limited to 'arch/x86/include/asm/perf_event_p4.h')
-rw-r--r-- | arch/x86/include/asm/perf_event_p4.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/x86/include/asm/perf_event_p4.h b/arch/x86/include/asm/perf_event_p4.h index 56fd9e3abbd..4d86c86178f 100644 --- a/arch/x86/include/asm/perf_event_p4.h +++ b/arch/x86/include/asm/perf_event_p4.h | |||
@@ -102,6 +102,14 @@ | |||
102 | #define P4_CONFIG_HT (1ULL << P4_CONFIG_HT_SHIFT) | 102 | #define P4_CONFIG_HT (1ULL << P4_CONFIG_HT_SHIFT) |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * If an event has alias it should be marked | ||
106 | * with a special bit. (Don't forget to check | ||
107 | * P4_PEBS_CONFIG_MASK and related bits on | ||
108 | * modification.) | ||
109 | */ | ||
110 | #define P4_CONFIG_ALIASABLE (1 << 9) | ||
111 | |||
112 | /* | ||
105 | * The bits we allow to pass for RAW events | 113 | * The bits we allow to pass for RAW events |
106 | */ | 114 | */ |
107 | #define P4_CONFIG_MASK_ESCR \ | 115 | #define P4_CONFIG_MASK_ESCR \ |
@@ -123,6 +131,31 @@ | |||
123 | (p4_config_pack_escr(P4_CONFIG_MASK_ESCR)) | \ | 131 | (p4_config_pack_escr(P4_CONFIG_MASK_ESCR)) | \ |
124 | (p4_config_pack_cccr(P4_CONFIG_MASK_CCCR)) | 132 | (p4_config_pack_cccr(P4_CONFIG_MASK_CCCR)) |
125 | 133 | ||
134 | /* | ||
135 | * In case of event aliasing we need to preserve some | ||
136 | * caller bits otherwise the mapping won't be complete. | ||
137 | */ | ||
138 | #define P4_CONFIG_EVENT_ALIAS_MASK \ | ||
139 | (p4_config_pack_escr(P4_CONFIG_MASK_ESCR) | \ | ||
140 | p4_config_pack_cccr(P4_CCCR_EDGE | \ | ||
141 | P4_CCCR_THRESHOLD_MASK | \ | ||
142 | P4_CCCR_COMPLEMENT | \ | ||
143 | P4_CCCR_COMPARE)) | ||
144 | |||
145 | #define P4_CONFIG_EVENT_ALIAS_IMMUTABLE_BITS \ | ||
146 | ((P4_CONFIG_HT) | \ | ||
147 | p4_config_pack_escr(P4_ESCR_T0_OS | \ | ||
148 | P4_ESCR_T0_USR | \ | ||
149 | P4_ESCR_T1_OS | \ | ||
150 | P4_ESCR_T1_USR) | \ | ||
151 | p4_config_pack_cccr(P4_CCCR_OVF | \ | ||
152 | P4_CCCR_CASCADE | \ | ||
153 | P4_CCCR_FORCE_OVF | \ | ||
154 | P4_CCCR_THREAD_ANY | \ | ||
155 | P4_CCCR_OVF_PMI_T0 | \ | ||
156 | P4_CCCR_OVF_PMI_T1 | \ | ||
157 | P4_CONFIG_ALIASABLE)) | ||
158 | |||
126 | static inline bool p4_is_event_cascaded(u64 config) | 159 | static inline bool p4_is_event_cascaded(u64 config) |
127 | { | 160 | { |
128 | u32 cccr = p4_config_unpack_cccr(config); | 161 | u32 cccr = p4_config_unpack_cccr(config); |