aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-09-27 00:04:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-27 00:04:16 -0400
commitd0b86480f5b33f4a86d7c106706d6e0dcd1935ce (patch)
treefd4908ad0b01e89a3426d82bf9febc896d557da3 /arch
parent28e8f9bead060aafc630a4256d23e2a55fb8b97d (diff)
sparc: Add Niagara2 HW cache event support.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/perf_event.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 8abdc4d1baa5..6f01e04cc323 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -215,8 +215,96 @@ static const struct perf_event_map *niagara2_event_map(int event_id)
215 return &niagara2_perfmon_event_map[event_id]; 215 return &niagara2_perfmon_event_map[event_id];
216} 216}
217 217
218static const cache_map_t niagara2_cache_map = {
219[C(L1D)] = {
220 [C(OP_READ)] = {
221 [C(RESULT_ACCESS)] = { 0x0208, PIC_UPPER | PIC_LOWER, },
222 [C(RESULT_MISS)] = { 0x0302, PIC_UPPER | PIC_LOWER, },
223 },
224 [C(OP_WRITE)] = {
225 [C(RESULT_ACCESS)] = { 0x0210, PIC_UPPER | PIC_LOWER, },
226 [C(RESULT_MISS)] = { 0x0302, PIC_UPPER | PIC_LOWER, },
227 },
228 [C(OP_PREFETCH)] = {
229 [C(RESULT_ACCESS)] = { CACHE_OP_UNSUPPORTED },
230 [C(RESULT_MISS)] = { CACHE_OP_UNSUPPORTED },
231 },
232},
233[C(L1I)] = {
234 [C(OP_READ)] = {
235 [C(RESULT_ACCESS)] = { 0x02ff, PIC_UPPER | PIC_LOWER, },
236 [C(RESULT_MISS)] = { 0x0301, PIC_UPPER | PIC_LOWER, },
237 },
238 [ C(OP_WRITE) ] = {
239 [ C(RESULT_ACCESS) ] = { CACHE_OP_NONSENSE },
240 [ C(RESULT_MISS) ] = { CACHE_OP_NONSENSE },
241 },
242 [ C(OP_PREFETCH) ] = {
243 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
244 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
245 },
246},
247[C(LL)] = {
248 [C(OP_READ)] = {
249 [C(RESULT_ACCESS)] = { 0x0208, PIC_UPPER | PIC_LOWER, },
250 [C(RESULT_MISS)] = { 0x0330, PIC_UPPER | PIC_LOWER, },
251 },
252 [C(OP_WRITE)] = {
253 [C(RESULT_ACCESS)] = { 0x0210, PIC_UPPER | PIC_LOWER, },
254 [C(RESULT_MISS)] = { 0x0320, PIC_UPPER | PIC_LOWER, },
255 },
256 [C(OP_PREFETCH)] = {
257 [C(RESULT_ACCESS)] = { CACHE_OP_UNSUPPORTED },
258 [C(RESULT_MISS)] = { CACHE_OP_UNSUPPORTED },
259 },
260},
261[C(DTLB)] = {
262 [C(OP_READ)] = {
263 [C(RESULT_ACCESS)] = { CACHE_OP_UNSUPPORTED },
264 [C(RESULT_MISS)] = { 0x0b08, PIC_UPPER | PIC_LOWER, },
265 },
266 [ C(OP_WRITE) ] = {
267 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
268 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
269 },
270 [ C(OP_PREFETCH) ] = {
271 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
272 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
273 },
274},
275[C(ITLB)] = {
276 [C(OP_READ)] = {
277 [C(RESULT_ACCESS)] = { CACHE_OP_UNSUPPORTED },
278 [C(RESULT_MISS)] = { 0xb04, PIC_UPPER | PIC_LOWER, },
279 },
280 [ C(OP_WRITE) ] = {
281 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
282 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
283 },
284 [ C(OP_PREFETCH) ] = {
285 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
286 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
287 },
288},
289[C(BPU)] = {
290 [C(OP_READ)] = {
291 [C(RESULT_ACCESS)] = { CACHE_OP_UNSUPPORTED },
292 [C(RESULT_MISS)] = { CACHE_OP_UNSUPPORTED },
293 },
294 [ C(OP_WRITE) ] = {
295 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
296 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
297 },
298 [ C(OP_PREFETCH) ] = {
299 [ C(RESULT_ACCESS) ] = { CACHE_OP_UNSUPPORTED },
300 [ C(RESULT_MISS) ] = { CACHE_OP_UNSUPPORTED },
301 },
302},
303};
304
218static const struct sparc_pmu niagara2_pmu = { 305static const struct sparc_pmu niagara2_pmu = {
219 .event_map = niagara2_event_map, 306 .event_map = niagara2_event_map,
307 .cache_map = &niagara2_cache_map,
220 .max_events = ARRAY_SIZE(niagara2_perfmon_event_map), 308 .max_events = ARRAY_SIZE(niagara2_perfmon_event_map),
221 .upper_shift = 19, 309 .upper_shift = 19,
222 .lower_shift = 6, 310 .lower_shift = 6,