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:
Eugene Syromyatnikov 2018-04-08 20:09:06 +02:00 committed by Dmitry V. Levin
parent 958cb40a6e
commit a3509bac24
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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