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 V2 9/9] ftrace_stress: cleanup and use ltp API
Date: Thu, 5 May 2016 03:44:56 -0400 (EDT)	[thread overview]
Message-ID: <1504573593.43522272.1462434296013.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1857309330.43401385.1462376568052.JavaMail.zimbra@redhat.com>



----- Original Message -----
> From: "Chunyu Hu" <chuhu@redhat.com>
> To: "Cyril Hrubis" <chrubis@suse.cz>
> Cc: liwan@redhat.com, ltp@lists.linux.it
> Sent: Wednesday, May 4, 2016 11:42:48 PM
> Subject: Re: [LTP] [PATCH V2 9/9] ftrace_stress: cleanup and use ltp API
> 
> 
> Hi Cyril,

> > > diff --git
> > > a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
> > > b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
> > > index 47d42bc..a24008a 100755
> > > ---
> > > a/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
> > > +++
> > > b/testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh
> > > @@ -13,10 +13,11 @@
> > >  #
> > >  #
> > >  ###############################################################################
> > >  
> > > +. test.sh
> > 
> > You don't have to add test.sh for tst_sleep.
> 
> OK. will remove this.
> 
> > >  ftrace_sleep()
> > >  {
> > > -	# usleep is not a standard command?
> > > -	usleep 200000 2> /dev/null
> > > +	tst_sleep 200000us
> > >  	if [ $? -ne 0 ]; then
> > >  		sleep 1
> > >  	fi
> > 
> > You should remove the fallback to sleep 1 if the usleep wasn't found.
> > Ideally the whole function ftrace_sleep should be removed and you should
> > just call tst_sleep from the main loop.
> 
> I think using tst_sleep directly is good way. thanks.
> 
> > > @@ -33,10 +34,9 @@ trap kill_this_pid SIGUSR1
> > >  
> > >  LOOP=20
> > >  
> > > -for ((; ;))
> > > -{
> > > -	for ((i = 0; i < $LOOP; i++))
> > > -	{
> > > +while true; do
> > > +	i=0;
> > > +	while [ $i -lt $LOOP ]; do
> > >  		cat "$TRACING_PATH"/trace_pipe > /dev/null &
> > >  
> > >  		this_pid=$!
> > > @@ -45,8 +45,7 @@ for ((; ;))
> > >  		wait $this_pid
> > >  		this_pid=0
> > >  		ftrace_sleep
> > > -	}
> > > -
> > > +		i=$((i + 1))
> > > +	done
> > >  	sleep 2
> > > -}
> > > -
> > > +done
> > 
> > And you should also fix the kill called by the full path in this script.
> > It should really be just kill not /bin/kill.
> 

Hi Cyril,

After i changing it to kill directly and retest it, i hit err message:

ftrace_trace_pipe.sh: line 18: kill: SIGKILL: invalid signal specification

then i found that kill is also one of the bash built-in cmd. So we'd better
still use /bin/kill in this case.
 
# type kill
kill is a shell builtin

bash-4.2.46-19.el7.x86_64





  parent reply	other threads:[~2016-05-05  7:44 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  8:04 [LTP] [PATCH V2 0/9] tracing: make ftrace tests to be extended Chunyu Hu
2016-04-18  8:04 ` [LTP] [PATCH V2 1/9] tracing: reorganize ftrace-stress tests to general tests Chunyu Hu
2016-04-18  8:04   ` [LTP] [PATCH V2 2/9] tracing/ftrace: add new case for ftrace userstacktrace Chunyu Hu
2016-04-18  8:04     ` [LTP] [PATCH V2 3/9] tracing/ftrace: add a new case for signal_generate Chunyu Hu
2016-04-18  8:04       ` [LTP] [PATCH V2 4/9] ftrace_stress: skip unsupported tests Chunyu Hu
2016-04-18  8:04         ` [LTP] [PATCH V2 5/9] ftrace_stress: keep the name of testscipt in sync with tracing file Chunyu Hu
2016-04-18  8:04           ` [LTP] [PATCH V2 6/9] testcases/lib: Add tst_random decmical integer generator Chunyu Hu
2016-04-18  8:04             ` [LTP] [PATCH V2 7/9] ftrace_stress: update the trace_options test Chunyu Hu
2016-04-18  8:04               ` [LTP] [PATCH V2 8/9] ftrace_stress: add two new tests Chunyu Hu
2016-04-18  8:04                 ` [LTP] [PATCH V2 9/9] ftrace_stress: cleanup and use ltp API Chunyu Hu
2016-05-04 14:56                   ` Cyril Hrubis
2016-05-04 15:42                     ` Chunyu Hu
2016-05-04 16:32                       ` Cyril Hrubis
2016-05-05  7:44                       ` Chunyu Hu [this message]
2016-05-10 14:13                         ` Cyril Hrubis
2016-05-11 11:01                           ` Chunyu Hu
2016-05-04 16:57               ` [LTP] [PATCH V2 7/9] ftrace_stress: update the trace_options test Cyril Hrubis
2016-05-04 13:34             ` [LTP] [PATCH V2 6/9] testcases/lib: Add tst_random decmical integer generator Cyril Hrubis
2016-05-04 15:04               ` Chunyu Hu
2016-05-04 15:55                 ` Cyril Hrubis
2016-05-04 16:28                   ` Chunyu Hu
2016-05-04 23:40                     ` Chunyu Hu
2016-05-04 16:50         ` [LTP] [PATCH V2 4/9] ftrace_stress: skip unsupported tests Cyril Hrubis
2016-05-05  0:53           ` Chunyu Hu
2016-05-10 14:25             ` Cyril Hrubis
2016-05-11 11:14               ` Chunyu Hu
2016-05-04 16:00     ` [LTP] [PATCH V2 2/9] tracing/ftrace: add new case for ftrace userstacktrace Cyril Hrubis
2016-05-05  6:24       ` Li Wang
2016-05-04 16:26   ` [LTP] [PATCH V2 1/9] tracing: reorganize ftrace-stress tests to general tests Cyril Hrubis
2016-05-05  6:21     ` Li Wang
2016-05-05 10:11     ` Chunyu Hu
2016-05-05 10:53       ` Chunyu Hu

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=1504573593.43522272.1462434296013.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