]> granicus.if.org Git - strace/commitdiff
bpf: add support for array fields
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 8 Apr 2018 18:09:06 +0000 (20:09 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 8 Apr 2018 22:01:12 +0000 (22:01 +0000)
* 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>
gen_bpf_attr_check.sh
m4/gen_bpf_attr_m4.sh

index 9da75ad9aecbb3e45c083763307d1349563ef7bd..1a52c2177745c513f74707ff4aeb9ea663b068d6 100755 (executable)
@@ -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
index f3dc30720e1a6e1954e1312bcc97d10c2d57d7e2..188d66288cd1d75baf9270a7adb9b03053baa377 100755 (executable)
@@ -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