Re: [iovisor-dev] bpftool binary size

2018-04-18 Thread Daniel Borkmann via iovisor-dev
On 04/18/2018 10:03 PM, Jesper Dangaard Brouer via iovisor-dev wrote:
[...]
> What does bpftool use BFD for?

It's used for the prog JIT dump in order to disassemble the instructions.
___
iovisor-dev mailing list
iovisor-dev@lists.iovisor.org
https://lists.iovisor.org/mailman/listinfo/iovisor-dev


Re: [iovisor-dev] bpftool binary size

2018-04-18 Thread Jesper Dangaard Brouer via iovisor-dev
(Cc. iovisor-dev list)

On Wed, 18 Apr 2018 21:32:45 +0200
Jesper Dangaard Brouer  wrote:

> On Wed, 18 Apr 2018 20:13:39 +0100
> Quentin Monnet  wrote:
> 
> > Hi Jesper,
> > 
> > Out of curiosity, how much did you say your bpftool executable weigh? Was
> > it 2 MB? I recompiled it on my laptop and it's 173 kB, 113 kB if stripped.
> > I don't believe it embeds libopcode on my system (right now Ubuntu 18.04).
> > What is your setup, if you don't mind me asking?  
> 
> On my Fedora 26, it is 2.2MB (2207976) and stripped 2MB (2046784).
> 
> For some reason the bpftool binary gets statically linked with
> libopcodes, which is /usr/lib64/libopcodes.a 1.76MB.

So, I figured out why this happens.

What does bpftool use BFD for?

I need the BFD lib and include file: /usr/include/bfd.h.
Thus, on fedora I need to install package binutils-devel.

The file /usr/lib64/libopcodes.so contains a ld-script that enforce
static linking:

$ cat /usr/lib64/libopcodes.so
/* GNU ld script */

/* Ensure this .so library will not be used by a link for a different format
   on a multi-architecture system.  */
OUTPUT_FORMAT(elf64-x86-64)

INPUT ( /usr/lib64/libopcodes.a -lbfd )



The info/description on the RPM file is interesting, it explicitly
explain why this static linking is enforced... and "strongly
encouraged" developers to use libelf instead of BFD.

Is using libelf instead an option?


$ rpm -qi binutils-devel
Name: binutils-devel
Version : 2.27
Release : 28.fc26
Architecture: x86_64
Install Date: Wed 18 Apr 2018 09:34:52 PM CEST
Group   : System Environment/Libraries
Size: 4651893
License : GPLv3+
Signature   : RSA/SHA256, Thu 02 Nov 2017 10:37:53 AM CET, Key ID 
812a6b4b64dab85d
Source RPM  : binutils-2.27-28.fc26.src.rpm
Build Date  : Fri 13 Oct 2017 03:48:11 PM CEST
Build Host  : buildvm-16.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager: Fedora Project
Vendor  : Fedora Project
URL : http://sources.redhat.com/binutils
Summary : BFD and opcodes static and dynamic libraries and header files
Description :
This package contains BFD and opcodes static and dynamic libraries.

The dynamic libraries are in this package, rather than a seperate
base package because they are actually linker scripts that force
the use of the static libraries.  This is because the API of the
BFD library is too unstable to be used dynamically.

The static libraries are here because they are now needed by the
dynamic libraries.

Developers starting new projects are strongly encouraged to consider
using libelf instead of BFD.


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
___
iovisor-dev mailing list
iovisor-dev@lists.iovisor.org
https://lists.iovisor.org/mailman/listinfo/iovisor-dev


[iovisor-dev] minutes: IO Visort TSC/Dev Meeting

2018-04-18 Thread Brenden Blanco via iovisor-dev
Hi All,

Thanks for attending the meeting today. As usual, here are my notes.

Cheers,
Brenden

=== Discussion ===

Alexei
- bpf-next queue is quite large, please have patience with delays in
clearing
  the backlog
- please help review others patches

Brenden
- Fixing image test issues in bcc
- To add python3 test infra

Yonghong
- some kernel fixes
- python3 script fixes
- asking for help adding python3 tests
- please help review bpfd changes

Jesper
- debugging performance regression, retpoline issue
  - getting help from dma experts
  - other issues may come with map lookup indirect accesses
- followup patches from xdp page return api

Sebastiano
- add map+prog id to tracepoint
  - can it be done with kprobe + tracepoint?
  - what is the use case, since it can already be done other ways?

Bjorn
- AF_XDP updates
  - non-rfc patchset to push asap
  - looking at different ring implementations
  - alternatives are each visible api change

Daniel
- Documentation guide!
  - http://cilium.readthedocs.io/en/latest/bpf/

William
- Trying AF_XDP
  - seeing if can be used by ovs datapath
  - seeing different perf numbers, 10g ixgbe
  - will try again with next patch spin
- Moving around examples/selftest code
- Some missing ipv6 tunnel test code

Jiong
- Control flow graph in verifier
  - dom tree to detect loops
  - please post rfc patches

Martin
- BTF patches posted
  - whether to have embedded pretty printer in the kernel
  - possible use in embedded environments to avoid extra binaries
  - should never support writing to maps from bpffs
  - bpftool should be main point of entry

=== Attendees ===
Alexei Starovoitov
Brenden Blanco
William Tu
Andy Gospodarek
Bjorn Topel
Daniel Borkmann
Jakub Kicinski
Jesper Brouer
Jiong Wang
Quentin Monnet
Sandipan
Sebastiano
Ferris
George Wilson
Yonghong Song
Martin Lau
Brendan Gregg
Alex Reece
Joe Stringer
Yi-Hung Wei
___
iovisor-dev mailing list
iovisor-dev@lists.iovisor.org
https://lists.iovisor.org/mailman/listinfo/iovisor-dev