linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>, Shuah Khan <shuah@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results
Date: Wed, 17 Oct 2018 00:26:32 +0900	[thread overview]
Message-ID: <20181017002632.20fcb18bf94efb79aa58219b@kernel.org> (raw)
In-Reply-To: <20181015234231.e163ab77fd42dbd3ac9c84d5@kernel.org>

On Mon, 15 Oct 2018 23:42:31 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Fri, 12 Oct 2018 22:21:06 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > 
> > Now that ftracetest has over 80 tests, it is difficult to simply scroll
> > up the console window to find the failed tests when it reports just two
> > tests have failed. In order to make this stand out better, have the
> > color of the word "PASS" be green, "FAIL" and "XFAIL" be red, and all
> > other results be blue. This helps tremendously in quickly spotting the
> > failed tests by just scrolling up the console window.
> > 
> 
> Looks good to me.
> 
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Oops, I found some problems.

> 
> Thanks!
> 
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > ---
> > diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> > index 5c71d58..4946b2e 100755
> > --- a/tools/testing/selftests/ftrace/ftracetest
> > +++ b/tools/testing/selftests/ftrace/ftracetest
> > @@ -153,7 +153,7 @@ else
> >  fi
> >  
> >  prlog() { # messages
> > -  [ -z "$LOG_FILE" ] && echo "$@" || echo "$@" | tee -a $LOG_FILE
> > +  [ -z "$LOG_FILE" ] && echo -e "$@" || echo -e "$@" | tee -a $LOG_FILE

I think we should strip escape-sequences from log files, like below;

strip_esc() {
  sed -E "s/[[:cntrl:]]\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
}

  [ -z "$LOG_FILE" ] && echo -e "$@" || echo -e "$@" | strip_esc | tee -a $LOG_FILE


> >  }
> >  catlog() { #file
> >    [ -z "$LOG_FILE" ] && cat $1 || cat $1 | tee -a $LOG_FILE
> > @@ -195,37 +195,37 @@ test_on_instance() { # testfile
> >  eval_result() { # sigval
> >    case $1 in
> >      $PASS)
> > -      prlog "	[PASS]"
> > +      prlog "	[\e[32mPASS\e[30m]"

The last one should be "\e[0m" (reset), "\e[30m" just set the color "black".
That doesn't work on my terminal, which is "white on black".

Thank you,


-- 
Masami Hiramatsu

  reply	other threads:[~2018-10-16 15:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181013022112epcas3p239547464b27b1d750b5628900a89f857@epcas3p2.samsung.com>
2018-10-13  2:21 ` [PATCH] selftests/ftrace: Add color to the PASS / FAIL results Steven Rostedt
2018-10-15 13:39   ` Shuah Khan
2018-10-15 14:44     ` Steven Rostedt
2018-10-15 14:47     ` Steven Rostedt
2018-10-15 15:06       ` Shuah Khan
2018-10-15 14:42   ` Masami Hiramatsu
2018-10-16 15:26     ` Masami Hiramatsu [this message]
2018-10-16 15:39       ` Steven Rostedt
2018-10-16 16:40         ` Shuah Khan
2018-10-16 16:58           ` Steven Rostedt

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=20181017002632.20fcb18bf94efb79aa58219b@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=shuahkh@osg.samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).