[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170630150313.146c863e@gandalf.local.home>
Date: Fri, 30 Jun 2017 15:03:13 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Denys Vlasenko <vda.linux@...glemail.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
linux-kselftest@...r.kernel.org, shuah@...nel.org,
Ingo Molnar <mingo@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] selftests: ftrace: Use md5sum to take less time of
checking logs
On Fri, 30 Jun 2017 20:50:45 +0200
Denys Vlasenko <vda.linux@...glemail.com> wrote:
> On Tue, Jun 27, 2017 at 12:28 PM, Masami Hiramatsu <mhiramat@...nel.org> wrote:
> > Use md5sum so that it takes less time of checking
> > trace logs update. Since busybox tail/cat takes too
> > long time to read the trace log, this uses md5sum
> > to check whether trace log is updated or not.
> >
> > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> > ---
> > .../test.d/ftrace/func_traceonoff_triggers.tc | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
> > index 9cf3852..7a9ab4f 100644
> > --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
> > @@ -103,11 +103,11 @@ if [ $on != "0" ]; then
> > fail "Tracing is not off"
> > fi
> >
> > -line1=`cat trace | tail -1`
> > +csum1=`md5sum trace`
> > sleep $SLEEP_TIME
> > -line2=`cat trace | tail -1`
> > +csum2=`md5sum trace`
>
> If you replace that with "tail -1 <trace", this code
> in busybox will be used:
>
> off_t current = lseek(fd, 0, SEEK_END);
The trace file is a kernel pseudo file that prevents lseek. Now what
you could do is:
cat trace > tempfile
csum1=`tail -1 <tempfile`
But then we need to make sure to clean up the files.
-- Steve
Powered by blists - more mailing lists