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: 187226 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1302217dyi; Thu, 11 Jan 2024 00:22:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFort/TE0qqdmCSPI/Tv1zEXeczDa9tHsUwSrQOkPqILlAIIPMEUm3zv3E6Qxe6HjI7QWaC X-Received: by 2002:a05:6214:23cb:b0:681:16ee:2f58 with SMTP id hr11-20020a05621423cb00b0068116ee2f58mr992234qvb.79.1704961364850; Thu, 11 Jan 2024 00:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704961364; cv=none; d=google.com; s=arc-20160816; b=QBelRFAVA8vvpZcxuLuPlMynnZDXu2upy2Fs72KfcixWOIyYzk4LnogGVhV6+jW8qg RSAZ45G3qJudzbrobqHGtk0PE1oi3OzheCETFeoL6IlYXZyW+klRxK4lxyKYJzq2Ke2Z SnJUDV4YMiqePKyxesQ+GIVxXunhVgdurFnS6qrvjk+mypwcBDQ5KVPjjNoHj5c+tvT/ ivBVQkyM9k5m8wJPg5ZdHQ5OFv2kJdl8L3WpzPo0pr087ZvAhjqwdohVF8d/C2ZaUjSH 1UdXkXX8gYhVf+SYIwa0B3kKWeNacuw1Yzm/u1N9Y4Kagsx48FltPeamEP9vS2pk1ayD jJXw== ARC-Message-Signature: i=1; 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=DP04JBm/++McGTjTc+vSf3bnPv2lgKTyCYHFfLJ5B70=; fh=cd6f3jNh3j7Qvd5mXmd/oCoIQnwAYeKd0j29JiSirLE=; b=GG4JZCO6Eqgj7LJh666Ntz8zSdDATA2rFszdvaHoYjK4QU7+qTM+RSLsbFM+QtQR2Q /b4gWJlL/o2+aY6E4hjM/yTx9F0cxxfTr6HUdpoYJOJNn8uiJ+iWnxP5ri8bGddf+TtH nHVsDnbx4mfXnPZRQOgDhrTF3C6iigahc39b8pGJ1KEIiLVUq3R36E80ZsWGtksNnxav xPKTIBYwlY6QOtKhzi7BOCORBp5+L0EVqWyUl/aMbljaTDuw0Q8sURY2UuGtn2SQhKlh yrPQ5RNS5YDMtO+HgX3Zy+BEIWNFTrKNJutxenCsY8hczaxGFjSN0Ze8kqoz6t6i2T65 ka9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EFHXf8Q5; spf=pass (google.com: domain of linux-kernel+bounces-23210-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23210-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x19-20020a0cb213000000b0067f483722c0si345430qvd.208.2024.01.11.00.22.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 00:22:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23210-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EFHXf8Q5; spf=pass (google.com: domain of linux-kernel+bounces-23210-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23210-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A3A461C21AC2 for ; Thu, 11 Jan 2024 08:22:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 884BD14AB9; Thu, 11 Jan 2024 08:20:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EFHXf8Q5" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (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 9EA9214A86; Thu, 11 Jan 2024 08:20:26 +0000 (UTC) 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=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="465166630" X-IronPort-AV: E=Sophos;i="6.04,185,1695711600"; d="scan'208";a="465166630" 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> 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: 1787781567847742508 X-GMAIL-MSGID: 1787781567847742508 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