-
Notifications
You must be signed in to change notification settings - Fork 34
/
test_bpfkv.sh
executable file
·43 lines (34 loc) · 1.1 KB
/
test_bpfkv.sh
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
if [ "$(uname -r)" != "5.12.0-xrp+" ]; then
printf "Not in XRP kernel. Please run the following commands to boot into XRP kernel:\n"
printf " sudo grub-reboot \"Advanced options for Ubuntu>Ubuntu, with Linux 5.12.0-xrp+\"\n"
printf " sudo reboot\n"
exit 1
fi
SCRIPT_PATH=`realpath $0`
BASE_DIR=`dirname $SCRIPT_PATH`
BPFKV_PATH="$BASE_DIR/BPF-KV"
UTILS_PATH="$BASE_DIR/utils"
MOUNT_POINT="/mnt/xrp"
DB_PATH="$MOUNT_POINT/bpfkv_test_db"
DEV_NAME="/dev/nvme0n1"
if [ ! -z $1 ]; then
DEV_NAME=$1
fi
printf "DEV_NAME=$DEV_NAME\n"
# Check whether BPF-KV is built
if [ ! -e "$BPFKV_PATH/simplekv" ]; then
printf "Cannot find BPF-KV binary. Please build BPF-KV first.\n"
exit 1
fi
# Disable CPU frequency scaling
$UTILS_PATH/disable_cpu_freq_scaling.sh
# Mount disk
$UTILS_PATH/mount_disk.sh $DEV_NAME $MOUNT_POINT
pushd $BPFKV_PATH
sudo rm -rf $MOUNT_POINT/*
printf "Creating a 5-layer database file...\n"
sudo ./simplekv $DB_PATH 5 create
printf "Running a short point lookup benchmark with XRP enabled...\n"
sudo ./simplekv $DB_PATH 5 get --requests=1000 --use-xrp
popd
printf "Done.\n"