All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: build debug qemu-xen in debug tools builds
@ 2013-09-03 13:12 Matthew Daley
  2013-09-03 15:32 ` Ian Campbell
  2013-09-09 14:05 ` Ian Campbell
  0 siblings, 2 replies; 6+ messages in thread
From: Matthew Daley @ 2013-09-03 13:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Matthew Daley, Ian Campbell

When building tools in debug mode (debug=y), pass --enable-debug when
configuring qemu-xen to enable some debug support (namely, to prevent
symbols from being stripped).

Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
 tools/Makefile |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index 0531f48..066df66 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -173,6 +173,12 @@ qemu-xen-dir-force-update:
 		$(GIT) reset --hard $(QEMU_UPSTREAM_REVISION); \
 	fi
 
+ifeq ($(debug),y)
+QEMU_XEN_ENABLE_DEBUG := --enable-debug
+else
+QEMU_XEN_ENABLE_DEBUG :=
+endif
+
 subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	if test -d $(QEMU_UPSTREAM_URL) ; then \
 		source=$(QEMU_UPSTREAM_URL); \
@@ -181,6 +187,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	fi; \
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
+		$(QEMU_XEN_ENABLE_DEBUG) \
 		--prefix=$(PREFIX) \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: build debug qemu-xen in debug tools builds
  2013-09-03 13:12 [PATCH] tools: build debug qemu-xen in debug tools builds Matthew Daley
@ 2013-09-03 15:32 ` Ian Campbell
  2013-09-03 16:24   ` Anthony PERARD
  2013-09-04  2:11   ` Matthew Daley
  2013-09-09 14:05 ` Ian Campbell
  1 sibling, 2 replies; 6+ messages in thread
From: Ian Campbell @ 2013-09-03 15:32 UTC (permalink / raw)
  To: Matthew Daley; +Cc: Anthony Perard, Stefano Stabellini, xen-devel

On Wed, 2013-09-04 at 01:12 +1200, Matthew Daley wrote:
> When building tools in debug mode (debug=y), pass --enable-debug when
> configuring qemu-xen to enable some debug support (namely, to prevent
> symbols from being stripped).

This is from the installed binaries I suppose? Is this the only affect
or are there others?

I'd like some feedback from the qemu maintainers about whether this is
an OK thing to do or not. Stefano/Anthony?

Is it something we could consider doing unconditionally?

Ian.

> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>
> ---
>  tools/Makefile |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index 0531f48..066df66 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -173,6 +173,12 @@ qemu-xen-dir-force-update:
>  		$(GIT) reset --hard $(QEMU_UPSTREAM_REVISION); \
>  	fi
>  
> +ifeq ($(debug),y)
> +QEMU_XEN_ENABLE_DEBUG := --enable-debug
> +else
> +QEMU_XEN_ENABLE_DEBUG :=
> +endif
> +
>  subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  	if test -d $(QEMU_UPSTREAM_URL) ; then \
>  		source=$(QEMU_UPSTREAM_URL); \
> @@ -181,6 +187,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  	fi; \
>  	cd qemu-xen-dir; \
>  	$$source/configure --enable-xen --target-list=i386-softmmu \
> +		$(QEMU_XEN_ENABLE_DEBUG) \
>  		--prefix=$(PREFIX) \
>  		--source-path=$$source \
>  		--extra-cflags="-I$(XEN_ROOT)/tools/include \

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: build debug qemu-xen in debug tools builds
  2013-09-03 15:32 ` Ian Campbell
@ 2013-09-03 16:24   ` Anthony PERARD
  2013-09-04  2:11   ` Matthew Daley
  1 sibling, 0 replies; 6+ messages in thread
From: Anthony PERARD @ 2013-09-03 16:24 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Matthew Daley, Stefano Stabellini, xen-devel

On 03/09/13 16:32, Ian Campbell wrote:
> On Wed, 2013-09-04 at 01:12 +1200, Matthew Daley wrote:
>> > When building tools in debug mode (debug=y), pass --enable-debug when
>> > configuring qemu-xen to enable some debug support (namely, to prevent
>> > symbols from being stripped).
> This is from the installed binaries I suppose? Is this the only affect
> or are there others?

The other difference is not having -O2 in the CFLAGS for QEMU, I don't
think there is anything else (beyond an debug option related to TCG
which we don't use).

> I'd like some feedback from the qemu maintainers about whether this is
> an OK thing to do or not. Stefano/Anthony?
> 
> Is it something we could consider doing unconditionally?

I've run several time qemu-xen with --enable-debug without any issue, so
I think it's fine to have this.

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: build debug qemu-xen in debug tools builds
  2013-09-03 15:32 ` Ian Campbell
  2013-09-03 16:24   ` Anthony PERARD
@ 2013-09-04  2:11   ` Matthew Daley
  2013-09-04 12:50     ` Stefano Stabellini
  1 sibling, 1 reply; 6+ messages in thread
From: Matthew Daley @ 2013-09-04  2:11 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Anthony Perard, Stefano Stabellini, xen-devel@lists.xen.org

On Wed, Sep 4, 2013 at 3:32 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Wed, 2013-09-04 at 01:12 +1200, Matthew Daley wrote:
>> When building tools in debug mode (debug=y), pass --enable-debug when
>> configuring qemu-xen to enable some debug support (namely, to prevent
>> symbols from being stripped).
>
> This is from the installed binaries I suppose?

Right, it stops the symbols from being stripped from the installed
binaries. The ones left in the build directory are not stripped
regardless.

> Is this the only affect or are there others?

The other changes I can see are to set
CONFIG_DEBUG_{TCG,MONITOR,EXEC}=y and, as Anthony said, to not add -O2
to CFLAGS (-g is added unconditionally).

AFAIK Xen doesn't use the subsystems where TCG/EXEC are mentioned, and
MONITOR just enables some extra error messages in the QEMU monitor
code anyway.

>
> I'd like some feedback from the qemu maintainers about whether this is
> an OK thing to do or not. Stefano/Anthony?
>
> Is it something we could consider doing unconditionally?

We could perhaps just configure with --disable-strip if we want to do
it unconditionally but still have optimization (for debug=n builds).
Debugging with -O2 isn't bad, but without symbols it's definitely more
annoying.

Looking at the current setup (without --enable-debug, FWIW) on my
machine, an unstripped binary is 18MB, while stripped is 4MB.

>
> Ian.
>
>>
>> Signed-off-by: Matthew Daley <mattjd@gmail.com>
>> ---
>>  tools/Makefile |    7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/tools/Makefile b/tools/Makefile
>> index 0531f48..066df66 100644
>> --- a/tools/Makefile
>> +++ b/tools/Makefile
>> @@ -173,6 +173,12 @@ qemu-xen-dir-force-update:
>>               $(GIT) reset --hard $(QEMU_UPSTREAM_REVISION); \
>>       fi
>>
>> +ifeq ($(debug),y)
>> +QEMU_XEN_ENABLE_DEBUG := --enable-debug
>> +else
>> +QEMU_XEN_ENABLE_DEBUG :=
>> +endif
>> +
>>  subdir-all-qemu-xen-dir: qemu-xen-dir-find
>>       if test -d $(QEMU_UPSTREAM_URL) ; then \
>>               source=$(QEMU_UPSTREAM_URL); \
>> @@ -181,6 +187,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>>       fi; \
>>       cd qemu-xen-dir; \
>>       $$source/configure --enable-xen --target-list=i386-softmmu \
>> +             $(QEMU_XEN_ENABLE_DEBUG) \
>>               --prefix=$(PREFIX) \
>>               --source-path=$$source \
>>               --extra-cflags="-I$(XEN_ROOT)/tools/include \
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: build debug qemu-xen in debug tools builds
  2013-09-04  2:11   ` Matthew Daley
