Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp856079lqb; Fri, 24 May 2024 16:24:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFmcKgfBgevlNITp5MKM3iYHHjcRq4CK1mpbTnYmC8zyGrQqdbaWg1dUGxaV35oX1aIXaRe20YFf0kCehI0zirw7SoXtH1nrcbPJdLbw== X-Google-Smtp-Source: AGHT+IF+NacmK7lwaW48U90p2X4PK/S2ooxCmTrZZ/vYcqLGGGbTK6icwwed2ASPt9E7NPjR8dh8 X-Received: by 2002:a17:906:3695:b0:a5a:7cfe:30e9 with SMTP id a640c23a62f3a-a6264f01e40mr242999066b.49.1716593065971; Fri, 24 May 2024 16:24:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716593065; cv=pass; d=google.com; s=arc-20160816; b=aD49M0s2d94EDj6iL6URH8OEsXLwdGXmaDv5cO/zZgjeQWcqBO+GfVPGgMJFTyX5fS zdne5kIBHGt6H8hkcFUdAgLzX0Zh7+NFvZXhecl1wipDr/CV3XVqIPqyLzkWNskxmpEm 89AMtn5M1L50YCNcN7dAOFkrK3X0cZ/7F3YCw+gqHqiqrtoc/BDZsi7fRzsT3RBDSku/ h+lopMneG67w30nhFTHh/McFWa3xB9c+g8R4oS/4tiFd1tBzJovTUFlwuOvyS57B43hk By1KbQNkVNDtQNnDSRN/3+21/9IUjeZV1sAgpoxFKLg2U+/DPBsrpug+BX7sHa8jzrJB UQBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=Jo/txYd16OxYeeZkLVhwLQWYv1aQLPqjfT1NvKfIevM=; fh=UUOcRdcQMOgM4ONK6OKG4dmPKDh7TRhCP7ITvRyNOQY=; b=PTOu1Wb++dZjdht1LAOzt9NfItE2ODwShweIHrr01kwkqzHBkM+eRbu9FYRyo6YfT4 UGrJbydcqVCoAwKx2TcmTTWsEQDDyw2QtRbgfXb5oNJZ0td7XRORJVvN+kHuBKAzI/7f qFvn388IQEUwk6RulYQqt65kTzoNivEOQsnTYCRAc0ZJdmVB+gaFOn8BbVRtUHbpwqxf e2Rbb4GHnNFrAFNLxyd/uS9XzAdOgD3dpTRVD2vMDgbCvnMloN2UvaJezD3QqzAxWK61 aePw9xIwwGPbM+KrxManPC/B8EiCJ0j5R/rwG6+s4g6fnXEY3tlDKCQmWWIra6F/NzUD EtoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-189188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c800fffsi120354366b.7.2024.05.24.16.24.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 16:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-189188-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B0D6F1F222DC for ; Fri, 24 May 2024 23:24:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1555715886C; Fri, 24 May 2024 23:24:18 +0000 (UTC) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A1C885936; Fri, 24 May 2024 23:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716593057; cv=none; b=chq4SgdhhnUVKlYsWZPEPCxJHgzmz9hdyKMa3xfEy3lHNrZkvx7dlx6f5ojqolR/QBAv43VHClebu3z9V8wI62hW2WEkhUOAqYiaS93lwOzBGcoN0lgBvk6ltAeKl3pSYsr0soUbxhrVON12I9HKMxQsNZZ3hrNu6Jb6h6nbmmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716593057; c=relaxed/simple; bh=jeGSZEblFR9O8TVzYhKnPHfChmV2IuXAfaybcxlkpZo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tFXa0eQ5TXiS3bmURqAi3J/uM4/oqSqx91CcsRZ96o7iWcTs7Ly+Vs//GTPH7whHoLLgM2I1uhl1VQ5yzEFrX2yFSy7lKtme6Mmze2kb6nWLXwSPW+2ImvnzsbTbbc/Id0D5inNZVs96/XIgrcTzrqwmCYgiWIBsiXl1CeNpCRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-681907aebebso1038691a12.1; Fri, 24 May 2024 16:24:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716593055; x=1717197855; 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=Jo/txYd16OxYeeZkLVhwLQWYv1aQLPqjfT1NvKfIevM=; b=ekN3csE0xENgciMILa0X4YgEIHQ3N4LnbDlOTNddjpRh66YHV/v0Q3klVF3T3eVded XFoqSo+nl2FnYDMIJvcHcUIG06UBAyr19ajvPJk+qAv7ylSt7VSLnyCbcGeHUfoAB3fj V56zQU3+dW4CALx0GzhFgCE4A4iOVrKB9fr7NIQZb+4FDHPVPY4r0F9go3x3KDZ4zQ/s xy6wGsLti8zVFJ9SNRwij3UFzFP+4Vy1muiWM8qdMW3aA1ezuNQhBG6+mXv/D/nlcpkv rBKLFwQ8ZNRtM/WLCrdypS/jZWQph58CqwQc5MlmNd+PdeYcPFPBocrtc5kVcMm4XabI jX/A== X-Forwarded-Encrypted: i=1; AJvYcCX2vTojkQB/QUiMhdVQ/0lHd5lhFYWWYNbUTPTP7MrYIPiIwPcTekAITs32IxQe+F4Nz4orUi/V34XU4YeB3Z7oc5JiSjCNnEm1zchsAseaFyNk1bo4ff/Gtb3RGUc3vioXFauplMCe7sdszNzg/Q== X-Gm-Message-State: AOJu0YzF1QaNGo/bEe4VcwlRWLhQobm7jE/RUuRDSUKKGGV9JBBPbzRm Zoyao1HQTpjUiK8pUr5NT78ZQq2CoBpHaZ3KpT16b5SQK/+R0080gsLwVmVvw43dCqCgAGs4zGZ xc2bkCthwQSrSyCfby+RBBi1vqW0= X-Received: by 2002:a17:90b:1bc4:b0:2b3:5d8a:a13f with SMTP id 98e67ed59e1d1-2bf5f7547a7mr3282122a91.47.1716593055660; Fri, 24 May 2024 16:24:15 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240521173952.3397644-1-weilin.wang@intel.com> <20240521173952.3397644-8-weilin.wang@intel.com> In-Reply-To: <20240521173952.3397644-8-weilin.wang@intel.com> From: Namhyung Kim Date: Fri, 24 May 2024 16:24:04 -0700 Message-ID: Subject: Re: [RFC PATCH v9 7/7] perf test: Add test for Intel TPEBS counting mode To: weilin.wang@intel.com Cc: Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2024 at 10:40=E2=80=AFAM wrote: > > From: Weilin Wang > > Intel TPEBS sampling mode is supported through perf record. The counting = mode > code uses perf record to capture retire_latency value and use it in metri= c > calculation. This test checks the counting mode code. > > Signed-off-by: Weilin Wang > --- > .../perf/tests/shell/test_stat_intel_tpebs.sh | 27 +++++++++++++++++++ > 1 file changed, 27 insertions(+) > create mode 100755 tools/perf/tests/shell/test_stat_intel_tpebs.sh > > diff --git a/tools/perf/tests/shell/test_stat_intel_tpebs.sh b/tools/perf= /tests/shell/test_stat_intel_tpebs.sh > new file mode 100755 > index 000000000000..4cb749d84367 > --- /dev/null > +++ b/tools/perf/tests/shell/test_stat_intel_tpebs.sh > @@ -0,0 +1,27 @@ > +#!/bin/sh > +# test Intel TPEBS counting mode > +# SPDX-License-Identifier: GPL-2.0 > + > +set e > +err=3D0 > + > +# Use this event for testing because it should exist in all platforms > +e=3Dcache-misses:R > + > +# Without this cmd option, default value or zero is returned > +echo "Testing without --enable-tpebs-recording" > +result=3D$(perf stat -e "$e" true 2>&1) > +[[ "$result" =3D~ "$e" ]] && err=3D0 || err=3D1 > + > +if [[ "$err" =3D=3D 1 ]] > +then > + exit "$err" > +fi Probably you can just do [[ "$result" =3D~ "$e" ]] || exit 1 > + > +# In platforms that do not support TPEBS, it should execute without erro= r. > +echo "Testing with --enable-tpebs-recording" > +result=3D$(perf stat -e "$e" --enable-tpebs-recording -a sleep 0.01 2>&1= ) > +[[ "$result" =3D~ "perf record" && "$result" =3D~ "$e" ]] && err=3D0 || = err=3D1 Ditto. Thanks, Namhyung > + > + > +exit "$err" > -- > 2.43.0 >