Skip to contentSkip to conversation

drm/file: add client id to drm_file_error

PATCH In review Sunil Khatri 2 participants 3 messages May 28, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 drm/file: add client id to drm_file_error

Add client id to the drm_file_error api, client id is a unique id for each drm fd and is quite useful for debugging.

---
 drivers/gpu/drm/drm_file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_file.c +4 -2
index dd351f601acd..2f6c0ebe0850 100644
@@ -1011,8 +1011,10 @@ void drm_file_err(struct drm_file *file_priv, const char *fmt, ...)
 	pid = rcu_dereference(file_priv->pid);
 	task = pid_task(pid, PIDTYPE_TGID);
 
-	drm_err(dev, "comm: %s pid: %d client: %s ... %pV", task ? task->comm : "Unset",
-		task ? task->pid : 0, file_priv->client_name ?: "Unset", &vaf);
+	drm_err(dev, "comm: %s pid: %d client: %s client-id:%llu ... %pV",
+		task ? task->comm : "Unset",
+		task ? task->pid : 0, file_priv->client_name ?: "Unset",
+		file_priv->client_id, &vaf);
 
 	va_end(args);
 	rcu_read_unlock();
Signature · 1 line
2.34.1
#1 lore raw
Quoted 14 lines · Sunil Khatri

Add client id to the drm_file_error api, client id is a unique id for each drm fd and is quite useful for debugging.

---
 drivers/gpu/drm/drm_file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_file.c +0 -0
index dd351f601acd..2f6c0ebe0850 100644

drivers/gpu/drm/drm_file.c void drm_file_err(struct drm_file *file_priv, const char *fmt, ...) · line 1017

Quoted 9 lines
drivers/gpu/drm/drm_file.c +4 -2
@@ -1011,8 +1011,10 @@ void drm_file_err(struct drm_file *file_priv, const char *fmt, ...)
 	pid = rcu_dereference(file_priv->pid);
 	task = pid_task(pid, PIDTYPE_TGID);
 
-	drm_err(dev, "comm: %s pid: %d client: %s ... %pV", task ? task->comm : "Unset",
-		task ? task->pid : 0, file_priv->client_name ?: "Unset", &vaf);
+	drm_err(dev, "comm: %s pid: %d client: %s client-id:%llu ... %pV",
+		task ? task->comm : "Unset",
+		task ? task->pid : 0, file_priv->client_name ?: "Unset",
+		file_priv->client_id, &vaf);

Same comment as with the debugfs patch, client-id first and then name I would say.

Apart from that looks good to me.

Regards,
Christian.

Quoted 3 lines
drivers/gpu/drm/drm_file.c +0 -0
 	va_end(args);
 	rcu_read_unlock();
#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, May 28, 2025 4:44 PM
To: Khatri, Sunil <[email protected]>; [email protected]; Tvrtko Ursulin <[email protected]>; [email protected]; Pelloux-Prayer, Pierre-Eric <[email protected]>
Subject: Re: [PATCH 3/3] drm/file: add client id to drm_file_error

Quoted 13 lines · Sunil Khatri

Add client id to the drm_file_error api, client id is a unique id for each drm fd and is quite useful for debugging.

---
 drivers/gpu/drm/drm_file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_file.c +0 -0
index dd351f601acd..2f6c0ebe0850 100644

drivers/gpu/drm/drm_file.c void drm_file_err(struct drm_file *file_priv, const char *fmt, ...) · line 1017

Quoted 9 lines
drivers/gpu/drm/drm_file.c +4 -2
@@ -1011,8 +1011,10 @@ void drm_file_err(struct drm_file *file_priv, const char *fmt, ...)
      pid = rcu_dereference(file_priv->pid);
      task = pid_task(pid, PIDTYPE_TGID);
 
-     drm_err(dev, "comm: %s pid: %d client: %s ... %pV", task ? task->comm : "Unset",
-             task ? task->pid : 0, file_priv->client_name ?: "Unset", &vaf);
+     drm_err(dev, "comm: %s pid: %d client: %s client-id:%llu ... %pV",
+             task ? task->comm : "Unset",
+             task ? task->pid : 0, file_priv->client_name ?: "Unset",
+             file_priv->client_id, &vaf);

Same comment as with the debugfs patch, client-id first and then name I would say. Sure I will update and send a new patch.

Thanks
Sunil

Apart from that looks good to me.

Regards,
Christian.

Quoted 3 lines
drivers/gpu/drm/drm_file.c +0 -0
      va_end(args);
      rcu_read_unlock();