linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ftracetest improvement and new testcase
@ 2014-10-20 10:52 Heiko Carstens
  2014-10-20 10:52 ` [PATCH 1/2] ftracetest: add kprobes on ftrace testcase Heiko Carstens
  2014-10-20 10:52 ` [PATCH 2/2] ftracetest: sort testcases Heiko Carstens
  0 siblings, 2 replies; 8+ messages in thread
From: Heiko Carstens @ 2014-10-20 10:52 UTC (permalink / raw)
  To: Masami Hiramatsu, Ingo Molnar, Steven Rostedt
  Cc: linux-kernel, Heiko Carstens

These two patches are a result from the s390 vs kprobes on ftrace
discussion, however they can be handled completely independent.

One patch simply sorts the ftrace testcases, while the second adds
a new testcase with a couple of sanity test with respect to the
coexistence of kprobes and ftrace.

Heiko Carstens (2):
  ftracetest: add kprobes on ftrace testcase
  ftracetest: sort testcases

 tools/testing/selftests/ftrace/ftracetest          |  2 +-
 .../ftrace/test.d/kprobe/kprobe_ftrace.tc          | 55 ++++++++++++++++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc

-- 
1.8.5.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ftracetest: add kprobes on ftrace testcase
  2014-10-20 10:52 [PATCH 0/2] ftracetest improvement and new testcase Heiko Carstens
@ 2014-10-20 10:52 ` Heiko Carstens
  2014-10-21  9:21   ` Masami Hiramatsu
  2014-10-20 10:52 ` [PATCH 2/2] ftracetest: sort testcases Heiko Carstens
  1 sibling, 1 reply; 8+ messages in thread
From: Heiko Carstens @ 2014-10-20 10:52 UTC (permalink / raw)
  To: Masami Hiramatsu, Ingo Molnar, Steven Rostedt
  Cc: linux-kernel, Heiko Carstens

Add a kprobes on ftrace testcase. The testcase verifies that
- enabling and disabling function tracing works on a function which
  already contains a dynamic kprobe
- adding and removing a dynamic kprobe works on a function which is
  already enabled for function tracing

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 .../ftrace/test.d/kprobe/kprobe_ftrace.tc          | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc

diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
new file mode 100644
index 000000000000..ab41d2b29841
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
@@ -0,0 +1,55 @@
+#!/bin/sh
+# description: Kprobe dynamic event with function tracer
+
+[ -f kprobe_events ] || exit_unsupported # this is configurable
+grep function available_tracers || exit_unsupported # this is configurable
+
+# prepare
+echo nop > current_tracer
+echo do_fork > set_ftrace_filter
+echo 0 > events/enable
+echo > kprobe_events
+echo 'p:testprobe do_fork' > kprobe_events
+
+# kprobe on / ftrace off
+echo 1 > events/kprobes/testprobe/enable
+echo > trace
+( echo "forked")
+grep testprobe trace
+! grep 'do_fork <-' trace
+
+# kprobe on / ftrace on
+echo function > current_tracer
+echo > trace
+( echo "forked")
+grep testprobe trace
+grep 'do_fork <-' trace
+
+# kprobe off / ftrace on
+echo 0 > events/kprobes/testprobe/enable
+echo > trace
+( echo "forked")
+! grep testprobe trace
+grep 'do_fork <-' trace
+
+# kprobe on / ftrace on
+echo 1 > events/kprobes/testprobe/enable
+echo function > current_tracer
+echo > trace
+( echo "forked")
+grep testprobe trace
+grep 'do_fork <-' trace
+
+# kprobe on / ftrace off
+echo nop > current_tracer
+echo > trace
+( echo "forked")
+grep testprobe trace
+! grep 'do_fork <-' trace
+
+# cleanup
+echo nop > current_tracer
+echo > set_ftrace_filter
+echo 0 > events/kprobes/testprobe/enable
+echo > kprobe_events
+echo > trace
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ftracetest: sort testcases
  2014-10-20 10:52 [PATCH 0/2] ftracetest improvement and new testcase Heiko Carstens
  2014-10-20 10:52 ` [PATCH 1/2] ftracetest: add kprobes on ftrace testcase Heiko Carstens
