[PATCH] drm/amdgpu: Print caller in amdgpu_userq_state_changed tracepoint

Prike Liang <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <[email protected]>
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.

Signed-off-by: Prike Liang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
index 5324030a13f5..569e1e38704c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
@@ -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.