From: sashiko-bot@kernel.org
To: "Arnaldo Carvalho de Melo" <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v9 02/13] perf scripts: Add a coverage harness for perf
Date: Fri, 20 Nov 2026 01:40:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-224334@kernel.org> (raw)
In-Reply-To: <20261120013211.1510-3-acme@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] perf scripts: focus_path() fails to strip leading perf/ prefix
for -f paths
--
commit 5debccd739d02a3ebc2b5b2486b3cc102c514507
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
perf scripts: Add a coverage harness for perf
This commit adds a clang source-based coverage script for perf along with
Makefile targets to build an instrumented perf, run the test suite, and
report line and function coverage.
> diff --git a/tools/perf/scripts/coverage.sh b/tools/perf/scripts/coverage.sh
> new file mode 100755
> index 0000000000000..bfaaa9a00e248
> --- /dev/null
> +++ b/tools/perf/scripts/coverage.sh
> @@ -0,0 +1,1153 @@
[ ... ]
> +AWK_PERF='
> +function perf_relpath(p) {
> + sub(/^.*tools\/perf\//, "", p)
> + sub(/^perf\//, "", p)
> + return p
> +}
> +function generated(p) {
> + return build != "" && index(perf_relpath(p), build "/") == 1
> +}
> +'
> +
> +# Line coverage of a full report for one file: "lines missed cover fn%".
> +# Match the requested path as a suffix: a build outside the source tree
> +# gives ".../tools/perf/...", one inside it "tools/perf/...", and one
> +# inside tools/ makes llvm-cov strip the "<srctree>/tools/" prefix shared
> +# by every reported file, giving "perf/...".
> +#
> +# -f takes the path as it shows in the report, or a tools/perf/ relative one.
> +focus_path()
> +{
> + case "$1" in
> + *tools/perf/*) printf '%s\n' "${1#*tools/perf/}" ;;
> + *) printf '%s\n' "$1" ;;
> + esac
> +}
[Severity: Low]
Should focus_path() also strip a leading perf/ prefix, like perf_relpath()
does?
When -f is passed a perf/... path from a report built under tools/,
focus_path() leaves the leading perf/ intact, causing print_uncovered() to
check for $PERF_DIR/perf/<file>, warn that the file was not found, and skip
printing its uncovered lines.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120013211.1510-1-acme@kernel.org?part=2
next prev parent reply other threads:[~2026-11-20 1:40 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 1:31 [PATCH v9 00/13] perf coverage: A harness for perf, and the fixes it found Arnaldo Carvalho de Melo
2026-11-20 1:31 ` [PATCH v9 01/13] perf build: Link the GTK UI with EXTRA_CFLAGS Arnaldo Carvalho de Melo
2026-11-20 1:38 ` sashiko-bot
2026-11-20 1:31 ` [PATCH v9 02/13] perf scripts: Add a coverage harness for perf Arnaldo Carvalho de Melo
2026-11-20 1:40 ` sashiko-bot [this message]
2026-11-20 1:31 ` [PATCH v9 03/13] perf annotate: Handle absolute addressing in data type profiling Arnaldo Carvalho de Melo
2026-11-20 1:49 ` sashiko-bot
2026-11-20 1:31 ` [PATCH v9 04/13] perf tests: Exercise DW_OP_addrx global variables Arnaldo Carvalho de Melo
2026-11-20 1:45 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 05/13] perf tests: Exercise the flexible array member path Arnaldo Carvalho de Melo
2026-11-20 1:38 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 06/13] perf annotate-data: Count flexible array accesses for the whole struct Arnaldo Carvalho de Melo
2026-11-20 1:41 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 07/13] perf tests: Exercise data type resolution from a register Arnaldo Carvalho de Melo
2026-11-20 1:39 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 08/13] perf annotate: Print the stats after the annotations Arnaldo Carvalho de Melo
2026-11-20 1:37 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 09/13] perf tests: Silence the libbfd probe in build-test Arnaldo Carvalho de Melo
2026-11-20 1:35 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 10/13] perf build: Record the features checked outside FEATURE_TESTS Arnaldo Carvalho de Melo
2026-11-20 1:40 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 11/13] perf tests: Fix the Intel PT virtual LBR check Arnaldo Carvalho de Melo
2026-11-20 1:39 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 12/13] perf test: Drop samples without an IP in the dlfilter test Arnaldo Carvalho de Melo
2026-11-20 1:39 ` sashiko-bot
2026-11-20 1:32 ` [PATCH v9 13/13] perf test: Skip the LBR inline unwinding check when unsupported Arnaldo Carvalho de Melo
2026-11-20 1:39 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-224334@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=acme@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox