strace/SOURCES/0118-types-skip-field-lines...

85 lines
3.7 KiB
Diff

From b0a361c0a9095b396ff7100203c767ec9ffd2cfa Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Tue, 16 Jun 2020 08:00:00 +0000
Subject: [PATCH] types: skip field lines that start with comments
This allows to exclude certain fields from type checks by placing
comments at the beginning of the corresponding lines.
* types/find_last_type_fields.awk: Skip lines starting with spaces
followed by "/".
---
types/find_last_type_fields.awk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: strace-5.7/types/find_last_type_fields.awk
===================================================================
--- strace-5.7.orig/types/find_last_type_fields.awk 2020-01-21 19:02:38.000000000 +0100
+++ strace-5.7/types/find_last_type_fields.awk 2020-11-09 04:47:06.976785148 +0100
@@ -17,7 +17,7 @@
print a[1] "." last_field
next
}
- if (match($0, /^[[:space:]]+[^];:[]+[[:space:]]+([^][:space:];:[]+)(\[[^];:[]*\])?;.*$/, a)) {
+ if (match($0, /^[[:space:]]+[^];[:space:]:\/[][^];:[]*[[:space:]]+([^][:space:];:[]+)(\[[^];:[]*\])?;.*$/, a)) {
last_field = a[1]
next
}
Index: strace-5.7/types/check-io_uring.c
===================================================================
--- strace-5.7.orig/types/check-io_uring.c 2020-11-09 04:47:06.977785139 +0100
+++ strace-5.7/types/check-io_uring.c 2020-11-09 04:49:10.033732186 +0100
@@ -14,13 +14,13 @@
#endif /* HAVE_STRUCT_IO_SQRING_OFFSETS */
#ifdef HAVE_STRUCT_IO_CQRING_OFFSETS
-# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV
+# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_CQES
static_assert(sizeof(struct io_cqring_offsets) == sizeof(struct_io_cqring_offsets),
"struct io_cqring_offsets size mismatch, please update the decoder or fix the kernel");
# else
-static_assert(sizeof(struct io_cqring_offsets) <= offsetof(struct_io_cqring_offsets, resv),
+static_assert(sizeof(struct io_cqring_offsets) <= offsetof(struct_io_cqring_offsets, cqes),
"struct io_cqring_offsets size mismatch, please update the decoder or fix the kernel");
-# endif /* HAVE_STRUCT_IO_CQRING_OFFSETS_RESV */
+# endif /* HAVE_STRUCT_IO_CQRING_OFFSETS_CQES */
#endif /* HAVE_STRUCT_IO_CQRING_OFFSETS */
#ifdef HAVE_STRUCT_IO_URING_PARAMS
Index: strace-5.7/config.h.in
===================================================================
--- strace-5.7.orig/config.h.in 2020-11-09 04:47:06.980785114 +0100
+++ strace-5.7/config.h.in 2020-11-09 04:50:11.871203054 +0100
@@ -2596,8 +2596,8 @@
/* Define to 1 if the system has the type `struct io_cqring_offsets'. */
#undef HAVE_STRUCT_IO_CQRING_OFFSETS
-/* Define to 1 if `resv' is a member of `struct io_cqring_offsets'. */
-#undef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV
+/* Define to 1 if `cqes' is a member of `struct io_cqring_offsets'. */
+#undef HAVE_STRUCT_IO_CQRING_OFFSETS_CQES
/* Define to 1 if the system has the type `struct io_sqring_offsets'. */
#undef HAVE_STRUCT_IO_SQRING_OFFSETS
Index: strace-5.7/configure
===================================================================
--- strace-5.7.orig/configure 2020-11-09 04:47:06.988785045 +0100
+++ strace-5.7/configure 2020-11-09 04:51:12.500684263 +0100
@@ -13475,13 +13475,13 @@
#define HAVE_STRUCT_IO_CQRING_OFFSETS 1
_ACEOF
-ac_fn_c_check_member "$LINENO" "struct io_cqring_offsets" "resv" "ac_cv_member_struct_io_cqring_offsets_resv" "$ac_includes_default
+ac_fn_c_check_member "$LINENO" "struct io_cqring_offsets" "cqes" "ac_cv_member_struct_io_cqring_offsets_cqes" "$ac_includes_default
#include <linux/io_uring.h>
"
-if test "x$ac_cv_member_struct_io_cqring_offsets_resv" = xyes; then :
+if test "x$ac_cv_member_struct_io_cqring_offsets_cqes" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IO_CQRING_OFFSETS_RESV 1
+#define HAVE_STRUCT_IO_CQRING_OFFSETS_CQES 1
_ACEOF