summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind
diff options
context:
space:
mode:
authorRandy MacLeod <Randy.MacLeod@windriver.com>2019-09-10 17:41:35 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-16 23:02:44 +0100
commit997d91f608ca5f866f9800c52a4d2ebbbce70cd2 (patch)
treeaa79f3946d31e5d50955093b73712f7b00733cc1 /meta/recipes-devtools/valgrind
parent3b83ad583066795fa3419495b320d5596c55597b (diff)
downloadpoky-997d91f608ca5f866f9800c52a4d2ebbbce70cd2.tar.gz
valgrind: ptest improvements to run-ptest and more
Make some changes to the run-ptest script: - after main tests run integrity check like the pkg Makefile. - aesthetic and ordering changes Add the .in_place directory and its contents which allows valgrind to be run in-place thereby enabling the gdbserver_tests to complete rather than hang. Unfortunately directory paths embedded in binaries still cause many of these test to fail. Add the exp-sgcheck tests. With core-image-minimal on qemux86-64/kvm: Recipe | Passed | Failed | Skipped | Time(s) before | 648 | 12 | 60 | 1541 after | 662 | 20 | 38 | 1429 ppc-no-gdbserv | 415 | 196 | 34 | 10689 Since fewer tests timeout, the overall time has decreased. With core-image-sato on qemux86-64/kvm the results are now the same as core-image-minimal. qemuppc/arm64 runs result in the oom-killer eventually running since some processes do not terminate properly and accumulate as defunct processes in memory. Without the gdbserver_tests, the tests complete without defunct process or the oom-killer running for ppc but not for arm64. (From OE-Core rev: 6dbaaeec17eae8329031188b688b33306a871870) Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/valgrind')
-rwxr-xr-xmeta/recipes-devtools/valgrind/valgrind/run-ptest27
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.15.0.bb38
2 files changed, 47 insertions, 18 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/run-ptest b/meta/recipes-devtools/valgrind/valgrind/run-ptest
index 447d33c8cb..5b3ad2a2ed 100755
--- a/meta/recipes-devtools/valgrind/valgrind/run-ptest
+++ b/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -4,13 +4,30 @@
4# wraps the valgrind regression script vg_regtest. 4# wraps the valgrind regression script vg_regtest.
5# 5#
6# Dave Lerner <dave.lerner@windriver.com> 6# Dave Lerner <dave.lerner@windriver.com>
7# Randy MacLeod <Randy.MacLeod@windriver.com>
7############################################################### 8###############################################################
8VALGRINDLIB=@libdir@/valgrind 9VALGRIND_LIB=@libdir@/valgrind
9LOG="${VALGRINDLIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log" 10VALGRIND_BIN=@bindir@/valgrind
10 11
11cd ${VALGRINDLIB}/ptest && ./tests/vg_regtest --all \ 12LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
12 --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \ 13
13 --yocto-ptest 2>&1|tee ${LOG} 14TOOLS="memcheck cachegrind callgrind helgrind drd massif dhat lackey none"
15EXP_TOOLS="exp-bbv exp-dhat exp-sgcheck"
16
17GDB_BIN=@bindir@/gdb
18cd ${VALGRIND_LIB}/ptest && ./gdbserver_tests/make_local_links ${GDB_BIN}
19
20cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
21 --valgrind=${VALGRIND_BIN} \
22 --valgrind-lib=${VALGRIND_LIB} \
23 --yocto-ptest \
24 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
25 2>&1|tee ${LOG}
26
27cd ${VALGRIND_LIB}/ptest && \
28 ./tests/post_regtest_checks $(pwd) \
29 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
30 2>&1|tee -a ${LOG}
14 31
15passed=`grep PASS: ${LOG}|wc -l` 32passed=`grep PASS: ${LOG}|wc -l`
16failed=`grep FAIL: ${LOG}|wc -l` 33failed=`grep FAIL: ${LOG}|wc -l`
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
index bf0ca57c93..6d47b6d01d 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
@@ -110,7 +110,11 @@ RDEPENDS_${PN} += "perl"
110# redirect functions like strlen. 110# redirect functions like strlen.
111RRECOMMENDS_${PN} += "${TCLIBC}-dbg" 111RRECOMMENDS_${PN} += "${TCLIBC}-dbg"
112 112
113RDEPENDS_${PN}-ptest += " bash file libgomp perl perl-module-file-glob procps sed ${PN}-dbg" 113RDEPENDS_${PN}-ptest += " bash coreutils file \
114 gdb libgomp \
115 perl \
116 perl-module-getopt-long perl-module-file-basename perl-module-file-glob \
117 procps sed ${PN}-dbg"
114RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" 118RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
115 119
116# One of the tests contains a bogus interpreter path on purpose. 120# One of the tests contains a bogus interpreter path on purpose.
@@ -136,12 +140,11 @@ do_install_ptest() {
136 cd $parent_dir 140 cd $parent_dir
137 141
138 subdirs=" \ 142 subdirs=" \
143 .in_place \
139 cachegrind/tests \ 144 cachegrind/tests \
140 callgrind/tests \ 145 callgrind/tests \
141 dhat/tests \ 146 dhat/tests \
142 drd/tests \ 147 drd/tests \
143 exp-bbv/tests \
144 exp-dhat/tests \
145 gdbserver_tests \ 148 gdbserver_tests \
146 helgrind/tests \ 149 helgrind/tests \
147 lackey/tests \ 150 lackey/tests \
@@ -149,6 +152,9 @@ do_install_ptest() {
149 memcheck/tests \ 152 memcheck/tests \
150 none/tests \ 153 none/tests \
151 tests \ 154 tests \
155 exp-bbv/tests \
156 exp-dhat/tests \
157 exp-sgcheck/tests \
152 " 158 "
153 # Get the vg test scripts, filters, and expected files 159 # Get the vg test scripts, filters, and expected files
154 for dir in $subdirs ; do 160 for dir in $subdirs ; do
@@ -156,16 +162,24 @@ do_install_ptest() {
156 done 162 done
157 cd $saved_dir 163 cd $saved_dir
158 done 164 done
165
166 # The scripts reference config.h so add it to the top ptest dir.
159 cp ${B}/config.h ${D}${PTEST_PATH} 167 cp ${B}/config.h ${D}${PTEST_PATH}
168
169 # Add an executable need by none/tests/bigcode
160 mkdir ${D}${PTEST_PATH}/perf 170 mkdir ${D}${PTEST_PATH}/perf
161 cp ${B}/perf/bigcode ${D}${PTEST_PATH}/perf 171 cp ${B}/perf/bigcode ${D}${PTEST_PATH}/perf
162 # needed by memcheck/tests/vcpu_bz2 172
173 # Add an executable needed by memcheck/tests/vcpu_bz2
163 cp ${B}/perf/bz2 ${D}${PTEST_PATH}/perf 174 cp ${B}/perf/bz2 ${D}${PTEST_PATH}/perf
164 175
165 # Hide then restore a.c that is used by ann[12].vgtest in call/cachegrind 176 # Make the ptest dir look like the top level valgrind src dir
166 mv ${D}${PTEST_PATH}/cachegrind/tests/a.c ${D}${PTEST_PATH}/cachegrind/tests/a_c 177 # This is checked by the gdbserver_tests/make_local_links script
167 # clean out build artifacts before building the package. Keep config.h for ptests. 178 mkdir ${D}${PTEST_PATH}/coregrind
168 mv ${D}${PTEST_PATH}/config.h ${D}${PTEST_PATH}/config_h 179 cp ${B}/coregrind/vgdb ${D}${PTEST_PATH}/coregrind
180
181 # Add an executable needed by massif tests
182 cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
169 183
170 find ${D}${PTEST_PATH} \ 184 find ${D}${PTEST_PATH} \
171 \( \ 185 \( \
@@ -173,9 +187,9 @@ do_install_ptest() {
173 -o -name "*.o" \ 187 -o -name "*.o" \
174 \) \ 188 \) \
175 -exec rm {} \; 189 -exec rm {} \;
176 mv ${D}${PTEST_PATH}/cachegrind/tests/a_c ${D}${PTEST_PATH}/cachegrind/tests/a.c 190
191 # These files need to be newer so touch them.
177 touch ${D}${PTEST_PATH}/cachegrind/tests/a.c -r ${D}${PTEST_PATH}/cachegrind/tests/cgout-test 192 touch ${D}${PTEST_PATH}/cachegrind/tests/a.c -r ${D}${PTEST_PATH}/cachegrind/tests/cgout-test
178 mv ${D}${PTEST_PATH}/config_h ${D}${PTEST_PATH}/config.h
179 193
180 # find *_annotate in ${bindir} for yocto build 194 # find *_annotate in ${bindir} for yocto build
181 sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann1.vgtest 195 sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann1.vgtest
@@ -184,9 +198,7 @@ do_install_ptest() {
184 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest 198 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest
185 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest 199 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest
186 200
187 # needed by massif tests
188 cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
189
190 # handle multilib 201 # handle multilib
191 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest 202 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
203 sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest
192} 204}