Re: [RFC][PATCH 0/3] kprobes/ftrace/x86: Function graph trace jprobes

From: Steven Rostedt
Date: Thu Jan 29 2015 - 10:56:33 EST


On Thu, 29 Jan 2015 15:04:44 +0900
Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx> wrote:

> Hmm, could you make this more generic? Maybe we can directly call
> ftrace_return_to_handler() from longjmp_break_handler().

I tried that, but because the longjump handlers can also be traced (and
I still want them to be :-) It makes things even more complicated to
get the stacks right. It's best to deal with the stack when you can.

> Actually, current implementation seems just skipping one return
> address, however, there may be possible to call jprobe_return() in
> the nested functions, like below;
>
> void test_exit(int flag)
> {
> if (!flag)
> jprobe_return();
> }
> int jdo_fork(...)
> {
> ...
> test_exit(something_to_test);
> ...
> jprobe_return();
> return 0;
> }
>
> I've tested similar code on this series and it crashed kernel.
> (I also checked that the above example can work safely without graph tracer)
>

Ah yes, I missed this. I have a way to solve this but it's not going to
get done before the merge window. Thanks for the test case. I'll use
this and more complicated ones for future changes.

Thanks!

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/