From: David Laight <david.laight.linux@gmail.com>
To: Leo Yan <leo.yan@arm.com>
Cc: James Clark <james.clark@linaro.org>,
Thomas Voegtle <tv@lio96.de>,
stable@vger.kernel.org, Sasha Levin <sashal@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf arm_spe: Fix bitfield dependency failure
Date: Fri, 23 Jan 2026 14:03:17 +0000 [thread overview]
Message-ID: <20260123140317.4bd85cdb@pumpkin> (raw)
In-Reply-To: <20260123120847.GB40455@e132581.arm.com>
On Fri, 23 Jan 2026 12:08:47 +0000
Leo Yan <leo.yan@arm.com> wrote:
> On Fri, Jan 23, 2026 at 10:27:42AM +0000, James Clark wrote:
>
> [...]
>
> > > diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
> > > index adf4cde320aa..8d16619cd098 100644
> > > --- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
> > > +++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
> > > @@ -7,6 +7,7 @@
> > > #ifndef INCLUDE__ARM_SPE_PKT_DECODER_H__
> > > #define INCLUDE__ARM_SPE_PKT_DECODER_H__
> > > +#include <linux/kernel.h>
> > > #include <linux/bitfield.h>
> >
> > This isn't the first time I've seen this issue. Isn't the real fix to
> > include kernel.h in bitfield.h if it depends on it?
>
> Good point!
>
> bitfield.h is a common header so I did not change it. I digged a bit
> and found diverage between kernel's bitfield.h and tool's bitfield.h.
>
> 1) The kernel's bitfield.h includes asm/byteorder.h, and finally it
> includes linux/byteorder/generic.h, cpu_to_le{16|32|64} are defined
> in this file.
>
> 2) The tool's bitfield.h will includes asm/byteorder.h, but this hooks
> to the headers provided by the toolchain. cpu_to_le{16|32|64} are
> not C lib API, they are defined in tool's kernel.h.
Perhaps cpu_to_le16() and friends should be defined in the tools
asm/byteorder.h rather than its kernel.h.
David
>
> As a result, we need to include kernel.h for perf build.
>
> As you said, we can include kernel.h in bitfield.h, I will respin and
> send a new series.
>
> > Usually you shouldn't
> > have to know what all the dependencies of a header are when you include it.
> > Or is there a reason it wasn't done that way in the first place? Maybe this
> > has been discussed before?
>
> This issue is for tools only, and only Arm modules in perf folder use
> this header, I don't expect this is widely spread issue.
>
> Thanks,
> Leo
>
next prev parent reply other threads:[~2026-01-23 14:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 10:02 [PATCH] perf arm_spe: Fix bitfield dependency failure Leo Yan
2026-01-23 10:27 ` James Clark
2026-01-23 12:08 ` Leo Yan
2026-01-23 14:03 ` David Laight [this message]
2026-01-23 14:41 ` Leo Yan
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=20260123140317.4bd85cdb@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=acme@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=leo.yan@arm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tv@lio96.de \
/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