summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2016-10-13 12:31:47 +0300
committerJani Nikula <jani.nikula@intel.com>2016-10-14 16:07:02 +0300
commitdaeb7f45257c4eea91a94b5eb34810441660c42c (patch)
treeccae96addc46d9c405b2ede465e29e9e226867b4 /tests
parent790b896898aeacc7c8325ca386599867af6e8fdc (diff)
tests: add facility to enable/disable hda dynamic debug in script based tests
Test scripts can call hda_dynamic_debug_enable and hda_dynamic_debug_disable to enable/disable snd_hda_intel and snd_hda_core debug messages. The dynamic debug will be disabled automatically at test end by the exit handler. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/drm_lib.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index df8ed7e7..af104ad7 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -5,6 +5,22 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
NAME=$(basename "$0")
+dynamic_debug=
+
+hda_dynamic_debug_enable() {
+ if [ -e "$dynamic_debug" ]; then
+ echo -n "module snd_hda_intel +pf" > $dynamic_debug
+ echo -n "module snd_hda_core +pf" > $dynamic_debug
+ fi
+}
+
+hda_dynamic_debug_disable() {
+ if [ -e "$dynamic_debug" ]; then
+ echo -n "module snd_hda_core =_" > $dynamic_debug
+ echo -n "module snd_hda_intel =_" > $dynamic_debug
+ fi
+}
+
KERN_EMER="<0>"
KERN_ALERT="<1>"
KERN_CRIT="<2>"
@@ -20,6 +36,7 @@ kmsg() {
finish() {
exitcode=$?
+ hda_dynamic_debug_disable
kmsg "${KERN_INFO}[IGT] $NAME: exiting, ret=$exitcode"
exit $exitcode
}
@@ -49,6 +66,11 @@ else
skip "debugfs not found"
fi
+dynamic_debug=$debugfs_path/dynamic_debug/control
+if [ ! -e "$dynamic_debug" ]; then
+ echo "WARNING: dynamic debug control not available"
+fi
+
if [ ! -d $debugfs_path/dri ]; then
skip "dri debugfs not found"
fi