summaryrefslogtreecommitdiffstats
path: root/rtas21-ae-case-study.sh
blob: b066b6eec5286122632e304f87dcd01b58bf03e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/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"

if [[ "$EUID" != 0 ]]; then
    echo "You need to be root to run realtime tasks with LITMUS-RT!"
    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 <taskset root directory> <num tasksets>"
        exit
    fi
    taskset_root=$1
    num_studies=$2
    if [[ ! -d "$taskset_root" ]]; then
        echo "Path '$taskset_root' not found."
        echo "Usage: $0 <taskset root directory> <num tasksets>"
        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"
    /playpen/mc2/liblitmus/release_ts
    sleep 3600
    echo "Killing taskset $i"
    kill $(cat pids.txt)
    sleep 600
done