Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

CORTX-30751: Codacy code cleanup (#1606) #1956

Merged
merged 2 commits into from
Aug 22, 2022
Merged
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
18 changes: 9 additions & 9 deletions scripts/systemtap/kem/kem_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#
# $ make

KEM_DIR="$(readlink -f $0)"
KEM_DIR=$(readlink -f "$0")
KEM_DIR="${KEM_DIR%/*}"

if [ "$EUID" -ne 0 ]; then
Expand All @@ -34,15 +34,15 @@ if [ "$EUID" -ne 0 ]; then
fi

echo Inserting kemd.ko
insmod $KEM_DIR/kemd.ko
insmod "$KEM_DIR/kemd.ko"

for i in $(seq 0 $(($(nproc)-1)))
do
mknod /dev/kemd$i c 60 $i
mknod "/dev/kemd$i" c 60 "$i"
done

echo Running Systemtap
stap -g $KEM_DIR/kemd.stp &
stap -g "$KEM_DIR/kemd.stp" &
stapPID=$!

# Wait stap for start
Expand All @@ -51,7 +51,7 @@ sleep 20
echo Running KEM clients
for i in $(seq 0 $(($(nproc)-1)))
do
$KEM_DIR/m0kemc $i > kemc_cpu$i.log 2>&1 &
"$KEM_DIR/m0kemc" "$i" > kemc_cpu"$i".log 2>&1 &
kemcPIDs[$i]=$!
done

Expand All @@ -70,14 +70,14 @@ sleep 2

for i in $(seq 0 $(($(nproc)-1)))
do
rm -f /dev/kemd$i
rm -f "/dev/kemd$i"
done

echo Removing kemd.ko
rmmod $KEM_DIR/kemd.ko
rmmod "$KEM_DIR/kemd.ko"

for i in $(seq 0 $(($(nproc)-1)))
do
$KEM_DIR/../../../utils/m0run m0addb2dump $PWD/_kemc$i/o/100000000000000:2 | grep pagefault -A 1 | head -n 40
$KEM_DIR/../../../utils/m0run m0addb2dump $PWD/_kemc$i/o/100000000000000:2 | grep ctx_switch -A 1 | head -n 40
"$KEM_DIR/../../../utils/m0run m0addb2dump" "$PWD"/_kemc"$i"/o/100000000000000:2 | grep pagefault -A 1 | head -n 40
"$KEM_DIR/../../../utils/m0run m0addb2dump" "$PWD"/_kemc"$i"/o/100000000000000:2 | grep ctx_switch -A 1 | head -n 40
done