diff options
author | Roberto Sassu <roberto.sassu@huawei.com> | 2022-09-20 10:59:42 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-22 03:32:48 +0300 |
commit | b8d31762a0ae6861e1115302ee338560d853e317 (patch) | |
tree | e6d40bc57b44b2a9c1e8de753b4206bfeee96548 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | e9e315b4a5de32d0482b92f482517095d5d844e4 (diff) | |
download | linux-b8d31762a0ae6861e1115302ee338560d853e317.tar.xz |
btf: Allow dynamic pointer parameters in kfuncs
Allow dynamic pointers (struct bpf_dynptr_kern *) to be specified as
parameters in kfuncs. Also, ensure that dynamic pointers passed as argument
are valid and initialized, are a pointer to the stack, and of the type
local. More dynamic pointer types can be supported in the future.
To properly detect whether a parameter is of the desired type, introduce
the stringify_struct() macro to compare the returned structure name with
the desired name. In addition, protect against structure renames, by
halting the build with BUILD_BUG_ON(), so that developers have to revisit
the code.
To check if a dynamic pointer passed to the kfunc is valid and initialized,
and if its type is local, export the existing functions
is_dynptr_reg_valid_init() and is_dynptr_type_expected().
Cc: Joanne Koong <joannelkoong@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20220920075951.929132-5-roberto.sassu@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions