summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2018-12-10 15:00:28 +0100
committerChristoph Hellwig <hch@lst.de>2018-12-11 14:31:17 +0100
commit9f191555ba4ba8fc82e589670e46a7f79b72a157 (patch)
treebcebdb4a6936baa0b76afc0fcb2af283a8f9c889 /kernel
parentarch: switch the default on ARCH_HAS_SG_CHAIN (diff)
downloadlinux-9f191555ba4ba8fc82e589670e46a7f79b72a157.tar.xz
linux-9f191555ba4ba8fc82e589670e46a7f79b72a157.zip
dma-debug: Expose nr_total_entries in debugfs
Expose nr_total_entries in debugfs, so that {num,min}_free_entries become even more meaningful to users interested in current/maximum utilisation. This becomes even more relevant once nr_total_entries may change at runtime beyond just the existing AMD GART debug code. Suggested-by: John Garry <john.garry@huawei.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Tested-by: Qian Cai <cai@lca.pw> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dma/debug.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 231ca4628062..f6a141eb9438 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -142,6 +142,7 @@ static struct dentry *show_all_errors_dent __read_mostly;
static struct dentry *show_num_errors_dent __read_mostly;
static struct dentry *num_free_entries_dent __read_mostly;
static struct dentry *min_free_entries_dent __read_mostly;
+static struct dentry *nr_total_entries_dent __read_mostly;
static struct dentry *filter_dent __read_mostly;
/* per-driver filter related state */
@@ -926,6 +927,12 @@ static int dma_debug_fs_init(void)
if (!min_free_entries_dent)
goto out_err;
+ nr_total_entries_dent = debugfs_create_u32("nr_total_entries", 0444,
+ dma_debug_dent,
+ &nr_total_entries);
+ if (!nr_total_entries_dent)
+ goto out_err;
+
filter_dent = debugfs_create_file("driver_filter", 0644,
dma_debug_dent, NULL, &filter_fops);
if (!filter_dent)