Have the tester 'run' scripts take # of runs as param

This commit is contained in:
Kaiwan N Billimoria
2023-11-16 14:12:18 +05:30
parent fb9b235e04
commit ae039e1408
2 changed files with 16 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
#!/bin/bash
# Test script for the ch13/3_list_demo_rdwrlock work
# Test script
name=$(basename $0)
KMOD=miscdrv_rdwr_nolocks
DEV=/dev/lkp_miscdrv_nolocks
@@ -23,6 +24,12 @@ writer()
#--- 'main'
[[ $# -ne 1 ]] && {
echo "Usage: ${name} number-of-readers-to-concurrently-run"
exit
}
MAX=$1
sudo rmmod ${KMOD} 2>/dev/null
lsmod |grep ${KMOD} >/dev/null || {
[[ ! -f ${KMOD}.ko ]] && die "Build the module first"
@@ -33,7 +40,6 @@ lsmod |grep ${KMOD} >/dev/null || {
# The I/O
sudo dmesg -C
MAX=1000
for i in $(seq 1 ${MAX})
do
reader &

View File

@@ -1,5 +1,6 @@
#!/bin/bash
# Test script for the ch13/3_list_demo_rdwrlock work
# Test script
name=$(basename $0)
KMOD=miscdrv_rdwr_rwlock
DEV=/dev/lkp_miscdrv_rdwr_rwlock
@@ -23,6 +24,12 @@ writer()
#--- 'main'
[[ $# -ne 1 ]] && {
echo "Usage: ${name} number-of-readers-to-concurrently-run"
exit
}
MAX=$1
sudo rmmod ${KMOD} 2>/dev/null
lsmod |grep ${KMOD} >/dev/null || {
[[ ! -f ${KMOD}.ko ]] && die "Build the module first"
@@ -33,7 +40,6 @@ lsmod |grep ${KMOD} >/dev/null || {
# The I/O
sudo dmesg -C
MAX=10
for i in $(seq 1 ${MAX})
do
reader &