* [PATCH] selftests/ftrace: Add color to the PASS / FAIL results @ 2018-10-13 2:21 ` Steven Rostedt 2018-10-15 13:39 ` Shuah Khan 2018-10-15 14:42 ` Masami Hiramatsu 0 siblings, 2 replies; 10+ messages in thread From: Steven Rostedt @ 2018-10-13 2:21 UTC (permalink / raw) To: LKML; +Cc: Shuah Khan, Masami Hiramatsu 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. 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 } 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]" PASSED_CASES="$PASSED_CASES $CASENO" return 0 ;; $FAIL) - prlog " [FAIL]" + prlog " [\e[31mFAIL\e[30m]" FAILED_CASES="$FAILED_CASES $CASENO" return 1 # this is a bug. ;; $UNRESOLVED) - prlog " [UNRESOLVED]" + prlog " [\e[34mUNRESOLVED\e[30m]" UNRESOLVED_CASES="$UNRESOLVED_CASES $CASENO" return 1 # this is a kind of bug.. something happened. ;; $UNTESTED) - prlog " [UNTESTED]" + prlog " [\e[34mUNTESTED\e[30m]" UNTESTED_CASES="$UNTESTED_CASES $CASENO" return 0 ;; $UNSUPPORTED) - prlog " [UNSUPPORTED]" + prlog " [\e[34mUNSUPPORTED\e[30m]" UNSUPPORTED_CASES="$UNSUPPORTED_CASES $CASENO" return $UNSUPPORTED_RESULT # depends on use case ;; $XFAIL) - prlog " [XFAIL]" + prlog " [\e[31mXFAIL\e[30m]" XFAILED_CASES="$XFAILED_CASES $CASENO" return 0 ;; *) - prlog " [UNDEFINED]" + prlog " [\e[34mUNDEFINED\e[30m]" UNDEFINED_CASES="$UNDEFINED_CASES $CASENO" return 1 # this must be a test bug ;; ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 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 14:42 ` Masami Hiramatsu 1 sibling, 2 replies; 10+ messages in thread From: Shuah Khan @ 2018-10-15 13:39 UTC (permalink / raw) To: Steven Rostedt, LKML; +Cc: Shuah Khan, Masami Hiramatsu, Shuah Khan On 10/12/2018 08:21 PM, Steven Rostedt 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. > > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Great. Scroll feature is going to be a great help. I will take this for 4.20-rc1 FYI. Please don't use shuah@kernel.org address for sending patches. shuahkh@osg.samsung.com will become absolete due Samsung IT changes. getmaintainers should give you right address. thanks, -- Shuah ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 2018-10-15 13:39 ` Shuah Khan @ 2018-10-15 14:44 ` Steven Rostedt 2018-10-15 14:47 ` Steven Rostedt 1 sibling, 0 replies; 10+ messages in thread From: Steven Rostedt @ 2018-10-15 14:44 UTC (permalink / raw) To: Shuah Khan; +Cc: LKML, Shuah Khan, Masami Hiramatsu On Mon, 15 Oct 2018 07:39:13 -0600 Shuah Khan <shuah@kernel.org> wrote: > On 10/12/2018 08:21 PM, Steven Rostedt 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. > > > > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> > > Great. Scroll feature is going to be a great help. I will take this > for 4.20-rc1 Great. > > FYI. Please don't use shuah@kernel.org address for sending patches. > shuahkh@osg.samsung.com will become absolete due Samsung IT changes. > > getmaintainers should give you right address. > OK, Thanks for the update. I have to update my address book (as that's what I used). -- Steve ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 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 1 sibling, 1 reply; 10+ messages in thread From: Steven Rostedt @ 2018-10-15 14:47 UTC (permalink / raw) To: Shuah Khan; +Cc: LKML, Shuah Khan, Masami Hiramatsu On Mon, 15 Oct 2018 07:39:13 -0600 Shuah Khan <shuah@kernel.org> wrote: > FYI. Please don't use shuah@kernel.org address for sending patches. > shuahkh@osg.samsung.com will become absolete due Samsung IT changes. I think you meant "please use shuah@kernel.org". -- Steve ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 2018-10-15 14:47 ` Steven Rostedt @ 2018-10-15 15:06 ` Shuah Khan 0 siblings, 0 replies; 10+ messages in thread From: Shuah Khan @ 2018-10-15 15:06 UTC (permalink / raw) To: Steven Rostedt; +Cc: LKML, Shuah Khan, Masami Hiramatsu, Shuah Khan On 10/15/2018 08:47 AM, Steven Rostedt wrote: > On Mon, 15 Oct 2018 07:39:13 -0600 > Shuah Khan <shuah@kernel.org> wrote: > > >> FYI. Please don't use shuah@kernel.org address for sending patches. >> shuahkh@osg.samsung.com will become absolete due Samsung IT changes. > > I think you meant "please use shuah@kernel.org". Yes. Thanks for catching this. Please use shuah@kernel.org which is in the address in MAINTAINERS file. thanks, -- Shuah ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 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:42 ` Masami Hiramatsu 2018-10-16 15:26 ` Masami Hiramatsu 1 sibling, 1 reply; 10+ messages in thread From: Masami Hiramatsu @ 2018-10-15 14:42 UTC (permalink / raw) To: Steven Rostedt; +Cc: LKML, Shuah Khan, Masami Hiramatsu 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> 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 > } > 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]" > PASSED_CASES="$PASSED_CASES $CASENO" > return 0 > ;; > $FAIL) > - prlog " [FAIL]" > + prlog " [\e[31mFAIL\e[30m]" > FAILED_CASES="$FAILED_CASES $CASENO" > return 1 # this is a bug. > ;; > $UNRESOLVED) > - prlog " [UNRESOLVED]" > + prlog " [\e[34mUNRESOLVED\e[30m]" > UNRESOLVED_CASES="$UNRESOLVED_CASES $CASENO" > return 1 # this is a kind of bug.. something happened. > ;; > $UNTESTED) > - prlog " [UNTESTED]" > + prlog " [\e[34mUNTESTED\e[30m]" > UNTESTED_CASES="$UNTESTED_CASES $CASENO" > return 0 > ;; > $UNSUPPORTED) > - prlog " [UNSUPPORTED]" > + prlog " [\e[34mUNSUPPORTED\e[30m]" > UNSUPPORTED_CASES="$UNSUPPORTED_CASES $CASENO" > return $UNSUPPORTED_RESULT # depends on use case > ;; > $XFAIL) > - prlog " [XFAIL]" > + prlog " [\e[31mXFAIL\e[30m]" > XFAILED_CASES="$XFAILED_CASES $CASENO" > return 0 > ;; > *) > - prlog " [UNDEFINED]" > + prlog " [\e[34mUNDEFINED\e[30m]" > UNDEFINED_CASES="$UNDEFINED_CASES $CASENO" > return 1 # this must be a test bug > ;; -- Masami Hiramatsu <mhiramat@kernel.org> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 2018-10-15 14:42 ` Masami Hiramatsu @ 2018-10-16 15:26 ` Masami Hiramatsu 2018-10-16 15:39 ` Steven Rostedt 0 siblings, 1 reply; 10+ messages in thread From: Masami Hiramatsu @ 2018-10-16 15:26 UTC (permalink / raw) To: Steven Rostedt, Shuah Khan; +Cc: LKML, Shuah Khan, Masami Hiramatsu 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 2018-10-16 15:26 ` Masami Hiramatsu @ 2018-10-16 15:39 ` Steven Rostedt 2018-10-16 16:40 ` Shuah Khan 0 siblings, 1 reply; 10+ messages in thread From: Steven Rostedt @ 2018-10-16 15:39 UTC (permalink / raw) To: Masami Hiramatsu; +Cc: Shuah Khan, LKML, Shuah Khan On Wed, 17 Oct 2018 00:26:32 +0900 Masami Hiramatsu <mhiramat@kernel.org> wrote: > 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". > > Ah thanks for the feedback. Want to write a patch on top, that Shuah can add? -- Steve ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 2018-10-16 15:39 ` Steven Rostedt @ 2018-10-16 16:40 ` Shuah Khan 2018-10-16 16:58 ` Steven Rostedt 0 siblings, 1 reply; 10+ messages in thread From: Shuah Khan @ 2018-10-16 16:40 UTC (permalink / raw) To: Steven Rostedt, Masami Hiramatsu; +Cc: LKML, Shuah Khan On 10/16/2018 09:39 AM, Steven Rostedt wrote: > On Wed, 17 Oct 2018 00:26:32 +0900 > Masami Hiramatsu <mhiramat@kernel.org> wrote: > >> 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". >> >> > > Ah thanks for the feedback. Want to write a patch on top, that Shuah > can add? > > -- Steve > That will be great. I can apply the updated patch with Masami's Reviewed-by perhaps. thanks, -- Shuah ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] selftests/ftrace: Add color to the PASS / FAIL results 2018-10-16 16:40 ` Shuah Khan @ 2018-10-16 16:58 ` Steven Rostedt 0 siblings, 0 replies; 10+ messages in thread From: Steven Rostedt @ 2018-10-16 16:58 UTC (permalink / raw) To: Shuah Khan; +Cc: Masami Hiramatsu, LKML On Tue, 16 Oct 2018 10:40:55 -0600 Shuah Khan <shuah@kernel.org> wrote: > >> 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". > >> > >> > > > > Ah thanks for the feedback. Want to write a patch on top, that Shuah > > can add? > > > > -- Steve > > > > That will be great. I can apply the updated patch with Masami's Reviewed-by > perhaps. I was hoping that Masami could write the patch ;-) -- Steve ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-10-16 16:58 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [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 2018-10-16 15:39 ` Steven Rostedt 2018-10-16 16:40 ` Shuah Khan 2018-10-16 16:58 ` Steven Rostedt
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).