tools/testing/selftests/rcutorture/bin/kvm-again.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/rcutorture/bin/kvm-again.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/rcutorture/bin/kvm-again.sh
Extension
.sh
Size
5512 bytes
Lines
246
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0+
#
# Rerun a series of tests under KVM.
#
# Usage: kvm-again.sh /path/to/old/run [ options ]
#
# Copyright (C) 2021 Facebook, Inc.
#
# Authors: Paul E. McKenney <paulmck@kernel.org>

scriptname=$0
args="$*"

T="`mktemp -d ${TMPDIR-/tmp}/kvm-again.sh.XXXXXX`"
trap 'rm -rf $T' 0

if ! test -d tools/testing/selftests/rcutorture/bin
then
	echo $scriptname must be run from top-level directory of kernel source tree.
	exit 1
fi

oldrun=$1
shift
if ! test -d "$oldrun"
then
	echo "Usage: $scriptname /path/to/old/run [ options ]"
	exit 1
fi
if ! cp "$oldrun/scenarios" $T/scenarios.oldrun
then
	# Later on, can reconstitute this from console.log files.
	echo Prior run scenarios file does not exist: $oldrun/scenarios
	exit 1
fi

if test -f "$oldrun/torture_suite"
then
	torture_suite="`cat $oldrun/torture_suite`"
elif test -f "$oldrun/TORTURE_SUITE"
then
	torture_suite="`cat $oldrun/TORTURE_SUITE`"
else
	echo "Prior run torture_suite file does not exist: $oldrun/{torture_suite,TORTURE_SUITE}"
	exit 1
fi

RCUTORTURE="`pwd`/tools/testing/selftests/rcutorture"; export RCUTORTURE
PATH=${RCUTORTURE}/bin:$PATH; export PATH
. functions.sh

bootargs=
dryrun=
dur=
default_link="cp -R"
resdir="`pwd`/tools/testing/selftests/rcutorture/res"
rundir="$resdir/`date +%Y.%m.%d-%H.%M.%S-again`"
got_datestamp=
got_rundir=

startdate="`date`"
starttime="`get_starttime`"

usage () {
	echo "Usage: $scriptname $oldrun [ arguments ]:"
	echo "       --bootargs kernel-boot-arguments"
	echo "       --datestamp string"
	echo "       --dryrun"
	echo "       --duration minutes | <seconds>s | <hours>h | <days>d"

Annotation

Implementation Notes