From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796213754; b=0wedkPgWs1OCAKRJJZl/nTy2sKOVWYpPj1iCFztyk4esGLkWecvDG5l62dD8WNyeNEHj FArGsC6plbC6w6Hf0ILAAE3lLGzhM3eyOtIqg9lxfIz44yt/kveKQR4V/+i1Vfxb1nAzc 9MDjG+6ewcq4noQH00spPN/lSE6uP6UUov8N/MCxvPdz6eviHvNlb4QAh+z47An7oZO3U RO9WbPUqEieSD2HVu9hVeKlpkORHcLO6T9tOrs2JrSzNH+PSCAloGyOzwb9iXMmbIiAlQ +EBX0kXnrBlhlTtbuUA41B0J74+F23njZiROx8OLocWf0THkPiPlrDGTC4QzhHkUA1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796213754; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=GefeGsVmFPmC9/MwqYHOd8LaubUZmdDM8MoL51WY2Bs=; b=Dvic8JyQgDyZyqqDqbGcunkp/oSGiL8YAARkj3qmAYTKdkLc/f6qDTbxYGi6YfiOQPZF +OtWEUEqtGKyTdSTwuhslz0uNSf2rFDcRUdV3/GTgODF3ncHnRH6c98w1Cy40wspOnKx1 HGHPPDNt2sBBhNesg3XQzarA69zjcjDltPcgdRZaOCI2UPphrSMn4+d12eSDG+wf+KkqK frjyaFv/rccIyk8AwuuPGrdPAznjVDdYF+fZaETV00Pvj9D94G3Sw+sEwcLdVUMf5+LYJ 2PK7AE2tRvB9k2AE+FUsqsB/p7lV61hkeX8lLsiBSr9T44027MroDX5BcHeKJMRdNEQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=drfchLmO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41E6D606A322 for ; Wed, 2 Dec 2026 12:15:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=drfchLmO Received: by smtp.kernel.org (Postfix) with ESMTPSA id B90EF1F008A0; Wed, 2 Dec 2026 12:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796213753; bh=GefeGsVmFPmC9/MwqYHOd8LaubUZmdDM8MoL51WY2Bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=drfchLmO7e1Il7HtJi05+Q0sRP3lDupB5Q0nPj3HgkPeg7KViuLMbNbOgvxhuU5ub Rxnj1x03bxylTYAFumEUvsduCIHnm1iCuzDerOyMS9lnmGG+r0VtOsPUBOQ6trPUxf +zDv4MSe7MXnYokJuWXJ4ngQP/iClVjhzhhQ8/LMigpJDlo595eVn+GhPhv3TSRJfy RUEvIff/gFF2ZiVRsuitMzbY+Aw1w14eOfS3KrSCC/Z/mzSCRVo/mj//rmsKph74TA fuZ/nD19U1zkd+XQ1gyhJfypVb5QDyf2uF+0uwxQpdnStfhLN/Jq6slOIiV1g11DQM hpdWZdcaoKa3A== From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , James Clark , Jiri Olsa , Ian Rogers , Adrian Hunter , Clark Williams , linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Athira Rajeev Subject: [PATCH v3 16/18] perf tests lock: Exercise perf lock report and info Date: Wed, 2 Dec 2026 09:14:32 -0300 Message-ID: <20261202121434.2224-17-acme@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261202121434.2224-1-acme@kernel.org> References: <20261202121434.2224-1-acme@kernel.org> X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnaldo Carvalho de Melo The lock contention test records and reads a perf.data file, but only through perf lock contention. Walk the report sort keys, combine the locks, and check the thread and lock lists of perf lock info on the same file. Reviewed-by: Athira Rajeev Tested-by: Athira Rajeev Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/shell/lock_contention.sh | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tools/perf/tests/shell/lock_contention.sh b/tools/perf/tests/shell/lock_contention.sh index 5df9a0cd48a34f4f..ebff99bd3688bb94 100755 --- a/tools/perf/tests/shell/lock_contention.sh +++ b/tools/perf/tests/shell/lock_contention.sh @@ -65,6 +65,59 @@ test_record() fi } +test_report() +{ + echo "Testing perf lock report" + # the output goes to the stderr and all keys are printed unless -F + # selects a subset, so walk the sort keys + for key in acquired contended avg_wait wait_total wait_max wait_min; do + if ! perf lock report -i ${perfdata} -k ${key} -E 5 2> ${result} + then + echo "[Fail] perf lock report --key ${key} failed" + err=1 + return + fi + if ! grep -q "Name" "${result}"; then + echo "[Fail] perf lock report --key ${key} has no output:" "$(cat "${result}")" + err=1 + exit + fi + done + + if ! perf lock report -i ${perfdata} -c -v -E 5 2> ${result} + then + echo "[Fail] perf lock report --combine-locks failed" + err=1 + return + fi + if ! grep -q "Name" "${result}"; then + echo "[Fail] perf lock report --combine-locks has no output:" "$(cat "${result}")" + err=1 + exit + fi +} + +test_info() +{ + echo "Testing perf lock info" + if ! perf lock info -i ${perfdata} 2> ${result} + then + echo "[Fail] perf lock info failed" + err=1 + return + fi + if ! grep -q "Thread ID" "${result}"; then + echo "[Fail] perf lock info has no thread list:" "$(cat "${result}")" + err=1 + exit + fi + if ! grep -q "Address of instance" "${result}"; then + echo "[Fail] perf lock info has no lock list:" "$(cat "${result}")" + err=1 + exit + fi +} + test_bpf() { echo "Testing perf lock contention --use-bpf" @@ -347,6 +400,8 @@ test_csv_output() check test_record +test_report +test_info test_bpf test_record_concurrent test_aggr_task -- 2.56.0