1. 04 9月, 2020 1 次提交
  2. 28 8月, 2020 1 次提交
  3. 26 8月, 2020 3 次提交
  4. 22 8月, 2020 1 次提交
    • Y
      bpftool: Implement link_query for bpf iterators · e60495ea
      Yonghong Song 提交于
      The link query for bpf iterators is implemented.
      Besides being shown to the user what bpf iterator
      the link represents, the target_name is also used
      to filter out what additional information should be
      printed out, e.g., whether map_id should be shown or not.
      The following is an example of bpf_iter link dump,
      plain output or pretty output.
      
        $ bpftool link show
        11: iter  prog 59  target_name task
                pids test_progs(1749)
        34: iter  prog 173  target_name bpf_map_elem  map_id 127
                pids test_progs_1(1753)
        $ bpftool -p link show
        [{
                "id": 11,
                "type": "iter",
                "prog_id": 59,
                "target_name": "task",
                "pids": [{
                        "pid": 1749,
                        "comm": "test_progs"
                    }
                ]
            },{
                "id": 34,
                "type": "iter",
                "prog_id": 173,
                "target_name": "bpf_map_elem",
                "map_id": 127,
                "pids": [{
                        "pid": 1753,
                        "comm": "test_progs_1"
                    }
                ]
            }
        ]
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NAndrii Nakryiko <andriin@fb.com>
      Link: https://lore.kernel.org/bpf/20200821184420.574430-1-yhs@fb.com
      e60495ea
  5. 21 8月, 2020 1 次提交
    • J
      tools/resolve_btfids: Fix sections with wrong alignment · 51f6463a
      Jiri Olsa 提交于
      The data of compressed section should be aligned to 4
      (for 32bit) or 8 (for 64 bit) bytes.
      
      The binutils ld sets sh_addralign to 1, which makes libelf
      fail with misaligned section error during the update as
      reported by Jesper:
      
         FAILED elf_update(WRITE): invalid section alignment
      
      While waiting for ld fix, we can fix compressed sections
      sh_addralign value manually.
      
      Adding warning in -vv mode when the fix is triggered:
      
        $ ./tools/bpf/resolve_btfids/resolve_btfids -vv vmlinux
        ...
        section(36) .comment, size 44, link 0, flags 30, type=1
        section(37) .debug_aranges, size 45684, link 0, flags 800, type=1
         - fixing wrong alignment sh_addralign 16, expected 8
        section(38) .debug_info, size 129104957, link 0, flags 800, type=1
         - fixing wrong alignment sh_addralign 1, expected 8
        section(39) .debug_abbrev, size 1152583, link 0, flags 800, type=1
         - fixing wrong alignment sh_addralign 1, expected 8
        section(40) .debug_line, size 7374522, link 0, flags 800, type=1
         - fixing wrong alignment sh_addralign 1, expected 8
        section(41) .debug_frame, size 702463, link 0, flags 800, type=1
        section(42) .debug_str, size 1017571, link 0, flags 830, type=1
         - fixing wrong alignment sh_addralign 1, expected 8
        section(43) .debug_loc, size 3019453, link 0, flags 800, type=1
         - fixing wrong alignment sh_addralign 1, expected 8
        section(44) .debug_ranges, size 1744583, link 0, flags 800, type=1
         - fixing wrong alignment sh_addralign 16, expected 8
        section(45) .symtab, size 2955888, link 46, flags 0, type=2
        section(46) .strtab, size 2613072, link 0, flags 0, type=3
        ...
        update ok for vmlinux
      
      Another workaround is to disable compressed debug info data
      CONFIG_DEBUG_INFO_COMPRESSED kernel option.
      
      Fixes: fbbb68de ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object")
      Reported-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: NYonghong Song <yhs@fb.com>
      Cc: Mark Wielaard <mjw@redhat.com>
      Cc: Nick Clifton <nickc@redhat.com>
      Link: https://lore.kernel.org/bpf/20200819092342.259004-1-jolsa@kernel.org
      51f6463a
  6. 19 8月, 2020 2 次提交
  7. 14 8月, 2020 2 次提交
  8. 13 8月, 2020 1 次提交
  9. 07 8月, 2020 2 次提交
  10. 03 8月, 2020 3 次提交
  11. 02 8月, 2020 2 次提交
  12. 28 7月, 2020 2 次提交
  13. 26 7月, 2020 2 次提交
  14. 22 7月, 2020 3 次提交
  15. 21 7月, 2020 1 次提交
    • W
      tools: bpf: Use local copy of headers including uapi/linux/filter.h · f143c11b
      Will Deacon 提交于
      Pulling header files directly out of the kernel sources for inclusion in
      userspace programs is highly error prone, not least because it bypasses
      the kbuild infrastructure entirely and so may end up referencing other
      header files that have not been generated.
      
      Subsequent patches will cause compiler.h to pull in the ungenerated
      asm/rwonce.h file via filter.h, breaking the build for tools/bpf:
      
        | $ make -C tools/bpf
        | make: Entering directory '/linux/tools/bpf'
        |   CC       bpf_jit_disasm.o
        |   LINK     bpf_jit_disasm
        |   CC       bpf_dbg.o
        | In file included from /linux/include/uapi/linux/filter.h:9,
        |                  from /linux/tools/bpf/bpf_dbg.c:41:
        | /linux/include/linux/compiler.h:247:10: fatal error: asm/rwonce.h: No such file or directory
        |  #include <asm/rwonce.h>
        |           ^~~~~~~~~~~~~~
        | compilation terminated.
        | make: *** [Makefile:61: bpf_dbg.o] Error 1
        | make: Leaving directory '/linux/tools/bpf'
      
      Take a copy of the installed version of linux/filter.h  (i.e. the one
      created by the 'headers_install' target) into tools/include/uapi/linux/
      and adjust the BPF tool Makefile to reference the local include
      directories instead of those in the main source tree.
      
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Suggested-by: NDaniel Borkmann <daniel@iogearbox.net>
      Reported-by: NXiao Yang <ice_yangxiao@163.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      f143c11b
  16. 18 7月, 2020 1 次提交
  17. 15 7月, 2020 1 次提交
  18. 14 7月, 2020 4 次提交
  19. 09 7月, 2020 1 次提交
  20. 08 7月, 2020 1 次提交
  21. 04 7月, 2020 1 次提交
  22. 02 7月, 2020 1 次提交
    • A
      tools/bpftool: Turn off -Wnested-externs warning · 17bbf925
      Andrii Nakryiko 提交于
      Turn off -Wnested-externs to avoid annoying warnings in BUILD_BUG_ON macro when
      compiling bpftool:
      
      In file included from /data/users/andriin/linux/tools/include/linux/build_bug.h:5,
                       from /data/users/andriin/linux/tools/include/linux/kernel.h:8,
                       from /data/users/andriin/linux/kernel/bpf/disasm.h:10,
                       from /data/users/andriin/linux/kernel/bpf/disasm.c:8:
      /data/users/andriin/linux/kernel/bpf/disasm.c: In function ‘__func_get_name’:
      /data/users/andriin/linux/tools/include/linux/compiler.h:37:38: warning: nested extern declaration of ‘__compiletime_assert_0’ [-Wnested-externs]
        _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                                            ^~~~~~~~~~~~~~~~~~~~~
      /data/users/andriin/linux/tools/include/linux/compiler.h:16:15: note: in definition of macro ‘__compiletime_assert’
         extern void prefix ## suffix(void) __compiletime_error(msg); \
                     ^~~~~~
      /data/users/andriin/linux/tools/include/linux/compiler.h:37:2: note: in expansion of macro ‘_compiletime_assert’
        _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        ^~~~~~~~~~~~~~~~~~~
      /data/users/andriin/linux/tools/include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
       #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                           ^~~~~~~~~~~~~~~~~~
      /data/users/andriin/linux/tools/include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
        BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
        ^~~~~~~~~~~~~~~~
      /data/users/andriin/linux/kernel/bpf/disasm.c:20:2: note: in expansion of macro ‘BUILD_BUG_ON’
        BUILD_BUG_ON(ARRAY_SIZE(func_id_str) != __BPF_FUNC_MAX_ID);
        ^~~~~~~~~~~~
      Signed-off-by: NAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20200701212816.2072340-1-andriin@fb.com
      17bbf925
  23. 01 7月, 2020 1 次提交
  24. 25 6月, 2020 2 次提交