All of lore.kernel.org
 help / color / mirror / Atom feed
* [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
@ 2016-10-13 12:59 Jani Nikula
  2016-10-13 12:59 ` [i-g-t PATCH 2/3] tests: add facility to enable/disable hda dynamic debug " Jani Nikula
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-13 12:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

While at it, make debugfs_path point at the debugfs root, not
dri. This'll be handy in future work.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 tests/drm_lib.sh | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 113da4c7d645..87e3ad0ab547 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -41,18 +41,22 @@ do_or_die() {
 	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
 }
 
-if [ -d /debug/dri ] ; then
-	debugfs_path=/debug/dri
+if [ -d /sys/kernel/debug ]; then
+	debugfs_path=/sys/kernel/debug
+elif [ -d /debug ]; then
+	debugfs_path=/debug
+else
+	skip "debugfs not found"
 fi
 
-if [ -d /sys/kernel/debug/dri ] ; then
-	debugfs_path=/sys/kernel/debug/dri
+if [ ! -d $debugfs_path/dri ]; then
+	skip "dri debugfs not found"
 fi
 
 i915_dfs_path=x
 for minor in `seq 0 16`; do
-	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
-		i915_dfs_path=$debugfs_path/$minor
+	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
+		i915_dfs_path=$debugfs_path/dri/$minor
 		break
 	fi
 done
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [i-g-t PATCH 2/3] tests: add facility to enable/disable hda dynamic debug in script based tests
  2016-10-13 12:59 [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Jani Nikula
@ 2016-10-13 12:59 ` Jani Nikula
  2016-10-13 12:59 ` [i-g-t PATCH 3/3] tests: enable hda dynamic debug for module reload test Jani Nikula
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-13 12:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

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.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 tests/drm_lib.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 87e3ad0ab547..8738827fc218 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$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
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [i-g-t PATCH 3/3] tests: enable hda dynamic debug for module reload test
  2016-10-13 12:59 [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Jani Nikula
  2016-10-13 12:59 ` [i-g-t PATCH 2/3] tests: add facility to enable/disable hda dynamic debug " Jani Nikula
@ 2016-10-13 12:59 ` Jani Nikula
  2016-10-13 13:17 ` [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Chris Wilson
  2016-10-14 10:55 ` Petri Latvala
  3 siblings, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-13 12:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Hopefully, this will provide more clues for figuring out why
snd_hda_intel unload fails sporadically.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 tests/drv_module_reload_basic | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic
index 93cf7c005638..a8d628dd96bd 100755
--- a/tests/drv_module_reload_basic
+++ b/tests/drv_module_reload_basic
@@ -81,6 +81,8 @@ function finish_load() {
 	return $IGT_EXIT_SUCCESS
 }
 
+hda_dynamic_debug_enable
+
 reload || exit $?
 finish_load || exit $?
 
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-13 12:59 [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Jani Nikula
  2016-10-13 12:59 ` [i-g-t PATCH 2/3] tests: add facility to enable/disable hda dynamic debug " Jani Nikula
  2016-10-13 12:59 ` [i-g-t PATCH 3/3] tests: enable hda dynamic debug for module reload test Jani Nikula
@ 2016-10-13 13:17 ` Chris Wilson
  2016-10-13 13:55   ` Jani Nikula
  2016-10-14 10:55 ` Petri Latvala
  3 siblings, 1 reply; 13+ messages in thread
From: Chris Wilson @ 2016-10-13 13:17 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
> While at it, make debugfs_path point at the debugfs root, not
> dri. This'll be handy in future work.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  tests/drm_lib.sh | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
> index 113da4c7d645..87e3ad0ab547 100755
> --- a/tests/drm_lib.sh
> +++ b/tests/drm_lib.sh
> @@ -41,18 +41,22 @@ do_or_die() {
>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
>  }
>  
> -if [ -d /debug/dri ] ; then
> -	debugfs_path=/debug/dri
> +if [ -d /sys/kernel/debug ]; then
> +	debugfs_path=/sys/kernel/debug
> +elif [ -d /debug ]; then
> +	debugfs_path=/debug
> +else
> +	skip "debugfs not found"
>  fi
>  
> -if [ -d /sys/kernel/debug/dri ] ; then
> -	debugfs_path=/sys/kernel/debug/dri
> +if [ ! -d $debugfs_path/dri ]; then
> +	skip "dri debugfs not found"
>  fi
>  
>  i915_dfs_path=x
>  for minor in `seq 0 16`; do
> -	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
> -		i915_dfs_path=$debugfs_path/$minor
> +	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
> +		i915_dfs_path=$debugfs_path/dri/$minor

Thinking of how to wean ourselves off i915_error_state; how about

	if [ grep -s i915 $debugfs_path/dri/$minor/name ]; then

?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-13 13:17 ` [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Chris Wilson
@ 2016-10-13 13:55   ` Jani Nikula
  2016-10-13 14:02     ` Chris Wilson
  2016-10-13 14:05     ` Chris Wilson
  0 siblings, 2 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-13 13:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Thu, 13 Oct 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
>> While at it, make debugfs_path point at the debugfs root, not
>> dri. This'll be handy in future work.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  tests/drm_lib.sh | 16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>> 
>> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
>> index 113da4c7d645..87e3ad0ab547 100755
>> --- a/tests/drm_lib.sh
>> +++ b/tests/drm_lib.sh
>> @@ -41,18 +41,22 @@ do_or_die() {
>>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
>>  }
>>  
>> -if [ -d /debug/dri ] ; then
>> -	debugfs_path=/debug/dri
>> +if [ -d /sys/kernel/debug ]; then
>> +	debugfs_path=/sys/kernel/debug
>> +elif [ -d /debug ]; then
>> +	debugfs_path=/debug
>> +else
>> +	skip "debugfs not found"
>>  fi
>>  
>> -if [ -d /sys/kernel/debug/dri ] ; then
>> -	debugfs_path=/sys/kernel/debug/dri
>> +if [ ! -d $debugfs_path/dri ]; then
>> +	skip "dri debugfs not found"
>>  fi
>>  
>>  i915_dfs_path=x
>>  for minor in `seq 0 16`; do
>> -	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
>> -		i915_dfs_path=$debugfs_path/$minor
>> +	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
>> +		i915_dfs_path=$debugfs_path/dri/$minor
>
> Thinking of how to wean ourselves off i915_error_state; how about

That's of course independent of this series.

> 	if [ grep -s i915 $debugfs_path/dri/$minor/name ]; then

For whatever reason, I got a machine here where that file is empty (not
talking about the size, but cating the file actually produces
nothing). And I've got another machine where that is not the
case. *scratches head*.

BR,
Jani.


>
> ?
> -Chris

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-13 13:55   ` Jani Nikula
@ 2016-10-13 14:02     ` Chris Wilson
  2016-10-13 14:05     ` Chris Wilson
  1 sibling, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2016-10-13 14:02 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Oct 13, 2016 at 04:55:49PM +0300, Jani Nikula wrote:
> On Thu, 13 Oct 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >> +	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
> >> +		i915_dfs_path=$debugfs_path/dri/$minor
> >
> > Thinking of how to wean ourselves off i915_error_state; how about
> 
> That's of course independent of this series.
> 
> > 	if [ grep -s i915 $debugfs_path/dri/$minor/name ]; then
> 
> For whatever reason, I got a machine here where that file is empty (not
> talking about the size, but cating the file actually produces
> nothing). And I've got another machine where that is not the
> case. *scratches head*.

Is the first i915.ko builtin?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-13 13:55   ` Jani Nikula
  2016-10-13 14:02     ` Chris Wilson
@ 2016-10-13 14:05     ` Chris Wilson
  2016-10-14 10:24       ` Jani Nikula
  1 sibling, 1 reply; 13+ messages in thread
From: Chris Wilson @ 2016-10-13 14:05 UTC (permalink / raw)
  To: Jani Nikula; +Cc: daniel.vetter, intel-gfx

On Thu, Oct 13, 2016 at 04:55:49PM +0300, Jani Nikula wrote:
> For whatever reason, I got a machine here where that file is empty (not
> talking about the size, but cating the file actually produces
> nothing). And I've got another machine where that is not the
> case. *scratches head*.

Appears to be Daniel's regression:

commit 95c081c17f284de50eaca60d4d55643a64d39019
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Jun 21 10:54:12 2016 +0200

    drm: Move master pointer from drm_minor to drm_device


Too bad my name's on it as well. :|
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-13 14:05     ` Chris Wilson
@ 2016-10-14 10:24       ` Jani Nikula
  0 siblings, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-14 10:24 UTC (permalink / raw)
  To: Chris Wilson; +Cc: daniel.vetter, intel-gfx

On Thu, 13 Oct 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Oct 13, 2016 at 04:55:49PM +0300, Jani Nikula wrote:
>> For whatever reason, I got a machine here where that file is empty (not
>> talking about the size, but cating the file actually produces
>> nothing). And I've got another machine where that is not the
>> case. *scratches head*.
>
> Appears to be Daniel's regression:
>
> commit 95c081c17f284de50eaca60d4d55643a64d39019
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Tue Jun 21 10:54:12 2016 +0200
>
>     drm: Move master pointer from drm_minor to drm_device

Ah, I guess I was just running an old kernel on the machine where it
still worked.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-13 12:59 [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Jani Nikula
                   ` (2 preceding siblings ...)
  2016-10-13 13:17 ` [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Chris Wilson
@ 2016-10-14 10:55 ` Petri Latvala
  2016-10-14 11:50   ` Jani Nikula
  3 siblings, 1 reply; 13+ messages in thread
From: Petri Latvala @ 2016-10-14 10:55 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
> While at it, make debugfs_path point at the debugfs root, not
> dri. This'll be handy in future work.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  tests/drm_lib.sh | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
> index 113da4c7d645..87e3ad0ab547 100755
> --- a/tests/drm_lib.sh
> +++ b/tests/drm_lib.sh
> @@ -41,18 +41,22 @@ do_or_die() {
>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
>  }
>  
> -if [ -d /debug/dri ] ; then
> -	debugfs_path=/debug/dri
> +if [ -d /sys/kernel/debug ]; then
> +	debugfs_path=/sys/kernel/debug
> +elif [ -d /debug ]; then
> +	debugfs_path=/debug
> +else
> +	skip "debugfs not found"
>  fi

Would parsing the output of  `mount -t debugfs`  be an option?


--
Petri Latvala



>  
> -if [ -d /sys/kernel/debug/dri ] ; then
> -	debugfs_path=/sys/kernel/debug/dri
> +if [ ! -d $debugfs_path/dri ]; then
> +	skip "dri debugfs not found"
>  fi
>  
>  i915_dfs_path=x
>  for minor in `seq 0 16`; do
> -	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
> -		i915_dfs_path=$debugfs_path/$minor
> +	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
> +		i915_dfs_path=$debugfs_path/dri/$minor
>  		break
>  	fi
>  done
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-14 10:55 ` Petri Latvala
@ 2016-10-14 11:50   ` Jani Nikula
  2016-10-14 12:01     ` Jani Nikula
  2016-10-14 12:22     ` Petri Latvala
  0 siblings, 2 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-14 11:50 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

On Fri, 14 Oct 2016, Petri Latvala <petri.latvala@intel.com> wrote:
> On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
>> While at it, make debugfs_path point at the debugfs root, not
>> dri. This'll be handy in future work.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  tests/drm_lib.sh | 16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>> 
>> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
>> index 113da4c7d645..87e3ad0ab547 100755
>> --- a/tests/drm_lib.sh
>> +++ b/tests/drm_lib.sh
>> @@ -41,18 +41,22 @@ do_or_die() {
>>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
>>  }
>>  
>> -if [ -d /debug/dri ] ; then
>> -	debugfs_path=/debug/dri
>> +if [ -d /sys/kernel/debug ]; then
>> +	debugfs_path=/sys/kernel/debug
>> +elif [ -d /debug ]; then
>> +	debugfs_path=/debug
>> +else
>> +	skip "debugfs not found"
>>  fi
>
> Would parsing the output of  `mount -t debugfs`  be an option?

I contemplated that, but decided that should be a separate change later
on. I can send a patch on top if you like.

BR,
Jani.

>
>
> --
> Petri Latvala
>
>
>
>>  
>> -if [ -d /sys/kernel/debug/dri ] ; then
>> -	debugfs_path=/sys/kernel/debug/dri
>> +if [ ! -d $debugfs_path/dri ]; then
>> +	skip "dri debugfs not found"
>>  fi
>>  
>>  i915_dfs_path=x
>>  for minor in `seq 0 16`; do
>> -	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
>> -		i915_dfs_path=$debugfs_path/$minor
>> +	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
>> +		i915_dfs_path=$debugfs_path/dri/$minor
>>  		break
>>  	fi
>>  done
>> -- 
>> 2.1.4
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-14 11:50   ` Jani Nikula
@ 2016-10-14 12:01     ` Jani Nikula
  2016-10-14 12:22     ` Petri Latvala
  1 sibling, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-14 12:01 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

On Fri, 14 Oct 2016, Jani Nikula <jani.nikula@intel.com> wrote:
> On Fri, 14 Oct 2016, Petri Latvala <petri.latvala@intel.com> wrote:
>> On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
>>> While at it, make debugfs_path point at the debugfs root, not
>>> dri. This'll be handy in future work.
>>> 
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>> ---
>>>  tests/drm_lib.sh | 16 ++++++++++------
>>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>> 
>>> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
>>> index 113da4c7d645..87e3ad0ab547 100755
>>> --- a/tests/drm_lib.sh
>>> +++ b/tests/drm_lib.sh
>>> @@ -41,18 +41,22 @@ do_or_die() {
>>>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
>>>  }
>>>  
>>> -if [ -d /debug/dri ] ; then
>>> -	debugfs_path=/debug/dri
>>> +if [ -d /sys/kernel/debug ]; then
>>> +	debugfs_path=/sys/kernel/debug
>>> +elif [ -d /debug ]; then
>>> +	debugfs_path=/debug
>>> +else
>>> +	skip "debugfs not found"
>>>  fi
>>
>> Would parsing the output of  `mount -t debugfs`  be an option?
>
> I contemplated that, but decided that should be a separate change later
> on. I can send a patch on top if you like.

Something like this (untested):

diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index af104ad791b7..6db604e22abf 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -58,11 +58,15 @@ do_or_die() {
 	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
 }
 
-if [ -d /sys/kernel/debug ]; then
-	debugfs_path=/sys/kernel/debug
-elif [ -d /debug ]; then
-	debugfs_path=/debug
-else
+debugfs_path=
+for path in $(mount -t debugfs | cut -d " " -f 3) /sys/kernel/debug /debug; do
+	if [ -d "$path" -a -d "$path/dri" ]; then
+		debugfs_path=$path
+		break
+	fi
+done
+
+if [ -z "$debugfs_path" ]; then
 	skip "debugfs not found"
 fi
 
@@ -71,10 +75,6 @@ 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
-
 i915_dfs_path=x
 for minor in `seq 0 16`; do
 	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then



-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-14 11:50   ` Jani Nikula
  2016-10-14 12:01     ` Jani Nikula
@ 2016-10-14 12:22     ` Petri Latvala
  2016-10-14 13:07       ` Jani Nikula
  1 sibling, 1 reply; 13+ messages in thread
From: Petri Latvala @ 2016-10-14 12:22 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Fri, Oct 14, 2016 at 02:50:49PM +0300, Jani Nikula wrote:
> On Fri, 14 Oct 2016, Petri Latvala <petri.latvala@intel.com> wrote:
> > On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
> >> While at it, make debugfs_path point at the debugfs root, not
> >> dri. This'll be handy in future work.
> >> 
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> ---
> >>  tests/drm_lib.sh | 16 ++++++++++------
> >>  1 file changed, 10 insertions(+), 6 deletions(-)
> >> 
> >> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
> >> index 113da4c7d645..87e3ad0ab547 100755
> >> --- a/tests/drm_lib.sh
> >> +++ b/tests/drm_lib.sh
> >> @@ -41,18 +41,22 @@ do_or_die() {
> >>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
> >>  }
> >>  
> >> -if [ -d /debug/dri ] ; then
> >> -	debugfs_path=/debug/dri
> >> +if [ -d /sys/kernel/debug ]; then
> >> +	debugfs_path=/sys/kernel/debug
> >> +elif [ -d /debug ]; then
> >> +	debugfs_path=/debug
> >> +else
> >> +	skip "debugfs not found"
> >>  fi
> >
> > Would parsing the output of  `mount -t debugfs`  be an option?
> 
> I contemplated that, but decided that should be a separate change later
> on. I can send a patch on top if you like.


Yes, separate patch, but no hurry on that one. Another patch for
making the same change in tools/intel_gpu_abrt would also be nice.


The series is

Reviewed-by: Petri Latvala <petri.latvala@intel.com>








> 
> BR,
> Jani.
> 
> >
> >
> > --
> > Petri Latvala
> >
> >
> >
> >>  
> >> -if [ -d /sys/kernel/debug/dri ] ; then
> >> -	debugfs_path=/sys/kernel/debug/dri
> >> +if [ ! -d $debugfs_path/dri ]; then
> >> +	skip "dri debugfs not found"
> >>  fi
> >>  
> >>  i915_dfs_path=x
> >>  for minor in `seq 0 16`; do
> >> -	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
> >> -		i915_dfs_path=$debugfs_path/$minor
> >> +	if [ -f $debugfs_path/dri/$minor/i915_error_state ] ; then
> >> +		i915_dfs_path=$debugfs_path/dri/$minor
> >>  		break
> >>  	fi
> >>  done
> >> -- 
> >> 2.1.4
> >> 
> >> _______________________________________________
> >> Intel-gfx mailing list
> >> Intel-gfx@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests
  2016-10-14 12:22     ` Petri Latvala
@ 2016-10-14 13:07       ` Jani Nikula
  0 siblings, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2016-10-14 13:07 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

On Fri, 14 Oct 2016, Petri Latvala <petri.latvala@intel.com> wrote:
> On Fri, Oct 14, 2016 at 02:50:49PM +0300, Jani Nikula wrote:
>> On Fri, 14 Oct 2016, Petri Latvala <petri.latvala@intel.com> wrote:
>> > On Thu, Oct 13, 2016 at 03:59:55PM +0300, Jani Nikula wrote:
>> >> While at it, make debugfs_path point at the debugfs root, not
>> >> dri. This'll be handy in future work.
>> >> 
>> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> >> ---
>> >>  tests/drm_lib.sh | 16 ++++++++++------
>> >>  1 file changed, 10 insertions(+), 6 deletions(-)
>> >> 
>> >> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
>> >> index 113da4c7d645..87e3ad0ab547 100755
>> >> --- a/tests/drm_lib.sh
>> >> +++ b/tests/drm_lib.sh
>> >> @@ -41,18 +41,22 @@ do_or_die() {
>> >>  	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE)
>> >>  }
>> >>  
>> >> -if [ -d /debug/dri ] ; then
>> >> -	debugfs_path=/debug/dri
>> >> +if [ -d /sys/kernel/debug ]; then
>> >> +	debugfs_path=/sys/kernel/debug
>> >> +elif [ -d /debug ]; then
>> >> +	debugfs_path=/debug
>> >> +else
>> >> +	skip "debugfs not found"
>> >>  fi
>> >
>> > Would parsing the output of  `mount -t debugfs`  be an option?
>> 
>> I contemplated that, but decided that should be a separate change later
>> on. I can send a patch on top if you like.
>
>
> Yes, separate patch, but no hurry on that one. Another patch for
> making the same change in tools/intel_gpu_abrt would also be nice.
>
>
> The series is
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>

Thanks, pushed.

BR,
Jani.

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-10-14 13:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-13 12:59 [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Jani Nikula
2016-10-13 12:59 ` [i-g-t PATCH 2/3] tests: add facility to enable/disable hda dynamic debug " Jani Nikula
2016-10-13 12:59 ` [i-g-t PATCH 3/3] tests: enable hda dynamic debug for module reload test Jani Nikula
2016-10-13 13:17 ` [i-g-t PATCH 1/3] tests: add more checks for finding the debugfs in script based tests Chris Wilson
2016-10-13 13:55   ` Jani Nikula
2016-10-13 14:02     ` Chris Wilson
2016-10-13 14:05     ` Chris Wilson
2016-10-14 10:24       ` Jani Nikula
2016-10-14 10:55 ` Petri Latvala
2016-10-14 11:50   ` Jani Nikula
2016-10-14 12:01     ` Jani Nikula
2016-10-14 12:22     ` Petri Latvala
2016-10-14 13:07       ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.