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

Configure Feed

Select the types of activity you want to include in your feed.

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

+9 -60
-12
arch/x86/include/asm/trace/common.h
··· 1 - #ifndef _ASM_TRACE_COMMON_H 2 - #define _ASM_TRACE_COMMON_H 3 - 4 - #ifdef CONFIG_TRACING 5 - DECLARE_STATIC_KEY_FALSE(trace_pagefault_key); 6 - #define trace_pagefault_enabled() \ 7 - static_branch_unlikely(&trace_pagefault_key) 8 - #else 9 - static inline bool trace_pagefault_enabled(void) { return false; } 10 - #endif 11 - 12 - #endif
+8 -19
arch/x86/include/asm/trace/exceptions.h include/trace/events/exceptions.h
··· 6 6 #define _TRACE_PAGE_FAULT_H 7 7 8 8 #include <linux/tracepoint.h> 9 - #include <asm/trace/common.h> 10 9 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, 15 11 16 12 TP_PROTO(unsigned long address, struct pt_regs *regs, 17 13 unsigned long error_code), ··· 22 26 23 27 TP_fast_assign( 24 28 __entry->address = address; 25 - __entry->ip = regs->ip; 29 + __entry->ip = instruction_pointer(regs); 26 30 __entry->error_code = error_code; 27 31 ), 28 32 ··· 30 34 (void *)__entry->address, (void *)__entry->ip, 31 35 __entry->error_code) ); 32 36 33 - #define DEFINE_PAGE_FAULT_EVENT(name) \ 34 - DEFINE_EVENT_FN(x86_exceptions, name, \ 35 - TP_PROTO(unsigned long address, struct pt_regs *regs, \ 36 - unsigned long error_code), \ 37 - TP_ARGS(address, regs, error_code), \ 38 - trace_pagefault_reg, trace_pagefault_unreg); 37 + DEFINE_EVENT(exceptions, page_fault_user, 38 + TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code), 39 + TP_ARGS(address, regs, error_code)); 40 + DEFINE_EVENT(exceptions, page_fault_kernel, 41 + TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code), 42 + TP_ARGS(address, regs, error_code)); 39 43 40 - DEFINE_PAGE_FAULT_EVENT(page_fault_user); 41 - DEFINE_PAGE_FAULT_EVENT(page_fault_kernel); 42 - 43 - #undef TRACE_INCLUDE_PATH 44 - #undef TRACE_INCLUDE_FILE 45 - #define TRACE_INCLUDE_PATH . 46 - #define TRACE_INCLUDE_FILE exceptions 47 44 #endif /* _TRACE_PAGE_FAULT_H */ 48 45 49 46 /* This part must be outside protection */
-1
arch/x86/include/asm/trace/irq_vectors.h
··· 6 6 #define _TRACE_IRQ_VECTORS_H 7 7 8 8 #include <linux/tracepoint.h> 9 - #include <asm/trace/common.h> 10 9 11 10 #ifdef CONFIG_X86_LOCAL_APIC 12 11
-1
arch/x86/kernel/Makefile
··· 141 141 obj-$(CONFIG_UPROBES) += uprobes.o 142 142 143 143 obj-$(CONFIG_PERF_EVENTS) += perf_regs.o 144 - obj-$(CONFIG_TRACING) += tracepoint.o 145 144 obj-$(CONFIG_SCHED_MC_PRIO) += itmt.o 146 145 obj-$(CONFIG_X86_UMIP) += umip.o 147 146
-21
arch/x86/kernel/tracepoint.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * Copyright (C) 2013 Seiji Aguchi <seiji.aguchi@hds.com> 4 - */ 5 - #include <linux/jump_label.h> 6 - #include <linux/atomic.h> 7 - 8 - #include <asm/trace/exceptions.h> 9 - 10 - DEFINE_STATIC_KEY_FALSE(trace_pagefault_key); 11 - 12 - int trace_pagefault_reg(void) 13 - { 14 - static_branch_inc(&trace_pagefault_key); 15 - return 0; 16 - } 17 - 18 - void trace_pagefault_unreg(void) 19 - { 20 - static_branch_dec(&trace_pagefault_key); 21 - }
-2
arch/x86/mm/Makefile
··· 29 29 # Make sure __phys_addr has no stackprotector 30 30 CFLAGS_physaddr.o := -fno-stack-protector 31 31 32 - CFLAGS_fault.o := -I $(src)/../include/asm/trace 33 - 34 32 obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o 35 33 36 34 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
+1 -4
arch/x86/mm/fault.c
··· 37 37 #include <asm/sev.h> /* snp_dump_hva_rmpentry() */ 38 38 39 39 #define CREATE_TRACE_POINTS 40 - #include <asm/trace/exceptions.h> 40 + #include <trace/events/exceptions.h> 41 41 42 42 /* 43 43 * Returns 0 if mmiotrace is disabled, or if the fault is not ··· 1454 1454 trace_page_fault_entries(struct pt_regs *regs, unsigned long error_code, 1455 1455 unsigned long address) 1456 1456 { 1457 - if (!trace_pagefault_enabled()) 1458 - return; 1459 - 1460 1457 if (user_mode(regs)) 1461 1458 trace_page_fault_user(address, regs, error_code); 1462 1459 else