@ 2014-10-20 10:52 ` Heiko Carstens
  1 sibling, 0 replies; 8+ messages in thread
From: Heiko Carstens @ 2014-10-20 10:52 UTC (permalink / raw)
  To: Masami Hiramatsu, Ingo Molnar, Steven Rostedt
  Cc: linux-kernel, Heiko Carstens

Make sure the order of the executed testcases is always the same.

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 tools/testing/selftests/ftrace/ftracetest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index a8f81c782856..2007a2cde56f 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -37,7 +37,7 @@ abspath() {
 }
 
 find_testcases() { #directory
-  echo `find $1 -name \*.tc`
+  echo `find $1 -name \*.tc | sort`
 }
 
 parse_opts() { # opts
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ftracetest: add kprobes on ftrace testcase
  2014-10-20 10:52 ` [PATCH 1/2] ftracetest: add kprobes on ftrace testcase Heiko Carstens
@ 2014-10-21  9:21   ` Masami Hiramatsu
  2014-10-21 11:59     ` Heiko Carstens
  0 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2014-10-21  9:21 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Ingo Molnar, Steven Rostedt, linux-kernel

(2014/10/20 19:52), Heiko Carstens wrote:
> Add a kprobes on ftrace testcase. The testcase verifies that
> - enabling and disabling function tracing works on a function which
>   already contains a dynamic kprobe
> - adding and removing a dynamic kprobe works on a function which is
>   already enabled for function tracing
> 

Looks good to me.

> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thanks!

> ---
>  .../ftrace/test.d/kprobe/kprobe_ftrace.tc          | 55 ++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
> new file mode 100644
> index 000000000000..ab41d2b29841
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
> @@ -0,0 +1,55 @@
> +#!/bin/sh
> +# description: Kprobe dynamic event with function tracer
> +
> +[ -f kprobe_events ] || exit_unsupported # this is configurable
> +grep function available_tracers || exit_unsupported # this is configurable
> +
> +# prepare
> +echo nop > current_tracer
> +echo do_fork > set_ftrace_filter
> +echo 0 > events/enable
> +echo > kprobe_events
> +echo 'p:testprobe do_fork' > kprobe_events
> +
> +# kprobe on / ftrace off
> +echo 1 > events/kprobes/testprobe/enable
> +echo > trace
> +( echo "forked")
> +grep testprobe trace
> +! grep 'do_fork <-' trace

I like this technique :)

> +
> +# kprobe on / ftrace on
> +echo function > current_tracer
> +echo > trace
> +( echo "forked")
> +grep testprobe trace
> +grep 'do_fork <-' trace
> +
> +# kprobe off / ftrace on
> +echo 0 > events/kprobes/testprobe/enable
> +echo > trace
> +( echo "forked")
> +! grep testprobe trace
> +grep 'do_fork <-' trace
> +
> +# kprobe on / ftrace on
> +echo 1 > events/kprobes/testprobe/enable
> +echo function > current_tracer
> +echo > trace
> +( echo "forked")
> +grep testprobe trace
> +grep 'do_fork <-' trace
> +
> +# kprobe on / ftrace off
> +echo nop > current_tracer
> +echo > trace
> +( echo "forked")
> +grep testprobe trace
> +! grep 'do_fork <-' trace
> +
> +# cleanup
> +echo nop > current_tracer
> +echo > set_ftrace_filter
> +echo 0 > events/kprobes/testprobe/enable
> +echo > kprobe_events
> +echo > trace
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ftracetest: add kprobes on ftrace testcase
  2014-10-21  9:21   ` Masami Hiramatsu
@ 2014-10-21 11:59     ` Heiko Carstens
  2014-10-21 12:10       ` Masami Hiramatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Carstens @ 2014-10-21 11:59 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Ingo Molnar, Steven Rostedt, linux-kernel

On Tue, Oct 21, 2014 at 06:21:05PM +0900, Masami Hiramatsu wrote:
> (2014/10/20 19:52), Heiko Carstens wrote:
> > Add a kprobes on ftrace testcase. The testcase verifies that
> > - enabling and disabling function tracing works on a function which
> >   already contains a dynamic kprobe
> > - adding and removing a dynamic kprobe works on a function which is
> >   already enabled for function tracing
> > 
> 
> Looks good to me.
> 
> > Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Hi Masami,

thanks! How should these two patches go upstream?

Thanks,
Heiko


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [PATCH 1/2] ftracetest: add kprobes on ftrace testcase
  2014-10-21 11:59     ` Heiko Carstens
