All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Add uid info to process BO list
@ 2020-09-21 19:18 Madhav Chauhan
  2020-09-21 19:24 ` Christian König
  0 siblings, 1 reply; 8+ messages in thread
From: Madhav Chauhan @ 2020-09-21 19:18 UTC (permalink / raw)
  To: amd-gfx
  Cc: kishore.surampalli, mihir.patel, shashank.sharma, Madhav Chauhan,
	alexander.deucher, athar.saleem

UID is helpful while doing analysis of BO allocated
by a process.

Signed-off-by: Madhav Chauhan <madhav.chauhan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index f4c2e2e75b8f..c1982349ec7b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -892,6 +892,7 @@ static int amdgpu_debugfs_gem_info(struct seq_file *m, void *data)
 	struct drm_info_node *node = (struct drm_info_node *)m->private;
 	struct drm_device *dev = node->minor->dev;
 	struct drm_file *file;
+	kuid_t uid;
 	int r;
 
 	r = mutex_lock_interruptible(&dev->filelist_mutex);
@@ -909,7 +910,10 @@ static int amdgpu_debugfs_gem_info(struct seq_file *m, void *data)
 		 */
 		rcu_read_lock();
 		task = pid_task(file->pid, PIDTYPE_PID);
-		seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid),
+		uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID;
+		seq_printf(m, "pid %8d uid %5d command %s:\n",
+			   pid_nr(file->pid),
+			   from_kuid_munged(seq_user_ns(m), uid),
 			   task ? task->comm : "<unknown>");
 		rcu_read_unlock();
 
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-22 15:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 19:18 [PATCH] drm/amdgpu: Add uid info to process BO list Madhav Chauhan
2020-09-21 19:24 ` Christian König
2020-09-21 19:55   ` Chauhan, Madhav
2020-09-22  6:44     ` Christian König
2020-09-22 10:38       ` Chauhan, Madhav
2020-09-22 12:54         ` Christian König
2020-09-22 14:39           ` Chauhan, Madhav
2020-09-22 15:02             ` Alex Deucher

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.