xen: Kconfig: Add DEBUG_XEN config option
PATCH 1/1 xen: Kconfig: Add DEBUG_XEN config option
From: Andrii Anisov <[email protected]>
Add a debug option to enable xen drivers debug code.
--- drivers/xen/Kconfig | 8 ++++++++ drivers/xen/Makefile | 2 ++ 2 files changed, 10 insertions(+)
drivers/xen/Kconfig +8 -0
@@ -298,4 +298,12 @@ config XEN_SYMS config XEN_HAVE_VPMU bool +config DEBUG_XEN + bool "XEN Drivers debug" + depends on DEBUG_KERNEL + help + Say Y here if you want to enable XEN drivers debug code. + + If you are unsure about this, say N here. + endmenu
drivers/xen/Makefile +2 -0
@@ -42,3 +42,5 @@ xen-evtchn-y := evtchn.o xen-gntdev-y := gntdev.o xen-gntalloc-y := gntalloc.o xen-privcmd-y := privcmd.o + +ccflags-$(CONFIG_DEBUG_XEN) := -DDEBUG
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 5 lines · Andrii Anisov
From: Andrii Anisov <[email protected]>
Add a debug option to enable xen drivers debug code.
Signed-off-by Andrii Anisov <[email protected]>
In future you might want to add the maintainers to the recipient list.
Quoted 10 lines
--- drivers/xen/Kconfig | 8 ++++++++ drivers/xen/Makefile | 2 ++ 2 files changed, 10 insertions(+)drivers/xen/Kconfig +0
-0
drivers/xen/Kconfig config XEN_SYMS · line 307
Quoted 10 lines
drivers/xen/Kconfig +7
-0@@ -298,4 +298,12 @@ config XEN_SYMS config XEN_HAVE_VPMU bool +config DEBUG_XEN + bool "XEN Drivers debug" + depends on DEBUG_KERNEL + help + Say Y here if you want to enable XEN drivers debug code. + + If you are unsure about this, say N here.
So is this really a sensible thing to do? I don't see the value for such a global config option possibly switching so many different drivers to debug mode.
In reality you want to do something like "debug" for a single driver only during time of development. This won't need a global config option but just a "#define" in the driver which is active while developing and testing and which should be removed or commented out when the final submission of the driver is done.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Hi Juergen,
Quoted 34 lines · Juergen Gross
Quoted 5 lines · Andrii Anisov
From: Andrii Anisov <[email protected]>
Add a debug option to enable xen drivers debug code.
Signed-off-by Andrii Anisov <[email protected]>In future you might want to add the maintainers to the recipient list.
Quoted 10 lines
--- drivers/xen/Kconfig | 8 ++++++++ drivers/xen/Makefile | 2 ++ 2 files changed, 10 insertions(+)drivers/xen/Kconfig +0
-0drivers/xen/Kconfig config XEN_SYMS · line 307
Quoted 10 lines
drivers/xen/Kconfig +7
-0@@ -298,4 +298,12 @@ config XEN_SYMS config XEN_HAVE_VPMU bool +config DEBUG_XEN + bool "XEN Drivers debug" + depends on DEBUG_KERNEL + help + Say Y here if you want to enable XEN drivers debug code. + + If you are unsure about this, say N here.So is this really a sensible thing to do? I don't see the value for such a global config option possibly switching so many different drivers to debug mode.
Quoted 5 lines
In reality you want to do something like "debug" for a single driver only during time of development. This won't need a global config option but just a "#define" in the driver which is active while developing and testing and which should be removed or commented out when the final submission of the driver is done.
This Kconfig was suggested in the context of [1]. The number of people working on swiotlb is very limited, but the check added is really useful in debug build to catch potential misuse for anyone.
Do you have any other idea to turn this check on for debug build??
Cheers,
[1] https://lists.xen.org/archives/html/xen-devel/2017-01/msg03448.html
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 43 lines · Julien Grall
Hi Juergen,
Quoted 34 lines · Juergen Gross
Quoted 5 lines · Andrii Anisov
From: Andrii Anisov <[email protected]>
Add a debug option to enable xen drivers debug code.
Signed-off-by Andrii Anisov <[email protected]>In future you might want to add the maintainers to the recipient list.
Quoted 10 lines
--- drivers/xen/Kconfig | 8 ++++++++ drivers/xen/Makefile | 2 ++ 2 files changed, 10 insertions(+)drivers/xen/Kconfig +0
-0drivers/xen/Kconfig config XEN_SYMS · line 307
Quoted 10 lines
drivers/xen/Kconfig +7
-0@@ -298,4 +298,12 @@ config XEN_SYMS config XEN_HAVE_VPMU bool +config DEBUG_XEN + bool "XEN Drivers debug" + depends on DEBUG_KERNEL + help + Say Y here if you want to enable XEN drivers debug code. + + If you are unsure about this, say N here.So is this really a sensible thing to do? I don't see the value for such a global config option possibly switching so many different drivers to debug mode.
Quoted 5 lines
In reality you want to do something like "debug" for a single driver only during time of development. This won't need a global config option but just a "#define" in the driver which is active while developing and testing and which should be removed or commented out when the final submission of the driver is done.
Quoted 5 lines
This
Kconfigwas suggested in the context of [1]. The number of people working on swiotlb is very limited, but the check added is really useful in debug build to catch potential misuse for anyone.Do you have any other idea to turn this check on for debug build??
I think for this use case we would want either a more specific config option name (e.g. DEBUG_XEN_SWIOTLB) or a more specific description what it is doing, like e.g.:
"Say Y here if you want to enable XEN drivers debug code adding more
sanity checks to Xen drivers eventually crashing the kernel in case of detected inconsistencies. Enabling this option might slow down the kernel. It is not appropriate for production.
If you are unsure about this, say N here."
This would make clear that this option should not be used to spam the console with thousands of messages by dozens of different drivers, but for catching potential bugs early, and shipping a kernel with this option enabled is not a good idea.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 48 lines · Juergen Gross
Quoted 47 lines · Julien Grall
Hi Juergen,
Quoted 34 lines · Juergen Gross
Quoted 5 lines · Andrii Anisov
From: Andrii Anisov <[email protected]>
Add a debug option to enable xen drivers debug code.
Signed-off-by Andrii Anisov <[email protected]>In future you might want to add the maintainers to the recipient list.
Quoted 10 lines
--- drivers/xen/Kconfig | 8 ++++++++ drivers/xen/Makefile | 2 ++ 2 files changed, 10 insertions(+)drivers/xen/Kconfig +0
-0drivers/xen/Kconfig config XEN_SYMS · line 307
Quoted 10 lines
drivers/xen/Kconfig +7
-0@@ -298,4 +298,12 @@ config XEN_SYMS config XEN_HAVE_VPMU bool +config DEBUG_XEN + bool "XEN Drivers debug" + depends on DEBUG_KERNEL + help + Say Y here if you want to enable XEN drivers debug code. + + If you are unsure about this, say N here.So is this really a sensible thing to do? I don't see the value for such a global config option possibly switching so many different drivers to debug mode.
Quoted 5 lines
In reality you want to do something like "debug" for a single driver only during time of development. This won't need a global config option but just a "#define" in the driver which is active while developing and testing and which should be removed or commented out when the final submission of the driver is done.
This
Kconfigwas suggested in the context of [1]. The number of people working on swiotlb is very limited, but the check added is really useful in debug build to catch potential misuse for anyone.
Quoted 5 lines
Quoted 1 line
Do you have any other idea to turn this check on for debug build??
I think for this use case we would want either a more specific config option name (e.g.
DEBUG_XEN_SWIOTLB) or a more specific description what it is doing, like e.g.:
I really don't want to add this in the Xen SWIOTLB.
It is kind of pointless - I would prefer if the debug code had just #if 0 with a comment explaining why it is such and what it can be used for.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Dear Juergen,
Quoted 1 line
In future you might want to add the maintainers to the recipient list.
Yep, I would take care to not miss this point.
And +1 to Julien's comment.
Sincerely,
Andrii Anisov.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel