• Dan Xu's avatar
    Link against system installed bcc (#327) · 4c3fbad2
    Dan Xu authored
    Link against system bcc
    
    Previously, bpftrace was clone bcc from github at build time, building
    a version of bcc, then linking against the built bcc. This is a no-go
    for many packaging systems including Fedora, openSUSE, and the internal
    Facebook one.
    
    This patch requires bcc and bcc development headers be installed to
    build bpftrace and removes the build time downloading behavior.
    Also simplifies some of the header search logic.
    
    Test plan:
    ```
    $ ./build/tests/bpftrace_test
    ...
    $ sudo make -C build runtime-tests
    ...
    
    $ cat ~/scratch/bpftrace/path.bt
    
    kprobe:vfs_open
    {
        printf("open path: %s\n", str(((path *)arg0)->dentry->d_name.name));
    }
    
    $ sudo ./build/src/bpftrace ~/scratch/bpftrace/path.bt
    [sudo] password for dlxu:
    Attaching 1 probe...
    open path: stat
    open path: user-745673103.journal
    open path: user-1001.journal
    open path: user-745673103.journal
    open path: user-1001.journal
    open path: user-745673103.journal
    open path: user-1001.journal
    open path: iio:device0
    open path: stat
    ...
    4c3fbad2
Dockerfile.fedora29 261 Bytes