[PATCH 3/4] drm/amdgpu: trace the scheduler dependent job fence name
Christian König
ckoenig.leichtzumerken at gmail.com
Thu Apr 17 07:35:04 UTC 2025
Am 16.04.25 um 16:16 schrieb Liang, Prike:
> [Public]
>
>> From: Koenig, Christian <Christian.Koenig at amd.com>
>> Sent: Wednesday, April 16, 2025 7:04 PM
>> To: Liang, Prike <Prike.Liang at amd.com>; amd-gfx at lists.freedesktop.org
>> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
>> Subject: Re: [PATCH 3/4] drm/amdgpu: trace the scheduler dependent job fence
>> name
>>
>> Am 16.04.25 um 10:50 schrieb Prike Liang:
>>> This trace will help in tracking the scheduler dependent job fence.
>> Changes for general DRM code need to got o the appropriate mailing list.
> Yes, it should be sent to dri-dev group.
>
>> Apart from that IIRC we intentionally didn't do that. Why should the driver name be
>> relevant here?
> By adding the scheduler-dependent fence name dump, this can help identify which exact fence is depended on by the scheduler job. With this dump, successfully catch the case about the SDMA and GFX kernel queue scheduled jobs that are dependent on the eviction fence when enabling the kq and uq at the same time.
Mhm, I see why you want to make that shortcut but we kind of agreed to identify fences in the scheduler always as context:seqno.
If you then want the driver/timeline names for that you should probably enable the fence trace points as well.
We are trying to reduce the accesses to those names to eventually allow dma_fence destruction independent of the driver module.
Regards,
Christian.
>
>> Regards,
>> Christian.
>>
>>> Signed-off-by: Prike Liang <Prike.Liang at amd.com>
>>> ---
>>> drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 5 ++++-
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
>>> b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
>>> index c75302ca3427..473a2cbbd7bd 100644
>>> --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
>>> +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
>>> @@ -91,6 +91,7 @@ TRACE_EVENT(drm_sched_job_wait_dep,
>>> __field(struct dma_fence *, fence)
>>> __field(uint64_t, ctx)
>>> __field(unsigned, seqno)
>>> + __string(dep_fence_name, fence->ops-
>>> get_driver_name(fence))
>>> ),
>>>
>>> TP_fast_assign(
>>> @@ -99,9 +100,11 @@ TRACE_EVENT(drm_sched_job_wait_dep,
>>> __entry->fence = fence;
>>> __entry->ctx = fence->context;
>>> __entry->seqno = fence->seqno;
>>> + __assign_str(dep_fence_name);
>>> ),
>>> - TP_printk("job ring=%s, id=%llu, depends fence=%p, context=%llu,
>> seq=%u",
>>> + TP_printk("job ring=%s, id=%llu, depends fence(name: %s) addr
>>> +=%p, context=%llu, seq=%u",
>>> __get_str(name), __entry->id,
>>> + __get_str(dep_fence_name),
>>> __entry->fence, __entry->ctx,
>>> __entry->seqno)
>>> );
More information about the amd-gfx
mailing list