bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Pavel Skripkin <paskripkin@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH bpf v2 3/3] tools/resolve_btfids: Skip unresolved symbol warning for empty BTF sets
Date: Thu, 25 Nov 2021 23:37:37 -0800	[thread overview]
Message-ID: <CAPhsuW7xSdStywDboiQs6HHLmwreSCd9xfJDPOeb9ZUCSvyfHg@mail.gmail.com> (raw)
In-Reply-To: <20211122144742.477787-4-memxor@gmail.com>

On Mon, Nov 22, 2021 at 6:47 AM Kumar Kartikeya Dwivedi
<memxor@gmail.com> wrote:
>
> resolve_btfids prints a warning when it finds an unresolved symbol,
> (id == 0) in id_patch. This can be the case for BTF sets that are empty
> (due to disabled config options), hence printing warnings for certain
> builds, most recently seen in [0].
>
> The reason behind this is because id->cnt aliases id->id in btf_id
> struct, leading to empty set showing up as ID 0 when we get to id_patch,
> which triggers the warning. Since sets are an exception here, accomodate
> by reusing hole in btf_id for bool is_set member, setting it to true for
> BTF set when setting id->cnt, and use that to skip extraneous warning.
>
>   [0]: https://lore.kernel.org/all/1b99ae14-abb4-d18f-cc6a-d7e523b25542@gmail.com
>
> Before:
>
> ; ./tools/bpf/resolve_btfids/resolve_btfids -v -b vmlinux net/ipv4/tcp_cubic.ko
> adding symbol tcp_cubic_kfunc_ids
> WARN: resolve_btfids: unresolved symbol tcp_cubic_kfunc_ids
> patching addr     0: ID       0 [tcp_cubic_kfunc_ids]
> sorting  addr     4: cnt      0 [tcp_cubic_kfunc_ids]
> update ok for net/ipv4/tcp_cubic.ko
>
> After:
>
> ; ./tools/bpf/resolve_btfids/resolve_btfids -v -b vmlinux net/ipv4/tcp_cubic.ko
> adding symbol tcp_cubic_kfunc_ids
> patching addr     0: ID       0 [tcp_cubic_kfunc_ids]
> sorting  addr     4: cnt      0 [tcp_cubic_kfunc_ids]
> update ok for net/ipv4/tcp_cubic.ko
>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Fixes: 0e32dfc80bae ("bpf: Enable TCP congestion control kfunc from modules")
> Reported-by: Pavel Skripkin <paskripkin@gmail.com>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>

Acked-by: Song Liu <songliubraving@fb.com>

  reply	other threads:[~2021-11-26  7:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 14:47 [PATCH bpf v2 0/3] Fixes for kfunc-mod regressions and warnings Kumar Kartikeya Dwivedi
2021-11-22 14:47 ` [PATCH bpf v2 1/3] bpf: Make CONFIG_DEBUG_INFO_BTF depend upon CONFIG_BPF_SYSCALL Kumar Kartikeya Dwivedi
2021-11-26  7:06   ` Song Liu
2025-05-14 10:30   ` Geert Uytterhoeven
2021-11-22 14:47 ` [PATCH bpf v2 2/3] bpf: Fix bpf_check_mod_kfunc_call for built-in modules Kumar Kartikeya Dwivedi
2021-11-26  7:13   ` Song Liu
2021-11-22 14:47 ` [PATCH bpf v2 3/3] tools/resolve_btfids: Skip unresolved symbol warning for empty BTF sets Kumar Kartikeya Dwivedi
2021-11-26  7:37   ` Song Liu [this message]
2021-11-29 23:46   ` Andrii Nakryiko
2021-11-30 19:56     ` Kumar Kartikeya Dwivedi
2021-12-02 22:39       ` Andrii Nakryiko
2021-12-02 22:30 ` [PATCH bpf v2 0/3] Fixes for kfunc-mod regressions and warnings patchwork-bot+netdevbpf

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=CAPhsuW7xSdStywDboiQs6HHLmwreSCd9xfJDPOeb9ZUCSvyfHg@mail.gmail.com \
    --to=song@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=memxor@gmail.com \
    --cc=paskripkin@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).