diff mbox series

tcg: Include "qemu/timer.h" for profile_getclock

Message ID 20230302162909.3267074-1-rjones@redhat.com (mailing list archive)
State New, archived
Headers show
Series tcg: Include "qemu/timer.h" for profile_getclock | expand

Commit Message

Richard W.M. Jones March 2, 2023, 4:29 p.m. UTC
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());
      |                                                   ^~~~~~~~~~~~~~~~

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
 tcg/tcg.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Philippe Mathieu-Daudé March 2, 2023, 9:56 p.m. UTC | #1
On 2/3/23 17:29, Richard W.M. Jones wrote:
> 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());
>        |                                                   ^~~~~~~~~~~~~~~~
> 
> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
> ---
>   tcg/tcg.c | 1 +
>   1 file changed, 1 insertion(+)

These files have the same issue:

- softmmu/runstate.c
- accel/tcg/translate-all.c
- accel/tcg/tcg-accel-ops.c
diff mbox series

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 5cccc06ae3..6b830ade4c 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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