public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC PATCH i-g-t] lib: Add warning if lockdep is disabled before a test.
Date: Wed, 20 Apr 2016 16:17:35 +0200	[thread overview]
Message-ID: <20160420141735.GL2510@phenom.ffwll.local> (raw)
In-Reply-To: <57162EC6.7070709@linux.intel.com>

On Tue, Apr 19, 2016 at 03:12:38PM +0200, Maarten Lankhorst wrote:
> When running tests, it will produce warnings like this:
> 
> (core_auth:2552) igt-core-WARNING: Lockdep is turned off.
> 
> This makes sure lockdep warnings during load aren't accidentally ignored.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Ack on the idea.
-Daniel

> ---
> Unfortunately this version suffers from a small problem, piglit still succeeds without WARN. :(
> 
> Seems to be an issue in piglit/tests/igt.py that needs a separate fix.
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 832361b0a9f9..bb17ddfbcadb 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -570,6 +570,39 @@ static void oom_adjust_for_doom(void)
>  
>  }
>  
> +static void igt_warn_lockdep(void)
> +{
> +	FILE *f;
> +	long val;
> +	char line[256];
> +
> +	f = fopen("/proc/lockdep_stats", "r");
> +	if (!f && errno == ENOENT) {
> +		igt_debug("Lockdep is not compiled in.\n");
> +		return;
> +	}
> +
> +	igt_assert(f);
> +
> +	while (fgets(line, sizeof(line), f)) {
> +		if (strncmp(line, " debug_locks:", 13))
> +			continue;
> +
> +		val = strtol(line + 13, NULL, 10);
> +
> +		if (!val)
> +			igt_warn("Lockdep is turned off.\n");
> +		else
> +			igt_debug("Lockdep is active.\n");
> +		goto out;
> +	}
> +
> +	igt_warn("Could not find lockdep setting.\n");
> +
> +out:
> +	fclose(f);
> +}
> +
>  static int common_init(int *argc, char **argv,
>  		       const char *extra_short_opts,
>  		       const struct option *extra_long_opts,
> @@ -741,6 +774,8 @@ out:
>  		low_mem_killer_disable(true);
>  	}
>  
> +	igt_warn_lockdep();
> +
>  	/* install exit handler, to ensure we clean up */
>  	igt_install_exit_handler(common_exit_handler);
>  
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2016-04-20 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 13:12 [RFC PATCH i-g-t] lib: Add warning if lockdep is disabled before a test Maarten Lankhorst
2016-04-20 14:17 ` Daniel Vetter [this message]

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=20160420141735.GL2510@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox