mirror of
https://github.com/ebrandi/FDD-book.git
synced 2026-12-06 00:23:30 +00:00
Organize companion code and materials by book part: part-01/ Foundations part-02/ Kernel & driver fundamentals part-03/ Character & block devices part-04/ Networking & storage part-05/ Buses & advanced topics part-06/ Debugging & performance part-07/ Real-world drivers appendices/ Supplementary material README.md Overview and build instructions
24 lines
557 B
Bash
Executable file
24 lines
557 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# run-workload.sh - run a simple read workload against /dev/perfdemo.
|
|
#
|
|
# Usage: ./run-workload.sh [count]
|
|
#
|
|
# Default count is 10000 blocks of 4096 bytes (40 MB total).
|
|
|
|
COUNT=${1:-10000}
|
|
DEV=${DEV:-/dev/perfdemo}
|
|
BS=${BS:-4096}
|
|
|
|
if [ ! -c "$DEV" ]; then
|
|
echo "Error: $DEV does not exist. Load the driver first:"
|
|
echo " sudo kldload ./perfdemo.ko"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Reading $COUNT blocks of $BS bytes from $DEV..."
|
|
time dd if=$DEV of=/dev/null bs=$BS count=$COUNT 2>&1
|
|
|
|
echo
|
|
echo "Counter values after workload:"
|
|
sysctl hw.perfdemo
|