From 246ae24d7df47f05d7b102f9c84e00b536eadc43 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sun, 2 Nov 2014 11:04:18 +0300 Subject: tcg: add separate monitor command to dump opcode counters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- tcg/tcg.c | 12 ++++++++---- tcg/tcg.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'tcg') diff --git a/tcg/tcg.c b/tcg/tcg.c index 7a84b87..6ff8b51 100644 --- a/tcg/tcg.c +++ b/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 void dump_op_count(void) +void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf) { int 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 @@ -2620,8 +2626,6 @@ void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf) s->restore_count); cpu_fprintf(f, " avg cycles %0.1f\n", s->restore_count ? (double)s->restore_time / s->restore_count : 0); - - dump_op_count(); } #else void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf) diff --git a/tcg/tcg.h b/tcg/tcg.h index 7285f71..944b877 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -610,6 +610,7 @@ int tcg_check_temp_count(void); #endif 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_IALIAS 0x40 -- cgit v1.1