Skip to content

Commit

Permalink
monitor/tcg: move tcg hmp commands to accel/tcg, register them dynami…
Browse files Browse the repository at this point in the history
…cally

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>
  • Loading branch information
kraxel authored and bonzini committed Jul 9, 2021
1 parent 627302a commit bca6eb3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
29 changes: 29 additions & 0 deletions accel/tcg/hmp.c
Original file line number Diff line number Diff line change
@@ -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);
1 change: 1 addition & 0 deletions accel/tcg/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions hmp-commands-info.hx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ ERST
.args_type = "",
.params = "",
.help = "show dynamic compiler info",
.cmd = hmp_info_jit,
},
#endif

Expand All @@ -289,7 +288,6 @@ ERST
.args_type = "",
.params = "",
.help = "show dynamic compiler opcode counters",
.cmd = hmp_info_opcount,
},
#endif

Expand Down
18 changes: 0 additions & 18 deletions monitor/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bca6eb3

Please sign in to comment.