From patchwork Thu Nov 29 15:07:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 10704755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E13313A4 for ; Thu, 29 Nov 2018 15:08:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ED912F501 for ; Thu, 29 Nov 2018 15:08:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D2A42F51F; Thu, 29 Nov 2018 15:08:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BE592F501 for ; Thu, 29 Nov 2018 15:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728667AbeK3CNr (ORCPT ); Thu, 29 Nov 2018 21:13:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:33160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728528AbeK3CNq (ORCPT ); Thu, 29 Nov 2018 21:13:46 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4493F20868; Thu, 29 Nov 2018 15:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543504086; bh=XAkdElZIosJC3P7YxxyOKkdxABvSoAcvfYVUrQixZ/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=SU2YYGUBm9wyYT8vHtuI3666MxLcoKYvgH1GCG5t0AQ2onupMKXRD8QAnWvwaVuuJ nVo+e9xm4mQTw8PImIHyGmCnn8mrsQNFrKVd0CIW9zb9dY1/eAFmquBEoBOsZxLUjs 82IiSmgibiSUynFYAzwvrSXA7F/5+x2M7QDMAIYM= From: Masami Hiramatsu To: linux-kselftest@vger.kernel.org, shuah@kernel.org, Steven Rostedt Cc: mhiramat@kernel.org, Tom Zanussi , linux-kernel@vger.kernel.org, =?utf-8?q?Daniel_D=C3=ADaz?= Subject: [PATCH] sefltests/ftrace: Use /bin/echo for output with options Date: Fri, 30 Nov 2018 00:07:43 +0900 Message-Id: <154350406317.4422.7595059658374071660.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org> References: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org> In-Reply-To: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org> References: <20181129235407.9788e718a4ae7830f9e5d225@kernel.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Suggested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Acked-by: Steven Rostedt (VMware) Tested-by: Tom Zanussi --- 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