2012-08-24 07:16:08

by Fengguang Wu

[permalink] [raw]
Subject: BUG: Kprobe smoke test: 2 out of 6 tests failed

Hi Steven,

The following test fails are mostly due to this commit, or one of the
last 4 commits in

tree: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git tip/perf/core
head: d57c5d51a30152f3175d2344cb6395f08bf8ee0c
commit: d57c5d51a30152f3175d2344cb6395f08bf8ee0c [100/100] ftrace/x86: Add support for -mfentry to x86_64

[ 9.084881] Kprobe smoke test failed: register_jprobe returned -22
[ 9.086786] Kprobe smoke test failed: register_jprobes returned -22
[ 9.121281] BUG: Kprobe smoke test: 2 out of 6 tests failed
[ 9.171132] Testing tracer function: PASSED
[ 9.408938] Testing dynamic ftrace: PASSED

Thanks,
Fengguang


Attachments:
(No filename) (665.00 B)
dmesg-kvm-waimea-20320-2012-08-24-06-33-30-3.6.0-rc1-00241-gd57c5d5-709 (63.27 kB)
config-3.6.0-rc1-00241-gd57c5d5 (56.04 kB)
Download all attachments

2012-08-24 13:41:43

by Steven Rostedt

[permalink] [raw]
Subject: Re: BUG: Kprobe smoke test: 2 out of 6 tests failed

Hi Fengguang,

Thanks for the report, I'll have a look at it today.

-- Steve


On Fri, 2012-08-24 at 15:15 +0800, Fengguang Wu wrote:
> Hi Steven,
>
> The following test fails are mostly due to this commit, or one of the
> last 4 commits in
>
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git tip/perf/core
> head: d57c5d51a30152f3175d2344cb6395f08bf8ee0c
> commit: d57c5d51a30152f3175d2344cb6395f08bf8ee0c [100/100] ftrace/x86: Add support for -mfentry to x86_64
>
> [ 9.084881] Kprobe smoke test failed: register_jprobe returned -22
> [ 9.086786] Kprobe smoke test failed: register_jprobes returned -22
> [ 9.121281] BUG: Kprobe smoke test: 2 out of 6 tests failed
> [ 9.171132] Testing tracer function: PASSED
> [ 9.408938] Testing dynamic ftrace: PASSED
>
> Thanks,
> Fengguang

2012-08-25 01:00:44

by Steven Rostedt

[permalink] [raw]
Subject: Re: BUG: Kprobe smoke test: 2 out of 6 tests failed

On Fri, 2012-08-24 at 09:41 -0400, Steven Rostedt wrote:

> On Fri, 2012-08-24 at 15:15 +0800, Fengguang Wu wrote:
> > Hi Steven,
> >
> > The following test fails are mostly due to this commit, or one of the
> > last 4 commits in
> >
> > tree: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git tip/perf/core
> > head: d57c5d51a30152f3175d2344cb6395f08bf8ee0c
> > commit: d57c5d51a30152f3175d2344cb6395f08bf8ee0c [100/100] ftrace/x86: Add support for -mfentry to x86_64
> >
> > [ 9.084881] Kprobe smoke test failed: register_jprobe returned -22
> > [ 9.086786] Kprobe smoke test failed: register_jprobes returned -22

Masami,

Seems that when we use fentry, we break jprobes. I thought the patches
that we added would just move the call to the next op, not fail totally?

Are jprobes deprecated?

-- Steve

> > [ 9.121281] BUG: Kprobe smoke test: 2 out of 6 tests failed
> > [ 9.171132] Testing tracer function: PASSED
> > [ 9.408938] Testing dynamic ftrace: PASSED
> >
> > Thanks,
> > Fengguang
>

Subject: Re: BUG: Kprobe smoke test: 2 out of 6 tests failed

Hi Steven and Fengguang,

(2012/08/25 10:00), Steven Rostedt wrote:
> On Fri, 2012-08-24 at 09:41 -0400, Steven Rostedt wrote:
>
>> On Fri, 2012-08-24 at 15:15 +0800, Fengguang Wu wrote:
>>> Hi Steven,
>>>
>>> The following test fails are mostly due to this commit, or one of the
>>> last 4 commits in
>>>
>>> tree: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git tip/perf/core
>>> head: d57c5d51a30152f3175d2344cb6395f08bf8ee0c
>>> commit: d57c5d51a30152f3175d2344cb6395f08bf8ee0c [100/100] ftrace/x86: Add support for -mfentry to x86_64
>>>
>>> [ 9.084881] Kprobe smoke test failed: register_jprobe returned -22
>>> [ 9.086786] Kprobe smoke test failed: register_jprobes returned -22
>
> Masami,
>
> Seems that when we use fentry, we break jprobes. I thought the patches
> that we added would just move the call to the next op, not fail totally?

Ah! yes, it would be kprobe-side problem.

Since ftrace_regs_call allows handlers to set regs->ip, it is not necessarily
to move jprobe onto the next instruction (even it will be the simplest one).
Instead, I think we can allow it on ftrace entries. Of course, ftrace side
change is also needed, e.g. sorting handlers for moving such ip-modifying
handler to the last.

Thank you,


--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: [email protected]