Skip to content

Commit f0d14a9

Browse files
committed
monitor: disable "info jit" and "info opcount" if !TCG
Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 8e2b729 commit f0d14a9

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

accel/tcg/translate-all.c

+5
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,11 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)
18511851

18521852
tb_lock();
18531853

1854+
if (!tcg_enabled()) {
1855+
cpu_fprintf(f, "TCG not enabled\n");
1856+
return;
1857+
}
1858+
18541859
target_code_size = 0;
18551860
max_target_code_size = 0;
18561861
cross_page = 0;

hmp-commands-info.hx

+4
Original file line numberDiff line numberDiff line change
@@ -261,27 +261,31 @@ STEXI
261261
Show memory tree.
262262
ETEXI
263263

264+
#if defined(CONFIG_TCG)
264265
{
265266
.name = "jit",
266267
.args_type = "",
267268
.params = "",
268269
.help = "show dynamic compiler info",
269270
.cmd = hmp_info_jit,
270271
},
272+
#endif
271273

272274
STEXI
273275
@item info jit
274276
@findex jit
275277
Show dynamic compiler info.
276278
ETEXI
277279

280+
#if defined(CONFIG_TCG)
278281
{
279282
.name = "opcount",
280283
.args_type = "",
281284
.params = "",
282285
.help = "show dynamic compiler opcode counters",
283286
.cmd = hmp_info_opcount,
284287
},
288+
#endif
285289

286290
STEXI
287291
@item info opcount

monitor.c

+2
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict)
10981098
}
10991099
}
11001100

1101+
#ifdef CONFIG_TCG
11011102
static void hmp_info_jit(Monitor *mon, const QDict *qdict)
11021103
{
11031104
if (!tcg_enabled()) {
@@ -1113,6 +1114,7 @@ static void hmp_info_opcount(Monitor *mon, const QDict *qdict)
11131114
{
11141115
dump_opcount_info((FILE *)mon, monitor_fprintf);
11151116
}
1117+
#endif
11161118

11171119
static void hmp_info_history(Monitor *mon, const QDict *qdict)
11181120
{

0 commit comments

Comments
 (0)