Skip to content

Commit 06aa937

Browse files
covanamIngo Molnar
authored andcommitted
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
1 parent d49ae41 commit 06aa937

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

arch/x86/mm/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ obj-y += pat/
3434
CFLAGS_physaddr.o := -fno-stack-protector
3535
CFLAGS_mem_encrypt_identity.o := -fno-stack-protector
3636

37-
CFLAGS_fault.o := -I $(src)/../include/asm/trace
38-
3937
obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o
4038

4139
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o

arch/x86/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <asm/sev.h> /* snp_dump_hva_rmpentry() */
3939

4040
#define CREATE_TRACE_POINTS
41-
#include <asm/trace/exceptions.h>
41+
#include <trace/events/exceptions.h>
4242

4343
/*
4444
* Returns 0 if mmiotrace is disabled, or if the fault is not

arch/x86/include/asm/trace/exceptions.h renamed to include/trace/events/exceptions.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include <linux/tracepoint.h>
99

10-
DECLARE_EVENT_CLASS(x86_exceptions,
10+
DECLARE_EVENT_CLASS(exceptions,
1111

1212
TP_PROTO(unsigned long address, struct pt_regs *regs,
1313
unsigned long error_code),
@@ -22,26 +22,21 @@ DECLARE_EVENT_CLASS(x86_exceptions,
2222

2323
TP_fast_assign(
2424
__entry->address = address;
25-
__entry->ip = regs->ip;
25+
__entry->ip = instruction_pointer(regs);
2626
__entry->error_code = error_code;
2727
),
2828

2929
TP_printk("address=%ps ip=%ps error_code=0x%lx",
3030
(void *)__entry->address, (void *)__entry->ip,
3131
__entry->error_code) );
3232

33-
DEFINE_EVENT(x86_exceptions, page_fault_user,
33+
DEFINE_EVENT(exceptions, page_fault_user,
3434
TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code),
3535
TP_ARGS(address, regs, error_code));
36-
37-
DEFINE_EVENT(x86_exceptions, page_fault_kernel,
36+
DEFINE_EVENT(exceptions, page_fault_kernel,
3837
TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code),
3938
TP_ARGS(address, regs, error_code));
4039

41-
#undef TRACE_INCLUDE_PATH
42-
#undef TRACE_INCLUDE_FILE
43-
#define TRACE_INCLUDE_PATH .
44-
#define TRACE_INCLUDE_FILE exceptions
4540
#endif /* _TRACE_PAGE_FAULT_H */
4641

4742
/* This part must be outside protection */

0 commit comments

Comments
 (0)