Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Matt Roper" <matthew.d.roper@intel.com>,
	"Priyanka Dandamudi" <priyanka.dandamudi@intel.com>,
	"Oak Zeng" <oak.zeng@intel.com>
Subject: Re: [PATCH] drm/xe: Use pointers in trace events
Date: Thu, 22 Feb 2024 17:12:11 +0100	[thread overview]
Message-ID: <b27b522576d493cac238b7f68e29ee569eec9a2c.camel@linux.intel.com> (raw)
In-Reply-To: <20240222144125.2862546-1-lucas.demarchi@intel.com>

On Thu, 2024-02-22 at 06:41 -0800, Lucas De Marchi wrote:
> Commit a0df2cc858c3 ("drm/xe/xe_bo_move: Enhance xe_bo_move trace")
> inadvertently reverted commit 8d038f49c1f3 ("drm/xe: Fix cast on
> trace
> variable"), breaking the build on 32bits.
> 
> As noted by Ville, there's no point in converting the pointers to u64
> and add casts everywhere. In fact, it's better to just use %p and let
> the address be hashed. Convert all the cases in xe_trace.h to use
> pointers.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> Cc: Oak Zeng <oak.zeng@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

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


> ---
>  drivers/gpu/drm/xe/xe_trace.h | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_trace.h
> b/drivers/gpu/drm/xe/xe_trace.h
> index 0cce98a6b14b7..3b97633d81d85 100644
> --- a/drivers/gpu/drm/xe/xe_trace.h
> +++ b/drivers/gpu/drm/xe/xe_trace.h
> @@ -27,16 +27,16 @@ DECLARE_EVENT_CLASS(xe_gt_tlb_invalidation_fence,
>  		    TP_ARGS(fence),
>  
>  		    TP_STRUCT__entry(
> -			     __field(u64, fence)
> +			     __field(struct
> xe_gt_tlb_invalidation_fence *, fence)
>  			     __field(int, seqno)
>  			     ),
>  
>  		    TP_fast_assign(
> -			   __entry->fence = (u64)fence;
> +			   __entry->fence = fence;
>  			   __entry->seqno = fence->seqno;
>  			   ),
>  
> -		    TP_printk("fence=0x%016llx, seqno=%d",
> +		    TP_printk("fence=%p, seqno=%d",
>  			      __entry->fence, __entry->seqno)
>  );
>  
> @@ -83,16 +83,16 @@ DECLARE_EVENT_CLASS(xe_bo,
>  		    TP_STRUCT__entry(
>  			     __field(size_t, size)
>  			     __field(u32, flags)
> -			     __field(u64, vm)
> +			     __field(struct xe_vm *, vm)
>  			     ),
>  
>  		    TP_fast_assign(
>  			   __entry->size = bo->size;
>  			   __entry->flags = bo->flags;
> -			   __entry->vm = (unsigned long)bo->vm;
> +			   __entry->vm = bo->vm;
>  			   ),
>  
> -		    TP_printk("size=%zu, flags=0x%02x,
> vm=0x%016llx",
> +		    TP_printk("size=%zu, flags=0x%02x, vm=%p",
>  			      __entry->size, __entry->flags,
> __entry->vm)
>  );
>  
> @@ -346,16 +346,16 @@ DECLARE_EVENT_CLASS(xe_hw_fence,
>  		    TP_STRUCT__entry(
>  			     __field(u64, ctx)
>  			     __field(u32, seqno)
> -			     __field(u64, fence)
> +			     __field(struct xe_hw_fence *, fence)
>  			     ),
>  
>  		    TP_fast_assign(
>  			   __entry->ctx = fence->dma.context;
>  			   __entry->seqno = fence->dma.seqno;
> -			   __entry->fence = (unsigned long)fence;
> +			   __entry->fence = fence;
>  			   ),
>  
> -		    TP_printk("ctx=0x%016llx, fence=0x%016llx,
> seqno=%u",
> +		    TP_printk("ctx=0x%016llx, fence=%p, seqno=%u",
>  			      __entry->ctx, __entry->fence, __entry-
> >seqno)
>  );
>  
> @@ -384,7 +384,7 @@ DECLARE_EVENT_CLASS(xe_vma,
>  		    TP_ARGS(vma),
>  
>  		    TP_STRUCT__entry(
> -			     __field(u64, vma)
> +			     __field(struct xe_vma *, vma)
>  			     __field(u32, asid)
>  			     __field(u64, start)
>  			     __field(u64, end)
> @@ -392,14 +392,14 @@ DECLARE_EVENT_CLASS(xe_vma,
>  			     ),
>  
>  		    TP_fast_assign(
> -			   __entry->vma = (unsigned long)vma;
> +			   __entry->vma = vma;
>  			   __entry->asid = xe_vma_vm(vma)->usm.asid;
>  			   __entry->start = xe_vma_start(vma);
>  			   __entry->end = xe_vma_end(vma) - 1;
>  			   __entry->ptr = xe_vma_userptr(vma);
>  			   ),
>  
> -		    TP_printk("vma=0x%016llx, asid=0x%05x,
> start=0x%012llx, end=0x%012llx, ptr=0x%012llx,",
> +		    TP_printk("vma=%p, asid=0x%05x, start=0x%012llx,
> end=0x%012llx, userptr=0x%012llx,",
>  			      __entry->vma, __entry->asid, __entry-
> >start,
>  			      __entry->end, __entry->ptr)
>  )
> @@ -484,16 +484,16 @@ DECLARE_EVENT_CLASS(xe_vm,
>  		    TP_ARGS(vm),
>  
>  		    TP_STRUCT__entry(
> -			     __field(u64, vm)
> +			     __field(struct xe_vm *, vm)
>  			     __field(u32, asid)
>  			     ),
>  
>  		    TP_fast_assign(
> -			   __entry->vm = (unsigned long)vm;
> +			   __entry->vm = vm;
>  			   __entry->asid = vm->usm.asid;
>  			   ),
>  
> -		    TP_printk("vm=0x%016llx, asid=0x%05x",  __entry-
> >vm,
> +		    TP_printk("vm=%p, asid=0x%05x",  __entry->vm,
>  			      __entry->asid)
>  );
>  


  parent reply	other threads:[~2024-02-22 16:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 14:41 [PATCH] drm/xe: Use pointers in trace events Lucas De Marchi
2024-02-22 14:52 ` ✓ CI.Patch_applied: success for " Patchwork
2024-02-22 14:53 ` ✓ CI.checkpatch: " Patchwork
2024-02-22 14:53 ` ✓ CI.KUnit: " Patchwork
2024-02-22 15:04 ` ✓ CI.Build: " Patchwork
2024-02-22 15:05 ` ✓ CI.Hooks: " Patchwork
2024-02-22 15:06 ` ✓ CI.checksparse: " Patchwork
2024-02-22 15:25 ` ✓ CI.BAT: " Patchwork
2024-02-22 16:12 ` Thomas Hellström [this message]
2024-02-22 22:25   ` Re: [PATCH] " Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b27b522576d493cac238b7f68e29ee569eec9a2c.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=oak.zeng@intel.com \
    --cc=priyanka.dandamudi@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox