diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-03-12 04:20:57 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-03-12 04:20:59 -0500 |
| commit | 937779db13fb6cb621e28d9ae0a6cf1d05b57d05 (patch) | |
| tree | 6c27402677c347c4dc01980de78c270630588847 /include/linux/perf_event.h | |
| parent | 6230f2c7ef01a69e2ba9370326572c287209d32a (diff) | |
| parent | 9f591fd76afdc0e5192e9ed00a36f8efc0b4dfe6 (diff) | |
Merge branch 'perf/urgent' into perf/core
Merge reason: We want to queue up a dependent patch.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
| -rw-r--r-- | include/linux/perf_event.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index be85f7c4a94f..2bccb7b9da2d 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -459,6 +459,8 @@ enum perf_callchain_context { | |||
| 459 | #include <linux/fs.h> | 459 | #include <linux/fs.h> |
| 460 | #include <linux/pid_namespace.h> | 460 | #include <linux/pid_namespace.h> |
| 461 | #include <linux/workqueue.h> | 461 | #include <linux/workqueue.h> |
| 462 | #include <linux/ftrace.h> | ||
| 463 | #include <linux/cpu.h> | ||
| 462 | #include <asm/atomic.h> | 464 | #include <asm/atomic.h> |
| 463 | 465 | ||
| 464 | #define PERF_MAX_STACK_DEPTH 255 | 466 | #define PERF_MAX_STACK_DEPTH 255 |
| @@ -865,6 +867,44 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | |||
| 865 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 867 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
| 866 | } | 868 | } |
| 867 | 869 | ||
| 870 | extern void | ||
| 871 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | ||
| 872 | |||
| 873 | /* | ||
| 874 | * Take a snapshot of the regs. Skip ip and frame pointer to | ||
| 875 | * the nth caller. We only need a few of the regs: | ||
| 876 | * - ip for PERF_SAMPLE_IP | ||
| 877 | * - cs for user_mode() tests | ||
| 878 | * - bp for callchains | ||
| 879 | * - eflags, for future purposes, just in case | ||
| 880 | */ | ||
| 881 | static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip) | ||
| 882 | { | ||
| 883 | unsigned long ip; | ||
| 884 | |||
| 885 | memset(regs, 0, sizeof(*regs)); | ||
| 886 | |||
| 887 | switch (skip) { | ||
| 888 | case 1 : | ||
| 889 | ip = CALLER_ADDR0; | ||
| 890 | break; | ||
| 891 | case 2 : | ||
| 892 | ip = CALLER_ADDR1; | ||
| 893 | break; | ||
| 894 | case 3 : | ||
| 895 | ip = CALLER_ADDR2; | ||
| 896 | break; | ||
| 897 | case 4: | ||
| 898 | ip = CALLER_ADDR3; | ||
| 899 | break; | ||
| 900 | /* No need to support further for now */ | ||
| 901 | default: | ||
| 902 | ip = 0; | ||
| 903 | } | ||
| 904 | |||
| 905 | return perf_arch_fetch_caller_regs(regs, ip, skip); | ||
| 906 | } | ||
| 907 | |||
| 868 | extern void __perf_event_mmap(struct vm_area_struct *vma); | 908 | extern void __perf_event_mmap(struct vm_area_struct *vma); |
| 869 | 909 | ||
| 870 | static inline void perf_event_mmap(struct vm_area_struct *vma) | 910 | static inline void perf_event_mmap(struct vm_area_struct *vma) |
| @@ -898,7 +938,8 @@ static inline bool perf_paranoid_kernel(void) | |||
| 898 | } | 938 | } |
| 899 | 939 | ||
| 900 | extern void perf_event_init(void); | 940 | extern void perf_event_init(void); |
| 901 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); | 941 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, |
| 942 | int entry_size, struct pt_regs *regs); | ||
| 902 | extern void perf_bp_event(struct perf_event *event, void *data); | 943 | extern void perf_bp_event(struct perf_event *event, void *data); |
| 903 | 944 | ||
| 904 | #ifndef perf_misc_flags | 945 | #ifndef perf_misc_flags |
