mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: "Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v9 01/10] drm/debugfs: output client_id in in drm_clients_info
Date: Thu, 24 Apr 2025 10:38:13 +0200	[thread overview]
Message-ID: <20250424083834.15518-2-pierre-eric.pelloux-prayer@amd.com> (raw)
In-Reply-To: <20250424083834.15518-1-pierre-eric.pelloux-prayer@amd.com>

client_id is a unique id used by fdinfo. Having it listed in 'clients'
output means a userspace application can correlate the fields, eg:
given a fdinfo id get the fdinfo name.

Geiven that client_id is a uint64_t, we use a %20llu printf format to
keep the output aligned (20 = digit count of the biggest uint64_t).

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
---
 drivers/gpu/drm/drm_debugfs.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 3dfd8b34dceb..abceb28b23fc 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -77,14 +77,15 @@ static int drm_clients_info(struct seq_file *m, void *data)
 	kuid_t uid;
 
 	seq_printf(m,
-		   "%20s %5s %3s master a %5s %10s %*s\n",
+		   "%20s %5s %3s master a %5s %10s %*s %20s\n",
 		   "command",
 		   "tgid",
 		   "dev",
 		   "uid",
 		   "magic",
 		   DRM_CLIENT_NAME_MAX_LEN,
-		   "name");
+		   "name",
+		   "id");
 
 	/* dev->filelist is sorted youngest first, but we want to present
 	 * oldest first (i.e. kernel, servers, clients), so walk backwardss.
@@ -100,7 +101,7 @@ static int drm_clients_info(struct seq_file *m, void *data)
 		pid = rcu_dereference(priv->pid);
 		task = pid_task(pid, PIDTYPE_TGID);
 		uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID;
-		seq_printf(m, "%20s %5d %3d   %c    %c %5d %10u %*s\n",
+		seq_printf(m, "%20s %5d %3d   %c    %c %5d %10u %*s %20llu\n",
 			   task ? task->comm : "<unknown>",
 			   pid_vnr(pid),
 			   priv->minor->index,
@@ -109,7 +110,8 @@ static int drm_clients_info(struct seq_file *m, void *data)
 			   from_kuid_munged(seq_user_ns(m), uid),
 			   priv->magic,
 			   DRM_CLIENT_NAME_MAX_LEN,
-			   priv->client_name ? priv->client_name : "<unset>");
+			   priv->client_name ? priv->client_name : "<unset>",
+			   priv->client_id);
 		rcu_read_unlock();
 		mutex_unlock(&priv->client_name_lock);
 	}
-- 
2.43.0


  reply	other threads:[~2025-04-24  8:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24  8:38 [PATCH v9 00/10] Improve gpu_scheduler trace events + UAPI Pierre-Eric Pelloux-Prayer
2025-04-24  8:38 ` Pierre-Eric Pelloux-Prayer [this message]
2025-04-24  8:38 ` [PATCH v9 02/10] drm/sched: store the drm client_id in drm_sched_fence Pierre-Eric Pelloux-Prayer
2025-05-14 12:44   ` Philipp Stanner
2025-05-15  6:53     ` Pierre-Eric Pelloux-Prayer
2025-05-19 11:02       ` Pierre-Eric Pelloux-Prayer
2025-05-19 11:59         ` Philipp Stanner
2025-04-24  8:38 ` [PATCH v9 03/10] drm/sched: add device name to the drm_sched_process_job event Pierre-Eric Pelloux-Prayer
2025-05-19 15:34   ` Danilo Krummrich
2025-05-20 16:56     ` Pierre-Eric Pelloux-Prayer
2025-04-24  8:38 ` [PATCH v9 04/10] drm/sched: cleanup gpu_scheduler trace events Pierre-Eric Pelloux-Prayer
2025-04-24  8:38 ` [PATCH v9 05/10] drm/sched: trace dependencies for gpu jobs Pierre-Eric Pelloux-Prayer
2025-05-14 12:46   ` Philipp Stanner
2025-04-24  8:38 ` [PATCH v9 06/10] drm/sched: add the drm_client_id to the drm_sched_run/exec_job events Pierre-Eric Pelloux-Prayer
2025-04-24  8:38 ` [PATCH v9 07/10] drm/sched: cleanup event names Pierre-Eric Pelloux-Prayer
2025-04-24  8:38 ` [PATCH v9 08/10] drm: get rid of drm_sched_job::id Pierre-Eric Pelloux-Prayer
2025-04-25  5:26   ` Yadav, Arvind
2025-05-14 12:50   ` Philipp Stanner
2025-04-24  8:38 ` [PATCH v9 09/10] drm/doc: document some tracepoints as uAPI Pierre-Eric Pelloux-Prayer
2025-05-14 12:53   ` Philipp Stanner
2025-05-16  7:56     ` Pierre-Eric Pelloux-Prayer
2025-04-24  8:38 ` [PATCH v9 10/10] drm/amdgpu: update trace format to match gpu_scheduler_trace Pierre-Eric Pelloux-Prayer
2025-04-25  5:31   ` Yadav, Arvind
2025-05-14 12:25 ` [PATCH v9 00/10] Improve gpu_scheduler trace events + UAPI Pierre-Eric Pelloux-Prayer

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=20250424083834.15518-2-pierre-eric.pelloux-prayer@amd.com \
    --to=pierre-eric.pelloux-prayer@amd.com \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®