History

ftrace: Have the callbacks receive a struct ftrace_regs instead of pt_regs

In preparation to have arguments of a function passed to callbacks attached to functions as default, change the default callback prototype to receive a struct ftrace_regs as the forth parameter instead of a pt_regs. For callbacks that set the FL_SAVE_REGS flag in their ftrace_ops flags, they will now need to get the pt_regs via a ftrace_get_regs() helper call. If this is called by a callback that their ftrace_ops did not have a FL_SAVE_REGS flag set, it that helper function will return NULL. This will allow the ftrace_regs to hold enough just to get the parameters and stack pointer, but without the worry that callbacks may have a pt_regs that is not completely filled.

Steven Rostedt (VMware) committed 6 years ago

Commit d19ad071 parent 58954b318 files · +71 −45Browse files

Unified · Split

18 files
  1. arch/csky/kernel/probes/ftrace.c +3 −1
  2. arch/nds32/kernel/ftrace.c +2 −2
  3. arch/parisc/kernel/ftrace.c +5 −3
  4. arch/powerpc/kernel/kprobes-ftrace.c +3 −1
  5. arch/s390/kernel/ftrace.c +3 −1
  6. arch/x86/kernel/kprobes/ftrace.c +2 −1
  7. fs/pstore/ftrace.c +1 −1
  8. include/linux/ftrace.h +14 −2
  9. include/linux/kprobes.h +1 −1
  10. kernel/livepatch/patch.c +2 −1
  11. kernel/trace/ftrace.c +15 −12
  12. kernel/trace/trace_event_perf.c +1 −1
  13. kernel/trace/trace_events.c +1 −1
  14. kernel/trace/trace_functions.c +4 −5
  15. kernel/trace/trace_irqsoff.c +1 −1
  16. kernel/trace/trace_sched_wakeup.c +1 −1
  17. kernel/trace/trace_selftest.c +11 −9
  18. kernel/trace/trace_stack.c +1 −1
