]> granicus.if.org Git - strace/commitdiff
bpf: exclude bit fields from the check
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Mar 2019 11:17:20 +0000 (11:17 +0000)
Currently we have no instruments to check the size and offsets
of bit fields.

* gen_bpf_attr_check.sh: Do not print bit fields.
* m4/gen_bpf_attr_m4.awk: Likewise.

gen_bpf_attr_check.sh
m4/gen_bpf_attr_m4.awk

index 686027e9ecb575a94b32c1478360a87d717272cc..f3b440eada73cfc791d61d49d91b32730a12d65d 100755 (executable)
@@ -32,7 +32,7 @@ for struct in $(sed -n 's/^struct \([^[:space:]]\+_struct\) .*/\1/p' < "$input")
        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 3158f7e5a30f4e0cf4fce2b74472698333564f61..320bb04c2d8e5318ba63dfe9a040d46d9f5fd984 100644 (file)
@@ -29,7 +29,7 @@
 }
 
 (in_struct == 1) {
-       if (match($0, /^[[:space:]]+[^;\[\]]+[[:space:]]+([^[:space:]\[\];]+)(\[[^;]*\])?;$/, a)) {
+       if (match($0, /^[[:space:]]+[^;:\[\]]+[[:space:]]+([^[:space:]\[\];:]+)(\[[^;:]*\])?;$/, a)) {
                print "\t\t" prefix "." a[1] ","
        }
 }