Skip to content

Commit d49ae41

Browse files
covanamIngo Molnar
authored andcommitted
x86/tracing, x86/mm: Remove redundant trace_pagefault_key
trace_pagefault_key is used to optimize the pagefault tracepoints when it is disabled. However, tracepoints already have built-in static_key for this exact purpose. Remove this redundant key. 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/827c7666d2989f08742a4fb869b1ed5bfaaf1dbf.1747046848.git.namcao@linutronix.de
1 parent 82f2b0b commit d49ae41

File tree

6 files changed

+6
-50
lines changed

6 files changed

+6
-50
lines changed

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

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

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

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

88
#include <linux/tracepoint.h>
9-
#include <asm/trace/common.h>
10-
11-
extern int trace_pagefault_reg(void);
12-
extern void trace_pagefault_unreg(void);
139

1410
DECLARE_EVENT_CLASS(x86_exceptions,
1511

@@ -34,15 +30,13 @@ DECLARE_EVENT_CLASS(x86_exceptions,
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);
33+
DEFINE_EVENT(x86_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));
4336

44-
DEFINE_PAGE_FAULT_EVENT(page_fault_user);
45-
DEFINE_PAGE_FAULT_EVENT(page_fault_kernel);
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));
4640

4741
#undef TRACE_INCLUDE_PATH
4842
#undef TRACE_INCLUDE_FILE

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/fault.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,6 @@ static __always_inline void
14551455
trace_page_fault_entries(struct pt_regs *regs, unsigned long error_code,
14561456
unsigned long address)
14571457
{
1458-
if (!trace_pagefault_enabled())
1459-
return;
1460-
14611458
if (user_mode(regs))
14621459
trace_page_fault_user(address, regs, error_code);
14631460
else

0 commit comments

Comments
 (0)