From patchwork Tue Sep 10 22:36:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2868131 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 723B49F485 for ; Tue, 10 Sep 2013 23:13:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79D0C20357 for ; Tue, 10 Sep 2013 23:13:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9F22020457 for ; Tue, 10 Sep 2013 23:13:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0843E64A5 for ; Tue, 10 Sep 2013 16:13:33 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ye0-f173.google.com (mail-ye0-f173.google.com [209.85.213.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 44C15E76C8 for ; Tue, 10 Sep 2013 15:37:19 -0700 (PDT) Received: by mail-ye0-f173.google.com with SMTP id m3so2786673yen.18 for ; Tue, 10 Sep 2013 15:37:19 -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=InlsJ0FQh4QiGxUEHwmNLCbMt1IGr6icYBpkfWZnhcg=; b=VvtXrPIHHWWfu7xQtdAdViZCB+hJHhpLHRVxLyzy+B45uqfm1yHBnfcY3qxHViXV/9 fGRdFqklmQoFO0Hvt6vtoKufgRyWtj1QcCY+u0HUMCKhqQ1pTE0aC5hcCD9A0Fz0VdOa hMvaIZduA7yiW4SOxkf/XTGc99l4B5XYbKH3qOJMorvA+eLbzH3yGrjflRiSmpTOmh2s uzOs9jG3ujJMclh2hjFA82vcDD2ZQHZUaGDtHdldzQmAb02LG1T81n/BuMRNPyIcuDsX sprFPEIBf2yqCr0sUXAGMR9DxhsL202Dn44qIXWBmSJyVtwM1FzeguMrh2l2Qp7e+lue SvUw== X-Received: by 10.236.163.228 with SMTP id a64mr24145151yhl.35.1378852639341; Tue, 10 Sep 2013 15:37:19 -0700 (PDT) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPSA id v22sm27925176yhn.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Sep 2013 15:37:19 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Sep 2013 19:36:40 -0300 Message-Id: <1378852608-30281-12-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1378852608-30281-1-git-send-email-rodrigo.vivi@gmail.com> References: <1378852608-30281-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 11/19] drm/i915: Add a tracepoint for using a semaphore 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=-4.7 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 So that we can find the callers who introduce a ring stall. A single ring stall is not too unwelcome, the right issue becomes when they start to interlock and prevent any concurrent work. That, however, is a little tricker to detect with a mere tracepoint! v2: Rebrand it as a ring event, rather than an object event. Signed-off-by: Chris Wilson Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem.c | 2 ++ drivers/gpu/drm/i915/i915_trace.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b3aaf29..bbcb1b6 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2600,6 +2600,8 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj, if (ret) return ret; + trace_i915_gem_ring_sync_to(from, to); + ret = to->sync_to(to, from, seqno); if (!ret) /* We use last_read_seqno because sync_to() diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index 5c8e36a..48e8f07 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -233,6 +233,25 @@ TRACE_EVENT(i915_gem_evict_everything, TP_printk("dev=%d", __entry->dev) ); +TRACE_EVENT(i915_gem_ring_sync_to, + TP_PROTO(struct intel_ring_buffer *from, struct intel_ring_buffer *to), + TP_ARGS(from, to), + + TP_STRUCT__entry( + __field(u32, dev) + __field(u32, sync_from) + __field(u32, sync_to) + ), + + TP_fast_assign( + __entry->dev = from->dev->primary->index; + __entry->sync_from = from->id; + __entry->sync_to = to->id; + ), + + TP_printk("dev=%u, sync-from=%u, sync-to=%u", __entry->dev, __entry->sync_from, __entry->sync_to) +); + TRACE_EVENT(i915_gem_ring_dispatch, TP_PROTO(struct intel_ring_buffer *ring, u32 flags), TP_ARGS(ring, flags),