pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

will-it-scale-git: Fix build with new git snapshot



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Nov 21 00:03:43 2019 +0100
Changeset:	8a72da9fa04cde3e979d35a3d8e70f9edfeabdfb

Modified Files:
	will-it-scale-git/distinfo
Added Files:
	will-it-scale-git/patches/patch-tests_fallocate2.c
	will-it-scale-git/patches/patch-tests_tlb__flush1.c
	will-it-scale-git/patches/patch-tests_tlb__flush2.c
	will-it-scale-git/patches/patch-tests_tlb__flush3.c
Removed Files:
	will-it-scale-git/patches/patch-main.c

Log Message:
will-it-scale-git: Fix build with new git snapshot

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8a72da9fa04cde3e979d35a3d8e70f9edfeabdfb

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 will-it-scale-git/distinfo                         |   5 +-
 will-it-scale-git/patches/patch-main.c             | 139 ---------------------
 will-it-scale-git/patches/patch-tests_fallocate2.c |  30 +++++
 .../patches/patch-tests_tlb__flush1.c              |  17 +++
 .../patches/patch-tests_tlb__flush2.c              |  17 +++
 .../patches/patch-tests_tlb__flush3.c              |  17 +++
 6 files changed, 85 insertions(+), 140 deletions(-)

diffs:
diff --git a/will-it-scale-git/distinfo b/will-it-scale-git/distinfo
index 8c57f54ca8..c024916ded 100644
--- a/will-it-scale-git/distinfo
+++ b/will-it-scale-git/distinfo
@@ -1,10 +1,13 @@
 $NetBSD$
 
 SHA1 (patch-Makefile) = fdf09838fe367c554f108aa92aef76264b790512
-SHA1 (patch-main.c) = 892b4fee8745289f1b4befedf527e5f3db8c575d
 SHA1 (patch-tests_eventfd1.c) = 290598658b7cbf564b0b34317f0f2c550b243fde
 SHA1 (patch-tests_fallocate1.c) = b6820c120ce5b8e1ddf7bbc925a17f567d5a9df5
+SHA1 (patch-tests_fallocate2.c) = 0ca2dd55dc1ef267e8a02c9fc5699e72e71eafe3
 SHA1 (patch-tests_futex1.c) = a45ffd09e0300e5f6c2b70d95fb3a2454112e588
 SHA1 (patch-tests_futex2.c) = ef36e22c01b00ea486bd139a361313c3269a3c2d
 SHA1 (patch-tests_futex3.c) = 6df2ef0e44085aa8829d66a9b7d591fc18b2adf7
 SHA1 (patch-tests_futex4.c) = cb80519781bd1b8f5539f3080379159f36b2476a
