From faf413d87556b9b76686ef9bf1e797e86e4b5129 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Thu, 10 Nov 2011 11:27:27 -0200 Subject: [PATCH] tests: add a test for checking edid reading delays With base on EDID timing testing, when we take more than 1s to run xrandr command, something is wrong.. So add this test for testing the time we take to read the status of all the connectors from sysfs. It should do us an average picture of how long we'd take to run xrandr (roughtly 2x that value). Signed-off-by: Eugeni Dodonov --- tests/Makefile.am | 1 + tests/sysfs_edid_timing | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 tests/sysfs_edid_timing diff --git a/tests/Makefile.am b/tests/Makefile.am index dffda411..7173afb9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,6 +57,7 @@ TESTS_progs = \ TESTS_scripts = \ debugfs_reader \ debugfs_emon_crash \ + sysfs_edid_timing \ $(NULL) kernel_tests = \ diff --git a/tests/sysfs_edid_timing b/tests/sysfs_edid_timing new file mode 100755 index 00000000..22340cba --- /dev/null +++ b/tests/sysfs_edid_timing @@ -0,0 +1,20 @@ +#!/bin/sh +# +# This check the time we take to read the content of all the possible connectors. +# Without the edid -ENXIO patch (http://permalink.gmane.org/gmane.comp.video.dri.devel/62083), +# we sometimes take a *really* long time. So let's just check for some reasonable timing here +# + +TIME1=$(date +%s%N) +cat $(find /sys/devices/|grep drm | grep /status) > /dev/null +TIME2=$(date +%s%N) + +# time in ms +RES=$[(TIME2 - TIME1) / 1000000] + +if [ $RES -gt 600 ]; then + echo "Talking to outputs took ${RES}ms, something is wrong" + exit 1 +fi + +exit 0