Blame SOURCES/strace-rh1540954-1.patch

71941d
commit 52231be034160c786735c6ae2f51ac7723c2e1fd
71941d
Author: Dmitry V. Levin <ldv@altlinux.org>
71941d
Date:   Fri Sep 15 16:06:14 2017 +0000
71941d
71941d
    Update MEMBARRIER_CMD_* constants
71941d
    
71941d
    * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED
71941d
    introduced by kernel commit v4.14-rc1~174^2^2^4.
71941d
    * NEWS: Mention this.
71941d
    * tests/membarrier.c (main): Update expected output.
71941d
71941d
diff -rup a/tests/membarrier.c b/tests/membarrier.c
71941d
--- a/tests/membarrier.c	2016-12-20 00:10:21.000000000 -0500
71941d
+++ b/tests/membarrier.c	2018-03-07 16:08:39.803150889 -0500
71941d
@@ -44,10 +44,23 @@ main(void)
71941d
 	printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n",
71941d
 	       sprintrc(-1));
71941d
 	if (saved_errno != ENOSYS) {
71941d
-		/* the test needs to be updated? */
71941d
-		assert(syscall(__NR_membarrier, 0, 0) == 1);
71941d
-		puts("membarrier(MEMBARRIER_CMD_QUERY, 0)"
71941d
-		     " = 0x1 (MEMBARRIER_CMD_SHARED)");
71941d
+		const char *text;
71941d
+		int rc = syscall(__NR_membarrier, 0, 0);
71941d
+
71941d
+		switch (rc) {
71941d
+		case 1:
71941d
+			text = "MEMBARRIER_CMD_SHARED";
71941d
+			break;
71941d
+		case 1|8:
71941d
+			text = "MEMBARRIER_CMD_SHARED|"
71941d
+			       "MEMBARRIER_CMD_PRIVATE_EXPEDITED";
71941d
+			break;
71941d
+		default:
71941d
+			error_msg_and_fail("membarrier returned %#x, does"
71941d
+					   " the test have to be updated?", rc);
71941d
+		}
71941d
+		printf("membarrier(MEMBARRIER_CMD_QUERY, 0) = %#x (%s)\n",
71941d
+		       rc, text);
71941d
 	}
71941d
 	puts("+++ exited with 0 +++");
71941d
 	return 0;
71941d
diff -rup a/xlat/membarrier_cmds.h b/xlat/membarrier_cmds.h
71941d
--- a/xlat/membarrier_cmds.h	2017-05-24 15:55:51.000000000 -0400
71941d
+++ b/xlat/membarrier_cmds.h	2018-03-07 16:08:54.883976263 -0500
71941d
@@ -5,6 +5,9 @@
71941d
 #if !(defined(MEMBARRIER_CMD_SHARED) || (defined(HAVE_DECL_MEMBARRIER_CMD_SHARED) && HAVE_DECL_MEMBARRIER_CMD_SHARED))
71941d
 # define MEMBARRIER_CMD_SHARED 1
71941d
 #endif
71941d
+#if !(defined(MEMBARRIER_CMD_PRIVATE_EXPEDITED) || (defined(HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED) && HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED))
71941d
+# define MEMBARRIER_CMD_PRIVATE_EXPEDITED 8
71941d
+#endif
71941d
 
71941d
 #ifdef IN_MPERS
71941d
 
71941d
@@ -16,6 +19,7 @@ static
71941d
 const struct xlat membarrier_cmds[] = {
71941d
  XLAT(MEMBARRIER_CMD_QUERY),
71941d
  XLAT(MEMBARRIER_CMD_SHARED),
71941d
+ XLAT(MEMBARRIER_CMD_PRIVATE_EXPEDITED),
71941d
  XLAT_END
71941d
 };
71941d
 
71941d
diff -rup a/xlat/membarrier_cmds.in b/xlat/membarrier_cmds.in
71941d
--- a/xlat/membarrier_cmds.in	2015-11-16 19:40:22.000000000 -0500
71941d
+++ b/xlat/membarrier_cmds.in	2018-03-07 16:08:39.804150878 -0500
71941d
@@ -1,2 +1,3 @@
71941d
-MEMBARRIER_CMD_QUERY	0
71941d
-MEMBARRIER_CMD_SHARED	1
71941d
+MEMBARRIER_CMD_QUERY			0
71941d
+MEMBARRIER_CMD_SHARED			1
71941d
+MEMBARRIER_CMD_PRIVATE_EXPEDITED	8