From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
Clark Williams <williams@redhat.com>,
Karim Yaghmour <karim.yaghmour@opersys.com>,
Brendan Gregg <bgregg@netflix.com>,
Joel Fernandes <joel@joelfernandes.org>,
Namhyung Kim <namhyung@kernel.org>,
Yann Ylavic <ylavic.dev@gmail.com>,
linux-rt-users@vger.kernel.org, Shuah Khan <shuahkhan@gmail.com>
Subject: Re: [PATCH v3 13/14] tracing/selftest: Add selftests to test trace_marker histogram triggers
Date: Thu, 31 May 2018 08:09:41 +0900 [thread overview]
Message-ID: <20180531080941.fd02980b7fd9aac015dbfd73@kernel.org> (raw)
In-Reply-To: <20180528212055.21e24c52@vmware.local.home>
On Mon, 28 May 2018 21:20:55 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 28 May 2018 01:32:58 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > Hi Steve,
> >
> > On Fri, 25 May 2018 17:13:53 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > On Fri, 25 May 2018 17:12:29 -0400
> > > Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > >
> > > > #!/bin/sh
> > >
> > > Hmm, I think I need to make this #!/bin/bash
> > >
> > > > test_trace() {
> > > > file=$1
> > > > x=$2
> > > >
> > > > cat $file | while read line; do
> > > > if [ "$line" != "${line/\#/}" ]; then
> > > > continue
> > > > fi
> > > > echo "testing $line for >$x<"
> > > > if [ "$line" == "${line/>$x</}" ]; then
> > >
> > > The ${line/>$x</} is unique to bash I believe.
> >
> > Hmm, could you try to use only posix-shell based test ?
> > Since I would like to keep this can run on small
> > environment, like busybox, etc.
> >
>
> Like something like this?
This looks good to me. :)
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Thanks,
>
> -- Steve
>
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
> index c6c50a2..3a3c33d 100644
> --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc
> @@ -41,11 +41,13 @@ test_trace() {
> x=$2
>
> cat $file | while read line; do
> - if [ "$line" != "${line/\#/}" ]; then
> + comment=`echo $line | sed -e 's/^#//'`
> + if [ "$line" != "$comment" ]; then
> continue
> fi
> echo "testing $line for >$x<"
> - if [ "$line" == "${line/>$x</}" ]; then
> + match=`echo $line | sed -e "s/>$x<//"`
> + if [ "$line" == "$match" ]; then
> fail "$line does not have >$x< in it"
> fi
> let x=$x+2
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2018-05-30 23:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 15:00 [PATCH v3 00/14] tracing: Add triggers to trace_marker writes Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 01/14] tracing: Do not reference event data in post call triggers Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 02/14] tracing: Add __find_event_file() to find event files without restrictions Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 03/14] tracing: Have event_trace_init() called by trace_init_tracefs() Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 04/14] tracing: Add brackets in ftrace event dynamic arrays Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 05/14] tracing: Do not show filter file for ftrace internal events Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 06/14] tracing: Add trigger file for trace_markers tracefs/ftrace/print Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 07/14] tracing: Have zero size length in filter logic be full string Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 08/14] tracing: Prevent further users of zero size static arrays in trace events Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 09/14] tracing: Allow histogram triggers to access ftrace internal events Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 10/14] tracing: Document trace_marker triggers Steven Rostedt
2018-05-16 15:42 ` [PATCH v3.5 " Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 11/14] ftrace/selftest: Have the reset_trigger code be a bit more careful Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 12/14] ftrace/selftest: Fix reset_trigger() to handle triggers with filters Steven Rostedt
2018-05-16 15:00 ` [PATCH v3 13/14] tracing/selftest: Add selftests to test trace_marker histogram triggers Steven Rostedt
2018-05-23 14:13 ` Masami Hiramatsu
2018-05-25 18:07 ` Steven Rostedt
2018-05-25 21:12 ` Steven Rostedt
2018-05-25 21:13 ` Steven Rostedt
2018-05-27 16:32 ` Masami Hiramatsu
2018-05-29 1:20 ` Steven Rostedt
2018-05-30 23:09 ` Masami Hiramatsu [this message]
2018-05-16 15:00 ` [PATCH v3 14/14] tracing/selftest: Add test to test hist trigger between kernel event and trace_marker Steven Rostedt
2018-05-23 14:15 ` Masami Hiramatsu
2018-05-25 18:15 ` Steven Rostedt
2018-05-25 18:19 ` Steven Rostedt
2018-05-27 16:33 ` Masami Hiramatsu
2018-05-23 5:41 ` [PATCH v3 00/14] tracing: Add triggers to trace_marker writes Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180531080941.fd02980b7fd9aac015dbfd73@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bgregg@netflix.com \
--cc=joel@joelfernandes.org \
--cc=karim.yaghmour@opersys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuahkhan@gmail.com \
--cc=tglx@linutronix.de \
--cc=tom.zanussi@linux.intel.com \
--cc=williams@redhat.com \
--cc=ylavic.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.