Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions multi_vms/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"

VIOMMU_MODES=("off" "nested" "nested-vFree")
# VIOMMU_MODES=("nested-vFree")

# --- Experiment configurations ---
# (num_vms, num_total_cores, num_active_cores, num_flows)
# num_flows = num_active_cores per VM
CONFIGS=(
"2 16 15 15"
"2 16 16 16"
"4 8 7 7"
"4 8 8 8"
"8 4 3 3"
"8 4 4 4"
)

Expand Down
4 changes: 2 additions & 2 deletions multi_vms/run_vms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SKIP_RESET_HOST=0

# --- Hardcoded experiment config ---
GIT_REPO="/home/schai/viommu"
GIT_BRANCH="many-vm-setup"
GIT_BRANCH="many-investigation"
VM_SCRIPT="cd /home/schai/viommu/scripts/sosp24-experiments; ./many_vm_flows_exp.sh"

# --- Host paths (this script runs ON the host) ---
Expand Down Expand Up @@ -68,7 +68,7 @@ IP_BASE="192.168.122.100"
VF_DRIVER="vfio-pci"

# --- Timeouts ---
BOOT_TIMEOUT=120 # seconds to poll SSH
BOOT_TIMEOUT=240 # seconds to poll SSH
NIC_WAIT=120 # seconds to wait for guest NIC

# --- Guest NIC interface name (SR-IOV VF) ---
Expand Down
41 changes: 37 additions & 4 deletions scripts/many-vm-run-dctcp-tput-experiment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ CLIENT_SETUP_DIR_REL="utils"
CLIENT_EXP_DIR_REL="utils/tcp"

EBPF_GUEST_LOADER_REL="$GUEST_FandS_REL/tracing/guest_loader"
EBPF_HOST_LOADER="/home/lbalara/viommu/ManyVM-FandS/tracing/server_loader" #hardcoded for speed
HOST_SETUP_DIR="/home/lbalara/viommu/ManyVM-FandS/utils"

# --- Remote Access (SSH) Configuration ---
HOST_SSH_UNAME="lbalara"
Expand All @@ -44,7 +46,8 @@ VM_ID="0" # Unique per-VM identifier for session names, ports, file prefixes
NUM_RUNS=1 # Always 1 for multi-VM; coordination handled by host
CORE_DURATION_S=20 # Duration for the main workload
MLC_CORES="none"
EBPF_TRACING_ENABLED=0
EBPF_TRACING_ENABLED=1
EBPF_TRACING_HOST_ENABLED=0
COLLECT_MEM_STATS=0

# --- Guest (Server) Machine Configuration ---
Expand Down Expand Up @@ -195,6 +198,12 @@ SCREEN_CLIENT_SESSION="client_session_vm${VM_ID}"
SCREEN_CLIENT_LOGGING="logging_session_client_vm${VM_ID}"
INIT_PORT=$((3000 + VM_ID * 100))

# Only trace on vm0
if [ "$VM_ID" -ne 0 ]; then
EBPF_TRACING_HOST_ENABLED=0
EBPF_TRACING_ENABLED=0
fi

