From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
haoluo@google.com, Andrii Nakryiko <andriin@fb.com>,
Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
olegrom@google.com, Martin KaFai Lau <kafai@fb.com>
Subject: Re: accessing global and per-cpu vars
Date: Fri, 22 May 2020 11:28:13 -0300 [thread overview]
Message-ID: <20200522142813.GF14034@kernel.org> (raw)
In-Reply-To: <CAEf4BzZVVgMbNE4d7b5kPUoWPJz-ENgyP1BfC+h-X29r1Pk2fA@mail.gmail.com>
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@gmail.com> 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
next prev parent reply other threads:[~2020-05-22 14:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 17:03 accessing global and per-cpu vars Alexei Starovoitov
2020-05-21 18:58 ` Andrii Nakryiko
2020-05-22 14:28 ` Arnaldo Carvalho de Melo [this message]
[not found] ` <CA+khW7j=ejncVYgY=hKEnkrkwA=Wjwa6Y2PFWgzrV1EV_8rvpw@mail.gmail.com>
2020-05-26 18:20 ` Andrii Nakryiko
[not found] ` <CA+khW7ha-5YSgm5kARO=+JEtf-Ahmc1N_TBJ2iLSntk12pfy3w@mail.gmail.com>
[not found] ` <CA+khW7hqemc+xsbMQq-DW3X+mHKO+Lm64hNpWNRyZ75MkUa0Gg@mail.gmail.com>
2020-05-28 20:58 ` Arnaldo Carvalho de Melo
2020-05-28 20:58 ` Andrii Nakryiko
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=20200522142813.GF14034@kernel.org \
--to=acme@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=kafai@fb.com \
--cc=olegrom@google.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 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.