aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2021-06-24 12:38:36 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-07-09 18:21:33 +0200
commitbca6eb34f0318b1b8211c9d227d5439e2d44286d (patch)
treeac90891f06ba7336b97b87c2917b775b209c7909 /accel
parent627302afb2f85cdd4b59595361876487aef19b7a (diff)
downloadqemu-bca6eb34f0318b1b8211c9d227d5439e2d44286d.zip
qemu-bca6eb34f0318b1b8211c9d227d5439e2d44286d.tar.gz
qemu-bca6eb34f0318b1b8211c9d227d5439e2d44286d.tar.bz2
monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically
One more little step towards modular tcg ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Jose R. Ziviani <jziviani@suse.de> Message-Id: <20210624103836.2382472-35-kraxel@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/hmp.c29
-rw-r--r--accel/tcg/meson.build1
2 files changed, 30 insertions, 0 deletions
diff --git a/accel/tcg/hmp.c b/accel/tcg/hmp.c
new file mode 100644
index 0000000..a6e72fd
--- /dev/null
+++ b/accel/tcg/hmp.c
@@ -0,0 +1,29 @@
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "exec/exec-all.h"
+#include "monitor/monitor.h"
+#include "sysemu/tcg.h"
+
+static void hmp_info_jit(Monitor *mon, const QDict *qdict)
+{
+ if (!tcg_enabled()) {
+ error_report("JIT information is only available with accel=tcg");
+ return;
+ }
+
+ dump_exec_info();
+ dump_drift_info();
+}
+
+static void hmp_info_opcount(Monitor *mon, const QDict *qdict)
+{
+ dump_opcount_info();
+}
+
+static void hmp_tcg_register(void)
+{
+ monitor_register_hmp("jit", true, hmp_info_jit);
+ monitor_register_hmp("opcount", true, hmp_info_opcount);
+}
+
+type_init(hmp_tcg_register);
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 0ae9180..137a1a4 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -15,6 +15,7 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
'cputlb.c',
+ 'hmp.c',
))
tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(