libbpf: Move BPF_SEQ_PRINTF and BPF_SNPRINTF to bpf_helpers.h
Subsystems (4)
PATCH v3 1/1 libbpf: Move BPF_SEQ_PRINTF and BPF_SNPRINTF to bpf_helpers.h
These macros are convenient wrappers around the bpf_seq_printf and bpf_snprintf helpers. They are currently provided by bpf_tracing.h which targets low level tracing primitives. bpf_helpers.h is a better fit.
The __bpf_narg and __bpf_apply are needed in both files and provided twice. __bpf_empty isn't used anywhere and is removed from bpf_tracing.h
--- kernel/bpf/preload/iterators/iterators.bpf.c | 1 - tools/lib/bpf/bpf_helpers.h | 66 +++++++++++++++++++ tools/lib/bpf/bpf_tracing.h | 62 +++-------------- .../bpf/progs/bpf_iter_bpf_hash_map.c | 1 - .../selftests/bpf/progs/bpf_iter_bpf_map.c | 1 - .../selftests/bpf/progs/bpf_iter_ipv6_route.c | 1 - .../selftests/bpf/progs/bpf_iter_netlink.c | 1 - .../selftests/bpf/progs/bpf_iter_task.c | 1 - .../selftests/bpf/progs/bpf_iter_task_btf.c | 1 - .../selftests/bpf/progs/bpf_iter_task_file.c | 1 - .../selftests/bpf/progs/bpf_iter_task_stack.c | 1 - .../selftests/bpf/progs/bpf_iter_task_vma.c | 1 - .../selftests/bpf/progs/bpf_iter_tcp4.c | 1 - .../selftests/bpf/progs/bpf_iter_tcp6.c | 1 - .../selftests/bpf/progs/bpf_iter_udp4.c | 1 - .../selftests/bpf/progs/bpf_iter_udp6.c | 1 - .../selftests/bpf/progs/test_snprintf.c | 1 - 17 files changed, 74 insertions(+), 69 deletions(-)
kernel/bpf/preload/iterators/iterators.bpf.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include <linux/bpf.h> #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> #include <bpf/bpf_core_read.h> #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
tools/lib/bpf/bpf_helpers.h +66 -0
70 lines not on this page · raw message
tools/lib/bpf/bpf_tracing.h +8 -54
77 lines not on this page · raw message
tools/testing/selftests/bpf/progs/bpf_iter_bpf_hash_map.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_bpf_map.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_ipv6_route.c +0 -1
@@ -3,7 +3,6 @@#include "bpf_iter.h" #include "bpf_tracing_net.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_netlink.c +0 -1
@@ -3,7 +3,6 @@#include "bpf_iter.h" #include "bpf_tracing_net.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_task.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_task_btf.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020, Oracle and/or its affiliates. */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> #include <bpf/bpf_core_read.h> #include <errno.h>
tools/testing/selftests/bpf/progs/bpf_iter_task_file.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_task_vma.c +0 -1
@@ -2,7 +2,6 @@/* Copyright (c) 2020 Facebook */ #include "bpf_iter.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_tcp4.c +0 -1
@@ -3,7 +3,6 @@#include "bpf_iter.h" #include "bpf_tracing_net.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> #include <bpf/bpf_endian.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_tcp6.c +0 -1
@@ -3,7 +3,6 @@#include "bpf_iter.h" #include "bpf_tracing_net.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> #include <bpf/bpf_endian.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_udp4.c +0 -1
@@ -3,7 +3,6 @@#include "bpf_iter.h" #include "bpf_tracing_net.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> #include <bpf/bpf_endian.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/bpf_iter_udp6.c +0 -1
@@ -3,7 +3,6 @@#include "bpf_iter.h" #include "bpf_tracing_net.h" #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> #include <bpf/bpf_endian.h> char _license[] SEC("license") = "GPL";
tools/testing/selftests/bpf/progs/test_snprintf.c +0 -1
@@ -3,7 +3,6 @@#include <linux/bpf.h> #include <bpf/bpf_helpers.h> -#include <bpf/bpf_tracing.h> __u32 pid =0 ;
Signature · 1 line
2.31.1.818.g46aad6cb9e-goog
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Quoted 8 lines · On Wed, 26 May 2021 18:46:43 +0200 you wrote:
These macros are convenient wrappers around the
bpf_seq_printfandbpf_snprintfhelpers. They are currently provided bybpf_tracing.hwhich targets low level tracing primitives.bpf_helpers.his a better fit.The
__bpf_nargand__bpf_applyare needed in both files and provided twice.__bpf_emptyisn't used anywhere and is removed frombpf_tracing.h[...]
Here is the summary with links:
- [bpf-next,v3] libbpf: Move BPF_SEQ_PRINTF and BPF_SNPRINTF to bpf_helpers.h
https://git.kernel.org/bpf/bpf-next/c/d6a6a55518c1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html