@@ -7,7 +7,6 @@
#ifndef TCG_PERF_H
#define TCG_PERF_H
-#if defined(CONFIG_TCG) && defined(CONFIG_LINUX)
/* Start writing perf-<pid>.map. */
void perf_enable_perfmap(void);
@@ -23,27 +22,5 @@ void perf_report_code(uint64_t guest_pc, TranslationBlock *tb,
/* Stop writing perf-<pid>.map and/or jit-<pid>.dump. */
void perf_exit(void);
-#else
-static inline void perf_enable_perfmap(void)
-{
-}
-
-static inline void perf_enable_jitdump(void)
-{
-}
-
-static inline void perf_report_prologue(const void *start, size_t size)
-{
-}
-
-static inline void perf_report_code(uint64_t guest_pc, TranslationBlock *tb,
- const void *start)
-{
-}
-
-static inline void perf_exit(void)
-{
-}
-#endif
#endif
new file mode 100644
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* TCG perf stubs */
+
+#include "qemu/osdep.h"
+#include "tcg/perf.h"
+
+void perf_enable_perfmap(void)
+{
+}
+
+void perf_enable_jitdump(void)
+{
+}
+
+void perf_report_prologue(const void *start, size_t size)
+{
+}
+
+void perf_report_code(uint64_t guest_pc, TranslationBlock *tb,
+ const void *start)
+{
+}
+
+void perf_exit(void)
+{
+}
@@ -25,6 +25,8 @@ endif
tcg_ss.add(when: libdw, if_true: files('debuginfo.c'))
if host_os == 'linux'
tcg_ss.add(files('perf.c'))
+else
+ tcg_ss.add(files('perf-stubs.c'))
endif
tcg_ss = tcg_ss.apply({})
These are not called so frequently as to be performance sensitive. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- include/tcg/perf.h | 23 ----------------------- tcg/perf-stubs.c | 26 ++++++++++++++++++++++++++ tcg/meson.build | 2 ++ 3 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 tcg/perf-stubs.c