From patchwork Wed Mar 28 17:39:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10313701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A09B60353 for ; Wed, 28 Mar 2018 17:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24BF82A000 for ; Wed, 28 Mar 2018 17:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 233992A032; Wed, 28 Mar 2018 17:40:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6AB92A00D for ; Wed, 28 Mar 2018 17:40:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 674C26E219; Wed, 28 Mar 2018 17:40:12 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE8266E219 for ; Wed, 28 Mar 2018 17:40:10 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id l49so3031539wrl.4 for ; Wed, 28 Mar 2018 10:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=GsTsiNKbqyaxGVs27HAlUQc1KwqLnD7LExEFJdN3z70=; b=pDfm9/s1aXERDRchiN7NNJ4KPTPg8bWs/UmuqUoUVvNsWzmNTX/aRFyF0epIv/Wt+N JZ35syMZki0hhCxtPof2Cx/m//1uasA9evBohJFe6B16WbR3HGLEfEdeBnTzG+BHBR9t 8sUwMw8tP/XKXmelAXbSNp/j3PGOSgUq8ZNd0BiDwOCa6gaIf/GeuRjieasRYezmjyDD HOdQXtCFq5sjdywigg9Mw/ROOOOH3ZwL3wyXUg3Rbwv+vStb27Tk1H0QfNiIgGArGzN4 uoi4dqH2bP18eR2qOQELxb1l4yIU9xOXyohV6tQ1Os5TiJijKQpAKYzFKmCUjVYl7qWK fJ0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GsTsiNKbqyaxGVs27HAlUQc1KwqLnD7LExEFJdN3z70=; b=tHQj4jMqCdO3wVHjT0fO8vyXclYng3eW054obWyEHkKXB3jPbpU14VT855o/Dt+5l+ fvjgWKS99SUq2F0oQ1OaAxGUyveMTqVPIS9lgc6JnGhsddKhL3T8wjuVp2wdROSj2b1I kQ5fcaELApvS5p/P77RK0d4f4gKJMgky+R7olwjECqnYc40SMTOj2DEedBLClXYkNRCO 5eeBHCExGI3Xc7CgE3yeA+pY/TfviNr76yMCjW8cgIs1gHu47WZvDwIsLUwLzxjvuSMX VSDUx+ZwhuXSjIRVlB/G0svaH60hcnJzhDxIMgbsK0BhDnoxUcjIISm1Y9TX5i6rcI1/ yAbw== X-Gm-Message-State: AElRT7HHt4jEv45TDqfAs01s99vKRGH5nnAYxnc9P46WiSjiWq+MxTAI woNjtGWkSHUnvBHmzgiqRDOq80yv X-Google-Smtp-Source: AIpwx4/ONDNiW+jXRKlFXHxVz8YfA17XoQlJV21exSc2eNwrEVjgquihuts97Wy6r7hp848ZUHI6iQ== X-Received: by 10.223.149.68 with SMTP id 62mr3512455wrs.201.1522258808868; Wed, 28 Mar 2018 10:40:08 -0700 (PDT) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id 55sm3516210wrw.52.2018.03.28.10.40.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 10:40:08 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Wed, 28 Mar 2018 18:39:59 +0100 Message-Id: <20180328173959.23948-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [PATCH] drm/i915/execlists: Consistent seqno reporting in GEM_TRACE X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Some messages are using %d and some %x which creates confusion while reading the traces. I also added: 1. Fence context/seqno to elsp traces - so it is easier to correlate events. 2. New GEM_TRACE logging to port and request cancellation sites. Signed-off-by: Tvrtko Ursulin --- Crystal ball says I'll be removing everything other than the seqno format consolidation in v2. :) --- drivers/gpu/drm/i915/intel_lrc.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index fe520c4dd999..c5e8526a2025 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -454,10 +454,12 @@ 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=%x, prio=%d\n", + GEM_TRACE("%s in[%d]: ctx=%d.%d, seqno=%d (fence %llx:%d), prio=%d\n", engine->name, n, port[n].context_id, count, rq->global_seqno, + rq->fence.context, + rq->fence.seqno, rq_prio(rq)); } else { GEM_BUG_ON(!n); @@ -727,6 +729,10 @@ 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%lu cancel %llx:%d [global %d]\n", + rq->engine->name, port - execlists->port, + rq->fence.context, rq->fence.seqno, rq->global_seqno); + GEM_BUG_ON(!execlists->active); intel_engine_context_out(rq->engine); @@ -802,7 +808,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, hws global %d\n", + engine->name, intel_engine_get_seqno(engine)); /* * Before we call engine->cancel_requests(), we should have exclusive @@ -829,8 +836,12 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine) /* Mark all executing requests as skipped. */ list_for_each_entry(rq, &engine->timeline->requests, link) { GEM_BUG_ON(!rq->global_seqno); - if (!i915_request_completed(rq)) + if (!i915_request_completed(rq)) { + GEM_TRACE("%s eio %llx:%d [global %d]\n", + rq->engine->name, rq->fence.context, + rq->fence.seqno, rq->global_seqno); dma_fence_set_error(&rq->fence, -EIO); + } } /* Flush the queued requests to the timeline list (for retiring). */ @@ -839,6 +850,10 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine) struct i915_priolist *p = to_priolist(rb); list_for_each_entry_safe(rq, rn, &p->requests, priotree.link) { + GEM_TRACE("%s submit-eio %llx:%d [global %d]\n", + rq->engine->name, rq->fence.context, + rq->fence.seqno, rq->global_seqno); + INIT_LIST_HEAD(&rq->priotree.link); dma_fence_set_error(&rq->fence, -EIO); @@ -999,10 +1014,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=%x, prio=%d\n", + GEM_TRACE("%s out[0]: ctx=%d.%d, seqno=%d (fence %llx:%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, rq ? rq_prio(rq) : 0); /* Check the context/desc id for this event matches */ @@ -1706,7 +1723,7 @@ static void reset_common_ring(struct intel_engine_cs *engine, struct intel_context *ce; unsigned long flags; - GEM_TRACE("%s seqno=%x\n", + GEM_TRACE("%s seqno=%d\n", engine->name, request ? request->global_seqno : 0); /* See execlists_cancel_requests() for the irq/spinlock split. */