From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Veronika Kabatova <vkabatov@redhat.com>,
Andrii Nakryiko <andriin@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
bpf <bpf@vger.kernel.org>, "Frank Ch. Eigler" <fche@redhat.com>,
Mark Wielaard <mjw@redhat.com>
Subject: Re: Build failures: unresolved symbol vfs_getattr
Date: Mon, 26 Oct 2020 15:06:09 -0700 [thread overview]
Message-ID: <CAEf4BzZgrEc=vBYq_KZ2xPkPOQOu14GJR1HZoA42fhZFJ2zC4A@mail.gmail.com> (raw)
In-Reply-To: <20201026101441.GA2726983@krava>
On Mon, Oct 26, 2020 at 3:14 AM Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Fri, Oct 23, 2020 at 11:22:05AM -0700, Andrii Nakryiko wrote:
> > On Thu, Oct 22, 2020 at 11:58 PM Jiri Olsa <jolsa@redhat.com> wrote:
> > >
> > > On Fri, Oct 23, 2020 at 07:36:57AM +0200, Jiri Olsa wrote:
> > > > On Thu, Oct 22, 2020 at 01:00:19PM -0700, Andrii Nakryiko wrote:
> > > >
> > > > SNIP
> > > >
> > > > > >
> > > > > > hi,
> > > > > > FYI there's still no solution yet, so far the progress is:
> > > > > >
> > > > > > the proposed workaround was to use the negation -> we don't have
> > > > > > DW_AT_declaration tag, so let's find out instead which DW_TAG_subprogram
> > > > > > tags have attached code and skip them if they don't have any:
> > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060#c10
> > > > > >
> > > > > > the attached patch is doing that, but the resulting BTF is missing
> > > > > > several functions due to another bug in dwarf:
> > > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1890107
> > > > >
> > > > > It seems fine if there are only few functions (especially if those are
> > > > > unlikely to be traced). Do you have an estimate of how many functions
> > > > > have this second DWARF bug?
> > > >
> > > > it wasn't that many, I'll recheck
> > >
> > > 127 functions missing if the workaround is applied, list attached
> > >
> >
> > some of those seem pretty useful... I guess the quick workaround in
> > pahole would be to just remember function names that were emitted
> > already. The problem with that is that we can pick a version without
> > parameter names, which is not the end of the world, but certainly
> > annoying.
>
> with the change below I seem to get all argument names
>
> the change assumes that we can skip dwarf functions with
> no argument names, because if the function is defined in
> the object, it needs to have argument names
I'd love it if it was that simple, but I learn time and time again
that DWARF and compilers tend to always have some bugs and gotchas
with type information. But let's try and see, of course.
>
> so there will be eventualy dwarf definition of that function
> with full argument names
>
> I wonder we could use this code as a check that the function
> is present in the object ;-) but I think we need to keep
> the symbols check as well
>
> I'll send that out together with the rest of the changes
>
> jirka
>
>
> ---
> diff --git a/btf_encoder.c b/btf_encoder.c
> index 7e370eb48174..0c14ac210425 100644
> --- a/btf_encoder.c
> +++ b/btf_encoder.c
> @@ -397,6 +397,19 @@ static int config(struct btf_elf *btfe, bool do_percpu_vars)
> return 0;
> }
>
> +static bool has_arg_names(struct cu *cu, struct ftype *ftype)
> +{
> + struct parameter *param;
> + const char *name;
> +
> + ftype__for_each_parameter(ftype, param) {
> + name = dwarves__active_loader->strings__ptr(cu, param->name);
> + if (name == NULL)
> + return false;
> + }
> + return true;
> +}
> +
> int cu__encode_btf(struct cu *cu, int verbose, bool force,
> bool skip_encoding_vars)
> {
> @@ -472,6 +485,9 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
> int btf_fnproto_id, btf_fn_id;
> const char *name;
>
> + if (!has_arg_names(cu, &fn->proto))
> + continue;
> +
> if (!generate_func(btfe, function__name(fn, cu)))
> continue;
>
>
prev parent reply other threads:[~2020-10-26 22:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1723352278.11013122.1600093319730.JavaMail.zimbra@redhat.com>
2020-09-14 14:48 ` Build failures: unresolved symbol vfs_getattr Veronika Kabatova
2020-09-14 18:25 ` Jiri Olsa
2020-09-14 22:26 ` Andrii Nakryiko
2020-09-15 7:30 ` Jiri Olsa
2020-09-15 12:17 ` Jiri Olsa
2020-09-16 9:06 ` Jiri Olsa
2020-10-16 21:38 ` Jiri Olsa
2020-10-21 19:42 ` Jiri Olsa
2020-10-22 20:00 ` Andrii Nakryiko
2020-10-23 5:36 ` Jiri Olsa
2020-10-23 6:58 ` Jiri Olsa
2020-10-23 18:22 ` Andrii Nakryiko
2020-10-23 20:17 ` Jiri Olsa
2020-10-23 20:32 ` Andrii Nakryiko
2020-10-23 20:45 ` Jiri Olsa
2020-10-23 22:02 ` Andrii Nakryiko
2020-10-26 10:14 ` Jiri Olsa
2020-10-26 22:06 ` Andrii Nakryiko [this message]
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='CAEf4BzZgrEc=vBYq_KZ2xPkPOQOu14GJR1HZoA42fhZFJ2zC4A@mail.gmail.com' \
--to=andrii.nakryiko@gmail.com \
--cc=acme@redhat.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=fche@redhat.com \
--cc=jolsa@redhat.com \
--cc=mjw@redhat.com \
--cc=vkabatov@redhat.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).