All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>,
	Thomas Wood <thomas.wood@intel.com>
Subject: Re: [PATCH i-g-t] Add dmesg capture and dumping to tests and a test for it.
Date: Mon, 16 Nov 2015 14:06:33 +0000	[thread overview]
Message-ID: <20151116140633.GT569@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1447680143-11895-1-git-send-email-joonas.lahtinen@linux.intel.com>

On Mon, Nov 16, 2015 at 03:22:23PM +0200, Joonas Lahtinen wrote:
> Cc: Thomas Wood <thomas.wood@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  lib/igt_core.c         | 113 ++++++++++++++++++++++++++++++++++++++++++++++---
>  tests/Makefile.sources |   1 +
>  tests/igt_capture.c    |  93 ++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 200 insertions(+), 7 deletions(-)
>  create mode 100644 tests/igt_capture.c
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 04a0ab2..e73175a 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -211,6 +211,8 @@
>   * "--help" command line option.
>   */
>  
> +#define IGT_KMSG_CAPTURE_DUMP_BUF_SIZE		4096
> +
>  static unsigned int exit_handler_count;
>  const char *igt_interactive_debug;
>  
> @@ -247,6 +249,10 @@ enum {
>  static int igt_exitcode = IGT_EXIT_SUCCESS;
>  static const char *command_str;
>  
> +static int igt_kmsg_capture_fd;
> +static char* igt_kmsg_capture_dump_buf;
> +static pthread_mutex_t kmsg_mutex = PTHREAD_MUTEX_INITIALIZER;
> +
>  static char* igt_log_domain_filter;
>  static struct {
>  	char *entries[256];
> @@ -312,6 +318,71 @@ static void _igt_log_buffer_dump(void)
>  	pthread_mutex_unlock(&log_buffer_mutex);
>  }
>  
> +static void _igt_kmsg_capture_reset(void)
> +{
> +	if (igt_kmsg_capture_fd == -1)
> +		return;
> +
> +	pthread_mutex_lock(&kmsg_mutex);
> +
> +	lseek(igt_kmsg_capture_fd, 0, SEEK_END);
> +
> +	pthread_mutex_unlock(&kmsg_mutex);
> +}

Since close() is signal-safe, you can avoid the mutex (which is not
signal-safe, but we can hope not to generate reentrancy here!) by
opening /dev/kmsg for each subtest, and close it again in
exit_subtest().

Note that we also want to detect dmesg spew during igt when the tests
report all is well. Having the full log associated with a fail,
preferrably with --debug is good, but filtering the <prio> for errors is
also useful.
-Chris

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

  reply	other threads:[~2015-11-16 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 13:22 [PATCH i-g-t] Add dmesg capture and dumping to tests and a test for it Joonas Lahtinen
2015-11-16 14:06 ` Chris Wilson [this message]
2015-11-17  8:24   ` Joonas Lahtinen
2015-11-17 13:05 ` Thomas Wood
2015-11-17 13:34   ` Joonas Lahtinen
2015-11-18 15:44 ` Daniel Vetter
2015-11-18 17:32   ` Chris Wilson
2015-11-19  9:38     ` Daniel Vetter
2015-11-19  9:41       ` Daniel Vetter
2015-11-20 11:22         ` Joonas Lahtinen
2015-11-20 11:34           ` Chris Wilson
2015-11-23 10:31             ` Joonas Lahtinen
2015-11-19 10:35     ` [PATCH i-g-t v2] lib/igt_core: Add kmsg capture and dumping Joonas Lahtinen
2015-11-19 11:32       ` Chris Wilson
2015-11-20 11:46         ` Joonas Lahtinen
2015-11-26 12:17           ` [PATCH i-g-t v4] " Joonas Lahtinen
2015-11-26 14:34             ` Daniel Vetter
2015-11-26 15:00               ` Joonas Lahtinen
2015-11-27 10:31                 ` Daniel Vetter
2015-11-27 11:46                   ` Joonas Lahtinen
2015-11-30  8:09                     ` Daniel Vetter
2015-11-18 17:41   ` [PATCH i-g-t] Add dmesg capture and dumping to tests and a test for it Thomas Wood
2015-11-18 18:12     ` Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151116140633.GT569@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=thomas.wood@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.