Skip to contentSkip to conversation

Kconfig debug options

PATCH Superseded Doug Goldstein 3 participants 21 messages May 10, 2016 – May 18, 2016

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Kconfig debug options

This converts the debug options from xen/Rules.mk to Kconfig.

This is a change from the previous version in the series because the feedback I got was that the debug options should not be linked to NDEBUG if EXPERT is set. Unfortunately Kconfig does not let you descend into a menu if that menu is not set. As a result this changes the way the menu works to just be a plain menu and moving the NDEBUG (!CONFIG_DEBUG) to another menu item.

change since v2:
- dropped patch 5 as it was unwanted
- remove 'default n'
- redo patch 1 as described above

Doug Goldstein (6):
build: add debug menu to Kconfig
build: convert crash_debug to Kconfig
build: convert verbose to Kconfig
build: convert frame_pointer to Kconfig
build: convert perfc{,_arrays} to Kconfig
build: convert lock_profile to Kconfig

 INSTALL                           |  6 -----
 docs/misc/crashdb.txt             |  4 +--
 xen/Kconfig                       |  2 ++
 xen/Kconfig.debug                 | 54 +++++++++++++++++++++++++++++++++++++++
 xen/Rules.mk                      | 31 +++++-----------------
 xen/arch/arm/kernel.c             |  2 +-
 xen/arch/arm/xen.lds.S            |  2 +-
 xen/arch/x86/Makefile             |  3 +--
 xen/arch/x86/domain.c             |  2 +-
 xen/arch/x86/domain_build.c       |  2 +-
 xen/arch/x86/hvm/hvm.c            |  2 +-
 xen/arch/x86/time.c               |  4 +--
 xen/arch/x86/x86_64/Makefile      |  2 +-
 xen/arch/x86/x86_64/asm-offsets.c |  2 +-
 xen/arch/x86/xen.lds.S            |  2 +-
 xen/common/Makefile               |  4 +--
 xen/common/keyhandler.c           |  4 +--
 xen/common/perfc.c                |  2 +-
 xen/common/spinlock.c             | 10 ++++----
 xen/common/sysctl.c               |  4 +--
 xen/include/asm-x86/asm_defns.h   |  2 +-
 xen/include/asm-x86/debugger.h    |  2 +-
 xen/include/asm-x86/domain.h      |  2 +-
 xen/include/xen/config.h          |  4 +++
 xen/include/xen/gdbstub.h         |  2 +-
 xen/include/xen/perfc.h           |  8 +++---
 xen/include/xen/sched.h           |  2 +-
 xen/include/xen/spinlock.h        |  4 +--
 xen/include/xsm/dummy.h           |  2 +-
 29 files changed, 104 insertions(+), 68 deletions(-)
 create mode 100644 xen/Kconfig.debug
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw

PATCH v3 1/6 build: add debug menu to Kconfig

There are a number of debugging options for Xen so the idea is to have a menu to group them all together. Enabling this menu item will also disable NDEBUG which will result in more debug prints. This was previously wired into the 'debug=y' command line option.

---
CC: Andrew Cooper <[email protected]>
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>

---
 xen/Kconfig              |  2 ++
 xen/Kconfig.debug        | 11 +++++++++++
 xen/Rules.mk             |  2 --
 xen/include/xen/config.h |  4 ++++
 4 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 xen/Kconfig.debug
xen/Kconfig +2 -0
index fa8b27c..0fe7a1a 100644
@@ -26,3 +26,5 @@ config DEFCONFIG_LIST
 config EXPERT
 	string
 	option env="XEN_CONFIG_EXPERT"
+
+source "Kconfig.debug"
xen/Kconfig.debug new file +11 -0
new file mode 100644
index 0000000..47dc885
@@ -0,0 +1,11 @@
+
+menu "Debugging Options"
+
+config DEBUG
+	bool "Developer Checks"
+	---help---
+	  Enables developer checks such as asserts and extra printks, this
+	  option is intended for development purposes only, and not for
+	  production use.
+
+endmenu
xen/Rules.mk +0 -2
index 961d533..f73d86e 100644
@@ -20,8 +20,6 @@ include $(XEN_ROOT)/Config.mk
 ifeq ($(debug),y)
 verbose       := y
 frame_pointer := y
-else
-CFLAGS += -DNDEBUG
 endif
 ifeq ($(perfc_arrays),y)
 perfc := y
xen/include/xen/config.h +4 -0
index ef6e5ee..473c5e8 100644
@@ -81,4 +81,8 @@
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
+#ifndef CONFIG_DEBUG
+#define NDEBUG
+#endif
+
 #endif /* __XEN_CONFIG_H__ */
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#2 lore raw

Re: [PATCH v3 1/6] build: add debug menu to Kconfig

Quoted 39 lines · Doug Goldstein

There are a number of debugging options for Xen so the idea is to have a menu to group them all together. Enabling this menu item will also disable NDEBUG which will result in more debug prints. This was previously wired into the 'debug=y' command line option.

---
CC: Andrew Cooper <[email protected]>
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>

---
 xen/Kconfig              |  2 ++
 xen/Kconfig.debug        | 11 +++++++++++
 xen/Rules.mk             |  2 --
 xen/include/xen/config.h |  4 ++++
 4 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 xen/Kconfig.debug
xen/Kconfig +2 -0
index fa8b27c..0fe7a1a 100644
@@ -26,3 +26,5 @@ config DEFCONFIG_LIST
 config EXPERT
 	string
 	option env="XEN_CONFIG_EXPERT"
+
+source "Kconfig.debug"
xen/Kconfig.debug new file +0 -0
new file mode 100644
index 0000000..47dc885

xen/Kconfig.debug line 9

Quoted 9 lines
xen/Kconfig.debug new file +9 -0
@@ -0,0 +1,11 @@
+
+menu "Debugging Options"
+
+config DEBUG
+	bool "Developer Checks"
+	---help---
+	  Enables developer checks such as asserts and extra printks, this
+	  option is intended for development purposes only, and not for
+	  production use.

"You probably want to say 'N' here."

Otherwise it looks good to me.

Quoted 31 lines
xen/Kconfig.debug new file +2 -0
+
+endmenu
xen/Rules.mk +0 -2
index 961d533..f73d86e 100644
@@ -20,8 +20,6 @@ include $(XEN_ROOT)/Config.mk
 ifeq ($(debug),y)
 verbose       := y
 frame_pointer := y
-else
-CFLAGS += -DNDEBUG
 endif
 ifeq ($(perfc_arrays),y)
 perfc := y
