Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4851643rdh; Wed, 29 Nov 2023 12:31:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGId2PoBqvfECaqeTeLVlWmFyWVJW2x/9qti8H0fKg224UTyQiUX/gGp7h05c7BjhXh5BzN X-Received: by 2002:a05:6a21:6da3:b0:18c:1e48:366b with SMTP id wl35-20020a056a216da300b0018c1e48366bmr18904246pzb.48.1701289895155; Wed, 29 Nov 2023 12:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701289895; cv=none; d=google.com; s=arc-20160816; b=DRBdKgjthfRY96fBxbPgEgNtudn/eBISgDhUrR+crekYaYOOCfMgS/xTFaJT+/O7aE +h6fzYDqTNd1Qp4Dmr2RNpiksZz1EpE3zUzP1tRhIzqP+zxALk3GpLzJaBQxQ7w+Ad6h x/W6Dz1Tw6ZtJocgiqgfYfL0cmEmq0WPGc+cvB4YlstkfgSGVs+s02aUqsmgmZw+S+hp mThtchA/kPOQhQcLr+xc0I26LXUO1dyAQKcseDR4q095m/wB1epwTd7uJvUqbkRs/uQr MBwcbSE8I5rsAjvyFHa2QWGyT4RZeo0LhAzqp8BCHmhv2QBW/QHIuWeCml/1lCSGaKnB gaVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Rcoa1QV6zIufPX3tLa5t2TvqBW9UIq/6izKqCi/hG10=; fh=Bba9W8LwQHUTOMIhipMYbKhiQ8zSqRmVkviTdgra8Pc=; b=Us2p1X1OeAhJwlqYxRGdgv0q7sVGVi+J1kAUAoHcrNlljDWlug+dhU5kfyM2K+Y/kE yaQbBXBnb3V9hu8Nn+WEI49Ow5+8KCJRYco18+McbtMcIz3jIWrsjtBB9zLNeJsi7wG3 iEJy88UyJ47//HwxeCCe0JQdb9lnueHwfX8JIPX4YnDTXlEjYE9f3Ap+gyShxJ+rrnLj AspRy61d4AiYKRrtlgHtQtUNh5WFQKqGxht9VynoiOmvoyQ2gD1fa73snF0n1ccsIi2F q4FDLQsUYCRIdBF0I7pMzULVpP462EeWSVrc71IRXNNqovmI0VsBjx8iD/4TAmwcPUo0 BEaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="frL0nD/G"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y11-20020a63e24b000000b005c623037c10si165345pgj.96.2023.11.29.12.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:31:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="frL0nD/G"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4776E8095648; Wed, 29 Nov 2023 12:31:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233898AbjK2Uaj (ORCPT + 99 others); Wed, 29 Nov 2023 15:30:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232601AbjK2Uai (ORCPT ); Wed, 29 Nov 2023 15:30:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E57DD67 for ; Wed, 29 Nov 2023 12:30:44 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A474C433C8; Wed, 29 Nov 2023 20:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701289843; bh=kDVqqhvS7fMT+IWmCg5HfszY7e3uXpelsi48BU7S+Ws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=frL0nD/GBuZLBlqS9AaNxXlTopyV8umDgZWa4jDEWA46BH7Q++/5ueTIpJzU6XZDV vRMPCFXPA9li0858dY4Bta3UtlgJpANTseqlwjLG52exFFE3KyAk9CUS0I8kq3D7Mo 1ixyF+sT+dXVwzCvjABZdcYiwTkrBp4oHnYg+M/EDsEu4XJyWP2uvvwoKBDbVP1Bvv KVu8IQYgBMM0TRh0TdrfFSqLUsftMcNp0Y/UDYAbGOl0YXUo1Mizb3/EMq3eD6zAZ2 qH8iX5u/zeDA8YBc8kGAq3Y0PNNgglDNpZfo56hdw2fnM8pGfTELN1UCm4W1utKt3t H/5SWbOEZTV7g== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 85D8A40094; Wed, 29 Nov 2023 17:30:40 -0300 (-03) Date: Wed, 29 Nov 2023 17:30:40 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers 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 Subject: Re: [PATCH v1 2/2] perf test: Add basic list test Message-ID: References: <20231129081004.1918096-1-irogers@google.com> <20231129081004.1918096-2-irogers@google.com> <03b314c6-ed6d-ae17-5bc5-0170139f7feb@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 12:31:04 -0800 (PST) Em Wed, Nov 29, 2023 at 09:21:12AM -0800, Ian Rogers escreveu: > On Wed, Nov 29, 2023 at 1:27 AM 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/shell/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=0 > > >> + > > >> +if [ "x$PYTHON" == "x" ] > > >> +then > > >> + if which python3 > /dev/null > > > > > > 'which' isn't always present. Maybe > > > > > > python3 --version >/dev/null 2>&1 && PYTHON=python3 > > > > > > > Now that we have shellcheck integrated into the build, we could enable > > 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.git/tree/tools/perf/tests/shell/stat+json_output.sh?h=perf-tools-next#n12 > > With this change: > ``` > diff --git a/tools/perf/tests/Makefile.tests b/tools/perf/tests/Makefile.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 := $(shell find tests/shell -perm -o=x -type f -name '*.sh') > +PROGS := $(shell find tests/shell -executable -type f -name '*.sh') > FILE_NAME := $(notdir $(PROGS)) > FILE_NAME := $(FILE_NAME:%=.%) > LOGS := $(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? - Arnaldo