[PATCH] drm/xe/xe_tracer: Align fence output format in ftrace log
Lucas De Marchi
lucas.demarchi at intel.com
Wed Mar 13 02:24:24 UTC 2024
On Wed, Mar 13, 2024 at 01:49:15AM +0000, Shuicheng Lin wrote:
>The fence print in xe_gt_tlb_invalidation_fence and xe_hw_fence
>is with "%p", change fence print in xe_sched_job to "%p" also.
ack
>Add the "0x" prefix as the "%p" is with hex format.
nack.
$ git grep -c %p -- drivers/gpu/drm/xe/xe_trace.h
drivers/gpu/drm/xe/xe_trace.h:6
$ git grep -c 0x%p -- drivers/gpu/drm/xe/xe_trace.h
$
even if you change those below, you are not changing all. Let's keep %p.
considering the whole kernel, most places don't bother with
the 0x neither.
$ git grep -c "%p" | cut -d: -f2 | paste -s -d+ |bc
22288
$ git grep -c "0x%p" | cut -d: -f2 | paste -s -d+ |bc
1727
for numbers, rather than addresses, it's more 50/50:
$ git grep -c "%x" | cut -d: -f2 | paste -s -d+ |bc
33209
$ git grep -c "0x%x" | cut -d: -f2 | paste -s -d+ |bc
16502
Lucas De Marchi
>
>Cc: De Marchi, Lucas <lucas.demarchi at intel.com>
>Signed-off-by: Shuicheng Lin <shuicheng.lin at intel.com>
>---
> drivers/gpu/drm/xe/xe_trace.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_trace.h b/drivers/gpu/drm/xe/xe_trace.h
>index 4ddc55527f9a..9214c6add766 100644
>--- a/drivers/gpu/drm/xe/xe_trace.h
>+++ b/drivers/gpu/drm/xe/xe_trace.h
>@@ -36,7 +36,7 @@ DECLARE_EVENT_CLASS(xe_gt_tlb_invalidation_fence,
> __entry->seqno = fence->seqno;
> ),
>
>- TP_printk("fence=%p, seqno=%d",
>+ TP_printk("fence=0x%p, seqno=%d",
> __entry->fence, __entry->seqno)
> );
>
>@@ -258,7 +258,7 @@ DECLARE_EVENT_CLASS(xe_sched_job,
> __field(u32, guc_state)
> __field(u32, flags)
> __field(int, error)
>- __field(u64, fence)
>+ __field(struct dma_fence *, fence)
> __field(u64, batch_addr)
> ),
>
>@@ -269,11 +269,11 @@ DECLARE_EVENT_CLASS(xe_sched_job,
> atomic_read(&job->q->guc->state);
> __entry->flags = job->q->flags;
> __entry->error = job->fence->error;
>- __entry->fence = (unsigned long)job->fence;
>+ __entry->fence = job->fence;
> __entry->batch_addr = (u64)job->batch_addr[0];
> ),
>
>- TP_printk("fence=0x%016llx, seqno=%u, guc_id=%d, batch_addr=0x%012llx, guc_state=0x%x, flags=0x%x, error=%d",
>+ TP_printk("fence=0x%p, seqno=%u, guc_id=%d, batch_addr=0x%012llx, guc_state=0x%x, flags=0x%x, error=%d",
> __entry->fence, __entry->seqno, __entry->guc_id,
> __entry->batch_addr, __entry->guc_state,
> __entry->flags, __entry->error)
>@@ -359,7 +359,7 @@ DECLARE_EVENT_CLASS(xe_hw_fence,
> __entry->fence = fence;
> ),
>
>- TP_printk("ctx=0x%016llx, fence=%p, seqno=%u",
>+ TP_printk("ctx=0x%016llx, fence=0x%p, seqno=%u",
> __entry->ctx, __entry->fence, __entry->seqno)
> );
>
>--
>2.25.1
>
More information about the Intel-xe
mailing list