From: Jiri Olsa <jolsa@redhat.com>
To: Hao Luo <haoluo@google.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Jiri Olsa <jolsa@kernel.org>,
dwarves@vger.kernel.org
Subject: Re: [PATCH] btf_encoder: Check var type after checking var addr.
Date: Tue, 27 Oct 2020 12:20:21 +0100 [thread overview]
Message-ID: <20201027112021.GA2900849@krava> (raw)
In-Reply-To: <20201026221822.29021-1-haoluo@google.com>
On Mon, Oct 26, 2020 at 03:18:22PM -0700, Hao Luo wrote:
> Commit 2e719cc ("btf_encoder: revamp how per-CPU variables are
> encoded") adds percpu_var_exists() to filter out the symbols that
> are not percpu var. However, the check comes after checking the
> var's type. There can be symbols that are of zero type. If we hit
> that, btf_encoder will not work without '--btf_encode_force'.
> So we should check percpu_var_exists before checking var's type.
>
> Tested:
> haoluo@haoluo:~/kernel/tip$ gcc --version
> gcc (GCC) 10.2.0
> Copyright (C) 2020 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> Before:
>
> haoluo@haoluo:~/kernel/tip$ make clean -s
> haoluo@haoluo:~/kernel/tip$ make -j 32 -s
> LINK resolve_btfids
> error: found variable in CU 'kernel/bpf/btf.c' that has void type
> Encountered error while encoding BTF.
> FAILED: load BTF from vmlinux: Unknown error -2make: *** [Makefile:1164: vmlinux] Error 255
>
> After:
>
> haoluo@haoluo:~/kernel/tip$ make clean -s
> haoluo@haoluo:~/kernel/tip$ make -j 32 -s
> LINK resolve_btfids
> haoluo@haoluo:~/kernel/tip$
>
> Fixes: 2e719cc ("btf_encoder: revamp how per-CPU variables are encoded")
> Signed-off-by: Hao Luo <haoluo@google.com>
it fixes the build issue for me
Tested-by: Jiri Olsa <jolsa@redhat.com>
thanks,
jirka
prev parent reply other threads:[~2020-10-27 11:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 22:18 [PATCH] btf_encoder: Check var type after checking var addr Hao Luo
2020-10-26 23:22 ` Andrii Nakryiko
2020-10-27 11:19 ` Arnaldo Carvalho de Melo
2020-10-27 11:20 ` Jiri Olsa [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=20201027112021.GA2900849@krava \
--to=jolsa@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=arnaldo.melo@gmail.com \
--cc=dwarves@vger.kernel.org \
--cc=haoluo@google.com \
--cc=jolsa@kernel.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 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).