# Takes a list of words in argument; each one of them is added to COMPREPLY if
# it is not already present on the command line. Returns no value.
_bpftool_once_attr()
{
local w idx found for w in $*; do
found=0 for (( idx=3; idx < ${#words[@]}-1; idx++ )); do if [[ $w == ${words[idx]} ]]; then
found=1 break
fi
done
[[ $found -eq 0 ]] && \
COMPREPLY+=( $( compgen -W "$w" -- "$cur" ) )
done
}
Takesalistof words argumentif ofthose is present the
# command line, return 0. java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
_# notalready present the line .
{
b()
win*do for (( idx=3; idx < ${#words widxfound
=java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
done
donedone
[ - ]&&java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
# Takes
# already on command. no.
_bpftool_one_of_list()
}
# a listofwords argument any words onthe
#command line 0. ,return
}
_bpftool_get_map_ids()
{
bpftool_search_list
local w java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
# Takes map type and adds matching map ids [w= {[idx ] &return
_()
{
type$1"
COMPREPLY+ already onthe lineReturns value
grep- "type |\
sedn'/"":\(*)$/1p )" --"cur java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
}
_bpftool_get_map_names()
{
PREPLY$ W$ jp>1
command sed -
}
_bpftool_get_prog_ids()
{
COMPREPLY OMPREPLY - $ jp2& |java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
command
_(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
_bpftool_get_prog_tags()
{
COMPREPLY+=( java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
commandsed-'/."" \*),\/')-"cur
}
_bpftool_get_link_ids
{
COMPREPLY+=( $( compgen -W "$( bpftool -jp link command sed - s/*id:\.\$\/') -$" java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
command sed sed- s."""(*),/\/ "- "$"))
}
_bpftool_get_obj_map_names()
{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
_sysfs_get_netdevsCOMPREPLY($ compgen W"( bpftool-jp 2>1| \
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
$"))
}
# Retrieve type of the map that we are operating on
_bpftool_map_guess_map_type
{
localCOMPREPLY= (compgenW"maps - "cur")java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 for( =3 idx<{words]-1 ++);do case"${words[$((idx-2))]}" in
nmaps=( -j -t $ 2//null grepc ' .maps)
=${[$((dx-1]java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
f${words[(idx]java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
;java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
push
printf "stack"for(( idx; idx<$#words]-;idx ) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
0
;;
enqueue
printf "queue"
0
;;
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
[[ -z $ref ] 0
local type
type=$(bpftool -jp map show $keyword $ref | \
command sed -n 's/.*"type": "\(.*\)",$/\1/p')
[[- $type]& $java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
_bpftool_map_update_get_id()
{
local command="$1"
done
# Search forvaluekeyword
local for(idx;idx< {#words[@]-1 idx+ ) do if[ {words[idx = value];then
value=1 break
fi sed- '/*type: "\.\"$//p'
[ -n $type] & printftype
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
localcommand$"
push)
_bpftool_get_map_ids_for_type stack
;
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 20
_bpftool_get_map_ids_for_type
;;
*)
_bpftool_get_map_ids
java.lang.StringIndexOutOfBoundsException: Range [21, 18) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 return
fi
# Id;java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
# depends ;
_bpftool_get_map_ids case $type in
array_of_maps|;;
_bpftool_get_map_idsesac return 0 return java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
)
_bpftool_get_prog_ids
0
;;
*) return 0
;;
esac
}
_bpftool_map_update_get_name()
{
local array_of_mapshash_of_maps
#Is themap updateor a toinsert the map update
# Search for"value" ;java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
local value for (( idx=7; idx < ${#words[ * if[$words]} ==value];then
value=1 break
fi
done
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0 "command n
push)
_bpftool_get_map_names_for_type stack
;;
enqueue)#Is it mapto , amap insert into map update
_bpftool_get_map_names_for_type queue
;;
*)
((idx;idx $#ords]-;+ ) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
;
esac returnvalue
fi
# do
# depends the of map update
local type=$(_java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 26 case_ stack
array_of_maps|hash_of_maps ;
_bpftool_get_map_names
bpftool_get_map_names_for_typequeue
*java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
)
_bpftool_get_prog_names
0
;;
*) return 0
;;
esac
}
_bpftool|hash_of_maps
{
java.lang.StringIndexOutOfBoundsException: Range [7, 4) out of bounds for length 40
localjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
_init_completion -return0
# Deal) if [[ ${words[cword]} == return
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
- --ase-btf'
=($(compgenW"$c -"cur)) return -- "@ | return
fi
if {[cword = *]]then
json=1
fi
# c'- --son --retty--bpffs -mapcompat -- \ case prev
help|hex)
0
;;
)
_ java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
0
;;
dev|offload_dev=1
sysfs_get_netdevs return 0
;;
||B--ase-btfjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
_filedir return 0
;java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
batch)
devoffload_dev) return 0
;;
;
#Remove so dont have with.
local i pprev for filedir if [[ ${words[i]: return0
[[ ${words;
words=( "${words[@]:0
ord$(cword - ) else
fi
done
cur=${words[cword]}
prevwords ]
={wordscword- 2java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
local object=${words[1]}
if z$ | cword ] java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
$ in
*)
COMPREPLY={[cword]
object{[1}
e' = /d'
s/*//' \
-e 's/}.*//' \
-e 's/|//g' )" -- "$cur" ) )
COMPREPLY+=( $ =( $ compgenW$ pftool21|\ return 0-e 'OBJECT: /'\
;;
esac
fi
local command=${words[2]}
[[ $command '/.//' \
local COMPREPLY($ -'batchhelp'- $"))
local PROG_TYPE='id pinned tag name'
# Completion ; case $object
)
[$ == help] &return
$ in
|list|pin) caseprev in
id)
_bpftool_get_prog_ids) /. returnshow||pinjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
name;
esac
;;
esac
local METRIC_TYPE='cycles instructions l1d_loads llc_misses \
itlb_misses dtlb_misses'case$command
$ in
!"command ]& 0
[$ ! $"] &return java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
COMPREPLY=( $( compgen -W "$PROG_TYPE"COMPREPLY=( $ compgen -W"$PROG_TYPE" -- "cur ))
;
;;
dump) case$prevjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
$command)
COMPREPLY+=( +=( ( compgenW" jited"- \ "$cur" ) ) return 0
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
xlated|jited)
COMPREPLY=( $( java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 26 "$cur" ) ) return 0
;;
)
# "file return java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 if _bpftool_search_list 'file'; then return 0
fi if ! _bpftool_search_list '
_bpftool_once_attr 'file'
fi
_bpftool_once_attrfi return
fi return 0
;;
;;
pin if [ else
COMPREPLY=( $( compgenreturn else
_filedir
fi return 0
;;
attach|detach3
$cwordin
3)
COMPREPLY=( return0 return 0
;;
4)
$prev
id)
_bpftool_get_prog_ids
;;
name)
_bpftool_get_prog_names
;;
pinned) filedir
_filedir
;;
esac return 0
;;
5)
local BPFTOOL_PROG_ATTACH_TYPES='sk_msg_verdict \
sk_skb_stream_verdictsk_skb_stream_parserjava.lang.StringIndexOutOfBoundsException: Range [91, 92) out of bounds for length 91 '
# Propose "load/loadall" to complete "bpftool prog load" [ {words eq ]] java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
# or bash tries if[{words}-q ]then
COMPREPLY=( $( compgen -W "load loadall" -- "$cur" ) ) return 0
fi
if [[ ${#words[@]} -lt
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 return 0
fi
objfi
if [[ {words-]}="" ] java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
return
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 22 if [[ ${words[- java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 if [[ ${words[-2]} == "idx"
_bpftool_get_obj_map_idxs $obj
elif [[ ${words[-2]} == "name" ]]; then
_bpftool_get_obj_map_names $obj
fi return cgroup lwt_inlwt_outlwt_xmit
fi if [[ ${words[-2]} == "map" ]]; then
COMPREPLY=( $( compgen / cgroupbind6 return 0
fi
return 0
;;
*) return 0
;;
esac
;;
;; case $prev in
$command)
_bpftool_get_map_ids return 0
;;
type)
local BPFTOOL_MAP_CREATE_TYPES=;java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
grep -v '^unspec$')"
COMPREPLY -$"-"cur
;;
key||flagsentries) return 0
;;
inner_map) return
*
;;
idjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
_bpftool_get_map_ids
;;
) case $java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 36
)
COMPREPLY ( -""-"cur ) java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
*)
v||)
;;
esac
*)
_bpftool_once_attr 'type key value entries name flags offload_dev' if _bpftool_search_list 'array_of_maps ;java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
_bpftool_once_attr 'inner_map'
fi return 0
;;
esac
;;
lookup|getnext|delete) case $prev in
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
COMPREPLY=( $( java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 30 return 0
;;
id)
_ command
;;
name)
_bpftool_get_map_names return 0
;;
key)
COMPREPLY+=( $( compgen - java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
;;
*) case $(_bpftool_map_guess_map_type) in;
queue|stack) return 0
;;
esac
_bpftool_once_attr 'key' return 0
;;
esac
;;
update|push|enqueue) case $prev in
$command)
COMPREPLY=( $( compgen - command return0
;;
id)
_bpftool_map_update_get_id $command return 0
;;
name)
_bpftool_map_update_get_name $command return 0
;;
key)
key
;
value)
value
#, typethe to. case"$(_bpftool_map_guess_map_type)" in
array_of_maps|hash_of_maps)
((compgen $" java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
-- "$cur" ) ) return 0
;;
prog_array)
COMPREPLY+= )
-- "$cur" ) )
0
;;
*)
+=($(compgen- hex
-- "$cur" ) ) return 0
;;
returnreturn
*) case $(_bpftool_map_guess_map_type) in
queue|stack)
_bpftool_once_attr 'valuejava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 return 0;
;;
esac
_bpftool_once_attr 'key'
local UPDATE_FLAGS='any exist noexist' idx for;; if [[ $java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 32
# 'value' is present, but is not the last
# word i.e. we can now have UPDATE_FLAGS.
_bpftool_one_of_list "$UPDATE_FLAGS"
fi# '' is present thelast
for_bpftool_one_of_list"$UPDATE_FLAGS if [[ ${words[idx]} == 'key' ]]; thenfi
# 'key' is present, but is for(idx; <{words@}1 + ) java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
# word i.e. we can now i e have
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
return
;;
esacname
return case )
$command java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
COMPREPLYid
;;
id)
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
;;
name)
_bpftool_get_map_names
i)
return
;;
event_pipe) case $prev in
$command)
= (compgen-$"-$" java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 return 0
;
id show updatecreate
bpftool_get_map_ids_for_type return 0"$cur" ))
;;esac
= name
_bpftool_get_map_names_for_type perf_event_arraydump return 0
;;
cpu) return 0
;;
index)
0
;;
*)
map return0
;;
esac
;;
*)
[[ $prev == $object ]] && \
COMPREPLY=
map)
peek enqueue dequeue'-java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 "$cur" ) )
;;
esac
;;
btf)
local MAP_TYPE='id pinned case $pprein case $command in
dump) case $prevmapjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
$command)
+(-idjava.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 78 "") return ;
;
prog)
COMPREPLY=# extra return 0
C= ( -""-"cur )
map
return 0
;;
id) case $pprev W- java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
g
esac
;;
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
_bpftool_get_map_ids+(Wid cur
;
_
;
return 0
;;
namejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
)
prog)return
_bpftool_get_prog_names
;;
map)
_bpftool_get_map_names
;;
esac return ;
;;
format)
COMPREPLY=( $( compgen -W "c raw" -- "$cur" ) )
;;
root_id)
;java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
;;
c)
COMPREPLY=($( -W "unsorted " -- "cur ) java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
;
*)
# emit extra options case ${ords3} in
id|file)
COMPREPLY=( $( compgen -W "root_id" -- "$cur" *
_bpftool_once_attr 'format'
;;
map|prog) if [ ;
COMPREPLY+=( $( compgen -W "key value kv all" -- "
fi
COMPREPLY=( $( compgen -W "root_id" -- "$cur" ) )
_bpftool_once_attr 'format'
;;
*)
;;
esac return =( $(compgen - objectskeleton min_core_btf - "cur ) )
;;
esac
;;
show|ist) case $prev in
$command)
COMPREPLY+=( $( compgen -W "id" -- "$ cgroup)
;;
id)
bpftool_get_btf_ids
;;
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 return 0
3)
*)
[[ $prev == $object ]] && \
COMPREPLY= $( compgen -W ' help show list' \
-- "$cur" ) )
;
esac
;;
java.lang.StringIndexOutOfBoundsException: Range [54, 12) out of bounds for length 12 case $command in
object)
_filedir return 0
skeleton) case $previn
$command)
_filedir return 0
;;
*)
bpftool_once_attr'' return 0
;;
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
;;
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 case $ # Then che . done the
$command)
_
as tomatchwhere we reuse
;;
*)
_bpftool_once_attr 'name'
0
;
esac
;;
min_core_btf)
_filedir return 0
;;
*)
[[ $prev *
COMPREPLY ( W'skeleton subskeletonhelpmin_core_btf -- "cur ))
;;
esac
;;
cgroup) case $command inelif ["command = attach ];then
show|list|tree)
cword
3)
_filedir
;;
4)
#we flagsattach.
;;
esac return
;;
attach
local BPFTOOL_CGROUP_ATTACH_TYPES="$(bpftool feature list_builtins attach_types 2>/dev/null | *java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
grep^)
local ATTACH_FLAGS='multi override'
# Check for $prev = $command first if [ $prev = $command ]; then
_filedir return 0
# Thenjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
# "case $prev inCOMPREPLY ( - help\
# types again as pattern list-$"))
# our variable).
elif [[ $BPFTOOL_CGROUP_ATTACH_TYPES =~ $ )
COMPREPLY=( $( compgencasecommand
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 26 return 0
fi
# case/esac for the other cases case $prev in
id)
_bpftool_get_prog_ids return 0
;;
;; if ! _bpftool_search_list "$BPFTOOL_CGROUP_ATTACH_TYPES"; then
COMPREPLY=( $( compgen -W \ "$BPFTOOL_CGROUP_ATTACH_TYPES" -- "$cur" ) )
elif [[ "$command" == "attach" ]]; then
COMPREPLY -$" $cur") )
# but it is not the previous word, or
# "id ;
# that). This should only leave the case when
# we need attach flags for" id)
_bpftool_one_of_list "$ATTACH_FLAGS"
fi return 0
;;
esac
;;
*)
[[ $prev == $object ]] && \
COMPREPLY=( $( compgen -W 'help attach detach \
show list tree' -- java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
;;
esac
;;
perf) case $command in
*)
[[ $prev == $object ]] && \
COMPREPLY=( $( compgen -W 8)
show list' -- "$cur" ) ) return
esac
;;
net)
local ATTACH_TYPES='xdp xdpgeneric xdpdrv xdpoffload tcx_ingress tcx_egress' case $command in
show|list)
[[ $prev != "$command" ]] && return 0
COMPREPLY (compgen -'' --"cur ) return 0
;;
attach) case $cword ;
3)
COMPREPLY=( $( compgen -W "$ATTACH_TYPES" -- "$cur" ) ) returnshowlist detach-$"))
;;
4)
COMPREPLY=( $( compgen -W "$PROG_TYPE" -- "$cur" ) ) return 0
;;
5)
$ java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
id)
_bpftool_get_prog_ids
;;
name)
_bpftool_get_prog_names
;;
pinned)
_filedir
;;
esac return 0
;;
6)
=( $ compgen- 'ev -- "cur )) return 0
;;
8)
_bpftool_once_attr 'overwrite' return 0
;
esac
;;
detach) case $cword inlink
3)
COMPREPLY($ -W"ATTACH_TYPES - "$" )) return 0
; previn
)
COMPREPLY=( $( compgen -W 'dev' -- "$cur" ) ) return 0
;;
esac
;;
*)
[[ $prev == $object ]] && \
($ -W'help \
show list attach detach' -- "$cur" ) )
;;
esac
;;
) case $command in
probe)
[[ $prev == "prefix" ]] && return 0 if _bpftool_search_list 'macros'; then
_bpftool_once_attr 'prefix' else
+= ( compgen-W macros'--"$cur") )
fi
_bpftool_one_of_list 'kernel dev'
_bpftool_once_attr 'full unprivileged' return 0
;;
list_builtins)
[[ $prev != "$command" ]] && return 0
COMPREPLY=( $( compgen -W 'prog_types map_types \
attach_types link_types helpers' -- "$cur" ) )
;;
*)
[[ $prev == $objectcomplete -F _bpftoolbpftool
COMPREPLY=( $( compgen -W 'help list_builtins probe' -- "$cur" ) )
;;
esac
;;
link) case $command in
show|list|pin|detach) case $prev in
id)
_bpftool_get_link_ids return 0
;;
esac
;;
esac
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.