All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kubakici@wp.pl>
To: David Ahern <dsahern@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	xdp-newbies@vger.kernel.org, ast@fb.com,
	Martin KaFai Lau <kafai@fb.com>,
	Hannes Frederic Sowa <hannes@redhat.com>
Subject: Re: XDP/BPF C and python libraries?
Date: Sat, 5 Aug 2017 09:40:58 -0700	[thread overview]
Message-ID: <20170805094058.42b2fe3e@cakuba> (raw)
In-Reply-To: <e3f6bfa8-abee-4467-9647-4c6ab7e8232a@gmail.com>

On Fri, 4 Aug 2017 16:20:19 -0600, David Ahern wrote:
> On 7/22/17 1:20 AM, Jakub Kicinski wrote:
> > I put together this very simple tool with iproute2-like syntax:
> > 
> > https://github.com/Netronome/bpf-tool
> > 
> > These are available subcommands:
> >   
> 
> Looking to add my code that pretty-prints instructions, but having
> trouble building the tool. What bpf headers should be installed? e.g.,
> <bpf/bpf.h>. hunting and pecking now based on what is in the kernel tree.

Hmm..  Did you run make install_headers?  I think my commit message
diverged from what the Makefile does.  To keep things in line with
tools/lib/traceevent/Makefile I made it a separate target.

I just tested on fresh Fedora 26 w/ net-next:

$ git rev-parse HEAD
a54df682e559da9cf09b41779ee62bc9f11d3804
$ make headers_install INSTALL_HDR_PATH=/usr/
[...]
$ cd tools/lib/bpf/
$ make -j 6
Auto-detecting system features:
...                        libelf: [ on  ]
...                           bpf: [ on  ]

Warning: tools/include/uapi/linux/bpf.h differs from kernel
  CC       libbpf.o
  CC       bpf.o
  LD       libbpf-in.o
  LINK     libbpf.a
  LINK     libbpf.so
$ sudo make install prefix=/usr/
Password: 
Warning: tools/include/uapi/linux/bpf.h differs from kernel
  INSTALL  libbpf.a
  INSTALL  libbpf.so
$ sudo make install_headers
  INSTALL  headers
$ cd ../bpf-tool
$ make
gcc -std=gnu99 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow   -c -MMD -o bpf-map.o bpf-map.c
gcc -std=gnu99 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow   -c -MMD -o bpf-prog.o bpf-prog.c
gcc -std=gnu99 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow   -c -MMD -o bpf-common.o bpf-common.c
gcc -std=gnu99 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow   -c -MMD -o bpf-jit-disasm.o bpf-jit-disasm.c
gcc -std=gnu99 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow -o bpftool bpf.o bpf-map.o bpf-prog.o bpf-common.o bpf-jit-disasm.o -lelf -lbpf -lelf -lbfd -lopcodes
$ ./bpftool 
Usage: ./bpftool OBJECT { COMMAND | help }
       ./bpftool batch file FILE

       OBJECT := { program | map }

  reply	other threads:[~2017-08-05 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21  5:53 XDP/BPF C and python libraries? Jakub Kicinski
2017-07-21 10:22 ` Daniel Borkmann
2017-07-21 22:37   ` Jakub Kicinski
2017-07-22  7:20     ` Jakub Kicinski
2017-07-23  5:35       ` Y Song
2017-07-23 23:54       ` Jakub Kicinski
2017-07-24  0:27         ` David Ahern
2017-07-24  1:00           ` Jakub Kicinski
2017-08-04 22:20       ` David Ahern
2017-08-05 16:40         ` Jakub Kicinski [this message]
2017-08-05 19:59           ` David Ahern

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=20170805094058.42b2fe3e@cakuba \
    --to=kubakici@wp.pl \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=hannes@redhat.com \
    --cc=kafai@fb.com \
    --cc=xdp-newbies@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.