From patchwork Tue Jun 5 23:45:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Gilling X-Patchwork-Id: 9130 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 15A6323E5A for ; Tue, 5 Jun 2012 23:46:32 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id D8F83A189DD for ; Tue, 5 Jun 2012 23:46:31 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so5101674ggn.11 for ; Tue, 05 Jun 2012 16:46:31 -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=BIYILrM1qar2TZ6fVLdM/VtRdEar0g9kC/dd2f8HBDw=; b=NMB0pGkkSf+t3qoYXuL3U4O0al64DeE/v19jDfICuSmUGWNf24iz9zrxqLsNeDvxwH Jzf1Qn8csHOcG5x2PEp8Fqeb6tH/uKXsypRH/Wf0EyPOvbppl+2DUxe67cAevVWk40Ov wv1p0xUTtRtH+PhJt+GQAsPN64SdL9LMnAV5a5QyiQJYh6L966A2JQ2MAHbJrgXE3AK9 6eTkK9lPkwwpZglwTIKGiNDK5nHuQeAgMLro56E3KezZF/DnDQxPl1kYmt+mjZhpvuy1 cD3nZAaR9VCFSOFv8V5Qflwfn54rxyiYtgsvl4t7LW2ZdTSJg0ljYpegEhgzvdiahkVI aLqg== Received: by 10.50.195.234 with SMTP id ih10mr4931768igc.0.1338939991534; Tue, 05 Jun 2012 16:46:31 -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 v20csp52404ibb; Tue, 5 Jun 2012 16:46:30 -0700 (PDT) Received: by 10.216.210.225 with SMTP id u75mr15291894weo.13.1338939990335; Tue, 05 Jun 2012 16:46:30 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id 31si4997484wet.48.2012.06.05.16.46.29; Tue, 05 Jun 2012 16:46:30 -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 1Sc3S1-0005jA-1x; Tue, 05 Jun 2012 23:46:13 +0000 Received: from mail-wg0-f74.google.com ([74.125.82.74]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sc3Rw-0005ha-Qg for linaro-mm-sig@lists.linaro.org; Tue, 05 Jun 2012 23:46:08 +0000 Received: by wgbdt11 with SMTP id dt11so363722wgb.1 for ; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: by 10.14.119.205 with SMTP id n53mr5632738eeh.11.1338939968688; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: by 10.14.119.205 with SMTP id n53mr5632735eeh.11.1338939968611; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id b15si10684een.0.2012.06.05.16.46.08 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: from dirtysouth.mtv.corp.google.com (dirtysouth.mtv.corp.google.com [172.18.104.93]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 69052200061; Tue, 5 Jun 2012 16:46:08 -0700 (PDT) Received: by dirtysouth.mtv.corp.google.com (Postfix, from userid 94083) id BCCB940E6E; 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:50 -0700 Message-Id: <1338939956-17312-6-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 05/11] sw_sync: add debug support 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: ALoCoQlnygT8O7T2fizlzbLlS8aeLhCEhBHM5ta1+7lVJVHm0xuF5rVG7c/t9f0Rqn99kSe9LKLB Allows sw_sync specific information to be included in debugfs. Signed-off-by: Erik Gilling --- drivers/base/sw_sync.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/base/sw_sync.c b/drivers/base/sw_sync.c index e94ecc7..41beb9e 100644 --- a/drivers/base/sw_sync.c +++ b/drivers/base/sw_sync.c @@ -69,11 +69,30 @@ static int sw_sync_pt_compare(struct sync_pt *a, struct sync_pt *b) return sw_sync_cmp(pt_a->value, pt_b->value); } +static void sw_sync_print_obj(struct seq_file *s, + struct sync_timeline *sync_timeline) +{ + struct sw_sync_timeline *obj = (struct sw_sync_timeline *)sync_timeline; + + seq_printf(s, "%d", obj->value); +} + +static void sw_sync_print_pt(struct seq_file *s, struct sync_pt *sync_pt) +{ + struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt; + struct sw_sync_timeline *obj = + (struct sw_sync_timeline *)sync_pt->parent; + + seq_printf(s, "%d / %d", pt->value, obj->value); +} + struct sync_timeline_ops sw_sync_timeline_ops = { .driver_name = "sw_sync", .dup = sw_sync_pt_dup, .has_signaled = sw_sync_pt_has_signaled, .compare = sw_sync_pt_compare, + .print_obj = sw_sync_print_obj, + .print_pt = sw_sync_print_pt, };