Paul Mackerras | d662ed2 | 2009-01-09 17:01:53 +1100 | [diff] [blame] | 1 | /* |
Scott Wood | a111065 | 2010-02-25 18:09:45 -0600 | [diff] [blame] | 2 | * Performance event support - hardware-specific disambiguation |
Paul Mackerras | d662ed2 | 2009-01-09 17:01:53 +1100 | [diff] [blame] | 3 | * |
Scott Wood | a111065 | 2010-02-25 18:09:45 -0600 | [diff] [blame] | 4 | * For now this is a compile-time decision, but eventually it should be |
| 5 | * runtime. This would allow multiplatform perf event support for e300 (fsl |
| 6 | * embedded perf counters) plus server/classic, and would accommodate |
| 7 | * devices other than the core which provide their own performance counters. |
| 8 | * |
| 9 | * Copyright 2010 Freescale Semiconductor, Inc. |
Paul Mackerras | d662ed2 | 2009-01-09 17:01:53 +1100 | [diff] [blame] | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU General Public License |
| 13 | * as published by the Free Software Foundation; either version |
| 14 | * 2 of the License, or (at your option) any later version. |
| 15 | */ |
Paul Mackerras | 4574910 | 2009-01-09 20:21:55 +1100 | [diff] [blame] | 16 | |
Paul Mackerras | 105988c | 2009-06-17 21:50:04 +1000 | [diff] [blame] | 17 | #ifdef CONFIG_PPC_PERF_CTRS |
Scott Wood | a111065 | 2010-02-25 18:09:45 -0600 | [diff] [blame] | 18 | #include <asm/perf_event_server.h> |
Paul Mackerras | 105988c | 2009-06-17 21:50:04 +1000 | [diff] [blame] | 19 | #endif |
| 20 | |
Scott Wood | a111065 | 2010-02-25 18:09:45 -0600 | [diff] [blame] | 21 | #ifdef CONFIG_FSL_EMB_PERF_EVENT |
| 22 | #include <asm/perf_event_fsl_emb.h> |
| 23 | #endif |
Frederic Weisbecker | b0f82b8 | 2010-05-20 07:47:21 +0200 | [diff] [blame] | 24 | |
| 25 | #ifdef CONFIG_PERF_EVENTS |
| 26 | #include <asm/ptrace.h> |
| 27 | #include <asm/reg.h> |
| 28 | |
| 29 | #define perf_arch_fetch_caller_regs(regs, __ip) \ |
| 30 | do { \ |
| 31 | (regs)->nip = __ip; \ |
| 32 | (regs)->gpr[1] = *(unsigned long *)__get_SP(); \ |
| 33 | asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \ |
| 34 | } while (0) |
| 35 | #endif |