All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests: tracing: Update inter-event testcases
@ 2018-04-05  9:28 Masami Hiramatsu
  2018-04-05  9:28 ` [PATCH 1/2] selftests: ftrace: Fix trigger extended error testcase Masami Hiramatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2018-04-05  9:28 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Tom Zanussi, tglx, namhyung, vedang.patel,
	bigeasy, joel.opensrc, joelaf, mathieu.desnoyers, baohong.liu,
	rajvi.jingar, julia, fengguang.wu, linux-kernel, linux-rt-users

Hi,

I've fixed a testcase for inter-event extended error
and added a testcase for multiple actions on trigger,
which is based on what Tom shown in his mail.

This series can be applied on Steven's tracing repo.

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
ftrace/core

Tom, could you review it?

Thanks,

---

Masami Hiramatsu (2):
      selftests: ftrace: Fix trigger extended error testcase
      selftests: ftrace: Add a testcase for multiple actions on trigger


 .../inter-event/trigger-extended-error-support.tc  |    2 -
 .../inter-event/trigger-multi-actions-accept.tc    |   44 ++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

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

* [PATCH 1/2] selftests: ftrace: Fix trigger extended error testcase
  2018-04-05  9:28 [PATCH 0/2] selftests: tracing: Update inter-event testcases Masami Hiramatsu
@ 2018-04-05  9:28 ` Masami Hiramatsu
  2018-04-05  9:29 ` [PATCH 2/2] selftests: ftrace: Add a testcase for multiple actions on trigger Masami Hiramatsu
  2018-04-24 19:22 ` [PATCH 0/2] selftests: tracing: Update inter-event testcases Steven Rostedt
  2 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2018-04-05  9:28 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Tom Zanussi, tglx, namhyung, vedang.patel,
	bigeasy, joel.opensrc, joelaf, mathieu.desnoyers, baohong.liu,
	rajvi.jingar, julia, fengguang.wu, linux-kernel, linux-rt-users

Previous testcase redirects echo-out into /dev/null
using "&>" as below

echo "trigger-command" >> trigger &> /dev/null

But this means redirecting both stdout and stderr into
/dev/null because it is same as below

echo "trigger-command" >> trigger > /dev/null 2>&1

So ">> trigger" redirects stdout to trigger file, but
next "> /dev/null" redirects stdout to /dev/null again
and the last "2>/&1" redirects stderr to stdout (/dev/null)

This fixes it by "2> /dev/null". And also, since it
must fail, add "!" to echo command.

Fixes: f06eec4d0f2c ("selftests: ftrace: Add inter-event hist triggers testcases")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../inter-event/trigger-extended-error-support.tc  |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc
index 786dce7e48be..2aabab363cfb 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc
@@ -29,7 +29,7 @@ do_reset
 
 echo "Test extended error support"
 echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
-echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger &>/dev/null
+! echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger 2> /dev/null
 if ! grep -q "ERROR:" events/sched/sched_wakeup/hist; then
     fail "Failed to generate extended error in histogram"
 fi

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

