Skip to content

Commit 0aee061

Browse files
committed
Merge tag 'x86-debug-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 debug updates from Ingo Molnar: "Move the x86 page fault tracepoints to generic code, because other architectures would like to make use of them as well" * tag 'x86-debug-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/tracing, x86/mm: Move page fault tracepoints to generic x86/tracing, x86/mm: Remove redundant trace_pagefault_key
2 parents 020fca0 + 06aa937 commit 0aee061

File tree

7 files changed

+9
-60
lines changed

7 files changed

+9
-60
lines changed

arch/x86/include/asm/trace/common.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

arch/x86/include/asm/trace/irq_vectors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#define _TRACE_IRQ_VECTORS_H
77

88
#include <linux/tracepoint.h>
9-
#include <asm/trace/common.h>
109

1110
#ifdef CONFIG_X86_LOCAL_APIC
1211

arch/x86/kernel/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ obj-$(CONFIG_OF) += devicetree.o
141141
obj-$(CONFIG_UPROBES) += uprobes.o
142142

143143
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o
144-
obj-$(CONFIG_TRACING) += tracepoint.o
145144
obj-$(CONFIG_SCHED_MC_PRIO) += itmt.o
146145
obj-$(CONFIG_X86_UMIP) += umip.o
147146

arch/x86/kernel/tracepoint.c

Lines changed: 0 additions & 21 deletions
This file was deleted.

arch/x86/mm/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ obj-y += pat/
2929
# Make sure __phys_addr has no stackprotector
3030
CFLAGS_physaddr.o := -fno-stack-protector
3131

32-
CFLAGS_fault.o := -I $(src)/../include/asm/trace
33-
3432
obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o
3533

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

arch/x86/mm/fault.c

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

3939
#define CREATE_TRACE_POINTS
40-
#include <asm/trace/exceptions.h>
40+
#include <trace/events/exceptions.h>
4141

4242
/*
4343
* Returns 0 if mmiotrace is disabled, or if the fault is not
@@ -1454,9 +1454,6 @@ static __always_inline void
14541454
trace_page_fault_entries(struct pt_regs *regs, unsigned long error_code,
14551455
unsigned long address)
14561456
{
1457-
if (!trace_pagefault_enabled())
1458-
return;
1459-
14601457
if (user_mode(regs))
14611458
trace_page_fault_user(address, regs, error_code);
14621459
else

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

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
#define _TRACE_PAGE_FAULT_H
77

88
#include <linux/tracepoint.h>
9-
#include <asm/trace/common.h>
109

11-
extern int trace_pagefault_reg(void);
12-
extern void trace_pagefault_unreg(void);
13-
14-
DECLARE_EVENT_CLASS(x86_exceptions,
10+
DECLARE_EVENT_CLASS(exceptions,
1511

1612
TP_PROTO(unsigned long address, struct pt_regs *regs,
1713
unsigned long error_code),
@@ -26,28 +22,21 @@ DECLARE_EVENT_CLASS(x86_exceptions,
2622

2723
TP_fast_assign(
2824
__entry->address = address;
29-
__entry->ip = regs->ip;
25+
__entry->ip = instruction_pointer(regs);
3026
__entry->error_code = error_code;
3127
),
3228

3329
TP_printk("address=%ps ip=%ps error_code=0x%lx",
3430
(void *)__entry->address, (void *)__entry->ip,
3531
__entry->error_code) );
3632

37-
#define DEFINE_PAGE_FAULT_EVENT(name) \
38-
DEFINE_EVENT_FN(x86_exceptions, name, \
39-
TP_PROTO(unsigned long address, struct pt_regs *regs, \
40-
unsigned long error_code), \
41-
TP_ARGS(address, regs, error_code), \
42-
trace_pagefault_reg, trace_pagefault_unreg);
43-
44-
DEFINE_PAGE_FAULT_EVENT(page_fault_user);
45-
DEFINE_PAGE_FAULT_EVENT(page_fault_kernel);
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,
37+
TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code),
38+
TP_ARGS(address, regs, error_code));
4639

47-
#undef TRACE_INCLUDE_PATH
48-
#undef TRACE_INCLUDE_FILE
49-
#define TRACE_INCLUDE_PATH .
50-
#define TRACE_INCLUDE_FILE exceptions
5140
#endif /* _TRACE_PAGE_FAULT_H */
5241

5342
/* This part must be outside protection */

0 commit comments

Comments
 (0)