* [PATCH i-g-t] tests/drv_module_reload_basic: Leave basic breadcrumbs in dmesg
@ 2016-10-06 12:08 ville.syrjala
2016-10-06 12:17 ` Jani Nikula
0 siblings, 1 reply; 4+ messages in thread
From: ville.syrjala @ 2016-10-06 12:08 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
running the test.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/drv_module_reload_basic | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic
index 93cf7c005638..4c75f0e9614a 100755
--- a/tests/drv_module_reload_basic
+++ b/tests/drv_module_reload_basic
@@ -6,6 +6,33 @@
#
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+
+NAME=$(basename "$0")
+
+KERN_EMER="<0>"
+KERN_ALERT="<1>"
+KERN_CRIT="<2>"
+KERN_ERR="<3>"
+KERN_WARNING="<4>"
+KERN_NOTICE="<5>"
+KERN_INFO="<6>"
+KERN_DEBUG="<7>"
+
+function kmsg()
+{
+ echo "$1" > /dev/kmsg
+}
+
+function finish()
+{
+ exitcode=$?
+ kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
+ exit $exitcode
+}
+trap finish EXIT
+
+kmsg "$KERN_INFO$NAME: executing"
+
. $SOURCE_DIR/drm_lib.sh
# no other drm service should be running, so we can just unbind
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH i-g-t] tests/drv_module_reload_basic: Leave basic breadcrumbs in dmesg
2016-10-06 12:08 [PATCH i-g-t] tests/drv_module_reload_basic: Leave basic breadcrumbs in dmesg ville.syrjala
@ 2016-10-06 12:17 ` Jani Nikula
2016-10-06 12:37 ` Ville Syrjälä
0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2016-10-06 12:17 UTC (permalink / raw)
To: ville.syrjala, intel-gfx
On Thu, 06 Oct 2016, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
> running the test.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> tests/drv_module_reload_basic | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic
> index 93cf7c005638..4c75f0e9614a 100755
> --- a/tests/drv_module_reload_basic
> +++ b/tests/drv_module_reload_basic
> @@ -6,6 +6,33 @@
> #
>
> SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
> +
> +NAME=$(basename "$0")
> +
> +KERN_EMER="<0>"
> +KERN_ALERT="<1>"
> +KERN_CRIT="<2>"
> +KERN_ERR="<3>"
> +KERN_WARNING="<4>"
> +KERN_NOTICE="<5>"
> +KERN_INFO="<6>"
> +KERN_DEBUG="<7>"
> +
> +function kmsg()
> +{
> + echo "$1" > /dev/kmsg
> +}
> +
Seems like these would belong in drm_lib.sh. Or do you really need to do
the kmsg *before* sourcing drm_lib.sh?
BR,
Jani.
> +function finish()
> +{
> + exitcode=$?
> + kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
> + exit $exitcode
> +}
> +trap finish EXIT
> +
> +kmsg "$KERN_INFO$NAME: executing"
> +
> . $SOURCE_DIR/drm_lib.sh
>
> # no other drm service should be running, so we can just unbind
--
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] 4+ messages in thread
* Re: [PATCH i-g-t] tests/drv_module_reload_basic: Leave basic breadcrumbs in dmesg
2016-10-06 12:17 ` Jani Nikula
@ 2016-10-06 12:37 ` Ville Syrjälä
2016-10-06 13:37 ` Ville Syrjälä
0 siblings, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2016-10-06 12:37 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Thu, Oct 06, 2016 at 03:17:45PM +0300, Jani Nikula wrote:
> On Thu, 06 Oct 2016, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
> > running the test.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > tests/drv_module_reload_basic | 27 +++++++++++++++++++++++++++
> > 1 file changed, 27 insertions(+)
> >
> > diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic
> > index 93cf7c005638..4c75f0e9614a 100755
> > --- a/tests/drv_module_reload_basic
> > +++ b/tests/drv_module_reload_basic
> > @@ -6,6 +6,33 @@
> > #
> >
> > SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
> > +
> > +NAME=$(basename "$0")
> > +
> > +KERN_EMER="<0>"
> > +KERN_ALERT="<1>"
> > +KERN_CRIT="<2>"
> > +KERN_ERR="<3>"
> > +KERN_WARNING="<4>"
> > +KERN_NOTICE="<5>"
> > +KERN_INFO="<6>"
> > +KERN_DEBUG="<7>"
> > +
> > +function kmsg()
> > +{
> > + echo "$1" > /dev/kmsg
> > +}
> > +
>
> Seems like these would belong in drm_lib.sh. Or do you really need to do
> the kmsg *before* sourcing drm_lib.sh?
drm_lib.sh can itself exit, so the trap needs to be done before sourcing
it. And drm_lib.sh isn't a bash script, so I didn't dare to put it
there.
>
> BR,
> Jani.
>
> > +function finish()
> > +{
> > + exitcode=$?
> > + kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
> > + exit $exitcode
> > +}
> > +trap finish EXIT
> > +
> > +kmsg "$KERN_INFO$NAME: executing"
> > +
> > . $SOURCE_DIR/drm_lib.sh
> >
> > # no other drm service should be running, so we can just unbind
>
> --
> Jani Nikula, Intel Open Source Technology Center
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH i-g-t] tests/drv_module_reload_basic: Leave basic breadcrumbs in dmesg
2016-10-06 12:37 ` Ville Syrjälä
@ 2016-10-06 13:37 ` Ville Syrjälä
0 siblings, 0 replies; 4+ messages in thread
From: Ville Syrjälä @ 2016-10-06 13:37 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Thu, Oct 06, 2016 at 03:37:50PM +0300, Ville Syrjälä wrote:
> On Thu, Oct 06, 2016 at 03:17:45PM +0300, Jani Nikula wrote:
> > On Thu, 06 Oct 2016, ville.syrjala@linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
> > > running the test.
> > >
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > > tests/drv_module_reload_basic | 27 +++++++++++++++++++++++++++
> > > 1 file changed, 27 insertions(+)
> > >
> > > diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic
> > > index 93cf7c005638..4c75f0e9614a 100755
> > > --- a/tests/drv_module_reload_basic
> > > +++ b/tests/drv_module_reload_basic
> > > @@ -6,6 +6,33 @@
> > > #
> > >
> > > SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
> > > +
> > > +NAME=$(basename "$0")
> > > +
> > > +KERN_EMER="<0>"
> > > +KERN_ALERT="<1>"
> > > +KERN_CRIT="<2>"
> > > +KERN_ERR="<3>"
> > > +KERN_WARNING="<4>"
> > > +KERN_NOTICE="<5>"
> > > +KERN_INFO="<6>"
> > > +KERN_DEBUG="<7>"
> > > +
> > > +function kmsg()
> > > +{
> > > + echo "$1" > /dev/kmsg
> > > +}
> > > +
> >
> > Seems like these would belong in drm_lib.sh. Or do you really need to do
> > the kmsg *before* sourcing drm_lib.sh?
>
> drm_lib.sh can itself exit, so the trap needs to be done before sourcing
> it. And drm_lib.sh isn't a bash script, so I didn't dare to put it
> there.
Actuall it's a bash script, and I guess trap isn't even a bashism. Not
sure why I have that idea. Anyway, new series posted with all the magic
happening in drm_lib.sh \o/
>
> >
> > BR,
> > Jani.
> >
> > > +function finish()
> > > +{
> > > + exitcode=$?
> > > + kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
> > > + exit $exitcode
> > > +}
> > > +trap finish EXIT
> > > +
> > > +kmsg "$KERN_INFO$NAME: executing"
> > > +
> > > . $SOURCE_DIR/drm_lib.sh
> > >
> > > # no other drm service should be running, so we can just unbind
> >
> > --
> > Jani Nikula, Intel Open Source Technology Center
>
> --
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-06 13:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-06 12:08 [PATCH i-g-t] tests/drv_module_reload_basic: Leave basic breadcrumbs in dmesg ville.syrjala
2016-10-06 12:17 ` Jani Nikula
2016-10-06 12:37 ` Ville Syrjälä
2016-10-06 13:37 ` Ville Syrjälä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox