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>, <dmitry.osipenko@collabora.com>
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
"Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>
Subject: [PATCH v4 2/6] drm: use drm_file client_name in fdinfo
Date: Fri, 27 Sep 2024 10:48:38 +0200 [thread overview]
Message-ID: <20240927084848.263718-3-pierre-eric.pelloux-prayer@amd.com> (raw)
In-Reply-To: <20240927084848.263718-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..566e122e6e60 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_CLIENT_NAME.
+
+
Utilization
^^^^^^^^^^^
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 64f5e15304e7..1c9e03477a24 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->client_name_lock);
+ if (file->client_name)
+ drm_printf(&p, "drm-client-name:\t%s\n", file->client_name);
+ mutex_unlock(&file->client_name_lock);
+
if (dev->driver->show_fdinfo)
dev->driver->show_fdinfo(&p, file);
}
--
2.40.1
next prev parent reply other threads:[~2024-09-27 8:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 8:48 [PATCH v4 0/6] DRM_SET_CLIENT_NAME ioctl Pierre-Eric Pelloux-Prayer
2024-09-27 8:48 ` [PATCH v4 1/6] drm: add " Pierre-Eric Pelloux-Prayer
2024-09-28 12:31 ` Dmitry Osipenko
2024-09-30 8:57 ` Tvrtko Ursulin
2024-09-27 8:48 ` Pierre-Eric Pelloux-Prayer [this message]
2024-09-27 8:48 ` [PATCH v4 3/6] drm/amdgpu: delay the use of amdgpu_vm_set_task_info Pierre-Eric Pelloux-Prayer
2024-09-27 8:48 ` [PATCH v4 4/6] drm/amdgpu: alloc and init vm::task_info from first submit Pierre-Eric Pelloux-Prayer
2024-09-27 8:48 ` [PATCH v4 5/6] drm/amdgpu: make process_name a flexible array Pierre-Eric Pelloux-Prayer
2024-09-27 8:48 ` [PATCH v4 6/6] drm/amdgpu: use drm_file::name in task_info::process_desc Pierre-Eric Pelloux-Prayer
2024-09-30 9:24 ` Tvrtko Ursulin
2024-09-27 9:07 ` [PATCH v4 0/6] DRM_SET_CLIENT_NAME ioctl Christian König
2024-09-27 9:16 ` Jani Nikula
2024-09-28 12:34 ` Dmitry Osipenko
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=20240927084848.263718-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=dmitry.osipenko@collabora.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