+SHA1 (patch-tests_tlb__flush1.c) = a2d9d8679ca90cafdd6d6ad6742f3732d3441817
+SHA1 (patch-tests_tlb__flush2.c) = ab23430f9b89131df163649a7a51cb300c866d80
+SHA1 (patch-tests_tlb__flush3.c) = 4b8aff09cfec2b9e06e457a432d417e049f74d72
diff --git a/will-it-scale-git/patches/patch-main.c b/will-it-scale-git/patches/patch-main.c
deleted file mode 100644
index 215e4ad6ab..0000000000
--- a/will-it-scale-git/patches/patch-main.c
+++ /dev/null
@@ -1,139 +0,0 @@
-$NetBSD$
-
---- main.c.orig	2018-03-17 15:30:11.000000000 +0000
-+++ main.c
-@@ -15,7 +15,6 @@
- #include <string.h>
- #include <sys/mman.h>
- #include <hwloc.h>
--#include <hwloc/glibc-sched.h>
- #include <sys/types.h>
- #include <signal.h>
- #include <poll.h>
-@@ -80,6 +79,8 @@ struct args
- 	unsigned long long *arg1;
- 	unsigned long arg2;
- 	int poll_fd;
-+	hwloc_topology_t topology;
-+	hwloc_cpuset_t cpuset;
- };
- 
- static void *testcase_trampoline(void *p)
-@@ -103,17 +104,29 @@ void new_task(void *(func)(void *), void
- 	pthread_create(&tid, NULL, func, arg);
- }
- 
--void new_task_affinity(struct args *args,
--		       size_t cpuset_size, cpu_set_t *mask)
-+static void *thread_pre_trampoline(void *p)
-+{
-+	struct args *args;
-+
-+	args = (struct args *)p;
-+	if (hwloc_set_thread_cpubind(args->topology, pthread_self(),
-+	    args->cpuset, 0)) {
-+		perror("hwloc_set_thread_cpubind");
-+		exit(1);
-+	}
-+	hwloc_topology_destroy(args->topology);
-+	hwloc_bitmap_free(args->cpuset);
-+	return testcase_trampoline(args);
-+}
-+
-+void new_task_affinity(struct args *args)
- {
- 	pthread_attr_t attr;
- 	pthread_t tid;
- 
- 	pthread_attr_init(&attr);
- 
--	pthread_attr_setaffinity_np(&attr, cpuset_size, mask);
--
--	pthread_create(&tid, &attr, testcase_trampoline, args);
-+	pthread_create(&tid, &attr, thread_pre_trampoline, args);
- 
- 	pthread_attr_destroy(&attr);
- }
-@@ -166,14 +179,27 @@ void new_task(void *(func)(void *), void
- 	pids[nr_pids++] = pid;
- }
- 
--void new_task_affinity(struct args *args,
--		       size_t cpuset_size, cpu_set_t *mask)
-+void new_task_affinity(struct args *args)
- {
--	cpu_set_t old_mask;
-+	hwloc_cpuset_t old_set;
- 	int pid;
- 
--	sched_getaffinity(0, sizeof(old_mask), &old_mask);
--	sched_setaffinity(0, cpuset_size, mask);
-+
-+	old_set = hwloc_bitmap_alloc();
-+	if (old_set == NULL) {
-+		perror("hwloc_bitmap_alloc");
-+		exit(1);
-+	}
-+	if (hwloc_get_cpubind(args->topology, old_set,
-+	    HWLOC_CPUBIND_PROCESS) < 0) {
-+		perror("hwloc_get_cpubind");
-+		exit(1);
-+	}
-+	if (hwloc_set_cpubind(args->topology, args->cpuset,
-+	    HWLOC_CPUBIND_PROCESS) < 0) {
-+		perror("hwloc_set_cpubind");
-+		exit(1);
-+	}
- 
- 	parent_pid = getpid();
- 
-@@ -195,9 +221,17 @@ void new_task_affinity(struct args *args
- 		testcase_trampoline(args);
- 	}
- 
--	sched_setaffinity(0, sizeof(old_mask), &old_mask);
-+	if (hwloc_set_cpubind(args->topology, old_set,
-+	    HWLOC_CPUBIND_PROCESS) < 0) {
-+		perror("hwloc_set_cpubind");
-+		exit(1);
-+	}
- 
- 	pids[nr_pids++] = pid;
-+	hwloc_topology_destroy(args->topology);
-+	hwloc_bitmap_free(args->cpuset);
-+	hwloc_bitmap_free(old_set);
-+
- }
- 
- 
-@@ -273,7 +307,6 @@ int main(int argc, char *argv[])
- 			smt_affinity ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE);
- 	for (i = 0; i < opt_tasks; i++) {
- 		hwloc_obj_t obj;
--		cpu_set_t mask;
- 		struct args *args;
- 
- 		args = malloc(sizeof(struct args));
-@@ -285,13 +318,18 @@ int main(int argc, char *argv[])
- 		args->arg1 = results[i];
- 		args->arg2 = i;
- 		args->poll_fd = fd[0];
--
- 		obj = hwloc_get_obj_by_type(topology,
- 				smt_affinity ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE,
- 				i % n);
--		hwloc_cpuset_to_glibc_sched_affinity(topology,
--				obj->cpuset, &mask, sizeof(mask));
--		new_task_affinity(args, sizeof(mask), &mask);
-+		if ((args->cpuset = hwloc_bitmap_dup(obj->cpuset)) == NULL) {
-+			perror("hwloc_bitmap_dup");
-+			exit(1);
-+		}
-+		if (hwloc_topology_dup(&args->topology, topology)) {
-+			perror("hwloc_topology_dup");
-+			exit(1);
-+		}
-+		new_task_affinity(args);
- 	}
- 
- 	if (write(fd[1], &i, 1) != 1) {
diff --git a/will-it-scale-git/patches/patch-tests_fallocate2.c b/will-it-scale-git/patches/patch-tests_fallocate2.c
new file mode 100644
index 0000000000..58d6a3cbd1
--- /dev/null
+++ b/will-it-scale-git/patches/patch-tests_fallocate2.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- tests/fallocate2.c.orig	2019-11-20 22:52:24.000000000 +0000
++++ tests/fallocate2.c
+@@ -1,3 +1,10 @@
++char *testcase_description = "Separate file fallocate";
++
++#if defined(__NetBSD__)
++void testcase(unsigned long long *iterations, unsigned long nr)
++{
++}
++#else
+ #define _GNU_SOURCE             /* See feature_test_macros(7) */
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -9,8 +16,6 @@
+ #define FILESIZE (1 * 1024 * 1024)
+ #define BUFLEN (FILESIZE / 128)
+ 
+-char *testcase_description = "Separate file fallocate";
+-
+ void testcase(unsigned long long *iterations, unsigned long nr)
+ {
+ 	char tmpfile[] = "/tmp/willitscale.XXXXXX";
+@@ -32,4 +37,4 @@ void testcase(unsigned long long *iterat
+ 		(*iterations)++;
+ 	}
+ }
+-
++#endif
diff --git a/will-it-scale-git/patches/patch-tests_tlb__flush1.c b/will-it-scale-git/patches/patch-tests_tlb__flush1.c
new file mode 100644
index 0000000000..dade84bac5
--- /dev/null
+++ b/will-it-scale-git/patches/patch-tests_tlb__flush1.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- tests/tlb_flush1.c.orig	2019-11-20 22:52:24.000000000 +0000
++++ tests/tlb_flush1.c
+@@ -10,7 +10,12 @@
+ #include <sys/syscall.h>
+ #include <stdio.h>
+ 
++#if defined(__NetBSD__)
++#include <lwp.h>
++#define gettid()  (long int)_lwp_self()
++#else
+ #define gettid()  syscall(SYS_gettid)
++#endif
+ #define FILESIZE (128 * 1024 * 1024)
+ 
+ char *testcase_description = "TLB flush of separated file private mapping";
diff --git a/will-it-scale-git/patches/patch-tests_tlb__flush2.c b/will-it-scale-git/patches/patch-tests_tlb__flush2.c
new file mode 100644
index 0000000000..f82f8a6b92
--- /dev/null
+++ b/will-it-scale-git/patches/patch-tests_tlb__flush2.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- tests/tlb_flush2.c.orig	2019-11-20 22:52:24.000000000 +0000
++++ tests/tlb_flush2.c
+@@ -10,7 +10,12 @@
+ #include <sys/syscall.h>
+ #include <stdio.h>
+ 
++#if defined(__NetBSD__)
++#include <lwp.h>
++#define gettid()  (long int)_lwp_self()
++#else
+ #define gettid()  syscall(SYS_gettid)
++#endif
+ #define MEMORYSIZE (1 * 1024 * 1024)
+ 
+ char *testcase_description = "TLB flush of anonymous memory private mapping";
diff --git a/will-it-scale-git/patches/patch-tests_tlb__flush3.c b/will-it-scale-git/patches/patch-tests_tlb__flush3.c
new file mode 100644
index 0000000000..32eaf64386
--- /dev/null
+++ b/will-it-scale-git/patches/patch-tests_tlb__flush3.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- tests/tlb_flush3.c.orig	2019-11-20 22:52:24.000000000 +0000
++++ tests/tlb_flush3.c
+@@ -10,7 +10,12 @@
+ #include <sys/syscall.h>
+ #include <stdio.h>
+ 
++#if defined(__NetBSD__)
++#include <lwp.h>
++#define gettid()  (long int)_lwp_self()
++#else
+ #define gettid()  syscall(SYS_gettid)
++#endif
+ #define FILESIZE (128 * 1024 * 1024)
+ 
+ char *testcase_description = "TLB flush of separated file shared mapping";


Home | Main Index | Thread Index | Old Index