From mboxrd@z Thu Jan 1 00:00:00 1970 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 D97091BCA11; Tue, 22 Oct 2024 16:01:13 +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=1729612875; cv=none; b=LwNk8UZj2azuiX4RQFS6yQogbwkawyUZjyAjsXm+TRvHaiIB8gSNtnOEn4oJh7NDjOhJKta+EI+63487PMa6kM+iqyLVeNXJBVwmv1bNqJkcf7hSFjQpJ6oyBX4IU9jTLREow49yulJKhqPzuJRqBJggbngYBPht1Pj1vVKKssk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729612875; c=relaxed/simple; bh=I3lwAaY2k2Cqh5MvLtKpAY2EtrDXrU0TgtzKmPwEjYo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KhEEAuZL8AHW5cthUz+6J6EMMA+XEBXzfCWBPDyoVAYsLrViuiUDVjW8Tf6UYaPIuBupd/QLkYwXdRbpQ6o30+F39Jc+kaDICwdFb3/tjRSdRxoPrRKtovGMzzK6gDiKtdZOYrxAbPVAafoaZ+yLBSgRnxRhlFHwSW7FLpq3sgw= 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=lnD1xl/+; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lnD1xl/+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729612874; x=1761148874; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I3lwAaY2k2Cqh5MvLtKpAY2EtrDXrU0TgtzKmPwEjYo=; b=lnD1xl/+IKT11NIj2VyenufPAXW2eJ9VmM4bdnS67wkBMMrzLdGgX/7q K9/38+cIIa6Tn/oDuAd4vimGOoQgaM0yJ/o7DKrNj6xfp9/Es9ksbxkpb NWEz9PAAjm4+fURJSSXnvyXQ8KEXkR6Xi2Z23OXiydDnvoC6YiqaY0ng/ zRxnk0kUGF2swXyneaN+0ouY3U3/lCBkWzWxeaWW0VLSjuh+2/4ncAc2a r50BAsHeTV/R3dM1LctxCl2MUdTUOfcPw019LXMXMRD8XBAn0yRD/lpoG QvZSvHU89bgRxIiP6+UgpLcWxDCyPqjpcTUMpOE2jlBnGw/YTqIZvH2oq g==; X-CSE-ConnectionGUID: W9K7v0hgTRSBg8DDB6KTLQ== X-CSE-MsgGUID: Os0tMTWLRj2uhZcUYuF0ZA== X-IronPort-AV: E=McAfee;i="6700,10204,11233"; a="29271178" X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="29271178" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 09:01:13 -0700 X-CSE-ConnectionGUID: iKp+Ct79RR+e6e0fTMU47g== X-CSE-MsgGUID: z83YfODQR52Te+7lg1Ynew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,223,1725346800"; d="scan'208";a="79858945" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.ger.corp.intel.com) ([10.246.16.81]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2024 09:01:05 -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 , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, H Peter Anvin , Kan Liang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V14 11/11] perf intel-pt: Add a test for pause / resume Date: Tue, 22 Oct 2024 18:59:17 +0300 Message-ID: <20241022155920.17511-12-adrian.hunter@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241022155920.17511-1-adrian.hunter@intel.com> References: <20241022155920.17511-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-perf-users@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 Content-Transfer-Encoding: 8bit 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 bf9017b812aa..bce579f4f447 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 -- 2.43.0