19 May, 2020

1 commit

  • Because the previous two commit replaced the bpf_load implementation of
    the user program with libbpf, the corresponding kernel program's MAP
    definition can be replaced with new BTF-defined map syntax.

    This commit only updates the samples which uses libbpf API for loading
    bpf program not with bpf_load.

    Signed-off-by: Daniel T. Lee
    Signed-off-by: Daniel Borkmann
    Acked-by: Yonghong Song
    Link: https://lore.kernel.org/bpf/20200516040608.1377876-6-danieltimlee@gmail.com

    Daniel T. Lee
     

21 Jan, 2020

1 commit

  • Fix all files in samples/bpf to include libbpf header files with the bpf/
    prefix, to be consistent with external users of the library. Also ensure
    that all includes of exported libbpf header files (those that are exported
    on 'make install' of the library) use bracketed includes instead of quoted.

    To make sure no new files are introduced that doesn't include the bpf/
    prefix in its include, remove tools/lib/bpf from the include path entirely,
    and use tools/lib instead.

    Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Alexei Starovoitov
    Acked-by: Jesper Dangaard Brouer
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/157952560911.1683545.8795966751309534150.stgit@toke.dk

    Toke Høiland-Jørgensen
     

08 Oct, 2017

1 commit


05 Jun, 2017

1 commit

  • $ trace_event

    tests attaching BPF program to HW_CPU_CYCLES, SW_CPU_CLOCK, HW_CACHE_L1D and other events.
    It runs 'dd' in the background while bpf program collects user and kernel
    stack trace on counter overflow.
    User space expects to see sys_read and sys_write in the kernel stack.

    $ tracex6

    tests reading of various perf counters from BPF program.

    Both tests were refactored to increase coverage and be more accurate.

    Signed-off-by: Teng Qin
    Signed-off-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Teng Qin
     

13 Aug, 2015

1 commit

  • There are two improvements in this patch:
    1. Fix the build warnings;
    2. Add function read_trace_pipe() to print the result on
    the screen;

    Before this patch, we can get the result through /sys/kernel/de
    bug/tracing/trace_pipe and get nothing on the screen.
    By applying this patch, the result can be printed on the screen.
    $ ./tracex6
    ...
    tracex6-705 [003] d..1 131.428593: : CPU-3 19981414
    sshd-683 [000] d..1 131.428727: : CPU-0 221682321
    sshd-683 [000] d..1 131.428821: : CPU-0 221808766
    sshd-683 [000] d..1 131.428950: : CPU-0 221982984
    sshd-683 [000] d..1 131.429045: : CPU-0 222111851
    tracex6-705 [003] d..1 131.429168: : CPU-3 20757551
    sshd-683 [000] d..1 131.429170: : CPU-0 222281240
    sshd-683 [000] d..1 131.429261: : CPU-0 222403340
    sshd-683 [000] d..1 131.429378: : CPU-0 222561024
    ...

    Signed-off-by: Kaixu Xia
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Kaixu Xia
     

10 Aug, 2015

1 commit