Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1541902 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-12-14 14:30 +0100 |
| Last post | 2016-12-15 16:40 +0100 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCHv3 perf/core 0/7] Reuse libbpf from samples/bpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-12-14 14:30 +0100
Re: [PATCHv3 perf/core 0/7] Reuse libbpf from samples/bpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-12-14 16:00 +0100
Re: [PATCHv3 perf/core 0/7] Reuse libbpf from samples/bpf Joe Stringer <joe@ovn.org> - 2016-12-14 23:50 +0100
Re: [PATCHv3 perf/core 0/7] Reuse libbpf from samples/bpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-12-15 15:40 +0100
Re: [PATCHv3 perf/core 0/7] Reuse libbpf from samples/bpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-12-15 16:40 +0100
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-12-14 14:30 +0100 |
| Subject | Re: [PATCHv3 perf/core 0/7] Reuse libbpf from samples/bpf |
| Message-ID | <sOhN8-6XS-15@gated-at.bofh.it> |
Em Fri, Dec 09, 2016 at 04:30:54PM +0100, Daniel Borkmann escreveu: > Hi Arnaldo, > > On 12/09/2016 04:09 PM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Dec 08, 2016 at 06:46:13PM -0800, Joe Stringer escreveu: > > > (Was "libbpf: Synchronize implementations") > > > > > > Update tools/lib/bpf to provide the remaining bpf wrapper pieces needed by the > > > samples/bpf/ code, then get rid of all of the duplicate BPF libraries in > > > samples/bpf/libbpf.[ch]. > > > > > > --- > > > v3: Add ack for first patch. > > > Split out second patch from v2 into separate changes for remaining diff. > > > Add patches to switch samples/bpf over to using tools/lib/. > > > v2: https://www.mail-archive.com/netdev@vger.kernel.org/msg135088.html > > > Don't shift non-bpf code into libbpf. > > > Drop the patch to synchronize ELF definitions with tc. > > > v1: https://www.mail-archive.com/netdev@vger.kernel.org/msg135088.html > > > First post. > > > > Thanks, applied after addressing the -I$(objtree) issue raised by Wang, > > [ Sorry for late reply. ] > > First of all, glad to see us getting rid of the duplicate lib eventually! :) > > Please note that this might result in hopefully just a minor merge issue > with net-next. Looks like patch 4/7 touches test_maps.c and test_verifier.c, > which moved to a new bpf selftest suite [1] this net-next cycle. Seems it's > just log buffer and some renames there, which can be discarded for both > files sitting in selftests. Yeah, I've got to this point, and the merge has a little bit more than that, including BPF_PROG_ATTACH/BPF_PROG_DETACH, etc, working on it... - Arnaldo
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-12-14 16:00 +0100 |
| Message-ID | <sOjcd-7GR-21@gated-at.bofh.it> |
| In reply to | #1541902 |
Em Wed, Dec 14, 2016 at 10:25:01AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Dec 09, 2016 at 04:30:54PM +0100, Daniel Borkmann escreveu:
> > On 12/09/2016 04:09 PM, Arnaldo Carvalho de Melo wrote:
> > > > v3: Add ack for first patch.
> > > > Split out second patch from v2 into separate changes for remaining diff.
> > > > Add patches to switch samples/bpf over to using tools/lib/.
> > > > v2: https://www.mail-archive.com/netdev@vger.kernel.org/msg135088.html
> > > > Don't shift non-bpf code into libbpf.
> > > > Drop the patch to synchronize ELF definitions with tc.
> > > > v1: https://www.mail-archive.com/netdev@vger.kernel.org/msg135088.html
> > > > First post.
> > > Thanks, applied after addressing the -I$(objtree) issue raised by Wang,
> > [ Sorry for late reply. ]
> > First of all, glad to see us getting rid of the duplicate lib eventually! :)
> >
> > Please note that this might result in hopefully just a minor merge issue
> > with net-next. Looks like patch 4/7 touches test_maps.c and test_verifier.c,
> > which moved to a new bpf selftest suite [1] this net-next cycle. Seems it's
> > just log buffer and some renames there, which can be discarded for both
> > files sitting in selftests.
>
> Yeah, I've got to this point, and the merge has a little bit more than
> that, including BPF_PROG_ATTACH/BPF_PROG_DETACH, etc, working on it...
So, Joe, can you try refreshing this work, starting from what I have in
perf/core? It has the changes coming from net-next that Daniel warned us about
and some more.
[acme@jouet linux]$ git log --oneline -5
1f125a4aa4d8 tools lib bpf: Add flags to bpf_create_map()
5adf5614f72d tools lib bpf: use __u32 from linux/types.h
ff687c38d803 tools lib bpf: Sync {tools,}/include/uapi/linux/bpf.h
53452c69b4c3 perf annotate: Fix jump target outside of function address range
2f41ae602b57 perf annotate: Support jump instruction with target as second operand
[acme@jouet linux]$
I tried refreshing it, but it seems samples/bpf/ needs some love and
care first, as I can't get it to build before these patches, to make
sure nothing gets broken.
Trying to bisect it I get to what seems multiple bisect breakages, last
tag I got it to build, with lots of warnings, was v4.8, after that I get
things like the ones below.
I could try fixing it, but may be missing something, and want to push the other
stuff in this branch...
[acme@jouet linux]$ egrep SAMPLES\|BPF .config
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NET_CLS_BPF=m
CONFIG_NET_ACT_BPF=m
CONFIG_BPF_JIT=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_BPF_EVENTS=y
# CONFIG_TEST_BPF is not set
CONFIG_SAMPLES=y
[acme@jouet linux]$
[acme@jouet linux]$ make -C samples/bpf
make: Entering directory '/home/acme/git/linux/samples/bpf'
make -C ../../ $PWD/
make[1]: Entering directory '/home/acme/git/linux'
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/timeconst.h
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC /home/acme/git/linux/samples/bpf/bpf_load.o
In file included from /home/acme/git/linux/samples/bpf/bpf_load.c:21:0:
/home/acme/git/linux/samples/bpf/bpf_helpers.h:76:11: error: ‘BPF_FUNC_skb_in_cgroup’ undeclared here (not in a function)
(void *) BPF_FUNC_skb_in_cgroup;
^~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.host:124: recipe for target '/home/acme/git/linux/samples/bpf/bpf_load.o' failed
make[2]: *** [/home/acme/git/linux/samples/bpf/bpf_load.o] Error 1
Makefile:1646: recipe for target '/home/acme/git/linux/samples/bpf/' failed
[acme@jouet linux]$ make -C samples/bpf
make: Entering directory '/home/acme/git/linux/samples/bpf'
make -C ../../ $PWD/
make[1]: Entering directory '/home/acme/git/linux'
scripts/kconfig/conf --silentoldconfig Kconfig
#
# configuration written to .config
#
SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_32_ia32.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h
CHK include/config/kernel.release
UPD include/config/kernel.release
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CHK include/generated/timeconst.h
CC kernel/bounds.s
CHK include/generated/bounds.h
GEN scripts/gdb/linux/constants.py
CC arch/x86/kernel/asm-offsets.s
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC /home/acme/git/linux/samples/bpf/bpf_load.o
In file included from /home/acme/git/linux/samples/bpf/bpf_load.c:21:0:
/home/acme/git/linux/samples/bpf/bpf_helpers.h:49:11: error: ‘BPF_FUNC_current_task_under_cgroup’ undeclared here (not in a function)
(void *) BPF_FUNC_current_task_under_cgroup;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/acme/git/linux/samples/bpf/bpf_helpers.h:80:11: error: ‘BPF_FUNC_skb_in_cgroup’ undeclared here (not in a function)
(void *) BPF_FUNC_skb_in_cgroup;
^~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.host:124: recipe for target '/home/acme/git/linux/samples/bpf/bpf_load.o' failed
[toc] | [prev] | [next] | [standalone]
| From | Joe Stringer <joe@ovn.org> |
|---|---|
| Date | 2016-12-14 23:50 +0100 |
| Message-ID | <sOqx4-6d9-37@gated-at.bofh.it> |
| In reply to | #1541971 |
On 14 December 2016 at 06:55, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Em Wed, Dec 14, 2016 at 10:25:01AM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Fri, Dec 09, 2016 at 04:30:54PM +0100, Daniel Borkmann escreveu:
>> > On 12/09/2016 04:09 PM, Arnaldo Carvalho de Melo wrote:
>> > Please note that this might result in hopefully just a minor merge issue
>> > with net-next. Looks like patch 4/7 touches test_maps.c and test_verifier.c,
>> > which moved to a new bpf selftest suite [1] this net-next cycle. Seems it's
>> > just log buffer and some renames there, which can be discarded for both
>> > files sitting in selftests.
>>
>> Yeah, I've got to this point, and the merge has a little bit more than
>> that, including BPF_PROG_ATTACH/BPF_PROG_DETACH, etc, working on it...
>
> So, Joe, can you try refreshing this work, starting from what I have in
> perf/core? It has the changes coming from net-next that Daniel warned us about
> and some more.
Hi Arnaldo,
I've just respun this series based on the version you previously
applied to perf/core. Since bpf_prog_{attach,detach}() were added to
samples/libbpf, a new patch will shift these over to tools/lib/bpf.
Other than that, I folded "samples/bpf: Drop unnecessary build
targets." back into "samples/bpf: Switch over to libbpf", and I
noticed that there were a couple of unnecessary log buffers with the
latest changes. For any new sample programs, those were fixed up to
use libbpf as well.
Don't forget to do a "make headers_install" before attempting to build
the samples, access to the latest headers is required (as per the
readme in samples/bpf).
Thanks,
Joe
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-12-15 15:40 +0100 |
| Message-ID | <sOFmp-6RD-25@gated-at.bofh.it> |
| In reply to | #1542291 |
Em Wed, Dec 14, 2016 at 02:46:23PM -0800, Joe Stringer escreveu:
> On 14 December 2016 at 06:55, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > So, Joe, can you try refreshing this work, starting from what I have in
> > perf/core? It has the changes coming from net-next that Daniel warned us about
> > and some more.
> I've just respun this series based on the version you previously
> applied to perf/core. Since bpf_prog_{attach,detach}() were added to
> samples/libbpf, a new patch will shift these over to tools/lib/bpf.
> Other than that, I folded "samples/bpf: Drop unnecessary build
> targets." back into "samples/bpf: Switch over to libbpf", and I
> noticed that there were a couple of unnecessary log buffers with the
> latest changes. For any new sample programs, those were fixed up to
> use libbpf as well.
> Don't forget to do a "make headers_install" before attempting to build
> the samples, access to the latest headers is required (as per the
> readme in samples/bpf).
Ah, README, I should read that ;-)
I got used to how tools/perf/ work, i.e. it is self sufficient wrt
in-flux stuff in the kernel, i.e. headers that are related to features
it supports and that are under constant improvements, such as eBPF, kvm,
syscall tables, etc.
Anyway, will do the headers_install step inside a container, to avoid
polluting my workstation.
Thanks for doing the respin and for the clarifications about building
samples/bpf/.
- Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-12-15 16:40 +0100 |
| Message-ID | <sOGit-7uh-5@gated-at.bofh.it> |
| In reply to | #1542783 |
Em Thu, Dec 15, 2016 at 11:33:29AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Dec 14, 2016 at 02:46:23PM -0800, Joe Stringer escreveu:
> > On 14 December 2016 at 06:55, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > So, Joe, can you try refreshing this work, starting from what I have in
> > > perf/core? It has the changes coming from net-next that Daniel warned us about
> > > and some more.
>
> > I've just respun this series based on the version you previously
> > applied to perf/core. Since bpf_prog_{attach,detach}() were added to
> > samples/libbpf, a new patch will shift these over to tools/lib/bpf.
> > Other than that, I folded "samples/bpf: Drop unnecessary build
> > targets." back into "samples/bpf: Switch over to libbpf", and I
> > noticed that there were a couple of unnecessary log buffers with the
> > latest changes. For any new sample programs, those were fixed up to
> > use libbpf as well.
>
> > Don't forget to do a "make headers_install" before attempting to build
> > the samples, access to the latest headers is required (as per the
> > readme in samples/bpf).
>
> Ah, README, I should read that ;-)
>
> I got used to how tools/perf/ work, i.e. it is self sufficient wrt
> in-flux stuff in the kernel, i.e. headers that are related to features
> it supports and that are under constant improvements, such as eBPF, kvm,
> syscall tables, etc.
>
> Anyway, will do the headers_install step inside a container, to avoid
> polluting my workstation.
heh: should've read that file, now I did:
<quote>
There are usually dependencies to header files of the current kernel.
To avoid installing devel kernel headers system wide, as a normal
user, simply call::
make headers_install
This will creates a local "usr/include" directory in the git/build top
level directory, that the make system automatically pickup first.
</quote>
> Thanks for doing the respin and for the clarifications about building
> samples/bpf/.
>
> - Arnaldo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web