1. 25 Oct, 2021 3 commits
  2. 23 Oct, 2021 8 commits
  3. 22 Oct, 2021 24 commits
  4. 21 Oct, 2021 5 commits
    • Andrii Nakryiko's avatar
      Merge branch 'selftests/bpf: Fixes for perf_buffer test' · b0c7663d
      Andrii Nakryiko authored
      Jiri Olsa says:
      
      ====================
      
      hi,
      sending fixes for perf_buffer test on systems
      with offline cpus.
      
      v2:
        - resend due to delivery issues, no changes
      
      thanks,
      jirka
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      ====================
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      b0c7663d
    • Jiri Olsa's avatar
      selftests/bpf: Use nanosleep tracepoint in perf buffer test · 99d09975
      Jiri Olsa authored
      The perf buffer tests triggers trace with nanosleep syscall,
      but monitors all syscalls, which results in lot of data in the
      buffer and makes it harder to debug. Let's lower the trace
      traffic and monitor just nanosleep syscall.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20211021114132.8196-4-jolsa@kernel.org
      99d09975
    • Jiri Olsa's avatar
      selftests/bpf: Fix possible/online index mismatch in perf_buffer test · aa274f98
      Jiri Olsa authored
      The perf_buffer fails on system with offline cpus:
      
        # test_progs -t perf_buffer
        serial_test_perf_buffer:PASS:nr_cpus 0 nsec
        serial_test_perf_buffer:PASS:nr_on_cpus 0 nsec
        serial_test_perf_buffer:PASS:skel_load 0 nsec
        serial_test_perf_buffer:PASS:attach_kprobe 0 nsec
        serial_test_perf_buffer:PASS:perf_buf__new 0 nsec
        serial_test_perf_buffer:PASS:epoll_fd 0 nsec
        skipping offline CPU #4
        serial_test_perf_buffer:PASS:perf_buffer__poll 0 nsec
        serial_test_perf_buffer:PASS:seen_cpu_cnt 0 nsec
        serial_test_perf_buffer:PASS:buf_cnt 0 nsec
        ...
        serial_test_perf_buffer:PASS:fd_check 0 nsec
        serial_test_perf_buffer:PASS:drain_buf 0 nsec
        serial_test_perf_buffer:PASS:consume_buf 0 nsec
        serial_test_perf_buffer:FAIL:cpu_seen cpu 5 not seen
        #88 perf_buffer:FAIL
        Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED
      
      If the offline cpu is from the middle of the possible set,
      we get mismatch with possible and online cpu buffers.
      
      The perf buffer test calls perf_buffer__consume_buffer for
      all 'possible' cpus, but the library holds only 'online'
      cpu buffers and perf_buffer__consume_buffer returns them
      based on index.
      
      Adding extra (online) index to keep track of online buffers,
      we need the original (possible) index to trigger trace on
      proper cpu.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20211021114132.8196-3-jolsa@kernel.org
      aa274f98
    • Jiri Olsa's avatar
      selftests/bpf: Fix perf_buffer test on system with offline cpus · d4121376
      Jiri Olsa authored
      The perf_buffer fails on system with offline cpus:
      
        # test_progs -t perf_buffer
        test_perf_buffer:PASS:nr_cpus 0 nsec
        test_perf_buffer:PASS:nr_on_cpus 0 nsec
        test_perf_buffer:PASS:skel_load 0 nsec
        test_perf_buffer:PASS:attach_kprobe 0 nsec
        test_perf_buffer:PASS:perf_buf__new 0 nsec
        test_perf_buffer:PASS:epoll_fd 0 nsec
        skipping offline CPU #24
        skipping offline CPU #25
        skipping offline CPU #26
        skipping offline CPU #27
        skipping offline CPU #28
        skipping offline CPU #29
        skipping offline CPU #30
        skipping offline CPU #31
        test_perf_buffer:PASS:perf_buffer__poll 0 nsec
        test_perf_buffer:PASS:seen_cpu_cnt 0 nsec
        test_perf_buffer:FAIL:buf_cnt got 24, expected 32
        Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED
      
      Changing the test to check online cpus instead of possible.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20211021114132.8196-2-jolsa@kernel.org
      d4121376
    • Andrii Nakryiko's avatar
      Merge branch 'bpf: keep track of verifier insn_processed' · 8082b856
      Andrii Nakryiko authored
      Dave Marchevsky says:
      
      ====================
      
      This is a followup to discussion around RFC patchset "bpf: keep track of
      prog verification stats" [0]. The RFC elaborates on my usecase, but to
      summarize: keeping track of verifier stats for programs as they - and
      the kernels they run on - change over time can help developers of
      individual programs and BPF kernel folks.
      
      The RFC added a verif_stats to the uapi which contained most of the info
      which verifier prints currently. Feedback here was to avoid polluting
      uapi with stats that might be meaningless after major changes to the
      verifier, but that insn_processed or conceptually similar number would
      exist in the long term and was safe to expose.
      
      So let's expose just insn_processed via bpf_prog_info and fdinfo for now
      and explore good ways of getting more complicated stats in the future.
      
      [0] https://lore.kernel.org/bpf/20210920151112.3770991-1-davemarchevsky@fb.com/
      
      v2->v3:
        * Remove unnecessary check in patch 2's test [Andrii]
        * Go back to adding new u32 in bpf_prog_info (vs using spare bits) [Andrii]
      	* Rebase + add acks [Andrii, John]
      
      v1->v2:
        * Rename uapi field from insn_processed to verified_insns [Daniel]
        * use 31 bits of existing bitfield space in bpf_prog_info [Daniel]
        * change underlying type from 64-> 32 bits [Daniel]
      ====================
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      8082b856