Skip to contentSkip to conversation

drm/amd/sched: print sched job id in amd_sched_job trace

PATCH In review Nicolai Hähnle 2 participants 2 messages Jun 27, 2017 1 message not in the archive

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

PATCH v2 1/1 drm/amd/sched: print sched job id in amd_sched_job trace

From: Nicolai Hähnle <[email protected]>

This makes it easier to correlate amd_sched_job with with other trace points that don't log the job pointer.

v2: don't print the sched_job pointer (Andres)

---
 drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h +5 -4
index dbd4fd3a..8bd3810 100644
@@ -9,39 +9,40 @@
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM gpu_sched
 #define TRACE_INCLUDE_FILE gpu_sched_trace
 
 TRACE_EVENT(amd_sched_job,
 	    TP_PROTO(struct amd_sched_job *sched_job),
 	    TP_ARGS(sched_job),
 	    TP_STRUCT__entry(
 			     __field(struct amd_sched_entity *, entity)
-			     __field(struct amd_sched_job *, sched_job)
 			     __field(struct dma_fence *, fence)
 			     __field(const char *, name)
+			     __field(uint64_t, id)
 			     __field(u32, job_count)
 			     __field(int, hw_job_count)
 			     ),
 
 	    TP_fast_assign(
 			   __entry->entity = sched_job->s_entity;
-			   __entry->sched_job = sched_job;
+			   __entry->id = sched_job->id;
 			   __entry->fence = &sched_job->s_fence->finished;
 			   __entry->name = sched_job->sched->name;
 			   __entry->job_count = kfifo_len(
 				   &sched_job->s_entity->job_queue) / sizeof(sched_job);
 			   __entry->hw_job_count = atomic_read(
 				   &sched_job->sched->hw_rq_count);
 			   ),
-	    TP_printk("entity=%p, sched job=%p, fence=%p, ring=%s, job count:%u, hw job count:%d",
-		      __entry->entity, __entry->sched_job, __entry->fence, __entry->name,
+	    TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d",
+		      __entry->entity, __entry->id,
+		      __entry->fence, __entry->name,
 		      __entry->job_count, __entry->hw_job_count)
 );
 
 TRACE_EVENT(amd_sched_process_job,
 	    TP_PROTO(struct amd_sched_fence *fence),
 	    TP_ARGS(fence),
 	    TP_STRUCT__entry(
 		    __field(struct dma_fence *, fence)
 		    ),
 
Signature · 6 lines
2.9.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170627084939.365-1-nhaehnle-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reviewed-by
#2 lore raw

Am 27.06.2017 um 10:49 schrieb Nicolai Hähnle:

Quoted 9 lines

From: Nicolai Hähnle <[email protected]>

This makes it easier to correlate amd_sched_job with with other trace points that don't log the job pointer.

v2: don't print the sched_job pointer (Andres)

Quoted 43 lines
---
  drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h +5 -4
index dbd4fd3a..8bd3810 100644
@@ -9,39 +9,40 @@
 
  #undef TRACE_SYSTEM
  #define TRACE_SYSTEM gpu_sched
  #define TRACE_INCLUDE_FILE gpu_sched_trace
 
  TRACE_EVENT(amd_sched_job,
  	    TP_PROTO(struct amd_sched_job *sched_job),
  	    TP_ARGS(sched_job),
  	    TP_STRUCT__entry(
  			     __field(struct amd_sched_entity *, entity)
-			     __field(struct amd_sched_job *, sched_job)
  			     __field(struct dma_fence *, fence)
  			     __field(const char *, name)
+			     __field(uint64_t, id)
  			     __field(u32, job_count)
  			     __field(int, hw_job_count)
  			     ),
 
  	    TP_fast_assign(
  			   __entry->entity = sched_job->s_entity;
-			   __entry->sched_job = sched_job;
+			   __entry->id = sched_job->id;
  			   __entry->fence = &sched_job->s_fence->finished;
  			   __entry->name = sched_job->sched->name;
  			   __entry->job_count = kfifo_len(
  				   &sched_job->s_entity->job_queue) / sizeof(sched_job);
  			   __entry->hw_job_count = atomic_read(
  				   &sched_job->sched->hw_rq_count);
  			   ),
-	    TP_printk("entity=%p, sched job=%p, fence=%p, ring=%s, job count:%u, hw job count:%d",
-		      __entry->entity, __entry->sched_job, __entry->fence, __entry->name,
+	    TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d",
+		      __entry->entity, __entry->id,
+		      __entry->fence, __entry->name,

drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h line 48

Quoted 10 lines
drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h +0 -0
  		      __entry->job_count, __entry->hw_job_count)
  );
 
  TRACE_EVENT(amd_sched_process_job,
  	    TP_PROTO(struct amd_sched_fence *fence),
  	    TP_ARGS(fence),
  	    TP_STRUCT__entry(
  		    __field(struct dma_fence *, fence)
  		    ),
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx