public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Chunyu Hu <chuhu@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH RFC 8/9] ftrace_stress: update the trace_options test
Date: Fri, 18 Mar 2016 09:21:36 -0400 (EDT)	[thread overview]
Message-ID: <2011167372.29659341.1458307296905.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160317171859.GH31815@rei.lan>



----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Li Wang" <liwang@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Friday, March 18, 2016 1:19:00 AM
> Subject: Re: [LTP] [PATCH RFC 8/9] ftrace_stress: update the trace_options test
> 
> Hi!
> > +# enable the nop_test_refuse can cause an
> > +# 'write error: Invalid argument'. So don't
> > +# test it.
> > +option_files=${option_files/test_nop_refuse/}
> > +trace_options=( $option_files )
> > +
> > +NR_TRACE_OPTIONS=${#trace_options[*]}
> 
> This does not work even in bash because the trace_options is never
> casted to array so it just returns 0.
> 
> The portable way is plain old wc:
> 
> NR=$(echo $trace_options |wc -w)

Will take this way in V2, thanks for the suggestion.

In fact i made it to an array. But i will make trace_options to a string in V2.
As you mentioned, some other shells may not recognize the bash style array. Thanks !


> >  for ((; ; ))
> >  {
> 
> Please fix these bash style loops as well.

Will do it in V2. Thanks.

> > @@ -25,7 +31,6 @@ for ((; ; ))
> >  	{
> >  		num=`date +%N`
> >  		num=`printf 1%s $num`
> > -
> >  		for ((i = 0; i < $NR_TRACE_OPTIONS; i++))
> >  		{
> 
> And here.

Will modify this in V2. Thanks for reviewing this.

> >  			n=$(( ( $num >> $i ) % 2 ))
> > @@ -34,9 +39,9 @@ for ((; ; ))
> >  			else
> >  				echo 1 > "$TRACING_PATH"/options/${trace_options[$i]}
> >  			fi
> > +			[ $? -ne 0 ] && echo "setup trace option ${trace_options[$i]} failed"
> 
> Shouldn't this check be just after the echo rather than here?

Agree, the echo message is just for setting, but the clear branch can also hit this message.
So we need to make the message can express both set and the clear option failure.

> >  		}
> >  	}
> >  
> >  	sleep 1
> >  }
> > -
> > --
> > 1.8.3.1
> > 
> > 
> > --
> > Mailing list info: http://lists.linux.it/listinfo/ltp
> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
> 

-- 
Regards,
Chunyu Hu


  parent reply	other threads:[~2016-03-18 13:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04  8:24 [LTP] [PATCH RFC 0/9] tracing: make ftrace tests to be extended Li Wang
2016-03-04  8:24 ` [LTP] [PATCH RFC 1/9] ftrace_stress: remove the useless file ftrace_get_page_size.c Li Wang
2016-03-04  8:24   ` [LTP] [PATCH RFC 2/9] tracing[1]: reorganize ftrace-stress tests to general tests Li Wang
2016-03-04  8:24     ` [LTP] [PATCH RFC 3/9] tracing[2]: reorganize ftrace stress " Li Wang
2016-03-04  8:24       ` [LTP] [PATCH RFC 4/9] ftrace_regression: add new case to ftrace_regression/ dir Li Wang
2016-03-04  8:24         ` [LTP] [PATCH RFC 5/9] ftrace_regression: add a new testcase Li Wang
2016-03-04  8:24           ` [LTP] [PATCH RFC 6/9] ftrace_stress: skip unsupported tests Li Wang
2016-03-04  8:24             ` [LTP] [PATCH RFC 7/9] ftrace_stress: keep the name of testscipt in sync with tracing file Li Wang
2016-03-04  8:24               ` [LTP] [PATCH RFC 8/9] ftrace_stress: update the trace_options test Li Wang
2016-03-04  8:24                 ` [LTP] [PATCH RFC 9/9] ftrace_stress: add two new tests Li Wang
2016-03-17 18:08                   ` Cyril Hrubis
2016-03-18 14:08                     ` Chunyu Hu
2016-03-21 12:09                       ` Cyril Hrubis
2016-03-17 17:19                 ` [LTP] [PATCH RFC 8/9] ftrace_stress: update the trace_options test Cyril Hrubis
2016-03-17 17:28                   ` Cyril Hrubis
2016-03-18 13:24                     ` Chunyu Hu
2016-03-18 13:21                   ` Chunyu Hu [this message]
2016-03-17 17:07             ` [LTP] [PATCH RFC 6/9] ftrace_stress: skip unsupported tests Cyril Hrubis
2016-03-18 13:08               ` Chunyu Hu
2016-03-17 16:50           ` [LTP] [PATCH RFC 5/9] ftrace_regression: add a new testcase Cyril Hrubis
2016-03-18  7:57             ` Li Wang
2016-03-17 16:49         ` [LTP] [PATCH RFC 4/9] ftrace_regression: add new case to ftrace_regression/ dir Cyril Hrubis
2016-03-17 16:39       ` [LTP] [PATCH RFC 3/9] tracing[2]: reorganize ftrace stress tests to general tests Cyril Hrubis
2016-03-18 10:42         ` Li Wang
2016-03-21 12:21           ` Cyril Hrubis
2016-03-22  8:27             ` Li Wang
2016-03-17 16:29   ` [LTP] [PATCH RFC 1/9] ftrace_stress: remove the useless file ftrace_get_page_size.c Cyril Hrubis

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=2011167372.29659341.1458307296905.JavaMail.zimbra@redhat.com \
    --to=chuhu@redhat.com \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox