summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2022-09-13 02:52:43 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2022-09-13 02:52:43 -0400
commit7741a500c1da6d534c6b0aeac78531212b743236 (patch)
tree3306c867f367d507e870bd0dd4216cb2c181b08d
parentaef45d67ef9a662329a8a9e555e341dd79c6a86a (diff)
Fix some privilege bugs with fig10_experiments.shrtss22-ae
-rwxr-xr-x[-rw-r--r--]fig10_experiments.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/fig10_experiments.sh b/fig10_experiments.sh
index b35caf9..5d48235 100644..100755
--- a/fig10_experiments.sh
+++ b/fig10_experiments.sh
@@ -1,24 +1,29 @@
1#!/bin/bash 1#!/bin/bash
2# May ask for sudo to drop caches between CPU paging experiments 2# Needs sudo to drop caches between CPU paging experiments
3# DO NOT execute this whole script as sudo
4if [ $# -eq 0 ]; then 3if [ $# -eq 0 ]; then
5 echo "Usage: $0 <number of sampling iterations>" 4 echo "Usage: $0 <number of sampling iterations>"
6 exit 5 exit
7fi 6fi
8 7
8if [ "$EUID" != 0 ]; then
9 sudo "$0" "$@"
10 exit $?
11fi
12
9iters=$1 13iters=$1
10 14
11echo "Running GPU paging experiments..." 15echo "Running GPU paging experiments..."
12gpu_times=$(date +"%b%d-%H")-gpu-times.tsv 16gpu_times=$(date +"%b%d-%H")-gpu-times.tsv
13echo "# Generated by './fig10_experiments.sh' with $iters iters" > $gpu_times 17echo "# Generated by './fig10_experiments.sh' with $iters iters" > $gpu_times
14for ((i = 1; i <= $iters; i++)); do ./gpu_paging_speed | tr -cd '[[:digit:]]\t\n' | sed "/\t$/d"; done >> $gpu_times 18# GPU paging needs to be run as a non-root user
19for ((i = 1; i <= $iters; i++)); do sudo -u ae ./gpu_paging_speed | tr -cd '[[:digit:]]\t\n' | sed "/\t$/d"; done >> $gpu_times
15 20
16echo "Done. Running direct I/O experiments..." 21echo "Done. Running direct I/O experiments..."
17directio_times=$(date +"%b%d-%H")-directio-times.tsv 22directio_times=$(date +"%b%d-%H")-directio-times.tsv
18sudo ./directio_paging_speed $iters > $directio_times 23./directio_paging_speed $iters > $directio_times
19 24
20echo "Done. Running demand paging experiments..." 25echo "Done. Running demand paging experiments..."
21demand_paging_times=$(date +"%b%d-%H")-demand-paging-times.tsv 26demand_paging_times=$(date +"%b%d-%H")-demand-paging-times.tsv
22sudo ./demand_paging_speed $iters > $demand_paging_times 27./demand_paging_speed $iters > $demand_paging_times
23 28
24echo "Done! Results are saved in $gpu_times, $directio_times, and $demand_paging_times" 29echo "Done! Results are saved in $gpu_times, $directio_times, and $demand_paging_times"