Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1319527pxb; Thu, 16 Sep 2021 05:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzERdxcycnbNTZpUh+LrdD573XXDB5kNuj2D0oNKJCAl8sY9JiA8UN3JYfoMssXh1E0Lv+H X-Received: by 2002:a6b:3c16:: with SMTP id k22mr4105919iob.130.1631794038817; Thu, 16 Sep 2021 05:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631794038; cv=none; d=google.com; s=arc-20160816; b=udK5kMMPyCf6Cre9H9JfDHIb5SED5lRM7rhbMcK+EntQz51FROMbuEypjaqpEbP2zS aaPPyn/lr2eA0aCQal6QjBIXjsqJNGipatjwXXsS0/jRhVJXm6VunKA0JLGICMx5bM2h WcGewPE2JCfpHqW6R6vgFLnaLWu0/sYqVK4ZhdRXVR9ihltNW83GkDPRpQpNBNvWdXfW b/TrUe5eCRo12Ll7o/RcV1eVuJ8eKT6qcGnkzJHFvBimYDgx91Bl0LFet/gqml4kov/+ jCotlmqRcw/yzqKPj6QW58PBE3s2PmfMa0Ff8sY39UdiukzExPs7FHnPXR8mfaQDB/2R 19dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5RhjU+LEmgORcq/vv2e0IOKZ6jh2ZKtBlLhFlAHPRHg=; b=FfvYhaTKwR8P3qs8hw/idxblrDcd8mHb2OpOz1TLr9WEPtddi8E/xRybYrfy5eWF8L 7TswjqJBrZdcrZQlJQWY0+Pwuh4EfnJCJMuFW+pteNLFw+ebTS9hTVbs4KRIwyKGMEKx 8s8CZOOP9K5bC7QYcPHOdeHCzaKdFwZgfe8mX+W2U/tqKfDCPfLU2HamucyXRjj07Erh CMksYnpLH1yudrN/anbdvu2gWLxwcpMsB2I7/4Zh80N+oz0xw/qEVBy7Ot7rTRIgleFN CjRB6dADDsPzNxTHGk3WKceSO8M2yGUijLEbE/RtfN+3qqm8k++99cVeXv4YX50SjV/1 6wbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GHxjWi0A; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q74si2817239iod.9.2021.09.16.05.07.04; Thu, 16 Sep 2021 05:07:18 -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=@ibm.com header.s=pp1 header.b=GHxjWi0A; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239012AbhIPMGR (ORCPT + 99 others); Thu, 16 Sep 2021 08:06:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32444 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238974AbhIPMGQ (ORCPT ); Thu, 16 Sep 2021 08:06:16 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 18GBokCc011984; Thu, 16 Sep 2021 08:04:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=5RhjU+LEmgORcq/vv2e0IOKZ6jh2ZKtBlLhFlAHPRHg=; b=GHxjWi0AyL+1vvNb7be9plmfgeSx9iPty/SNXCP7Ah0PYh/MLaKRxVTdnkZDvwVOmfcj 5/AqtcO2CkGgLKgRoqEJahbXoF6E5qsi0dPTaM+QI5l70nV4Lo8jXvuGh+/nzsBpiKyI ujvdhfsUk+PtkhwJQql888ydK7g8/Tn9CbVeb07nm3yORXGAzwD3UMkBXeuk/oTIMQrG sLY0Vfrt8ILxhtsCWG/JHQ9Mf16fdElDAC4/0zTPMiUc1ug5DHe28gStaOhBpBPf0EVd YkFo/8iWBRq1QP+WSF3ANxv+Voa1oZA2+94018gYlpNRdrFxl4dO3gA5+wsFt054xReg Aw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3b44r3hb65-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Sep 2021 08:04:39 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18GBpAOe018953; Thu, 16 Sep 2021 08:04:39 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 3b44r3hb5m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Sep 2021 08:04:39 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18GBuu0s027838; Thu, 16 Sep 2021 12:04:38 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02wdc.us.ibm.com with ESMTP id 3b0m3cgswa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Sep 2021 12:04:38 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18GC4cSH22086012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Sep 2021 12:04:38 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E032528067; Thu, 16 Sep 2021 12:04:37 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F378A2805C; Thu, 16 Sep 2021 12:04:35 +0000 (GMT) Received: from li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com (unknown [9.160.174.53]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS; Thu, 16 Sep 2021 12:04:35 +0000 (GMT) Date: Thu, 16 Sep 2021 07:04:34 -0500 From: "Paul A. Clarke" To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Jin Yao , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, eranian@google.com Subject: Re: [PATCH v2] perf test: Workload test of metric and metricgroups Message-ID: <20210916120434.GA4498@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> References: <20210916060525.1890638-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210916060525.1890638-1-irogers@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QZlgmHlhqgc6bOwf_oeWkoIU_-VfjeQS X-Proofpoint-ORIG-GUID: WhGUe7YqOAMBCriT8Gea9tpvtlqe3mrk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 lowpriorityscore=0 clxscore=1011 phishscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109160068 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 15, 2021 at 11:05:25PM -0700, Ian Rogers wrote: > Test every metric and metricgroup with 'true' as a workload. Good idea! (However...) > Signed-off-by: Ian Rogers > --- > tools/perf/tests/shell/stat_all_metricgroups.sh | 12 ++++++++++++ > tools/perf/tests/shell/stat_all_metrics.sh | 16 ++++++++++++++++ > 2 files changed, 28 insertions(+) > create mode 100755 tools/perf/tests/shell/stat_all_metricgroups.sh > create mode 100755 tools/perf/tests/shell/stat_all_metrics.sh > > diff --git a/tools/perf/tests/shell/stat_all_metricgroups.sh b/tools/perf/tests/shell/stat_all_metricgroups.sh > new file mode 100755 > index 000000000000..de24d374ce24 > --- /dev/null > +++ b/tools/perf/tests/shell/stat_all_metricgroups.sh > @@ -0,0 +1,12 @@ > +#!/bin/sh > +# perf all metricgroups test > +# SPDX-License-Identifier: GPL-2.0 > + > +set -e > + > +for m in $(perf list --raw-dump metricgroups); do > + echo "Testing $m" > + perf stat -M "$m" true > +done > + > +exit 0 This always succeeds. Is that what you want? Maybe check the return code from "perf", at least? > diff --git a/tools/perf/tests/shell/stat_all_metrics.sh b/tools/perf/tests/shell/stat_all_metrics.sh > new file mode 100755 > index 000000000000..81b19ba27e68 > --- /dev/null > +++ b/tools/perf/tests/shell/stat_all_metrics.sh > @@ -0,0 +1,16 @@ > +#!/bin/sh > +# perf all metrics test > +# SPDX-License-Identifier: GPL-2.0 > + > +set -e > + > +for m in `perf list --raw-dump metrics`; do > + echo "Testing $m" > + result=$(perf stat -M "$m" true) I don't think this is doing what you want it to do, as it just captures the output of "true", which is always empty. > + if [[ "$result" =~ "$m" ]]; then So this always fails to match, and you'll never fail here, either. :-) > + echo "Metric not printed: $m" > + exit 1 > + fi > +done > + > +exit 0 You may want to redirect the output of the "perf" command to a temporary file, then grep within that. And, you'll need to remove the file before running the perf command, because if it fails, it will leave any existing file untouched. Thanks! :-) PC