* [PATCH] cxl: Add CONFIG_CXL_DEBUG to drivers/cxl
@ 2025-06-26 9:54 Yuquan Wang
2025-06-26 14:10 ` Ira Weiny
0 siblings, 1 reply; 2+ messages in thread
From: Yuquan Wang @ 2025-06-26 9:54 UTC (permalink / raw)
To: dave, jonathan.cameron, dave.jiang, alison.schofield,
vishal.l.verma, ira.weiny, dan.j.williams
Cc: linux-cxl, linux-kernel, chenbaozi, Yuquan Wang
CONFIG_CXL_DEBUG=y adds -DDEBUG to CFLAGS, which enables pr_debug()
and dev_dbg(). Users can use this config to open all cxl debug
messages.
Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
---
drivers/cxl/Kconfig | 10 ++++++++++
drivers/cxl/Makefile | 2 ++
2 files changed, 12 insertions(+)
diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig
index 48b7314afdb8..b7e5225e9d7c 100644
--- a/drivers/cxl/Kconfig
+++ b/drivers/cxl/Kconfig
@@ -233,4 +233,14 @@ config CXL_MCE
def_bool y
depends on X86_MCE && MEMORY_FAILURE
+config CXL_DEBUG
+ bool "CXL Debugging"
+ depends on DEBUG_KERNEL
+ help
+ Say Y here if you want the CXL core to produce a bunch of debug
+ messages to the system log. Select this if you are having a
+ problem with CXL support and want to see more of what is going on.
+
+ When in doubt, say N.
+
endif
diff --git a/drivers/cxl/Makefile b/drivers/cxl/Makefile
index 2caa90fa4bf2..9c0151a2b201 100644
--- a/drivers/cxl/Makefile
+++ b/drivers/cxl/Makefile
@@ -19,3 +19,5 @@ cxl_acpi-y := acpi.o
cxl_pmem-y := pmem.o security.o
cxl_mem-y := mem.o
cxl_pci-y := pci.o
+
+subdir-ccflags-$(CONFIG_CXL_DEBUG) := -DDEBUG
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cxl: Add CONFIG_CXL_DEBUG to drivers/cxl
2025-06-26 9:54 [PATCH] cxl: Add CONFIG_CXL_DEBUG to drivers/cxl Yuquan Wang
@ 2025-06-26 14:10 ` Ira Weiny
0 siblings, 0 replies; 2+ messages in thread
From: Ira Weiny @ 2025-06-26 14:10 UTC (permalink / raw)
To: Yuquan Wang, dave, jonathan.cameron, dave.jiang, alison.schofield,
vishal.l.verma, ira.weiny, dan.j.williams
Cc: linux-cxl, linux-kernel, chenbaozi, Yuquan Wang
Yuquan Wang wrote:
> CONFIG_CXL_DEBUG=y adds -DDEBUG to CFLAGS, which enables pr_debug()
> and dev_dbg(). Users can use this config to open all cxl debug
> messages.
There is no need for this.
Dynamic debugging can be turned on at run time.[1]
For example here is what run_qemu[2] adds to the cmdline to debug cxl with
cxl-test.
cxl_acpi.dyndbg=+fplm cxl_pci.dyndbg=+fplm cxl_core.dyndbg=+fplm
cxl_mem.dyndbg=+fplm cxl_pmem.dyndbg=+fplm cxl_port.dyndbg=+fplm
cxl_region.dyndbg=+fplm cxl_test.dyndbg=+fplm cxl_mock.dyndbg=+fplm
cxl_mock_mem.dyndbg=+fplm
Ira
[1] https://www.kernel.org/doc/html/v4.14/admin-guide/dynamic-debug-howto.html
[2] https://github.com/pmem/run_qemu
[snip]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-26 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 9:54 [PATCH] cxl: Add CONFIG_CXL_DEBUG to drivers/cxl Yuquan Wang
2025-06-26 14:10 ` Ira Weiny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).