• Andrii Nakryiko's avatar
    selftests/bpf: Make perf_buffer selftests work on 4.9 kernel again · 57385ae3
    Andrii Nakryiko authored
    Recent change to use tp/syscalls/sys_enter_nanosleep for perf_buffer
    selftests causes this selftest to fail on 4.9 kernel in libbpf CI ([0]):
    
      libbpf: prog 'handle_sys_enter': failed to attach to perf_event FD 6: Invalid argument
      libbpf: prog 'handle_sys_enter': failed to attach to tracepoint 'syscalls/sys_enter_nanosleep': Invalid argument
    
    It's not exactly clear why, because perf_event itself is created for
    this tracepoint, but I can't even compile 4.9 kernel locally, so it's
    hard to figure this out. If anyone has better luck and would like to
    help investigating this, I'd really appreciate this.
    
    For now, unblock CI by switching back to raw_syscalls/sys_enter, but reduce
    amount of unnecessary samples emitted by filter by process ID. Use
    explicit ARRAY map for that to make it work on 4.9 as well, because
    global data isn't yet supported there.
    
    Fixes: aa274f98 ("selftests/bpf: Fix possible/online index mismatch in perf_buffer test")
    Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Link: https://lore.kernel.org/bpf/20211022201342.3490692-1-andrii@kernel.org
    57385ae3
perf_buffer.c 3.69 KB