summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2014-11-14 14:24:59 +0000
committerJohn Harrison <John.C.Harrison@Intel.com>2016-05-06 14:12:47 +0100
commitd0a7904c4d71afefe297d44085941d134fd5acd5 (patch)
tree1491b691c7ed97a988fcdfa35258748d9df9a858
parent31516a29908668e99e7a707ebc371c96503b54bb (diff)
drm/i915: Add total count to context status debugfs output
When there are lots and lots and even more lots of contexts (e.g. when running with execlists) it is useful to be able to immediately see what the total context count is. v4: Re-typed a variable (review feedback from Joonas) For: VIZ-1587 Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 29ff1b380b22..e89781a611fb 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1961,7 +1961,7 @@ static int i915_context_status(struct seq_file *m, void *unused)
struct intel_engine_cs *engine;
struct intel_context *ctx;
enum intel_engine_id id;
- int ret;
+ int ret, count = 0;
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
@@ -1976,6 +1976,7 @@ static int i915_context_status(struct seq_file *m, void *unused)
describe_ctx(m, ctx);
if (ctx == dev_priv->kernel_context)
seq_printf(m, "(kernel context) ");
+ count++;
if (i915.enable_execlists) {
seq_putc(m, '\n');
@@ -1999,6 +2000,8 @@ static int i915_context_status(struct seq_file *m, void *unused)
seq_putc(m, '\n');
}
+ seq_printf(m, "Total: %d contexts\n", count);
+
mutex_unlock(&dev->struct_mutex);
return 0;