netperf2 relies on a structure defined on the sched.h include, that had
its definition updated on newer systems. After some research, I found
the fix on netperf svn trunk, so a patch to fix the build was created
and applied before we run ./configure.
Risk: Low (Only the relevant change from svn trunk upstream was
backported, it shouldn't bring regressions on older systems).
Visibility: Users of the netperf2 test using it on distros such as
Fedora 10 and OpenSUSE 11, Ubuntu Hardy will be able to use it.
Warning: This is a p0 patch that is supposed to be applied under
client/tests/netperf2. Sorry, had to make this in a hurry.
Signed-off-by: Lucas Meneghel Rodrigues <lucasmr@br.ibm.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2321 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/netperf2/fix_netperf_build.patch b/client/tests/netperf2/fix_netperf_build.patch
new file mode 100644
index 0000000..d37bfef
--- /dev/null
+++ b/client/tests/netperf2/fix_netperf_build.patch
@@ -0,0 +1,16 @@
+--- src/netlib.c.orig 2008-10-21 20:32:05.000000000 -0400
++++ src/netlib.c 2008-10-21 20:35:13.000000000 -0400
+@@ -1990,8 +1990,13 @@
+
+ #if defined(__CPU_SETSIZE)
+ #define NETPERF_CPU_SETSIZE __CPU_SETSIZE
++#if defined(__CPU_SET_S)
++#define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET_S(cpu, sizeof (cpu_set_t), cpusetp)
++#define NETPERF_CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp)
++#else
+ #define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET(cpu, cpusetp)
+ #define NETPERF_CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
++#endif
+ typedef cpu_set_t netperf_cpu_set_t;
+ #else
+ #define NETPERF_CPU_SETSIZE sizeof(unsigned long)
diff --git a/client/tests/netperf2/netperf2.py b/client/tests/netperf2/netperf2.py
index d174664..a8dcc77 100755
--- a/client/tests/netperf2/netperf2.py
+++ b/client/tests/netperf2/netperf2.py
@@ -12,6 +12,10 @@
autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
+ # Fixing up a compile issue under newer systems that have
+ # CPU_SET_S defined on /usr/include/sched.h, backported from
+ # upstream svn trunk
+ utils.system('patch -p1 < ../fix_netperf_build.patch')
utils.system('./configure')
utils.system('make')