From patchwork Fri Mar 1 00:43:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 15161 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 CB6D223E1A for ; Fri, 1 Mar 2013 00:43:49 +0000 (UTC) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by fiordland.canonical.com (Postfix) with ESMTP id 7FF96A1935F for ; Fri, 1 Mar 2013 00:43:49 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id b10so2410134vea.16 for ; Thu, 28 Feb 2013 16:43:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=oUcHzSfeGCDUEj/XBawtrtgaRk3gGRxEsRw1ynN6zLM=; b=gM/54x6EShNQY5cM9qUsEhQly+r2GGIEDYdgmHiMlkR4nuRIPSh+IJrk+uQSBmkGE8 cM2FNXIyNEJ965ZOFUWga4v4WgFP1XfPMMx/kN0M6bprvFZNRGsye8nG7AoCYiKCZztV gB5LelnlYSA2HXIM8tAZK7hnbTcdJBf5ux/bQVW5+rXi61s1RtzvynusWbuTaht62MSP 4Cmli3Ss/YOaTTbqf9OvcmlXM64NlgVkpcJuWwyQgPBEiUFVyKDBTEiwgx7BHxXtyGba dkjD/r18Ki1hiynCIYI+4w+yDJfEvQlkBRPgwDgO1FnspElTwBucmPhyz5+0/vEuDl1+ 0dqw== X-Received: by 10.52.29.18 with SMTP id f18mr2892631vdh.57.1362098628996; Thu, 28 Feb 2013 16:43:48 -0800 (PST) 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.58.145.101 with SMTP id st5csp639veb; Thu, 28 Feb 2013 16:43:48 -0800 (PST) X-Received: by 10.66.75.200 with SMTP id e8mr15937029paw.72.1362098628155; Thu, 28 Feb 2013 16:43:48 -0800 (PST) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id ot10si10294257pbb.67.2013.02.28.16.43.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:48 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: by mail-pb0-f41.google.com with SMTP id um15so1401415pbc.14 for ; Thu, 28 Feb 2013 16:43:47 -0800 (PST) X-Received: by 10.66.97.50 with SMTP id dx18mr15829148pab.78.1362098627755; Thu, 28 Feb 2013 16:43:47 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id dx17sm10914892pac.17.2013.02.28.16.43.46 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:47 -0800 (PST) From: John Stultz To: lkml Cc: Erik Gilling , Maarten Lankhorst , Daniel Vetter , Rob Clark , Sumit Semwal , Greg KH , dri-devel@lists.freedesktop.org, Android Kernel Team , John Stultz Subject: [PATCH 05/30] staging: sw_sync: Add debug support Date: Thu, 28 Feb 2013 16:43:01 -0800 Message-Id: <1362098606-26469-6-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> References: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> X-Gm-Message-State: ALoCoQlvNwPaDFHPWTBM2de2kZF0PoYeJlm6xbV1Bu0MiSiE7o1MloRUD8nQ2GKkhc4UtDqsyhkO From: Erik Gilling Add debugfs support hooks. Cc: Maarten Lankhorst Cc: Erik Gilling Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Greg KH Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team Signed-off-by: Erik Gilling [jstultz: Add commit message] Signed-off-by: John Stultz --- drivers/staging/android/sw_sync.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index c27004c..64c5ebb 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -70,11 +70,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, };