arch/csky/kernel/probes/ftrace.c+3−1
@@ -11,17 +11,19 @@ int arch_check_ftrace_location(struct kprobe *p) · 10 unmodified lines
1111
1212 /* Ftrace callback handler for kprobes -- called under preepmt disabed */
1313 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
14− struct ftrace_ops *ops, struct pt_regs *regs)
14+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
1515 {
1616 int bit;
1717 bool lr_saver = false;
1818 struct kprobe *p;
1919 struct kprobe_ctlblk *kcb;
20+ struct pt_regs *regs;
2021
2122 bit = ftrace_test_recursion_trylock(ip, parent_ip);
2223 if (bit < 0)
2324 return;
2425
26+ regs = ftrace_get_regs(fregs);
2527 preempt_disable_notrace();
2628 p = get_kprobe((kprobe_opcode_t *)ip);
2729 if (!p) {
arch/nds32/kernel/ftrace.c+2−2
@@ -10,7 +10,7 @@ extern void (*ftrace_trace_function)(unsigned long, unsigned long, · 9 unmodified lines
1010 extern void ftrace_graph_caller(void);
1111
1212 noinline void __naked ftrace_stub(unsigned long ip, unsigned long parent_ip,
13− struct ftrace_ops *op, struct pt_regs *regs)
13+ struct ftrace_ops *op, struct ftrace_regs *fregs)
1414 {
1515 __asm__ (""); /* avoid to optimize as pure function */
1616 }
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(_mcount); · 21 unmodified lines
3838 #else /* CONFIG_DYNAMIC_FTRACE */
3939
4040 noinline void __naked ftrace_stub(unsigned long ip, unsigned long parent_ip,
41− struct ftrace_ops *op, struct pt_regs *regs)
41+ struct ftrace_ops *op, struct ftrace_regs *fregs)
4242 {
4343 __asm__ (""); /* avoid to optimize as pure function */
4444 }
arch/parisc/kernel/ftrace.c+5−3
@@ -51,7 +51,7 @@ static void __hot prepare_ftrace_return(unsigned long *parent, · 50 unmodified lines
5151 void notrace __hot ftrace_function_trampoline(unsigned long parent,
5252 unsigned long self_addr,
5353 unsigned long org_sp_gr3,
54− struct pt_regs *regs)
54+ struct ftrace_regs *fregs)
5555 {
5656 #ifndef CONFIG_DYNAMIC_FTRACE
5757 extern ftrace_func_t ftrace_trace_function;
@@ -61,7 +61,7 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent, · 3 unmodified lines
6161 if (function_trace_op->flags & FTRACE_OPS_FL_ENABLED &&
6262 ftrace_trace_function != ftrace_stub)
6363 ftrace_trace_function(self_addr, parent,
64− function_trace_op, regs);
64+ function_trace_op, fregs);
6565
6666 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
6767 if (dereference_function_descriptor(ftrace_graph_return) !=
@@ -204,9 +204,10 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, · 136 unmodified lines
204204
205205 #ifdef CONFIG_KPROBES_ON_FTRACE
206206 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
207− struct ftrace_ops *ops, struct pt_regs *regs)
207+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
208208 {
209209 struct kprobe_ctlblk *kcb;
210+ struct pt_regs *regs;
210211 struct kprobe *p;
211212 int bit;
212213
@@ -214,6 +215,7 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, · 1 unmodified line
214215 if (bit < 0)
215216 return;
216217
218+ regs = ftrace_get_regs(fregs);
217219 preempt_disable_notrace();
218220 p = get_kprobe((kprobe_opcode_t *)ip);
219221 if (unlikely(!p) || kprobe_disabled(p))
arch/powerpc/kernel/kprobes-ftrace.c+3−1
@@ -14,16 +14,18 @@ · 13 unmodified lines
1414
1515 /* Ftrace callback handler for kprobes */
1616 void kprobe_ftrace_handler(unsigned long nip, unsigned long parent_nip,
17− struct ftrace_ops *ops, struct pt_regs *regs)
17+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
1818 {
1919 struct kprobe *p;
2020 struct kprobe_ctlblk *kcb;
21+ struct pt_regs *regs;
2122 int bit;
2223
2324 bit = ftrace_test_recursion_trylock(nip, parent_nip);
2425 if (bit < 0)
2526 return;
2627
28+ regs = ftrace_get_regs(fregs);
2729 preempt_disable_notrace();
2830 p = get_kprobe((kprobe_opcode_t *)nip);
2931 if (unlikely(!p) || kprobe_disabled(p))
arch/s390/kernel/ftrace.c+3−1
@@ -198,9 +198,10 @@ int ftrace_disable_ftrace_graph_caller(void) · 197 unmodified lines
198198
199199 #ifdef CONFIG_KPROBES_ON_FTRACE
200200 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
201− struct ftrace_ops *ops, struct pt_regs *regs)
201+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
202202 {
203203 struct kprobe_ctlblk *kcb;
204+ struct pt_regs *regs;
204205 struct kprobe *p;
205206 int bit;
206207
@@ -208,6 +209,7 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, · 1 unmodified line
208209 if (bit < 0)
209210 return;
210211
212+ regs = ftrace_get_regs(fregs);
211213 preempt_disable_notrace();
212214 p = get_kprobe((kprobe_opcode_t *)ip);
213215 if (unlikely(!p) || kprobe_disabled(p))
arch/x86/kernel/kprobes/ftrace.c+2−1
@@ -14,8 +14,9 @@ · 13 unmodified lines
1414
1515 /* Ftrace callback handler for kprobes -- called under preepmt disabed */
1616 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
17− struct ftrace_ops *ops, struct pt_regs *regs)
17+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
1818 {
19+ struct pt_regs *regs = ftrace_get_regs(fregs);
1920 struct kprobe *p;
2021 struct kprobe_ctlblk *kcb;
2122 int bit;
fs/pstore/ftrace.c+1−1
@@ -26,7 +26,7 @@ static u64 pstore_ftrace_stamp; · 25 unmodified lines
2626 static void notrace pstore_ftrace_call(unsigned long ip,
2727 unsigned long parent_ip,
2828 struct ftrace_ops *op,
29− struct pt_regs *regs)
29+ struct ftrace_regs *fregs)
3030 {
3131 int bit;
3232 unsigned long flags;
include/linux/ftrace.h+14−2
@@ -90,8 +90,20 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, · 89 unmodified lines
9090
9191 struct ftrace_ops;
9292
93+struct ftrace_regs {
94+ struct pt_regs regs;
95+};
96+
97+static __always_inline struct pt_regs *ftrace_get_regs(struct ftrace_regs *fregs)
98+{
99+ if (!fregs)
100+ return NULL;
101+
102+ return &fregs->regs;
103+}
104+
93105 typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
94− struct ftrace_ops *op, struct pt_regs *regs);
106+ struct ftrace_ops *op, struct ftrace_regs *fregs);
95107
96108 ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops);
97109
@@ -259,7 +271,7 @@ int register_ftrace_function(struct ftrace_ops *ops); · 161 unmodified lines
259271 int unregister_ftrace_function(struct ftrace_ops *ops);
260272
261273 extern void ftrace_stub(unsigned long a0, unsigned long a1,
262− struct ftrace_ops *op, struct pt_regs *regs);
274+ struct ftrace_ops *op, struct ftrace_regs *fregs);
263275
264276 #else /* !CONFIG_FUNCTION_TRACER */
265277 /*
include/linux/kprobes.h+1−1
@@ -345,7 +345,7 @@ static inline void wait_for_kprobe_optimizer(void) { } · 344 unmodified lines
345345 #endif /* CONFIG_OPTPROBES */
346346 #ifdef CONFIG_KPROBES_ON_FTRACE
347347 extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
348− struct ftrace_ops *ops, struct pt_regs *regs);
348+ struct ftrace_ops *ops, struct ftrace_regs *fregs);
349349 extern int arch_prepare_kprobe_ftrace(struct kprobe *p);
350350 #endif
351351
kernel/livepatch/patch.c+2−1
@@ -40,8 +40,9 @@ struct klp_ops *klp_find_ops(void *old_func) · 39 unmodified lines
4040 static void notrace klp_ftrace_handler(unsigned long ip,
4141 unsigned long parent_ip,
4242 struct ftrace_ops *fops,
43− struct pt_regs *regs)
43+ struct ftrace_regs *fregs)
4444 {
45+ struct pt_regs *regs = ftrace_get_regs(fregs);
4546 struct klp_ops *ops;
4647 struct klp_func *func;
4748 int patch_state;
kernel/trace/ftrace.c+15−12
@@ -121,7 +121,7 @@ struct ftrace_ops global_ops; · 120 unmodified lines
121121
122122 #if ARCH_SUPPORTS_FTRACE_OPS
123123 static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
124− struct ftrace_ops *op, struct pt_regs *regs);
124+ struct ftrace_ops *op, struct ftrace_regs *fregs);
125125 #else
126126 /* See comment below, where ftrace_ops_list_func is defined */
127127 static void ftrace_ops_no_ops(unsigned long ip, unsigned long parent_ip);
@@ -140,7 +140,7 @@ static inline void ftrace_ops_init(struct ftrace_ops *ops) · 12 unmodified lines
140140 }
141141
142142 static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip,
143− struct ftrace_ops *op, struct pt_regs *regs)
143+ struct ftrace_ops *op, struct ftrace_regs *fregs)
144144 {
145145 struct trace_array *tr = op->private;
146146 int pid;
@@ -154,7 +154,7 @@ static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip, · 7 unmodified lines
154154 return;
155155 }
156156
157− op->saved_func(ip, parent_ip, op, regs);
157+ op->saved_func(ip, parent_ip, op, fregs);
158158 }
159159
160160 static void ftrace_sync_ipi(void *data)
@@ -754,7 +754,7 @@ ftrace_profile_alloc(struct ftrace_profile_stat *stat, unsigned long ip) · 593 unmodified lines
754754
755755 static void
756756 function_profile_call(unsigned long ip, unsigned long parent_ip,
757− struct ftrace_ops *ops, struct pt_regs *regs)
757+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
758758 {
759759 struct ftrace_profile_stat *stat;
760760 struct ftrace_profile *rec;
@@ -2143,6 +2143,7 @@ static int ftrace_check_record(struct dyn_ftrace *rec, bool enable, bool update) · 1382 unmodified lines
21432143 else
21442144 rec->flags &= ~FTRACE_FL_TRAMP_EN;
21452145 }
2146+
21462147 if (flag & FTRACE_FL_DIRECT) {
21472148 /*
21482149 * If there's only one user (direct_ops helper)
@@ -2368,8 +2369,9 @@ unsigned long ftrace_find_rec_direct(unsigned long ip) · 219 unmodified lines
23682369 }
23692370
23702371 static void call_direct_funcs(unsigned long ip, unsigned long pip,
2371− struct ftrace_ops *ops, struct pt_regs *regs)
2372+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
23722373 {
2374+ struct pt_regs *regs = ftrace_get_regs(fregs);
23732375 unsigned long addr;
23742376
23752377 addr = ftrace_find_rec_direct(ip);
@@ -4292,7 +4294,7 @@ static int __init ftrace_mod_cmd_init(void) · 1916 unmodified lines
42924294 core_initcall(ftrace_mod_cmd_init);
42934295
42944296 static void function_trace_probe_call(unsigned long ip, unsigned long parent_ip,
4295− struct ftrace_ops *op, struct pt_regs *pt_regs)
4297+ struct ftrace_ops *op, struct ftrace_regs *fregs)
42964298 {
42974299 struct ftrace_probe_ops *probe_ops;
42984300 struct ftrace_func_probe *probe;
@@ -6911,8 +6913,9 @@ void ftrace_reset_array_ops(struct trace_array *tr) · 2612 unmodified lines
69116913
69126914 static nokprobe_inline void
69136915 __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
6914− struct ftrace_ops *ignored, struct pt_regs *regs)
6916+ struct ftrace_ops *ignored, struct ftrace_regs *fregs)
69156917 {
6918+ struct pt_regs *regs = ftrace_get_regs(fregs);
69166919 struct ftrace_ops *op;
69176920 int bit;
69186921
@@ -6945,7 +6948,7 @@ __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, · 26 unmodified lines
69456948 pr_warn("op=%p %pS\n", op, op);
69466949 goto out;
69476950 }
6948− op->func(ip, parent_ip, op, regs);
6951+ op->func(ip, parent_ip, op, fregs);
69496952 }
69506953 } while_for_each_ftrace_op(op);
69516954 out:
@@ -6968,9 +6971,9 @@ out: · 16 unmodified lines
69686971 */
69696972 #if ARCH_SUPPORTS_FTRACE_OPS
69706973 static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
6971− struct ftrace_ops *op, struct pt_regs *regs)
6974+ struct ftrace_ops *op, struct ftrace_regs *fregs)
69726975 {
6973− __ftrace_ops_list_func(ip, parent_ip, NULL, regs);
6976+ __ftrace_ops_list_func(ip, parent_ip, NULL, fregs);
69746977 }
69756978 NOKPROBE_SYMBOL(ftrace_ops_list_func);
69766979 #else
@@ -6987,7 +6990,7 @@ NOKPROBE_SYMBOL(ftrace_ops_no_ops); · 10 unmodified lines
69876990 * this function will be called by the mcount trampoline.
69886991 */
69896992 static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
6990− struct ftrace_ops *op, struct pt_regs *regs)
6993+ struct ftrace_ops *op, struct ftrace_regs *fregs)
69916994 {
69926995 int bit;
69936996
@@ -6998,7 +7001,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip, · 4 unmodified lines
69987001 preempt_disable_notrace();
69997002
70007003 if (!(op->flags & FTRACE_OPS_FL_RCU) || rcu_is_watching())
7001− op->func(ip, parent_ip, op, regs);
7004+ op->func(ip, parent_ip, op, fregs);
70027005
70037006 preempt_enable_notrace();
70047007 trace_clear_recursion(bit);
kernel/trace/trace_event_perf.c+1−1
@@ -432,7 +432,7 @@ NOKPROBE_SYMBOL(perf_trace_buf_update); · 431 unmodified lines
432432 #ifdef CONFIG_FUNCTION_TRACER
433433 static void
434434 perf_ftrace_function_call(unsigned long ip, unsigned long parent_ip,
435− struct ftrace_ops *ops, struct pt_regs *pt_regs)
435+ struct ftrace_ops *ops, struct ftrace_regs *fregs)
436436 {
437437 struct ftrace_entry *entry;
438438 struct perf_event *event;
kernel/trace/trace_events.c+1−1
@@ -3673,7 +3673,7 @@ static struct trace_event_file event_trace_file __initdata; · 3672 unmodified lines
36733673
36743674 static void __init
36753675 function_test_events_call(unsigned long ip, unsigned long parent_ip,
3676− struct ftrace_ops *op, struct pt_regs *pt_regs)
3676+ struct ftrace_ops *op, struct ftrace_regs *regs)
36773677 {
36783678 struct trace_buffer *buffer;
36793679 struct ring_buffer_event *event;
kernel/trace/trace_functions.c+4−5
@@ -23,10 +23,10 @@ static void tracing_start_function_trace(struct trace_array *tr); · 22 unmodified lines
2323 static void tracing_stop_function_trace(struct trace_array *tr);
2424 static void
2525 function_trace_call(unsigned long ip, unsigned long parent_ip,
26− struct ftrace_ops *op, struct pt_regs *pt_regs);
26+ struct ftrace_ops *op, struct ftrace_regs *fregs);
2727 static void
2828 function_stack_trace_call(unsigned long ip, unsigned long parent_ip,
29− struct ftrace_ops *op, struct pt_regs *pt_regs);
29+ struct ftrace_ops *op, struct ftrace_regs *fregs);
3030 static struct tracer_flags func_flags;
3131
3232 /* Our option */
@@ -89,7 +89,6 @@ void ftrace_destroy_function_files(struct trace_array *tr) · 56 unmodified lines
8989 static int function_trace_init(struct trace_array *tr)
9090 {
9191 ftrace_func_t func;
92−
9392 /*
9493 * Instance trace_arrays get their ops allocated
9594 * at instance creation. Unless it failed
@@ -129,7 +128,7 @@ static void function_trace_start(struct trace_array *tr) · 33 unmodified lines
129128
130129 static void
131130 function_trace_call(unsigned long ip, unsigned long parent_ip,
132− struct ftrace_ops *op, struct pt_regs *pt_regs)
131+ struct ftrace_ops *op, struct ftrace_regs *fregs)
133132 {
134133 struct trace_array *tr = op->private;
135134 struct trace_array_cpu *data;
@@ -178,7 +177,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip, · 42 unmodified lines
178177
179178 static void
180179 function_stack_trace_call(unsigned long ip, unsigned long parent_ip,
181− struct ftrace_ops *op, struct pt_regs *pt_regs)
180+ struct ftrace_ops *op, struct ftrace_regs *fregs)
182181 {
183182 struct trace_array *tr = op->private;
184183 struct trace_array_cpu *data;
kernel/trace/trace_irqsoff.c+1−1
@@ -138,7 +138,7 @@ static int func_prolog_dec(struct trace_array *tr, · 137 unmodified lines
138138 */
139139 static void
140140 irqsoff_tracer_call(unsigned long ip, unsigned long parent_ip,
141− struct ftrace_ops *op, struct pt_regs *pt_regs)
141+ struct ftrace_ops *op, struct ftrace_regs *fregs)
142142 {
143143 struct trace_array *tr = irqsoff_trace;
144144 struct trace_array_cpu *data;
kernel/trace/trace_sched_wakeup.c+1−1
@@ -212,7 +212,7 @@ static void wakeup_print_header(struct seq_file *s) · 211 unmodified lines
212212 */
213213 static void
214214 wakeup_tracer_call(unsigned long ip, unsigned long parent_ip,
215− struct ftrace_ops *op, struct pt_regs *pt_regs)
215+ struct ftrace_ops *op, struct ftrace_regs *fregs)
216216 {
217217 struct trace_array *tr = wakeup_trace;
218218 struct trace_array_cpu *data;
kernel/trace/trace_selftest.c+11−9
@@ -107,7 +107,7 @@ static int trace_selftest_test_probe1_cnt; · 106 unmodified lines
107107 static void trace_selftest_test_probe1_func(unsigned long ip,
108108 unsigned long pip,
109109 struct ftrace_ops *op,
110− struct pt_regs *pt_regs)
110+ struct ftrace_regs *fregs)
111111 {
112112 trace_selftest_test_probe1_cnt++;
113113 }
@@ -116,7 +116,7 @@ static int trace_selftest_test_probe2_cnt; · 2 unmodified lines
116116 static void trace_selftest_test_probe2_func(unsigned long ip,
117117 unsigned long pip,
118118 struct ftrace_ops *op,
119− struct pt_regs *pt_regs)
119+ struct ftrace_regs *fregs)
120120 {
121121 trace_selftest_test_probe2_cnt++;
122122 }
@@ -125,7 +125,7 @@ static int trace_selftest_test_probe3_cnt; · 2 unmodified lines
125125 static void trace_selftest_test_probe3_func(unsigned long ip,
126126 unsigned long pip,
127127 struct ftrace_ops *op,
128− struct pt_regs *pt_regs)
128+ struct ftrace_regs *fregs)
129129 {
130130 trace_selftest_test_probe3_cnt++;
131131 }
@@ -134,7 +134,7 @@ static int trace_selftest_test_global_cnt; · 2 unmodified lines
134134 static void trace_selftest_test_global_func(unsigned long ip,
135135 unsigned long pip,
136136 struct ftrace_ops *op,
137− struct pt_regs *pt_regs)
137+ struct ftrace_regs *fregs)
138138 {
139139 trace_selftest_test_global_cnt++;
140140 }
@@ -143,7 +143,7 @@ static int trace_selftest_test_dyn_cnt; · 2 unmodified lines
143143 static void trace_selftest_test_dyn_func(unsigned long ip,
144144 unsigned long pip,
145145 struct ftrace_ops *op,
146− struct pt_regs *pt_regs)
146+ struct ftrace_regs *fregs)
147147 {
148148 trace_selftest_test_dyn_cnt++;
149149 }
@@ -414,7 +414,7 @@ static int trace_selftest_recursion_cnt; · 264 unmodified lines
414414 static void trace_selftest_test_recursion_func(unsigned long ip,
415415 unsigned long pip,
416416 struct ftrace_ops *op,
417− struct pt_regs *pt_regs)
417+ struct ftrace_regs *fregs)
418418 {
419419 /*
420420 * This function is registered without the recursion safe flag.
@@ -429,7 +429,7 @@ static void trace_selftest_test_recursion_func(unsigned long ip, · 8 unmodified lines
429429 static void trace_selftest_test_recursion_safe_func(unsigned long ip,
430430 unsigned long pip,
431431 struct ftrace_ops *op,
432− struct pt_regs *pt_regs)
432+ struct ftrace_regs *fregs)
433433 {
434434 /*
435435 * We said we would provide our own recursion. By calling
@@ -548,9 +548,11 @@ static enum { · 112 unmodified lines
548548 static void trace_selftest_test_regs_func(unsigned long ip,
549549 unsigned long pip,
550550 struct ftrace_ops *op,
551− struct pt_regs *pt_regs)
551+ struct ftrace_regs *fregs)
552552 {
553− if (pt_regs)
553+ struct pt_regs *regs = ftrace_get_regs(fregs);
554+
555+ if (regs)
554556 trace_selftest_regs_stat = TRACE_SELFTEST_REGS_FOUND;
555557 else
556558 trace_selftest_regs_stat = TRACE_SELFTEST_REGS_NOT_FOUND;
kernel/trace/trace_stack.c+1−1
@@ -290,7 +290,7 @@ static void check_stack(unsigned long ip, unsigned long *stack) · 289 unmodified lines
290290
291291 static void
292292 stack_trace_call(unsigned long ip, unsigned long parent_ip,
293− struct ftrace_ops *op, struct pt_regs *pt_regs)
293+ struct ftrace_ops *op, struct ftrace_regs *fregs)
294294 {
295295 unsigned long stack;
296296