From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 2/4] drm/i915: Make engine state pretty-printer header configurable
Date: Fri, 10 Nov 2017 14:27:41 +0200 [thread overview]
Message-ID: <87shdmqpxe.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20171109235407.5595-2-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Pass in a format string (and args) to specify the header to be emitted
> along with the engine state when pretty-printing. This allows the header
> to be emitted inside the drm_printer stream, so sharing the same prefix
> and output characteristics (e.g. debug level and filtering).
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
> drivers/gpu/drm/i915/intel_engine_cs.c | 18 ++++++++++++------
> drivers/gpu/drm/i915/intel_ringbuffer.h | 5 ++++-
> drivers/gpu/drm/i915/selftests/intel_hangcheck.c | 21 ++++++++++++---------
> 4 files changed, 29 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 533ba096b9a6..8c5c4f161147 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3248,7 +3248,7 @@ static int i915_engine_info(struct seq_file *m, void *unused)
>
> p = drm_seq_file_printer(m);
> for_each_engine(engine, dev_priv, id)
> - intel_engine_dump(engine, &p);
> + intel_engine_dump(engine, &p, "%s\n", engine->name);
>
> intel_runtime_pm_put(dev_priv);
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 403cc4749008..54d19784b6ab 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1652,12 +1652,12 @@ void intel_engines_park(struct drm_i915_private *i915)
> * will be no more interrupts arriving later and the engines
> * are truly idle.
> */
> - if (!intel_engine_is_idle(engine)) {
> + if (GEM_WARN_ON(!intel_engine_is_idle(engine))) {
> struct drm_printer p = drm_debug_printer(__func__);
>
> - DRM_ERROR("%s is not idle before parking\n",
> - engine->name);
> - intel_engine_dump(engine, &p);
> + intel_engine_dump(engine, &p,
> + "%s is not idle before parking\n",
> + engine->name);
> }
>
> if (engine->park)
> @@ -1727,7 +1727,9 @@ static void print_request(struct drm_printer *m,
> rq->timeline->common->name);
> }
>
> -void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
> +void intel_engine_dump(struct intel_engine_cs *engine,
> + struct drm_printer *m,
> + const char *fmt, ...)
> {
> struct intel_breadcrumbs * const b = &engine->breadcrumbs;
> const struct intel_engine_execlists * const execlists = &engine->execlists;
> @@ -1735,9 +1737,13 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
> struct drm_i915_private *dev_priv = engine->i915;
> struct drm_i915_gem_request *rq;
> struct rb_node *rb;
> + va_list ap;
> u64 addr;
>
> - drm_printf(m, "%s\n", engine->name);
> + va_start(ap, fmt);
> + drm_vprintf(m, fmt, &ap);
> + va_end(ap);
> +
> drm_printf(m, "\tcurrent seqno %x, last %x, hangcheck %x [%d ms], inflight %d\n",
> intel_engine_get_seqno(engine),
> intel_engine_last_submit(engine),
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 2b0ae5468f48..a1a33466683b 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -936,6 +936,9 @@ unsigned int intel_engines_has_context_isolation(struct drm_i915_private *i915);
>
> bool intel_engine_can_store_dword(struct intel_engine_cs *engine);
>
> -void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *p);
> +__printf(3, 4)
> +void intel_engine_dump(struct intel_engine_cs *engine,
> + struct drm_printer *m,
> + const char *fmt, ...);
>
> #endif /* _INTEL_RINGBUFFER_H_ */
> diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> index 71ce06680d66..18f181c46443 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> @@ -626,9 +626,10 @@ static int igt_wait_reset(void *arg)
> if (!wait_for_hang(&h, rq)) {
> struct drm_printer p = drm_info_printer(i915->drm.dev);
>
> - pr_err("Failed to start request %x, at %x\n",
> - rq->fence.seqno, hws_seqno(&h, rq));
> - intel_engine_dump(rq->engine, &p);
> + intel_engine_dump(rq->engine, &p,
> + "%s: Failed to start request %x, at %x\n",
> + rq->engine->name,
> + rq->fence.seqno, hws_seqno(&h, rq));
>
> i915_reset(i915, 0);
> i915_gem_set_wedged(i915);
> @@ -721,9 +722,10 @@ static int igt_reset_queue(void *arg)
> if (!wait_for_hang(&h, prev)) {
> struct drm_printer p = drm_info_printer(i915->drm.dev);
>
> - pr_err("Failed to start request %x, at %x\n",
> - prev->fence.seqno, hws_seqno(&h, prev));
> - intel_engine_dump(rq->engine, &p);
> + intel_engine_dump(rq->engine, &p,
> + "%s: Failed to start request %x, at %x\n",
> + prev->engine->name,
> + prev->fence.seqno, hws_seqno(&h, prev));
>
> i915_gem_request_put(rq);
> i915_gem_request_put(prev);
> @@ -827,9 +829,10 @@ static int igt_handle_error(void *arg)
> if (!wait_for_hang(&h, rq)) {
> struct drm_printer p = drm_info_printer(i915->drm.dev);
>
> - pr_err("Failed to start request %x, at %x\n",
> - rq->fence.seqno, hws_seqno(&h, rq));
> - intel_engine_dump(rq->engine, &p);
> + intel_engine_dump(rq->engine, &p,
> + "%s: Failed to start request %x, at %x\n",
> + rq->engine->name,
> + rq->fence.seqno, hws_seqno(&h, rq));
>
> i915_reset(i915, 0);
> i915_gem_set_wedged(i915);
> --
> 2.15.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-10 12:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 23:54 [PATCH v3 1/4] drm-print Chris Wilson
2017-11-09 23:54 ` [PATCH v3 2/4] drm/i915: Make engine state pretty-printer header configurable Chris Wilson
2017-11-10 12:27 ` Mika Kuoppala [this message]
2017-11-09 23:54 ` [PATCH v3 3/4] drm/i915: Include engine state on detecting a missed breadcrumb/seqno Chris Wilson
2017-11-10 9:43 ` [PATCH v4] " Chris Wilson
2017-11-09 23:54 ` [PATCH v3 4/4] drm/i915: Add is-wedged flag to intel_engine_dump() Chris Wilson
2017-11-17 13:34 ` Mika Kuoppala
2017-11-10 0:14 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/4] drm-print Patchwork
2017-11-10 1:10 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-10 9:52 ` [PATCH v2] drm/printer: Add drm_vprintf() Chris Wilson
2017-11-10 11:28 ` Daniel Vetter
2017-11-10 10:03 ` ✗ Fi.CI.BAT: failure for series starting with [v3,1/4] drm-print (rev2) Patchwork
2017-11-10 10:20 ` ✗ Fi.CI.BAT: warning for series starting with [v2] drm/printer: Add drm_vprintf() (rev3) 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=87shdmqpxe.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.