• Arnaldo Carvalho de Melo's avatar
    perf bpf: Show better message when failing to load an object · 739e2edc
    Arnaldo Carvalho de Melo authored
    Before:
    
      libbpf: license of tools/perf/examples/bpf/etcsnoop.c is GPL
      libbpf: section(6) version, size 4, link 0, flags 3, type=1
      libbpf: kernel version of tools/perf/examples/bpf/etcsnoop.c is 41200
      libbpf: section(7) .symtab, size 120, link 1, flags 0, type=2
      bpf: config program 'syscalls:sys_enter_openat'
      libbpf: load bpf program failed: Operation not permitted
      libbpf: failed to load program 'syscalls:sys_enter_openat'
      libbpf: failed to load object 'tools/perf/examples/bpf/etcsnoop.c'
      bpf: load objects failed
    
    After: (just the last line changes)
    
      bpf: load objects failed: err=-4009: (Incorrect kernel version)
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Wang Nan <wangnan0@huawei.com>
    Link: https://lkml.kernel.org/n/tip-wi44iid0yjfht3lcvplc75fm@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    739e2edc
bpf-loader.c 40 KB