Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3242941lqo; Tue, 21 May 2024 10:41:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUb5ih+CIYKiZlJ0ii2+agj0dWv3uoGdyI1TTjCCOfgw9pCVj2uNUgYh1wOfE4oMHUceBDE/6MBYDgH76SRVBmb9m1lvL3lCg4RpfNb+w== X-Google-Smtp-Source: AGHT+IFGfD5jIaHu1YYsw1P7jvOPMHNUL7jA8h5eM8zJVZimtKuwzRwMiBFiEvDHgKTcJA24wBXT X-Received: by 2002:a50:cd41:0:b0:574:eca8:631c with SMTP id 4fb4d7f45d1cf-574eca865a6mr18013741a12.1.1716313290812; Tue, 21 May 2024 10:41:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716313290; cv=pass; d=google.com; s=arc-20160816; b=OWLz4gjjpIN4SUxOLljBDwxVZY+Lr0U4NeGXeEVrUqKt1WZMCmSqW7m0tZlWrP5s73 fmWsq3E84lpZnfTnH/F5y7sFfEpphZMxbHqnilaSkUplY537gZnnDwUpXc+EGg+oekUd iYW6uhgqZdD+yfsYCRMV6jJgbHGQU9PZP8fkoPd5TkJ9YucbzY8D0ym9tnKb4ctK+Fgo Yy2RG8xygnWvfSTVocGiQNJwbgwSOPHvX1CVrl04koXGaAeWRgBUNSFpHMj2t878M45K UgSHvOxgVOSrZmkfUMxlfo/Kaf0VP1w3Ratb38GCXlQjIsN4cBp+F+VBOila6x+s88nM 257g== 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=wOn/7Mrz6zyk/Y7aVbKZF8dYRI86rhIqrPzPpNb3Y0M=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=bgH3Ihv6qCGlUMu2gp0AjW/M2SaWhYjmk4U2F7mFgtlHoSx3fv9DgMdO8+poXxPiM0 U67LN/rMw6OOQv7T+V3OpTsSMB3oH3FFGc57IC4cOIWYxWtubcsJhqarhw1an8kjw+By nFcnUwSzPZ9JTwz3M67YhXOIbOX0r+8/+qLIFx6NpboPYvOja7XQYTAnGP02+/DLonsL 79RkVcWvZXLFtD+IJK9YE5uSDoUim2okSh4om6XaOfAfpEsWYucsBCZd87T1sX9sL+U8 6fpus0kwEXh1PGUafYxWjLw/oTi5Pv6jWUiX0r+FtummA7JupeSmV0qayuZ20H0HzydW GH/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gK3/DEUl"; 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-185286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185286-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c3270b2si14705609a12.358.2024.05.21.10.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 10:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gK3/DEUl"; 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-185286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185286-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 839BB1F2225C for ; Tue, 21 May 2024 17:41:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84F7A149C6C; Tue, 21 May 2024 17:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gK3/DEUl" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 08B751494BE; Tue, 21 May 2024 17:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716313205; cv=none; b=hCnTNJu489cPfRx8KBDdn7a4JhnBNz/UtUWmQFuLnH0JnpB/2OXTmtsVR4zWmoqVTMFUuJxmAphRTiVFqYrxG5xIiK0GXVbv0TbEty3XYZsdnz06alwxr9uOPizG91X3N7JHA+u9FS6pFa5AC5cJZNUm8q0/k2x8KjVroihoH3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716313205; c=relaxed/simple; bh=PiFk/rDzdb0k9fXo1Z/4A46tpxk4GHQ+W7cQvXeUXoE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i4frittgsRUgtkwpwLKtI8Yjp3kpeF7zAGhaOyhOf//imsIPx+78cICvUy2nkLaXVGvE8ic84pO1oaDGsUCKtjqv4S4SNBTaSrCjcbECrxAyTTFM+vO23N6e74ggL6AXXMQ1WF9/h0Zg+RyGVXxTWRxCSz+YXKyapfswjKugUz0= 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=gK3/DEUl; arc=none smtp.client-ip=192.198.163.18 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=1716313204; x=1747849204; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PiFk/rDzdb0k9fXo1Z/4A46tpxk4GHQ+W7cQvXeUXoE=; b=gK3/DEUlJxt6n2obSkrUdC3iAxAIhvdWxrikKpP/L/XEBZ0M0uP0sAOJ Xl6mLYDNruRyOPWygtAVc4J2yB3ljVuP7Zkp/kuk0NLNERZBpvaCs2xN7 5eOKS7R5vxsTtSuXruEbV7m0AEdwECRXGHFGI/EQlyLhgwr6hf1bHlKWE dmyGLmeyT7zmvesB34RXWZFC92Dh0PyUSY5SYiq37unRL3u2Lm0f+wAJ3 ClcD4yu30XnNZB3Et5roazmVGRrwUPS4qi7mpPSvfYYtzaij2QKpw/7wf WlC1MDDKYjtA4Zp0kk2dZyhTzbxEGa7/0gY3M2kfvejVS/6XzM8tUuKb0 w==; X-CSE-ConnectionGUID: ENQiNvWXTHC8AqA3J27QQg== X-CSE-MsgGUID: lOuyWQ//TTSIkgaTCCZ0HQ== X-IronPort-AV: E=McAfee;i="6600,9927,11079"; a="12317692" X-IronPort-AV: E=Sophos;i="6.08,178,1712646000"; d="scan'208";a="12317692" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 10:40:00 -0700 X-CSE-ConnectionGUID: dGowoYrIQSO46GNnnfXyag== X-CSE-MsgGUID: gbfxm/k0SEq6AJfmRnLO1Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,178,1712646000"; d="scan'208";a="32924981" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by fmviesa007.fm.intel.com with ESMTP; 21 May 2024 10:39:59 -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 v9 7/7] perf test: Add test for Intel TPEBS counting mode Date: Tue, 21 May 2024 13:39:35 -0400 Message-ID: <20240521173952.3397644-8-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240521173952.3397644-1-weilin.wang@intel.com> References: <20240521173952.3397644-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 | 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=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" ]] && err=0 || err=1 + +if [[ "$err" == 1 ]] +then + exit "$err" +fi + +# 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" ]] && err=0 || err=1 + + +exit "$err" -- 2.43.0