Skip to content

Commit

Permalink
fixup gh
Browse files Browse the repository at this point in the history
  • Loading branch information
thehajime committed Sep 21, 2024
1 parent aadadb9 commit d53d51a
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt update -y
sudo apt install -y ccache libseccomp-dev
sudo apt install -y ccache libseccomp-dev gnuplot
- name: build-0
run: |
make ARCH=um ${{ matrix.defconfig }} O=build
Expand Down
Binary file added .github/workflows/do_getpid
Binary file not shown.
28 changes: 28 additions & 0 deletions .github/workflows/um-nommu-bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

SCRIPT_DIR="$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)"

# macos has different syntax
OUTPUT=$SCRIPT_DIR/$(date "+%Y-%m-%d")
mkdir -p $OUTPUT

TRIALS="1"
ENTRIES="1000000"
VSIZES="1 8 256 1024 8192"
RUNTIMES="build/mmu build"


echo "$(tput bold)== um (mmu) ($test-$num-$vsize) ==$(tput sgr0)"
../linux-um-nommu/build-mmu/vmlinux eth0=tuntap,tap100,0e:fd:0:0:0:1,172.17.0.1 ubd0=./alpine-test.ext3 rw mem=1024m loglevel=0 init=/sbin/init sh \
| tee "$OUTPUT/um-mmu.dat"

echo "$(tput bold)== um (nommu) ($test-$num-$vsize) ==$(tput sgr0)"
../linux-um-nommu/build/vmlinux eth0=tuntap,tap100,0e:fd:0:0:0:1,172.17.0.1 ubd0=./alpine-test.ext3 rw mem=1024m loglevel=0 init=/sbin/init sh \
| tee "$OUTPUT/um-nommu.dat"

echo "$(tput bold)== host (mmu) ($test-$num-$vsize) ==$(tput sgr0)"
sh docker/alpine/lmbench_run.sh \
|& tee "$OUTPUT/native.dat"
./zpoline-bench/do_getpid -c 100 | tee -a "$OUTPUT/native.dat"

bash ${SCRIPT_DIR}/um-nommu-plot.sh
65 changes: 65 additions & 0 deletions .github/workflows/um-nommu-plot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"

OUTPUT="$1"
DIRS="read fill"

mkdir -p "$OUTPUT/out/"

# parse outputs

for f in `ls $OUTPUT/*.dat`
do
cat $f | grep microsec | sed "s/.*:\(.*\)/\1/" | awk '{print $1}' \
> $OUTPUT/out/`basename $f .dat`-out.dat

cat $f | grep average | awk '{print $2 $3}' \
> $OUTPUT/out/`basename $f .dat`-getpid-out.dat
done

gnuplot << EndGNUPLOT
set terminal postscript eps lw 3 "Helvetica" 24
set output "${OUTPUT}/out/lmbench.eps"
#set xtics font "Helvetica,14"
set pointsize 2
set xzeroaxis
set grid ytics
set boxwidth 0.2
set style fill pattern
set size 1.0,0.8
set key top left
set xrange [-0.5:10]
set xtics ('select10' 0, 'select-100' 1, 'select-1000' 2, 'syscall' 3, 'read' 4, 'write' 5, 'stat' 6, 'open/close' 7, 'fork+sh' 8, 'fork+execve' 9)
set xtics rotate by 45 right
set yrange [0.01:100000]
set ylabel "Latency (usec)"
set logscale y
plot \
'${OUTPUT}/out/um-mmu-out.dat' usin (\$0-0.2):(\$1) w boxes fill patter 2 lt 1 lc rgb "green" title "um(mmu)" ,\
'${OUTPUT}/out/um-nommu-out.dat' usin (\$0):(\$1) w boxes fill patter 2 lt 1 lc rgb "blue" title "um(nommu)" ,\
'${OUTPUT}/out/native-out.dat' usin (\$0+0.2):(\$1) w boxes fill patter 2 lt 1 lc rgb "red" title "native"
set terminal png lw 3 14 crop
set output "${OUTPUT}/out/lmbench.png"
replot
EndGNUPLOT

echo -e "==lmbench (usec)==\n"
echo -e "|select-10\n|select-100\n|select-1000\n|syscall\n|read\n|write\n|stat\n|open/close\n|fork+sh\n|fork+execve" > /tmp/a

echo -e "||native|um|um-nommu| \n|--|--|--|--|"; paste -d "|" `ls ../2024-09-19/out/*.dat |grep -v getpid` | sed "s/\(.*\)/\|\1\|/" | paste /tmp/a - | column -t


echo -e "==do_getpid bench (nsec)==\n"
for f in `ls $OUTPUT/*.dat`
do
export $(basename $f .dat|sed "s/-/_/")=`grep aver $f | awk '{print $2}'`
done
echo -e "||native|um|um-nommu| \n|--|--|--|--|"
echo "|getpid | ${native} | ${um_mmu} | ${um_nommu}|"

0 comments on commit d53d51a

Please sign in to comment.