Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1741516rdb; Mon, 2 Oct 2023 22:10:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDshaF7m0RPyfzM+TorfrsBVvwDW+UAtSb9OeMQ/d+3IB0DLg5sejQAksfKi6YdxneGJlJ X-Received: by 2002:a05:6a20:5483:b0:160:a980:1222 with SMTP id i3-20020a056a20548300b00160a9801222mr14113248pzk.53.1696309852585; Mon, 02 Oct 2023 22:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696309852; cv=none; d=google.com; s=arc-20160816; b=SnFYHsW7ucugr8Fw/f9QWkZIABPq/KS/JwSYJnTiqqPxl2B/tnLSOcV9ZN7n8ErB0/ d+P8lTvPJLLU9naTAgzSp3k6pQiJjgbFAPUXRDPaYfY0v5do8gZOiJH2THftg9gmYXlT o9TBrLOP7IxHWIA3rF45Q0zEKWUNaix2Rbx32/wuy/tbrQkDyHoPul8xFkAVRajmY4Vv I9vA7b6wUX/h0Ir2tSLH580zekYbsXLof/SYMNGdvsOKcxVMTZN2thx9gQHW/mdBcebA AjaY1Uh3cuN7dxn5KrGYIKQ8re8zngjpzBGnVieP785a7KHdRS3LZF5lDh0wbwswIc8Z X0cA== 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=nuCQrq07t28e/w8SE3k84A5e3jrsGC5/Njzxci1gOnM=; fh=PrbR9/zYfGrMjtFcq0Ws6gCws9l4P0YOs/0kQkJqD0w=; b=Q0f7tyElRcxwNBNwn3t4nn035DGN8A2qmoLrPxv810+Wxt5eC2zGQpib+/CiXPHEpX 2H1Qmi2a+7S56CR1Gm+eY3ZqRRs0X5mYp3JysKkZkPcVB0VxyQ4/e6WkSNx653WhDudB rMnPy//j903anH5rAXJen73JwcmXFok7MQbTdVDFof/0JzteUNAD/g9im0C3SFRdkoqQ IgHATmzP1KS4vdcPgLv4Tj7YAlzxnNtMPEKQeC1NPxztGyW9AS9gf4KgjLAFthoUsUkk t8IOVlG1xy5lxhD58naXkXj+coxQDn6fMUaXU1Wn/oDhX66TAmOW4XCI9y687I6i9qWg adow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vImCd6G1; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id a13-20020a170902eccd00b001c62d5b4e00si587502plh.508.2023.10.02.22.10.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 22:10:52 -0700 (PDT) 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=@google.com header.s=20230601 header.b=vImCd6G1; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EAFE98077A40; Mon, 2 Oct 2023 22:10:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239088AbjJCFKI (ORCPT + 99 others); Tue, 3 Oct 2023 01:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239122AbjJCFKF (ORCPT ); Tue, 3 Oct 2023 01:10:05 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99EA8E3 for ; Mon, 2 Oct 2023 22:10:00 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50348c54439so2109e87.1 for ; Mon, 02 Oct 2023 22:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696309799; x=1696914599; 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=nuCQrq07t28e/w8SE3k84A5e3jrsGC5/Njzxci1gOnM=; b=vImCd6G1Y+pKOMGE2CajqhHxMzgQHmJugXVu3fvu0SAGfc+M0NFkn7DcVlJpSjYuFU vM2EZkN7CNWLF/LIH1az4Gsz5u8F28APE6mfkCwKPpzRff3NWeWlwsxR2ZDh5lejsDCj Pl0bPQyJV7X46dAeb5TOfPiLy3tKrT/IvtY95XZaX9+j/eJvRK/5tBemBHms5a6h2TT8 TZkQkGoRooRxg6L2CU7Fycy4iBUCW8GQ/6Kdn7/jmm8hmzCohTz8PTUkZzgeLec2Yzbc Pe6VaRp3rZyPluUirJXpj6EaU3+F8U9WTK6pPzzT72lcrQpzMpaIpnADeD4G72675Syx DT6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696309799; x=1696914599; 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=nuCQrq07t28e/w8SE3k84A5e3jrsGC5/Njzxci1gOnM=; b=Qg4Vj4jPpBqOshl3J3rtO0C1fKgStPBd9b++DaauM75ZR72tBPGG64k3Ma4lV0RqLM elHsU1bRwG1OXYwMUQXoilyFMkjuxPnjvqKe6Nic481UKPdi+iuDTAPiXh614gyf5aP+ nu5NDilTck9yE+NbLPETy2GnGe8x9L+52hfoF8BFr5zGIA+wKjX00Pye6y8kIJgFdDvf E3Ah0GBMcL9Ye68hodku7fthR6ZC6GfrSdaSBSgaXVlDmaotX8lPoRNmQ7bTQ3HIEjFP NeZx9/JqKYL0mSWPgW7yNiJIZcatGdpTthvZlCvLry4cVgloHcssTihYdcUVkh5XwBlD 2rAQ== X-Gm-Message-State: AOJu0Yyjsyzu6Ls0TJbsTfvK20WbNPaFXbAh/+Ine5YiwAVhX3PIjXwP 3tLDe8cGFWAUrJ9Ys9Z77o32ElrFEq7P5OLeKXDt/A== X-Received: by 2002:ac2:4ade:0:b0:505:7c88:9e45 with SMTP id m30-20020ac24ade000000b005057c889e45mr57996lfp.0.1696309798688; Mon, 02 Oct 2023 22:09:58 -0700 (PDT) MIME-Version: 1.0 References: <20230930060206.2353141-1-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 2 Oct 2023 22:09:47 -0700 Message-ID: Subject: Re: [PATCH v1] perf test: Avoid system wide when not privileged To: Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@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,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 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]); Mon, 02 Oct 2023 22:10:17 -0700 (PDT) On Mon, Oct 2, 2023 at 9:47=E2=80=AFPM Namhyung Kim w= rote: > > Hi Ian, > > On Fri, Sep 29, 2023 at 11:02=E2=80=AFPM Ian Rogers = wrote: > > > > Switch the test program to sleep that makes more sense for system wide > > events. Only enable system wide when root or not paranoid. This avoids > > failures under some testing conditions like ARM cloud. > > > > Signed-off-by: Ian Rogers > > While I'm ok with the change, I wonder why it doesn't have the same > code structure as in the stat_all_metrics.sh which checks the actual resu= lt. > > Acked-by: Namhyung Kim The metric group isn't printed when we print the metrics within it. This could be changed. Thanks, Ian > Thanks, > Namhyung > > > --- > > tools/perf/tests/shell/stat_all_metricgroups.sh | 16 ++++++++++++++-- > > 1 file changed, 14 insertions(+), 2 deletions(-) > > > > diff --git a/tools/perf/tests/shell/stat_all_metricgroups.sh b/tools/pe= rf/tests/shell/stat_all_metricgroups.sh > > index cb35e488809a..f3e305649e2c 100755 > > --- a/tools/perf/tests/shell/stat_all_metricgroups.sh > > +++ b/tools/perf/tests/shell/stat_all_metricgroups.sh > > @@ -4,9 +4,21 @@ > > > > set -e > > > > -for m in $(perf list --raw-dump metricgroups); do > > +function ParanoidAndNotRoot() > > +{ > > + [ "$(id -u)" !=3D 0 ] && [ "$(cat /proc/sys/kernel/perf_event_parano= id)" -gt $1 ] > > +} > > + > > +system_wide_flag=3D"-a" > > +if ParanoidAndNotRoot 0 > > +then > > + system_wide_flag=3D"" > > +fi > > + > > +for m in $(perf list --raw-dump metricgroups) > > +do > > echo "Testing $m" > > - perf stat -M "$m" -a true > > + perf stat -M "$m" $system_wide_flag sleep 0.01 > > done > > > > exit 0 > > -- > > 2.42.0.582.g8ccd20d70d-goog > >