Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1321682ybz; Fri, 1 May 2020 20:10:37 -0700 (PDT) X-Google-Smtp-Source: APiQypK3T1lmRxQdIplNCIO7OBll5/WPFHwr5w7cFz5xBT7aABnh0X3O9AVCcWEj28Naz/smYxkd X-Received: by 2002:a17:906:d143:: with SMTP id br3mr6146181ejb.348.1588389037376; Fri, 01 May 2020 20:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588389037; cv=none; d=google.com; s=arc-20160816; b=jgVLa4stM2C+O5AYJ/9kaDe8Hs7s4UySCC3JifM3mKkiIhOuQtTmDGCeJTMH3xgdAq NJH3tbWwb7zoHu0CEdkMzcudODCc/PG/QE+EZmacANIAQs4WjmNhn2z1DfGmQ6q1cwRZ 24lqiVHHa6fhrrUDmxXkftP7hbQZvyL574HdKAZQIB/ejqt/wQr0nwT4cP+ngVn+uz7A FSn8jGBUe6dd7gIuP0w0Jz+diFsoKWqfH7gGQWnNcfVsC1G2FEUSRQy3u8npxuFnY0l0 6DQkm8Mnen5ID4b+HE/Y2N2L/OJvUHaa47DY0CXyTAz0Q1H7D+lTAn+iBires+knPYeI gPGw== 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=UfHO6HjvfEtAClyrFGlKylhZ7t/1QNGxw2L/UKjM9vI=; b=ESQfdTE1YuzfTT7dJ4H876becXdQUQT5Ar+N0ojJ726SQId+jm2ERC4c1pa2z7vlZA GW7ewSLlgHqMo+OI/wXV2i9HapO/bbhM/axdAAVa39YJIOvz0qN1Q2OGVpIvAWVuxmT2 QMLgA6ejL/pTirOzWN4fC+dSBRXLe8itJCt3jEEPsEpHfMj0GKnetJYB+GkcYmBmWVGL 3iSoyhYWNlpARDvRX0UXufuBBv3Ykg/yzYBsRndsLd5R6tndYXAQxsMQ3u79Wu2/RWYr k/2WUi+Llq+IvRoda4ezVyUtrZ9phJx5pOJTNQ1P9m/Xlp8jg4UeGocGQySPCmloMIPr bIFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EBHU+MfU; 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 t27si2808362edt.42.2020.05.01.20.10.12; Fri, 01 May 2020 20:10:37 -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=EBHU+MfU; 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 S1726752AbgEBDIr (ORCPT + 99 others); Fri, 1 May 2020 23:08:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:33206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbgEBDIq (ORCPT ); Fri, 1 May 2020 23:08:46 -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 7CDEC20643; Sat, 2 May 2020 03:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588388926; bh=CVVzZMedAe8PdBduhRusdDDg5TkLXYOBqIOrAi/OAWY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EBHU+MfU3W/1OIbC5IeO5DS/aUfTleTjzlVdYqwiU2A56qhLp6gxrAHjEi1GqCe1D g1+ws0Yh3rJdba9K4bcy/y56KZ6ExbsYS5IAWcAJL5hjQ2hI5QVjbUZfFjPgkugdwk zYtonEgOJaXs5NfBCM/M3Y8BPd/Iw0qbIe7Tdy/o= Date: Sat, 2 May 2020 12:08:42 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Zanussi , Li Philip , Liu Yiding Subject: Re: [PATCH 3/3] selftests/ftrace: Use /bin/echo instead of built-in echo Message-Id: <20200502120842.9d93352083fb854295150235@kernel.org> In-Reply-To: <20200501101942.5c0da986@gandalf.local.home> References: <158834025077.28357.15141584656220094821.stgit@devnote2> <158834028054.28357.398159034694277189.stgit@devnote2> <20200501101942.5c0da986@gandalf.local.home> 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 Fri, 1 May 2020 10:19:42 -0400 Steven Rostedt wrote: > On Fri, 1 May 2020 22:38:00 +0900 > 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" > > > > clear_trace() { # reset trace output > > echo > trace > > diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc > > index ab6bedb25736..b3f70f53ee69 100644 > > --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc > > +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc > > @@ -30,7 +30,7 @@ fi > > > > echo "Test histogram trace_marker tigger" > > > > -echo 'hist:keys=common_pid' > events/ftrace/print/trigger > > +echo 'hist:keys=ip' > events/ftrace/print/trigger > > This is doing more than just changing the echo being used. It's changing > the test being done. Yes, I need Tom's review for this change. As far as I can test, this fixes the test failure. If this isn't acceptable, we can use "alias echo=echo" for this test case. Thank you, > > > for i in `seq 1 10` ; do echo "hello" > trace_marker; done > > grep 'hitcount: *10$' events/ftrace/print/hist > /dev/null || \ > > fail "hist trigger did not trigger correct times on trace_marker" > > diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic-kernel.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic-kernel.tc > > index 18b4d1c2807e..c1625d945f4d 100644 > > --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic-kernel.tc > > +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic-kernel.tc > > @@ -44,6 +44,10 @@ echo 'latency u64 lat' > synthetic_events > > echo 'hist:keys=pid:ts0=common_timestamp.usecs' > events/sched/sched_waking/trigger > > echo 'hist:keys=common_pid:lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).latency($lat)' > events/ftrace/print/trigger > > echo 'hist:keys=common_pid,lat:sort=lat' > events/synthetic/latency/trigger > > + > > +# We have to use the built-in echo here because waking up pid must be same > > +# as echoing pid. > > +alias echo=echo > > sleep 1 > > echo "hello" > trace_marker > > > > diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic.tc > > index dd262d6d0db6..23e52c8d71de 100644 > > --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic.tc > > +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-synthetic.tc > > @@ -36,8 +36,8 @@ fi > > echo "Test histogram trace_marker to trace_marker latency histogram trigger" > > > > echo 'latency u64 lat' > synthetic_events > > -echo 'hist:keys=common_pid:ts0=common_timestamp.usecs if buf == "start"' > events/ftrace/print/trigger > > -echo 'hist:keys=common_pid:lat=common_timestamp.usecs-$ts0:onmatch(ftrace.print).latency($lat) if buf == "end"' >> events/ftrace/print/trigger > > +echo 'hist:keys=ip:ts0=common_timestamp.usecs if buf == "start"' > events/ftrace/print/trigger > > +echo 'hist:keys=ip:lat=common_timestamp.usecs-$ts0:onmatch(ftrace.print).latency($lat) if buf == "end"' >> events/ftrace/print/trigger > > This too. And it's not explained in the change log why. In fact, these > changes look like they belong in a separate patch. > > -- Steve > > > echo 'hist:keys=common_pid,lat:sort=lat' > events/synthetic/latency/trigger > > echo -n "start" > trace_marker > > echo -n "end" > trace_marker > -- Masami Hiramatsu