From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Alan Maguire <alan.maguire@oracle.com>,
Alexei Starovoitov <ast@kernel.org>,
linux-perf-users@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH v2] perf: Fix up build failure due to bpf changes
Date: Wed, 17 Jun 2026 12:44:00 -0300 [thread overview]
Message-ID: <ajLAwJpkG8Lt7daP@x1> (raw)
In-Reply-To: <20260617130038.34534-1-broonie@kernel.org>
On Wed, Jun 17, 2026 at 02:00:38PM +0100, Mark Brown wrote:
> Fix
>
> util/btf.c: In function '__btf_type__find_member_by_name':
> util/btf.c:19:43: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
> 19 | for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
> | ^
>
> builtin-trace.c: In function 'syscall_arg__strtoul_btf_enum':
> builtin-trace.c:967:27: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
> 967 | for (int i = 0; i < btf_vlen(bt); ++i, ++be) {
> | ^
>
> by making the variable the same type as the function.
Thanks, applied to perf-tools-next, for v7.2.
- Arnaldo
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> v2: Fix a second error.
>
> tools/perf/builtin-trace.c | 2 +-
> tools/perf/util/btf.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index 48615ddccd93a..4b23b82732e74 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -964,7 +964,7 @@ static bool syscall_arg__strtoul_btf_enum(char *bf, size_t size, struct syscall_
> struct btf *btf = arg->trace->btf;
> struct btf_enum *be = btf_enum(bt);
>
> - for (int i = 0; i < btf_vlen(bt); ++i, ++be) {
> + for (u32 i = 0; i < btf_vlen(bt); ++i, ++be) {
> const char *name = btf__name_by_offset(btf, be->name_off);
> int max_len = max(size, strlen(name));
>
> diff --git a/tools/perf/util/btf.c b/tools/perf/util/btf.c
> index bb163fe87767c..50d98f3e83bf0 100644
> --- a/tools/perf/util/btf.c
> +++ b/tools/perf/util/btf.c
> @@ -14,7 +14,7 @@ const struct btf_member *__btf_type__find_member_by_name(struct btf *btf,
> {
> const struct btf_type *t = btf__type_by_id(btf, type_id);
> const struct btf_member *m;
> - int i;
> + u32 i;
>
> for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
> const char *current_member_name = btf__name_by_offset(btf, m->name_off);
> --
> 2.47.3
>
>
prev parent reply other threads:[~2026-06-17 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 13:00 [PATCH v2] perf: Fix up build failure due to bpf changes Mark Brown
2026-06-17 15:44 ` Arnaldo Carvalho de Melo [this message]
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=ajLAwJpkG8Lt7daP@x1 \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alan.maguire@oracle.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=broonie@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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.