GUEST_SETUP_DIR="${GUEST_HOME}/${GUEST_FandS_REL}/${GUEST_SETUP_DIR_REL}"
GUEST_EXP_DIR="${GUEST_HOME}/${GUEST_FandS_REL}/${GUEST_EXP_DIR_REL}"
GUEST_MLC_DIR="${GUEST_HOME}/${GUEST_MLC_DIR_REL}"
Expand Down Expand Up @@ -320,6 +329,14 @@ cleanup() {
sudo pkill -SIGINT -f "$guest_loader_basename" 2>/dev/null || true
sudo pkill -9 -f "$guest_loader_basename" 2>/dev/null || true
fi
if [ "$EBPF_TRACING_HOST_ENABLED" -eq 1 ]; then
local host_loader_basename
host_loader_basename=$(basename "$EBPF_HOST_LOADER")
$SSH_HOST_CMD \
"sudo pkill -SIGINT -f '$host_loader_basename'; sleep 5; sudo pkill -9 -f '$host_loader_basename'; screen -S ebpf_host_tracer -X quit || true"
fi
sleep 5


# Only kill THIS VM's screen sessions on the client (not other VMs')
log_info "Terminating client screen sessions: $SCREEN_CLIENT_SESSION, $SCREEN_CLIENT_LOGGING"
Expand Down Expand Up @@ -406,6 +423,7 @@ log_info "############################################################"
# Files within the client dir also get vm prefix for safety in case the
# caller passes a shared EXP_NAME.
current_guest_reports_dir="${GUEST_SETUP_DIR}/reports/${EXP_NAME}-RUN-${j}"
host_reports_dir_remote="${HOST_SETUP_DIR}/reports/${EXP_NAME}-RUN-${j}"
client_reports_dir_remote="${CLIENT_SETUP_DIR}/reports/${EXP_NAME}-RUN-${j}"

perf_guest_data_file="${current_guest_reports_dir}/perf_guest_cpu.data"
Expand All @@ -415,8 +433,10 @@ guest_server_app_log_file="${current_guest_reports_dir}/server_app.log"
guest_mlc_log_file="${current_guest_reports_dir}/mlc.log"
client_app_log_file="${current_guest_reports_dir}/client_app.log"
client_app_log_file_remote="${client_reports_dir_remote}/client_app.log"
ebpf_host_stats="${host_reports_dir_remote}/ebpf_host_stats.csv"

sudo mkdir -p "$current_guest_reports_dir"
$SSH_HOST_CMD "mkdir -p '$host_reports_dir_remote'"

# --- Pre-run cleanup ---
cleanup
Expand Down Expand Up @@ -470,16 +490,25 @@ $SSH_CLIENT_CMD "screen -dmS $SCREEN_CLIENT_SESSION sudo bash -c \"$client_cmd\"

# --- Warmup Phase ---
log_info "Warming up experiment (120 seconds)..."
progress_bar 120 2
progress_bar 116 2

if [ "$EBPF_TRACING_HOST_ENABLED" -eq 1 ]; then
log_info "Starting HOST eBPF tracer on $HOST_IP..."
host_loader_cmd="sudo taskset -c 33 $EBPF_HOST_LOADER -o $ebpf_host_stats"
$SSH_HOST_CMD "screen -dmS ebpf_host_tracer sudo bash -c \"$host_loader_cmd\""
fi
sleep 4 # Allow eBPF loaders to initialize

# --- Start Guest eBPF Tracers (if enabled) ---
if [ "$EBPF_TRACING_ENABLED" -eq 1 ]; then
log_info "Starting GUEST eBPF tracer..."
echo "current_time: $(date) $(date +%s)"
sudo taskset -c 13 "$EBPF_GUEST_LOADER" -d "$CORE_DURATION_S" -o "$ebpf_guest_stats" &
sleep 2
sudo taskset -c 0 "$EBPF_GUEST_LOADER" -d "$CORE_DURATION_S" -o "$ebpf_guest_stats" &
fi

# Sleep outside so all VMs nearly in sync
sleep 2

# --- Guest Ftrace Setup ---
log_info "Configuring GUEST ftrace (Buffer: ${FTRACE_BUFFER_SIZE_KB}KB, Overwrite: ${FTRACE_OVERWRITE_ON_FULL})..."
sudo sh -c "echo $FTRACE_BUFFER_SIZE_KB > /sys/kernel/debug/tracing/buffer_size_kb"
Expand Down Expand Up @@ -532,6 +561,10 @@ if [ "$EBPF_TRACING_ENABLED" -eq 1 ]; then
log_info "SIGINT sent to GUEST eBPF loader." || \
log_info "WARN: GUEST eBPF loader process not found or SIGINT failed."
fi
if [ "$EBPF_TRACING_HOST_ENABLED" -eq 1 ]; then
host_loader_basename=$(basename "$EBPF_HOST_LOADER")
$SSH_HOST_CMD "sudo pkill -SIGINT -f '$host_loader_basename'"
fi

# --- Transfer Report Files from Client ---
# Files on the client are in a dir named after EXP_NAME (already VM-specific).
Expand Down
7 changes: 7 additions & 0 deletions scripts/sosp24-experiments/many_vm_flows_exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,20 @@ for z in $run_list; do
# --- SCP results back to host ---
echo "Copying results to host..."
local_report_dir="../utils/reports/$EXP_NAME"
local_run_dir="${local_report_dir}-RUN-0"

sudo chmod -R a+rw $local_run_dir

$SSH_HOST_CMD "mkdir -p ${HOST_RESULTS_DIR}/${EXP_NAME}"

$SCP_HOST_CMD -r \
"$local_report_dir"/* \
"${HOST_SSH_UNAME}@${HOST_IP}:${HOST_RESULTS_DIR}/${EXP_NAME}/"

$SCP_HOST_CMD -r \
"$local_run_dir"/* \
"${HOST_SSH_UNAME}@${HOST_IP}:${HOST_RESULTS_DIR}/${EXP_NAME}-RUN-0/"

echo "Results copied to ${HOST_SSH_UNAME}@${HOST_IP}:${HOST_RESULTS_DIR}/${EXP_NAME}/"
done

Expand Down
4 changes: 2 additions & 2 deletions tracing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ reader: $(READER_APP)
clean:
@echo "Cleaning up generated files..."
@rm -f $(HOST_BPF_OBJ) $(HOST_BPF_SKEL) \
$(SERVER_BPF_OBJ) $(SERVER_BPF_SKEL) \
$(SERVER_BPF_OBJ) $(SERVER_BPF_SKEL) \
$(GUEST_BPF_OBJ) $(GUEST_BPF_SKEL) \
$(HOST_LOADER_APP) $(GUEST_LOADER_APP) \
$(HOST_LOADER_APP) $(GUEST_LOADER_APP) $(SERVER_LOADER_APP)\
$(READER_APP) \
vmlinux.h

Loading