From patchwork Fri Feb 22 20:53:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 10826983 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 4B004139A for ; Fri, 22 Feb 2019 20:54:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C15928505 for ; Fri, 22 Feb 2019 20:54:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3060828706; Fri, 22 Feb 2019 20:54:15 +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=-7.9 required=2.0 tests=BAYES_00,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 D51F528505 for ; Fri, 22 Feb 2019 20:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726278AbfBVUyO (ORCPT ); Fri, 22 Feb 2019 15:54:14 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:35339 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbfBVUyO (ORCPT ); Fri, 22 Feb 2019 15:54:14 -0500 Received: from mail-wm1-f70.google.com ([209.85.128.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1gxHpk-0000Lu-DY for linux-kselftest@vger.kernel.org; Fri, 22 Feb 2019 20:54:12 +0000 Received: by mail-wm1-f70.google.com with SMTP id f202so488304wme.2 for ; Fri, 22 Feb 2019 12:54:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NRPeMIi4WkzlI/wi4uTphGWN+IH4+mQk5AY4oH1wsVE=; b=LPydPkX4yBnap6TBoc8v0sBuIwavEI3GCaGUnYgEJakl20TB4spLT/+CaGQ6ebXXd/ H3ylyyv46GH1SHr7euN/+ZqffkZv7Nt8/S1veah3R9fv0Tf+ds9uHSa+5K8MNvyXHT/J OzfCrje8QmEmBg6DgHAZODkdaVX6/RUrm/Pdc+I14xzPhwom9o8yMcJ7CuABfbf/dHTQ qScI92VoQG8syi7H5DaMMKdyZvE55DNviLXmbEmORC5BQfb8UFTGmvsktmnjLn+fr8tQ NFAQMJpNeVRo/ae5GMoHzjaBlXInE7BjdxTSNAlTMyhiCiaSArk4emQcX6yWvLxWJyDr 19oA== X-Gm-Message-State: AHQUAuYYi6wNJdIIOMKQlV5jAt5eUqt2KZIh5JCgl4dO8mnCc5sXIRXZ gTKVTN1qN76GGIdsvE0fpG/qLsfOE4PGWAsZsdfFo3Q3EG/qUrPcQ14USMDN+B+E2sijomdXWW3 P0Z0QioZxIywbCGMTiBFVtnRU9Ghv0Nlf9yOX8UCy6F2Hxg== X-Received: by 2002:a7b:c14f:: with SMTP id z15mr3731357wmi.3.1550868851578; Fri, 22 Feb 2019 12:54:11 -0800 (PST) X-Google-Smtp-Source: AHgI3Ialsemdfap9Uq6CkVhuIqk/R+3D8RwXnBkjzKnz4OIkFedPm1/Tr/PIJkJuQiFWK7EGw45u7w== X-Received: by 2002:a7b:c14f:: with SMTP id z15mr3731351wmi.3.1550868851431; Fri, 22 Feb 2019 12:54:11 -0800 (PST) Received: from smeagol.c.hoisthospitality.com ([194.158.46.138]) by smtp.gmail.com with ESMTPSA id r14sm1432990wrv.77.2019.02.22.12.54.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 12:54:10 -0800 (PST) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, mhiramat@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: Juerg Haefliger Subject: [RESEND PATCH v2 1/2] selftests/ftrace: Replace echo -e with printf Date: Fri, 22 Feb 2019 21:53:50 +0100 Message-Id: <20190222205351.743-2-juergh@canonical.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190222205351.743-1-juergh@canonical.com> References: <20190222091021.10178-1-juergh@canonical.com> <20190222205351.743-1-juergh@canonical.com> 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 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 --- 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 fc755e1b50f1..20c9c0ad8682 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 From patchwork Fri Feb 22 20:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 10826985 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 867DF1575 for ; Fri, 22 Feb 2019 20:54:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74BC928505 for ; Fri, 22 Feb 2019 20:54:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6903728706; Fri, 22 Feb 2019 20:54:22 +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=-7.9 required=2.0 tests=BAYES_00,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 1557E28505 for ; Fri, 22 Feb 2019 20:54:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbfBVUyV (ORCPT ); Fri, 22 Feb 2019 15:54:21 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:35344 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfBVUyQ (ORCPT ); Fri, 22 Feb 2019 15:54:16 -0500 Received: from mail-wr1-f71.google.com ([209.85.221.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1gxHpm-0000M7-Dw for linux-kselftest@vger.kernel.org; Fri, 22 Feb 2019 20:54:14 +0000 Received: by mail-wr1-f71.google.com with SMTP id 92so384487wrb.6 for ; Fri, 22 Feb 2019 12:54:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G3RGIsjVJiV9/aYmypk7Tl84Nzy7qZUzmLjkFAcwVNY=; b=W6Ow9L7jSr5Ussp0pbP//xFPSfuqqAxOMdVbwvkWxRAQmsTmhGXHRCEMD6RExRoYRH 78qDp/Jc/fNkqTVa2DQcuB+rg03k+DeL2yUJQlDgoLBA3Gbl64ofQTEV0dVnjgtRcEg6 1zd/QtUyrvWyMkCj+SK6l8goWkyQqSx73/u4Km/H16SNLZPL9Tq38X4Yd0SCOZW5y3kL DA0yrN3sWyxYycwb5w/sDxyxay8lQC84r0d8i8BSkj6ljJmc/BTHYvp3as7qDioHXzct XY8J15EXKuj2S4wlAR6GgFQdTY1m3c/e3m30mbxTzvmbvoIYw5xbTx487mq+gq7/IUcl FWJg== X-Gm-Message-State: AHQUAuYpGyhz+iK+BdAs9sVmXGvgO3KY45B9T+LnP3fnLUgKO4Kqdt2j 59taGW+DkVirxbPvsMUULSWiKlI0iu+9e6kyYkW1fL2GYAM3v+AZ1gtMrvbnL9Ot4YYm8YrHWQN e++Uxo7EdlfM1TRNUrX+L+2Y1LxnHKjLrz4S5q52JUH1h/A== X-Received: by 2002:a7b:cc18:: with SMTP id f24mr3889576wmh.42.1550868854137; Fri, 22 Feb 2019 12:54:14 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaq9Ra3RsUt32F/YRL+99sKkbpXWyQZkGMAh2rYRuQPURXlOKRjW4W/CBv7vuJE9p+3WFqztQ== X-Received: by 2002:a7b:cc18:: with SMTP id f24mr3889568wmh.42.1550868854010; Fri, 22 Feb 2019 12:54:14 -0800 (PST) Received: from smeagol.c.hoisthospitality.com ([194.158.46.138]) by smtp.gmail.com with ESMTPSA id r14sm1432990wrv.77.2019.02.22.12.54.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 12:54:13 -0800 (PST) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, mhiramat@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: Juerg Haefliger Subject: [RESEND PATCH v2 2/2] selftests/ftrace: Replace \e with \033 Date: Fri, 22 Feb 2019 21:53:51 +0100 Message-Id: <20190222205351.743-3-juergh@canonical.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190222205351.743-1-juergh@canonical.com> References: <20190222091021.10178-1-juergh@canonical.com> <20190222205351.743-1-juergh@canonical.com> 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 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 --- 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 20c9c0ad8682..136387422b00 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" -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() {