[PATCH] drm/amd/sched: print sched job id in amd_sched_job trace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2017-06-13 04:14 PM, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
> 
> This makes it easier to correlate amd_sched_job with with other trace
> points that don't log the job pointer.
> 
> Signed-off-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
>   drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h b/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
> index dbd4fd3a..09c4230 100644
> --- a/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
> +++ b/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
> @@ -12,36 +12,39 @@
>   #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)


Change looks good. One minor suggestion would be to get rid of the 
sched_job pointer altogether.

Since we have an id the sched_job* becomes superfluous, and it can lead 
to confusion if we hit the pointer re-use case. I think this is also the 
only trace that still prints the pointer, so it isn't actually very 
useful in the first place.

With that change you can add:
Reviewed-by: Andres Rodriguez <andresx7 at gmail.com>

Regards,
Andres


>   			     __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, sched job=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d",
> +		      __entry->entity, __entry->sched_job, __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)
>   		    ),
>   
> 


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux