Commit 51892906 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld

lateset concurrency test

parent faca52b7
......@@ -4,28 +4,36 @@
DEV=mdev
BIS=3
ENT_NUM=50
function plug_unplug {
k=0
while :
#for k in `seq 1 1000000`
do
echo "K is $k"
echo 1 > /configfs/vimc/$DEV/hotplug
sleep 2
sleep $((RANDOM % 5))
echo 0 > /configfs/vimc/$DEV/hotplug
sleep 1
sleep $((RANDOM % 2))
echo 1 > /configfs/vimc/$DEV/hotplug
k=$(($k + 1))
done
}
#one script creates new entities
function create_entities {
while :
for k in `seq 1 ${BIS}`
do
for i in {0..99}
for i in `seq 1 ${ENT_NUM}`
do
mkdir -p /configfs/vimc/$DEV/vimc-sensor:sen$i
mkdir -p /configfs/vimc/$DEV/vimc-debayer:deb$i
mkdir -p /configfs/vimc/$DEV/vimc-scaler:sca$i
mkdir -p /configfs/vimc/$DEV/vimc-capture:cap$i
done
sleep 1
#sleep 1
done
}
......@@ -44,36 +52,43 @@ function link {
#3 - one script links between entities
function create_links {
while :
#for k in `seq 1 ${BIS}`
for k in `seq 1 30`
do
i=$((RANDOM % 100))
j=$((RANDOM % 100))
k=$((RANDOM % 100))
a=$((RANDOM % 100))
b=$((RANDOM % 100))
c=$((RANDOM % 100))
d=$((RANDOM % 100))
e=$((RANDOM % 100))
i=$((RANDOM % 10))
j=$((RANDOM % 10))
l=$((RANDOM % 10))
a=$((RANDOM % 10))
b=$((RANDOM % 10))
c=$((RANDOM % 10))
d=$((RANDOM % 10))
e=$((RANDOM % 10))
link sen$i vimc-sensor 0 deb$j vimc-debayer 0 on
link deb$k vimc-debayer 1 sca$c vimc-scaler 0 on
link sen$i vimc-sensor 0 cap$j vimc-capture 0 on
link deb$l vimc-debayer 1 sca$c vimc-scaler 0 on
link sca$a vimc-scaler 1 cap$b vimc-capture 0 on
link sca$d vimc-scaler 1 sca$e vimc-scaler 0 on
sleep 2
#sleep 2
done
for k in `seq 11 50`
do
link sen$k vimc-sensor 0 cap$k vimc-capture 0 on
done
}
#4 - one script delets links
function delete_links {
while :
for k in `seq 1 ${BIS}`
do
find /configfs -type l -delete;
sleep 3
sleep 4
done
}
#one script delet entities
function delete_entities {
while :
for k in `seq 1 ${BIS}`
do
find /configfs -type d -name "vimc-sensor*" -delete
sleep 1
......@@ -106,18 +121,26 @@ function configure_all_formats {
#one script configure the device and streams it
function stream {
while :
#for k in `seq 1 10000`
do
for i in {0..99}
for i in `seq 1 ${ENT_NUM}`
do
for j in {0..9}
for j in {0..0}
do
media-ctl -d platform:vimc-00$j -V "\"sen$i\":0[fmt:SBGGR8_1X8/640x480]"
media-ctl -d platform:vimc-00$j -V "\"deb$i\":0[fmt:SBGGR8_1X8/640x480]"
media-ctl -d platform:vimc-00$j -V "\"sca$i\":0[fmt:RGB888_1X24/640x480]"
v4l2-ctl -z platform:vimc-00$j -d "cap$i" -v pixelformat=RGB3
v4l2-ctl -z platform:vimc-00$j -d "cap$i" --stream-mmap --stream-count=10
if [ -c "/dev/media0" ]; then
media-ctl -d platform:vimc-00$j -V "\"sen$i\":0[fmt:SBGGR8_1X8/640x480]"
media-ctl -d platform:vimc-00$j -V "\"deb$i\":0[fmt:SBGGR8_1X8/640x480]"
media-ctl -d platform:vimc-00$j -V "\"sca$i\":0[fmt:RGB888_1X24/640x480]"
# v4l2-ctl -z platform:vimc-00$j -d "cap$i" -v pixelformat=RGB3
echo "steaming $i"
v4l2-ctl -z platform:vimc-00$j -d "cap$i" -v pixelformat=BA81
v4l2-ctl -z platform:vimc-00$j -d "cap$i" --stream-mmap --stream-count=10
else
echo "no media"
fi
done
done
sleep $((RANDOM % 2))
done
}
......@@ -127,15 +150,15 @@ mount -t configfs none /configfs
echo 15 > /proc/sys/kernel/printk
#echo "file drivers/media/platform/vimc/* +p" > /sys/kernel/debug/dynamic_debug/control
#echo "file drivers/media/platform/vimc/vimc-core.c +p" > /sys/kernel/debug/dynamic_debug/control
#echo "file drivers/media/platform/vimc/vimc-debayer.c +p" > /sys/kernel/debug/dynamic_debug/control
echo "file drivers/media/platform/vimc/vimc-debayer.c +p" > /sys/kernel/debug/dynamic_debug/control
#echo "file drivers/media/platform/vimc/vimc-configfs.c +p" > /sys/kernel/debug/dynamic_debug/control
#echo 1 > /sys/module/devres/parameters/log
#echo "file drivers/base/core.c +p" > /sys/kernel/debug/dynamic_debug/control
#echo "file drivers/base/dd.c +p" > /sys/kernel/debug/dynamic_debug/control
mkdir /configfs/vimc/$DEV
plug_unplug &
create_entities &
#for i in {0..99}
#plug_unplug &
#create_entities &
#for i in {1..50}
#do
# mkdir -p /configfs/vimc/$DEV/vimc-sensor:sen$i
# mkdir -p /configfs/vimc/$DEV/vimc-debayer:deb$i
......@@ -144,14 +167,53 @@ create_entities &
#done
#while :
#do
#echo 0 > /configfs/vimc/$DEV/hotplug
#echo 1 > /configfs/vimc/$DEV/hotplug
echo 0 > /configfs/vimc/$DEV/hotplug
echo 1 > /configfs/vimc/$DEV/hotplug
#done
#link &
create_links &
exit
delete_links &
delete_entities &
#while :
#for i in {1..100}
#do
# echo $i
# i=$((RANDOM % ${ENT_NUM}))
# j=$((RANDOM % ${ENT_NUM}))
# k=$((RANDOM % ${ENT_NUM}))
# a=$((RANDOM % ${ENT_NUM}))
# b=$((RANDOM % ${ENT_NUM}))
# c=$((RANDOM % ${ENT_NUM}))
# d=$((RANDOM % ${ENT_NUM}))
# e=$((RANDOM % ${ENT_NUM}))
# link sen$i vimc-sensor 0 deb$j vimc-debayer 0 on
# link deb$k vimc-debayer 1 sca$c vimc-scaler 0 on
# link sca$a vimc-scaler 1 cap$b vimc-capture 0 on
# if [ $d == $e ]; then
# echo "$d == $e"
# else
# link sca$d vimc-scaler 1 sca$e vimc-scaler 0 on
# fi
# #sleep 2
#done
plug_unplug &
create_entities
create_links
create_links
create_links
#delete_links &
#delete_entities &
#create_entities &
stream &
stream &
#echo 1 > /configfs/vimc/$DEV/hotplug
#sleep 2
#media-ctl -d0 --print-dot | dot -Tps -o vmpath/conc.ps
#sleep 3
#echo 0 > /configfs/vimc/$DEV/hotplug
#create_links &
#exit
#delete_links &
#delete_entities &
#stream &
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment