All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/3] perf build: Add libnvme feature detection
Date: Tue, 09 Jun 2026 07:12:26 +0000	[thread overview]
Message-ID: <20260609071226.B77D71F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609070348.541964-2-irogers@google.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The feature check for `libnvme` fails to utilize `pkg-config` during the test compilation, contradicting the commit message and breaking detection when the library is in a non-standard path.
- [Medium] `libnvme` is omitted from `test-all.c`, which causes false positives in fast-path detection and triggers continuous feature-dump flip-flops and rebuilds.
--

commit 1f4a72ba50b99659f0972d94ef171f8be76bc329
Author: Ian Rogers <irogers@google.com>

perf build: Add libnvme feature detection

Introduce a feature check for libnvme so that we can conditionally
compile the NVMe PMU driver. This checks for the availability of the
libnvme headers and library using pkg-config.

> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index ed1374af31c16..bf85032415397 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -73,6 +73,7 @@ FEATURE_TESTS_BASIC :=                  \
>          libbfd                          \
>  	libbfd-threadsafe		\
>          libelf                          \
> +        libnvme                         \

[Severity: Medium]
Without including test-libnvme.c in test-all.c, the fast-path build will
succeed even if libnvme is absent.

This can cause the initial discovery to falsely report libnvme as present,
which then flip-flops when individual checks are run later in
tools/perf/Makefile.config. This mismatch invalidates the build cache and
triggers full feature evaluations and rebuilds on every make invocation.

Since libnvme was added to FEATURE_TESTS_BASIC, does it also need to be
included in tools/build/feature/test-all.c?

>          libelf-getphdrnum               \
>          libelf-gelf_getnote             \
>          libelf-getshdrstrndx            \

[ ... ]

> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 62909a9c799d3..fd00e0be60690 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -147,6 +147,9 @@ $(OUTPUT)test-libcap.bin:
>  $(OUTPUT)test-libelf.bin:
>  	$(BUILD) -lelf
>  
> +$(OUTPUT)test-libnvme.bin:
> +	$(BUILD) -lnvme
> +

[Severity: Medium]
The commit message states the availability of libnvme headers and library are
checked using pkg-config. However, because libnvme is omitted from the
FEATURE_PKG_CONFIG list in tools/build/Makefile.feature, the variables
FEATURE_CHECK_CFLAGS-libnvme and FEATURE_CHECK_LDFLAGS-libnvme are never
initialized.

This rule manually invokes $(BUILD) -lnvme, falling back to standard compiler
paths instead of leveraging pkg-config variables.

If libnvme is installed in a non-standard location discoverable only via
pkg-config, could the feature test fail and incorrectly disable NVMe PMU
support?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609070348.541964-1-irogers@google.com?part=1

  reply	other threads:[~2026-06-09  7:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  7:03 [PATCH v1 0/3] perf pmu: Add tool-provided NVMe PMU Ian Rogers
2026-06-09  7:03 ` [PATCH v1 1/3] perf build: Add libnvme feature detection Ian Rogers
2026-06-09  7:12   ` sashiko-bot [this message]
2026-06-09  7:03 ` [PATCH v1 2/3] perf pmu: Implement tool-provided NVMe PMU Ian Rogers
2026-06-09  7:21   ` sashiko-bot
2026-06-09  7:03 ` [PATCH v1 3/3] perf tests: Add NVMe PMU event parsing test Ian Rogers
2026-06-09 16:57 ` [PATCH v2 0/3] perf pmu: Add tool-provided NVMe PMU Ian Rogers
2026-06-09 16:57   ` [PATCH v2 1/3] perf build: Add libnvme feature detection Ian Rogers
2026-06-09 17:08     ` sashiko-bot
2026-06-09 16:57   ` [PATCH v2 2/3] perf pmu: Implement tool-provided NVMe PMU Ian Rogers
2026-06-09 17:19     ` sashiko-bot
2026-06-09 16:57   ` [PATCH v2 3/3] perf tests: Add NVMe PMU event parsing test Ian Rogers

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=20260609071226.B77D71F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.