File tree Expand file tree Collapse file tree 4 files changed +45
-5
lines changed Expand file tree Collapse file tree 4 files changed +45
-5
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ obj-$(CONFIG_MODULE_SECTIONS) += module-sections.o
44
44
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
45
45
obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o
46
46
47
+ obj-$(CONFIG_TRACE_IRQFLAGS) += trace_irq.o
48
+
47
49
obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o
48
50
obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
49
51
obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ _save_context:
98
98
.option pop
99
99
100
100
#ifdef CONFIG_TRACE_IRQFLAGS
101
- call trace_hardirqs_off
101
+ call __trace_hardirqs_off
102
102
#endif
103
103
104
104
#ifdef CONFIG_CONTEXT_TRACKING
@@ -131,7 +131,7 @@ skip_context_tracking:
131
131
andi t0, s1, SR_PIE
132
132
beqz t0, 1f
133
133
#ifdef CONFIG_TRACE_IRQFLAGS
134
- call trace_hardirqs_on
134
+ call __trace_hardirqs_on
135
135
#endif
136
136
csrs CSR_STATUS, SR_IE
137
137
@@ -222,7 +222,7 @@ ret_from_exception:
222
222
REG_L s0, PT_STATUS(sp )
223
223
csrc CSR_STATUS, SR_IE
224
224
#ifdef CONFIG_TRACE_IRQFLAGS
225
- call trace_hardirqs_off
225
+ call __trace_hardirqs_off
226
226
#endif
227
227
#ifdef CONFIG_RISCV_M_MODE
228
228
/* the MPP value is too large to be used as an immediate arg for addi */
@@ -258,10 +258,10 @@ restore_all:
258
258
REG_L s1, PT_STATUS(sp )
259
259
andi t0, s1, SR_PIE
260
260
beqz t0, 1f
261
- call trace_hardirqs_on
261
+ call __trace_hardirqs_on
262
262
j 2f
263
263
1 :
264
- call trace_hardirqs_off
264
+ call __trace_hardirqs_off
265
265
2 :
266
266
#endif
267
267
REG_L a0 , PT_STATUS(sp )
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-2.0
2
+ /*
3
+ * Copyright (C) 2022 Changbin Du <changbin.du@gmail.com>
4
+ */
5
+
6
+ #include <linux/irqflags.h>
7
+ #include <linux/kprobes.h>
8
+ #include "trace_irq.h"
9
+
10
+ /*
11
+ * trace_hardirqs_on/off require the caller to setup frame pointer properly.
12
+ * Otherwise, CALLER_ADDR1 might trigger an pagging exception in kernel.
13
+ * Here we add one extra level so they can be safely called by low
14
+ * level entry code which $fp is used for other purpose.
15
+ */
16
+
17
+ void __trace_hardirqs_on (void )
18
+ {
19
+ trace_hardirqs_on ();
20
+ }
21
+ NOKPROBE_SYMBOL (__trace_hardirqs_on );
22
+
23
+ void __trace_hardirqs_off (void )
24
+ {
25
+ trace_hardirqs_off ();
26
+ }
27
+ NOKPROBE_SYMBOL (__trace_hardirqs_off );
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0 */
2
+ /*
3
+ * Copyright (C) 2022 Changbin Du <changbin.du@gmail.com>
4
+ */
5
+ #ifndef __TRACE_IRQ_H
6
+ #define __TRACE_IRQ_H
7
+
8
+ void __trace_hardirqs_on (void );
9
+ void __trace_hardirqs_off (void );
10
+
11
+ #endif /* __TRACE_IRQ_H */
You can’t perform that action at this time.
0 commit comments