From: Jiri Olsa <jolsa@redhat.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andriin@fb.com>, Yonghong Song <yhs@fb.com>,
Hao Luo <haoluo@google.com>, "Frank Ch. Eigler" <fche@redhat.com>,
Mark Wielaard <mjw@redhat.com>
Subject: Re: [PATCH 1/3] btf_encoder: Move find_all_percpu_vars in generic config function
Date: Wed, 28 Oct 2020 16:51:14 +0100 [thread overview]
Message-ID: <20201028155114.GQ2900849@krava> (raw)
In-Reply-To: <CAEf4Bzan6=Jjfez17=S55Zu9EQTF_J2dg2DST4v+CfENm8cbUQ@mail.gmail.com>
On Tue, Oct 27, 2020 at 04:12:04PM -0700, Andrii Nakryiko wrote:
> On Mon, Oct 26, 2020 at 5:07 PM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > Moving find_all_percpu_vars under generic onfig function
> > that walks over symbols and calls config_percpu_var.
> >
> > We will add another config function that needs to go
> > through all the symbols, so it's better they go through
> > them just once.
> >
> > There's no functional change intended.
> >
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> > btf_encoder.c | 126 ++++++++++++++++++++++++++------------------------
> > 1 file changed, 66 insertions(+), 60 deletions(-)
> >
> > diff --git a/btf_encoder.c b/btf_encoder.c
> > index 2a6455be4c52..2dd26c904039 100644
> > --- a/btf_encoder.c
> > +++ b/btf_encoder.c
> > @@ -250,7 +250,64 @@ static bool percpu_var_exists(uint64_t addr, uint32_t *sz, const char **name)
> > return true;
> > }
> >
> > -static int find_all_percpu_vars(struct btf_elf *btfe)
> > +static int config_percpu_var(struct btf_elf *btfe, GElf_Sym *sym)
>
> I find the "config" name completely misleading. How about
> "collect_percpu_var" or something along those lines?
ok
>
> > +{
> > + const char *sym_name;
> > + uint64_t addr;
> > + uint32_t size;
> > +
>
> [...]
>
> > +}
> > +
> > +static int config(struct btf_elf *btfe, bool do_percpu_vars)
>
> same here, config is generic and misrepresenting what we are doing
> here. E.g., collect_symbols would probably be more clear.
ook
jirka
>
> > {
> > uint32_t core_id;
> > GElf_Sym sym;
>
> [...]
>
next prev parent reply other threads:[~2020-10-28 21:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 22:36 [RFC 0/3] pahole: Workaround dwarf bug for function encoding Jiri Olsa
2020-10-26 22:36 ` [PATCH 1/3] btf_encoder: Move find_all_percpu_vars in generic config function Jiri Olsa
2020-10-27 23:12 ` Andrii Nakryiko
2020-10-27 23:54 ` Hao Luo
2020-10-28 15:51 ` Jiri Olsa [this message]
2020-10-26 22:36 ` [PATCH 2/3] btf_encoder: Change functions check due to broken dwarf Jiri Olsa
2020-10-27 23:20 ` Andrii Nakryiko
2020-10-28 15:50 ` Jiri Olsa
2020-10-26 22:36 ` [PATCH 3/3] btf_encoder: Include static functions to BTF data Jiri Olsa
2020-10-27 23:21 ` Andrii Nakryiko
2020-10-28 15:53 ` Jiri Olsa
2020-10-27 23:13 ` [RFC 0/3] pahole: Workaround dwarf bug for function encoding Andrii Nakryiko
2020-10-28 15:49 ` Jiri Olsa
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=20201028155114.GQ2900849@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=fche@redhat.com \
--cc=haoluo@google.com \
--cc=jolsa@kernel.org \
--cc=mjw@redhat.com \
--cc=yhs@fb.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