[v2,2/2] selftests/ftrace: Distinguish between hist and synthetic event checks
diff mbox series

Message ID af36c539006ef2768114b4ed38e6b054f7c7a3bd.1590693308.git.zanussi@kernel.org
State In Next
Commit bea24f766efceb5322f704015c56596ff94642f7
Headers show
Series
  • [v2,1/2] tracing: Move synthetic events to a separate file
Related show

Commit Message

Tom Zanussi May 28, 2020, 7:32 p.m. UTC
With synthetic events now a separate config item as a result of
'tracing: Move synthetic events to a separate file', tests that use
both need to explicitly check for hist trigger support rather than
relying on hist triggers to pull in synthetic events.

Add an additional hist trigger check to all the trigger tests that now
require it, otherwise they'll fail if synthetic events but not hist
triggers are enabled.

Signed-off-by: Tom Zanussi <zanussi@kernel.org>
---
 .../trigger/inter-event/trigger-field-variable-support.tc    | 5 +++++
 .../trigger/inter-event/trigger-inter-event-combined-hist.tc | 5 +++++
 .../trigger/inter-event/trigger-multi-actions-accept.tc      | 5 +++++
 .../trigger/inter-event/trigger-onmatch-action-hist.tc       | 5 +++++
 .../trigger/inter-event/trigger-onmatch-onmax-action-hist.tc | 5 +++++
 .../test.d/trigger/inter-event/trigger-onmax-action-hist.tc  | 5 +++++
 .../trigger/inter-event/trigger-snapshot-action-hist.tc      | 5 +++++
 .../test.d/trigger/inter-event/trigger-trace-action-hist.tc  | 5 +++++
 8 files changed, 40 insertions(+)

Comments

Masami Hiramatsu May 29, 2020, 2:38 p.m. UTC | #1
Hi Tom,

On Thu, 28 May 2020 14:32:38 -0500
Tom Zanussi <zanussi@kernel.org> wrote:

> With synthetic events now a separate config item as a result of
> 'tracing: Move synthetic events to a separate file', tests that use
> both need to explicitly check for hist trigger support rather than
> relying on hist triggers to pull in synthetic events.
> 
> Add an additional hist trigger check to all the trigger tests that now
> require it, otherwise they'll fail if synthetic events but not hist
> triggers are enabled.

OK, this looks good to me. And if you don't want to repeat it,
you can also put the check function into the test.d/functions.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you,

> 
> Signed-off-by: Tom Zanussi <zanussi@kernel.org>
> ---
>  .../trigger/inter-event/trigger-field-variable-support.tc    | 5 +++++
>  .../trigger/inter-event/trigger-inter-event-combined-hist.tc | 5 +++++
>  .../trigger/inter-event/trigger-multi-actions-accept.tc      | 5 +++++
>  .../trigger/inter-event/trigger-onmatch-action-hist.tc       | 5 +++++
>  .../trigger/inter-event/trigger-onmatch-onmax-action-hist.tc | 5 +++++
>  .../test.d/trigger/inter-event/trigger-onmax-action-hist.tc  | 5 +++++
>  .../trigger/inter-event/trigger-snapshot-action-hist.tc      | 5 +++++
>  .../test.d/trigger/inter-event/trigger-trace-action-hist.tc  | 5 +++++
>  8 files changed, 40 insertions(+)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc
> index 77be6e1f6e7b..e232059a8ab2 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  echo "Test field variable support"
>  
>  echo 'wakeup_latency u64 lat; pid_t pid; int prio; char comm[16]' > synthetic_events
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc
> index f3eb8aacec0e..07cfcb8157b6 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  echo "Test create synthetic event"
>  
>  echo 'waking_latency  u64 lat pid_t pid' > synthetic_events
> 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
> index d281f056f980..73e413c2ca26 100644
> --- 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
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  echo "Test multiple actions on hist trigger"
>  echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events
>  TRIGGER1=events/sched/sched_wakeup/trigger
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc
> index a708f0e7858a..ebe0ad827f9f 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  echo "Test create synthetic event"
>  
>  echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc
> index dfce6932d8be..2a2ef767249e 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  echo "Test create synthetic event"
>  
>  echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc
> index 0035995c2194..98d73bfb0296 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  echo "Test create synthetic event"
>  
>  echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
> index f546c1b66a9b..01b01b9c4e07 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
> @@ -12,6 +12,11 @@ if [ ! -f set_event ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  if [ ! -f snapshot ]; then
>      echo "snapshot is not supported"
>      exit_unsupported
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
> index 8021d60aafec..c3baa486aeb4 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
> @@ -17,6 +17,11 @@ if [ ! -f synthetic_events ]; then
>      exit_unsupported
>  fi
>  
> +if [ ! -f events/sched/sched_process_fork/hist ]; then
> +    echo "hist trigger is not supported"
> +    exit_unsupported
> +fi
> +
>  grep -q "trace(<synthetic_event>" README || exit_unsupported # version issue
>  
>  echo "Test create synthetic event"
> -- 
> 2.17.1
>
Steven Rostedt May 29, 2020, 2:53 p.m. UTC | #2
On Fri, 29 May 2020 23:38:45 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Hi Tom,
> 
> On Thu, 28 May 2020 14:32:38 -0500
> Tom Zanussi <zanussi@kernel.org> wrote:
> 
> > With synthetic events now a separate config item as a result of
> > 'tracing: Move synthetic events to a separate file', tests that use
> > both need to explicitly check for hist trigger support rather than
> > relying on hist triggers to pull in synthetic events.
> > 
> > Add an additional hist trigger check to all the trigger tests that now
> > require it, otherwise they'll fail if synthetic events but not hist
> > triggers are enabled.  
> 
> OK, this looks good to me. And if you don't want to repeat it,
> you can also put the check function into the test.d/functions.
> 
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks Tom and Masami. I'm running tests on these now.

-- Steve

Patch
diff mbox series

diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc
index 77be6e1f6e7b..e232059a8ab2 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 echo "Test field variable support"
 
 echo 'wakeup_latency u64 lat; pid_t pid; int prio; char comm[16]' > synthetic_events
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc
index f3eb8aacec0e..07cfcb8157b6 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 echo "Test create synthetic event"
 
 echo 'waking_latency  u64 lat pid_t pid' > synthetic_events
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
index d281f056f980..73e413c2ca26 100644
--- 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
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 echo "Test multiple actions on hist trigger"
 echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events
 TRIGGER1=events/sched/sched_wakeup/trigger
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc
index a708f0e7858a..ebe0ad827f9f 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 echo "Test create synthetic event"
 
 echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc
index dfce6932d8be..2a2ef767249e 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 echo "Test create synthetic event"
 
 echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc
index 0035995c2194..98d73bfb0296 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 echo "Test create synthetic event"
 
 echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
index f546c1b66a9b..01b01b9c4e07 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
@@ -12,6 +12,11 @@  if [ ! -f set_event ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 if [ ! -f snapshot ]; then
     echo "snapshot is not supported"
     exit_unsupported
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
index 8021d60aafec..c3baa486aeb4 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
@@ -17,6 +17,11 @@  if [ ! -f synthetic_events ]; then
     exit_unsupported
 fi
 
+if [ ! -f events/sched/sched_process_fork/hist ]; then
+    echo "hist trigger is not supported"
+    exit_unsupported
+fi
+
 grep -q "trace(<synthetic_event>" README || exit_unsupported # version issue
 
 echo "Test create synthetic event"