Re: [Intel-gfx] [PATCH i-g-t 2/5] tests: Leave basic breadcrumbs in dmesg for shell script based tests

2016-10-07 Thread Ville Syrjälä
On Fri, Oct 07, 2016 at 10:24:39AM +0300, Jani Nikula wrote:
> On Thu, 06 Oct 2016, ville.syrj...@linux.intel.com wrote:
> > From: Ville Syrjälä 
> >
> > Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
> > running the test.
> >
> > Signed-off-by: Ville Syrjälä 
> > ---
> >  tests/drm_lib.sh | 24 
> >  1 file changed, 24 insertions(+)
> >
> > diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
> > index 0eeab1c183c9..456040e1971f 100755
> > --- a/tests/drm_lib.sh
> > +++ b/tests/drm_lib.sh
> > @@ -3,6 +3,30 @@
> >  SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
> >  . $SOURCE_DIR/drm_getopt.sh
> >  
> > +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>"
> > +
> > +kmsg() {
> > +   echo "$1" > /dev/kmsg
> 
> If you make that echo "$@", it'll all end up in kmsg even if someone
> accidentally uses more than one parameter. But no big deal.

Changed it, and pushed the lot.

> 
> BR,
> Jani.
> 
> > +}
> > +
> > +finish() {
> > +   exitcode=$?
> > +   kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
> > +   exit $exitcode
> > +}
> > +trap finish EXIT
> > +
> > +kmsg "$KERN_INFO$NAME: executing"
> > +
> >  skip() {
> > echo "$@"
> > exit $IGT_EXIT_SKIP
> 
> -- 
> 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


Re: [Intel-gfx] [PATCH i-g-t 2/5] tests: Leave basic breadcrumbs in dmesg for shell script based tests

2016-10-07 Thread Jani Nikula
On Thu, 06 Oct 2016, ville.syrj...@linux.intel.com wrote:
> From: Ville Syrjälä 
>
> Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
> running the test.
>
> Signed-off-by: Ville Syrjälä 
> ---
>  tests/drm_lib.sh | 24 
>  1 file changed, 24 insertions(+)
>
> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
> index 0eeab1c183c9..456040e1971f 100755
> --- a/tests/drm_lib.sh
> +++ b/tests/drm_lib.sh
> @@ -3,6 +3,30 @@
>  SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
>  . $SOURCE_DIR/drm_getopt.sh
>  
> +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>"
> +
> +kmsg() {
> + echo "$1" > /dev/kmsg

If you make that echo "$@", it'll all end up in kmsg even if someone
accidentally uses more than one parameter. But no big deal.

BR,
Jani.

> +}
> +
> +finish() {
> + exitcode=$?
> + kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
> + exit $exitcode
> +}
> +trap finish EXIT
> +
> +kmsg "$KERN_INFO$NAME: executing"
> +
>  skip() {
>   echo "$@"
>   exit $IGT_EXIT_SKIP

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


[Intel-gfx] [PATCH i-g-t 2/5] tests: Leave basic breadcrumbs in dmesg for shell script based tests

2016-10-06 Thread ville . syrjala
From: Ville Syrjälä 

Leave the normal "executing" and "exiting" breadcrumbs into dmesg when
running the test.

Signed-off-by: Ville Syrjälä 
---
 tests/drm_lib.sh | 24 
 1 file changed, 24 insertions(+)

diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 0eeab1c183c9..456040e1971f 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -3,6 +3,30 @@
 SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
 . $SOURCE_DIR/drm_getopt.sh
 
+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>"
+
+kmsg() {
+   echo "$1" > /dev/kmsg
+}
+
+finish() {
+   exitcode=$?
+   kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
+   exit $exitcode
+}
+trap finish EXIT
+
+kmsg "$KERN_INFO$NAME: executing"
+
 skip() {
echo "$@"
exit $IGT_EXIT_SKIP
-- 
2.7.4

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