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=1796213722; b=aCXpNa9Dy2LMXIJNde1TMB6lmQSWHM743xkfz+eG91Wz/MpyVNk7F1NOiR9d+8wjgfxN NZnF1AddMIPKH75nju/Okk83RLxARo7WZ81NLfwsiI+p+jU7oc0YZiKFtnDU0QThrj3wN 2iKBsXrYvZh96j8qcX25PMV3o6DmdKa4Op8XefFYgbuK++lQEM07/ffsOc55YwwRnVVvs WUXwK7e5cWRZGbEs+2b6MD7iaLR1ItfmXFAfSobt9NMMhKKIQGJYxxR/r+egbjVbvINwF c9GdefjfL1prHncREogrLebH8ydZsJxoJBPbFAK5yvWtE4wqs0Wx9dcpGYt7WBdHChQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796213722; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=BfvMfNRRnHwdDqefTzmI4IAJOAVVOLmBCX27pMegoQw=; b=sfTlCwsJikc7qtacMdJCWXV8CVD+qpbGjU0TkIigwpeGQFrl/qOAVCy95OLVEWzyR80P lVdRdvjuq7XFHWXPRgoc53oXy1nb//TiiplfqO4e4uMlnpvb6slRqImKtJYOWgSFmRb4Y 1ZkHCqcXUvdWKCIh18rICxjbYIdu9U/6+uh/DPRoaOqE9KdpFY5a96w6Rla1QVsABNtYr ZiOfWncvcNqNyj++cNrj6DTvD7m1Uvq9lH5M+ODvuazcY37rJMkhTh1u3/z+4vOfhUOGt waStlxuLV+N4/zBWLLfjfXZD0OTmstNoE1HsZ8QKk2WTcoYLxO3LU9y3w8i8Bw4PB4w== 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=Sb0LIvfO; 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 ADE3E606A31A for ; Wed, 2 Dec 2026 12:15:22 +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=Sb0LIvfO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12C231F00899; Wed, 2 Dec 2026 12:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796213722; bh=BfvMfNRRnHwdDqefTzmI4IAJOAVVOLmBCX27pMegoQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Sb0LIvfO+stSgbdp1CQ1xokNdAbnLoDPw/phvajZpNJL8ebP0qy/QZBofWNR9hJKz XUWGTZIqRpZKoBpUjedgyRSL3G3XvokeBDZO2U6SzzCyCAep3ealFUvayjC1TLrtW9 Dh+LxTm7gZ8Eyk0Q6/s1qTs0p0H4KQf1igg/e6Ew/3Dw0LpGP9OFnbT3dMWaAT81wn qFsiZ5WOhCbrPZ3nOsmQZalk9U6Gee7S1k6brG1hw7h5k2GWNB9+fQ7WsP166oth+I BPfG4HFOL7j2FSH9FxcAHOJOrg+mr+8pm5pdDP0DC7zr9wuC0p7BgO+PiSKsFUh/OY HGluFCMsLA3mg== 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 09/18] perf tests annotate: Exercise the output and filter options Date: Wed, 2 Dec 2026 09:14:25 -0300 Message-ID: <20261202121434.2224-10-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 annotate test covers the stdio and pipe modes. Add the --stdio2 output, --print-line, --asm-raw with --show-total-period, --show-nr-samples, --percent-type and the DSO filter, the last one checked by also annotating through a DSO that is not in the data. Reviewed-by: Athira Rajeev Tested-by: Athira Rajeev Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/shell/annotate.sh | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh index 26411edf5cb4ece1..d799414690402fc0 100755 --- a/tools/perf/tests/shell/annotate.sh +++ b/tools/perf/tests/shell/annotate.sh @@ -105,8 +105,72 @@ test_basic() { echo "${mode} annotate test [Success]" } +test_options() { + echo "Options annotate test" + perf record -o "${perfdata}" ${testprog} 2> /dev/null + + # --stdio2 prints each instruction with the symbol header + if ! perf annotate -i "${perfdata}" --stdio2 -s "${testsym}" 2> /dev/null | grep -q "${testsym}()" + then + echo "Options annotate [Failed: missing --stdio2 output]" + err=1 + return + fi + + # -l/--print-line prints a summary of the annotated file with source lines + if ! perf annotate -i "${perfdata}" --stdio --print-line -s "${testsym}" 2> /dev/null | grep -q "Sorted summary for file" + then + echo "Options annotate [Failed: missing --print-line output]" + err=1 + return + fi + + # --show-total-period adds a period column; --asm-raw is the default + if ! perf annotate -i "${perfdata}" --stdio --asm-raw --show-total-period -s "${testsym}" 2> /dev/null | grep -q "Period" + then + echo "Options annotate [Failed: missing --show-total-period output]" + err=1 + return + fi + + # --show-nr-samples adds a samples column + if ! perf annotate -i "${perfdata}" --stdio -n -s "${testsym}" 2> /dev/null | grep -q "Samples" + then + echo "Options annotate [Failed: missing --show-nr-samples output]" + err=1 + return + fi + + # --percent-type selects the percentage type shown in the header + if ! perf annotate -i "${perfdata}" --stdio --percent-type global-period -s "${testsym}" 2> /dev/null | grep -q "percent: global period" + then + echo "Options annotate [Failed: missing --percent-type output]" + err=1 + return + fi + + # -d limits the annotation to the given DSO: perf has the symbol, a + # DSO absent from the data produces no annotation + if ! perf annotate -i "${perfdata}" --stdio -s "${testsym}" -d perf 2> /dev/null | grep -q "Disassembly of" + then + echo "Options annotate [Failed: missing -d output]" + err=1 + return + fi + + if perf annotate -i "${perfdata}" --stdio -s "${testsym}" -d nonexistent-dso 2> /dev/null | grep -q "Disassembly of" + then + echo "Options annotate [Failed: -d did not filter the DSO]" + err=1 + return + fi + + echo "Options annotate test [Success]" +} + test_basic Basic test_basic Pipe +test_options cleanup exit $err -- 2.56.0