Skip to content

Commit 2aee0de

Browse files
committed
rcutorture: Avoid torture.sh compressing identical files
Currently, torture.sh will compress the vmlinux files for KASAN and KCSAN runs. But it will compress all of the files, including those copied verbatim by the kvm-again.sh script. Compression takes around ten minutes, so this is not a good thing. This commit therefore compresses only one of a given set of identical vmlinux files, and then hard-links it to the directories produced by kvm-again.sh. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent dfabd42 commit 2aee0de

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tools/testing/selftests/rcutorture/bin/torture.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,10 @@ if test -n "$tdir" && test $compress_concurrency -gt 0
536536
then
537537
# KASAN vmlinux files can approach 1GB in size, so compress them.
538538
echo Looking for K[AC]SAN files to compress: `date` > "$tdir/log-xz" 2>&1
539-
find "$tdir" -type d -name '*-k[ac]san' -print > $T/xz-todo
539+
find "$tdir" -type d -name '*-k[ac]san' -print > $T/xz-todo-all
540+
find "$tdir" -type f -name 're-run' -print | sed -e 's,/re-run,,' |
541+
grep -e '-k[ac]san$' > $T/xz-todo-copy
542+
sort $T/xz-todo-all $T/xz-todo-copy | uniq -u > $T/xz-todo
540543
ncompresses=0
541544
batchno=1
542545
if test -s $T/xz-todo
@@ -568,6 +571,22 @@ then
568571
echo Waiting for final batch $batchno of $ncompresses compressions `date` | tee -a "$tdir/log-xz" | tee -a $T/log
569572
fi
570573
wait
574+
if test -s $T/xz-todo-copy
575+
then
576+
echo Linking vmlinux.xz files to re-use scenarios `date` | tee -a "$tdir/log-xz" | tee -a $T/log
577+
dirstash="`pwd`"
578+
for i in `cat $T/xz-todo-copy`
579+
do
580+
cd $i
581+
find "$i" -name vmlinux -print > $T/xz-todo-copy-vmlinux
582+
for v in `cat $T/xz-todo-copy-vmlinux`
583+
do
584+
rm -f "$v"
585+
cp -l "$i/$v".xz "`dirname "$v"`"
586+
done
587+
cd "$dirstash"
588+
done
589+
fi
571590
echo Size after compressing $n2compress files: `du -sh $tdir | awk '{ print $1 }'` `date` 2>&1 | tee -a "$tdir/log-xz" | tee -a $T/log
572591
echo Total duration `get_starttime_duration $starttime`. | tee -a $T/log
573592
else

0 commit comments

Comments
 (0)