Similarly to bpf_attr fields checks. * ptp_clock.h: New file. * Makefile.am (strace_SOURCES): Add it. (strace_SOURCES_check, BUILT_SOURCES, CLEANFILES): Add ptp_clock_check.c. (EXTRA_DIST): Add gen_ptp_clock_check.sh. (ptp_clock_check.c): New rule. * configure.ac (AC_CHECK_HEADERS([linux/ptp_clock.h])): Call st_PTP_CLOCK. * gen_ptp_clock_check.sh: New file. * m4/gen_ptp_clock_m4.awk: Likewise. * m4/gen_ptp_clock_m4.sh: Likewise.
22 lines
383 B
Awk
22 lines
383 B
Awk
/^struct (strace_ptp_[^[:space:]]+)[[:space:]]+{/ {
|
|
match($0, /^struct strace_(ptp_[^[:space:]]+)[[:space:]]+{/, a)
|
|
|
|
struct_name = a[1]
|
|
prefix = "struct " struct_name
|
|
|
|
in_struct = 1
|
|
next
|
|
}
|
|
|
|
/^};/ {
|
|
in_struct = 0
|
|
next
|
|
}
|
|
|
|
(in_struct == 1) {
|
|
if (match($0, /^[[:space:]]+([^;\[\]]+[[:space:]]+)+([^[:space:]\[\];]+)(\[[^;]*\])?;$/, a)) {
|
|
print "\t\t" prefix "." a[2] ","
|
|
}
|
|
}
|
|
|