[PATCH] drm/xe/xe_trace: Add move_lacks_source detail to xe_bo_move trace

Thomas Hellström thomas.hellstrom at linux.intel.com
Wed Feb 28 10:38:28 UTC 2024


On Wed, 2024-02-21 at 15:49 +0530, priyanka.dandamudi at intel.com wrote:
> From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> 
> Add move_lacks_source detail to xe_bo_move trace to make it readable
> that is to check if it is migrate clear or migrate copy.
> 
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>

> ---
>  drivers/gpu/drm/xe/xe_bo.c    |  2 +-
>  drivers/gpu/drm/xe/xe_trace.h | 12 ++++++++----
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 76dfaf1cd200..6603a0ea79c5 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -736,7 +736,7 @@ static int xe_bo_move(struct ttm_buffer_object
> *ttm_bo, bool evict,
>  		migrate = xe->tiles[0].migrate;
>  
>  	xe_assert(xe, migrate);
> -	trace_xe_bo_move(bo, new_mem->mem_type, old_mem_type);
> +	trace_xe_bo_move(bo, new_mem->mem_type, old_mem_type,
> move_lacks_source);
>  	xe_device_mem_access_get(xe);
>  
>  	if (xe_bo_is_pinned(bo) && !xe_bo_is_user(bo)) {
> diff --git a/drivers/gpu/drm/xe/xe_trace.h
> b/drivers/gpu/drm/xe/xe_trace.h
> index 0cce98a6b14b..485d1ecacc36 100644
> --- a/drivers/gpu/drm/xe/xe_trace.h
> +++ b/drivers/gpu/drm/xe/xe_trace.h
> @@ -102,14 +102,16 @@ DEFINE_EVENT(xe_bo, xe_bo_cpu_fault,
>  );
>  
>  TRACE_EVENT(xe_bo_move,
> -	    TP_PROTO(struct xe_bo *bo, uint32_t new_placement,
> uint32_t old_placement),
> -	    TP_ARGS(bo, new_placement, old_placement),
> +	    TP_PROTO(struct xe_bo *bo, uint32_t new_placement,
> uint32_t old_placement,
> +		     bool move_lacks_source),
> +	    TP_ARGS(bo, new_placement, old_placement,
> move_lacks_source),
>  	    TP_STRUCT__entry(
>  		     __field(struct xe_bo *, bo)
>  		     __field(size_t, size)
>  		     __field(u32, new_placement)
>  		     __field(u32, old_placement)
>  		     __array(char, device_id, 12)
> +		     __field(bool, move_lacks_source)
>  			),
>  
>  	    TP_fast_assign(
> @@ -118,9 +120,11 @@ TRACE_EVENT(xe_bo_move,
>  		   __entry->new_placement = new_placement;
>  		   __entry->old_placement = old_placement;
>  		   strscpy(__entry->device_id,
> dev_name(xe_bo_device(__entry->bo)->drm.dev), 12);
> +		   __entry->move_lacks_source = move_lacks_source;
>  		   ),
> -	    TP_printk("migrate object %p [size %zu] from %s to %s
> device_id:%s",
> -		      __entry->bo, __entry->size,
> xe_mem_type_to_name[__entry->old_placement],
> +	    TP_printk("move_lacks_source:%s, migrate object %p [size
> %zu] from %s to %s device_id:%s",
> +		      __entry->move_lacks_source ? "yes" : "no",
> __entry->bo, __entry->size,
> +		      xe_mem_type_to_name[__entry->old_placement],
>  		      xe_mem_type_to_name[__entry->new_placement],
> __entry->device_id)
>  );
>  



More information about the Intel-xe mailing list