[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/5] monitor/tcg: move tcg hmp commands to accel/tcg, register th
From: |
Gerd Hoffmann |
Subject: |
[PATCH 5/5] monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically |
Date: |
Tue, 22 Jun 2021 14:49:15 +0200 |
One more little step towards modular tcg ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
accel/tcg/hmp.c | 29 +++++++++++++++++++++++++++++
monitor/misc.c | 18 ------------------
accel/tcg/meson.build | 1 +
hmp-commands-info.hx | 2 --
4 files changed, 30 insertions(+), 20 deletions(-)
create mode 100644 accel/tcg/hmp.c
diff --git a/accel/tcg/hmp.c b/accel/tcg/hmp.c
new file mode 100644
index 000000000000..a6e72fdb3ed6
--- /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/monitor/misc.c b/monitor/misc.c
index 672267008b02..e28f23e1931a 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -320,24 +320,6 @@ static void hmp_info_registers(Monitor *mon, const QDict
*qdict)
}
}
-#ifdef CONFIG_TCG
-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();
-}
-#endif
-
static void hmp_info_sync_profile(Monitor *mon, const QDict *qdict)
{
int64_t max = qdict_get_try_int(qdict, "max", 10);
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 0ae9180282e3..137a1a44cc0a 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(
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index ce42aef47acb..27206ac049df 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -274,7 +274,6 @@ ERST
.args_type = "",
.params = "",
.help = "show dynamic compiler info",
- .cmd = hmp_info_jit,
},
#endif
@@ -289,7 +288,6 @@ ERST
.args_type = "",
.params = "",
.help = "show dynamic compiler opcode counters",
- .cmd = hmp_info_opcount,
},
#endif
--
2.31.1
- [PATCH 0/5] [RfC] monitor/hmp: command register support, Gerd Hoffmann, 2021/06/22
- [PATCH 1/5] monitor: allow register hmp commands, Gerd Hoffmann, 2021/06/22
- [PATCH 4/5] usb: build usb-host as module, Gerd Hoffmann, 2021/06/22
- [PATCH 2/5] usb: drop usb_host_dev_is_scsi_storage hook, Gerd Hoffmann, 2021/06/22
- [PATCH 3/5] monitor/usb: register 'info usbhost' dynamically, Gerd Hoffmann, 2021/06/22
- [PATCH 5/5] monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically,
Gerd Hoffmann <=