diff options
| author | Roy Li <rongqing.li@windriver.com> | 2014-07-18 16:50:02 +0800 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-07-22 00:01:57 +0200 |
| commit | 3bcea1441cc608fc7e0913c5b8c30b39c5eef3aa (patch) | |
| tree | b59298b5933b46e3bfa310fa8998b9435a6bdee3 | |
| parent | 96d6bd7721dd4c95663e2aea65f2a8df0e62325c (diff) | |
| download | meta-openembedded-3bcea1441cc608fc7e0913c5b8c30b39c5eef3aa.tar.gz | |
numctl: add recipe
It consists of a numactl program to run other programs with a specific NUMA
policy and a libnuma to do allocations with NUMA policy in applications.
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
5 files changed, 146 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/numactl/numactl/Fix-the-test-output-format.patch b/meta-oe/recipes-support/numactl/numactl/Fix-the-test-output-format.patch new file mode 100644 index 0000000000..8c309a4b5c --- /dev/null +++ b/meta-oe/recipes-support/numactl/numactl/Fix-the-test-output-format.patch | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | [PATCH] Fix the test output format | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | |||
| 5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
| 6 | --- | ||
| 7 | test/regress | 6 +++--- | ||
| 8 | test/regress2 | 9 ++++----- | ||
| 9 | 2 files changed, 7 insertions(+), 8 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/test/regress b/test/regress | ||
| 12 | index 05eff5b..10d72f7 100755 | ||
| 13 | --- a/test/regress | ||
| 14 | +++ b/test/regress | ||
| 15 | @@ -73,6 +73,7 @@ probe_hardware() | ||
| 16 | if [ $numnodes -lt 2 ] ; then | ||
| 17 | echo "need at least two nodes with at least $NEEDPAGES each of" | ||
| 18 | echo "free memory for mempolicy regression tests" | ||
| 19 | + echo "FAIL: numa regress" | ||
| 20 | exit 1 | ||
| 21 | fi | ||
| 22 | } | ||
| 23 | @@ -206,10 +207,9 @@ main() | ||
| 24 | rm A B | ||
| 25 | |||
| 26 | if [ "$EXIT" = 0 ] ; then | ||
| 27 | - echo '========SUCCESS' | ||
| 28 | + echo 'PASS: numactl regress' | ||
| 29 | else | ||
| 30 | - echo '========FAILURE' | ||
| 31 | - exit 1 | ||
| 32 | + echo 'FAIL: numactl regress' | ||
| 33 | fi | ||
| 34 | } | ||
| 35 | |||
| 36 | diff --git a/test/regress2 b/test/regress2 | ||
| 37 | index 6a254fa..9c97943 100755 | ||
| 38 | --- a/test/regress2 | ||
| 39 | +++ b/test/regress2 | ||
| 40 | @@ -6,12 +6,11 @@ VALGRIND=${VALGRIND:-} | ||
| 41 | export LD_LIBRARY_PATH=`pwd`/.. | ||
| 42 | |||
| 43 | T() { | ||
| 44 | - echo "$@" | ||
| 45 | - if ! $VALGRIND "$@" ; then | ||
| 46 | - echo $1 FAILED!!!! | ||
| 47 | - exit 1 | ||
| 48 | + if ! $VALGRIND "$@" 2>&1 1>/dev/null; then | ||
| 49 | + echo "FAIL: $1" | ||
| 50 | + else | ||
| 51 | + echo "PASS: $1" | ||
| 52 | fi | ||
| 53 | - echo | ||
| 54 | } | ||
| 55 | |||
| 56 | # various tests | ||
| 57 | -- | ||
| 58 | 1.7.10.4 | ||
| 59 | |||
diff --git a/meta-oe/recipes-support/numactl/numactl/Makefile b/meta-oe/recipes-support/numactl/numactl/Makefile new file mode 100644 index 0000000000..9a5134c3f2 --- /dev/null +++ b/meta-oe/recipes-support/numactl/numactl/Makefile | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | .PHONY: regress1 regress2 | ||
| 2 | |||
| 3 | regress1: | ||
| 4 | cd test ; ./regress | ||
| 5 | |||
| 6 | regress2: | ||
| 7 | cd test ; ./regress2 | ||
diff --git a/meta-oe/recipes-support/numactl/numactl/fix-null-pointer.patch b/meta-oe/recipes-support/numactl/numactl/fix-null-pointer.patch new file mode 100644 index 0000000000..53952aef95 --- /dev/null +++ b/meta-oe/recipes-support/numactl/numactl/fix-null-pointer.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | [PATCH] return 0 if distance_table is NULL | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | |||
| 5 | read_distance_table() maybe return 0, but distance_table is not set, | ||
| 6 | if distance_table is used, and will lead to SEGFAULT | ||
| 7 | |||
| 8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
| 9 | --- | ||
| 10 | distance.c | 2 ++ | ||
| 11 | 1 file changed, 2 insertions(+) | ||
| 12 | |||
| 13 | diff --git a/distance.c b/distance.c | ||
| 14 | index 4a26972..c6ca021 100755 | ||
| 15 | --- a/distance.c | ||
| 16 | +++ b/distance.c | ||
| 17 | @@ -113,6 +113,8 @@ int numa_distance(int a, int b) | ||
| 18 | int err = read_distance_table(); | ||
| 19 | if (err < 0) | ||
| 20 | return 0; | ||
| 21 | + if (!distance_table) | ||
| 22 | + return 0; | ||
| 23 | } | ||
| 24 | return distance_table[a * distance_numnodes + b]; | ||
| 25 | } | ||
| 26 | -- | ||
| 27 | 1.7.10.4 | ||
| 28 | |||
diff --git a/meta-oe/recipes-support/numactl/numactl/run-ptest b/meta-oe/recipes-support/numactl/numactl/run-ptest new file mode 100755 index 0000000000..215f7c25b9 --- /dev/null +++ b/meta-oe/recipes-support/numactl/numactl/run-ptest | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | make regress1 | ||
| 3 | make regress2 | ||
| 4 | if numademo -t -e 10M; then | ||
| 5 | echo "PASS: numademo" | ||
| 6 | else | ||
| 7 | echo "FAIL: numademo" | ||
| 8 | fi | ||
| 9 | |||
diff --git a/meta-oe/recipes-support/numactl/numactl_2.0.9.bb b/meta-oe/recipes-support/numactl/numactl_2.0.9.bb new file mode 100644 index 0000000000..bbb3393a4a --- /dev/null +++ b/meta-oe/recipes-support/numactl/numactl_2.0.9.bb | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | SUMMARY = "Development package for building Applications that use numa" | ||
| 2 | DESCRIPTION = "Simple NUMA policy support. It consists of a numactl program \ | ||
| 3 | to run other programs with a specific NUMA policy and a libnuma to do \ | ||
| 4 | allocations with NUMA policy in applications." | ||
| 5 | LICENSE = "GPL-2.0 & LGPL-2.1" | ||
| 6 | SECTION = "apps" | ||
| 7 | RDEPENDS_${PN} = "perl" | ||
| 8 | |||
| 9 | inherit autotools-brokensep ptest | ||
| 10 | |||
| 11 | LIC_FILES_CHKSUM = "file://README;beginline=19;endline=32;md5=5644cc3851cb2499f6c48e52fe198bd9" | ||
| 12 | SRC_URI[md5sum] = "136685c8eaf9d6569c351fe1d453b30c" | ||
| 13 | SRC_URI[sha256sum] = "9ca033e6c14c0f26c20379b0cf9299429fd5a354a79c3c7880fd41ef69f7751c" | ||
| 14 | |||
| 15 | SRC_URI = "ftp://oss.sgi.com/www/projects/libnuma/download/${BPN}-${PV}.tar.gz \ | ||
| 16 | file://fix-null-pointer.patch \ | ||
| 17 | file://Fix-the-test-output-format.patch \ | ||
| 18 | file://Makefile \ | ||
| 19 | file://run-ptest \ | ||
| 20 | " | ||
| 21 | |||
| 22 | # ARM does not currently support NUMA | ||
| 23 | COMPATIBLE_HOST = "^((?!arm).*)$" | ||
| 24 | |||
| 25 | do_install() { | ||
| 26 | oe_runmake DESTDIR=${D} prefix=${D}/usr libdir=${D}/${libdir} install | ||
| 27 | #remove the empty man2 directory | ||
| 28 | rm -r ${D}${mandir}/man2 | ||
| 29 | } | ||
| 30 | |||
| 31 | do_install_ptest() { | ||
| 32 | #install tests binaries | ||
| 33 | local test_binaries="checkaffinity checktopology distance \ | ||
| 34 | ftok mbind_mig_pages migrate_pages move_pages mynode \ | ||
| 35 | nodemap pagesize prefered printcpu randmap realloc_test \ | ||
| 36 | regress regress2 runltp shmtest tbitmap tshared" | ||
| 37 | |||
| 38 | [ ! -d ${D}/${PTEST_PATH}/test ] && mkdir -p ${D}/${PTEST_PATH}/test | ||
| 39 | for i in $test_binaries; do | ||
| 40 | install -m 0755 ${B}/test/$i ${D}${PTEST_PATH}/test | ||
| 41 | done | ||
| 42 | install -m 0755 ${WORKDIR}/Makefile ${D}${PTEST_PATH}/ | ||
| 43 | } | ||
