aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/bpf/bpftool/bash-completion/bpftool
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-03-18 12:40:33 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-03-18 16:14:23 -0700
commitd80b2fcbe0a023619e0fc73112f2a02c2662f6ab (patch)
tree5a232c9c067b8af8ef6a1789d09d55a64f4a15cc /tools/bpf/bpftool/bash-completion/bpftool
parentbpftool: Add ability to specify custom skeleton object name (diff)
downloadwireguard-linux-d80b2fcbe0a023619e0fc73112f2a02c2662f6ab.tar.xz
wireguard-linux-d80b2fcbe0a023619e0fc73112f2a02c2662f6ab.zip
bpftool: Add `gen object` command to perform BPF static linking
Add `bpftool gen object <output-file> <input_file>...` command to statically link multiple BPF ELF object files into a single output BPF ELF object file. This patch also updates bash completions and man page. Man page gets a short section on `gen object` command, but also updates the skeleton example to show off workflow for BPF application with two .bpf.c files, compiled individually with Clang, then resulting object files are linked together with `gen object`, and then final object file is used to generate usable BPF skeleton. This should help new users understand realistic workflow w.r.t. compiling mutli-file BPF application. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20210318194036.3521577-10-andrii@kernel.org
Diffstat (limited to 'tools/bpf/bpftool/bash-completion/bpftool')
-rw-r--r--tools/bpf/bpftool/bash-completion/bpftool6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
index bf7b4bdbb23a..d67518bcbd44 100644
--- a/tools/bpf/bpftool/bash-completion/bpftool
+++ b/tools/bpf/bpftool/bash-completion/bpftool
@@ -981,6 +981,10 @@ _bpftool()
;;
gen)
case $command in
+ object)
+ _filedir
+ return 0
+ ;;
skeleton)
case $prev in
$command)
@@ -995,7 +999,7 @@ _bpftool()
;;
*)
[[ $prev == $object ]] && \
- COMPREPLY=( $( compgen -W 'skeleton help' -- "$cur" ) )
+ COMPREPLY=( $( compgen -W 'object skeleton help' -- "$cur" ) )
;;
esac
;;