diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 02:25:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 02:25:10 -0500 |
commit | 7971e23a66c94f1b9bd2d64a3e86dfbfa8c60121 (patch) | |
tree | 20ff577e437ac6c361335151ce6b4c59bc72de02 /arch/x86/mm/fault.c | |
parent | f0d55cc1a65852e6647d4f5d707c1c9b5471ce3c (diff) | |
parent | a4f61dec55c1bdebb84ba77212ebf98f7247736c (diff) |
Merge branch 'x86-trace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/trace changes from Ingo Molnar:
"This adds page fault tracepoints which have zero runtime cost in the
disabled case via IDT trickery (no NOPs in the page fault hotpath)"
* 'x86-trace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86, trace: Change user|kernel_page_fault to page_fault_user|kernel
x86, trace: Add page fault tracepoints
x86, trace: Delete __trace_alloc_intr_gate()
x86, trace: Register exception handler to trace IDT
x86, trace: Remove __alloc_intr_gate()
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 7a517bb41060..1560a5de1ce0 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -20,6 +20,9 @@ | |||
20 | #include <asm/kmemcheck.h> /* kmemcheck_*(), ... */ | 20 | #include <asm/kmemcheck.h> /* kmemcheck_*(), ... */ |
21 | #include <asm/fixmap.h> /* VSYSCALL_START */ | 21 | #include <asm/fixmap.h> /* VSYSCALL_START */ |
22 | 22 | ||
23 | #define CREATE_TRACE_POINTS | ||
24 | #include <asm/trace/exceptions.h> | ||
25 | |||
23 | /* | 26 | /* |
24 | * Page fault error code bits: | 27 | * Page fault error code bits: |
25 | * | 28 | * |
@@ -1232,3 +1235,23 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
1232 | __do_page_fault(regs, error_code); | 1235 | __do_page_fault(regs, error_code); |
1233 | exception_exit(prev_state); | 1236 | exception_exit(prev_state); |
1234 | } | 1237 | } |
1238 | |||
1239 | static void trace_page_fault_entries(struct pt_regs *regs, | ||
1240 | unsigned long error_code) | ||
1241 | { | ||
1242 | if (user_mode(regs)) | ||
1243 | trace_page_fault_user(read_cr2(), regs, error_code); | ||
1244 | else | ||
1245 | trace_page_fault_kernel(read_cr2(), regs, error_code); | ||
1246 | } | ||
1247 | |||
1248 | dotraplinkage void __kprobes | ||
1249 | trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) | ||
1250 | { | ||
1251 | enum ctx_state prev_state; | ||
1252 | |||
1253 | prev_state = exception_enter(); | ||
1254 | trace_page_fault_entries(regs, error_code); | ||
1255 | __do_page_fault(regs, error_code); | ||
1256 | exception_exit(prev_state); | ||
1257 | } | ||