Em Thu, May 21, 2020 at 11:58:47AM -0700, Andrii Nakryiko escreveu: > On Thu, May 21, 2020 at 10:07 AM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > 2. teach pahole to store ' A ' annotated kallsyms into vmlinux BTF as > > BTF_KIND_VAR. > > There are ~300 of them, so should be minimal increase in size. > > I thought we'd do that based on section name? Or we will actually > teach pahole to extract kallsyms from vmlinux image? No need to touch kallsyms: net/core/filter.c DEFINE_PER_CPU(struct bpf_redirect_info, bpf_redirect_info); # grep -w bpf_redirect_info /proc/kallsyms 000000000002a160 A bpf_redirect_info # # readelf -s ~acme/git/build/v5.7-rc2+/vmlinux | grep bpf_redirect_info 113637: 000000000002a2e0 32 OBJECT GLOBAL DEFAULT 34 bpf_redirect_info # Its in the ELF symtab. [root@quaco ~]# grep ' A ' /proc/kallsyms | wc -l 351 [root@quaco ~]# readelf -s ~acme/git/build/v5.7-rc2+/vmlinux | grep "OBJECT GLOBAL" | wc -l 3221 [root@quaco ~]# So ' A ' in kallsyms needs some extra info from the symtab in addition to being OBJECT GLOBAL, checking... > There was step 1.5 (or even 0.5) to see if it's feasible to add not > just per-CPU variables as well. - Arnaldo