]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/sched: Add the drm_client_id to the drm_sched_run/exec_job events
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 26 May 2025 12:54:48 +0000 (14:54 +0200)
committerPhilipp Stanner <phasta@kernel.org>
Wed, 28 May 2025 14:16:12 +0000 (16:16 +0200)
For processes with multiple drm_file instances, the drm_client_id is
the only way to map jobs back to their unique owner.

It's even more useful if drm client_name is set, because now a tool
can map jobs to the client name instead of only having access to
the process name.

Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-7-pierre-eric.pelloux-prayer@amd.com
drivers/gpu/drm/scheduler/gpu_scheduler_trace.h

index 5d9992ad47d374e6dbe4ac9b87c7e5e613bce406..38cdd659a286012f016fa0ebddf8f8ac78e4d5b3 100644 (file)
@@ -43,6 +43,7 @@ DECLARE_EVENT_CLASS(drm_sched_job,
                             __string(dev, dev_name(sched_job->sched->dev))
                             __field(u64, fence_context)
                             __field(u64, fence_seqno)
+                            __field(u64, client_id)
                             ),
 
            TP_fast_assign(
@@ -54,11 +55,12 @@ DECLARE_EVENT_CLASS(drm_sched_job,
                           __assign_str(dev);
                           __entry->fence_context = sched_job->s_fence->finished.context;
                           __entry->fence_seqno = sched_job->s_fence->finished.seqno;
+                          __entry->client_id = sched_job->s_fence->drm_client_id;
                           ),
-           TP_printk("dev=%s, id=%llu, fence=%llu:%llu, ring=%s, job count:%u, hw job count:%d",
+           TP_printk("dev=%s, id=%llu, fence=%llu:%llu, ring=%s, job count:%u, hw job count:%d, client_id:%llu",
                      __get_str(dev), __entry->id,
                      __entry->fence_context, __entry->fence_seqno, __get_str(name),
-                     __entry->job_count, __entry->hw_job_count)
+                     __entry->job_count, __entry->hw_job_count, __entry->client_id)
 );
 
 DEFINE_EVENT(drm_sched_job, drm_sched_job,