From patchwork Tue May 14 10:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1099414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453F9y5r7zz9sMr; Tue, 14 May 2019 21:01:42 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hQVBi-0007YC-Uu; Tue, 14 May 2019 11:01:38 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hQVBZ-0007X6-Cu for kernel-team@lists.ubuntu.com; Tue, 14 May 2019 11:01:29 +0000 Received: from mail-pf1-f200.google.com ([209.85.210.200]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hQVBY-0007XD-U8 for kernel-team@lists.ubuntu.com; Tue, 14 May 2019 11:01:29 +0000 Received: by mail-pf1-f200.google.com with SMTP id u7so5624198pfh.17 for ; Tue, 14 May 2019 04:01:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=rdycHe7HAqUkPvxjXMOUwdH1eW9KTpMeaEPEVUTYGmg=; b=CQgWmXW790HoohCoOtLQOlnqHirwFFHRI5Ry/RzglOppH5VeoeLKTsm35Vf5c5V5fn UMbLyem29+bICukD2Xh9uvRjj66lZ9Y6N/M/YFVZZKfypt8gdzp5qN0nm6OLNIuPUbXu Z/pH5WgE9YMdRDyvTSiopqcP1Xrg4da0L/AwfUGxko1eO6J3S5kBOQ4bWkp8tqyBbz8y opKckGEeXDvof/QBXab72M5ClcmICE3yEMP6gNAPpxbq/mZ4mvulg2N4FYqf+ypwdaMA oT7WA5q4HYQKWs7FQA0T9q/O32BhC2zafuop3iSNveyp7m0hKAOKwSOLdw9LLiPZkryu eWJQ== X-Gm-Message-State: APjAAAVoISPyXNh/OedaEqt26PSuzsqBsOsvDa40zKp2AR4bUymGdJvN iHY1sbhRpsP28B/oGgonIfnlS5oIsY1cfCYkvEb+K2Y1gA/MDa9X/9dghRtcNrv92AcTvxkXpqY Z60FlFaZR13hcxjSVEczukZkRcqvvqs0g1Q+oAR3O X-Received: by 2002:a17:902:7d90:: with SMTP id a16mr36040333plm.122.1557831687162; Tue, 14 May 2019 04:01:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqz77R0Hd49aT9iRUl8bbcwCzAmOvBGR9LOuquUaMO34IA7qHys2r0lgpNT0q6oqFduX+x1psQ== X-Received: by 2002:a17:902:7d90:: with SMTP id a16mr36040315plm.122.1557831686969; Tue, 14 May 2019 04:01:26 -0700 (PDT) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id p2sm41581919pfi.73.2019.05.14.04.01.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 04:01:26 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [D][E][SRU][PATCH 1/2] selftests/ftrace: Replace \e with \033 Date: Tue, 14 May 2019 18:56:53 +0800 Message-Id: <20190514105654.11369-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190514105654.11369-1-po-hsu.lin@canonical.com> References: <20190514105654.11369-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Juerg Haefliger BugLink: https://bugs.launchpad.net/bugs/1828995 The \e sequence character is not POSIX. Fix that by using \033 instead. Acked-by: Steven Rostedt (VMware) Acked-by: Masami Hiramatsu Signed-off-by: Juerg Haefliger Signed-off-by: Shuah Khan (cherry picked from commit 4ce55a9ce18ed7649eed0e2dcb9f187891bcdf07) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/ftrace/ftracetest | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index 75244db..384972b 100755 --- a/tools/testing/selftests/ftrace/ftracetest +++ b/tools/testing/selftests/ftrace/ftracetest @@ -161,10 +161,10 @@ color_green= color_blue= # If stdout exists and number of colors is eight or more, use them if [ -t 1 -a "$ncolors" -a "$ncolors" -ge 8 ]; then - color_reset="\e[0m" - color_red="\e[31m" - color_green="\e[32m" - color_blue="\e[34m" + color_reset="\033[0m" + color_red="\033[31m" + color_green="\033[32m" + color_blue="\033[34m" fi strip_esc() { From patchwork Tue May 14 10:56:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1099415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453FB94YXXz9sMr; Tue, 14 May 2019 21:01:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hQVBu-0007am-53; Tue, 14 May 2019 11:01:50 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hQVBr-0007aW-LW for kernel-team@lists.ubuntu.com; Tue, 14 May 2019 11:01:47 +0000 Received: from mail-pl1-f197.google.com ([209.85.214.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hQVBo-0007XM-J2 for kernel-team@lists.ubuntu.com; Tue, 14 May 2019 11:01:47 +0000 Received: by mail-pl1-f197.google.com with SMTP id g11so10351460plt.23 for ; Tue, 14 May 2019 04:01:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=k/Yhpvtp5aS7VxIhP3d8g1ILV18GfBfjQgR1G6XvzTo=; b=lPrj/oClzr6H8NHVplMW99L/oYA+9vcZEXKA1NGdGsfj5x5llzvYquW1jkotJNz7L1 obUNuUxt0e4QGP0d07qhlsDIYvvuYe9/Eek/v52iu7ztziN2yfFsfF4AAzx7NbW3eK8R hAl0A+5OQPNWTrHLsUEvzsmQKeyLPcHnI/i5Vn4EpU6xBbvC32vDONtmwEGMvxrRbeyS ySLF6eBrdXeh9sPUrQXJLm3oPGtUWVq49JK8l8PBbTtzSH5DYGcOPsKib13X12UBBGq8 6nOYGhcfRZAClCPJ+OvvN8I7Iw1i28nKtaS1SqKxbA2lSWTkSK/q2XKtVEl8PHhbACxX s5HA== X-Gm-Message-State: APjAAAUgKo5p5x3EGKmZhwDPDZYejTwgZig4LMSKB6lPnvizmom4xANO MtRhPCwcTFMqXa1YF5FM8zwrlxsICG26IibuapZZspYjWp5Cd1EymSZI6gYcv1t1/t42VR/JMWc OMtgWr7bwQRgA1NxBH43t53jAnCYK/fPVxyeqCjHZ X-Received: by 2002:a62:1cd5:: with SMTP id c204mr381193pfc.205.1557831688744; Tue, 14 May 2019 04:01:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEDKvCxgzVAEvWbT+9BN4mWxmgZEpcGTWT8lYmTozhTtkEsCGN4vc7O5Sg96v5Y+qrd3hXLA== X-Received: by 2002:a62:1cd5:: with SMTP id c204mr381169pfc.205.1557831688542; Tue, 14 May 2019 04:01:28 -0700 (PDT) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id p2sm41581919pfi.73.2019.05.14.04.01.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 04:01:27 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [D][E][SRU][PATCH 2/2] selftests/ftrace: Replace echo -e with printf Date: Tue, 14 May 2019 18:56:54 +0800 Message-Id: <20190514105654.11369-3-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190514105654.11369-1-po-hsu.lin@canonical.com> References: <20190514105654.11369-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Juerg Haefliger BugLink: https://bugs.launchpad.net/bugs/1828995 echo -e is not POSIX. Depending on what /bin/sh is, we can get incorrect output like: $ -e -n [1] Basic trace file check $ -e [PASS] Fix that by using printf instead. Acked-by: Steven Rostedt (VMware) Acked-by: Masami Hiramatsu Signed-off-by: Juerg Haefliger Signed-off-by: Shuah Khan (cherry picked from commit 37fb665b059edcd6ab87b1541402eef3dac91168) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/ftrace/ftracetest | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index 384972b..316f2bf 100755 --- a/tools/testing/selftests/ftrace/ftracetest +++ b/tools/testing/selftests/ftrace/ftracetest @@ -173,8 +173,13 @@ strip_esc() { } prlog() { # messages - echo -e "$@" - [ "$LOG_FILE" ] && echo -e "$@" | strip_esc >> $LOG_FILE + newline="\n" + if [ "$1" = "-n" ] ; then + newline= + shift + fi + printf "$*$newline" + [ "$LOG_FILE" ] && printf "$*$newline" | strip_esc >> $LOG_FILE } catlog() { #file cat $1