From patchwork Thu Jan 21 12:49:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8080731 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ABE389F1CC for ; Thu, 21 Jan 2016 12:51:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA199203B4 for ; Thu, 21 Jan 2016 12:51:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 29669203A1 for ; Thu, 21 Jan 2016 12:51:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 512FE6EA9B; Thu, 21 Jan 2016 04:51:33 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f193.google.com (mail-yk0-f193.google.com [209.85.160.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 62D886EA9B for ; Thu, 21 Jan 2016 04:51:30 -0800 (PST) Received: by mail-yk0-f193.google.com with SMTP id k129so3239498yke.3 for ; Thu, 21 Jan 2016 04:51:30 -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=v6DeRsSdjcmrBWb1QkBdJxlpH9e/1TN7r+pdPSWAzWM=; b=A6jIcdww/065rTs0Er03BK3SKkWrRsBpHMdb9Nynf22ST5MRZw01TCQmTtuFkYtycQ fJLTOVYLBHEqOq3DTW+M7Iiv6wcENNXZVZcVBFRYTNNpgR88S4dgbfSDlHLnnJIZy9Qz 7xjFdDhMBehHmnbPh/SYJLBECCbF7BLmMtwWmcdiYdkP5xniTsGr/FEiyd155f5yY08R sF1Gwp2tY11w4u8nPDdRRwCfcHxcCTg8KbgUBvUiv1Bt3HrUAsxVfr15rElpwBQRMAf8 EA+H4lQHPoZtCmHnRYD4xcsXaSL+UjVruCJn9KwId5Eb0Bu4loUieXgdTeZTAupXpX/b ag+A== X-Gm-Message-State: ALoCoQnywORbh2lF9xuD9mAeFFg1FePXm48dgTzhvxmZ/Gke/AxDWKqHEvHOVIcnxq21RjsSvcBoUnVN2DZQdTWpaj5UgbIjrw== X-Received: by 10.13.242.5 with SMTP id b5mr23827290ywf.246.1453380689764; Thu, 21 Jan 2016 04:51:29 -0800 (PST) Received: from jade.localdomain ([177.194.47.65]) by smtp.gmail.com with ESMTPSA id z129sm588264ywb.26.2016.01.21.04.51.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2016 04:51:29 -0800 (PST) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH 04/11] staging/android: create a 'sync' dir for debugfs information Date: Thu, 21 Jan 2016 10:49:17 -0200 Message-Id: <1453380564-3328-5-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453380564-3328-1-git-send-email-gustavo@padovan.org> References: <1453380564-3328-1-git-send-email-gustavo@padovan.org> Cc: devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , 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 b366461..ca35f97 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); @@ -193,13 +196,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, @@ -207,11 +210,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)