translate-all: fix compiler warning and linked error
PATCH 1/1 translate-all: fix compiler warning and linked error
The code did use profile_getclock() but did not include include/qemu/timer.h where this function is defined. The patch fixes this.
---
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(+)
translate-all.c +1 -0
@@ -58,6 +58,7 @@#include "exec/cputlb.h" #include "translate-all.h" +#include "qemu/timer.h" //#define DEBUG_TB_INVALIDATE //#define DEBUG_FLUSH
Signature · 1 line
1.7.10.4
Quoted 4 lines · Alexey Kardashevskiy
The code did use
profile_getclock()but did not includeinclude/qemu/timer.hwhere this function is defined. The patch fixes this.Signed-off-by Alexey Kardashevskiy <[email protected]>
NB that this compile failure only happens if you configure with --enable-profiler.
thanks
-- PMM
Quoted 10 lines · Peter Maydell
Quoted 4 lines · Alexey Kardashevskiy
The code did use
profile_getclock()but did not includeinclude/qemu/timer.hwhere this function is defined. The patch fixes this.Signed-off-by Alexey Kardashevskiy <[email protected]>Reviewed-by Peter Maydell <[email protected]>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$
Signature · 1 line
Alexey
Quoted 9 lines · Alexey Kardashevskiy
Quoted 2 lines · Peter Maydell
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
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Alexey Kardashevskiy
Quoted 2 lines · Peter Maydell
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:
Quoted 7 lines
Quoted 2 lines
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.
Signature · 1 line
Alexey
Anthony Liguori
AppliedApplied. Thanks.
Regards,
Anthony Liguori