[PATCH] tcg: Include "qemu/timer.h" for profile_getclock

Richard W.M. Jones posted 1 patch 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230302162909.3267074-1-rjones@redhat.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>
There is a newer version of this series
tcg/tcg.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] tcg: Include "qemu/timer.h" for profile_getclock
Posted by Richard W.M. Jones 1 year, 1 month ago
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(+)

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
-- 
2.39.2


Re: [PATCH] tcg: Include "qemu/timer.h" for profile_getclock
Posted by Philippe Mathieu-Daudé 1 year, 1 month ago
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