[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 28/28 v2] Separate runtime debug output from debug symbols



On Fri, Sep 26, Jan Beulich wrote:

> >>> On 26.09.14 at 13:40, <olaf@xxxxxxxxx> wrote:
> > --- a/xen/Rules.mk
> > +++ b/xen/Rules.mk
> > @@ -10,6 +10,10 @@ lock_profile  ?= n
> >  crash_debug   ?= n
> >  frame_pointer ?= n
> >  lto           ?= n
> > +debug_xen     ?= y
> > +debuginfo_xen ?= y
> > +debug         := $(debug_xen)
> > +debug_symbols := $(debuginfo_xen)
> 
> I'm not sure I want to see this do away with the old mechanism
> altogether - various of my testing build flavors depend on overriding
> the "debug" variable, and I wouldn't want to change all their .config
> files. At least for a certain period of time the latter two should
> probably continue to use ?=.

I think .config will continue to work with a "debug := y" and also 'make
debug=y'.

> > @@ -43,7 +47,10 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
> >  
> >  CFLAGS += -fno-builtin -fno-common
> >  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> > -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> > +ifeq ($(debug_symbols),y)
> > +CFLAGS += -g
> > +endif
> > +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> >  CFLAGS += -nostdinc
> >  
> >  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
> 
> The context here shows that CFLAGS-y gets used elsewhere, so
> please do so too above. And if possible this should be considered
> elsewhere too.

I'm not sure what you mean? The hunk just makes "-g" conditional.

> In any event I don't see this change as important enough to
> warrant overriding the feature freeze.

Regarding feature freeze, that small version below for 'make debug=yn
debug_symbols=yn' will work for me as well.

Olaf


    Separate runtime debug output from debug symbols
    
    With this change debug and debug_symbols is used consistently.
    With 'make debug=yn debug_symbols=yn' my rebuild time and diskspace
    usage goes down:
       105275K clean xen.git checkout.
    y 1247041K build time: 5:57
    n  812112K build time: 5:34
    
    No change in behaviour is expected by that patch for tools and xen.
    For stubdom CFLAGS change from -O1 to O2 with debug=n.
    
    Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
    Cc: David Scott <dave.scott@xxxxxxxxxxxxx>
    Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Cc: Jan Beulich <jbeulich@xxxxxxxx>
    Cc: Keir Fraser <keir@xxxxxxx>
    Cc: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
    Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Cc: Tim Deegan <tim@xxxxxxx>
    Cc: Wei Liu <wei.liu2@xxxxxxxxxx>

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9dac103..60dc0b8 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os
 export XEN_OS=MiniOS
 
 export stubdom=y
-export debug=y
-include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Stubdom.mk
+include $(XEN_ROOT)/Config.mk
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
 ifeq ($(XEN_TARGET_ARCH),x86_32)
diff --git a/tools/Makefile b/tools/Makefile
index 4afadfd..9ae1ab1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -189,6 +189,12 @@ else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
 
+ifeq ($(debug_symbols),y)
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip
+else
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info
+endif
+
 subdir-all-qemu-xen-dir: qemu-xen-dir-find
        if test -d $(QEMU_UPSTREAM_LOC) ; then \
                source=$(QEMU_UPSTREAM_LOC); \
@@ -198,6 +204,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
        cd qemu-xen-dir; \
        $$source/configure --enable-xen --target-list=i386-softmmu \
                $(QEMU_XEN_ENABLE_DEBUG) \
+               $(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \
                --prefix=$(LIBEXEC) \
                --libdir=$(LIBEXEC_LIB) \
                --includedir=$(LIBEXEC_INC) \
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index d5478f6..33b3142 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) 
-cc $(CC) -w F -warn-error F
-OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
+ifeq ($(debug_symbols),y)
+OCAMLCFLAGS += -g
+endif
+OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F
 
 VERSION := 4.1
 
diff --git a/xen/Rules.mk b/xen/Rules.mk
index e2f9e36..a8bbd8e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
 CFLAGS += -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+CFLAGS-$(debug_symbols) += -g
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += -nostdinc
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.