diff mbox

translate-all: fix compiler warning and linked error

Message ID 1366616571-4321-1-git-send-email-aik@ozlabs.ru
State New
Headers show

Commit Message

Alexey Kardashevskiy April 22, 2013, 7:42 a.m. UTC
The code did use profile_getclock() but did not include
include/qemu/timer.h where this function is defined. The patch fixes this.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

The exact warning and error messages are:

/home/alexey/pcipassthru/qemu-impreza/translate-all.c:150:5: warning: implicit declaration of function 'profile_getclock' [-Wimplicit-function-declaration]
     ti = profile_getclock();
     ^

...

/home/alexey/pcipassthru/qemu-impreza/translate-all.c:150: undefined reference to `profile_getclock'


---
 translate-all.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Peter Maydell April 22, 2013, 9 a.m. UTC | #1
On 22 April 2013 08:42, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> The code did use profile_getclock() but did not include
> include/qemu/timer.h where this function is defined. The patch fixes this.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

NB that this compile failure only happens if you configure
with --enable-profiler.

thanks
-- PMM
Alexey Kardashevskiy April 22, 2013, 10:01 a.m. UTC | #2
On 04/22/2013 07:00 PM, Peter Maydell wrote:
> On 22 April 2013 08:42, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>> The code did use profile_getclock() but did not include
>> include/qemu/timer.h where this function is defined. The patch fixes this.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> NB that this compile failure only happens if you configure
> with --enable-profiler.

I also thought I can enable/disable it via ./configure but in fact I cannot:

alexey@ka1:~/pcipassthru/qemu-impreza$ ./configure --help | grep prof
alexey@ka1:~/pcipassthru/qemu-impreza$
Peter Maydell April 22, 2013, 10:03 a.m. UTC | #3
On 22 April 2013 11:01, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> On 04/22/2013 07:00 PM, Peter Maydell wrote:
>> NB that this compile failure only happens if you configure
>> with --enable-profiler.
>
>
> I also thought I can enable/disable it via ./configure but in fact I cannot:
>
> alexey@ka1:~/pcipassthru/qemu-impreza$ ./configure --help | grep prof
> alexey@ka1:~/pcipassthru/qemu-impreza$

--enable-profiler exists but it is undocumented (ie not mentioned
in the --help text). In fact I have no idea how you tripped over
this missing include if you don't know about --enable-profiler,
since configure's default is to not enable this code.

thanks
-- PMM
Alexey Kardashevskiy April 22, 2013, 10:08 a.m. UTC | #4
On 04/22/2013 08:03 PM, Peter Maydell wrote:
> On 22 April 2013 11:01, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>> On 04/22/2013 07:00 PM, Peter Maydell wrote:
>>> NB that this compile failure only happens if you configure
>>> with --enable-profiler.
>>
>>
>> I also thought I can enable/disable it via ./configure but in fact I cannot:
>>
>> alexey@ka1:~/pcipassthru/qemu-impreza$ ./configure --help | grep prof
>> alexey@ka1:~/pcipassthru/qemu-impreza$
>
> --enable-profiler exists but it is undocumented (ie not mentioned
> in the --help text). In fact I have no idea how you tripped over
> this missing include if you don't know about --enable-profiler,
> since configure's default is to not enable this code.

Ah. Looked closer to my scripts and found --enable-profiler (leftover from 
something). I was confused by the fact that there is no 
"--disable-profiler", the ./configure script prints an error.
Anthony Liguori April 22, 2013, 6:34 p.m. UTC | #5
Applied.  Thanks.

Regards,

Anthony Liguori
diff mbox

Patch

diff --git a/translate-all.c b/translate-all.c
index 08dd038..d04a116 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -58,6 +58,7 @@ 
 
 #include "exec/cputlb.h"
 #include "translate-all.h"
+#include "qemu/timer.h"
 
 //#define DEBUG_TB_INVALIDATE
 //#define DEBUG_FLUSH