1. 14 3月, 2020 1 次提交
    • Q
      tools: bpftool: Restore message on failure to guess program type · 6ae32b29
      Quentin Monnet 提交于
      In commit 4a3d6c6a ("libbpf: Reduce log level for custom section
      names"), log level for messages for libbpf_attach_type_by_name() and
      libbpf_prog_type_by_name() was downgraded from "info" to "debug". The
      latter function, in particular, is used by bpftool when attempting to
      load programs, and this change caused bpftool to exit with no hint or
      error message when it fails to detect the type of the program to load
      (unless "-d" option was provided).
      
      To help users understand why bpftool fails to load the program, let's do
      a second run of the function with log level in "debug" mode in case of
      failure.
      
      Before:
      
          # bpftool prog load sample_ret0.o /sys/fs/bpf/sample_ret0
          # echo $?
          255
      
      Or really verbose with -d flag:
      
          # bpftool -d prog load sample_ret0.o /sys/fs/bpf/sample_ret0
          libbpf: loading sample_ret0.o
          libbpf: section(1) .strtab, size 134, link 0, flags 0, type=3
          libbpf: skip section(1) .strtab
          libbpf: section(2) .text, size 16, link 0, flags 6, type=1
          libbpf: found program .text
          libbpf: section(3) .debug_abbrev, size 55, link 0, flags 0, type=1
          libbpf: skip section(3) .debug_abbrev
          libbpf: section(4) .debug_info, size 75, link 0, flags 0, type=1
          libbpf: skip section(4) .debug_info
          libbpf: section(5) .rel.debug_info, size 32, link 14, flags 0, type=9
          libbpf: skip relo .rel.debug_info(5) for section(4)
          libbpf: section(6) .debug_str, size 150, link 0, flags 30, type=1
          libbpf: skip section(6) .debug_str
          libbpf: section(7) .BTF, size 155, link 0, flags 0, type=1
          libbpf: section(8) .BTF.ext, size 80, link 0, flags 0, type=1
          libbpf: section(9) .rel.BTF.ext, size 32, link 14, flags 0, type=9
          libbpf: skip relo .rel.BTF.ext(9) for section(8)
          libbpf: section(10) .debug_frame, size 40, link 0, flags 0, type=1
          libbpf: skip section(10) .debug_frame
          libbpf: section(11) .rel.debug_frame, size 16, link 14, flags 0, type=9
          libbpf: skip relo .rel.debug_frame(11) for section(10)
          libbpf: section(12) .debug_line, size 74, link 0, flags 0, type=1
          libbpf: skip section(12) .debug_line
          libbpf: section(13) .rel.debug_line, size 16, link 14, flags 0, type=9
          libbpf: skip relo .rel.debug_line(13) for section(12)
          libbpf: section(14) .symtab, size 96, link 1, flags 0, type=2
          libbpf: looking for externs among 4 symbols...
          libbpf: collected 0 externs total
          libbpf: failed to guess program type from ELF section '.text'
          libbpf: supported section(type) names are: socket sk_reuseport kprobe/ [...]
      
      After:
      
          # bpftool prog load sample_ret0.o /sys/fs/bpf/sample_ret0
          libbpf: failed to guess program type from ELF section '.text'
          libbpf: supported section(type) names are: socket sk_reuseport kprobe/ [...]
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20200311021205.9755-1-quentin@isovalent.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
      6ae32b29
  2. 13 3月, 2020 11 次提交
  3. 12 3月, 2020 1 次提交
  4. 11 3月, 2020 3 次提交
  5. 10 3月, 2020 16 次提交
  6. 06 3月, 2020 2 次提交
  7. 05 3月, 2020 6 次提交