Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1715948ybk; Mon, 11 May 2020 02:29:46 -0700 (PDT) X-Google-Smtp-Source: APiQypIsu2o90s4r3TlK+XwFvYhZP94HFJPQk+vMDJRoHYWvFg0Ibfs49S/c3J38wpPa0deD9MkX X-Received: by 2002:a17:906:1d4c:: with SMTP id o12mr12908584ejh.357.1589189386781; Mon, 11 May 2020 02:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589189386; cv=none; d=google.com; s=arc-20160816; b=LkOczELanZhyX9lYNWaJ/yXgQRthmSRS0GcP9PaSvG9DwnEKhDzROiai6pBTw1pic3 Of5Qm19rVshN1v99/qRgs68HGS/SJhMvNLMdYqxOCj2zJqS4uNiVcBJX08f16sPzFaef Z+WO7/4k+t0Kcmp/xGqQmgtF7tZfQBAUHnbPcRx1KupERerExLWQH5eC4cG/Oa5+oGs2 bo3EPwDiOGL2dgoaVQEZ/1bl7IgjagrywHYtNSSDg0axyd51D5l7v9RKSAtUgTCi/1J/ 4RJen3UjQvl4MBreovoV+pe0LScWXKf1k36ANyWfwRARPrHXi5rXEIvRbhiGPTFnVknT kYuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=x/G163upeNSOMwWbC0HI0kI5f+995W9o9VDACx6xR7s=; b=Rou8GUZCACx5880FRxpLbdj8YniZKYt8Q2FMFEhef+HOzFGhE+yixfg9YWU6WoudGI WNfyy3TrEWg9aBwr/AG+CMvtNv8vNUT+sHltKZRULoCwL/5e9q5zZsNhq3ffssHxOUJI TgdKPZRn4rW7gbbkASTxmNZVikN92gIb2cudK6rtp+dfl2FljG4cvwW5cmwUUWyT7kCe Vi11ECxaDJgYaP4nSJFjmpANZWrvYbQRVp2gQamsaAUnfFLM+ESPqwRB7TCyjPw+n3Fm AThkpFL3m77aTNvylATuC+NVsgeAmZcm7YmeX6O6YUZZEUGc2rzBmbrtIQeS+bFgGPox qmxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zZ/MnKpi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce18si4527764edb.26.2020.05.11.02.29.23; Mon, 11 May 2020 02:29:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zZ/MnKpi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbgEKJ15 (ORCPT + 99 others); Mon, 11 May 2020 05:27:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:48814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728260AbgEKJ15 (ORCPT ); Mon, 11 May 2020 05:27:57 -0400 Received: from devnote2 (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 21A6B206E6; Mon, 11 May 2020 09:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589189277; bh=oqgSUGP9MR8xZApzgNfSSeMcrgiWYjklZNtwHFxto4M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zZ/MnKpipz2Wmf+CG2sWYdc/PG4RRutTEk8EEmhSnamy+IWovmhTb7USVthxrPZhZ FD4akhu3sVoZL21TND/PgEFvujvBLJVGdha/iLWAxQ25UqHh+wg0Ge2XSXLTfVseSd VoXNUv5FTEWNN017WQ69dU8FGDElRT5npNqAjWPM= Date: Mon, 11 May 2020 18:27:52 +0900 From: Masami Hiramatsu To: Xiao Yang Cc: Steven Rostedt , Shuah Khan , , , Tom Zanussi , Li Philip , Liu Yiding Subject: Re: [PATCH 3/3] selftests/ftrace: Use /bin/echo instead of built-in echo Message-Id: <20200511182752.c83f3454bcb3e205cf2bda4a@kernel.org> In-Reply-To: <5EB8FD31.9020906@cn.fujitsu.com> References: <158834025077.28357.15141584656220094821.stgit@devnote2> <158834028054.28357.398159034694277189.stgit@devnote2> <5EB3AE7C.5@cn.fujitsu.com> <20200507181505.3e8369ee39f14d9c74ec986b@kernel.org> <5EB8FD31.9020906@cn.fujitsu.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 May 2020 15:22:25 +0800 Xiao Yang wrote: > On 2020/5/7 17:15, Masami Hiramatsu wrote: > > On Thu, 7 May 2020 14:45:16 +0800 > > Xiao Yang wrote: > > > >> On 2020/5/1 21:38, Masami Hiramatsu wrote: > >>> Since the built-in echo has different behavior in POSIX shell > >>> (dash) and bash, we forcibly use /bin/echo -E (not interpret > >>> backslash escapes) by default. > >>> > >>> This also fixes some test cases which expects built-in > >>> echo command. > >>> > >>> Reported-by: Liu Yiding > >>> Signed-off-by: Masami Hiramatsu > >>> --- > >>> tools/testing/selftests/ftrace/test.d/functions | 3 +++ > >>> .../test.d/trigger/trigger-trace-marker-hist.tc | 2 +- > >>> .../trigger-trace-marker-synthetic-kernel.tc | 4 ++++ > >>> .../trigger/trigger-trace-marker-synthetic.tc | 4 ++-- > >>> 4 files changed, 10 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions > >>> index 5d4550591ff9..ea59b6ea2c3e 100644 > >>> --- a/tools/testing/selftests/ftrace/test.d/functions > >>> +++ b/tools/testing/selftests/ftrace/test.d/functions > >>> @@ -1,3 +1,6 @@ > >>> +# Since the built-in echo has different behavior in POSIX shell (dash) and > >>> +# bash, we forcibly use /bin/echo -E (not interpret backslash escapes). > >>> +alias echo="/bin/echo -E" > >> Hi Masami, Steven > >> > >> It seems that only kprobe_syntax_errors.tc is impacted by the issue > >> currently. Is it necessary for all tests to use /bin/echo and could we > >> just make kprobe_syntax_errors.tc use /bin/echo? > > > > Yes, I would like to unify the "echo"'s behavior among the testcases > > instead of patching each failure in the future. > > Or would you have any concern on it? > Hi Masami, > > Very sorry for the late reply. > > We may not avoid fixing related failures after your change: > 1) We have to reuse built-in echo (do alias echo=echo) if we want to > test common_pid for histogram. > 2) We have to reuse built-in echo if some new tests want to interpret > backslash escapes in future. 1) yes, that's what I need to do for avoiding "pid" key histogram (but I think we should have better way to test it) 2) No, in that case you should use "/bin/echo -e" explicitly. dash's built-in echo doesn't support it. > Is it simple to provide two implementations of echo?(built-in echo and > echo command?) and then just apply echo command for kprobe_syntax_errors.tc? Hmm, OK, there might be another reason we reconsider this patch. - Alisasing echo (this patch) can avoid dash related issues but this also makes "echo" running in another process implicitly. - Using /bin/echo for backslash explicitly will be missed unless user runs it on dash, but it will keep "echo" in same process. So both have pros/cons, but your idea will be locally effected. OK, I'll retry it. Thank you, -- Masami Hiramatsu