All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andriin@fb.com>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH v6 bpf-next 0/9] bpf: Add d_path helper - preparation changes
Date: Sat, 11 Jul 2020 22:03:46 +0200	[thread overview]
Message-ID: <20200711200346.GA5823@krava> (raw)
In-Reply-To: <CAEf4BzbejJeaG-kffJf-tM_a7kMDET7n3Nu4dJB+jKRicc90Qw@mail.gmail.com>

On Fri, Jul 10, 2020 at 01:46:02PM -0700, Andrii Nakryiko wrote:
> On Fri, Jul 10, 2020 at 12:38 PM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > hi,
> > this patchset does preparation work for adding d_path helper,
> > which still needs more work, but the initial set of patches
> > is ready and useful to have.
> >
> > This patchset adds:
> >   - support to generate BTF ID lists that are resolved during
> >     kernel linking and usable within kernel code with following
> >     macros:
> >
> >       BTF_ID_LIST(bpf_skb_output_btf_ids)
> >       BTF_ID(struct, sk_buff)
> >
> >     and access it in kernel code via:
> >       extern u32 bpf_skb_output_btf_ids[];
> >
> >   - resolve_btfids tool that scans elf object for .BTF_ids
> >     section and resolves its symbols with BTF ID values
> >   - resolving of bpf_ctx_convert struct and several other
> >     objects with BTF_ID_LIST
> >
> > v6 changes:
> >   - added acks
> >   - added general make rule to resolve_btfids Build [Andrii]
> >   - renamed .BTF.ids to .BTF_ids [Andrii]
> >   - added --no-fail option to resolve_btfids [Andrii]
> >   - changed resolve_btfids test to work over BTF from object
> >     file, so we don't depend on vmlinux BTF [Andrii]
> >   - fixed few typos [Andrii]
> >   - fixed the out of tree build [Andrii]
> >
> > Also available at:
> >   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> >   bpf/d_path
> >
> > thanks,
> > jirka
> >
> >
> > ---
> 
> You've missed fixing bpf_get_task_stack_proto with your
> BTF_IDS_LIST/BTF_ID macro. It's currently failing in subtests. With
> BTF_IDS_LIST/BTF_ID trivial fix it works again. Please fix that before
> this can be applied.

ugh.. moving fast ;-) some of the selftests are failing for me
on regular basis, I overlooked this one, sry

> 
> btf_data.c could also use some name-conflicting entries, just to make
> sure that kind (struct vs typedef) is taken into account. Maybe just
> add some dummy `typedef int S;` or something?

sure.. and I had to change resolve_btfids a bit because of that,
so I'll not add your ack to first patch yet

I'll send the new version shortly

thanks,
jirka

> 
> So with the above, please add for the next revision:
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> Tested-by: Andrii Nakryiko <andriin@fb.com>
> 
> > Jiri Olsa (9):
> >       bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object
> >       bpf: Compile resolve_btfids tool at kernel compilation start
> >       bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros
> >       bpf: Resolve BTF IDs in vmlinux image
> >       bpf: Remove btf_id helpers resolving
> >       bpf: Use BTF_ID to resolve bpf_ctx_convert struct
> >       bpf: Add info about .BTF_ids section to btf.rst
> >       tools headers: Adopt verbatim copy of btf_ids.h from kernel sources
> >       selftests/bpf: Add test for resolve_btfids
> >
> >  Documentation/bpf/btf.rst                               |  36 +++++
> >  Makefile                                                |  25 +++-
> >  include/asm-generic/vmlinux.lds.h                       |   4 +
> >  include/linux/btf_ids.h                                 |  87 ++++++++++++
> >  kernel/bpf/btf.c                                        | 103 ++------------
> >  kernel/trace/bpf_trace.c                                |   9 +-
> >  net/core/filter.c                                       |   9 +-
> >  scripts/link-vmlinux.sh                                 |   6 +
> >  tools/Makefile                                          |   3 +
> >  tools/bpf/Makefile                                      |   9 +-
> >  tools/bpf/resolve_btfids/Build                          |  10 ++
> >  tools/bpf/resolve_btfids/Makefile                       |  77 +++++++++++
> >  tools/bpf/resolve_btfids/main.c                         | 721 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tools/include/linux/btf_ids.h                           |  87 ++++++++++++
> >  tools/include/linux/compiler.h                          |   4 +
> >  tools/testing/selftests/bpf/Makefile                    |  14 +-
> >  tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 107 ++++++++++++++
> >  tools/testing/selftests/bpf/progs/btf_data.c            |  26 ++++
> >  18 files changed, 1234 insertions(+), 103 deletions(-)
> >  create mode 100644 include/linux/btf_ids.h
> >  create mode 100644 tools/bpf/resolve_btfids/Build
> >  create mode 100644 tools/bpf/resolve_btfids/Makefile
> >  create mode 100644 tools/bpf/resolve_btfids/main.c
> >  create mode 100644 tools/include/linux/btf_ids.h
> >  create mode 100644 tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> >  create mode 100644 tools/testing/selftests/bpf/progs/btf_data.c
> >
> 


      reply	other threads:[~2020-07-11 20:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 19:37 [PATCH v6 bpf-next 0/9] bpf: Add d_path helper - preparation changes Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 1/9] bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 2/9] bpf: Compile resolve_btfids tool at kernel compilation start Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 3/9] bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 4/9] bpf: Resolve BTF IDs in vmlinux image Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 5/9] bpf: Remove btf_id helpers resolving Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 6/9] bpf: Use BTF_ID to resolve bpf_ctx_convert struct Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 7/9] bpf: Add info about .BTF_ids section to btf.rst Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 8/9] tools headers: Adopt verbatim copy of btf_ids.h from kernel sources Jiri Olsa
2020-07-10 19:37 ` [PATCH v6 bpf-next 9/9] selftests/bpf: Add test for resolve_btfids Jiri Olsa
2020-07-10 20:46 ` [PATCH v6 bpf-next 0/9] bpf: Add d_path helper - preparation changes Andrii Nakryiko
2020-07-11 20:03   ` Jiri Olsa [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=20200711200346.GA5823@krava \
    --to=jolsa@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=netdev@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
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.