tcg: Include "qemu/timer.h" for profile_getclock
PATCH v2 1/1 tcg: Include "qemu/timer.h" for profile_getclock
When CONFIG_PROFILER is set there are various undefined references to profile_getclock. Include the header which defines this function.
For example:
../tcg/tcg.c: In function ‘tcg_gen_code’:../tcg/tcg.c:4905:51: warning: implicit declaration of function ‘profile_getclock’ [-Wimplicit-function-declaration]
4905 | qatomic_set(&prof->opt_time, prof->opt_time - profile_getclock());
| ^~~~~~~~~~~~~~~~
Thanks: Philippe Mathieu-Daudé
--- accel/tcg/tcg-accel-ops.c | 1 + accel/tcg/translate-all.c | 1 + softmmu/runstate.c | 1 + tcg/tcg.c | 1 + 4 files changed, 4 insertions(+)
accel/tcg/tcg-accel-ops.c +1 -0
@@ -31,6 +31,7 @@#include "sysemu/cpu-timers.h" #include "qemu/main-loop.h" #include "qemu/guest-random.h" +#include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/hwaddr.h" #include "exec/gdbstub.h"
accel/tcg/translate-all.c +1 -0
@@ -51,6 +51,7 @@#include "qemu/qemu-print.h" #include "qemu/main-loop.h" #include "qemu/cacheinfo.h" +#include "qemu/timer.h" #include "exec/log.h" #include "sysemu/cpus.h" #include "sysemu/cpu-timers.h"
softmmu/runstate.c +1 -0
@@ -46,6 +46,7 @@#include "qemu/module.h" #include "qemu/plugin.h" #include "qemu/sockets.h" +#include "qemu/timer.h" #include "qemu/thread.h" #include "qom/object.h" #include "qom/object_interfaces.h"
tcg/tcg.c +1 -0
@@ -36,6 +36,7 @@#include "qemu/qemu-print.h" #include "qemu/cacheflush.h" #include "qemu/cacheinfo.h" +#include "qemu/timer.h" /* Note: the long term plan is to reduce the dependencies on the QEMU CPU definitions. Currently they are used for qemu_ld/st
Signature · 1 line
2.39.2
Quoted 11 lines · Richard W.M. Jones
When
CONFIG_PROFILERis set there are various undefined references toprofile_getclock. Include the header which defines this function.For example:
../tcg/tcg.c: In function ‘tcg_gen_code’:../tcg/tcg.c:4905:51: warning: implicit declaration of function ‘profile_getclock’ [-Wimplicit-function-declaration]
4905 |qatomic_set(&prof->opt_time, prof->opt_time - profile_getclock());
| ^~~~~~~~~~~~~~~~Thanks: Philippe Mathieu-Daudé
;)
Quoted 7 lines
Signed-off-by Richard W.M. Jones <[email protected]>--- accel/tcg/tcg-accel-ops.c | 1 + accel/tcg/translate-all.c | 1 + softmmu/runstate.c | 1 + tcg/tcg.c | 1 + 4 files changed, 4 insertions(+)
Quoted 10 lines · Richard W.M. Jones
When
CONFIG_PROFILERis set there are various undefined references toprofile_getclock. Include the header which defines this function.For example:
../tcg/tcg.c: In function ‘tcg_gen_code’:../tcg/tcg.c:4905:51: warning: implicit declaration of function ‘profile_getclock’ [-Wimplicit-function-declaration]
4905 |qatomic_set(&prof->opt_time, prof->opt_time - profile_getclock());
| ^~~~~~~~~~~~~~~~
Quoted 8 lines
Thanks: Philippe Mathieu-Daudé
Signed-off-by Richard W.M. Jones<[email protected]>--- accel/tcg/tcg-accel-ops.c | 1 + accel/tcg/translate-all.c | 1 + softmmu/runstate.c | 1 + tcg/tcg.c | 1 + 4 files changed, 4 insertions(+)
And queued to tcg-next.
r~