#!/bin/bash # Copyright 2021 Joshua Bakita # Developed to run the case study as documented in the RTAS'21 paper, # "Simultaneous Multithreading in Real-Time Mixed-Criticality Systems" LIBLITMUS="${LIBLITMUS:=/playpen/mc2/liblitmus}" if [[ "$EUID" != 0 ]]; then echo "You need to be root to run realtime tasks with LITMUS-RT!" exit fi if ! grep -q mc2 /proc/version; then echo "You must first install the MC^2 kernel!" exit fi if ! grep -q MC2 /proc/litmus/active_plugin; then echo "You must first switch to the MC^2 kernel!" exit fi # Parameter validation if [ $# -lt 1 ]; then taskset_root=ABmod_light_TACle-SDVBS_5.5 num_studies=10 echo "Using default case-study task sets from '$taskset_root'." echo "To use another set, pass the path as the first param and the number of sets as the second." else if [ $# -lt 2 ]; then echo "Number of tasksets not specified!" echo "Usage: $0 " exit fi taskset_root=$1 num_studies=$2 if [[ ! -d "$taskset_root" ]]; then echo "Path '$taskset_root' not found." echo "Usage: $0 " exit else echo "Using case-study task sets from '$taskset_root'." fi fi # Run studies for (( i = 1; i <= $num_studies; i++ )); do echo "Starting case study for taskset $i" ./run_case_study.py $taskset_root/$i/ & sleep 600 echo "Releasing taskset $i" $LIBLITMUS/release_ts sleep 3600 echo "Killing taskset $i" kill $(cat pids.txt) sleep 600 done