From patchwork Wed Apr 20 17:09:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Harrison X-Patchwork-Id: 8893161 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E9C1BF29F for ; Wed, 20 Apr 2016 17:10:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E16420211 for ; Wed, 20 Apr 2016 17:10:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5F8522020F for ; Wed, 20 Apr 2016 17:10:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72B516EA75; Wed, 20 Apr 2016 17:10:11 +0000 (UTC) X-Original-To: Intel-GFX@lists.freedesktop.org Delivered-To: Intel-GFX@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id 3EC986E064 for ; Wed, 20 Apr 2016 17:10:04 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 20 Apr 2016 10:10:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,510,1455004800"; d="scan'208";a="949324347" Received: from johnharr-linux.isw.intel.com ([10.102.226.93]) by fmsmga001.fm.intel.com with ESMTP; 20 Apr 2016 10:10:04 -0700 From: John.C.Harrison@Intel.com To: Intel-GFX@Lists.FreeDesktop.Org Date: Wed, 20 Apr 2016 18:09:54 +0100 Message-Id: <1461172195-3959-8-git-send-email-John.C.Harrison@Intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461172195-3959-1-git-send-email-John.C.Harrison@Intel.com> References: <1461172195-3959-1-git-send-email-John.C.Harrison@Intel.com> Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH v7 7/8] drm/i915: Updated request structure tracing X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: John Harrison Added the '_complete' trace event which occurs when a fence/request is signaled as complete. Also moved the notify event from the IRQ handler code to inside the notify function itself. v3: Added the current ring seqno to the notify trace point. v5: Line wrapping to keep the style checker happy. v7: Updated to newer nightly (lots of ring -> engine renaming). For: VIZ-5190 Signed-off-by: John Harrison --- drivers/gpu/drm/i915/i915_gem.c | 9 +++++++-- drivers/gpu/drm/i915/i915_irq.c | 1 - drivers/gpu/drm/i915/i915_trace.h | 14 +++++++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 9b1de5f..a89bfe9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2915,8 +2915,10 @@ void i915_gem_request_notify(struct intel_engine_cs *engine, bool fence_locked) unsigned long flags; u32 seqno; - if (list_empty(&engine->fence_signal_list)) + if (list_empty(&engine->fence_signal_list)) { + trace_i915_gem_request_notify(engine, 0); return; + } if (!fence_locked) spin_lock_irqsave(&engine->fence_lock, flags); @@ -2924,6 +2926,7 @@ void i915_gem_request_notify(struct intel_engine_cs *engine, bool fence_locked) if (engine->irq_seqno_barrier) engine->irq_seqno_barrier(engine); seqno = engine->get_seqno(engine); + trace_i915_gem_request_notify(engine, seqno); list_for_each_entry_safe(req, req_next, &engine->fence_signal_list, signal_link) { if (!req->cancelled) { @@ -2937,8 +2940,10 @@ void i915_gem_request_notify(struct intel_engine_cs *engine, bool fence_locked) */ list_del_init(&req->signal_link); - if (!req->cancelled) + if (!req->cancelled) { fence_signal_locked(&req->fence); + trace_i915_gem_request_complete(req); + } if (req->irq_enabled) { req->engine->irq_put(req->engine); diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 9640fa8..0952064 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -999,7 +999,6 @@ static void notify_ring(struct intel_engine_cs *engine) if (!intel_engine_initialized(engine)) return; - trace_i915_gem_request_notify(engine); engine->user_interrupts++; i915_gem_request_notify(engine, false); diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index dc0def2..b7c7031 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -550,23 +550,27 @@ DEFINE_EVENT(i915_gem_request, i915_gem_request_add, ); TRACE_EVENT(i915_gem_request_notify, - TP_PROTO(struct intel_engine_cs *engine), - TP_ARGS(engine), + TP_PROTO(struct intel_engine_cs *engine, uint32_t seqno), + TP_ARGS(engine, seqno), TP_STRUCT__entry( __field(u32, dev) __field(u32, ring) __field(u32, seqno) + __field(bool, is_empty) ), TP_fast_assign( __entry->dev = engine->dev->primary->index; __entry->ring = engine->id; - __entry->seqno = engine->get_seqno(engine); + __entry->seqno = seqno; + __entry->is_empty = + list_empty(&engine->fence_signal_list); ), - TP_printk("dev=%u, ring=%u, seqno=%u", - __entry->dev, __entry->ring, __entry->seqno) + TP_printk("dev=%u, ring=%u, seqno=%u, empty=%d", + __entry->dev, __entry->ring, __entry->seqno, + __entry->is_empty) ); DEFINE_EVENT(i915_gem_request, i915_gem_request_retire,