Add "--debugfs" option to specify the path to the kernel debugfs.
Defaults to "/sys/kernel/debug" if left unspecified.

Signed-off-by: Ben Cheatham <benjamin.cheat...@amd.com>
---
 Documentation/cxl/cxl-list.txt | 4 ++++
 cxl/list.c                     | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/Documentation/cxl/cxl-list.txt b/Documentation/cxl/cxl-list.txt
index 9a9911e..56eb516 100644
--- a/Documentation/cxl/cxl-list.txt
+++ b/Documentation/cxl/cxl-list.txt
@@ -491,6 +491,10 @@ OPTIONS
        If the cxl tool was built with debug enabled, turn on debug
        messages.
 
+--debugfs::
+       Specifies the path to the kernel debug filesystem. If not specified,
+       to "/sys/kernel/debug".
+
 include::human-option.txt[]
 
 include::../copyright.txt[]
diff --git a/cxl/list.c b/cxl/list.c
index 0b25d78..5f77d87 100644
--- a/cxl/list.c
+++ b/cxl/list.c
@@ -13,6 +13,7 @@
 #include "filter.h"
 
 static struct cxl_filter_params param;
+static const char *debugfs;
 static bool debug;
 
 static const struct option options[] = {
@@ -60,6 +61,8 @@ static const struct option options[] = {
        OPT_BOOLEAN('L', "media-errors", &param.media_errors,
                    "include media-error information "),
        OPT_INCR('v', "verbose", &param.verbose, "increase output detail"),
+       OPT_STRING(0, "debugfs", &debugfs, "debugfs mount point",
+                  "mount point of kernel debugfs (defaults to 
'/sys/kernel/debug')"),
 #ifdef ENABLE_DEBUG
        OPT_BOOLEAN(0, "debug", &debug, "debug list walk"),
 #endif
@@ -146,6 +149,9 @@ int cmd_list(int argc, const char **argv, struct cxl_ctx 
*ctx)
                param.ctx.log_priority = LOG_DEBUG;
        }
 
+       if (debugfs)
+               cxl_set_debugfs(ctx, debugfs);
+
        if (cxl_filter_has(param.port_filter, "root") && param.ports)
                param.buses = true;
 
-- 
2.34.1


Reply via email to