From patchwork Mon Feb 3 12:29:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Semwal X-Patchwork-Id: 3570131 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 109419F382 for ; Mon, 3 Feb 2014 18:08:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43285201B6 for ; Mon, 3 Feb 2014 18:08:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 754B720181 for ; Mon, 3 Feb 2014 18:08:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E37A110A02; Mon, 3 Feb 2014 10:04:45 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 492D7F9E74 for ; Mon, 3 Feb 2014 07:15:16 -0800 (PST) Received: by mail-pb0-f43.google.com with SMTP id md12so7158002pbc.2 for ; Mon, 03 Feb 2014 07:15:16 -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; bh=BlB922n34NAC10SbIobq5a8iMzIklZvpnDIgxopuKHY=; b=Sy0oF996P3ZX5lEzlWMAaqU3cYtM9juky8Ds4sweXb8I20yulyGskXaAlPkkSoC+G7 6I9PJZakkcIKwkMIU94iCNcoJnn3CD8mBzTTXYtzb5xrkkJCu6exywHQrbjIe8PBOupU m0qa/G2hh2dvLQZOxIiJPBkJ8CG+FcLLpuMRL7AekB+RV9Neij3dPGJJsUg9BSjFKf5L 3rp2UCtNrcGD17iTQLHTE4VmOY+QwDxsLxA+z6Win8nhdf2HwXYnNoCAbcv69aumoqCE Ts8Hb8dddhn7EiLWD42KEJnnIuCx+aRdtYHO1TioFD0LitMVLMs2lV6Bhh/0DxQ++9V/ qgLA== X-Gm-Message-State: ALoCoQnLUlz1T6eaQ8RrHjQHMivVGeV8acDq6GbuDtB7iLsX4OFsnemQnN8VMNyLjEjItXxr89Mt X-Received: by 10.67.22.38 with SMTP id hp6mr37105725pad.53.1391430609020; Mon, 03 Feb 2014 04:30:09 -0800 (PST) Received: from localhost.localdomain ([122.179.40.212]) by mx.google.com with ESMTPSA id db3sm55650937pbb.10.2014.02.03.04.30.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 04:30:08 -0800 (PST) From: Sumit Semwal To: linux@arm.linux.org.uk Subject: [PATCH] dma-buf: update debugfs output Date: Mon, 3 Feb 2014 17:59:41 +0530 Message-Id: <1391430581-18522-1-git-send-email-sumit.semwal@linaro.org> X-Mailer: git-send-email 1.8.3.2 Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, 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 Russell King observed 'wierd' looking output from debugfs, and also suggested better ways of getting device names (use KBUILD_MODNAME, dev_name()) This patch addresses these issues to make the debugfs output correct and better looking. Signed-off-by: Sumit Semwal --- drivers/base/dma-buf.c | 18 ++++++++---------- include/linux/dma-buf.h | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index cfe1d8b..bf89fe3 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c @@ -621,7 +621,7 @@ static int dma_buf_describe(struct seq_file *s) return ret; seq_printf(s, "\nDma-buf Objects:\n"); - seq_printf(s, "\texp_name\tsize\tflags\tmode\tcount\n"); + seq_printf(s, "size\tflags\tmode\tcount\texp_name\n"); list_for_each_entry(buf_obj, &db_list.head, list_node) { ret = mutex_lock_interruptible(&buf_obj->lock); @@ -632,24 +632,22 @@ static int dma_buf_describe(struct seq_file *s) continue; } - seq_printf(s, "\t"); - - seq_printf(s, "\t%s\t%08zu\t%08x\t%08x\t%08ld\n", - buf_obj->exp_name, buf_obj->size, + seq_printf(s, "%08zu\t%08x\t%08x\t%08ld\t%s\n", + buf_obj->size, buf_obj->file->f_flags, buf_obj->file->f_mode, - (long)(buf_obj->file->f_count.counter)); + (long)(buf_obj->file->f_count.counter), buf_obj->exp_name); - seq_printf(s, "\t\tAttached Devices:\n"); + seq_printf(s, "\tAttached Devices:\n"); attach_count = 0; list_for_each_entry(attach_obj, &buf_obj->attachments, node) { - seq_printf(s, "\t\t"); + seq_printf(s, "\t"); - seq_printf(s, "%s\n", attach_obj->dev->init_name); + seq_printf(s, "%s\n", dev_name(attach_obj->dev)); attach_count++; } - seq_printf(s, "\n\t\tTotal %d devices attached\n", + seq_printf(s, "\nTotal %d devices attached\n", attach_count); count++; diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index dfac5ed..f886985 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -171,7 +171,7 @@ struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, size_t size, int flags, const char *); #define dma_buf_export(priv, ops, size, flags) \ - dma_buf_export_named(priv, ops, size, flags, __FILE__) + dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME) int dma_buf_fd(struct dma_buf *dmabuf, int flags); struct dma_buf *dma_buf_get(int fd);