Dwarves Archive on lore.kernel.org
 help / color / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Andrii Nakryiko <andriin@fb.com>,
	dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH dwarves 04/11] btf_loader: use libbpf to load BTF
Date: Thu, 8 Oct 2020 12:32:42 -0700
Message-ID: <CAEf4BzbOUQv0JQqJ=BuTkKz5XFo=ZpiskaXEmeEfsgTD5_eBmw@mail.gmail.com> (raw)
In-Reply-To: <20201008180651.GD246083@kernel.org>

On Thu, Oct 8, 2020 at 11:59 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Tue, Sep 29, 2020 at 09:27:35PM -0700, Andrii Nakryiko escreveu:
> > Switch BTF loading to completely use libbpf's own struct btf and related APIs.
> > BTF encoding is still happening with pahole's own code, so these two code
> > paths are not sharing anything now. String fetching is happening based on
> > whether btfe->strings were set to non-NULL pointer by btf_encoder.
>
> This patch is not applying, since there was a fix in the btf_loader.c
> file where lexblocks (DWARF concept) wasn't being initialized and then
> some other tool was segfaulting when trying to traverse an uninitialized
> list.
>
> I tried applying this patch by hand, but it seems it needs some
> massaging before I can use plain vim on it:
>
> diff --git a/btf_loader.c b/btf_loader.c
> index 9db76957a7e5..c31ee61060f1 100644
> --- a/btf_loader.c
> +++ b/btf_loader.c
> @@ -46,21 +46,17 @@ static void *tag__alloc(const size_t size)
>  }
> =20
>  static int btf_elf__load_ftype(struct btf_elf *btfe, struct ftype *proto=
> , uint32_t tag,
> -                              uint32_t type, uint16_t vlen, struct btf_param *args, uint32_t=
>  id)
> +                              const struct btf_type *tp, uint32_t id)
>  {
> -       int i;
> +       const struct btf_param *param =3D btf_params(tp);
> +       int i, vlen =3D btf_vlen(tp);
> =20
>         proto->tag.tag  =3D tag;
> -       proto->tag.type =3D type;
> +       proto->tag.type =3D tp->type;
>         INIT_LIST_HEAD(&proto->parms);
> =20
> -       for (i =3D 0; i < vlen; ++i) {
>
>
> Can you please check?
>
> The first three patches are already applied an in master, both at
> kernel.org and its mirror at github.com.

Sure, no problem. I'll rebase the rest and post as v2.

>
> - Arnaldo
>

[...]

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30  4:27 [PATCH dwarves 00/11] Switch BTF loading and encoding to libbpf APIs Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 01/11] libbpf: update to latest libbpf version Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 02/11] btf_encoder: detect BTF encoding errors and exit Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 03/11] dwarves: expose and maintain active debug info loader operations Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 04/11] btf_loader: use libbpf to load BTF Andrii Nakryiko
2020-10-08 18:06   ` Arnaldo Carvalho de Melo
2020-10-08 19:32     ` Andrii Nakryiko [this message]
2020-09-30  4:27 ` [PATCH dwarves 05/11] btf_encoder: use libbpf APIs to encode BTF type info Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 06/11] btf_encoder: fix emitting __ARRAY_SIZE_TYPE__ as index range type Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 07/11] btf_encoder: discard CUs after BTF encoding Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 08/11] btf_encoder: revamp how per-CPU variables are encoded Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 09/11] dwarf_loader: increase the size of lookup hash map Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 10/11] strings: use BTF's string APIs for strings management Andrii Nakryiko
2020-09-30  4:27 ` [PATCH dwarves 11/11] btf_encoder: support cross-compiled ELF binaries with different endianness 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='CAEf4BzbOUQv0JQqJ=BuTkKz5XFo=ZpiskaXEmeEfsgTD5_eBmw@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=acme@kernel.org \
    --cc=andriin@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    /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

Dwarves Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dwarves/0 dwarves/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dwarves dwarves/ https://lore.kernel.org/dwarves \
		dwarves@vger.kernel.org
	public-inbox-index dwarves

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dwarves


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git