Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp454675lqb; Wed, 29 May 2024 00:00:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8zPguYEl5DleDSleQxDTjJB7utLWXEgDirLEihH4jiwPpCyx3jMYU2LThbJQu2G6u54eAGlXvbp88sbhBk/XPq7l53uyyxiUDYx779Q== X-Google-Smtp-Source: AGHT+IHATGxtHJ21YKuII7RVRW0DNNRQxBMul0KZ1wteWkUXWkwga+SkVMg2gNq4csUMx6aKzXJc X-Received: by 2002:a17:902:fa03:b0:1f4:7a54:49c with SMTP id d9443c01a7336-1f47a540615mr78944755ad.65.1716966046358; Wed, 29 May 2024 00:00:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716966046; cv=pass; d=google.com; s=arc-20160816; b=mFSBTO4NyK/pKl9IqvPNq6Gi443PX158RaEIouJmsWLckeII/RoHtdXg6R/+WtZdXj s6xUqjHm6j3W6ZMDEduubzg1nvnwgc6lxUD38yKZpu9DTM3DU1lUPDdOw68aIrqkTYBR z41KJz7kyBOHViNcD71vIKjrlszkvMUixkRH8Y3n7B4OGmy/qu+0pnKAWCm2nLY9LA6u jI1QWRcVhypCBT7NXSxKuvg7GDwSPV3pmN9QwfrGVZaM55mIsKpszWYBoL0re+H1lQpn Tw2Q/lv+h7nQvEDLDZFWbBH9B54UYMKjdMxJmmF+5Bj7/zs2Dq/9A040MLh52+sWZW46 FB8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rXCxjDT7zhhXGDAd8KzVrqB3kWxv9tnJZaUjES9ZYUs=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=Y5pVBOhKdGcLFAy8zW0S3ZIbWusHCB1jB8zgw99axMJN66sQwY3KaFpL2+5Z+EEoRE Nk/FpqnnKId+EZRIZ3MQ/8LXc+D3IaRpQT3ND/apJ9XjNP6nuUZVjzN3JRJOD8wLRXcn iAej9sJjvIQLwjGzVqsVvSCFE+fUmZgBmU3BngSprAyNZU5Wwjfnej5s4/zmyX9id7KO tbEZ91Yj51rRSSQQYPHSizRU3ZbvjRV+V0sgu2lhdgx3rs1X67/Qqzb38jFu48mDqU15 L79RvWuPpgBOKQmQM/G4aVD9AowC+wSi/9hvnR584vIckSLSN45EFPjx5T7DFkEF0Uhj AiJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C7sPyWma; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-193537-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f48af2145csi57462915ad.485.2024.05.29.00.00.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 00:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193537-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C7sPyWma; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-193537-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0DABBB25F33 for ; Wed, 29 May 2024 06:45:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F8E9168C37; Wed, 29 May 2024 06:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="C7sPyWma" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 274FC167D90; Wed, 29 May 2024 06:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716965022; cv=none; b=UpHn1JTxMm7FW9VPjUcIg7atbE0UD58TevRN0ZxKQ+FOr2DOdg8gZczKJq1/RZxO8L99D2udxWFqkhFSD5561T3qHe/kaZt6bCU9unFQYSmA6QEJWZqxnZ0MXnd6ss+glIxpaLADn8VI7Pa56/qWxH+wjV7C515D2cBWSOZVDDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716965022; c=relaxed/simple; bh=ZJYI/Pn9c1nDzAxqFDHF0oN1xE02kbwoHSmmnVXOVVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rvkwTAy46nwNiqUXAGHG2ANssD0bh6uXpklk+vOMyvMJtsCezhJzZbFGMZi/pW2YVhUERx7bMVO41d9Y9nvT75ahfrm5K63RLIuptN1jh3PpzExvvd/4LHge/rmrUWuVMwCLMWaPPRDniu+QnRLhTjUVZ52nos8IRmkgmH4Kcrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=C7sPyWma; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716965021; x=1748501021; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZJYI/Pn9c1nDzAxqFDHF0oN1xE02kbwoHSmmnVXOVVo=; b=C7sPyWmaTMfIvXJUdiC9I/A0+Vkj3PIP3reRlM4Shj3s89Xa3Kn0C5rU dCHZNuEreN1CDGRGrdz3O7Ar7EOt3tY8y4TjfCRRTdW+2DUWG8fGVzrfH B6q3urbJZM8XYfNcWNtCSjLhN2VAZqfINLkzg0ntgAuPH+NtOsNX8HXhz xynZ8EKJdoXqRsAUAfP6WIr+6jVwkESRYnYCTSR5ia97JRFINicZ30sVT e+RtjbHF8kkujR1AWE/GtQSJ7AeWZqC/Eo3miXcMHFtQkS8jr5HQFgnNY hy1P2s72dUtyevLfJOTooTP/IC4EwqNmFTZ+r6FVJ6HOy+NqKWCQZZFnx Q==; X-CSE-ConnectionGUID: bQ6Gk1cFRJKawu/SsGWQ9Q== X-CSE-MsgGUID: FPfEC3pfSbmlkhoYF42EbA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="16298017" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="16298017" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:43:37 -0700 X-CSE-ConnectionGUID: DcOZIanSRICRnKUFnk4nSg== X-CSE-MsgGUID: D6hk+r77R7O/YtI8vqsDhA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="39759336" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by fmviesa005.fm.intel.com with ESMTP; 28 May 2024 23:43:36 -0700 From: weilin.wang@intel.com To: weilin.wang@intel.com, Namhyung Kim , Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Subject: [RFC PATCH v10 8/8] perf test: Add test for Intel TPEBS counting mode Date: Wed, 29 May 2024 02:43:24 -0400 Message-ID: <20240529064327.4080674-9-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240529064327.4080674-1-weilin.wang@intel.com> References: <20240529064327.4080674-1-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-Transfer-Encoding: 8bit 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 | 19 +++++++++++++++++++ 1 file changed, 19 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..43f75055fee4 --- /dev/null +++ b/tools/perf/tests/shell/test_stat_intel_tpebs.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# test Intel TPEBS counting mode +# SPDX-License-Identifier: GPL-2.0 + +set e +err=0 + +# 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 -- 2.43.0