ftrace/jprobes/s390: Fix conflict between jprobes and function graph tracing
PATCH 1/1 ftrace/jprobes/s390: Fix conflict between jprobes and function graph tracing
This fixes the same issue Steven already fixed for x86 in following commit:
237d28db036e ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing
It fixes the crash, that happens when function graph tracing and jprobes are used simultaneously. Please refer to above commit for details.
--- arch/s390/kernel/kprobes.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/s390/kernel/kprobes.c +12 -0
@@ -690,6 +690,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) stack = (unsigned long ) regs->gprs[15 ];memcpy (kcb->jprobes_stack, (void *) stack,MIN_STACK_SIZE (stack)); + +/* +* jprobes use jprobe_return() which skips the normal return +* path of the function, and this messes up the accounting of the +* function graph tracer to get messed up. +* +* Pause function graph tracing while performing the jprobe function. +*/ +pause_graph_tracing ();return 1 ; }NOKPROBE_SYMBOL (setjmp_pre_handler);
@@ -705,6 +714,9 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)struct kprobe_ctlblk *kcb =get_kprobe_ctlblk ();unsigned long stack; +/* It's OK to start function graph tracing again */ +unpause_graph_tracing (); + stack = (unsigned long ) kcb->jprobe_saved_regs.gprs[15 ];/* Put the regs back */
Signature · 1 line
2.4.11
Quoted 8 lines · On Mon, 18 Jul 2016 15:26:41 +0200 Jiri Olsa <[email protected]> wrote:
This fixes the same issue Steven already fixed for x86 in following commit:
237d28db036eftrace/jprobes/x86: Fix conflict between jprobes and function graph tracingIt fixes the crash, that happens when function graph tracing and jprobes are used simultaneously. Please refer to above commit for details.
I'm guessing that this should go in via the s390 tree.
-- Steve
Quoted 36 lines
Signed-off-by Jiri Olsa <[email protected]>--- arch/s390/kernel/kprobes.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/s390/kernel/kprobes.c +12
-0@@ -690,6 +690,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) stack = (unsigned long ) regs->gprs[15 ];memcpy (kcb->jprobes_stack, (void *) stack,MIN_STACK_SIZE (stack)); + +/* +* jprobes use jprobe_return() which skips the normal return +* path of the function, and this messes up the accounting of the +* function graph tracer to get messed up. +* +* Pause function graph tracing while performing the jprobe function. +*/ +pause_graph_tracing ();return 1 ; }NOKPROBE_SYMBOL (setjmp_pre_handler);@@ -705,6 +714,9 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)struct kprobe_ctlblk *kcb =get_kprobe_ctlblk ();unsigned long stack; +/* It's OK to start function graph tracing again */ +unpause_graph_tracing (); + stack = (unsigned long ) kcb->jprobe_saved_regs.gprs[15 ];/* Put the regs back */
Quoted 6 lines · Steven Rostedt
Quoted 3 lines · On Mon, 18 Jul 2016 15:26:41 +0200 Jiri Olsa <[email protected]> wrote:
This fixes the same issue Steven already fixed for x86 in following commit:
Quoted 7 lines
Quoted 5 lines
237d28db036eftrace/jprobes/x86: Fix conflict between jprobes and function graph tracingIt fixes the crash, that happens when function graph tracing and jprobes are used simultaneously. Please refer to above commit for details.
I'm guessing that this should go in via the s390 tree.
oops, I forgot to CC s390 mailing list.. CC-ing now
I can repost if needed
thanks,
jirka
Quoted 42 lines
Acked-by Steven Rostedt <[email protected]>-- Steve
Quoted 36 lines
Signed-off-by Jiri Olsa <[email protected]>--- arch/s390/kernel/kprobes.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/s390/kernel/kprobes.c +12
-0@@ -690,6 +690,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) stack = (unsigned long ) regs->gprs[15 ];memcpy (kcb->jprobes_stack, (void *) stack,MIN_STACK_SIZE (stack)); + +/* +* jprobes use jprobe_return() which skips the normal return +* path of the function, and this messes up the accounting of the +* function graph tracer to get messed up. +* +* Pause function graph tracing while performing the jprobe function. +*/ +pause_graph_tracing ();return 1 ; }NOKPROBE_SYMBOL (setjmp_pre_handler);@@ -705,6 +714,9 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)struct kprobe_ctlblk *kcb =get_kprobe_ctlblk ();unsigned long stack; +/* It's OK to start function graph tracing again */ +unpause_graph_tracing (); + stack = (unsigned long ) kcb->jprobe_saved_regs.gprs[15 ];/* Put the regs back */
Martin Schwidefsky
AppliedQuoted 13 lines · On Sun, 31 Jul 2016 14:21:14 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 12 lines · Steven Rostedt
Quoted 8 lines · On Mon, 18 Jul 2016 15:26:41 +0200 Jiri Olsa <[email protected]> wrote:
This fixes the same issue Steven already fixed for x86 in following commit:
237d28db036eftrace/jprobes/x86: Fix conflict between jprobes and function graph tracingIt fixes the crash, that happens when function graph tracing and jprobes are used simultaneously. Please refer to above commit for details.
Quoted 5 lines
Quoted 1 line
I'm guessing that this should go in via the s390 tree.
oops, I forgot to CC s390 mailing list.. CC-ing now
I can repost if needed
This is not necessary. I have seen your original patch and could test it now. As expected it crashes without the patch and works find with your patch.
Applied to linux-s390. Thanks.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.