From patchwork Tue Jun 5 23:45:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Gilling X-Patchwork-Id: 9125 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9533B23E5A for ; Tue, 5 Jun 2012 23:46:19 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4EEDEA189DE for ; Tue, 5 Jun 2012 23:46:19 +0000 (UTC) Received: by yenq6 with SMTP id q6so5088568yen.11 for ; Tue, 05 Jun 2012 16:46:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :date:message-id:x-mailer:in-reply-to:references:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=O+dXd+opoMpHSEqiAsc6rQAw1gyCOny8VfJR/95S5qU=; b=peDoWHeCDkcfITmsoXuB+vHhgz98F8a5GjIlm+i7sfB8y41tRDJT5Vz+BnoHMIRUaB BHCj3oW7dj3HvqzpyW8s2DfPsKqT4knMuUrAP3XwvLpoHGYbjWtw4dlwkj6DyFkUrRRr ZEK/Bn2zQdmUWUQtLRvJYFRr6AQ8mccPWM0ru5Ec9gIkaUy403jO6Q2FjnyJd6L1zU1S +dHAsFDVWUg23PpK8bjVlSejTuQaJXnglMFapZt9htprmuycbqlpbT44EU2p25NnJyft INFzLnOgWWTcO/BUwDScsB7zE1K+Y043aQjPJYDh8i5GVL7JdM6YfuuOCvXelzxONMq+ vgfg== Received: by 10.50.193.196 with SMTP id hq4mr4771663igc.57.1338939978473; Tue, 05 Jun 2012 16:46:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp52390ibb; Tue, 5 Jun 2012 16:46:17 -0700 (PDT) Received: by 10.216.194.93 with SMTP id l71mr15842910wen.169.1338939976432; Tue, 05 Jun 2012 16:46:16 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id gl1si546730wib.26.2012.06.05.16.46.15; Tue, 05 Jun 2012 16:46:16 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sc3Rz-0005iv-QJ; Tue, 05 Jun 2012 23:46:12 +0000 Received: from mail-gg0-f202.google.com ([209.85.161.202]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sc3Rw-0005fp-Lo for linaro-mm-sig@lists.linaro.org; Tue, 05 Jun 2012 23:46:08 +0000 Received: by mail-gg0-f202.google.com with SMTP id h3so654803gge.1 for ; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: by 10.101.133.36 with SMTP id k36mr8174012ann.25.1338939968415; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: by 10.101.133.36 with SMTP id k36mr8173999ann.25.1338939967996; Tue, 05 Jun 2012 16:46:07 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id v25si2015145yhm.0.2012.06.05.16.46.07 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 05 Jun 2012 16:46:07 -0700 (PDT) Received: from dirtysouth.mtv.corp.google.com (dirtysouth.mtv.corp.google.com [172.18.104.93]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id DF1731E004D; Tue, 5 Jun 2012 16:46:07 -0700 (PDT) Received: by dirtysouth.mtv.corp.google.com (Postfix, from userid 94083) id 8F53740DB9; Tue, 5 Jun 2012 16:46:07 -0700 (PDT) From: Erik Gilling To: linaro-mm-sig@lists.linaro.org Date: Tue, 5 Jun 2012 16:45:48 -0700 Message-Id: <1338939956-17312-4-git-send-email-konkers@android.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1338939956-17312-1-git-send-email-konkers@android.com> References: <1338939956-17312-1-git-send-email-konkers@android.com> Subject: [Linaro-mm-sig] [RFC 03/11] sync: add timestamps to sync_pts X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQmvDXGwXwh9jtzkd4YSLdseuKbwHsGMYPrTbe7/m6yvo8Ie/qmwDGjm6Ngm+HcjwYzoQITL When profiling performance, knowing when various points in the graphics pipeline finished is very useful. Signed-off-by: Erik Gilling --- drivers/base/sync.c | 5 +++++ include/linux/sync.h | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/base/sync.c b/drivers/base/sync.c index 4a8604b..ea0b664 100644 --- a/drivers/base/sync.c +++ b/drivers/base/sync.c @@ -155,12 +155,17 @@ void sync_pt_free(struct sync_pt *pt) /* call with pt->parent->active_list_lock held */ static int _sync_pt_has_signaled(struct sync_pt *pt) { + int old_status = pt->status; + if (!pt->status) pt->status = pt->parent->ops->has_signaled(pt); if (!pt->status && pt->parent->destroyed) pt->status = -ENOENT; + if (pt->status != old_status) + pt->timestamp = ktime_get(); + return pt->status; } diff --git a/include/linux/sync.h b/include/linux/sync.h index 2e7ee55..b9ee821 100644 --- a/include/linux/sync.h +++ b/include/linux/sync.h @@ -16,6 +16,7 @@ #include #ifdef __KERNEL__ +#include #include #include #include @@ -92,6 +93,8 @@ struct sync_timeline { * @fence: sync_fence to which the sync_pt belongs * @pt_list: membership in sync_fence.pt_list_head * @status: 1: signaled, 0:active, <0: error + * @timestamp: time which sync_pt status transitioned from active to + * singaled or error. */ struct sync_pt { struct sync_timeline *parent; @@ -104,6 +107,8 @@ struct sync_pt { /* protected by parent->active_list_lock */ int status; + + ktime_t timestamp; }; /**