Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142186359
D26796.id78263.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D26796.id78263.diff
View Options
Index: Makefile.inc1
===================================================================
--- Makefile.inc1
+++ Makefile.inc1
@@ -2342,6 +2342,8 @@
.endif
# mkfifo is used by sys/conf/newvers.sh
_basic_bootstrap_tools+=usr.bin/mkfifo
+# jot is needed for the mkimg tests
+_basic_bootstrap_tools+=usr.bin/jot
.if ${MK_BOOT} != "no"
# md5 is used by boot/beri (and possibly others)
Index: usr.bin/mkimg/tests/Makefile
===================================================================
--- usr.bin/mkimg/tests/Makefile
+++ usr.bin/mkimg/tests/Makefile
@@ -15,9 +15,25 @@
sed -e '/^#.*/D' < ${.ALLSRC} > ${.TARGET}
.endfor
+# Note: Pre-generating this test file saves a lot of time when building on
+# emulated platforms such as QEMU. It can take about 2-5 seconds to generate
+# the test file using jot (depending on the emulated architecture) and this
+# is done for each of the 168 test configurations.
+# The effect is even more pronounced on CHERI-RISCV QEMU (emulating CHERI inside
+# QEMU adds additional run-time overhead): Running the apm_1x1_512_raw without
+# the pre-generated file takes about 108 seconds of which 102 seconds (over 95%)
+# were spent running jot -b. It's even worse on CHERI-MIPS QEMU: 187 seconds
+# for jot -b P 2097152 > /dev/null. By using a pre-generated 4MB file, the
+# slowest test variant (vtoc8_63x255_4096_vhdx) now only takes 29 seconds (of
+# which 26s are spent in hexdump -C) instead of previously 2min30s.
+${PACKAGE}FILES+= partition_data_4M.bin
+partition_data_4M.bin: Makefile
+ jot -b P 2097152 > ${.TARGET} || rm -f ${.TARGET}
+
CLEANFILES+= ${${PACKAGE}FILES}}
-rebase: .PHONY
- (cd ${.CURDIR}; /usr/libexec/atf-sh ${_REBASE_SCRIPT}.sh rebase)
+rebase: partition_data_4M.bin ${_REBASE_SCRIPT} .PHONY
+ cd ${.CURDIR}; PATH=${.OBJDIR}/..:$${PATH}:/usr/bin:/bin \
+ /usr/libexec/atf-sh ${.OBJDIR}/${_REBASE_SCRIPT} -s ${.OBJDIR} rebase
.include <bsd.test.mk>
Index: usr.bin/mkimg/tests/mkimg_test.sh
===================================================================
--- usr.bin/mkimg/tests/mkimg_test.sh
+++ usr.bin/mkimg/tests/mkimg_test.sh
@@ -56,7 +56,7 @@
if test -z "$partarg"; then
local swap ufs
swap="-p freebsd-swap::128K"
- ufs="-p freebsd-ufs:=`mkcontents P 4194304`"
+ ufs="-p freebsd-ufs:=$(atf_get_srcdir)/partition_data_4M.bin"
partarg="$ufs $swap"
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 17, 11:41 PM (8 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27701075
Default Alt Text
D26796.id78263.diff (2 KB)
Attached To
Mode
D26796: Significantly speed up mkimg_test
Attached
Detach File
Event Timeline
Log In to Comment