summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/usdt.bpf.h
diff options
context:
space:
mode:
authorJames Hilliard <james.hilliard1@gmail.com>2022-08-03 18:14:03 +0300
committerAndrii Nakryiko <andrii@kernel.org>2022-08-05 00:43:41 +0300
commitd25f40ff68aa61c838947bb9adee6c6b36e77453 (patch)
tree1bf6f961710f6e77b71bf3bb2c37dca727e272d4 /tools/lib/bpf/usdt.bpf.h
parentd55dfe587bc0670f90564a962615723fe7749ab1 (diff)
downloadlinux-d25f40ff68aa61c838947bb9adee6c6b36e77453.tar.xz
libbpf: Ensure functions with always_inline attribute are inline
GCC expects the always_inline attribute to only be set on inline functions, as such we should make all functions with this attribute use the __always_inline macro which makes the function inline and sets the attribute. Fixes errors like: /home/buildroot/bpf-next/tools/testing/selftests/bpf/tools/include/bpf/bpf_tracing.h:439:1: error: ‘always_inline’ function might not be inlinable [-Werror=attributes] 439 | ____##name(unsigned long long *ctx, ##args) | ^~~~ Signed-off-by: James Hilliard <james.hilliard1@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20220803151403.793024-1-james.hilliard1@gmail.com
Diffstat (limited to 'tools/lib/bpf/usdt.bpf.h')
-rw-r--r--tools/lib/bpf/usdt.bpf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lib/bpf/usdt.bpf.h b/tools/lib/bpf/usdt.bpf.h
index 4f2adc0bd6ca..fdfd235e52c4 100644
--- a/tools/lib/bpf/usdt.bpf.h
+++ b/tools/lib/bpf/usdt.bpf.h
@@ -232,7 +232,7 @@ long bpf_usdt_cookie(struct pt_regs *ctx)
*/
#define BPF_USDT(name, args...) \
name(struct pt_regs *ctx); \
-static __attribute__((always_inline)) typeof(name(0)) \
+static __always_inline typeof(name(0)) \
____##name(struct pt_regs *ctx, ##args); \
typeof(name(0)) name(struct pt_regs *ctx) \
{ \
@@ -241,7 +241,7 @@ typeof(name(0)) name(struct pt_regs *ctx) \
return ____##name(___bpf_usdt_args(args)); \
_Pragma("GCC diagnostic pop") \
} \
-static __attribute__((always_inline)) typeof(name(0)) \
+static __always_inline typeof(name(0)) \
____##name(struct pt_regs *ctx, ##args)
#endif /* __USDT_BPF_H__ */