[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Thoughts around dtrace linking...
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Thoughts around dtrace linking... |
Date: |
Thu, 22 Mar 2012 16:28:59 +0000 |
On Wed, Mar 21, 2012 at 1:01 PM, Andreas Färber <address@hidden> wrote:
> Hi,
>
> Am 21.03.2012 11:45, schrieb Lee Essen:
>> I've been trying to find a sensible way to solve the Solaris/Illumos
>> dtrace requirement to pass all the objs to the dtrace command so that
>> the resultant object file contains all the symbols needed to properly
>> link the relevant binary.
>>
>> The easiest way to do this is just prior to linking the binary, so
>> something like this (in rules.mak):
>>
>> LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS)
>> $(LDFLAGS) -o $@ $(sort $(1)) $(LIBS)," LINK $(TARGET_DIR)$@")
>>
>> DTRACE = $(call quiet-command,dtrace $(CONFIG_DTRACE_FLAGS) -o
>> $(1)-dtrace.o -G -s $(2) $(3), " GEN $(TARGET_DIR)$(1)-dtrace.o")
>>
>> %$(EXESUF): %.o
>> $(call DTRACE,$*,trace-dtrace.dtrace,$^)
>> $(call LINK,$^ $*-dtrace.o)
What I find slightly surprising is that you're putting the -dtrace.o
generation step as a command in the executable's target.
I would expect the -dtrace.o to be a target itself, which also allows
make to use it's timestamping on dependencies to ensure we only
rebuild when necessary. i.e. specifying dependencies is the make way
of doing things, and I think we should try where possible.
>>
>> Obviously with the relevant tests around it to check the trace backend,
>> and also an adjustment in Makefile.target to cause the right thing to
>> happen for each target.
>> Or, is there a better way?
>
> The two issues I see (as info for Stefan et al.) are
> a) compiling DTrace probes into .o files requires linking those objects
> with that additional .o file to avoid linker errors (even for tools
> where using DTrace probes does not seem to make much sense),
qemu-tool binaries are built with tracing enabled. But this is a good
point, we need to check that all binaries buildable from the QEMU
source tree continue to work with this change.
Stefan
- [Qemu-devel] Thoughts around dtrace linking..., Lee Essen, 2012/03/21
- Re: [Qemu-devel] Thoughts around dtrace linking..., Andreas Färber, 2012/03/21
- Re: [Qemu-devel] Thoughts around dtrace linking..., Lee Essen, 2012/03/21
- Re: [Qemu-devel] Thoughts around dtrace linking...,
Stefan Hajnoczi <=
- Re: [Qemu-devel] Thoughts around dtrace linking..., Lee Essen, 2012/03/22
- Re: [Qemu-devel] Thoughts around dtrace linking..., Stefan Hajnoczi, 2012/03/23
- Re: [Qemu-devel] Thoughts around dtrace linking..., Lee Essen, 2012/03/23
- Re: [Qemu-devel] Thoughts around dtrace linking..., Stefan Hajnoczi, 2012/03/26
- Re: [Qemu-devel] Thoughts around dtrace linking..., Lee Essen, 2012/03/26