From patchwork Fri Apr 6 12:35:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10325951 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 7DB886053F for ; Fri, 6 Apr 2018 12:35:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DF50294EA for ; Fri, 6 Apr 2018 12:35:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62D1F294F3; Fri, 6 Apr 2018 12:35:40 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 E0071294EA for ; Fri, 6 Apr 2018 12:35:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CFB66E95D; Fri, 6 Apr 2018 12:35:28 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 987EE89DCF for ; Fri, 6 Apr 2018 12:35:26 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id r82so3140224wme.0 for ; Fri, 06 Apr 2018 05:35:26 -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:in-reply-to:references; bh=PjynBj5KlebbdPlbAj5QFIwX4kCImEHF9uxwclDQcNg=; b=zDSdgQciSaEwEOiW1gStrlSFcI+H1P6wllB39kxiIWhaaxhrx/OjOSpZXnnugd1hE+ C5EW14u2qEoangtokUCzQFDbzVm4ivmNYg7k4/2wkhoTwG/jEEH4VrsUdZyQunJKj8vu XJH77ykvhX4ENLLU44fghA/nwi9AoMSxkwB5vF4vZ+DtkGCD6BRz+slLBcPS/oF+RQJv YejXHvBANnCBXj0+LFTGH/yYIlMqxYI4jbla+hi1r45evVcagwlgqELH46oY2JWkvVgm FU62iXiESbrVaJ5pm7CjykB5dTs7ZMkQV9ONktLC4CCyUUT1tErEjBk2gaTsrrfbYobV 4CgA== 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:in-reply-to :references; bh=PjynBj5KlebbdPlbAj5QFIwX4kCImEHF9uxwclDQcNg=; b=UXb3t49gXVs9xvO47riIH7xnQymLYB7ulbmH8/JUXFlHfqUzbE1J1edx0J6kGC+6xz k2Uygh7BnUIQwCFJTVrSws8mc1kNHLUu3/hmqwuhxgfPnhqEvEqD0xnjeO+vRhlt0DHP HzsnyVGm0j4LCClEUA46Vm34cgmP1gyKNWo+1Ls0Bik+EL4hFqrdrD+OoASMWPhDsanx 1McrBXyGZG20hpfRj1aPW5SqDw0FwyTtPZYVYJripJrNKrKqhxcQpV3L0E2zIBgmJkua KPcwR6PcT6wyUJPHvFT7l1YjfNNmqa9pzqLq6gPR0yjsHV/Skse2rUlXnG6tOchtKHls V6tw== X-Gm-Message-State: AElRT7HRz4BFg49mDmxPJ5iqlHVeG1CNqXoeGsZITHT4yGRCY37y49wz AwWVngXsvfGzsYcrVBoklQsWObNV X-Google-Smtp-Source: AIpwx4/MRQe3fxXIG+l5ko/OgfTsxGLf/TygqRaZJe6UfyRDkmhPGSVXh7WDaLYZ9lu/EhEIjHiNcw== X-Received: by 10.28.216.148 with SMTP id p142mr14921850wmg.72.1523018124736; Fri, 06 Apr 2018 05:35:24 -0700 (PDT) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id v191sm5541077wmf.34.2018.04.06.05.35.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 05:35:23 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Fri, 6 Apr 2018 13:35:14 +0100 Message-Id: <20180406123514.5809-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180406113651.20953-1-tvrtko.ursulin@linux.intel.com> References: <20180406113651.20953-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH v3] drm/i915/execlists: Log fence context & seqno throughout 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 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 Reviewed-by: Chris Wilson # v2 Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/i915_request.c | 6 +++--- drivers/gpu/drm/i915/intel_lrc.c | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 152321655fe6..66976683ffff 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -389,7 +389,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, @@ -512,7 +512,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, @@ -567,7 +567,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, diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index f6631ff11caf..16ea95ff7c51 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -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); @@ -1745,8 +1756,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);