* [PATCH 2/2] selftests: ftrace: Add a testcase for multiple actions on trigger
  2018-04-05  9:28 [PATCH 0/2] selftests: tracing: Update inter-event testcases Masami Hiramatsu
  2018-04-05  9:28 ` [PATCH 1/2] selftests: ftrace: Fix trigger extended error testcase Masami Hiramatsu
@ 2018-04-05  9:29 ` Masami Hiramatsu
  2018-04-24 19:22 ` [PATCH 0/2] selftests: tracing: Update inter-event testcases Steven Rostedt
  2 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2018-04-05  9:29 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Tom Zanussi, tglx, namhyung, vedang.patel,
	bigeasy, joel.opensrc, joelaf, mathieu.desnoyers, baohong.liu,
	rajvi.jingar, julia, fengguang.wu, linux-kernel, linux-rt-users

Add a testcase for multiple actions with different
parameters on an event trigger, which has been fixed
by commit 192c283e93bd ("tracing: Add action comparisons
 when testing matching hist triggers").

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../inter-event/trigger-multi-actions-accept.tc    |   44 ++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc

diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc
new file mode 100644
index 000000000000..c193dce611a2
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc
@@ -0,0 +1,44 @@
+#!/bin/sh
+# description: event trigger - test multiple actions on hist trigger
+
+
+do_reset() {
+    reset_trigger
+    echo > set_event
+    clear_trace
+}
+
+fail() { #msg
+    do_reset
+    echo $1
+    exit_fail
+}
+
+if [ ! -f set_event ]; then
+    echo "event tracing is not supported"
+    exit_unsupported
+fi
+
+if [ ! -f synthetic_events ]; then
+    echo "synthetic event is not supported"
+    exit_unsupported
+fi
+
+clear_synthetic_events
+reset_tracer
+do_reset
+
+echo "Test multiple actions on hist trigger"
+echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events
+TRIGGER1=events/sched/sched_wakeup/trigger
+TRIGGER2=events/sched/sched_switch/trigger
+
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' > $TRIGGER1
+echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 if next_comm=="cyclictest"' >> $TRIGGER2
+echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> $TRIGGER2
+echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> $TRIGGER2
+echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> $TRIGGER2
+
+do_reset
+
+exit 0

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

* Re: [PATCH 0/2] selftests: tracing: Update inter-event testcases
  2018-04-05  9:28 [PATCH 0/2] selftests: tracing: Update inter-event testcases Masami Hiramatsu
  2018-04-05  9:28 ` [PATCH 1/2] selftests: ftrace: Fix trigger extended error testcase Masami Hiramatsu
  2018-04-05  9:29 ` [PATCH 2/2] selftests: ftrace: Add a testcase for multiple actions on trigger Masami Hiramatsu
@ 2018-04-24 19:22 ` Steven Rostedt
  2018-04-24 22:24   ` Tom Zanussi
  2 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2018-04-24 19:22 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Tom Zanussi, tglx, namhyung, vedang.patel, bigeasy, joel.opensrc,
	joelaf, mathieu.desnoyers, baohong.liu, rajvi.jingar, julia,
	fengguang.wu, linux-kernel, linux-rt-users

On Thu,  5 Apr 2018 18:28:11 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Hi,
> 
> I've fixed a testcase for inter-event extended error
> and added a testcase for multiple actions on trigger,
> which is based on what Tom shown in his mail.
> 
> This series can be applied on Steven's tracing repo.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
> ftrace/core
> 
> Tom, could you review it?

Even without Tom's review. I took both patches.

Thanks Masami!

-- Steve

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

* Re: [PATCH 0/2] selftests: tracing: Update inter-event testcases
  2018-04-24 19:22 ` [PATCH 0/2] selftests: tracing: Update inter-event testcases Steven Rostedt
@ 2018-04-24 22:24   ` Tom Zanussi
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Zanussi @ 2018-04-24 22:24 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, tglx, namhyung, vedang.patel, bigeasy,
	joel.opensrc, joelaf, mathieu.desnoyers, baohong.liu,
	rajvi.jingar, julia, fengguang.wu, linux-kernel, linux-rt-users

On Tue, 2018-04-24 at 15:22 -0400, Steven Rostedt wrote:
> On Thu,  5 Apr 2018 18:28:11 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > Hi,
> > 
> > I've fixed a testcase for inter-event extended error
> > and added a testcase for multiple actions on trigger,
> > which is based on what Tom shown in his mail.
> > 
> > This series can be applied on Steven's tracing repo.
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
> > ftrace/core
> > 
> > Tom, could you review it?
> 
> Even without Tom's review. I took both patches.
> 

Oops, sorry, completely forgot about these.. 

For both patches:

Reviewed-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com>

Thanks,

Tom

> Thanks Masami!
> 
> -- Steve

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

end of thread, other threads:[~2018-04-24 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05  9:28 [PATCH 0/2] selftests: tracing: Update inter-event testcases Masami Hiramatsu
2018-04-05  9:28 ` [PATCH 1/2] selftests: ftrace: Fix trigger extended error testcase Masami Hiramatsu
2018-04-05  9:29 ` [PATCH 2/2] selftests: ftrace: Add a testcase for multiple actions on trigger Masami Hiramatsu
2018-04-24 19:22 ` [PATCH 0/2] selftests: tracing: Update inter-event testcases Steven Rostedt
2018-04-24 22:24   ` Tom Zanussi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.