Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4884550rdh; Wed, 29 Nov 2023 13:38:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnzCV4w6aXA+f32K6YPLQbRZ9H2xrVRAa1Tl6mx3SzZAMR0EHzOwrug2S2dBwyHi4MX1Al X-Received: by 2002:a17:90b:3807:b0:285:e16c:fb0a with SMTP id mq7-20020a17090b380700b00285e16cfb0amr9596593pjb.4.1701293913548; Wed, 29 Nov 2023 13:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701293913; cv=none; d=google.com; s=arc-20160816; b=z/bNZUzur8luIY70d7hvCg4VJjbu226BQUCHXglSGyAOhHgsELyn7FLNO44ptkTLPX M0iZk4/JfAM0kc6k1p6ZAikh5ItT0PyekfS7/civqz6h4IVn9YQoD4DVFn501892iavf n1lktnBsOYsXvL7QlsvkFAAujfLn3cB62ChabYDcDzGHhyZDpBAMjxnKvJ3xUjlhT52S vSGWpVrhUfIeNIMLvDSX3udsE47uLs7nPUvQ7ebU3Qnckn89/tEC/JL7jsKDuYZ/kWSI ubjiGtJEdOSo9Q1TasfIqsSsnGGqBCzJQDD4Dvo6WoQPyfCcdxRo6CQLGf/KV8q1sVE2 rlLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wy/DOxiHYGOEhpK16Bls8GJxdkJJyBiBMP5pgr/S1pE=; fh=yZIbqSKaY5qsizS1bfquGzFzxsM2gxLh+of7j9V8h+M=; b=Cf8ML5ZGUGhIXCyqpVnIVGD4vajTCg/2/gqt0pY55I4nvinPK1AnK5z8lPCHKrrbfy pF5xso0eafBT7LOcd26O1zZbgFiMD4HaCtZKOQjhWbdh3B/PCklIftfyiQQBwamzwojE ke27avddKdG30CEcCFQLe29XNwVQ6+AgkFVNWvZCznKF0OwpXcu9xFwELeO47EarQGYg ficUCkhdxT534+dRO3UeI8IwL63IMZ0znWxRjLGY1c8YhTbSiGzpKo867+RmR46qVIX+ q0eU+ix3TXKh9Abjy904Jb6DragJkmf0AcQfk4vFiF9htUYXgmJdHqcot6t6aVDVJGod 4Mmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=h5QU13l3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id lk15-20020a17090b33cf00b002810355fb4dsi2110161pjb.107.2023.11.29.13.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 13:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=h5QU13l3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C251081F35A1; Wed, 29 Nov 2023 13:38:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234257AbjK2ViC (ORCPT + 99 others); Wed, 29 Nov 2023 16:38:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjK2ViB (ORCPT ); Wed, 29 Nov 2023 16:38:01 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD7695 for ; Wed, 29 Nov 2023 13:38:07 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-548ae9a5eeaso1013a12.1 for ; Wed, 29 Nov 2023 13:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701293886; x=1701898686; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wy/DOxiHYGOEhpK16Bls8GJxdkJJyBiBMP5pgr/S1pE=; b=h5QU13l390tViRGxSa68EluVR2+FUcht2vqNklPF6P4G3/DlluLNgDh3WHugkAJdF6 yM5V0+e5rWLQUfy6++W1EAmVoE+yrVKN8oNtr3f5CNxKC7dgIyTBSAuWP3r+as3k97gM RJMAjoEKZuaGWoC7ysMqWnPvTqotKTzN+sJNKzgCHi7pRegsjP+4BRRpIXu+XEvYfFqP VoYHZv39qV9iE6p2AaRc91E+D9EhzNzZTbEvQIeJLg12jusyhxDfPTLXF9rwdet1V7eu 4uUO8UpXPCfmWv4xR8XmW1A1ggwm2teARzAgTnz1+0LxZHzP+st6s93xyq1hJXQ9+O4j SABQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701293886; x=1701898686; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wy/DOxiHYGOEhpK16Bls8GJxdkJJyBiBMP5pgr/S1pE=; b=OKHN+RK82ARKIVX+bbtsVEm7LB8OC49zkxLFiF0gUlWpqfwsTOq/qdWrwTo12y6G7A qX7Iw8Js2rMDNRmlAkKZAwdQlcI3+yeTUloE9Dg3aZJIxlZsybgCPu5tq2izYGdgY/Wc P9bwKOJA/4OsBgF0JI6gTUHFmWIpqs7FRRiLxzpFcOT16a+gkl7l66GC7BfVGqgE9jHb C2AUZ6onH1tPuXa8w1rrVlIsGwfTAiOYlrAuRcqQwVYeOg3l6KOwjddXNAPsvoOpZNNo gPeB4CLmRn00mIMd3e/7hq2MtvgYFSYf1QJimsUtZJLpCb+GSTBzm6FprbpM7ayku9sN z2gw== X-Gm-Message-State: AOJu0YwRaF/A8hEoDYfJyRj7tvi2mbLjKnHY4tA+nEvwMVGGv1YffvZw CBibXo5gdb1mC5Ia4EfHP2X8x9ixTl9LCXUnOwHZAw== X-Received: by 2002:aa7:c6c1:0:b0:54b:8f42:e3dc with SMTP id b1-20020aa7c6c1000000b0054b8f42e3dcmr40148eds.2.1701293885558; Wed, 29 Nov 2023 13:38:05 -0800 (PST) MIME-Version: 1.0 References: <20231129081004.1918096-1-irogers@google.com> <20231129081004.1918096-2-irogers@google.com> <03b314c6-ed6d-ae17-5bc5-0170139f7feb@arm.com> In-Reply-To: From: Ian Rogers Date: Wed, 29 Nov 2023 13:37:53 -0800 Message-ID: Subject: Re: [PATCH v1 2/2] perf test: Add basic list test To: Arnaldo Carvalho de Melo Cc: James Clark , Adrian Hunter , Athira Rajeev , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kan Liang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 13:38:31 -0800 (PST) On Wed, Nov 29, 2023 at 12:30=E2=80=AFPM Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 29, 2023 at 09:21:12AM -0800, Ian Rogers escreveu: > > On Wed, Nov 29, 2023 at 1:27=E2=80=AFAM James Clark wrote: > > > > > > > > > > > > On 29/11/2023 09:00, Adrian Hunter wrote: > > > > On 29/11/23 10:10, Ian Rogers wrote: > > > >> Test that json output produces valid json. > > > >> > > > >> Signed-off-by: Ian Rogers > > > >> --- > > > >> tools/perf/tests/shell/list.sh | 29 +++++++++++++++++++++++++++++ > > > >> 1 file changed, 29 insertions(+) > > > >> create mode 100755 tools/perf/tests/shell/list.sh > > > >> > > > >> diff --git a/tools/perf/tests/shell/list.sh b/tools/perf/tests/she= ll/list.sh > > > >> new file mode 100755 > > > >> index 000000000000..286879a9837a > > > >> --- /dev/null > > > >> +++ b/tools/perf/tests/shell/list.sh > > > >> @@ -0,0 +1,29 @@ > > > >> +#!/bin/sh > > > >> +# perf list tests > > > >> +# SPDX-License-Identifier: GPL-2.0 > > > >> + > > > >> +set -e > > > >> +err=3D0 > > > >> + > > > >> +if [ "x$PYTHON" =3D=3D "x" ] > > > >> +then > > > >> + if which python3 > /dev/null > > > > > > > > 'which' isn't always present. Maybe > > > > > > > > python3 --version >/dev/null 2>&1 && PYTHON=3Dpython3 > > > > > > > > > > Now that we have shellcheck integrated into the build, we could enabl= e > > > the POSIX mode test which would warn against this usage of which and > > > suggest the alternative. > > > > > > At the moment though there are several other usages of which already = in > > > the tests. And probably enabling POSIX mode would come with hundreds = of > > > other warnings to fix. > > > > > > I'm not saying we shouldn't change this instance though, just adding = the > > > info for the discussion. > > > > Sounds good to me. Fwiw, the instance where I lifted this code was: > > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.gi= t/tree/tools/perf/tests/shell/stat+json_output.sh?h=3Dperf-tools-next#n12 > > > > With this change: > > ``` > > diff --git a/tools/perf/tests/Makefile.tests b/tools/perf/tests/Makefil= e.tests > > index fdaca5f7a946..06de6d3f4842 100644 > > --- a/tools/perf/tests/Makefile.tests > > +++ b/tools/perf/tests/Makefile.tests > > @@ -1,7 +1,7 @@ > > # SPDX-License-Identifier: GPL-2.0 > > # Athira Rajeev , 2023 > > > > -PROGS :=3D $(shell find tests/shell -perm -o=3Dx -type f -name '*.sh') > > +PROGS :=3D $(shell find tests/shell -executable -type f -name '*.sh') > > FILE_NAME :=3D $(notdir $(PROGS)) > > FILE_NAME :=3D $(FILE_NAME:%=3D.%) > > LOGS :=3D $(join $(dir $(PROGS)),$(FILE_NAME)) > > ``` > > > > shellcheck now runs for me. I'll try adding the posix check into the > > patch series, as well as fixing other instances I can see. > > So I'll wait for a v2 for this one, ok? Yep, sent: https://lore.kernel.org/lkml/20231129213428.2227448-1-irogers@google.com/ There are 2 fixes, one for perf list and the other for the shellcheck log file building stuff. The shellcheck stuff took a little longer PTAL. Thanks, Ian > - Arnaldo