qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 10/11] ppc: avoid write only variables


From: Blue Swirl
Subject: [Qemu-devel] Re: [PATCH 10/11] ppc: avoid write only variables
Date: Fri, 8 Oct 2010 15:44:25 +0000

On Thu, Oct 7, 2010 at 8:08 PM, Alexander Graf <address@hidden> wrote:
>
> Am 07.10.2010 um 20:59 schrieb Blue Swirl <address@hidden>:
>
>> On Wed, Oct 6, 2010 at 9:39 PM, Alexander Graf <address@hidden> wrote:
>>>
>>> On 06.10.2010, at 23:34, Blue Swirl wrote:
>>>
>>>> Compiling with GCC 4.6.0 20100925 produced warnings:
>>>> /src/qemu/target-ppc/op_helper.c: In function 'helper_icbi':
>>>> /src/qemu/target-ppc/op_helper.c:351:14: error: variable 'tmp' set but
>>>> not used [-Werror=unused-but-set-variable]
>>>> /src/qemu/target-ppc/op_helper.c: In function 'do_6xx_tlb':
>>>> /src/qemu/target-ppc/op_helper.c:3805:28: error: variable 'EPN' set
>>>> but not used [-Werror=unused-but-set-variable]
>>>> /src/qemu/target-ppc/op_helper.c: In function 'do_74xx_tlb':
>>>> /src/qemu/target-ppc/op_helper.c:3838:28: error: variable 'EPN' set
>>>> but not used [-Werror=unused-but-set-variable]
>>>>
>>>> Fix by making the variable declarations and their uses also conditional
>>>> to debug definition. Delete tmp.
>>>
>>> Maybe it would make more sense to get those LOG_* macros into static inline 
>>> functions. But for the issue at hand, the solution looks good to me.
>>
>> Perhaps all conditionally enabled debug printf stuff should be
>> transformed into tracepoints? That would be more flexible than
>> uncommenting DEBUG_foobar. Would it help with bitrot too?
>
> I haven't looked at the qemu tracepoints framework yet, but some of this 
> debug stuff is in hot paths and only very rarely used. So unless it is 
> overhead free, I'd prefer debug function stubs.

There is zero overhead with 'nop' backend, with other backends there
is some overhead. I think only 'nop' backend should be used on
production versions, so this should be comparable to current debug
stuff.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]