From patchwork Tue Aug 6 15:55:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13755199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E166DC52D70 for ; Tue, 6 Aug 2024 16:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XaBTxXBw6KWOKhqqOSnSX1kvXh3ODLZ7sHjT43w9s9M=; b=TuLoDSjSsZXVfeO0AnLBhFzfFD thL41MiIgVi5Mrcol10SS5EDx+5B/xzVSRNIud1QtJJK26jALf3X5lcXfmEMMK/hNJ96OJJQs5+uO haAGKRZ5JpnENYRK/rP/5vJo5w9m4F8/+8b+odHeU0eaoWWDdTPUHWOC0DrjZGTJoSWhfTTtFjVX1 LTHxip5mO1LWVc3+tKDK6W4J9LD4mAV6Qov+JKjVZm8IDu0znsB4N3Tk+i9zpg7CbAa7Icx5+ttV5 1RcNigHIjBxc+jT5rdKvW6AHsaZ5WXathf7qOA/9yqEQnyBJCafB1fDmkQPEv5LFH95rYrK7RA2UI zTWoHf8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbMex-00000002HeE-3CNz; Tue, 06 Aug 2024 16:03:39 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbMZ2-00000002FtA-0Xca for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 15:57:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722959852; x=1754495852; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T3lYCZNDTOox5kJQOOR6Dbvex/BUJB0U27xJgGtdjGk=; b=jpVBvAMhecXIuY0BYTDWH4s/9WXObJ+M2nNR+u4sIMe+ODWFj6v8Jtq8 20Pc4ZSqHLQVom8El2HR3LN8D3vFxxIGqm7k+rV6c36YImpfda0num6TN J/Yma0WLC8FeGww/8k4Hwk036eZvxT8qwBobsvALTWiQiaw7ADlPNXB27 +mZlfSxo5sMYIJ9tsC1iHAeuhYnXQ1XwEqFulTan3V27tGkoA6mi5D8r9 Kx/xVI/R8HSNVNIaOPwZuqpK0BohbNE7oVmGqSaoqh9aipHX2Q9zDDYzI /cs09NieoCGM8T6YyYh7SuGKReM9d/ZEpwrLuml1W7HJFyT0//FGWgRVk w==; X-CSE-ConnectionGUID: pg8KZlxuS6C9yNDxMWIzCA== X-CSE-MsgGUID: dx1/R41/Q2iQ0MG9QRRl0Q== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="43514300" X-IronPort-AV: E=Sophos;i="6.09,268,1716274800"; d="scan'208";a="43514300" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 08:56:30 -0700 X-CSE-ConnectionGUID: KmWNhmmERSCv4N7Km3j1ew== X-CSE-MsgGUID: AqnACi6NS2CldDv+WSzWTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,268,1716274800"; d="scan'208";a="56631503" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.94.248.17]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2024 08:56:24 -0700 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 V11 10/10] perf intel-pt: Add a test for pause / resume Date: Tue, 6 Aug 2024 18:55:14 +0300 Message-Id: <20240806155514.17900-11-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806155514.17900-1-adrian.hunter@intel.com> References: <20240806155514.17900-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_085732_326193_3C0AAB08 X-CRM114-Status: GOOD ( 11.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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