Thread (8 messages) flat view 8 messages, 3 authors, 2019-07-03

Re: [PATCH v3 bpf-next 2/4] selftests/bpf: add __int and __type macro for BTF-defined maps

From: Yonghong Song <hidden>
Date: 2019-07-03 22:41:47
Also in: bpf


On 7/3/19 12:06 PM, Andrii Nakryiko wrote:
Add simple __int and __type macro that hide details of how type and
The "__int" should be "__uint".
The subject line should change from __int to __uint.
quoted hunk ↗ jump to hunk
integer values are captured in BTF-defined maps.

Signed-off-by: Andrii Nakryiko <redacted>
---
  tools/testing/selftests/bpf/bpf_helpers.h | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index 1a5b1accf091..5a3d92c8bec8 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -8,6 +8,9 @@
   */
  #define SEC(NAME) __attribute__((section(NAME), used))
  
+#define __uint(name, val) int (*name)[val]
+#define __type(name, val) val *name
+
  /* helper macro to print out debug messages */
  #define bpf_printk(fmt, ...)				\
  ({							\
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help