Skip to contentSkip to conversation

drm/amdgpu: Print caller in amdgpu_userq_state_changed tracepoint

PATCH In review Prike Liang 1 participant 2 messages Aug 26 – Aug 28

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

PATCH 1/1 drm/amdgpu: Print caller in amdgpu_userq_state_changed tracepoint

Since amdgpu_userq_state_changed() is invoked across multiple state transition paths in the userq lifecycle (e.g., creation, eviction, restore, and destroy), logging the caller makes it significantly easier to trace the exact call sequence when debugging ftrace outputs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +5 -2
index 5324030a13f5..569e1e38704c 100644
@@ -721,15 +721,18 @@ TRACE_EVENT(amdgpu_userq_state_changed,
 			     __field(u64, client_id)
 			     __field(u32, queue_type)
 			     __field(u32, to)
+			     __field(void *, caller)
 			     ),
 	    TP_fast_assign(
 			   __entry->doorbell_index = queue->doorbell_index;
 			   __entry->queue_type = queue->queue_type;
 			   __entry->client_id = queue->userq_mgr->file->client_id;
 			   __entry->to = new_state;
+			   __entry->caller = (void *)_RET_IP_;
 			   ),
-	    TP_printk("client_id=%llu, type=%u, doorbell=%llu, to=%d",
-		      __entry->client_id, __entry->queue_type, __entry->doorbell_index, __entry->to)
+	    TP_printk("client_id=%llu, type=%u, doorbell=%llu, to=%d caller:%pS",
+		      __entry->client_id, __entry->queue_type, __entry->doorbell_index,
+		      __entry->to, __entry->caller)
 );
 
 #undef AMDGPU_JOB_GET_TIMELINE_NAME
Signature · 1 line
2.34.1
#1 lore raw

AMD General

Since the caller can be collected by stacktrace trigger and further parsed by tool lib, so drop this change.

Regards,
Prike

Quoted 50 lines

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Wednesday, August 26, 2026 2:17 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pelloux-Prayer, Pierre-Eric <Pierre-eric.Pelloux- [email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] drm/amdgpu: Print caller in amdgpu_userq_state_changed tracepoint

Since amdgpu_userq_state_changed() is invoked across multiple state transition paths in the userq lifecycle (e.g., creation, eviction, restore, and destroy), logging the caller makes it significantly easier to trace the exact call sequence when debugging ftrace outputs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +5 -2
index 5324030a13f5..569e1e38704c 100644
@@ -721,15 +721,18 @@ TRACE_EVENT(amdgpu_userq_state_changed,
                           __field(u64, client_id)
                           __field(u32, queue_type)
                           __field(u32, to)
+                          __field(void *, caller)
                           ),
          TP_fast_assign(
                         __entry->doorbell_index = queue->doorbell_index;
                         __entry->queue_type = queue->queue_type;
                         __entry->client_id = queue->userq_mgr->file->client_id;
                         __entry->to = new_state;
+                        __entry->caller = (void *)_RET_IP_;
                         ),
-         TP_printk("client_id=%llu, type=%u, doorbell=%llu, to=%d",
-                   __entry->client_id, __entry->queue_type, __entry-
 >doorbell_index, __entry->to)
+         TP_printk("client_id=%llu, type=%u, doorbell=%llu, to=%d caller:%pS",
+                   __entry->client_id, __entry->queue_type, __entry-
 >doorbell_index,
+                   __entry->to, __entry->caller)
 );

#undef AMDGPU_JOB_GET_TIMELINE_NAME
--
2.34.1