Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/tracing, x86/mm: Move page fault tracepoints to generic

Page fault tracepoints are interesting for other architectures as well.
Move them to be generic.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Gabriele Monaco <gmonaco@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/89c2f284adf9b4c933f0e65811c50cef900a5a95.1747046848.git.namcao@linutronix.de

authored by

Nam Cao and committed by
Ingo Molnar
06aa9378 d49ae417

+7 -14
+6 -11
arch/x86/include/asm/trace/exceptions.h include/trace/events/exceptions.h
··· 7 7 8 8 #include <linux/tracepoint.h> 9 9 10 - DECLARE_EVENT_CLASS(x86_exceptions, 10 + DECLARE_EVENT_CLASS(exceptions, 11 11 12 12 TP_PROTO(unsigned long address, struct pt_regs *regs, 13 13 unsigned long error_code), ··· 22 22 23 23 TP_fast_assign( 24 24 __entry->address = address; 25 - __entry->ip = regs->ip; 25 + __entry->ip = instruction_pointer(regs); 26 26 __entry->error_code = error_code; 27 27 ), 28 28 ··· 30 30 (void *)__entry->address, (void *)__entry->ip, 31 31 __entry->error_code) ); 32 32 33 - DEFINE_EVENT(x86_exceptions, page_fault_user, 33 + DEFINE_EVENT(exceptions, page_fault_user, 34 + TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code), 35 + TP_ARGS(address, regs, error_code)); 36 + DEFINE_EVENT(exceptions, page_fault_kernel, 34 37 TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code), 35 38 TP_ARGS(address, regs, error_code)); 36 39 37 - DEFINE_EVENT(x86_exceptions, page_fault_kernel, 38 - TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code), 39 - TP_ARGS(address, regs, error_code)); 40 - 41 - #undef TRACE_INCLUDE_PATH 42 - #undef TRACE_INCLUDE_FILE 43 - #define TRACE_INCLUDE_PATH . 44 - #define TRACE_INCLUDE_FILE exceptions 45 40 #endif /* _TRACE_PAGE_FAULT_H */ 46 41 47 42 /* This part must be outside protection */
-2
arch/x86/mm/Makefile
··· 34 34 CFLAGS_physaddr.o := -fno-stack-protector 35 35 CFLAGS_mem_encrypt_identity.o := -fno-stack-protector 36 36 37 - CFLAGS_fault.o := -I $(src)/../include/asm/trace 38 - 39 37 obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o 40 38 41 39 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
+1 -1
arch/x86/mm/fault.c
··· 38 38 #include <asm/sev.h> /* snp_dump_hva_rmpentry() */ 39 39 40 40 #define CREATE_TRACE_POINTS 41 - #include <asm/trace/exceptions.h> 41 + #include <trace/events/exceptions.h> 42 42 43 43 /* 44 44 * Returns 0 if mmiotrace is disabled, or if the fault is not