From patchwork Tue May 1 15:34:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10374079 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 44ACA601C7 for ; Tue, 1 May 2018 15:34:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3595C1FF81 for ; Tue, 1 May 2018 15:34:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A5D9283C5; Tue, 1 May 2018 15:34:16 +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.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 C8D501FF81 for ; Tue, 1 May 2018 15:34:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 481806E430; Tue, 1 May 2018 15:34:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7994B6E430 for ; Tue, 1 May 2018 15:34:13 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 11559289-1500050 for multiple; Tue, 01 May 2018 16:34:11 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Tue, 01 May 2018 16:34:05 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 1 May 2018 16:34:04 +0100 Message-Id: <20180501153404.30629-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180501151309.10787-2-chris@chris-wilson.co.uk> References: <20180501151309.10787-2-chris@chris-wilson.co.uk> X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH v3] drm/i915: Include completed status in HW request tracepoints 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 Include a bool to show whether the request is complete in every tracepoint. This especially helps when tracing the flow of requests through the HW. v2: Limit to in/out HW events, not all general request tracepoints. v3: ifdeffery Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_trace.h | 19 ++++++++++++------- drivers/gpu/drm/i915/intel_guc_submission.c | 2 +- drivers/gpu/drm/i915/intel_lrc.c | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index 408827bf5d96..1de3cf442e36 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -691,6 +691,8 @@ DECLARE_EVENT_CLASS(i915_request_hw, __field(u32, seqno) __field(u32, global_seqno) __field(u32, port) + __field(u32, prio) + __field(u32, completed) ), TP_fast_assign( @@ -701,12 +703,15 @@ DECLARE_EVENT_CLASS(i915_request_hw, __entry->seqno = rq->fence.seqno; __entry->global_seqno = rq->global_seqno; __entry->port = port; + __entry->prio = rq->sched.attr.priority; + __entry->completed = i915_request_completed(rq); ), - TP_printk("dev=%u, hw_id=%u, ring=%u, ctx=%u, seqno=%u, global=%u, port=%u", + TP_printk("dev=%u, hw_id=%u, ring=%u, ctx=%u, seqno=%u, prio=%u, global=%u, port=%u, completed?=%d", __entry->dev, __entry->hw_id, __entry->ring, - __entry->ctx, __entry->seqno, - __entry->global_seqno, __entry->port) + __entry->ctx, __entry->seqno, __entry->prio, + __entry->global_seqno, __entry->port, + __entry->completed) ); DEFINE_EVENT(i915_request_hw, i915_request_in, @@ -714,9 +719,9 @@ DEFINE_EVENT(i915_request_hw, i915_request_in, TP_ARGS(rq, port) ); -DEFINE_EVENT(i915_request, i915_request_out, - TP_PROTO(struct i915_request *rq), - TP_ARGS(rq) +DEFINE_EVENT(i915_request_hw, i915_request_out, + TP_PROTO(struct i915_request *rq, unsigned int port), + TP_ARGS(rq, port) ); #else #if !defined(TRACE_HEADER_MULTI_READ) @@ -736,7 +741,7 @@ trace_i915_request_in(struct i915_request *rq, unsigned int port) } static inline void -trace_i915_request_out(struct i915_request *rq) +trace_i915_request_out(struct i915_request *rq, unsigned int port) { } #endif diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c index c6bb5bebddfc..bd440687892a 100644 --- a/drivers/gpu/drm/i915/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/intel_guc_submission.c @@ -762,7 +762,7 @@ static void guc_submission_tasklet(unsigned long data) rq = port_request(port); while (rq && i915_request_completed(rq)) { - trace_i915_request_out(rq); + trace_i915_request_out(rq, 0); i915_request_put(rq); port = execlists_port_complete(execlists, port); diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index ffc74f562f77..396d9596d0aa 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -402,7 +402,7 @@ execlists_context_schedule_out(struct i915_request *rq, unsigned long status) { intel_engine_context_out(rq->engine); execlists_context_status_change(rq, status); - trace_i915_request_out(rq); + trace_i915_request_out(rq, 0); } static void