From patchwork Thu Feb 8 11:31:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 198328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp101496dyd; Thu, 8 Feb 2024 03:37:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUZ2Slu7OWcT1LUrXc4G8KcDRYsdCHA+Gk9L5802TfX51q14rKUBUW3slI23V1nU/oOcYd2SO+Wvp2Iu0NLTNhxHv314g== X-Google-Smtp-Source: AGHT+IGMvdI/9Hfk748X8LlQSbH2gkEJNBnkMlbkQ+US7JegGo1SNPYZ//8tp5GWaNgydPcblvyV X-Received: by 2002:a05:6358:e481:b0:178:8ec9:a2f with SMTP id by1-20020a056358e48100b001788ec90a2fmr6838694rwb.5.1707392222807; Thu, 08 Feb 2024 03:37:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707392222; cv=pass; d=google.com; s=arc-20160816; b=UqfaKe5gzAYgTm2wjC/hJERGDdASPgtrFoJbS5lsAMUaKo41zjPsxRJTh3Boh5OkvV DbWpJk1pTnM0a1frEqxH2e+HFj3zv44avX4F7fhvC2c5+E5WVp4qG59LnULULr9P+CYQ XZPy3Wemv6tpJvd+hDHE1/UnhJ0Ua9fjtDzX7BXXJ9U+RbB6f821BJegD8bGPQiIu5Kx eKysebRmAFaMAPSW83eQ1BkLhTBDZkjfYg2WmJoSWMNU1bY4nOVyzovKIfallktpevsB aSNvgBPSAlqE3qAwi8QFKBsy5PSXb6xQWtJs7sL8XnGQlOKujGw2l3t0EaEuEzkLCWhV m0GA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=2sCpe1zfJJLCKweo+jv3p3iPTwl1AjjLkgZPtGcwXHQ=; fh=o1j1BWyIZGhKmtpyMXhrdRBgKrtZbVsCsRfjKTFJ4CY=; b=rEpRzd1rNiMMlRcT4oi1ilPiInA7hBUM0OfgrHNz8cpz0Lf6xsVtPXBfNnl6GR0R69 cMy1+JHu8ys85dsw9dxEN7c8qj7oY38BGwYo2NygNUW4crrfhAvGEwZmgY3BrTaIdBrg urk2lRCjaPhxBmGaaYErwORmMPywqnEhGR0C+RxMnwjkz6hIk9gMcbyVuteWV/cCw2vQ uWjyy0vyo1B/vN8AbkhKprn+PSg7s2LYi5ajKz1SCQ5FAJYJly/1vYB3tU1vs8CfqVUg DX70D3/OILnF+E4w9kN8OrhkM2eO9dtFp1pZmUs+PRV+XJje8EFHdY0PfqC8+2rkn/kp 1rGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EkO1fpun; 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-57972-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57972-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUSKrowVDsxQZrbEVcd3jfsH3j7gXW0e45UZY0yDvSNq3AQwcimnm/J/MNQr1PlYPuxxEcnrannQnWELP1qMgQxtaZm0w== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l6-20020a632506000000b005d81875c4cfsi3784678pgl.882.2024.02.08.03.37.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:37:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57972-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EkO1fpun; 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-57972-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57972-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CE7CC2850D9 for ; Thu, 8 Feb 2024 11:36:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69C1D78B51; Thu, 8 Feb 2024 11:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EkO1fpun" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 1FD6178B49; Thu, 8 Feb 2024 11:32:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391977; cv=none; b=bWM/vVSMPtbYWZosnVOHohrwnTOPly8BUwIoGisCE8QuLJhq5KLieMHXDQXFS6MRfpMoMTDLUg7rGEH1Kd1IlP9IGt20FJMA+XH0kbrlW5S0fvzKLdgHIz/PdrvcpLvHvkL0/cMlCdinsp4rfZkJzIL4D7HrsIC7FyHsIUt9UzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391977; c=relaxed/simple; bh=z/v40T43ha2hX1e8ZimPBiWM40ccC7SzSxwOXcvZwoA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sG1P5PrHXXTW5UMt0/gcLF9jtYmdrEttCx0BeKNef24hVoE3LO8XzYUgM0jar/6zUusRKA47coqPTnyV3tOkvw+GWtTyfFCVZASczlZUg2tUx0dYWtqwJQ2q969PsHC+WOqNjNQN/pdtvqiLZhi9pV7de5gN0+UmJECSmPXcRAY= 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=EkO1fpun; arc=none smtp.client-ip=192.198.163.15 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=1707391976; x=1738927976; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z/v40T43ha2hX1e8ZimPBiWM40ccC7SzSxwOXcvZwoA=; b=EkO1fpunqnrk9NBrQ1Tw5QA47SX4ICesqZYz2m5pSZtzPWaW6ppjw9pn XzzDXHhRZwxLu05c/SQCngpyQ7bswb8q6FkgJint9lguBuL4vOlwUtatX m3I/YG68DIyN2z7Nf5lxqp3cnj5CPhIY1j0wHoV5x/3R4iWIT/n7VDClv Z6kihpieUEQmjMXynEMBBif2xMQX+67fl7DJD565+69eCvrCfJhkxO6Jr j+5Fyzr+f5XaOCiXM6miB3VRFXEFpM6Hoh3B8VoILYN/VXzpN7LhgnTq2 kpRx3McM5l4lmUBp6w9CCBoHrirqvZ2OiMcfalsNS9uhqTmWiHzWQvFOT Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="1345804" X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1345804" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1957927" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.219.88]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:50 -0800 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V5 12/12] perf intel-pt: Add a test for pause / resume Date: Thu, 8 Feb 2024 13:31:27 +0200 Message-Id: <20240208113127.22216-13-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240208113127.22216-1-adrian.hunter@intel.com> References: <20240208113127.22216-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790330507865168174 X-GMAIL-MSGID: 1790330507865168174 Add a simple sub-test to the "Miscellaneous Intel PT testing" test to check pause / resume. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Reviewed-by: Andi Kleen --- tools/perf/tests/shell/test_intel_pt.sh | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh index 723ec501f99a..e359db0d0ff2 100755 --- a/tools/perf/tests/shell/test_intel_pt.sh +++ b/tools/perf/tests/shell/test_intel_pt.sh @@ -644,6 +644,33 @@ test_pipe() return 0 } +test_pause_resume() +{ + echo "--- Test with pause / resume ---" + if ! perf_record_no_decode -o "${perfdatafile}" -e intel_pt/aux-action=start-paused/u uname ; then + echo "SKIP: pause / resume is not supported" + return 2 + fi + if ! perf_record_no_bpf -o "${perfdatafile}" \ + -e intel_pt/aux-action=start-paused/u \ + -e instructions/period=50000,aux-action=resume,name=Resume/u \ + -e instructions/period=100000,aux-action=pause,name=Pause/u uname ; then + echo "perf record with pause / resume failed" + return 1 + fi + if ! perf script -i "${perfdatafile}" --itrace=b -Fperiod,event | \ + awk 'BEGIN {paused=1;branches=0} + /Resume/ {paused=0} + /branches/ {if (paused) exit 1;branches=1} + /Pause/ {paused=1} + END {if (!branches) exit 1}' ; then + echo "perf record with pause / resume failed" + return 1 + fi + echo OK + return 0 +} + count_result() { if [ "$1" -eq 2 ] ; then @@ -672,6 +699,7 @@ test_power_event || ret=$? ; count_result $ret ; ret=0 test_no_tnt || ret=$? ; count_result $ret ; ret=0 test_event_trace || ret=$? ; count_result $ret ; ret=0 test_pipe || ret=$? ; count_result $ret ; ret=0 +test_pause_resume || ret=$? ; count_result $ret ; ret=0 cleanup