summaryrefslogtreecommitdiffstats
path: root/patches/0009-x86-fault-do-not-define-trace-function-for-CONFIG_TR.patch
blob: 23cdfb2b084035137d6e21e8e9712c018dcb3bd6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 210cd60d993e023a293b403eb4886dfb8c8acbc9 Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Sun, 24 May 2020 19:01:48 -0600
Subject: [PATCH 09/34] x86: fault: do not define trace function for
 !CONFIG_TRACING

Do not define the page fault tracing function for !CONFIG_TRACING, when
the header file has a static inline function to redirect it elsewhere.
Having both results in a compiler error.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 arch/x86/mm/fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index f7d79eae0b1..4698dedc707 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1379,6 +1379,7 @@ static void trace_page_fault_entries(struct pt_regs *regs,
 		trace_page_fault_kernel(read_cr2(), regs, error_code);
 }
 
+#ifdef CONFIG_TRACING
 dotraplinkage void __kprobes
 trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
 {
@@ -1396,3 +1397,4 @@ trace_do_page_fault(struct pt_regs *regs, unsigned long error_code)
 	__do_page_fault(regs, error_code, address);
 	exception_exit(prev_state);
 }
+#endif
-- 
2.29.1