From patchwork Mon Sep 23 20:33:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2929891 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2A194BFF05 for ; Mon, 23 Sep 2013 20:37:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4193C203AD for ; Mon, 23 Sep 2013 20:37:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 286BD20274 for ; Mon, 23 Sep 2013 20:37:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00979E7591 for ; Mon, 23 Sep 2013 13:37:39 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ye0-f180.google.com (mail-ye0-f180.google.com [209.85.213.180]) by gabe.freedesktop.org (Postfix) with ESMTP id D2ADEE6921 for ; Mon, 23 Sep 2013 13:33:50 -0700 (PDT) Received: by mail-ye0-f180.google.com with SMTP id m15so1373317yen.39 for ; Mon, 23 Sep 2013 13:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5z6U8JnCSGOa+PDFxGhf8VHmfxjuWfc5hrq1GUJS/XI=; b=yPR+S4lBNBAihz/s+/Fu5YFVZrPBCVzoSM56OVxB6UyqD/lsgHXNdIoP7n4gEZvYmz 8iztBedJjxveBy78S7bT89HNii6zxp42mqUhqdUobEG4VhB5tlcMf83t54hH9CSo2zli myY1DBpUF5rU9it5di4j0JT+LdAe6VsoxaE9wWQFwlW0/DNWM2sR52sOnNNaBv2M1/+Q 2K3xC3UygwRryz1ZlyIdF/Vp/b5owezco6q/q/6m3bM88DHpu09qSbOuf0wM9NC8sTYV t/LGKzYIYusGJvFjfEmD1gLR4UxWIJASoXVkpfrWp9ujgn59f2OlSdRNlbwi2p4quSOB U6Dw== X-Received: by 10.236.92.35 with SMTP id i23mr5053yhf.104.1379968430383; Mon, 23 Sep 2013 13:33:50 -0700 (PDT) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPSA id v96sm38875107yhp.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 13:33:49 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 23 Sep 2013 17:33:23 -0300 Message-Id: <1379968410-14428-7-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1379968410-14428-1-git-send-email-rodrigo.vivi@gmail.com> References: <1379968410-14428-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 06/13] drm/i915: Pair seqno completion tracepoint with its dispatch X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Chris Wilson In order to time how long a seqno is executed by a ring, we need to measure both its insertion and its completion. (Using the completion of the previous seqno as an estimate for when the GPU starts, if busy.) In order to get an exact completion timestamp, we need irqs. This is enabled by trace_i915_gem_ring_dispatch, so it makes more sens to pair the completion event with that rather than the request. Signed-off-by: Chris Wilson Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +- drivers/gpu/drm/i915/i915_irq.c | 2 +- drivers/gpu/drm/i915/i915_trace.h | 48 +++++++++++++++--------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index ee93357..3976579 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1185,7 +1185,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, goto err; } - trace_i915_gem_ring_dispatch(ring, intel_ring_get_seqno(ring), flags); + trace_i915_gem_ring_dispatch(ring, flags); i915_gem_execbuffer_move_to_active(&eb->vmas, ring); i915_gem_execbuffer_retire_commands(dev, file, ring, batch_obj); diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 84b7efc..82bd7f5d 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -807,7 +807,7 @@ static void notify_ring(struct drm_device *dev, if (ring->obj == NULL) return; - trace_i915_gem_request_complete(ring); + trace_i915_gem_ring_complete(ring); wake_up_all(&ring->irq_queue); i915_queue_hangcheck(dev); diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index a1797f6..5c8e36a 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -234,8 +234,8 @@ TRACE_EVENT(i915_gem_evict_everything, ); TRACE_EVENT(i915_gem_ring_dispatch, - TP_PROTO(struct intel_ring_buffer *ring, u32 seqno, u32 flags), - TP_ARGS(ring, seqno, flags), + TP_PROTO(struct intel_ring_buffer *ring, u32 flags), + TP_ARGS(ring, flags), TP_STRUCT__entry( __field(u32, dev) @@ -247,15 +247,35 @@ TRACE_EVENT(i915_gem_ring_dispatch, TP_fast_assign( __entry->dev = ring->dev->primary->index; __entry->ring = ring->id; - __entry->seqno = seqno; + __entry->seqno = intel_ring_get_seqno(ring), __entry->flags = flags; - i915_trace_irq_get(ring, seqno); + i915_trace_irq_get(ring, __entry->seqno); ), TP_printk("dev=%u, ring=%u, seqno=%u, flags=%x", __entry->dev, __entry->ring, __entry->seqno, __entry->flags) ); +TRACE_EVENT(i915_gem_ring_complete, + TP_PROTO(struct intel_ring_buffer *ring), + TP_ARGS(ring), + + TP_STRUCT__entry( + __field(u32, dev) + __field(u32, ring) + __field(u32, seqno) + ), + + TP_fast_assign( + __entry->dev = ring->dev->primary->index; + __entry->ring = ring->id; + __entry->seqno = ring->get_seqno(ring, false); + ), + + TP_printk("dev=%u, ring=%u, seqno=%u", + __entry->dev, __entry->ring, __entry->seqno) +); + TRACE_EVENT(i915_gem_ring_flush, TP_PROTO(struct intel_ring_buffer *ring, u32 invalidate, u32 flush), TP_ARGS(ring, invalidate, flush), @@ -304,26 +324,6 @@ DEFINE_EVENT(i915_gem_request, i915_gem_request_add, TP_ARGS(ring, seqno) ); -TRACE_EVENT(i915_gem_request_complete, - TP_PROTO(struct intel_ring_buffer *ring), - TP_ARGS(ring), - - TP_STRUCT__entry( - __field(u32, dev) - __field(u32, ring) - __field(u32, seqno) - ), - - TP_fast_assign( - __entry->dev = ring->dev->primary->index; - __entry->ring = ring->id; - __entry->seqno = ring->get_seqno(ring, false); - ), - - TP_printk("dev=%u, ring=%u, seqno=%u", - __entry->dev, __entry->ring, __entry->seqno) -); - DEFINE_EVENT(i915_gem_request, i915_gem_request_retire, TP_PROTO(struct intel_ring_buffer *ring, u32 seqno), TP_ARGS(ring, seqno)