From patchwork Thu Jan 11 08:19: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: 13516878 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 E7BE5C47077 for ; Thu, 11 Jan 2024 08:21:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WoxVjvXNBimDZitY0GKnY1DQcjDCAvEbwbkvn9fhuh4=; b=xdkutMA2BSfc5E iTlCppR0pUVTvfO1aMjyY2xxdbcMMciOhScDAx1+2bJ1urO/F+ZKYs7+8wz5qASLgKPq94yo09kBq T1FdPAbisT4PUJg5zikd1kAhp8jNTvgTIb4N6gUdch0eJf6sR+UMjbPYjU2oz1YGiKakmZde0Fwmz gKAb9Vi2zEfg8Dsv7NekWv/ftqlcElMdpPiilMzt+HxoZ+V9uLPt7UUCvBHjJUEzvV6ksjAhvxl4P DBt6CNTDEL+8KlWkz9ka8xgF7iU+Ph/CnsIEt20AjuUwRPNYUbnn5ph8ZCvxJVCMDlZ2zIlIMsuPe yLSvwtI9baqE+xyWt8PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNqIj-00GThe-0u; Thu, 11 Jan 2024 08:20:33 +0000 Received: from mgamail.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNqIc-00GTcs-2g for linux-arm-kernel@lists.infradead.org; Thu, 11 Jan 2024 08:20:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704961226; x=1736497226; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YF2mznNPxiYOY4eRx14gZJdV4+DolWzQx58W70hEjws=; b=EFHXf8Q5AWH9uKnOXFRrSuabZtwfBGPisX80lGF1hpgnxlpwQ1aztlJs rKzRG+ITWSwQcObEpvuLH5Ctnw0Tv0Xwgl3wH1jdP8jIcu5qpGCe8tB6V QOkKivq7XxJlFB0DvxLBnRGgKazdmV+Y6tUivc81geYnolzEnzMxolT2V gwjfuxtzKYXNZ6qh2nxLlpxFdAy9GNXQoLIWSyfjJ4irpt5rhVzfSZe80 11mjPxM3SNMGaYJA5IBDBhsY9Jse7bMcqnz78F0HQrRkQETShg7dfYL+S urypokDOEQjHIjZpeRX2nucQTjz738p9KdD4isxO4PXeXan4QWRVmGrkK w==; X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="465166623" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="465166623" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 00:20:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="925923216" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="925923216" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.52.224]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 00:20:21 -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 , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V4 11/11] perf intel-pt: Add a test for pause / resume Date: Thu, 11 Jan 2024 10:19:14 +0200 Message-Id: <20240111081914.3123-12-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111081914.3123-1-adrian.hunter@intel.com> References: <20240111081914.3123-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-20240111_002026_931468_D7098A5C X-CRM114-Status: GOOD ( 12.56 ) 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 --- 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