xen/include/xen/config.h +4 -0
index ef6e5ee..473c5e8 100644
@@ -81,4 +81,8 @@
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
+#ifndef CONFIG_DEBUG
+#define NDEBUG
+#endif
+
 #endif /* __XEN_CONFIG_H__ */
Signature · 1 line
2.7.3

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw

PATCH v3 2/6 build: convert crash_debug to Kconfig

In reply to Doug Goldstein

Convert the crash_debug option to Kconfig as CONFIG_CRASH_DEBUG. This was previously togglable on the command line so this adds a message for users enabling it from the command line to tell them to enable it from make menuconfig.

---
CC: Andrew Cooper <[email protected]>
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>

---
 INSTALL                        | 1 -
 docs/misc/crashdb.txt          | 4 ++--
 xen/Kconfig.debug              | 7 +++++++
 xen/Rules.mk                   | 5 +++--
 xen/arch/x86/Makefile          | 3 +--
 xen/arch/x86/x86_64/Makefile   | 2 +-
 xen/common/Makefile            | 2 +-
 xen/include/asm-x86/debugger.h | 2 +-
 xen/include/xen/gdbstub.h      | 2 +-
 9 files changed, 17 insertions(+), 11 deletions(-)
INSTALL +0 -1
index 95fa94d..2974b9b 100644
@@ -231,7 +231,6 @@ verbose=y
 perfc=y
 perfc_arrays=y
 lock_profile=y
-crash_debug=y
 frame_pointer=y
 lto=y
 
docs/misc/crashdb.txt +2 -2
index b41a538..9733666 100644
@@ -5,7 +5,7 @@ Xen has a simple gdb stub for doing post-mortem debugging i.e. once
 you've crashed it, you get to poke around and find out why.  There's
 also a special key handler for making it crash, which is handy.
 
-You need to have crash_debug=y set when compiling , and you also need
+You need to have CRASH_DEBUG=y set when compiling, and you also need
 to enable it on the Xen command line, eg by gdb=com1.
 
 If you need to have a serial port shared between gdb and the console,
@@ -19,7 +19,7 @@ if you have a simple null modem connection between the test box and
 the workstation, and aren't using a H/L split console:
 
   * Set debug=y in Config.mk
-  * Set crash_debug=y in xen/Rules.mk
+  * Set CRASH_DEBUG=y with `make -C xen menuconfig`
   * Make the changes in the attached patch, and build.
   * Arrange to pass gdb=com1 as a hypervisor command line argument
     (I already have com1=38400,8n1 console=com1,vga sync_console)
xen/Kconfig.debug +7 -0
index 47dc885..8abfbaa 100644
@@ -1,6 +1,13 @@
 
 menu "Debugging Options"
 
+config CRASH_DEBUG
+	bool "Crash Debugging Support"
+	depends on X86
+	---help---
+	  If you want to be able to attach gdb to Xen to be able to debug
+	  Xen if it crashes then say Y.
+
 config DEBUG
 	bool "Developer Checks"
 	---help---
xen/Rules.mk +3 -2
index f73d86e..1a220bd 100644
@@ -7,7 +7,6 @@ verbose       ?= n
 perfc         ?= n
 perfc_arrays  ?= n
 lock_profile  ?= n
-crash_debug   ?= n
 frame_pointer ?= n
 lto           ?= n
 
@@ -28,6 +27,9 @@ endif
 ifneq ($(origin kexec),undefined)
 $(error "You must use 'make menuconfig' to enable/disable kexec now.")
 endif
+ifneq ($(origin crash_debug),undefined)
+$(error "You must use 'make menuconfig' to enable/disable crash_debug now.")
+endif
 
 # Set ARCH/SUBARCH appropriately.
 override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
@@ -56,7 +58,6 @@ CFLAGS += -Wa,--strip-local-absolute
 endif
 
 CFLAGS-$(verbose)       += -DVERBOSE
-CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
 CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
xen/arch/x86/Makefile +1 -2
index 4665a68..4ccef4a 100644
@@ -27,6 +27,7 @@ obj-y += domain_page.o
 obj-y += e820.o
 obj-y += extable.o
 obj-y += flushtlb.o
+obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
@@ -66,8 +67,6 @@ obj-y += vm_event.o
 obj-$(CONFIG_XSPLICE) += alternative.o xsplice.o
 obj-y += xstate.o
 
-obj-$(crash_debug) += gdbstub.o
-
 x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
 
 efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
xen/arch/x86/x86_64/Makefile +1 -1
index 5b54c16..d8815e7 100644
@@ -14,4 +14,4 @@ obj-y += cpu_idle.o
 obj-y += cpufreq.o
 obj-bin-$(CONFIG_KEXEC) += kexec_reloc.o
 
-obj-$(crash_debug)   += gdbstub.o
+obj-$(CONFIG_CRASH_DEBUG)   += gdbstub.o
xen/common/Makefile +1 -1
index afd84b6..a98bcc2 100644
@@ -8,6 +8,7 @@ obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
 obj-y += event_fifo.o
+obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o
 obj-y += grant_table.o
 obj-y += guestcopy.o
 obj-bin-y += gunzip.init.o
@@ -64,7 +65,6 @@ obj-$(CONFIG_XSPLICE) += xsplice_elf.o
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
 obj-$(perfc)       += perfc.o
-obj-$(crash_debug) += gdbstub.o
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
 
xen/include/asm-x86/debugger.h +1 -1
index 33f4700..271cbaa 100644
@@ -39,7 +39,7 @@
 #define DEBUGGER_trap_fatal(_v, _r) \
     if ( debugger_trap_fatal(_v, _r) ) return;
 
-#if defined(CRASH_DEBUG)
+#ifdef CONFIG_CRASH_DEBUG
 
 #include <xen/gdbstub.h>
 
xen/include/xen/gdbstub.h +1 -1
index ab710da..a5e6714 100644
@@ -23,7 +23,7 @@
 #include <asm/atomic.h>
 #include <asm/page.h>
 
