All of lore.kernel.org
 help / color / mirror / Atom feed
From: mhiramat at kernel.org (Masami Hiramatsu)
Subject: [PATCH] sefltests/ftrace: Use /bin/echo for output with options
Date: Fri, 30 Nov 2018 00:07:43 +0900	[thread overview]
Message-ID: <154350406317.4422.7595059658374071660.stgit@devbox> (raw)
In-Reply-To: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org>

Use /bin/echo for console output with options like non
newline (-n) and/or backslash escape (-e).

Tom Zanussi reported that when he tested ftracetest, it
shows "-e" and "-n" options on the console, since a system
which uses dash as the alias of /bin/sh, uses dash built-in
echo command which doesn't accept "-e".

To avoid this issue, use /bin/echo instead of echo for
the output with options.

Fixes: 8f381ac4d321 ("selftests/ftrace: Add color to the PASS / FAIL results")
Link: http://lkml.kernel.org/r/cover.1542221862.git.tom.zanussi at linux.intel.com
Reported-by: Tom Zanussi <zanussi at kernel.org>
Suggested-by: Tom Zanussi <zanussi at kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
---
 tools/testing/selftests/ftrace/ftracetest |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 75244db70331..ba670b452bdb 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -173,8 +173,8 @@ strip_esc() {
 }
 
 prlog() { # messages
-  echo -e "$@"
-  [ "$LOG_FILE" ] && echo -e "$@" | strip_esc >> $LOG_FILE
+  /bin/echo -e "$@"
+  [ "$LOG_FILE" ] && /bin/echo -e "$@" | strip_esc >> $LOG_FILE
 }
 catlog() { #file
   cat $1

WARNING: multiple messages have this Message-ID (diff)
From: mhiramat@kernel.org (Masami Hiramatsu)
Subject: [PATCH] sefltests/ftrace: Use /bin/echo for output with options
Date: Fri, 30 Nov 2018 00:07:43 +0900	[thread overview]
Message-ID: <154350406317.4422.7595059658374071660.stgit@devbox> (raw)
Message-ID: <20181129150743.RMt4JW3-PK2LYUCEEdrgkiNWcdcgBzvDRFnFvoKKXl0@z> (raw)
In-Reply-To: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org>

Use /bin/echo for console output with options like non
newline (-n) and/or backslash escape (-e).

Tom Zanussi reported that when he tested ftracetest, it
shows "-e" and "-n" options on the console, since a system
which uses dash as the alias of /bin/sh, uses dash built-in
echo command which doesn't accept "-e".

To avoid this issue, use /bin/echo instead of echo for
the output with options.

Fixes: 8f381ac4d321 ("selftests/ftrace: Add color to the PASS / FAIL results")
Link: http://lkml.kernel.org/r/cover.1542221862.git.tom.zanussi at linux.intel.com
Reported-by: Tom Zanussi <zanussi at kernel.org>
Suggested-by: Tom Zanussi <zanussi at kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
---
 tools/testing/selftests/ftrace/ftracetest |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 75244db70331..ba670b452bdb 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -173,8 +173,8 @@ strip_esc() {
 }
 
 prlog() { # messages
-  echo -e "$@"
-  [ "$LOG_FILE" ] && echo -e "$@" | strip_esc >> $LOG_FILE
+  /bin/echo -e "$@"
+  [ "$LOG_FILE" ] && /bin/echo -e "$@" | strip_esc >> $LOG_FILE
 }
 catlog() { #file
   cat $1

WARNING: multiple messages have this Message-ID (diff)
From: Masami Hiramatsu <mhiramat@kernel.org>
To: linux-kselftest@vger.kernel.org, shuah@kernel.org,
	Steven Rostedt <rostedt@goodmis.org>
Cc: mhiramat@kernel.org, "Tom Zanussi" <zanussi@kernel.org>,
	linux-kernel@vger.kernel.org,
	"Daniel Díaz" <daniel.diaz@linaro.org>
Subject: [PATCH] sefltests/ftrace: Use /bin/echo for output with options
Date: Fri, 30 Nov 2018 00:07:43 +0900	[thread overview]
Message-ID: <154350406317.4422.7595059658374071660.stgit@devbox> (raw)
In-Reply-To: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org>
In-Reply-To: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org>

Use /bin/echo for console output with options like non
newline (-n) and/or backslash escape (-e).

Tom Zanussi reported that when he tested ftracetest, it
shows "-e" and "-n" options on the console, since a system
which uses dash as the alias of /bin/sh, uses dash built-in
echo command which doesn't accept "-e".

To avoid this issue, use /bin/echo instead of echo for
the output with options.

Fixes: 8f381ac4d321 ("selftests/ftrace: Add color to the PASS / FAIL results")
Link: http://lkml.kernel.org/r/cover.1542221862.git.tom.zanussi@linux.intel.com
Reported-by: Tom Zanussi <zanussi@kernel.org>
Suggested-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 tools/testing/selftests/ftrace/ftracetest |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 75244db70331..ba670b452bdb 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -173,8 +173,8 @@ strip_esc() {
 }
 
 prlog() { # messages
-  echo -e "$@"
-  [ "$LOG_FILE" ] && echo -e "$@" | strip_esc >> $LOG_FILE
+  /bin/echo -e "$@"
+  [ "$LOG_FILE" ] && /bin/echo -e "$@" | strip_esc >> $LOG_FILE
 }
 catlog() { #file
   cat $1


  reply	other threads:[~2018-11-29 15:07 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 20:17 [PATCH v7 00/16] tracing: Hist trigger snapshot and onchange additions Tom Zanussi
2018-11-14 20:17 ` [PATCH v7 01/16] tracing: Refactor hist trigger action code Tom Zanussi
2018-11-14 20:17 ` [PATCH v7 02/16] tracing: Make hist trigger Documentation better reflect actions/handlers Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 03/16] tracing: Add hist trigger handler.action documentation to README Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 04/16] tracing: Split up onmatch action data Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 05/16] tracing: Generalize hist trigger onmax and save action Tom Zanussi
2018-11-23  2:50   ` Namhyung Kim
2018-12-03 22:22     ` Tom Zanussi
2018-12-04  7:25       ` Namhyung Kim
2018-12-04 19:53         ` Tom Zanussi
2018-11-23  7:01   ` Namhyung Kim
2018-11-27 22:48     ` Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 06/16] tracing: Add conditional snapshot Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 07/16] tracing: Add hist trigger snapshot() action Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 08/16] tracing: Add hist trigger snapshot() action Documentation Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 09/16] tracing: Add hist trigger snapshot() action test case Tom Zanussi
2018-11-26 13:03   ` Masami Hiramatsu
2018-11-27 22:53     ` Tom Zanussi
2018-11-28  2:15       ` Masami Hiramatsu
2018-11-29  1:12         ` Tom Zanussi
2018-12-04 19:59     ` Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 10/16] tracing: Add hist trigger onchange() handler Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 11/16] tracing: Add hist trigger onchange() handler Documentation Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 12/16] tracing: Add hist trigger onchange() handler test case Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 13/16] tracing: Add alternative synthetic event trace action syntax Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 14/16] tracing: Add alternative synthetic event trace action test case Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 15/16] tracing: Add hist trigger action 'expected fail' " Tom Zanussi
2018-11-14 20:18 ` [PATCH v7 16/16] tracing: Add SPDX license GPL-2.0 license identifier to inter-event testcases Tom Zanussi
2018-11-26 14:09 ` [PATCH v7 00/16] tracing: Hist trigger snapshot and onchange additions Masami Hiramatsu
2018-11-26 21:21   ` Tom Zanussi
2018-11-29 13:52     ` Masami Hiramatsu
2018-11-29 14:54       ` Masami Hiramatsu
2018-11-29 15:07         ` mhiramat [this message]
2018-11-29 15:07           ` [PATCH] sefltests/ftrace: Use /bin/echo for output with options Masami Hiramatsu
2018-11-29 15:07           ` Masami Hiramatsu
2018-11-29 16:32           ` rostedt
2018-11-29 16:32             ` Steven Rostedt
2018-11-29 16:32             ` Steven Rostedt
2018-11-29 16:43           ` zanussi
2018-11-29 16:43             ` Tom Zanussi
2018-11-29 16:43             ` Tom Zanussi
2018-11-29 16:49             ` rostedt
2018-11-29 16:49               ` Steven Rostedt
2018-11-29 16:49               ` Steven Rostedt
2019-03-04 20:09               ` zanussi
2019-03-04 20:09                 ` Tom Zanussi
2019-03-04 20:09                 ` Tom Zanussi

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=154350406317.4422.7595059658374071660.stgit@devbox \
    --to=unknown@example.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.