tcg: add separate monitor command to dump opcode counters
Currently 'info jit' outputs half of the information to monitor and the rest to qemu log. Dumping opcode counts to monitor as a part of 'info jit' command doesn't sound useful. Add new monitor command 'info opcount' that only dumps opcode counters. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
d86fb03469
commit
246ae24d7d
|
@ -342,6 +342,7 @@ extern RAMList ram_list;
|
||||||
#define TLB_MMIO (1 << 5)
|
#define TLB_MMIO (1 << 5)
|
||||||
|
|
||||||
void dump_exec_info(FILE *f, fprintf_function cpu_fprintf);
|
void dump_exec_info(FILE *f, fprintf_function cpu_fprintf);
|
||||||
|
void dump_opcount_info(FILE *f, fprintf_function cpu_fprintf);
|
||||||
ram_addr_t last_ram_offset(void);
|
ram_addr_t last_ram_offset(void);
|
||||||
void qemu_mutex_lock_ramlist(void);
|
void qemu_mutex_lock_ramlist(void);
|
||||||
void qemu_mutex_unlock_ramlist(void);
|
void qemu_mutex_unlock_ramlist(void);
|
||||||
|
|
12
monitor.c
12
monitor.c
|
@ -1042,6 +1042,11 @@ static void do_info_jit(Monitor *mon, const QDict *qdict)
|
||||||
dump_drift_info((FILE *)mon, monitor_fprintf);
|
dump_drift_info((FILE *)mon, monitor_fprintf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void do_info_opcount(Monitor *mon, const QDict *qdict)
|
||||||
|
{
|
||||||
|
dump_opcount_info((FILE *)mon, monitor_fprintf);
|
||||||
|
}
|
||||||
|
|
||||||
static void do_info_history(Monitor *mon, const QDict *qdict)
|
static void do_info_history(Monitor *mon, const QDict *qdict)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -2738,6 +2743,13 @@ static mon_cmd_t info_cmds[] = {
|
||||||
.help = "show dynamic compiler info",
|
.help = "show dynamic compiler info",
|
||||||
.mhandler.cmd = do_info_jit,
|
.mhandler.cmd = do_info_jit,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "opcount",
|
||||||
|
.args_type = "",
|
||||||
|
.params = "",
|
||||||
|
.help = "show dynamic compiler opcode counters",
|
||||||
|
.mhandler.cmd = do_info_opcount,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.name = "kvm",
|
.name = "kvm",
|
||||||
.args_type = "",
|
.args_type = "",
|
||||||
|
|
12
tcg/tcg.c
12
tcg/tcg.c
|
@ -2401,14 +2401,20 @@ static int tcg_reg_alloc_call(TCGContext *s, const TCGOpDef *def,
|
||||||
|
|
||||||
static int64_t tcg_table_op_count[NB_OPS];
|
static int64_t tcg_table_op_count[NB_OPS];
|
||||||
|
|
||||||
static void dump_op_count(void)
|
void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = INDEX_op_end; i < NB_OPS; i++) {
|
for(i = INDEX_op_end; i < NB_OPS; i++) {
|
||||||
qemu_log("%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
|
cpu_fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name,
|
||||||
|
tcg_table_op_count[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf)
|
||||||
|
{
|
||||||
|
cpu_fprintf(f, "[TCG profiler not compiled]\n");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -2620,8 +2626,6 @@ void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
|
||||||
s->restore_count);
|
s->restore_count);
|
||||||
cpu_fprintf(f, " avg cycles %0.1f\n",
|
cpu_fprintf(f, " avg cycles %0.1f\n",
|
||||||
s->restore_count ? (double)s->restore_time / s->restore_count : 0);
|
s->restore_count ? (double)s->restore_time / s->restore_count : 0);
|
||||||
|
|
||||||
dump_op_count();
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
|
void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
|
||||||
|
|
|
@ -610,6 +610,7 @@ int tcg_check_temp_count(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf);
|
void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf);
|
||||||
|
void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf);
|
||||||
|
|
||||||
#define TCG_CT_ALIAS 0x80
|
#define TCG_CT_ALIAS 0x80
|
||||||
#define TCG_CT_IALIAS 0x40
|
#define TCG_CT_IALIAS 0x40
|
||||||
|
|
|
@ -1651,6 +1651,11 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)
|
||||||
tcg_dump_info(f, cpu_fprintf);
|
tcg_dump_info(f, cpu_fprintf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dump_opcount_info(FILE *f, fprintf_function cpu_fprintf)
|
||||||
|
{
|
||||||
|
tcg_dump_op_count(f, cpu_fprintf);
|
||||||
|
}
|
||||||
|
|
||||||
#else /* CONFIG_USER_ONLY */
|
#else /* CONFIG_USER_ONLY */
|
||||||
|
|
||||||
void cpu_interrupt(CPUState *cpu, int mask)
|
void cpu_interrupt(CPUState *cpu, int mask)
|
||||||
|
|
Loading…
Reference in a new issue