@ 2013-09-04 12:50     ` Stefano Stabellini
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2013-09-04 12:50 UTC (permalink / raw)
  To: Matthew Daley
  Cc: Anthony Perard, Stefano Stabellini, Ian Campbell,
	xen-devel@lists.xen.org

On Wed, 4 Sep 2013, Matthew Daley wrote:
> On Wed, Sep 4, 2013 at 3:32 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Wed, 2013-09-04 at 01:12 +1200, Matthew Daley wrote:
> >> When building tools in debug mode (debug=y), pass --enable-debug when
> >> configuring qemu-xen to enable some debug support (namely, to prevent
> >> symbols from being stripped).
> >
> > This is from the installed binaries I suppose?
> 
> Right, it stops the symbols from being stripped from the installed
> binaries. The ones left in the build directory are not stripped
> regardless.
> 
> > Is this the only affect or are there others?
> 
> The other changes I can see are to set
> CONFIG_DEBUG_{TCG,MONITOR,EXEC}=y and, as Anthony said, to not add -O2
> to CFLAGS (-g is added unconditionally).
> 
> AFAIK Xen doesn't use the subsystems where TCG/EXEC are mentioned, and
> MONITOR just enables some extra error messages in the QEMU monitor
> code anyway.

It seems reasonable.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: build debug qemu-xen in debug tools builds
  2013-09-03 13:12 [PATCH] tools: build debug qemu-xen in debug tools builds Matthew Daley
  2013-09-03 15:32 ` Ian Campbell
@ 2013-09-09 14:05 ` Ian Campbell
  1 sibling, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2013-09-09 14:05 UTC (permalink / raw)
  To: Matthew Daley; +Cc: xen-devel

On Wed, 2013-09-04 at 01:12 +1200, Matthew Daley wrote:
> When building tools in debug mode (debug=y), pass --enable-debug when
> configuring qemu-xen to enable some debug support (namely, to prevent
> symbols from being stripped).
> 
> Signed-off-by: Matthew Daley <mattjd@gmail.com>

Neither Stefano nor Anthony offered formal acks but they seem happy with
so I've applied it.

> ---
>  tools/Makefile |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index 0531f48..066df66 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -173,6 +173,12 @@ qemu-xen-dir-force-update:
>  		$(GIT) reset --hard $(QEMU_UPSTREAM_REVISION); \
>  	fi
>  
> +ifeq ($(debug),y)
> +QEMU_XEN_ENABLE_DEBUG := --enable-debug
> +else
> +QEMU_XEN_ENABLE_DEBUG :=
> +endif
> +
>  subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  	if test -d $(QEMU_UPSTREAM_URL) ; then \
>  		source=$(QEMU_UPSTREAM_URL); \
> @@ -181,6 +187,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  	fi; \
>  	cd qemu-xen-dir; \
>  	$$source/configure --enable-xen --target-list=i386-softmmu \
> +		$(QEMU_XEN_ENABLE_DEBUG) \
>  		--prefix=$(PREFIX) \
>  		--source-path=$$source \
>  		--extra-cflags="-I$(XEN_ROOT)/tools/include \

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-09 14:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03 13:12 [PATCH] tools: build debug qemu-xen in debug tools builds Matthew Daley
2013-09-03 15:32 ` Ian Campbell
2013-09-03 16:24   ` Anthony PERARD
2013-09-04  2:11   ` Matthew Daley
2013-09-04 12:50     ` Stefano Stabellini
2013-09-09 14:05 ` Ian Campbell

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.