[Intel-gfx] [PATCH 10/15] drm/i915: debugfs entry for i915 clients
Ben Widawsky
ben at bwidawsk.net
Sat Nov 19 03:24:27 CET 2011
$ cat /sys/kernel/debug/dri/0/i915_clients
PID CMD
15869 X
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
drivers/gpu/drm/i915/i915_debugfs.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 261aa7c..59b9f22 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1307,6 +1307,33 @@ static int i915_context_status(struct seq_file *m, void *unused)
return 0;
}
+static int i915_clients(struct seq_file *m, void *unused)
+{
+ struct drm_info_node *node = (struct drm_info_node *) m->private;
+ struct drm_device *dev = node->minor->dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_i915_file_private *temp;
+ int ret;
+
+ ret = mutex_lock_interruptible(&dev->struct_mutex);
+ if (ret)
+ return ret;
+
+ seq_printf(m, "PID CMD\n");
+ list_for_each_entry(temp, &dev_priv->i915_client_list, client_link) {
+ struct pid *p;
+ struct task_struct *tsk;
+ pid_t pid = temp->drm_file->pid;
+ p = find_get_pid(pid);
+ tsk = get_pid_task(p, PIDTYPE_PID);
+ seq_printf(m, "%d %s\n", pid, tsk->comm);
+ put_pid(p);
+ }
+
+ mutex_unlock(&dev->struct_mutex);
+ return 0;
+}
+
static int i915_gen6_forcewake_count_info(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -1657,6 +1684,7 @@ static struct drm_info_list i915_debugfs_list[] = {
{"i915_gem_framebuffer", i915_gem_framebuffer_info, 0},
{"i915_context_status", i915_context_status, 0},
{"i915_gen6_forcewake_count", i915_gen6_forcewake_count_info, 0},
+ {"i915_clients", i915_clients, 0},
};
#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
--
1.7.7.3
More information about the Intel-gfx
mailing list