diff options
author | Delyan Kratunov <delyank@fb.com> | 2022-03-17 02:37:28 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-03-18 09:12:39 +0300 |
commit | 00389c58ffe993782a8ba4bb5a34a102b1f6fe24 (patch) | |
tree | 0ffa1555b105f3f55fa2187075c9eaf460bf6784 /tools/bpf/bpftool/bash-completion | |
parent | 430025e5dca5ad8902e7c3092b7c975acae154c5 (diff) | |
download | linux-00389c58ffe993782a8ba4bb5a34a102b1f6fe24.tar.xz |
bpftool: Add support for subskeletons
Subskeletons are headers which require an already loaded program to
operate.
For example, when a BPF library is linked into a larger BPF object file,
the library userspace needs a way to access its own global variables
without requiring knowledge about the larger program at build time.
As a result, subskeletons require a loaded bpf_object to open().
Further, they find their own symbols in the larger program by
walking BTF type data at run time.
At this time, programs, maps, and globals are supported through
non-owning pointers.
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/ca8a48b4841c72d285ecce82371bef4a899756cb.1647473511.git.delyank@fb.com
Diffstat (limited to 'tools/bpf/bpftool/bash-completion')
-rw-r--r-- | tools/bpf/bpftool/bash-completion/bpftool | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index 958e1fd71b5c..5df8d72c5179 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -1003,13 +1003,25 @@ _bpftool() ;; esac ;; + subskeleton) + case $prev in + $command) + _filedir + return 0 + ;; + *) + _bpftool_once_attr 'name' + return 0 + ;; + esac + ;; min_core_btf) _filedir return 0 ;; *) [[ $prev == $object ]] && \ - COMPREPLY=( $( compgen -W 'object skeleton help min_core_btf' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'object skeleton subskeleton help min_core_btf' -- "$cur" ) ) ;; esac ;; |