]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/guc: Add trace point for GuC submit
authorMatthew Brost <matthew.brost@intel.com>
Wed, 21 Jul 2021 21:51:00 +0000 (14:51 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Thu, 22 Jul 2021 17:07:29 +0000 (10:07 -0700)
Add trace point for GuC submit. Extended existing request trace points
to include submit fence value,, guc_id, and ring tail value.

v2: Fix white space alignment in i915_request_add trace point
v3: Delete dep_from , dep_to (Tvrtko)

Cc: John Harrison <john.c.harrison@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210721215101.139794-18-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/i915/i915_trace.h

index e6e5364beb1c45fe4bbdd36dbf95d20dda9316bf..d47a8358c831395b06d9bf5a8e4f0f98f4f0711a 100644 (file)
@@ -418,6 +418,7 @@ resubmit:
                        guc->stalled_request = last;
                        return false;
                }
+               trace_i915_request_guc_submit(last);
        }
 
        guc->stalled_request = NULL;
@@ -638,6 +639,8 @@ static int guc_bypass_tasklet_submit(struct intel_guc *guc,
        ret = guc_add_request(guc, rq);
        if (ret == -EBUSY)
                guc->stalled_request = rq;
+       else
+               trace_i915_request_guc_submit(rq);
 
        return ret;
 }
index 6778ad2a14a406bc900030d2e318aa70685f2ec3..478f5427531d9dfda2fa6fe63c1c8a8e8427b85a 100644 (file)
@@ -794,30 +794,40 @@ DECLARE_EVENT_CLASS(i915_request,
            TP_STRUCT__entry(
                             __field(u32, dev)
                             __field(u64, ctx)
+                            __field(u32, guc_id)
                             __field(u16, class)
                             __field(u16, instance)
                             __field(u32, seqno)
+                            __field(u32, tail)
                             ),
 
            TP_fast_assign(
                           __entry->dev = rq->engine->i915->drm.primary->index;
                           __entry->class = rq->engine->uabi_class;
                           __entry->instance = rq->engine->uabi_instance;
+                          __entry->guc_id = rq->context->guc_id;
                           __entry->ctx = rq->fence.context;
                           __entry->seqno = rq->fence.seqno;
+                          __entry->tail = rq->tail;
                           ),
 
-           TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u",
+           TP_printk("dev=%u, engine=%u:%u, guc_id=%u, ctx=%llu, seqno=%u, tail=%u",
                      __entry->dev, __entry->class, __entry->instance,
-                     __entry->ctx, __entry->seqno)
+                     __entry->guc_id, __entry->ctx, __entry->seqno,
+                     __entry->tail)
 );
 
 DEFINE_EVENT(i915_request, i915_request_add,
-           TP_PROTO(struct i915_request *rq),
-           TP_ARGS(rq)
+            TP_PROTO(struct i915_request *rq),
+            TP_ARGS(rq)
 );
 
 #if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
+DEFINE_EVENT(i915_request, i915_request_guc_submit,
+            TP_PROTO(struct i915_request *rq),
+            TP_ARGS(rq)
+);
+
 DEFINE_EVENT(i915_request, i915_request_submit,
             TP_PROTO(struct i915_request *rq),
             TP_ARGS(rq)
@@ -887,6 +897,11 @@ TRACE_EVENT(i915_request_out,
 
 #else
 #if !defined(TRACE_HEADER_MULTI_READ)
+static inline void
+trace_i915_request_guc_submit(struct i915_request *rq)
+{
+}
+
 static inline void
 trace_i915_request_submit(struct i915_request *rq)
 {