All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/33] drm/i915/selftests: Apply a subtest filter
Date: Fri, 25 Jan 2019 13:44:30 +0200	[thread overview]
Message-ID: <87k1itkllt.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190125023005.1007-7-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> In bringup on simulated HW even rudimentary tests are slow, and so many
> may fail that we want to be able to filter out the noise to focus on the
> specific problem. Even just the tests groups provided for igt is not
> specific enough, and we would like to isolate one particular subtest
> (and probably subsubtests!). For simplicity, allow the user to provide a
> command line parameter such as
>
> 	i915.st_filter=i915_timeline_mock_selftests/igt_sync
>
> to restrict ourselves to only running on subtest. The exact name to use
> is given during a normal run, highlighted as an error if it failed,
> debug otherwise. The test group is optional, and then all subtests are
> compared for an exact match with the filter (most subtests have unique
> names). The filter can be negated, e.g. i915.st_filter=!igt_sync and
> then all tests but those that match will be run. More than one match can
> be supplied separated by a comma, e.g.
>
> 	i915.st_filter=igt_vma_create,igt_vma_pin1
>
> to only run those specified, or
>
> 	i915.st_filter=!igt_vma_create,!igt_vma_pin1
>
> to run all but those named. Mixing a blacklist and whitelist will only
> execute those subtests matching the whitelist so long as they are
> previously excluded in the blacklist.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_selftest.h          |  1 +
>  .../gpu/drm/i915/selftests/i915_selftest.c    | 44 +++++++++++++++++++
>  2 files changed, 45 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_selftest.h b/drivers/gpu/drm/i915/i915_selftest.h
> index a73472dd12fd..207e21b478f2 100644
> --- a/drivers/gpu/drm/i915/i915_selftest.h
> +++ b/drivers/gpu/drm/i915/i915_selftest.h
> @@ -31,6 +31,7 @@ struct i915_selftest {
>  	unsigned long timeout_jiffies;
>  	unsigned int timeout_ms;
>  	unsigned int random_seed;
> +	char *filter;
>  	int mock;
>  	int live;
>  };
> diff --git a/drivers/gpu/drm/i915/selftests/i915_selftest.c b/drivers/gpu/drm/i915/selftests/i915_selftest.c
> index 86c54ea37f48..1b174ac65ff9 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_selftest.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_selftest.c
> @@ -197,6 +197,46 @@ int i915_live_selftests(struct pci_dev *pdev)
>  	return 0;
>  }
>  
> +static bool apply_subtest_filter(const char *caller, const char *name)
> +{
> +	char *filter, *sep, *tok;
> +	bool result = true;
> +
> +	filter = kstrdup(i915_selftest.filter, GFP_KERNEL);

Was going to say that bailout if !filter.
But apparently it is ok this way.

-Mika

> +	for (sep = filter; (tok = strsep(&sep, ","));) {
> +		bool allow = true;
> +		char *sl;
> +
> +		if (*tok == '!') {
> +			allow = false;
> +			tok++;
> +		}
> +
> +		sl = strchr(tok, '/');
> +		if (sl) {
> +			*sl++ = '\0';
> +			if (strcmp(tok, caller)) {
> +				if (allow)
> +					result = false;
> +				continue;
> +			}
> +			tok = sl;
> +		}
> +
> +		if (strcmp(tok, name)) {
> +			if (allow)
> +				result = false;
> +			continue;
> +		}
> +
> +		result = allow;
> +		break;
> +	}
> +	kfree(filter);
> +
> +	return result;
> +}
> +
>  int __i915_subtests(const char *caller,
>  		    const struct i915_subtest *st,
>  		    unsigned int count,
> @@ -209,6 +249,9 @@ int __i915_subtests(const char *caller,
>  		if (signal_pending(current))
>  			return -EINTR;
>  
> +		if (!apply_subtest_filter(caller, st->name))
> +			continue;
> +
>  		pr_debug(DRIVER_NAME ": Running %s/%s\n", caller, st->name);
>  		GEM_TRACE("Running %s/%s\n", caller, st->name);
>  
> @@ -244,6 +287,7 @@ bool __igt_timeout(unsigned long timeout, const char *fmt, ...)
>  
>  module_param_named(st_random_seed, i915_selftest.random_seed, uint, 0400);
>  module_param_named(st_timeout, i915_selftest.timeout_ms, uint, 0400);
> +module_param_named(st_filter, i915_selftest.filter, charp, 0400);
>  
>  module_param_named_unsafe(mock_selftests, i915_selftest.mock, int, 0400);
>  MODULE_PARM_DESC(mock_selftests, "Run selftests before loading, using mock hardware (0:disabled [default], 1:run tests then load driver, -1:run tests then exit module)");
> -- 
> 2.20.1
>
> _______________________________________________
> 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

  reply	other threads:[~2019-01-25 11:46 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  2:29 [PATCH 01/33] drm/i915/execlists: Move RPCS setup to context pin Chris Wilson
2019-01-25  2:29 ` [PATCH 02/33] drm/i915: Measure the required reserved size for request emission Chris Wilson
2019-01-25  8:34   ` Mika Kuoppala
2019-01-25  9:52     ` Chris Wilson
2019-01-25  2:29 ` [PATCH 03/33] drm/i915: Remove manual breadcumb counting Chris Wilson
2019-01-25  9:21   ` Mika Kuoppala
2019-01-25  2:29 ` [PATCH 04/33] drm/i915: Compute the HWS offsets explicitly Chris Wilson
2019-01-25  9:26   ` Mika Kuoppala
2019-01-25  2:29 ` [PATCH 05/33] drm/i915/execlists: Suppress preempting self Chris Wilson
2019-01-25  2:29 ` [PATCH 06/33] drm/i915/execlists: Suppress redundant preemption Chris Wilson
2019-01-25  2:29 ` [PATCH 07/33] drm/i915/selftests: Apply a subtest filter Chris Wilson
2019-01-25 11:44   ` Mika Kuoppala [this message]
2019-01-25 11:48     ` Chris Wilson
2019-01-29 10:37   ` Joonas Lahtinen
2019-01-25  2:29 ` [PATCH 08/33] drm/i915: Make all GPU resets atomic Chris Wilson
2019-01-25  2:29 ` [PATCH 09/33] drm/i915/guc: Disable global reset Chris Wilson
2019-01-25  2:29 ` [PATCH 10/33] drm/i915: Remove GPU reset dependence on struct_mutex Chris Wilson
2019-01-25 12:50   ` Mika Kuoppala
2019-01-25  2:29 ` [PATCH 11/33] drm/i915/selftests: Trim struct_mutex duration for set-wedged selftest Chris Wilson
2019-01-25  2:29 ` [PATCH 12/33] drm/i915: Issue engine resets onto idle engines Chris Wilson
2019-01-25  2:29 ` [PATCH 13/33] drm/i915: Stop tracking MRU activity on VMA Chris Wilson
2019-01-25  2:29 ` [PATCH 14/33] drm/i915: Pull VM lists under the VM mutex Chris Wilson
2019-01-25  2:29 ` [PATCH 15/33] drm/i915: Move vma lookup to its own lock Chris Wilson
2019-01-25  2:29 ` [PATCH 16/33] drm/i915: Always allocate an object/vma for the HWSP Chris Wilson
2019-01-25  2:29 ` [PATCH 17/33] drm/i915: Add timeline barrier support Chris Wilson
2019-01-25  2:29 ` [PATCH 18/33] drm/i915: Move list of timelines under its own lock Chris Wilson
2019-01-25  2:29 ` [PATCH 19/33] drm/i915: Introduce concept of per-timeline (context) HWSP Chris Wilson
2019-01-25  2:29 ` [PATCH 20/33] drm/i915: Enlarge vma->pin_count Chris Wilson
2019-01-25  2:29 ` [PATCH 21/33] drm/i915: Allocate a status page for each timeline Chris Wilson
2019-01-25  2:29 ` [PATCH 22/33] drm/i915: Share per-timeline HWSP using a slab suballocator Chris Wilson
2019-01-25  2:29 ` [PATCH 23/33] drm/i915: Track the context's seqno in its own timeline HWSP Chris Wilson
2019-01-25  2:29 ` [PATCH 24/33] drm/i915: Track active timelines Chris Wilson
2019-01-25  2:29 ` [PATCH 25/33] drm/i915: Identify active requests Chris Wilson
2019-01-25  2:29 ` [PATCH 26/33] drm/i915: Remove the intel_engine_notify tracepoint Chris Wilson
2019-01-25 14:10   ` Tvrtko Ursulin
2019-01-25  2:29 ` [PATCH 27/33] drm/i915: Replace global breadcrumbs with per-context interrupt tracking Chris Wilson
2019-01-25 13:54   ` Tvrtko Ursulin
2019-01-25 14:26     ` Chris Wilson
2019-01-25 14:39       ` Chris Wilson
2019-01-25  2:30 ` [PATCH 28/33] drm/i915: Drop fake breadcrumb irq Chris Wilson
2019-01-25 11:07   ` Tvrtko Ursulin
2019-01-25  2:30 ` [PATCH 29/33] drm/i915: Implement an "idle" barrier Chris Wilson
2019-01-25  8:43   ` Chris Wilson
2019-01-25  2:30 ` [PATCH 30/33] drm/i915: Keep timeline HWSP allocated until the system is idle Chris Wilson
2019-01-25  2:30 ` [PATCH 31/33] drm/i915/execlists: Refactor out can_merge_rq() Chris Wilson
2019-01-25  2:30 ` [PATCH 32/33] drm/i915: Use HW semaphores for inter-engine synchronisation on gen8+ Chris Wilson
2019-01-25  2:30 ` [PATCH 33/33] drm/i915: Prioritise non-busywait semaphore workloads Chris Wilson
2019-01-25  3:13 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/33] drm/i915/execlists: Move RPCS setup to context pin Patchwork
2019-01-25  3:27 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-25  3:34 ` ✗ Fi.CI.BAT: failure " Patchwork

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=87k1itkllt.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.