diff --git a/autobuild.sh b/autobuild.sh index 324911284..d04ee627f 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -17,6 +17,10 @@ timing_enter check_format ./scripts/check_format.sh timing_exit check_format +timing_enter build_kmod +./scripts/build_kmod.sh build +timing_exit build_kmod + scanbuild='' if hash scan-build; then scanbuild="scan-build -o $out/scan-build-tmp --status-bugs" diff --git a/autotest.sh b/autotest.sh index 01f239be0..808f582b3 100755 --- a/autotest.sh +++ b/autotest.sh @@ -53,6 +53,7 @@ time test/lib/ioat/ioat.sh timing_exit lib ./scripts/cleanup.sh +./scripts/build_kmod.sh clean timing_exit autotest chmod a+r $output_dir/timing.txt diff --git a/examples/ioat/kperf/README b/examples/ioat/kperf/README index cf1e3aa12..76f7b76a2 100644 --- a/examples/ioat/kperf/README +++ b/examples/ioat/kperf/README @@ -16,7 +16,7 @@ Building & Usage 1. Compile and load the kernel test module first. modprobe -v ioatdma - cd kmod && make && insmod dmaperf.ko + ./scripts/build_kmod.sh build && insmod dmaperf.ko 2. Run the test application. @@ -37,6 +37,9 @@ Building & Usage Channel 3 Performance Data 1415 MB/s Total Channel Performance Data 5655 MB/s +3. Cleanup + ./scripts/build_kmod.sh clean + OS Support ========== We have tested several Linux distributions, currently Fedora 21/22 with kernel diff --git a/scripts/build_kmod.sh b/scripts/build_kmod.sh new file mode 100755 index 000000000..41f40b42a --- /dev/null +++ b/scripts/build_kmod.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +readonly BASEDIR=$(readlink -f $(dirname $0))/.. + +set -e + +function build_ioat_kmod() { + if [ -d $BASEDIR/examples/ioat/kperf/kmod ]; then + echo "Build Linux Ioat Test Module ..." + cd $BASEDIR/examples/ioat/kperf/kmod + make + fi +} + +function clean_ioat_kmod() { + # remove dmaperf test module + grep -q "^dmaperf" /proc/modules && rmmod dmaperf + # cleanup build + if [ -d $BASEDIR/examples/ioat/kperf/kmod ]; then + echo "Cleanup Linux Ioat Test Module ..." + cd $BASEDIR/examples/ioat/kperf/kmod + make clean + fi +} + +if [ `uname` = Linux ]; then + if [ "$1" = "build" ]; then + build_ioat_kmod + fi + if [ "$1" = "clean" ]; then + clean_ioat_kmod + fi +fi