From patchwork Fri Jan 15 14:55:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8041751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 83CC9BEEE1 for ; Fri, 15 Jan 2016 14:56:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2BC32044C for ; Fri, 15 Jan 2016 14:56:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7434520434 for ; Fri, 15 Jan 2016 14:56:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8559F7A0DF; Fri, 15 Jan 2016 06:56:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f171.google.com (mail-yk0-f171.google.com [209.85.160.171]) by gabe.freedesktop.org (Postfix) with ESMTPS id D76CF7A0DF for ; Fri, 15 Jan 2016 06:56:06 -0800 (PST) Received: by mail-yk0-f171.google.com with SMTP id v14so451522195ykd.3 for ; Fri, 15 Jan 2016 06:56:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aILnPaVPw8NUCamMYk9pHIupIlT+J0bOOMfemkQuZsU=; b=ZPavRQHJQZJ82bfFIxWKKrwz892Wis1aqOpoZPqeRMEzjDe5U8sATDBmSD8yYW2DBw TKQavEH2XxnncjtxrEO5SYoPqErTWrvqNIeczmXdRFpsTebTGTiJyiOfK87CsreZH5yf b6gzRVQvjf97UG1+ZEw8IUj0PWHJVJFR2QCOglQnCnbnUvbonR3OfOKkuHPAGrVx899w sP0iwWyKtbGuhzLyCHpUWBP6ZftyNjW8PWxuPrGFHW/77V/EQs6+Lsi6uZZYnfqB8w8R rxSmfJ04T+dPPZPqOfjZSq7ibOaLNE6x/OvN+Nyy4NuXgAMc0Abyl3MBiZREPoXhbrpZ 8aUg== X-Gm-Message-State: ALoCoQkLJMkw84nG4Bu9CMFgFHdJJRVPFxR1x7OraMfUb990kMu6QySA5VdmClf5SxUShQ1+h+A6SLCZvyh3iT0E9NIMhLFZcw== X-Received: by 10.129.137.193 with SMTP id z184mr8127176ywf.257.1452869766222; Fri, 15 Jan 2016 06:56:06 -0800 (PST) Received: from jade.localdomain ([2804:14c:487:41f:6257:18ff:feab:2e8f]) by smtp.gmail.com with ESMTPSA id o123sm8267717ywd.2.2016.01.15.06.56.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jan 2016 06:56:05 -0800 (PST) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [RFC 06/29] staging/android: create a 'sync' dir for debugfs information Date: Fri, 15 Jan 2016 12:55:16 -0200 Message-Id: <1452869739-3304-7-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452869739-3304-1-git-send-email-gustavo@padovan.org> References: <1452869739-3304-1-git-send-email-gustavo@padovan.org> Cc: devel@driverdev.osuosl.org, daniels@collabora.com, Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Maarten Lankhorst , Gustavo Padovan , John Harrison X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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: Gustavo Padovan Creates the 'sync' dir on debugfs root dir and move the 'sync' file to sync/info. This is the preparation to add more debug info and control. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sync_debug.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index f45d13c..86d683b 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -30,6 +31,8 @@ #ifdef CONFIG_DEBUG_FS +static struct dentry *dbgfs; + static LIST_HEAD(sync_timeline_list_head); static DEFINE_SPINLOCK(sync_timeline_list_lock); static LIST_HEAD(sync_fence_list_head); @@ -208,13 +211,13 @@ static int sync_debugfs_show(struct seq_file *s, void *unused) return 0; } -static int sync_debugfs_open(struct inode *inode, struct file *file) +static int sync_info_debugfs_open(struct inode *inode, struct file *file) { return single_open(file, sync_debugfs_show, inode->i_private); } -static const struct file_operations sync_debugfs_fops = { - .open = sync_debugfs_open, +static const struct file_operations sync_info_debugfs_fops = { + .open = sync_info_debugfs_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, @@ -222,11 +225,21 @@ static const struct file_operations sync_debugfs_fops = { static __init int sync_debugfs_init(void) { - debugfs_create_file("sync", S_IRUGO, NULL, NULL, &sync_debugfs_fops); + dbgfs = debugfs_create_dir("sync", NULL); + + debugfs_create_file("info", 0444, dbgfs, NULL, &sync_info_debugfs_fops); + return 0; } late_initcall(sync_debugfs_init); +static __exit void sync_debugfs_exit(void) +{ + if (dbgfs) + debugfs_remove_recursive(dbgfs); +} +module_exit(sync_debugfs_exit); + #define DUMP_CHUNK 256 static char sync_dump_buf[64 * 1024]; void sync_dump(void)