summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenhua Luo <b19537@freescale.com>2012-03-09 11:22:17 +0000
committerKhem Raj <raj.khem@gmail.com>2012-03-11 10:10:37 -0700
commit36e2463bb988b9df930a70392622b68ad2b9f035 (patch)
treeffcdf5f64c8ae4e1382e66e0c513218184c0486f
parent77a7fad52a7ff6a6c5e6c48d7d259055920a3774 (diff)
downloadmeta-openembedded-36e2463bb988b9df930a70392622b68ad2b9f035.tar.gz
netperf: add version 2.4.4
Signed-off-by: Zhenhua Luo <b19537@freescale.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-benchmark/netperf/files/cpu_set.patch24
-rw-r--r--meta-oe/recipes-benchmark/netperf/files/init51
-rw-r--r--meta-oe/recipes-benchmark/netperf/files/vfork.patch26
-rw-r--r--meta-oe/recipes-benchmark/netperf/netperf_2.4.4.bb46
4 files changed, 147 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/netperf/files/cpu_set.patch b/meta-oe/recipes-benchmark/netperf/files/cpu_set.patch
new file mode 100644
index 000000000..b2b95c78b
--- /dev/null
+++ b/meta-oe/recipes-benchmark/netperf/files/cpu_set.patch
@@ -0,0 +1,24 @@
1Index: netperf-2.4.4/src/netlib.c
2===================================================================
3--- netperf-2.4.4.orig/src/netlib.c 2007-10-17 23:16:02.000000000 +0200
4+++ netperf-2.4.4/src/netlib.c 2008-12-03 17:56:32.000000000 +0100
5@@ -1988,10 +1988,15 @@
6 fall-back on what we had before, which is to use just the size of
7 an unsigned long. raj 2006-09-14 */
8
9-#if defined(__CPU_SETSIZE)
10-#define NETPERF_CPU_SETSIZE __CPU_SETSIZE
11-#define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET(cpu, cpusetp)
12-#define NETPERF_CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
13+#if defined(CPU_SETSIZE)
14+#define NETPERF_CPU_SETSIZE CPU_SETSIZE
15+#define NETPERF_CPU_SET(cpu, cpusetp) CPU_SET(cpu, cpusetp)
16+#define NETPERF_CPU_ZERO(cpusetp) CPU_ZERO (cpusetp)
17+ typedef cpu_set_t netperf_cpu_set_t;
18+#elif defined(__CPU_SETSIZE)
19+#define NETPERF_CPU_SETSIZE __CPU_SETSIZE
20+#define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
21+#define NETPERF_CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
22 typedef cpu_set_t netperf_cpu_set_t;
23 #else
24 #define NETPERF_CPU_SETSIZE sizeof(unsigned long)
diff --git a/meta-oe/recipes-benchmark/netperf/files/init b/meta-oe/recipes-benchmark/netperf/files/init
new file mode 100644
index 000000000..7cc053ad1
--- /dev/null
+++ b/meta-oe/recipes-benchmark/netperf/files/init
@@ -0,0 +1,51 @@
1#!/bin/sh
2#
3#
4# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
5# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.org>.
6# Modified for Debian by Christoph Lameter <clameter@debian.org>
7# Modified for openembedded by Bruno Randolf <bruno.randolf@4g-systems.biz>
8
9PATH=/bin:/usr/bin:/sbin:/usr/sbin
10DAEMON=/usr/sbin/netserver
11
12test -f $DAEMON || exit 0
13
14case "$1" in
15 start)
16 echo -n "Starting network benchmark server: netserver"
17 start-stop-daemon -S -x $DAEMON > /dev/null 2>&1
18 echo "."
19 ;;
20 stop)
21 echo -n "Stopping network benchmark server: netserver"
22 start-stop-daemon -K -x $DAEMON
23 echo "."
24 ;;
25 #reload)
26 #
27 # If the daemon can reload its config files on the fly
28 # for example by sending it SIGHUP, do it here.
29 #
30 # If the daemon responds to changes in its config file
31 # directly anyway, make this a do-nothing entry.
32 #
33 # start-stop-daemon --stop --signal 1 --verbose --exec $DAEMON
34 # ;;
35 restart|force-reload)
36 #
37 # If the "reload" option is implemented, move the "force-reload"
38 # option to the "reload" entry above. If not, "force-reload" is
39 # just the same as "restart".
40 #
41 start-stop-daemon -K -x $DAEMON
42 sleep 1
43 start-stop-daemon -S -x $DAEMON
44 ;;
45 *)
46 echo "Usage: /etc/init.d/netperf {start|stop|restart|force-reload}"
47 exit 1
48 ;;
49esac
50
51exit 0
diff --git a/meta-oe/recipes-benchmark/netperf/files/vfork.patch b/meta-oe/recipes-benchmark/netperf/files/vfork.patch
new file mode 100644
index 000000000..a40c96fca
--- /dev/null
+++ b/meta-oe/recipes-benchmark/netperf/files/vfork.patch
@@ -0,0 +1,26 @@
1--- netperf-2.4.4/src/netserver.c 2007-10-17 17:09:12.000000000 -0400
2+++ netperf-2.4.4.new/src/netserver.c 2011-01-23 12:26:39.000000000 -0500
3@@ -567,7 +567,11 @@
4 fflush (stdin);
5 fflush (stdout);
6 fflush (stderr);
7+#if defined(HAVE_FORK)
8 switch (fork())
9+#else
10+ switch (vfork())
11+#endif
12 {
13 case -1:
14 perror("netperf server error");
15@@ -712,7 +716,11 @@
16 #else
17 signal(SIGCLD, SIG_IGN);
18
19+#if defined(HAVE_FORK)
20 switch (fork())
21+#else
22+ switch (vfork())
23+#endif
24 {
25 case -1:
26 /* something went wrong */
diff --git a/meta-oe/recipes-benchmark/netperf/netperf_2.4.4.bb b/meta-oe/recipes-benchmark/netperf/netperf_2.4.4.bb
new file mode 100644
index 000000000..6a3a81c51
--- /dev/null
+++ b/meta-oe/recipes-benchmark/netperf/netperf_2.4.4.bb
@@ -0,0 +1,46 @@
1DESCRIPTION="Network performance benchmark including tests for TCP, UDP, sockets, ATM and more."
2SECTION = "console/network"
3HOMEPAGE = "http://www.netperf.org/"
4LICENSE = "GPLv2+"
5
6LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6"
7
8SRC_URI="ftp://ftp.netperf.org/netperf/archive/netperf-${PV}.tar.bz2 \
9 file://cpu_set.patch \
10 file://vfork.patch \
11 file://init"
12
13SRC_URI[md5sum] = "0e942f22864e601406a994420231075b"
14SRC_URI[sha256sum] = "28e76af491ea3696885e4558ae2f5628a4b9ebdbefc2f1d9cf1b35db2813e497"
15
16inherit update-rc.d autotools
17
18S = "${WORKDIR}/netperf-${PV}"
19
20# cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros
21CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE"
22
23do_install() {
24 install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d
25 install -m 4755 src/netperf ${D}${bindir}
26 install -m 4755 src/netserver ${D}${sbindir}
27 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
28
29 # man
30 install -d ${D}${mandir}/man1/
31 install -m 0644 doc/netserver.man ${D}${mandir}/man1/netserver.1
32 install -m 0644 doc/netperf.man ${D}${mandir}/man1/netperf.1
33
34 # move scripts to examples directory
35 install -d ${D}${docdir}/netperf/examples
36 install -m 0644 doc/examples/*_script ${D}${docdir}/netperf/examples/
37
38 # docs ..
39 install -m 0644 COPYING ${D}${docdir}/netperf
40 install -m 0644 Release_Notes ${D}${docdir}/netperf
41 install -m 0644 README ${D}${docdir}/netperf
42 install -m 0644 doc/netperf_old.ps ${D}${docdir}/netperf
43}
44
45INITSCRIPT_NAME="netperf"
46INITSCRIPT_PARAMS="defaults"