19 Aug, 2020

1 commit


31 Jul, 2020

1 commit

  • The o32, n32 and n64 calling conventions require the return
    value to be stored in $v0 which maps to $2 register, i.e.,
    the register 2.

    Fixes: c1932cd ("bpf: Add MIPS support to samples/bpf.")
    Signed-off-by: Jerry Crunchtime
    Signed-off-by: Daniel Borkmann
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/43707d31-0210-e8f0-9226-1af140907641@web.de

    Jerry Crunchtime
     

16 May, 2020

1 commit


15 May, 2020

1 commit

  • Fix register naming in PT_REGS s390 macros

    Fixes: b8ebce86ffe6 ("libbpf: Provide CO-RE variants of PT_REGS macros")
    Signed-off-by: Sumanth Korikkar
    Signed-off-by: Alexei Starovoitov
    Reviewed-by: Julian Wiedmann
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20200513154414.29972-1-sumanthk@linux.ibm.com

    Sumanth Korikkar
     

10 May, 2020

1 commit

  • Two new libbpf APIs are added to support bpf_iter:
    - bpf_program__attach_iter
    Given a bpf program and additional parameters, which is
    none now, returns a bpf_link.
    - bpf_iter_create
    syscall level API to create a bpf iterator.

    The macro BPF_SEQ_PRINTF are also introduced. The format
    looks like:
    BPF_SEQ_PRINTF(seq, "task id %d\n", pid);

    This macro can help bpf program writers with
    nicer bpf_seq_printf syntax similar to the kernel one.

    Signed-off-by: Yonghong Song
    Signed-off-by: Alexei Starovoitov
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20200509175917.2476936-1-yhs@fb.com

    Yonghong Song
     

18 Mar, 2020

1 commit

  • Use PT_REGS_RC instead of PT_REGS_RET to get ret correctly.

    Fixes: df8ff35311c8 ("libbpf: Merge selftests' bpf_trace_helpers.h into libbpf's bpf_tracing.h")
    Signed-off-by: Wenbo Zhang
    Signed-off-by: Daniel Borkmann
    Acked-by: Andrii Nakryiko
    Link: https://lore.kernel.org/bpf/20200315083252.22274-1-ethercflow@gmail.com

    Wenbo Zhang
     

14 Mar, 2020

1 commit

  • Syscall raw tracepoints have struct pt_regs pointer as tracepoint's first
    argument. After that, reading any of pt_regs fields requires bpf_probe_read(),
    even for tp_btf programs. Due to that, PT_REGS_PARMx macros are not usable as
    is. This patch adds CO-RE variants of those macros that use BPF_CORE_READ() to
    read necessary fields. This provides relocatable architecture-agnostic pt_regs
    field accesses.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann
    Acked-by: Martin KaFai Lau
    Link: https://lore.kernel.org/bpf/20200313172336.1879637-4-andriin@fb.com

    Andrii Nakryiko
     

03 Mar, 2020

2 commits

  • Move BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE macro into libbpf's bpf_tracing.h
    header to make it available for non-selftests users.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20200229231112.1240137-5-andriin@fb.com

    Andrii Nakryiko
     
  • Add detection of vmlinux.h to bpf_tracing.h header for PT_REGS macro.
    Currently, BPF applications have to define __KERNEL__ symbol to use correct
    definition of struct pt_regs on x86 arch. This is due to different field names
    under internal kernel vs UAPI conditions. To make this more transparent for
    users, detect vmlinux.h by checking __VMLINUX_H__ symbol.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20200229231112.1240137-3-andriin@fb.com

    Andrii Nakryiko
     

09 Oct, 2019

1 commit

  • Move bpf_helpers.h, bpf_tracing.h, and bpf_endian.h into libbpf. Move
    bpf_helper_defs.h generation into libbpf's Makefile. Ensure all those
    headers are installed along the other libbpf headers. Also, adjust
    selftests and samples include path to include libbpf now.

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Daniel Borkmann
    Acked-by: Song Liu
    Link: https://lore.kernel.org/bpf/20191008175942.1769476-6-andriin@fb.com

    Andrii Nakryiko