summaryrefslogtreecommitdiff
path: root/include/linux/btf_ids.h
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2021-11-12 07:02:43 -0800
committerAlexei Starovoitov <ast@kernel.org>2021-11-12 10:19:09 -0800
commitd19ddb476a539fd78ad1028ae13bb38506286931 (patch)
tree293ae437aeb1c13fd0ead6e9d4291326a64e97e5 /include/linux/btf_ids.h
parent9e2ad638ae3632ef916ceb39f70e3104bf8fdc97 (diff)
bpf: Introduce btf_tracing_ids
Similar to btf_sock_ids, btf_tracing_ids provides btf ID for task_struct, file, and vm_area_struct via easy to understand format like btf_tracing_ids[BTF_TRACING_TYPE_[TASK|file|VMA]]. Suggested-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20211112150243.1270987-3-songliubraving@fb.com
Diffstat (limited to 'include/linux/btf_ids.h')
-rw-r--r--include/linux/btf_ids.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index 6bb42b785293..919c0fde1c51 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -189,6 +189,18 @@ MAX_BTF_SOCK_TYPE,
extern u32 btf_sock_ids[];
#endif
-extern u32 btf_task_struct_ids[];
+#define BTF_TRACING_TYPE_xxx \
+ BTF_TRACING_TYPE(BTF_TRACING_TYPE_TASK, task_struct) \
+ BTF_TRACING_TYPE(BTF_TRACING_TYPE_FILE, file) \
+ BTF_TRACING_TYPE(BTF_TRACING_TYPE_VMA, vm_area_struct)
+
+enum {
+#define BTF_TRACING_TYPE(name, type) name,
+BTF_TRACING_TYPE_xxx
+#undef BTF_TRACING_TYPE
+MAX_BTF_TRACING_TYPE,
+};
+
+extern u32 btf_tracing_ids[];
#endif