Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp138158lqp; Mon, 10 Jun 2024 22:36:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVofw7oePzC50fUgAqHYrUR02YpQBq+KFj1jNxgmzJKyncemV3PU7LyjzWjGtaN+s9of2xbPg7M6otvWLJWJvNArDp+XJsxAK8ZzkAevw== X-Google-Smtp-Source: AGHT+IFCYMJB391PVsalZ+Io0mr5jR055DMdfO6l9rDV8RJ/N4ShC0Dh+kTj42oNDi9+exxPkmk0 X-Received: by 2002:a17:906:150c:b0:a6f:eb8:801a with SMTP id a640c23a62f3a-a6f0eb884afmr452740166b.56.1718084210756; Mon, 10 Jun 2024 22:36:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718084210; cv=pass; d=google.com; s=arc-20160816; b=Xx0Klc9bJ61MikeL6MVAig2Be07YkzVHw8sugX5DgsCRQ68BT9VQt4TKXJMu5LYHC9 T7FLxqnyGhH0dc6LDbSudhU9YM0CoTDaj5MP0MwVRj1lYAgmKtDDHbJpVn5nwwKnFAYI J5qpdrqb3GqsuGXAXKnVBYAH1J8RRdEQUzD2epk/HIdElVelrGIcDLEWk2sFKM6Wslku 9V181KtwItKrElZoaFTvTlyWwmJ3cRv7hbhyyI+gajb1D+aXPzH85j03Vp/xECQloXaf IFCrFjy9bQ/PCQQ59+prylO8FD+uNSglhURxnhKKR11I5IY1BbKXEiPz8L/JiXcFHTVd 5OaQ== 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=bYwCHVRD+AEX7+/wez6R9JSRJXhRkT08+jGBBhqRsOs=; fh=7D8bWqELNqJM6KF7zbibUOya8038rGAdDMFXsJMRu8c=; b=0thyh0rHNFHqKNhcakRMcawzJqjy7Se1pUpg6Bc469EHsBKlpEGnZt/R8E1bABwxN9 9gXmH+/ujbbWGEj02n8vjttzMj9lwh7lEvB5IPcvtpAxo4CQaPLr4PXgzBXobHsJHyoC aSzDDvZDFPguBMw3AMAtp5aw7QeL3rBeflaYtQefLTJqqkrfJyt3jbgaeABqrp84jLiB J0nHCTnuuzCuy07ec6u0bO9jOveXibyw9Ks1gNasg9FJkVUIbqr9WGbqY9x0h4zbXHQI 2xHv5kB6A1dY9aOc5eLd+3mVYkbEYBAbTQjjPqMaqHQ78iSeeeOCm7os7FInDOpn5rhU QXFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=erUY1Ey8; 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-209278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209278-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 a640c23a62f3a-a6f0ed50b6bsi284526566b.55.2024.06.10.22.36.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 22:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209278-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=erUY1Ey8; 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-209278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209278-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 2D47F1F22EDC for ; Tue, 11 Jun 2024 05:32:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F380B176223; Tue, 11 Jun 2024 05:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="erUY1Ey8" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 9EEE4174ECA; Tue, 11 Jun 2024 05:24:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083452; cv=none; b=mcIYZOPoAryccl5Jo6bSZGv198Zdx0h1XhMaekZhVByVZ+yGQTfYtV/vxmp/DHqNs31nz5S9oQKr9wt6xvASF2m5W8U9h00xYPLh8px0rl/wm1KhC+7lYdU145d1uAzbRELEv/KF4WjMgZ1/muo+nrFU5cM5FG5F4wuaxr1BN10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718083452; c=relaxed/simple; bh=9rfkw6btWnuXeXgwlnlhpR/TPnJa6+KlRHAa2N3kdwo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rZ2ClyHXI8g1EsrHGS7tRi55y84wztYbBclMo8JKioKBTdUH1HEROqaE7eqKj/aoDKUjfeetrVwoqr8VveCYASNg/xN1L5YzBOWvdsyf0Sccr2cPlwlMgx129kqDOzXENkB+jPmC4hBzPteYUWrPubsJhaDd7MUIN6plL/m+MMg= 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=erUY1Ey8; arc=none smtp.client-ip=192.198.163.17 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=1718083450; x=1749619450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9rfkw6btWnuXeXgwlnlhpR/TPnJa6+KlRHAa2N3kdwo=; b=erUY1Ey801haGp6Rd596TALdZtRnVbYOqIoP2/KPXhf3FVvPQ4vbzGgJ pxbvbD7YTfl0l1r9uhb5qtlR7IbJ5CQXr6+IX+kO3sIokfsqsThxg7Ox2 qn8gsZkNvlnNyFmu8Kzs/X5qPc6VRFUOFWC1Y8bSNgMkBjJUYPxRy1bIu /2Q8e+2+693KsH6Tr3sU46pUkpGzf/zSrIPL8WeWITq29KnRasSwq9MG+ ANLhjE1oTb1E0pH7jU9Z+1PYhThS4FP9lBvX1hjfQk11fx1mo+5uY1JAj jU+y02d71NcZJlfUjwR8e2Y3mJMVUORWD5v90h0AJ+AjNuFmcDh1KLsjl A==; X-CSE-ConnectionGUID: 4SZvCM27SZiaRXBIS4ldxQ== X-CSE-MsgGUID: BlGf2WdGT9ySHIR2C3+RWg== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="14651158" X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="14651158" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 22:24:04 -0700 X-CSE-ConnectionGUID: +iOstIDST+a/9CsVe1bLeA== X-CSE-MsgGUID: zpTAIMa0QfOplUwsnNIuTA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="44441213" Received: from fl31ca102ks0602.deacluster.intel.com (HELO gnr-bkc.deacluster.intel.com) ([10.75.133.163]) by orviesa004.jf.intel.com with ESMTP; 10 Jun 2024 22:24:05 -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 v12 8/8] perf test: Add test for Intel TPEBS counting mode Date: Tue, 11 Jun 2024 01:23:27 -0400 Message-ID: <20240611052331.85715-9-weilin.wang@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611052331.85715-1-weilin.wang@intel.com> References: <20240611052331.85715-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 | 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 -- 2.43.0