All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Madhav Chauhan <madhav.chauhan@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, kishore.surampalli@amd.com,
	mihir.patel@amd.com, athar.saleem@amd.com,
	shashank.sharma@amd.com
Subject: Re: [PATCH] drm/amdgpu: Add uid info to process BO list
Date: Mon, 21 Sep 2020 21:24:27 +0200	[thread overview]
Message-ID: <be158145-41b9-c319-8e46-cda88d5cb9c2@gmail.com> (raw)
In-Reply-To: <20200921191803.18549-1-madhav.chauhan@amd.com>

Am 21.09.20 um 21:18 schrieb Madhav Chauhan:
> UID is helpful while doing analysis of BO allocated
> by a process.

Looks like a bit overkill to me, why not get the uid from the process info?

Christian.

>
> 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();
>   

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

  reply	other threads:[~2020-09-21 19:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be158145-41b9-c319-8e46-cda88d5cb9c2@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=athar.saleem@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=kishore.surampalli@amd.com \
    --cc=madhav.chauhan@amd.com \
    --cc=mihir.patel@amd.com \
    --cc=shashank.sharma@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.