1. 14 7月, 2020 1 次提交
  2. 09 7月, 2020 1 次提交
  3. 08 7月, 2020 1 次提交
  4. 04 7月, 2020 1 次提交
  5. 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
  6. 01 7月, 2020 1 次提交
  7. 25 6月, 2020 2 次提交
  8. 24 6月, 2020 2 次提交
  9. 23 6月, 2020 5 次提交
  10. 20 6月, 2020 1 次提交
  11. 17 6月, 2020 1 次提交
  12. 16 6月, 2020 1 次提交
  13. 13 6月, 2020 1 次提交
  14. 12 6月, 2020 1 次提交
  15. 11 6月, 2020 1 次提交
  16. 10 6月, 2020 1 次提交
  17. 03 6月, 2020 1 次提交
  18. 02 6月, 2020 5 次提交
  19. 20 5月, 2020 1 次提交
  20. 15 5月, 2020 1 次提交
    • D
      bpf, bpftool: Allow probing for CONFIG_HZ from kernel config · 0ee52c0f
      Daniel Borkmann 提交于
      In Cilium we've recently switched to make use of bpf_jiffies64() for
      parts of our tc and XDP datapath since bpf_ktime_get_ns() is more
      expensive and high-precision is not needed for our timeouts we have
      anyway. Our agent has a probe manager which picks up the json of
      bpftool's feature probe and we also use the macro output in our C
      programs e.g. to have workarounds when helpers are not available on
      older kernels.
      
      Extend the kernel config info dump to also include the kernel's
      CONFIG_HZ, and rework the probe_kernel_image_config() for allowing a
      macro dump such that CONFIG_HZ can be propagated to BPF C code as a
      simple define if available via config. Latter allows to have _compile-
      time_ resolution of jiffies <-> sec conversion in our code since all
      are propagated as known constants.
      
      Given we cannot generally assume availability of kconfig everywhere,
      we also have a kernel hz probe [0] as a fallback. Potentially, bpftool
      could have an integrated probe fallback as well, although to derive it,
      we might need to place it under 'bpftool feature probe full' or similar
      given it would slow down the probing process overall. Yet 'full' doesn't
      fit either for us since we don't want to pollute the kernel log with
      warning messages from bpf_probe_write_user() and bpf_trace_printk() on
      agent startup; I've left it out for the time being.
      
        [0] https://github.com/cilium/cilium/blob/master/bpf/cilium-probe-kernel-hz.cSigned-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: NQuentin Monnet <quentin@isovalent.com>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Link: https://lore.kernel.org/bpf/20200513075849.20868-1-daniel@iogearbox.net
      0ee52c0f
  21. 12 5月, 2020 2 次提交
  22. 10 5月, 2020 2 次提交
    • S
      bpf, runqslower: include proper uapi/bpf.h · b4563fac
      Song Liu 提交于
      runqslower doesn't specify include path for uapi/bpf.h. This causes the
      following warning:
      
      In file included from runqslower.c:10:
      .../tools/testing/selftests/bpf/tools/include/bpf/bpf.h:234:38:
      warning: 'enum bpf_stats_type' declared inside parameter list will not
      be visible outside of this definition or declaration
        234 | LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type);
      
      Fix this by adding -I tools/includ/uapi to the Makefile.
      Reported-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NSong Liu <songliubraving@fb.com>
      Acked-by: NAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      b4563fac
    • Y
      tools/bpftool: Add bpf_iter support for bptool · 9406b485
      Yonghong Song 提交于
      Currently, only one command is supported
        bpftool iter pin <bpf_prog.o> <path>
      
      It will pin the trace/iter bpf program in
      the object file <bpf_prog.o> to the <path>
      where <path> should be on a bpffs mount.
      
      For example,
        $ bpftool iter pin ./bpf_iter_ipv6_route.o \
          /sys/fs/bpf/my_route
      User can then do a `cat` to print out the results:
        $ cat /sys/fs/bpf/my_route
          fe800000000000000000000000000000 40 00000000000000000000000000000000 ...
          00000000000000000000000000000000 00 00000000000000000000000000000000 ...
          00000000000000000000000000000001 80 00000000000000000000000000000000 ...
          fe800000000000008c0162fffebdfd57 80 00000000000000000000000000000000 ...
          ff000000000000000000000000000000 08 00000000000000000000000000000000 ...
          00000000000000000000000000000000 00 00000000000000000000000000000000 ...
      
      The implementation for ipv6_route iterator is in one of subsequent
      patches.
      
      This patch also added BPF_LINK_TYPE_ITER to link query.
      
      In the future, we may add additional parameters to pin command
      by parameterizing the bpf iterator. For example, a map_id or pid
      may be added to let bpf program only traverses a single map or task,
      similar to kernel seq_file single_open().
      
      We may also add introspection command for targets/iterators by
      leveraging the bpf_iter itself.
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200509175920.2477247-1-yhs@fb.com
      9406b485
  23. 30 4月, 2020 3 次提交
  24. 29 4月, 2020 3 次提交