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 Apr, 2016

1 commit

  • the first microbenchmark does
    fd=open("/proc/self/comm");
    for() {
    write(fd, "test");
    }
    and on 4 cpus in parallel:
    writes per sec
    base (no tracepoints, no kprobes) 930k
    with kprobe at __set_task_comm() 420k
    with tracepoint at task:task_rename 730k

    For kprobe + full bpf program manully fetches oldcomm, newcomm via bpf_probe_read.
    For tracepint bpf program does nothing, since arguments are copied by tracepoint.

    2nd microbenchmark does:
    fd=open("/dev/urandom");
    for() {
    read(fd, buf);
    }
    and on 4 cpus in parallel:
    reads per sec
    base (no tracepoints, no kprobes) 300k
    with kprobe at urandom_read() 279k
    with tracepoint at random:urandom_read 290k

    bpf progs attached to kprobe and tracepoint are noop.

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

    Alexei Starovoitov