drm/i915/execlists: Log fence context & seqno throughout GEM_TRACE
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 6 Apr 2018 12:35:14 +0000 (13:35 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 9 Apr 2018 12:36:47 +0000 (13:36 +0100)
Include fence context and seqno in low level tracing so it is easier to
follow flows of individual requests when things go bad.

Also added tracing on the reset side of things.

v2:
 Chris Wilson:
 * Standardize global_seqno and seqno as global.
 * Include current hws seqno in execlists_cancel_port_requests.

v3:
 * Fix port printk format for all builds.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v2
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180406123514.5809-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/intel_lrc.c

index 629f3e860592a9ddbdadae248a656854af1de76f..9ca9c24b44215c4aeb56cd4e4ddf6fc0c0505e28 100644 (file)
@@ -343,7 +343,7 @@ static void i915_request_retire(struct i915_request *request)
        struct intel_engine_cs *engine = request->engine;
        struct i915_gem_active *active, *next;
 
-       GEM_TRACE("%s fence %llx:%d, global_seqno %d, current %d\n",
+       GEM_TRACE("%s fence %llx:%d, global=%d, current %d\n",
                  engine->name,
                  request->fence.context, request->fence.seqno,
                  request->global_seqno,
@@ -466,7 +466,7 @@ void __i915_request_submit(struct i915_request *request)
        struct intel_engine_cs *engine = request->engine;
        u32 seqno;
 
-       GEM_TRACE("%s fence %llx:%d -> global_seqno %d, current %d\n",
+       GEM_TRACE("%s fence %llx:%d -> global=%d, current %d\n",
                  engine->name,
                  request->fence.context, request->fence.seqno,
                  engine->timeline->seqno + 1,
@@ -516,7 +516,7 @@ void __i915_request_unsubmit(struct i915_request *request)
 {
        struct intel_engine_cs *engine = request->engine;
 
-       GEM_TRACE("%s fence %llx:%d <- global_seqno %d, current %d\n",
+       GEM_TRACE("%s fence %llx:%d <- global=%d, current %d\n",
                  engine->name,
                  request->fence.context, request->fence.seqno,
                  request->global_seqno,
index 3592288e4696eb537604b996bbd461986144e4f7..02b25bf2378a79099ecb0a533150a72adbf31fc5 100644 (file)
@@ -468,10 +468,11 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
                        desc = execlists_update_context(rq);
                        GEM_DEBUG_EXEC(port[n].context_id = upper_32_bits(desc));
 
-                       GEM_TRACE("%s in[%d]:  ctx=%d.%d, seqno=%d (current %d), prio=%d\n",
+                       GEM_TRACE("%s in[%d]:  ctx=%d.%d, global=%d (fence %llx:%d) (current %d), prio=%d\n",
                                  engine->name, n,
                                  port[n].context_id, count,
                                  rq->global_seqno,
+                                 rq->fence.context, rq->fence.seqno,
                                  intel_engine_get_seqno(engine),
                                  rq_prio(rq));
                } else {
@@ -742,6 +743,13 @@ execlists_cancel_port_requests(struct intel_engine_execlists * const execlists)
        while (num_ports-- && port_isset(port)) {
                struct i915_request *rq = port_request(port);
 
+               GEM_TRACE("%s:port%u global=%d (fence %llx:%d), (current %d)\n",
+                         rq->engine->name,
+                         (unsigned int)(port - execlists->port),
+                         rq->global_seqno,
+                         rq->fence.context, rq->fence.seqno,
+                         intel_engine_get_seqno(rq->engine));
+
                GEM_BUG_ON(!execlists->active);
                intel_engine_context_out(rq->engine);
 
@@ -817,7 +825,8 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)
        struct rb_node *rb;
        unsigned long flags;
 
-       GEM_TRACE("%s\n", engine->name);
+       GEM_TRACE("%s current %d\n",
+                 engine->name, intel_engine_get_seqno(engine));
 
        /*
         * Before we call engine->cancel_requests(), we should have exclusive
@@ -1014,10 +1023,12 @@ static void execlists_submission_tasklet(unsigned long data)
                                                        EXECLISTS_ACTIVE_USER));
 
                        rq = port_unpack(port, &count);
-                       GEM_TRACE("%s out[0]: ctx=%d.%d, seqno=%d (current %d), prio=%d\n",
+                       GEM_TRACE("%s out[0]: ctx=%d.%d, global=%d (fence %llx:%d) (current %d), prio=%d\n",
                                  engine->name,
                                  port->context_id, count,
                                  rq ? rq->global_seqno : 0,
+                                 rq ? rq->fence.context : 0,
+                                 rq ? rq->fence.seqno : 0,
                                  intel_engine_get_seqno(engine),
                                  rq ? rq_prio(rq) : 0);
 
@@ -1744,8 +1755,9 @@ static void reset_common_ring(struct intel_engine_cs *engine,
        struct intel_context *ce;
        unsigned long flags;
 
-       GEM_TRACE("%s seqno=%x\n",
-                 engine->name, request ? request->global_seqno : 0);
+       GEM_TRACE("%s request global=%x, current=%d\n",
+                 engine->name, request ? request->global_seqno : 0,
+                 intel_engine_get_seqno(engine));
 
        /* See execlists_cancel_requests() for the irq/spinlock split. */
        local_irq_save(flags);