Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Use pointers in trace events

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>
Link: https://patchwork.freedesktop.org/patch/msgid/20240222144125.2862546-1-lucas.demarchi@intel.com
(cherry picked from commit 7a975748d4dc0a524c99a390c6f74b7097ef8cf7)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

authored by

Lucas De Marchi and committed by
Thomas Hellström
4ca5c829 a09946a9

+15 -15
+15 -15
drivers/gpu/drm/xe/xe_trace.h
··· 27 27 TP_ARGS(fence), 28 28 29 29 TP_STRUCT__entry( 30 - __field(u64, fence) 30 + __field(struct xe_gt_tlb_invalidation_fence *, fence) 31 31 __field(int, seqno) 32 32 ), 33 33 34 34 TP_fast_assign( 35 - __entry->fence = (u64)fence; 35 + __entry->fence = fence; 36 36 __entry->seqno = fence->seqno; 37 37 ), 38 38 39 - TP_printk("fence=0x%016llx, seqno=%d", 39 + TP_printk("fence=%p, seqno=%d", 40 40 __entry->fence, __entry->seqno) 41 41 ); 42 42 ··· 83 83 TP_STRUCT__entry( 84 84 __field(size_t, size) 85 85 __field(u32, flags) 86 - __field(u64, vm) 86 + __field(struct xe_vm *, vm) 87 87 ), 88 88 89 89 TP_fast_assign( 90 90 __entry->size = bo->size; 91 91 __entry->flags = bo->flags; 92 - __entry->vm = (unsigned long)bo->vm; 92 + __entry->vm = bo->vm; 93 93 ), 94 94 95 - TP_printk("size=%zu, flags=0x%02x, vm=0x%016llx", 95 + TP_printk("size=%zu, flags=0x%02x, vm=%p", 96 96 __entry->size, __entry->flags, __entry->vm) 97 97 ); 98 98 ··· 346 346 TP_STRUCT__entry( 347 347 __field(u64, ctx) 348 348 __field(u32, seqno) 349 - __field(u64, fence) 349 + __field(struct xe_hw_fence *, fence) 350 350 ), 351 351 352 352 TP_fast_assign( 353 353 __entry->ctx = fence->dma.context; 354 354 __entry->seqno = fence->dma.seqno; 355 - __entry->fence = (unsigned long)fence; 355 + __entry->fence = fence; 356 356 ), 357 357 358 - TP_printk("ctx=0x%016llx, fence=0x%016llx, seqno=%u", 358 + TP_printk("ctx=0x%016llx, fence=%p, seqno=%u", 359 359 __entry->ctx, __entry->fence, __entry->seqno) 360 360 ); 361 361 ··· 384 384 TP_ARGS(vma), 385 385 386 386 TP_STRUCT__entry( 387 - __field(u64, vma) 387 + __field(struct xe_vma *, vma) 388 388 __field(u32, asid) 389 389 __field(u64, start) 390 390 __field(u64, end) ··· 392 392 ), 393 393 394 394 TP_fast_assign( 395 - __entry->vma = (unsigned long)vma; 395 + __entry->vma = vma; 396 396 __entry->asid = xe_vma_vm(vma)->usm.asid; 397 397 __entry->start = xe_vma_start(vma); 398 398 __entry->end = xe_vma_end(vma) - 1; 399 399 __entry->ptr = xe_vma_userptr(vma); 400 400 ), 401 401 402 - TP_printk("vma=0x%016llx, asid=0x%05x, start=0x%012llx, end=0x%012llx, ptr=0x%012llx,", 402 + TP_printk("vma=%p, asid=0x%05x, start=0x%012llx, end=0x%012llx, userptr=0x%012llx,", 403 403 __entry->vma, __entry->asid, __entry->start, 404 404 __entry->end, __entry->ptr) 405 405 ) ··· 484 484 TP_ARGS(vm), 485 485 486 486 TP_STRUCT__entry( 487 - __field(u64, vm) 487 + __field(struct xe_vm *, vm) 488 488 __field(u32, asid) 489 489 ), 490 490 491 491 TP_fast_assign( 492 - __entry->vm = (unsigned long)vm; 492 + __entry->vm = vm; 493 493 __entry->asid = vm->usm.asid; 494 494 ), 495 495 496 - TP_printk("vm=0x%016llx, asid=0x%05x", __entry->vm, 496 + TP_printk("vm=%p, asid=0x%05x", __entry->vm, 497 497 __entry->asid) 498 498 ); 499 499