-#ifdef CRASH_DEBUG
+#ifdef CONFIG_CRASH_DEBUG
 
 struct gdb_context {
     int                 serhnd;           /* handle on our serial line */
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#4 lore raw

Re: [PATCH v3 2/6] build: convert crash_debug to Kconfig

Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -1,6 +1,13 @@
 
 menu "Debugging Options"
 

xen/Kconfig.debug line 13

Quoted 10 lines
xen/Kconfig.debug +7 -0
+config CRASH_DEBUG
+	bool "Crash Debugging Support"
+	depends on X86
+	---help---
+	  If you want to be able to attach gdb to Xen to be able to debug
+	  Xen if it crashes then say Y.
+
 config DEBUG
 	bool "Developer Checks"
 	---help---

Is this really meant to be independent of DEBUG (or EXPERT), as it's being placed ahead of DEBUG?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw

Re: [PATCH v3 2/6] build: convert crash_debug to Kconfig

Quoted 21 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -1,6 +1,13 @@
 
 menu "Debugging Options"
 

xen/Kconfig.debug line 13

Quoted 10 lines
xen/Kconfig.debug +7 -0
+config CRASH_DEBUG
+	bool "Crash Debugging Support"
+	depends on X86
+	---help---
+	  If you want to be able to attach gdb to Xen to be able to debug
+	  Xen if it crashes then say Y.
+
 config DEBUG
 	bool "Developer Checks"
 	---help---

Is this really meant to be independent of DEBUG (or EXPERT), as it's being placed ahead of DEBUG?

Quoted 2 lines

Jan

That's what we talked about with v2. You wanted it to be independent if EXPERT was set but when you have something defined as "menuconfig XXXX" you cannot then have a rule "if XXXX || EXPERT" as you asked for in v2. So I needed to make them independent always which is what I did.

Let me restate more generically, if things are dependent on a menu for the sub-menu items to be displayed (as in v2) then the menu must be enabled and cannot be conditionally displayed on another option.

Roughly think of it this way:

menuconfig SOME_STATE

if SOME_STATE || EXPERT

config OTHER

endif

is the following code:

if (SOME_STATE) {

  if (SOME_STATE or EXPERT) {
    printf("got here\n");

}
}

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw

Re: [PATCH v3 2/6] build: convert crash_debug to Kconfig

Quoted 43 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 19:35, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -1,6 +1,13 @@
 
 menu "Debugging Options"
 
Quoted 13 lines

xen/Kconfig.debug line 13

Quoted 10 lines
xen/Kconfig.debug +7 -0
+config CRASH_DEBUG
+	bool "Crash Debugging Support"
+	depends on X86
+	---help---
+	  If you want to be able to attach gdb to Xen to be able to debug
+	  Xen if it crashes then say Y.
+
 config DEBUG
 	bool "Developer Checks"
 	---help---

Is this really meant to be independent of DEBUG (or EXPERT), as it's being placed ahead of DEBUG?

That's what we talked about with v2. You wanted it to be independent if EXPERT was set but when you have something defined as "menuconfig XXXX" you cannot then have a rule "if XXXX || EXPERT" as you asked for in v2. So I needed to make them independent always which is what I did.

Let me restate more generically, if things are dependent on a menu for the sub-menu items to be displayed (as in v2) then the menu must be enabled and cannot be conditionally displayed on another option.

Roughly think of it this way:

menuconfig SOME_STATE

if SOME_STATE || EXPERT

config OTHER

endif

Quoted 8 lines

is the following code:

if (SOME_STATE) {

  if (SOME_STATE or EXPERT) {
    printf("got here\n");

}
}

But there's no menuconfig anymore, for precisely that reason (aiui).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw

Re: [PATCH v3 2/6] build: convert crash_debug to Kconfig

Quoted 52 lines · Jan Beulich
Quoted 43 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 19:35, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -1,6 +1,13 @@
 
 menu "Debugging Options"
 
Quoted 13 lines

xen/Kconfig.debug line 13

Quoted 10 lines
xen/Kconfig.debug +7 -0
+config CRASH_DEBUG
+	bool "Crash Debugging Support"
+	depends on X86
+	---help---
+	  If you want to be able to attach gdb to Xen to be able to debug
+	  Xen if it crashes then say Y.
+
 config DEBUG
 	bool "Developer Checks"
 	---help---

Is this really meant to be independent of DEBUG (or EXPERT), as it's being placed ahead of DEBUG?

That's what we talked about with v2. You wanted it to be independent if EXPERT was set but when you have something defined as "menuconfig XXXX" you cannot then have a rule "if XXXX || EXPERT" as you asked for in v2. So I needed to make them independent always which is what I did.

Let me restate more generically, if things are dependent on a menu for the sub-menu items to be displayed (as in v2) then the menu must be enabled and cannot be conditionally displayed on another option.

Roughly think of it this way:

menuconfig SOME_STATE

if SOME_STATE || EXPERT

config OTHER

endif

Quoted 8 lines

is the following code:

if (SOME_STATE) {

  if (SOME_STATE or EXPERT) {
    printf("got here\n");

}
}

Quoted 4 lines

But there's no menuconfig anymore, for precisely that reason (aiui).

Jan

Right. That's what I was trying to get across. What I gathered from past reviews is that it should to be independent of DEBUG correct?

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw

Re: [PATCH v3 2/6] build: convert crash_debug to Kconfig

Quoted 54 lines
Quoted 1 line
Quoted 1 line · On 18.05.16 at 04:15, <[email protected]> wrote:
Quoted 52 lines · Jan Beulich
Quoted 51 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 19:35, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -1,6 +1,13 @@
 
 menu "Debugging Options"
 
Quoted 13 lines

xen/Kconfig.debug line 13

Quoted 10 lines
xen/Kconfig.debug +7 -0
+config CRASH_DEBUG
+	bool "Crash Debugging Support"
+	depends on X86
+	---help---
+	  If you want to be able to attach gdb to Xen to be able to debug
+	  Xen if it crashes then say Y.
+
 config DEBUG
 	bool "Developer Checks"
 	---help---

Is this really meant to be independent of DEBUG (or EXPERT), as it's being placed ahead of DEBUG?

That's what we talked about with v2. You wanted it to be independent if EXPERT was set but when you have something defined as "menuconfig XXXX" you cannot then have a rule "if XXXX || EXPERT" as you asked for in v2. So I needed to make them independent always which is what I did.

Let me restate more generically, if things are dependent on a menu for the sub-menu items to be displayed (as in v2) then the menu must be enabled and cannot be conditionally displayed on another option.

Roughly think of it this way:

menuconfig SOME_STATE

if SOME_STATE || EXPERT

config OTHER

endif

is the following code:

if (SOME_STATE) {

  if (SOME_STATE or EXPERT) {
    printf("got here\n");

}
}

Quoted 4 lines
Quoted 1 line

But there's no menuconfig anymore, for precisely that reason (aiui).

Right. That's what I was trying to get across. What I gathered from past reviews is that it should to be independent of DEBUG correct?

"It" being what? The CRASH_DEBUG above? That would be the question I asked you in my initial reply (still visible above); I don't think it should be, but instead should, like all the other DEBUG controlled ones, be dependent on "DEBUG || EXPERT" as said a number of times.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw

PATCH v3 3/6 build: convert verbose to Kconfig

In reply to Doug Goldstein

Convert 'verbose', which was enabled by 'debug=y' to Kconfig as CONFIG_VERBOSE_DEBUG which is enabled by default when CONFIG_DEBUG is enabled.

---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Daniel De Graaf <[email protected]>

---
 INSTALL                     | 1 -
 xen/Kconfig.debug           | 7 +++++++
 xen/Rules.mk                | 3 ---
 xen/arch/arm/kernel.c       | 2 +-
 xen/arch/x86/domain_build.c | 2 +-
 xen/include/xsm/dummy.h     | 2 +-
 6 files changed, 10 insertions(+), 7 deletions(-)
INSTALL +0 -1
index 2974b9b..35668bd 100644
@@ -227,7 +227,6 @@ VGABIOS_REL_DATE="dd Mon yyyy"
 
 The following variables can be used to tweak some aspects of the
 hypervisor build.
-verbose=y
 perfc=y
 perfc_arrays=y
 lock_profile=y
xen/Kconfig.debug +7 -0
index 8abfbaa..734e78d 100644
@@ -15,4 +15,11 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
+config VERBOSE_DEBUG
+	bool "Verbose debug messages"
+	default DEBUG
+	---help---
+	  Guest output from HYPERVISOR_console_io and hypervisor parsing
+	  ELF images (dom0) is logged in the Xen ring buffer.
+
 endmenu
xen/Rules.mk +0 -3
index 1a220bd..b159451 100644
@@ -3,7 +3,6 @@
 # If you change any of these configuration options then you must
 # 'make clean' before rebuilding.
 #
-verbose       ?= n
 perfc         ?= n
 perfc_arrays  ?= n
 lock_profile  ?= n
@@ -17,7 +16,6 @@ include $(XEN_ROOT)/Config.mk
 # Hardcoded configuration implications and dependencies.
 # Do this is a neater way if it becomes unwieldy.
 ifeq ($(debug),y)
-verbose       := y
 frame_pointer := y
 endif
 ifeq ($(perfc_arrays),y)
@@ -57,7 +55,6 @@ ifneq ($(clang),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
-CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
 CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
xen/arch/arm/kernel.c +1 -1
index 9871bd9..3f6cce3 100644
@@ -472,7 +472,7 @@ static int kernel_elf_probe(struct kernel_info *info,
 
     if ( (rc = elf_init(&info->elf.elf, info->elf.kernel_img, size )) != 0 )
         goto err;
-#ifdef VERBOSE
+#ifdef CONFIG_VERBOSE_DEBUG
     elf_set_verbose(&info->elf.elf);
 #endif
     elf_parse_binary(&info->elf.elf);
xen/arch/x86/domain_build.c +1 -1
index f9a3eca..b29c377 100644
@@ -942,7 +942,7 @@ int __init construct_dom0(
 
     if ( (rc = elf_init(&elf, image_start, image_len)) != 0 )
         return rc;
-#ifdef VERBOSE
+#ifdef CONFIG_VERBOSE_DEBUG
     elf_set_verbose(&elf);
 #endif
     elf_parse_binary(&elf);
xen/include/xsm/dummy.h +1 -1
index abbe282..406cd18 100644
@@ -215,7 +215,7 @@ static XSM_INLINE int xsm_memory_stat_reservation(XSM_DEFAULT_ARG struct domain
 static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
-#ifdef VERBOSE
+#ifdef CONFIG_VERBOSE_DEBUG
     if ( cmd == CONSOLEIO_write )
         return xsm_default_action(XSM_HOOK, d, NULL);
 #endif
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#10 lore raw

Re: [PATCH v3 3/6] build: convert verbose to Kconfig

xen/Kconfig.debug config DEBUG · line 23

Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +6 -0
@@ -15,4 +15,11 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
+config VERBOSE_DEBUG
+	bool "Verbose debug messages"
+	default DEBUG
+	---help---
+	  Guest output from HYPERVISOR_console_io and hypervisor parsing
+	  ELF images (dom0) is logged in the Xen ring buffer.

The "depends on DEBUG || EXPERT" did get lost here (or, looking at the following patch, a respective "if" framing them all).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#11 lore raw

Re: [PATCH v3 3/6] build: convert verbose to Kconfig

Quoted 17 lines · Jan Beulich

xen/Kconfig.debug config DEBUG · line 23

Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +6 -0
@@ -15,4 +15,11 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
+config VERBOSE_DEBUG
+	bool "Verbose debug messages"
+	default DEBUG
+	---help---
+	  Guest output from HYPERVISOR_console_io and hypervisor parsing
+	  ELF images (dom0) is logged in the Xen ring buffer.

The "depends on DEBUG || EXPERT" did get lost here (or, looking at the following patch, a respective "if" framing them all).

Quoted 2 lines

Jan

This option is always visible to someone and is not dependent on DEBUG due to the if not being possible in the form you asked. So I adjusted it to "default DEBUG" as you had asked. I can make this option dependent on DEBUG or EXPERT.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#12 lore raw

Re: [PATCH v3 3/6] build: convert verbose to Kconfig

Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 19:37, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -15,4 +15,11 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
Quoted 9 lines

xen/Kconfig.debug config DEBUG · line 23

Quoted 6 lines
xen/Kconfig.debug +6 -0
+config VERBOSE_DEBUG
+	bool "Verbose debug messages"
+	default DEBUG
+	---help---
+	  Guest output from HYPERVISOR_console_io and hypervisor parsing
+	  ELF images (dom0) is logged in the Xen ring buffer.

The "depends on DEBUG || EXPERT" did get lost here (or, looking at the following patch, a respective "if" framing them all).

Quoted 4 lines

This option is always visible to someone and is not dependent on DEBUG due to the if not being possible in the form you asked. So I adjusted it to "default DEBUG" as you had asked. I can make this option dependent on DEBUG or EXPERT.

Same here - with the menuconfig gone, I don't see why.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#13 lore raw

Re: [PATCH v3 3/6] build: convert verbose to Kconfig

Quoted 19 lines · Jan Beulich
Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 19:37, <[email protected]> wrote:
Quoted 16 lines · Jan Beulich

xen/Kconfig.debug config DEBUG · line 23

Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +6 -0
@@ -15,4 +15,11 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
+config VERBOSE_DEBUG
+	bool "Verbose debug messages"
+	default DEBUG
+	---help---
+	  Guest output from HYPERVISOR_console_io and hypervisor parsing
+	  ELF images (dom0) is logged in the Xen ring buffer.

The "depends on DEBUG || EXPERT" did get lost here (or, looking at the following patch, a respective "if" framing them all).

Quoted 9 lines
Quoted 4 lines

This option is always visible to someone and is not dependent on DEBUG due to the if not being possible in the form you asked. So I adjusted it to "default DEBUG" as you had asked. I can make this option dependent on DEBUG or EXPERT.

Same here - with the menuconfig gone, I don't see why.

Jan

So no change? From the first email I gather that it should be "depends on DEBUG || EXPERT" but from the last one I gather no change.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#14 lore raw

Re: [PATCH v3 3/6] build: convert verbose to Kconfig

Quoted 26 lines
Quoted 1 line
Quoted 1 line · On 18.05.16 at 04:16, <[email protected]> wrote:
Quoted 24 lines · Jan Beulich
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 19:37, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -15,4 +15,11 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
Quoted 9 lines

xen/Kconfig.debug config DEBUG · line 23

Quoted 6 lines
xen/Kconfig.debug +6 -0
+config VERBOSE_DEBUG
+	bool "Verbose debug messages"
+	default DEBUG
+	---help---
+	  Guest output from HYPERVISOR_console_io and hypervisor parsing
+	  ELF images (dom0) is logged in the Xen ring buffer.

The "depends on DEBUG || EXPERT" did get lost here (or, looking at the following patch, a respective "if" framing them all).

This option is always visible to someone and is not dependent on DEBUG due to the if not being possible in the form you asked. So I adjusted it to "default DEBUG" as you had asked. I can make this option dependent on DEBUG or EXPERT.

Quoted 4 lines
Quoted 1 line

Same here - with the menuconfig gone, I don't see why.

So no change? From the first email I gather that it should be "depends on DEBUG || EXPERT" but from the last one I gather no change.

Oh, my mistake. I read the "can" in the last sentence of your previous reply as "can only", i.e. understanding you mean either DEBUG or EXPERT. So yes, what I meant to be asking for is "depends on DEBUG || EXPERT" uniformly for all the DEBUG sub-options. Which, it no longer being a menuconfig, should be possible to express by just an "if DEBUG || EXPERT" framing them all.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#15 lore raw

PATCH v3 4/6 build: convert frame_pointer to Kconfig

In reply to Doug Goldstein

Converts the frame_pointer option to a Kconfig option.

---
CC: Andrew Cooper <[email protected]>
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>

---
 INSTALL           | 1 -
 xen/Kconfig.debug | 8 ++++++++
 xen/Rules.mk      | 6 +-----
 3 files changed, 9 insertions(+), 6 deletions(-)
INSTALL +0 -1
index 35668bd..f55d42c 100644
@@ -230,7 +230,6 @@ hypervisor build.
 perfc=y
 perfc_arrays=y
 lock_profile=y
-frame_pointer=y
 lto=y
 
 During tools build external repos will be cloned into the source tree.
xen/Kconfig.debug +8 -0
index 734e78d..375c71d 100644
@@ -15,6 +15,14 @@ config DEBUG
 	  option is intended for development purposes only, and not for
 	  production use.
 
+config FRAME_POINTER
+	bool "Compile Xen with frame pointers"
+	default DEBUG
+	---help---
+	  If you say Y here the resulting Xen will be slightly larger and
+	  maybe slower, but it gives very useful debugging information
+	  in case of any Xen bugs.
+
 config VERBOSE_DEBUG
 	bool "Verbose debug messages"
 	default DEBUG
xen/Rules.mk +1 -5
index b159451..84b9d81 100644
@@ -6,7 +6,6 @@
 perfc         ?= n
 perfc_arrays  ?= n
 lock_profile  ?= n
-frame_pointer ?= n
 lto           ?= n
 
 -include $(BASEDIR)/include/config/auto.conf
@@ -15,9 +14,6 @@ include $(XEN_ROOT)/Config.mk
 
 # Hardcoded configuration implications and dependencies.
 # Do this is a neater way if it becomes unwieldy.
-ifeq ($(debug),y)
-frame_pointer := y
-endif
 ifeq ($(perfc_arrays),y)
 perfc := y
 endif
@@ -58,7 +54,7 @@ endif
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
 CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
-CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
+CFLAGS-$(CONFIG_FRAME_POINTER) += -fno-omit-frame-pointer
 
 ifneq ($(max_phys_irqs),)
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#16 lore raw

PATCH v3 5/6 build: convert perfc{, _arrays} to Kconfig

In reply to Doug Goldstein

Convert the 'perfc' and 'perfc_arrays' options to Kconfig as CONFIG_PERF_COUNTERS and CONFIG_PERF_ARRAYS to minimize code changes.

---
CC: Andrew Cooper <[email protected]>
CC: George Dunlap <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>

---
 INSTALL                           |  2 --
 xen/Kconfig.debug                 | 14 ++++++++++++++
 xen/Rules.mk                      | 13 +++----------
 xen/arch/x86/hvm/hvm.c            |  2 +-
 xen/arch/x86/time.c               |  4 ++--
 xen/arch/x86/x86_64/asm-offsets.c |  2 +-
 xen/common/Makefile               |  2 +-
 xen/common/keyhandler.c           |  2 +-
 xen/common/perfc.c                |  2 +-
 xen/common/sysctl.c               |  2 +-
 xen/include/asm-x86/asm_defns.h   |  2 +-
 xen/include/asm-x86/domain.h      |  2 +-
 xen/include/xen/perfc.h           |  8 ++++----
 xen/include/xen/sched.h           |  2 +-
 14 files changed, 32 insertions(+), 27 deletions(-)
INSTALL +0 -2
index f55d42c..623887d 100644
@@ -227,8 +227,6 @@ VGABIOS_REL_DATE="dd Mon yyyy"
 
 The following variables can be used to tweak some aspects of the
 hypervisor build.
-perfc=y
-perfc_arrays=y
 lock_profile=y
 lto=y
 
xen/Kconfig.debug +14 -0
index 375c71d..d056748 100644
@@ -23,6 +23,20 @@ config FRAME_POINTER
 	  maybe slower, but it gives very useful debugging information
 	  in case of any Xen bugs.
 
+config PERF_COUNTERS
+	bool "Performance Counters"
+	---help---
+	  Enables software performance counters that allows you to analyze
+	  bottlenecks in the system. To access this data you must use the
+	  'xenperf' tool.
+
+config PERF_ARRAYS
+	bool "Performance Counter Array Histograms"
+	depends on PERF_COUNTERS
+	---help---
+	  Enables software performance counter array histograms.
+
+
 config VERBOSE_DEBUG
 	bool "Verbose debug messages"
 	default DEBUG
xen/Rules.mk +3 -10
index 84b9d81..2d9265e 100644
@@ -3,8 +3,6 @@
 # If you change any of these configuration options then you must
 # 'make clean' before rebuilding.
 #
-perfc         ?= n
-perfc_arrays  ?= n
 lock_profile  ?= n
 lto           ?= n
 
@@ -12,18 +10,15 @@ lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
 
-# Hardcoded configuration implications and dependencies.
-# Do this is a neater way if it becomes unwieldy.
-ifeq ($(perfc_arrays),y)
-perfc := y
-endif
-
 ifneq ($(origin kexec),undefined)
 $(error "You must use 'make menuconfig' to enable/disable kexec now.")
 endif
 ifneq ($(origin crash_debug),undefined)
 $(error "You must use 'make menuconfig' to enable/disable crash_debug now.")
 endif
+ifneq ($(origin perfc),undefined)
+$(error "You must use 'make menuconfig' to enable/disable perfc now.")
+endif
 
 # Set ARCH/SUBARCH appropriately.
 override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
@@ -51,8 +46,6 @@ ifneq ($(clang),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
-CFLAGS-$(perfc)         += -DPERF_COUNTERS
-CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(CONFIG_FRAME_POINTER) += -fno-omit-frame-pointer
 
xen/arch/x86/hvm/hvm.c +1 -1
index 863d134..34bc7a8 100644
@@ -3535,7 +3535,7 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
 static uint64_t _hvm_rdtsc_intercept(void)
 {
     struct vcpu *curr = current;
-#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+#if !defined(NDEBUG) || defined(CONFIG_PERF_COUNTERS)
     struct domain *currd = curr->domain;
 
     if ( currd->arch.vtsc )
xen/arch/x86/time.c +2 -2
index 6438b47..3928a5f 100644
@@ -1688,7 +1688,7 @@ void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp)
 
     spin_lock(&d->arch.vtsc_lock);
 
-#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+#if !defined(NDEBUG) || defined(CONFIG_PERF_COUNTERS)
     if ( guest_kernel_mode(v, regs) )
         d->arch.vtsc_kerncount++;
     else
@@ -1959,7 +1959,7 @@ static void dump_softtsc(unsigned char key)
             printk(",khz=%"PRIu32, d->arch.tsc_khz);
         if ( d->arch.incarnation )
             printk(",inc=%"PRIu32, d->arch.incarnation);
-#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+#if !defined(NDEBUG) || defined(CONFIG_PERF_COUNTERS)
         if ( !(d->arch.vtsc_kerncount | d->arch.vtsc_usercount) )
             printk("\n");
         else
xen/arch/x86/x86_64/asm-offsets.c +1 -1
index fa37ee0..891ddc8 100644
@@ -151,7 +151,7 @@ void __dummy__(void)
     OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
     BLANK();
 
-#if PERF_COUNTERS
+#if CONFIG_PERF_COUNTERS
     DEFINE(ASM_PERFC_hypercalls, PERFC_hypercalls);
     DEFINE(ASM_PERFC_exceptions, PERFC_exceptions);
     BLANK();
xen/common/Makefile +1 -1
index a98bcc2..5891b1c 100644
@@ -64,7 +64,7 @@ obj-$(CONFIG_XSPLICE) += xsplice_elf.o
 
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
-obj-$(perfc)       += perfc.o
+obj-$(CONFIG_PERF_COUNTERS)       += perfc.o
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
 
xen/common/keyhandler.c +1 -1
index 4ff90f6..65b70ce 100644
@@ -59,7 +59,7 @@ static struct keyhandler {
     IRQ_KEYHANDLER('%', do_debug_key, "trap to xendbg", 0),
     IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
 
-#ifdef PERF_COUNTERS
+#ifdef CONFIG_PERF_COUNTERS
     KEYHANDLER('p', perfc_printall, "print performance counters", 1),
     KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
 #endif
xen/common/perfc.c +1 -1
index 9f078e1..3da4c96 100644
@@ -78,7 +78,7 @@ void perfc_printall(unsigned char key)
             printk("TOTAL[%12Lu]", sum);
             if (sum)
             {
-#ifdef PERF_ARRAYS
+#ifdef CONFIG_PERF_ARRAYS
                 for ( k = 0; k < perfc_info[i].nr_elements; k++ )
                 {
                     sum = 0;
xen/common/sysctl.c +1 -1
index 9a4cc1f..11bef0e 100644
@@ -115,7 +115,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     }
     break;
 
-#ifdef PERF_COUNTERS
+#ifdef CONFIG_PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
         ret = perfc_control(&op->u.perfc_op);
         break;
xen/include/asm-x86/asm_defns.h +1 -1
index b5f79d8..24f5404 100644
@@ -363,7 +363,7 @@ static always_inline void stac(void)
 
 #endif
 
-#ifdef PERF_COUNTERS
+#ifdef CONFIG_PERF_COUNTERS
 #define PERFC_INCR(_name,_idx,_cur)             \
         pushq _cur;                             \
         movslq VCPU_processor(_cur),_cur;       \
xen/include/asm-x86/domain.h +1 -1
index 165e533..783fa4f 100644
@@ -377,7 +377,7 @@ struct arch_domain
                                      hardware TSC scaling cases */
     uint32_t incarnation;    /* incremented every restore or live migrate
                                 (possibly other cases in the future */
-#if !defined(NDEBUG) || defined(PERF_COUNTERS)
+#if !defined(NDEBUG) || defined(CONFIG_PERF_COUNTERS)
     uint64_t vtsc_kerncount;
     uint64_t vtsc_usercount;
 #endif
xen/include/xen/perfc.h +4 -4
index 6cb0cd1..6846e71 100644
@@ -1,7 +1,7 @@
 #ifndef __XEN_PERFC_H__
 #define __XEN_PERFC_H__
 
-#ifdef PERF_COUNTERS
+#ifdef CONFIG_PERF_COUNTERS
 
 #include <xen/lib.h>
 #include <xen/smp.h>
@@ -76,7 +76,7 @@ DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters);
  * Histogram: special treatment for 0 and 1 count. After that equally spaced 
  * with last bucket taking the rest.
  */
-#ifdef PERF_ARRAYS
+#ifdef CONFIG_PERF_ARRAYS
 #define perfc_incr_histo(x,v)                                           \
     do {                                                                \
         if ( (v) == 0 )                                                 \
@@ -100,7 +100,7 @@ extern void perfc_printall(unsigned char key);
 extern void perfc_reset(unsigned char key);
 
     
-#else /* PERF_COUNTERS */
+#else /* CONFIG_PERF_COUNTERS */
 
 #define perfc_value(x)    (0)
 #define perfc_valuea(x,y) (0)
@@ -114,6 +114,6 @@ extern void perfc_reset(unsigned char key);
 #define perfc_adda(x,y,z) ((void)0)
 #define perfc_incr_histo(x,y,z) ((void)0)
 
-#endif /* PERF_COUNTERS */
+#endif /* CONFIG_PERF_COUNTERS */
 
 #endif /* __XEN_PERFC_H__ */
xen/include/xen/sched.h +1 -1
index fe15e9c..46c82e7 100644
@@ -39,7 +39,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_compat_t);
  * Enable and ease the use of scheduling related performance counters.
  *
  */
-#ifdef PERF_COUNTERS
+#ifdef CONFIG_PERF_COUNTERS
 #define SCHED_STATS
 #endif
 
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#17 lore raw

Re: [PATCH v3 5/6] build: convert perfc{, _arrays} to Kconfig

Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:

Convert the 'perfc' and 'perfc_arrays' options to Kconfig as CONFIG_PERF_COUNTERS and CONFIG_PERF_ARRAYS to minimize code changes.

I don't understand the "to minimize code changes" part.

Quoted 9 lines
xen/Rules.mk +0 -5
@@ -12,18 +10,15 @@ lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
 
-# Hardcoded configuration implications and dependencies.
-# Do this is a neater way if it becomes unwieldy.
-ifeq ($(perfc_arrays),y)
-perfc := y
-endif

xen/Rules.mk lto ?= n · line 21

Quoted 10 lines
xen/Rules.mk +3 -1
-
 ifneq ($(origin kexec),undefined)
 $(error "You must use 'make menuconfig' to enable/disable kexec now.")
 endif
 ifneq ($(origin crash_debug),undefined)
 $(error "You must use 'make menuconfig' to enable/disable crash_debug now.")
 endif
+ifneq ($(origin perfc),undefined)
+$(error "You must use 'make menuconfig' to enable/disable perfc now.")
+endif

I'm pretty sure I've asked before: Why do you add something here for crash_debug and perfc, but not for debug, verbose, and frame_pointer?

xen/arch/x86/x86_64/asm-offsets.c void __dummy__(void) · line 154

Quoted 8 lines
xen/arch/x86/x86_64/asm-offsets.c +1 -1
@@ -151,7 +151,7 @@ void __dummy__(void)
     OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
     BLANK();
 
-#if PERF_COUNTERS
+#if CONFIG_PERF_COUNTERS

Same here - I'm pretty sure I've already asked for this to become #ifdef.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#18 lore raw

Re: [PATCH v3 5/6] build: convert perfc{, _arrays} to Kconfig

Quoted 5 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:

Convert the 'perfc' and 'perfc_arrays' options to Kconfig as CONFIG_PERF_COUNTERS and CONFIG_PERF_ARRAYS to minimize code changes.

I don't understand the "to minimize code changes" part.

Instead of calling the options "CONFIG_PERFC" and CONFIG_PERFC_ARRAYS" as the originals would be called.

I do most of these Kconfig patches with sed and not by hand.

Quoted 16 lines
Quoted 16 lines
xen/Rules.mk +0 -6
@@ -12,18 +10,15 @@ lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
 
-# Hardcoded configuration implications and dependencies.
-# Do this is a neater way if it becomes unwieldy.
-ifeq ($(perfc_arrays),y)
-perfc := y
-endif
-
 ifneq ($(origin kexec),undefined)
 $(error "You must use 'make menuconfig' to enable/disable kexec now.")
 endif
 ifneq ($(origin crash_debug),undefined)
 $(error "You must use 'make menuconfig' to enable/disable crash_debug now.")
Quoted 8 lines

xen/Rules.mk lto ?= n · line 21

Quoted 4 lines
xen/Rules.mk +3 -0
 endif
+ifneq ($(origin perfc),undefined)
+$(error "You must use 'make menuconfig' to enable/disable perfc now.")
+endif

I'm pretty sure I've asked before: Why do you add something here for crash_debug and perfc, but not for debug, verbose, and frame_pointer?

I added the one you had mentioned. I didn't realize it was a uniform statement. In the past (for other series) I've been told to drop those statements for not common options.

As far as the debug one, I had that in patch 5 but passing the value in but that was dropped.

Quoted 15 lines

xen/arch/x86/x86_64/asm-offsets.c void __dummy__(void) · line 154

Quoted 9 lines
xen/arch/x86/x86_64/asm-offsets.c +1 -1
@@ -151,7 +151,7 @@ void __dummy__(void)
     OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
     BLANK();
 
-#if PERF_COUNTERS
+#if CONFIG_PERF_COUNTERS

Same here - I'm pretty sure I've already asked for this to become #ifdef.

Jan

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#19 lore raw

Re: [PATCH v3 5/6] build: convert perfc{, _arrays} to Kconfig

Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 11.05.16 at 20:39, <[email protected]> wrote:
Quoted 5 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 10.05.16 at 23:05, <[email protected]> wrote:

Convert the 'perfc' and 'perfc_arrays' options to Kconfig as CONFIG_PERF_COUNTERS and CONFIG_PERF_ARRAYS to minimize code changes.

I don't understand the "to minimize code changes" part.

Instead of calling the options "CONFIG_PERFC" and CONFIG_PERFC_ARRAYS" as the originals would be called.

How would using those have resulted in more code changes? The changes would have looked a little different, but it would have been the same amount of lines modified.

Quoted 1 line

I do most of these Kconfig patches with sed and not by hand.

Sure, but that's unrelated to this afaict.

Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
xen/Rules.mk +0 -6
@@ -12,18 +10,15 @@ lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
 
-# Hardcoded configuration implications and dependencies.
-# Do this is a neater way if it becomes unwieldy.
-ifeq ($(perfc_arrays),y)
-perfc := y
-endif
-
 ifneq ($(origin kexec),undefined)
 $(error "You must use 'make menuconfig' to enable/disable kexec now.")
 endif
 ifneq ($(origin crash_debug),undefined)
 $(error "You must use 'make menuconfig' to enable/disable crash_debug now.")
Quoted 8 lines

xen/Rules.mk lto ?= n · line 21

Quoted 4 lines
xen/Rules.mk +3 -0
 endif
+ifneq ($(origin perfc),undefined)
+$(error "You must use 'make menuconfig' to enable/disable perfc now.")
+endif

I'm pretty sure I've asked before: Why do you add something here for crash_debug and perfc, but not for debug, verbose, and frame_pointer?

Quoted 3 lines

I added the one you had mentioned. I didn't realize it was a uniform statement. In the past (for other series) I've been told to drop those statements for not common options.

Hmm, I don't recall such requests, but if there were - what is the criteria for being "not common"?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#20 lore raw

PATCH v3 6/6 build: convert lock_profile to Kconfig

In reply to Doug Goldstein

Convert the 'lock_profile' option to Kconfig as CONFIG_LOCK_PROFILE.

---
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Andrew Cooper <[email protected]>

---
 INSTALL                    |  1 -
 xen/Kconfig.debug          |  7 +++++++
 xen/Rules.mk               |  2 --
 xen/arch/arm/xen.lds.S     |  2 +-
 xen/arch/x86/domain.c      |  2 +-
 xen/arch/x86/xen.lds.S     |  2 +-
 xen/common/keyhandler.c    |  2 +-
 xen/common/spinlock.c      | 10 +++++-----
 xen/common/sysctl.c        |  2 +-
 xen/include/xen/spinlock.h |  4 ++--
 10 files changed, 19 insertions(+), 15 deletions(-)
INSTALL +0 -1
index 623887d..616a67a 100644
@@ -227,7 +227,6 @@ VGABIOS_REL_DATE="dd Mon yyyy"
 
 The following variables can be used to tweak some aspects of the
 hypervisor build.
-lock_profile=y
 lto=y
 
 During tools build external repos will be cloned into the source tree.
xen/Kconfig.debug +7 -0
index d056748..ca0913b 100644
@@ -23,6 +23,13 @@ config FRAME_POINTER
 	  maybe slower, but it gives very useful debugging information
 	  in case of any Xen bugs.
 
+config LOCK_PROFILE
+	bool "Lock Profiiling"
+	---help---
+	  Lock profiling allows you to see how often locks are taken and blocked.
+	  You can use serial console to print (and reset) using 'l' and 'L'
+	  respectively, or the 'xenlockprof' tool.
+
 config PERF_COUNTERS
 	bool "Performance Counters"
 	---help---
xen/Rules.mk +0 -2
index 2d9265e..f85b3b3 100644
@@ -3,7 +3,6 @@
 # If you change any of these configuration options then you must
 # 'make clean' before rebuilding.
 #
-lock_profile  ?= n
 lto           ?= n
 
 -include $(BASEDIR)/include/config/auto.conf
@@ -46,7 +45,6 @@ ifneq ($(clang),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
-CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(CONFIG_FRAME_POINTER) += -fno-omit-frame-pointer
 
 ifneq ($(max_phys_irqs),)
xen/arch/arm/xen.lds.S +1 -1
index 1f010bd..76982b2 100644
@@ -54,7 +54,7 @@ SECTIONS
        *(.rodata)
        *(.rodata.*)
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
        . = ALIGN(POINTER_ALIGN);
        __lock_profile_start = .;
        *(.lockprofile.data)
xen/arch/x86/domain.c +1 -1
index 5af2cc5..978ec3a 100644
@@ -251,7 +251,7 @@ struct domain *alloc_domain_struct(void)
 #endif
 
 
-#ifndef LOCK_PROFILE
+#ifndef CONFIG_LOCK_PROFILE
     BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
 #endif
     d = alloc_xenheap_pages(order, MEMF_bits(bits));
xen/arch/x86/xen.lds.S +1 -1
index b14bcd2..a43b29d 100644
@@ -103,7 +103,7 @@ SECTIONS
        *(.ex_table.pre)
        __stop___pre_ex_table = .;
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
        . = ALIGN(POINTER_ALIGN);
        __lock_profile_start = .;
        *(.lockprofile.data)
xen/common/keyhandler.c +1 -1
index 65b70ce..16de6e8 100644
@@ -64,7 +64,7 @@ static struct keyhandler {
     KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
 #endif
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
     KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
     KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
 #endif
xen/common/spinlock.c +5 -5
index b377bb9..017bdf3 100644
@@ -85,7 +85,7 @@ void spin_debug_disable(void)
 
 #endif
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
 
 #define LOCK_PROFILE_REL                                                     \
     if (lock->profile)                                                       \
@@ -212,7 +212,7 @@ int _spin_trylock(spinlock_t *lock)
     if ( cmpxchg(&lock->tickets.head_tail,
                  old.head_tail, new.head_tail) != old.head_tail )
         return 0;
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
     if (lock->profile)
         lock->profile->time_locked = NOW();
 #endif
@@ -227,7 +227,7 @@ int _spin_trylock(spinlock_t *lock)
 void _spin_barrier(spinlock_t *lock)
 {
     spinlock_tickets_t sample;
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
     s_time_t block = NOW();
 #endif
 
@@ -238,7 +238,7 @@ void _spin_barrier(spinlock_t *lock)
     {
         while ( observe_head(&lock->tickets) == sample.head )
             arch_lock_relax();
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
         if ( lock->profile )
         {
             lock->profile->time_block += NOW() - block;
@@ -296,7 +296,7 @@ void _spin_unlock_recursive(spinlock_t *lock)
     }
 }
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
 
 struct lock_profile_anc {
     struct lock_profile_qhead *head_q;   /* first head of this type */
xen/common/sysctl.c +1 -1
index 11bef0e..b4f235e 100644
@@ -121,7 +121,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         break;
 #endif
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
         ret = spinlock_profile_control(&op->u.lockprof_op);
         break;
xen/include/xen/spinlock.h +2 -2
index 88b53f9..c1883bd 100644
@@ -20,7 +20,7 @@ struct lock_debug { };
 #define spin_debug_disable() ((void)0)
 #endif
 
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
 
 #include <public/sysctl.h>
 
@@ -144,7 +144,7 @@ typedef struct spinlock {
     u16 recurse_cnt:4;
 #define SPINLOCK_MAX_RECURSE 0xfu
     struct lock_debug debug;
-#ifdef LOCK_PROFILE
+#ifdef CONFIG_LOCK_PROFILE
     struct lock_profile *profile;
 #endif
 } spinlock_t;
Signature · 7 lines
2.7.3


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel