diff mbox

[2/2] drm/i915: Display current hangcheck status in debugfs

Message ID 1422017048-4792-2-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Jan. 23, 2015, 12:44 p.m. UTC
From: Chris Wilson <chris@chris-wilson.co.uk>

For example,

/sys/kernel/debug/dri/0/i915_hangcheck_info:

Hangcheck active, fires in 15887800ms
render ring:
        seqno = -4059 [current -583]
        action = 2
        score = 0
        ACTHD = 1ee8 [current 21f980]
        max ACTHD = 0

v2: Include expiration ETA. Can anyone spot a problem?
v3: Convert for workqueued hangcheck (Mika)

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) (v2)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (v2)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

Ville Syrjälä Jan. 23, 2015, 1:19 p.m. UTC | #1
On Fri, Jan 23, 2015 at 02:44:08PM +0200, Mika Kuoppala wrote:
> From: Chris Wilson <chris@chris-wilson.co.uk>
> 
> For example,
> 
> /sys/kernel/debug/dri/0/i915_hangcheck_info:
> 
> Hangcheck active, fires in 15887800ms
> render ring:
>         seqno = -4059 [current -583]
>         action = 2
>         score = 0
>         ACTHD = 1ee8 [current 21f980]
>         max ACTHD = 0
> 
> v2: Include expiration ETA. Can anyone spot a problem?
> v3: Convert for workqueued hangcheck (Mika)
> 
> Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) (v2)
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (v2)
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 2ad4c48..1502c96 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1219,6 +1219,41 @@ out:
>  	return ret;
>  }
>  
> +static int i915_hangcheck_info(struct seq_file *m, void *unused)
> +{
> +	struct drm_info_node *node = m->private;
> +	struct drm_i915_private *dev_priv = to_i915(node->minor->dev);
> +	struct intel_engine_cs *ring;
> +	int i;
> +
> +	if (!i915.enable_hangcheck) {
> +		seq_printf(m, "Hangcheck disabled\n");
> +		return 0;
> +	}
> +
> +	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
> +		seq_printf(m, "Hangcheck active, fires in %dms\n",
> +			   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
> +					    jiffies));
> +	} else
> +		seq_printf(m, "Hangcheck inactive\n");
> +
> +	for_each_ring(ring, dev_priv, i) {
> +		seq_printf(m, "%s:\n", ring->name);
> +		seq_printf(m, "\tseqno = %d [current %d]\n",

%u ?

> +			   ring->hangcheck.seqno, ring->get_seqno(ring, false));
> +		seq_printf(m, "\taction = %d\n", ring->hangcheck.action);
> +		seq_printf(m, "\tscore = %d\n", ring->hangcheck.score);
> +		seq_printf(m, "\tACTHD = 0x%08llx [current 0x%08llx]\n",
> +			   (long long)ring->hangcheck.acthd,
> +			   (long long)intel_ring_get_active_head(ring));
> +		seq_printf(m, "\tmax ACTHD = 0x%08llx\n",
> +			   (long long)ring->hangcheck.max_acthd);
> +	}
> +
> +	return 0;
> +}
> +
>  static int ironlake_drpc_info(struct seq_file *m)
>  {
>  	struct drm_info_node *node = m->private;
> @@ -4407,6 +4442,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
>  	{"i915_gem_hws_vebox", i915_hws_info, 0, (void *)VECS},
>  	{"i915_gem_batch_pool", i915_gem_batch_pool_info, 0},
>  	{"i915_frequency_info", i915_frequency_info, 0},
> +	{"i915_hangcheck_info", i915_hangcheck_info, 0},
>  	{"i915_drpc_info", i915_drpc_info, 0},
>  	{"i915_emon_status", i915_emon_status, 0},
>  	{"i915_ring_freq_table", i915_ring_freq_table, 0},
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Shuang He Jan. 23, 2015, 6:24 p.m. UTC | #2
Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 5634
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -1              353/353              352/353
ILK                                  353/353              353/353
SNB              +1                 399/422              400/422
IVB              +1                 486/487              487/487
BYT                                  296/296              296/296
HSW              +1-2              507/508              506/508
BDW                                  399/402              399/402
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_gen3_render_linear_blits      PASS(3, M7M23)      CRASH(1, M23)
 SNB  igt_kms_flip_nonexisting-fb      NSPT(1, M35)PASS(5, M35M22)      PASS(1, M22)
 IVB  igt_gem_pwrite_pread_snooped-pwrite-blt-cpu_mmap-performance      DMESG_WARN(2, M21)PASS(1, M4)      PASS(1, M21)
*HSW  igt_gem_storedw_batches_loop_normal      PASS(2, M19M20)      DMESG_WARN(1, M20)
 HSW  igt_gem_storedw_loop_blt      DMESG_WARN(2, M19M20)PASS(4, M20M40)      PASS(1, M20)
*HSW  igt_pm_rpm_debugfs-read      PASS(2, M19M20)      DMESG_WARN(1, M20)
Note: You need to pay more attention to line start with '*'
Chris Wilson Jan. 23, 2015, 8:53 p.m. UTC | #3
On Fri, Jan 23, 2015 at 03:19:16PM +0200, Ville Syrjälä wrote:
> On Fri, Jan 23, 2015 at 02:44:08PM +0200, Mika Kuoppala wrote:
> > From: Chris Wilson <chris@chris-wilson.co.uk>
> > 
> > For example,
> > 
> > /sys/kernel/debug/dri/0/i915_hangcheck_info:
> > 
> > Hangcheck active, fires in 15887800ms
> > render ring:
> >         seqno = -4059 [current -583]
> >         action = 2
> >         score = 0
> >         ACTHD = 1ee8 [current 21f980]
> >         max ACTHD = 0
> > 
> > v2: Include expiration ETA. Can anyone spot a problem?
> > v3: Convert for workqueued hangcheck (Mika)
> > 
> > Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) (v2)
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (v2)
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c | 36 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 2ad4c48..1502c96 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1219,6 +1219,41 @@ out:
> >  	return ret;
> >  }
> >  
> > +static int i915_hangcheck_info(struct seq_file *m, void *unused)
> > +{
> > +	struct drm_info_node *node = m->private;
> > +	struct drm_i915_private *dev_priv = to_i915(node->minor->dev);
> > +	struct intel_engine_cs *ring;
> > +	int i;
> > +
> > +	if (!i915.enable_hangcheck) {
> > +		seq_printf(m, "Hangcheck disabled\n");
> > +		return 0;
> > +	}
> > +
> > +	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
> > +		seq_printf(m, "Hangcheck active, fires in %dms\n",
> > +			   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
> > +					    jiffies));
> > +	} else
> > +		seq_printf(m, "Hangcheck inactive\n");
> > +
> > +	for_each_ring(ring, dev_priv, i) {
> > +		seq_printf(m, "%s:\n", ring->name);
> > +		seq_printf(m, "\tseqno = %d [current %d]\n",
> 
> %u ?

%x. Then it will be more consistent with how we print it else. (No one
has ever accused me of being consistent!)
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 2ad4c48..1502c96 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1219,6 +1219,41 @@  out:
 	return ret;
 }
 
+static int i915_hangcheck_info(struct seq_file *m, void *unused)
+{
+	struct drm_info_node *node = m->private;
+	struct drm_i915_private *dev_priv = to_i915(node->minor->dev);
+	struct intel_engine_cs *ring;
+	int i;
+
+	if (!i915.enable_hangcheck) {
+		seq_printf(m, "Hangcheck disabled\n");
+		return 0;
+	}
+
+	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
+		seq_printf(m, "Hangcheck active, fires in %dms\n",
+			   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
+					    jiffies));
+	} else
+		seq_printf(m, "Hangcheck inactive\n");
+
+	for_each_ring(ring, dev_priv, i) {
+		seq_printf(m, "%s:\n", ring->name);
+		seq_printf(m, "\tseqno = %d [current %d]\n",
+			   ring->hangcheck.seqno, ring->get_seqno(ring, false));
+		seq_printf(m, "\taction = %d\n", ring->hangcheck.action);
+		seq_printf(m, "\tscore = %d\n", ring->hangcheck.score);
+		seq_printf(m, "\tACTHD = 0x%08llx [current 0x%08llx]\n",
+			   (long long)ring->hangcheck.acthd,
+			   (long long)intel_ring_get_active_head(ring));
+		seq_printf(m, "\tmax ACTHD = 0x%08llx\n",
+			   (long long)ring->hangcheck.max_acthd);
+	}
+
+	return 0;
+}
+
 static int ironlake_drpc_info(struct seq_file *m)
 {
 	struct drm_info_node *node = m->private;
@@ -4407,6 +4442,7 @@  static const struct drm_info_list i915_debugfs_list[] = {
 	{"i915_gem_hws_vebox", i915_hws_info, 0, (void *)VECS},
 	{"i915_gem_batch_pool", i915_gem_batch_pool_info, 0},
 	{"i915_frequency_info", i915_frequency_info, 0},
+	{"i915_hangcheck_info", i915_hangcheck_info, 0},
 	{"i915_drpc_info", i915_drpc_info, 0},
 	{"i915_emon_status", i915_emon_status, 0},
 	{"i915_ring_freq_table", i915_ring_freq_table, 0},