* [PATCH dwarves] cmake: make libbpf's Linux UAPI headers
@ 2020-10-26 19:58 Arnaldo Carvalho de Melo
2020-10-26 20:32 ` Jiri Olsa
0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-10-26 19:58 UTC (permalink / raw)
To: Andrii Nakryiko, Hao Luo; +Cc: dwarves, Jiri Olsa
Hi guys,
I just stumbled on this, investigating... This is with what is
in the tmp branch at
git://git.kernel.org/pub/scm/devel/pahole/pahole.git.
error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
Encountered error while encoding BTF.
LD .tmp_vmlinux.kallsyms1
KSYMS .tmp_vmlinux.kallsyms1.S
AS .tmp_vmlinux.kallsyms1.S
LD .tmp_vmlinux.kallsyms2
KSYMS .tmp_vmlinux.kallsyms2.S
AS .tmp_vmlinux.kallsyms2.S
LD vmlinux
BTFIDS vmlinux
FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+'
make: *** [Makefile:185: __sub-make] Error 2
- Arnaldo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH dwarves] cmake: make libbpf's Linux UAPI headers
2020-10-26 19:58 [PATCH dwarves] cmake: make libbpf's Linux UAPI headers Arnaldo Carvalho de Melo
@ 2020-10-26 20:32 ` Jiri Olsa
2020-10-26 21:17 ` Hao Luo
0 siblings, 1 reply; 5+ messages in thread
From: Jiri Olsa @ 2020-10-26 20:32 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: Andrii Nakryiko, Hao Luo, dwarves, Jiri Olsa
On Mon, Oct 26, 2020 at 04:58:30PM -0300, Arnaldo Carvalho de Melo wrote:
> Hi guys,
>
> I just stumbled on this, investigating... This is with what is
> in the tmp branch at
> git://git.kernel.org/pub/scm/devel/pahole/pahole.git.
>
> error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
> Encountered error while encoding BTF.
> LD .tmp_vmlinux.kallsyms1
> KSYMS .tmp_vmlinux.kallsyms1.S
> AS .tmp_vmlinux.kallsyms1.S
> LD .tmp_vmlinux.kallsyms2
> KSYMS .tmp_vmlinux.kallsyms2.S
> AS .tmp_vmlinux.kallsyms2.S
> LD vmlinux
> BTFIDS vmlinux
> FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
> make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+'
> make: *** [Makefile:185: __sub-make] Error 2
yep, I see the same and when I use --btf_encode_force,
it shows more of them:
error: found variable in CU 'arch/x86/kernel/cpu/mce/core.c' that has void type
error: found variable in CU 'security/selinux/hooks.c' that has void type
error: found variable in CU 'security/selinux/hooks.c' that has void type
error: found variable in CU 'security/selinux/hooks.c' that has void type
error: found variable in CU 'security/selinux/hooks.c' that has void type
error: found variable in CU 'security/selinux/hooks.c' that has void type
error: found variable in CU 'security/selinux/hooks.c' that has void type
error: found variable in CU 'drivers/platform/x86/intel_pmc_core.c' that has void type
I have no idea how variables are encoded in dwarf,
but I wonder it's another gcc bug ;-)
jirka
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH dwarves] cmake: make libbpf's Linux UAPI headers
2020-10-26 20:32 ` Jiri Olsa
@ 2020-10-26 21:17 ` Hao Luo
2020-10-26 21:19 ` Hao Luo
0 siblings, 1 reply; 5+ messages in thread
From: Hao Luo @ 2020-10-26 21:17 UTC (permalink / raw)
To: Jiri Olsa; +Cc: Arnaldo Carvalho de Melo, Andrii Nakryiko, dwarves, Jiri Olsa
On Mon, Oct 26, 2020 at 1:32 PM Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Mon, Oct 26, 2020 at 04:58:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > Hi guys,
> >
> > I just stumbled on this, investigating... This is with what is
> > in the tmp branch at
> > git://git.kernel.org/pub/scm/devel/pahole/pahole.git.
> >
> > error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
> > Encountered error while encoding BTF.
> > LD .tmp_vmlinux.kallsyms1
> > KSYMS .tmp_vmlinux.kallsyms1.S
> > AS .tmp_vmlinux.kallsyms1.S
> > LD .tmp_vmlinux.kallsyms2
> > KSYMS .tmp_vmlinux.kallsyms2.S
> > AS .tmp_vmlinux.kallsyms2.S
> > LD vmlinux
> > BTFIDS vmlinux
> > FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
> > make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+'
> > make: *** [Makefile:185: __sub-make] Error 2
>
> yep, I see the same and when I use --btf_encode_force,
> it shows more of them:
>
> error: found variable in CU 'arch/x86/kernel/cpu/mce/core.c' that has void type
> error: found variable in CU 'security/selinux/hooks.c' that has void type
> error: found variable in CU 'security/selinux/hooks.c' that has void type
> error: found variable in CU 'security/selinux/hooks.c' that has void type
> error: found variable in CU 'security/selinux/hooks.c' that has void type
> error: found variable in CU 'security/selinux/hooks.c' that has void type
> error: found variable in CU 'security/selinux/hooks.c' that has void type
> error: found variable in CU 'drivers/platform/x86/intel_pmc_core.c' that has void type
>
> I have no idea how variables are encoded in dwarf,
> but I wonder it's another gcc bug ;-)
>
> jirka
>
Still looking. But I found if I move
c815d266 (Hao Luo 2020-08-24 17:45:23 -0700 444)
if (var->ip.tag.type == 0) {
2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 445)
fprintf(stderr, "error: found variable in CU '%s'
that has void type\n",
2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 446)
cu->name);
f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 447)
if (force)
f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 448)
continue;
f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 449)
err = -1;
f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 450)
break;
f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 451)
}
f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 452)
after
2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 453)
type = var->ip.tag.type + type_id_off;
2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 454)
linkage = var->external ? BTF_VAR_GLOBAL_ALLOCATED :
BTF_VAR_STATIC;
2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 455)
if (!percpu_var_exists(addr, &size, &name))
2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 456)
continue; /* not a per-CPU variable */
the error is gone. I think we should check percpu_var_exists() before
checking var->ip.tag.type.
Hao
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH dwarves] cmake: make libbpf's Linux UAPI headers
2020-10-26 21:17 ` Hao Luo
@ 2020-10-26 21:19 ` Hao Luo
2020-10-26 21:39 ` Andrii Nakryiko
0 siblings, 1 reply; 5+ messages in thread
From: Hao Luo @ 2020-10-26 21:19 UTC (permalink / raw)
To: Jiri Olsa; +Cc: Arnaldo Carvalho de Melo, Andrii Nakryiko, dwarves, Jiri Olsa
Oops, sorry about my terrible formatting.
On Mon, Oct 26, 2020 at 2:17 PM Hao Luo <haoluo@google.com> wrote:
>
> On Mon, Oct 26, 2020 at 1:32 PM Jiri Olsa <jolsa@redhat.com> wrote:
> >
> > On Mon, Oct 26, 2020 at 04:58:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Hi guys,
> > >
> > > I just stumbled on this, investigating... This is with what is
> > > in the tmp branch at
> > > git://git.kernel.org/pub/scm/devel/pahole/pahole.git.
> > >
> > > error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
> > > Encountered error while encoding BTF.
> > > LD .tmp_vmlinux.kallsyms1
> > > KSYMS .tmp_vmlinux.kallsyms1.S
> > > AS .tmp_vmlinux.kallsyms1.S
> > > LD .tmp_vmlinux.kallsyms2
> > > KSYMS .tmp_vmlinux.kallsyms2.S
> > > AS .tmp_vmlinux.kallsyms2.S
> > > LD vmlinux
> > > BTFIDS vmlinux
> > > FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
> > > make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+'
> > > make: *** [Makefile:185: __sub-make] Error 2
> >
> > yep, I see the same and when I use --btf_encode_force,
> > it shows more of them:
> >
> > error: found variable in CU 'arch/x86/kernel/cpu/mce/core.c' that has void type
> > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > error: found variable in CU 'drivers/platform/x86/intel_pmc_core.c' that has void type
> >
> > I have no idea how variables are encoded in dwarf,
> > but I wonder it's another gcc bug ;-)
> >
> > jirka
> >
>
> Still looking. But I found if I move
>
> c815d266 (Hao Luo 2020-08-24 17:45:23 -0700 444)
> if (var->ip.tag.type == 0) {
> 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 445)
> fprintf(stderr, "error: found variable in CU '%s'
> that has void type\n",
> 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 446)
> cu->name);
> f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 447)
> if (force)
> f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 448)
> continue;
> f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 449)
> err = -1;
> f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 450)
> break;
> f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 451)
> }
> f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 452)
>
> after
>
> 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 453)
> type = var->ip.tag.type + type_id_off;
> 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 454)
> linkage = var->external ? BTF_VAR_GLOBAL_ALLOCATED :
> BTF_VAR_STATIC;
> 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 455)
> if (!percpu_var_exists(addr, &size, &name))
> 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 456)
> continue; /* not a per-CPU variable */
>
> the error is gone. I think we should check percpu_var_exists() before
> checking var->ip.tag.type.
>
> Hao
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH dwarves] cmake: make libbpf's Linux UAPI headers
2020-10-26 21:19 ` Hao Luo
@ 2020-10-26 21:39 ` Andrii Nakryiko
0 siblings, 0 replies; 5+ messages in thread
From: Andrii Nakryiko @ 2020-10-26 21:39 UTC (permalink / raw)
To: Hao Luo
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Andrii Nakryiko, dwarves, Jiri Olsa
On Mon, Oct 26, 2020 at 2:20 PM Hao Luo <haoluo@google.com> wrote:
>
> Oops, sorry about my terrible formatting.
>
>
> On Mon, Oct 26, 2020 at 2:17 PM Hao Luo <haoluo@google.com> wrote:
> >
> > On Mon, Oct 26, 2020 at 1:32 PM Jiri Olsa <jolsa@redhat.com> wrote:
> > >
> > > On Mon, Oct 26, 2020 at 04:58:30PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > Hi guys,
> > > >
> > > > I just stumbled on this, investigating... This is with what is
> > > > in the tmp branch at
> > > > git://git.kernel.org/pub/scm/devel/pahole/pahole.git.
> > > >
> > > > error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
> > > > Encountered error while encoding BTF.
> > > > LD .tmp_vmlinux.kallsyms1
> > > > KSYMS .tmp_vmlinux.kallsyms1.S
> > > > AS .tmp_vmlinux.kallsyms1.S
> > > > LD .tmp_vmlinux.kallsyms2
> > > > KSYMS .tmp_vmlinux.kallsyms2.S
> > > > AS .tmp_vmlinux.kallsyms2.S
> > > > LD vmlinux
> > > > BTFIDS vmlinux
> > > > FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
> > > > make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+'
> > > > make: *** [Makefile:185: __sub-make] Error 2
> > >
> > > yep, I see the same and when I use --btf_encode_force,
> > > it shows more of them:
> > >
> > > error: found variable in CU 'arch/x86/kernel/cpu/mce/core.c' that has void type
> > > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > > error: found variable in CU 'security/selinux/hooks.c' that has void type
> > > error: found variable in CU 'drivers/platform/x86/intel_pmc_core.c' that has void type
> > >
> > > I have no idea how variables are encoded in dwarf,
> > > but I wonder it's another gcc bug ;-)
> > >
> > > jirka
> > >
> >
> > Still looking. But I found if I move
> >
> > c815d266 (Hao Luo 2020-08-24 17:45:23 -0700 444)
> > if (var->ip.tag.type == 0) {
> > 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 445)
> > fprintf(stderr, "error: found variable in CU '%s'
> > that has void type\n",
> > 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 446)
> > cu->name);
> > f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 447)
> > if (force)
> > f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 448)
> > continue;
> > f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 449)
> > err = -1;
> > f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 450)
> > break;
> > f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 451)
> > }
> > f3d9054b (Hao Luo 2020-07-08 13:44:10 -0700 452)
> >
> > after
> >
> > 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 453)
> > type = var->ip.tag.type + type_id_off;
> > 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 454)
> > linkage = var->external ? BTF_VAR_GLOBAL_ALLOCATED :
> > BTF_VAR_STATIC;
> > 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 455)
> > if (!percpu_var_exists(addr, &size, &name))
> > 2e719cca (Andrii Nakryiko 2020-10-08 16:39:57 -0700 456)
> > continue; /* not a per-CPU variable */
> >
> > the error is gone. I think we should check percpu_var_exists() before
> > checking var->ip.tag.type.
sounds like a plan, can you please send a patch? Thanks!
> >
> > Hao
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-10-26 21:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 19:58 [PATCH dwarves] cmake: make libbpf's Linux UAPI headers Arnaldo Carvalho de Melo
2020-10-26 20:32 ` Jiri Olsa
2020-10-26 21:17 ` Hao Luo
2020-10-26 21:19 ` Hao Luo
2020-10-26 21:39 ` Andrii Nakryiko
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).