@ 2014-10-21 12:10       ` Masami Hiramatsu
  2014-10-22 15:04         ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2014-10-21 12:10 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Ingo Molnar, Steven Rostedt, linux-kernel

(2014/10/21 20:59), Heiko Carstens wrote:
> On Tue, Oct 21, 2014 at 06:21:05PM +0900, Masami Hiramatsu wrote:
>> (2014/10/20 19:52), Heiko Carstens wrote:
>>> Add a kprobes on ftrace testcase. The testcase verifies that
>>> - enabling and disabling function tracing works on a function which
>>>   already contains a dynamic kprobe
>>> - adding and removing a dynamic kprobe works on a function which is
>>>   already enabled for function tracing
>>>
>>
>> Looks good to me.
>>
>>> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
>>
>> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> 
> Hi Masami,
> 
> thanks! How should these two patches go upstream?

Steven, could you pick this series to your tree?
I think it is better to manage ftracetest testcases in one tree.

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ftracetest: add kprobes on ftrace testcase
  2014-10-21 12:10       ` Masami Hiramatsu
@ 2014-10-22 15:04         ` Steven Rostedt
  2014-10-23  1:04           ` Masami Hiramatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2014-10-22 15:04 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Heiko Carstens, Ingo Molnar, linux-kernel

On Tue, 21 Oct 2014 21:10:00 +0900
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:


> Steven, could you pick this series to your tree?
> I think it is better to manage ftracetest testcases in one tree.

I can pick these up. Is it OK if it goes into the 3.19 queue? Or is
there some urgent need to get them into 3.18? As they are ftracetests,
it's not that big of a deal to get them in early, as it is highly
unlikely to break the kernel itself.

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ftracetest: add kprobes on ftrace testcase
  2014-10-22 15:04         ` Steven Rostedt
@ 2014-10-23  1:04           ` Masami Hiramatsu
  0 siblings, 0 replies; 8+ messages in thread
From: Masami Hiramatsu @ 2014-10-23  1:04 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Heiko Carstens, Ingo Molnar, linux-kernel

(2014/10/23 0:04), Steven Rostedt wrote:
> On Tue, 21 Oct 2014 21:10:00 +0900
> Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:
> 
> 
>> Steven, could you pick this series to your tree?
>> I think it is better to manage ftracetest testcases in one tree.
> 
> I can pick these up. Is it OK if it goes into the 3.19 queue? Or is
> there some urgent need to get them into 3.18? As they are ftracetests,
> it's not that big of a deal to get them in early, as it is highly
> unlikely to break the kernel itself.

It seems we have no urgent need, I think 3.19 queue is OK. :)

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-10-23  1:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20 10:52 [PATCH 0/2] ftracetest improvement and new testcase Heiko Carstens
2014-10-20 10:52 ` [PATCH 1/2] ftracetest: add kprobes on ftrace testcase Heiko Carstens
2014-10-21  9:21   ` Masami Hiramatsu
2014-10-21 11:59     ` Heiko Carstens
2014-10-21 12:10       ` Masami Hiramatsu
2014-10-22 15:04         ` Steven Rostedt
2014-10-23  1:04           ` Masami Hiramatsu
2014-10-20 10:52 ` [PATCH 2/2] ftracetest: sort testcases Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).