From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
To: <dri-devel@lists.freedesktop.org>, <christian.koenig@amd.com>,
<tursulin@igalia.com>, <simona.vetter@ffwll.ch>,
<robdclark@gmail.com>, <alexander.deucher@amd.com>,
<amd-gfx@lists.freedesktop.org>
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
"Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>
Subject: [PATCH v3 2/6] drm: use drm_file name in fdinfo
Date: Fri, 20 Sep 2024 11:06:44 +0200 [thread overview]
Message-ID: <20240920090920.1342694-3-pierre-eric.pelloux-prayer@amd.com> (raw)
In-Reply-To: <20240920090920.1342694-1-pierre-eric.pelloux-prayer@amd.com>
Add an optional drm-client-name field to drm fdinfo's output.
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
---
Documentation/gpu/drm-usage-stats.rst | 5 +++++
drivers/gpu/drm/drm_file.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/Documentation/gpu/drm-usage-stats.rst b/Documentation/gpu/drm-usage-stats.rst
index a80f95ca1b2f..ed1d7edbbc5f 100644
--- a/Documentation/gpu/drm-usage-stats.rst
+++ b/Documentation/gpu/drm-usage-stats.rst
@@ -73,6 +73,11 @@ scope of each device, in which case `drm-pdev` shall be present as well.
Userspace should make sure to not double account any usage statistics by using
the above described criteria in order to associate data to individual clients.
+- drm-client-name: <valstr>
+
+String optionally set by userspace using DRM_IOCTL_SET_NAME.
+
+
Utilization
^^^^^^^^^^^
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index e9dd0e90a1f9..6a3621f50784 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -955,6 +955,11 @@ void drm_show_fdinfo(struct seq_file *m, struct file *f)
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
}
+ mutex_lock(&file->name_lock);
+ if (file->name)
+ drm_printf(&p, "drm-client-name:\t%s\n", file->name);
+ mutex_unlock(&file->name_lock);
+
if (dev->driver->show_fdinfo)
dev->driver->show_fdinfo(&p, file);
}
--
2.40.1
next prev parent reply other threads:[~2024-09-20 9:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 9:06 [PATCH v3 0/6] DRM_SET_NAME ioctl Pierre-Eric Pelloux-Prayer
2024-09-20 9:06 ` [PATCH v3 1/6] drm: add " Pierre-Eric Pelloux-Prayer
2024-09-23 10:06 ` Tvrtko Ursulin
2024-09-24 8:22 ` Pierre-Eric Pelloux-Prayer
2024-09-24 8:38 ` Tvrtko Ursulin
2024-09-23 10:28 ` Dmitry Osipenko
2024-09-23 11:03 ` Dmitry Osipenko
2024-09-23 16:29 ` Pierre-Eric Pelloux-Prayer
2024-09-23 18:09 ` Dmitry Osipenko
2024-09-23 18:18 ` Dmitry Osipenko
2024-09-24 23:28 ` Dmitry Osipenko
2024-09-20 9:06 ` Pierre-Eric Pelloux-Prayer [this message]
2024-09-20 9:06 ` [PATCH v3 3/6] drm/amdgpu: delay the use of amdgpu_vm_set_task_info Pierre-Eric Pelloux-Prayer
2024-09-23 10:25 ` Tvrtko Ursulin
2024-09-24 8:23 ` Christian König
2024-09-24 8:43 ` Tvrtko Ursulin
2024-09-24 10:01 ` Pierre-Eric Pelloux-Prayer
2024-09-20 9:06 ` [PATCH v3 4/6] drm/amdgpu: alloc and init vm::task_info from first submit Pierre-Eric Pelloux-Prayer
2024-09-23 10:58 ` Tvrtko Ursulin
2024-09-24 7:21 ` Pierre-Eric Pelloux-Prayer
2024-09-20 9:06 ` [PATCH v3 5/6] drm/amdgpu: make process_name a flexible array Pierre-Eric Pelloux-Prayer
2024-09-20 9:06 ` [PATCH v3 6/6] drm/amdgpu: use drm_file::name in task_info::process_desc Pierre-Eric Pelloux-Prayer
2024-09-20 12:08 ` Christian König
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=20240920090920.1342694-3-pierre-eric.pelloux-prayer@amd.com \
--to=pierre-eric.pelloux-prayer@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=robdclark@gmail.com \
--cc=simona.vetter@ffwll.ch \
--cc=tursulin@igalia.com \
--cc=tvrtko.ursulin@igalia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox