bpf: add support for array fields
* gen_bpf_attr_check.sh: Ignore field array size definition. * m4/gen_bpf_attr_m4.sh (filter_entries): Likewise. Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
This commit is contained in:
parent
958cb40a6e
commit
a3509bac24
@ -44,7 +44,7 @@ for struct in $(sed -n 's/^struct \(BPF_[^[:space:]]\+_struct\) .*/\1/p' < "$inp
|
||||
enum="$enum${enum:+.}"
|
||||
ENUM="$ENUM${ENUM:+_}"
|
||||
sed -n '/^struct '"$struct"' [^{]*{/,/^};$/p' < "$input" |
|
||||
sed -n 's/^[[:space:]]\+[^;]*[[:space:]]\([^[:space:];]\+\);$/\1/p' |
|
||||
sed -n 's/^[[:space:]]\+[^][;]*[[:space:]]\([^][[:space:];]\+\)\(\[[^;]*\]\)\?;$/\1/p' |
|
||||
while read field; do
|
||||
FIELD="$(printf %s "$field" |tr '[:lower:]' '[:upper:]')"
|
||||
cat <<EOF
|
||||
|
@ -50,7 +50,7 @@ filter_entries()
|
||||
local subtype=
|
||||
[ -z "$name" ] ||
|
||||
subtype=".$name"
|
||||
local search='^[[:space:]]\+[^;]*[[:space:]]\([^[:space:];]\+\);$'
|
||||
local search='^[[:space:]]\+[^][;]*[[:space:]]\([^][[:space:];]\+\)\(\[[^;]*\]\)\?;$'
|
||||
local replacement='\t\tunion bpf_attr'"$subtype"'.\1,'
|
||||
sed -n "s/$search/$replacement/p" |
|
||||
sort -u
|
||||
|
Loading…
Reference in New Issue
Block a user