Skip to contentSkip to conversation

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

PATCH Superseded Richard W.M. Jones 2 participants 2 messages Mar 2, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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());
| ^~~~~~~~~~~~~~~~

---
 tcg/tcg.c | 1 +
 1 file changed, 1 insertion(+)
tcg/tcg.c +1 -0
index 5cccc06ae3..6b830ade4c 100644
@@ -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
#1 lore raw
Quoted 10 lines · Richard W.M. Jones

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());
| ^~~~~~~~~~~~~~~~

Quoted 4 lines
---
  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