aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/perf_event.h13
-rw-r--r--arch/x86/include/asm/stacktrace.h7
2 files changed, 15 insertions, 5 deletions
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index 254883d0c7e0..02de29830ffe 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -140,6 +140,19 @@ extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
140extern unsigned long perf_misc_flags(struct pt_regs *regs); 140extern unsigned long perf_misc_flags(struct pt_regs *regs);
141#define perf_misc_flags(regs) perf_misc_flags(regs) 141#define perf_misc_flags(regs) perf_misc_flags(regs)
142 142
143#include <asm/stacktrace.h>
144
145/*
146 * We abuse bit 3 from flags to pass exact information, see perf_misc_flags
147 * and the comment with PERF_EFLAGS_EXACT.
148 */
149#define perf_arch_fetch_caller_regs(regs, __ip) { \
150 (regs)->ip = (__ip); \
151 (regs)->bp = caller_frame_pointer(); \
152 (regs)->cs = __KERNEL_CS; \
153 regs->flags = 0; \
154}
155
143#else 156#else
144static inline void init_hw_perf_events(void) { } 157static inline void init_hw_perf_events(void) { }
145static inline void perf_events_lapic_init(void) { } 158static inline void perf_events_lapic_init(void) { }
diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
index a957463d3c7a..2b16a2ad23dc 100644
--- a/arch/x86/include/asm/stacktrace.h
+++ b/arch/x86/include/asm/stacktrace.h
@@ -78,17 +78,14 @@ struct stack_frame_ia32 {
78 u32 return_address; 78 u32 return_address;
79}; 79};
80 80
81static inline unsigned long rewind_frame_pointer(int n) 81static inline unsigned long caller_frame_pointer(void)
82{ 82{
83 struct stack_frame *frame; 83 struct stack_frame *frame;
84 84
85 get_bp(frame); 85 get_bp(frame);
86 86
87#ifdef CONFIG_FRAME_POINTER 87#ifdef CONFIG_FRAME_POINTER
88 while (n--) { 88 frame = frame->next_frame;
89 if (probe_kernel_address(&frame->next_frame, frame))
90 break;
91 }
92#endif 89#endif
93 90
94 return (unsigned long)frame; 91 return (unsigned long)frame;