From: Ben Cheatham <Benjamin.Cheatham@amd.com>
To: <nvdimm@lists.linux.dev>
Cc: <linux-cxl@vger.kernel.org>, <benjamin.cheatham@amd.com>,
<alison.schofield@intel.com>
Subject: [PATCH 4/6] cxl/list: Add debugfs option
Date: Thu, 24 Apr 2025 16:23:59 -0500 [thread overview]
Message-ID: <20250424212401.14789-5-Benjamin.Cheatham@amd.com> (raw)
In-Reply-To: <20250424212401.14789-1-Benjamin.Cheatham@amd.com>
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.Cheatham@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", ¶m.media_errors,
"include media-error information "),
OPT_INCR('v', "verbose", ¶m.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
next prev parent reply other threads:[~2025-04-24 21:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 21:23 [ndctl PATCH 0/6] Add error injection support Ben Cheatham
2025-04-24 21:23 ` [PATCH 1/6] libcxl: Add debugfs path to CXL context Ben Cheatham
2025-04-24 21:23 ` [PATCH 2/6] libcxl: Add CXL protocol errors Ben Cheatham
2025-04-24 21:23 ` [PATCH 3/6] libcxl: Add poison injection functions Ben Cheatham
2025-04-24 21:23 ` Ben Cheatham [this message]
2025-04-24 21:24 ` [PATCH 5/6] cxl/list: Add injectable-errors option Ben Cheatham
2025-04-24 21:24 ` [PATCH 6/6] cxl: Add inject-error command Ben Cheatham
2025-04-29 2:35 ` [ndctl PATCH 0/6] Add error injection support Alison Schofield
2025-04-29 20:01 ` Ben Cheatham
2025-04-30 0:53 ` Alison Schofield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250424212401.14789-5-Benjamin.Cheatham@amd.com \
--to=benjamin.cheatham@amd.com \
--cc=alison.schofield@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.