drm: Include task->name and master status in debugfs clients info
Showing who is the current master is useful for trying to decypher errors when trying to acquire master (e.g. a race with X taking over from plymouth). By including the process name as well as the pid simplifies the task of grabbing enough information remotely at the point of error. v2: Add the command column header and flesh out a couple of comments. (David Herrmann) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
2a5706a36d
commit
50d47cb318
|
@ -183,15 +183,32 @@ int drm_clients_info(struct seq_file *m, void *data)
|
|||
struct drm_device *dev = node->minor->dev;
|
||||
struct drm_file *priv;
|
||||
|
||||
seq_printf(m,
|
||||
"%20s %5s %3s master a %5s %10s\n",
|
||||
"command",
|
||||
"pid",
|
||||
"dev",
|
||||
"uid",
|
||||
"magic");
|
||||
|
||||
/* dev->filelist is sorted youngest first, but we want to present
|
||||
* oldest first (i.e. kernel, servers, clients), so walk backwardss.
|
||||
*/
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
seq_printf(m, "a dev pid uid magic\n\n");
|
||||
list_for_each_entry(priv, &dev->filelist, lhead) {
|
||||
seq_printf(m, "%c %3d %5d %5d %10u\n",
|
||||
priv->authenticated ? 'y' : 'n',
|
||||
priv->minor->index,
|
||||
list_for_each_entry_reverse(priv, &dev->filelist, lhead) {
|
||||
struct task_struct *task;
|
||||
|
||||
rcu_read_lock(); /* locks pid_task()->comm */
|
||||
task = pid_task(priv->pid, PIDTYPE_PID);
|
||||
seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n",
|
||||
task ? task->comm : "<unknown>",
|
||||
pid_vnr(priv->pid),
|
||||
priv->minor->index,
|
||||
priv->is_master ? 'y' : 'n',
|
||||
priv->authenticated ? 'y' : 'n',
|
||||
from_kuid_munged(seq_user_ns(m), priv->uid),
|
||||
priv->magic);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue