From: Jiri Olsa <jolsa@redhat.com>
To: Yonghong Song <yhs@fb.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
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>, Hao Luo <haoluo@google.com>,
"Frank Ch. Eigler" <fche@redhat.com>,
Mark Wielaard <mjw@redhat.com>
Subject: Re: [PATCH 2/2] btf_encoder: Change functions check due to broken dwarf
Date: Wed, 4 Nov 2020 00:18:27 +0100 [thread overview]
Message-ID: <20201103231827.GA3861143@krava> (raw)
In-Reply-To: <5bbb9838-d98a-c04d-ecba-878f2f934ae0@fb.com>
On Tue, Nov 03, 2020 at 12:27:56PM -0800, Yonghong Song wrote:
SNIP
> > > >
> > >
> > > bpf_map iter definition:
> > >
> > > DEFINE_BPF_ITER_FUNC(bpf_map, struct bpf_iter_meta *meta, struct bpf_map *map)
> > >
> > > goes to:
> > >
> > > #define DEFINE_BPF_ITER_FUNC(target, args...) \
> > > extern int bpf_iter_ ## target(args); \
> > > int __init bpf_iter_ ## target(args) { return 0; }
> > >
> > > that creates __init bpf_iter_bpf_map function that will make
> > > it into BTF where it's expected when opening iterator, but the
> > > code will be freed because it's __init function
> >
> > hm... should we just drop __init there?
> >
> > Yonghong, is __init strictly necessary, or was just an optimization to
> > save a tiny bit of space?
>
> It is an optimization to save some space. We only need function
> signature, not function body, for bpf_iter.
>
> The macro definition is in include/linux/bpf.h.
>
> #define DEFINE_BPF_ITER_FUNC(target, args...) \
> extern int bpf_iter_ ## target(args); \
> int __init bpf_iter_ ## target(args) { return 0; }
>
> Maybe you could have a section, e.g., called
> .init.bpf.preserve_type
> which you can scan through to preserve the types.
right, sounds good, will send v3 with that
thanks,
jirka
next prev parent reply other threads:[~2020-11-03 23:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-31 22:31 [PATCHv2 0/2] pahole: Workaround dwarf bug for function encoding Jiri Olsa
2020-10-31 22:31 ` [PATCH 1/2] btf_encoder: Move find_all_percpu_vars in generic collect_symbols Jiri Olsa
2020-11-02 18:29 ` Hao Luo
2020-11-03 17:31 ` Arnaldo Carvalho de Melo
2020-10-31 22:31 ` [PATCH 2/2] btf_encoder: Change functions check due to broken dwarf Jiri Olsa
2020-11-02 21:59 ` Jiri Olsa
2020-11-02 22:56 ` Jiri Olsa
2020-11-03 18:58 ` Andrii Nakryiko
2020-11-03 19:05 ` Jiri Olsa
2020-11-03 19:23 ` Andrii Nakryiko
2020-11-03 19:34 ` Jiri Olsa
2020-11-03 20:27 ` Yonghong Song
2020-11-03 23:18 ` Jiri Olsa [this message]
2020-11-03 18:55 ` Andrii Nakryiko
2020-11-03 23:22 ` 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=20201103231827.GA3861143@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;
as well as URLs for NNTP newsgroup(s).