diff options
author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2023-08-23 01:26:02 +0900 |
---|---|---|
committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2023-08-23 09:40:16 +0900 |
commit | 302db0f5b3d87e3b9de2d82bfe11c1d7db84d0c2 (patch) | |
tree | 1a210bb75e09522bddea4670b3985ebe099542ff /kernel/trace/trace_btf.h | |
parent | ebeed8d4a55513116116993861c98a72915265ba (diff) |
tracing/probes: Add a function to search a member of a struct/union
Add btf_find_struct_member() API to search a member of a given data structure
or union from the member's name.
Link: https://lore.kernel.org/all/169272156248.160970.8868479822371129043.stgit@devnote2/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_btf.h')
-rw-r--r-- | kernel/trace/trace_btf.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace_btf.h b/kernel/trace/trace_btf.h index 98685e9a556c..4bc44bc261e6 100644 --- a/kernel/trace/trace_btf.h +++ b/kernel/trace/trace_btf.h @@ -5,3 +5,7 @@ const struct btf_type *btf_find_func_proto(const char *func_name, struct btf **btf_p); const struct btf_param *btf_get_func_param(const struct btf_type *func_proto, s32 *nr); +const struct btf_member *btf_find_struct_member(struct btf *btf, + const struct btf_type *type, + const char *member_name, + u32 *anon_offset); |