Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1646548lqs; Sat, 15 Jun 2024 20:32:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJ8ihjKOxtoiFCU3g4AoHAL7vNv+Z6FUz4W0EW9nBkPh/AhioG0sb+RaqLjWRpUZ/LCgEnUr+BIO8VJaNUwPk8i35q7MaMu4rNpEd8VQ== X-Google-Smtp-Source: AGHT+IHkZdkOE+RuNMEH6mhw9gO30bMAyl+8zjWEq0JA+T67nFBgcP71tpp7f/9KmuHLuAwVoZ4A X-Received: by 2002:a0c:ed46:0:b0:6ae:2a6b:de8d with SMTP id 6a1803df08f44-6b2afdd29c1mr64031956d6.64.1718508758516; Sat, 15 Jun 2024 20:32:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718508758; cv=pass; d=google.com; s=arc-20160816; b=R//nSFHoah+q7DFIc2Yg101gz6DyAyhRxrnbwAzb4LgmO8IIQrERUbWxxxDO60sZ2w awo6Xyk70GCwyLOJKyp2NbjdS+NgdlzvGR8QHO1wcv/0mIGpS0dNgFxBVmhkx0Ga+rPK cXKFRIdnt0Zm1Ykru2bazaSXedpWpUjbCg54gUYADGCZLaQ3gf+gFsMDzudu/Io2s3vD mtGxItMmBm9Hk7fJdxLxUrFO8xNjFf4mEYAeFvi8M+Zv9+PMnXG2+QlMLkT9550r9tPg jK+M7LbreUD16lPFPbHtDBP2eEYIAJAs/mSU8fQr95f9TH3g/pjWC20Mpl+PEHFL92wk omKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tISvJgBhEfP+yACDcdf1qF8v6yjIU157XeSohtnzqVE=; fh=TwWKxRqMrWMZJ/dz6IssxkuSvbHFHHY/DI75PfXdMQc=; b=U7U529dg0rUrDsww71QoRGYY9Kxi1HzxAdiC4x646k2N6txQySNbxTTC5P1xTRLlvB 73T1pcPuxTbOge37DR/fun7NEBv1t6NiG5U7u8qiw7Apqi6UXqnL4PVNDw6FXrZ8BNxn VvhgxoXtEmYR5xgDbEnFY1qQTZDDxkunktVqO+GkFyIWjZuUYHApYg8jv38fW5zJJHxN Crlw6Dtdn+h/33s1BBTYqngNbcGasGpoL8dxTncEptCagSfZu62/cx4SYlikGaDz/DB/ QMHgE7kIa//IAF2SPFHCkPydjRHpPEFA80zAthdN7GFo7A/3ohUkwJfptRBcWtkK6rAn etUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JruMbUdf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-216103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216103-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5afd87fsi74475396d6.235.2024.06.15.20.32.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 20:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JruMbUdf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-216103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216103-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 418721C210D8 for ; Sun, 16 Jun 2024 03:32:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1D3416193C; Sun, 16 Jun 2024 03:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JruMbUdf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B883AD53B; Sun, 16 Jun 2024 03:32:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718508750; cv=none; b=ZNU/m+6wesaqXU1dYi6zxYgQzY7UTCZpr8iGrJ2nDoukCmOlCKf67N9XidUu/cVu866m3tOY0B4ZubCfqG8ITBz41xzyiuLBBfG5M3XpZ+bEnod2ykgq/FrnoDBz+UT4YIrl0jMdo3LGNIfKK0vU8RNQeMhheOcGxT0D3v1C8dQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718508750; c=relaxed/simple; bh=h2Rupb3bRR++IkyJmTxLp/G1ivGk3oFy6DUp33fuDJQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dBkIHNXaSLF4cS7iL7hOdiyXdJHme41SAp5072X6888nh9YVouk0/s7cM5+MOXd4/nh8jAAKLv5zoxPPpbcaME+zQYhpXhVLo80CYh4fhKD9J05J89hFYRyWMiEsmZv5f0WZojyCWB7E9R3Sr/ImYVfmR0kkx7AZt5SbR6bq5fM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JruMbUdf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1206FC3277B; Sun, 16 Jun 2024 03:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718508750; bh=h2Rupb3bRR++IkyJmTxLp/G1ivGk3oFy6DUp33fuDJQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JruMbUdfJQ9hvfk7YNxEY/g13sfle3Smr9l3hDu7HgWQhCkuacKMoKnbczDvXyZMf x7F+5cPGqSFbfvce/GvdNLgOBFWJ3OC/rQCrll2Bz0KBLNQ81wZGtlro5tAt7KAvMA S+bnCwsoH2C2GhTOON4ecldJT0/rgf6uwkccwCzSk2vUfOefoi1ee7p3Pg7MmqmepR orcGLddxVkCgcCaDEE9ydUVkF33gbLDFknxOG9GfiPCViVivCLjJDf67Y+WRdEX093 fQfxexOYcj2OQDaK36uzMeSwRh/qFCKg/II4E2KbgwndXxknOhwR9KinWI5M0/8AxY VvIRZBHp0HApw== Date: Sat, 15 Jun 2024 20:32:25 -0700 From: Namhyung Kim 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 Subject: Re: [RFC PATCH v13 9/9] perf test: Add test for Intel TPEBS counting mode Message-ID: References: <20240613033631.199800-1-weilin.wang@intel.com> <20240613033631.199800-10-weilin.wang@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240613033631.199800-10-weilin.wang@intel.com> Hello Weilin, On Wed, Jun 12, 2024 at 11:36:29PM -0400, weilin.wang@intel.com 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 metric > calculation. This test checks the counting mode code. > > Signed-off-by: Weilin Wang > --- > .../perf/tests/shell/test_stat_intel_tpebs.sh | 18 ++++++++++++++++++ > 1 file changed, 18 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..3c8763b39bd4 > --- /dev/null > +++ b/tools/perf/tests/shell/test_stat_intel_tpebs.sh > @@ -0,0 +1,18 @@ > +#!/bin/bash > +# test Intel TPEBS counting mode > +# SPDX-License-Identifier: GPL-2.0 > + > +set e > + > +# Use this event for testing because it should exist in all platforms > +e=cache-misses:R > + > +# Without this cmd option, default value or zero is returned > +echo "Testing without --enable-tpebs-recording" > +result=$(perf stat -e "$e" true 2>&1) > +[[ "$result" =~ "$e" ]] || exit 1 > + > +# In platforms that do not support TPEBS, it should execute without error. > +echo "Testing with --enable-tpebs-recording" > +result=$(perf stat -e "$e" --enable-tpebs-recording -a sleep 0.01 2>&1) > +[[ "$result" =~ "perf record" && "$result" =~ "$e" ]] || exit 1 This still gives me errors like: In tests/shell/test_stat_intel_tpebs.sh line 13: [[ "$result" =~ "$e" ]] || exit 1 ^--^ SC2076 (warning): Remove quotes from right-hand side of =~ to match as a regex rather than literally. In tests/shell/test_stat_intel_tpebs.sh line 18: [[ "$result" =~ "perf record" && "$result" =~ "$e" ]] || exit 1 ^--^ SC2076 (warning): Remove quotes from right-hand side of =~ to match as a regex rather than literally. For more information: https://www.shellcheck.net/wiki/SC2076 -- Remove quotes from right-hand sid... make[4]: *** [tests/Build:90: tests/shell/test_stat_intel_tpebs.sh.shellcheck_log] Error 1 make[4]: *** Waiting for unfinished jobs.... Please install shellcheck and check the build. I'm not sure what's the correct fix but it seems the shellcheck suggested to match '$' as a regex special character. You may disable the shellcheck if it's a false alarm. Thanks, Namhyung