aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-04-17 21:17:52 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-04-18 22:18:59 +0200
commit3de2faa9a87e0a9fd84a00a2481cdbb0304e866d (patch)
tree5120f80212118065ab68f0536034d57bc2edd763 /tcg
parentd4c51a0af35f5a29da3d58e144f8352581a3f34e (diff)
tcg: Simplify how dump_exec_info() prints
dump_exec_info() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_jit() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417191805.28198-5-armbru@redhat.com>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c41
-rw-r--r--tcg/tcg.h2
2 files changed, 22 insertions, 21 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index cc5f4e2a03..6a22c8746c 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -4015,7 +4015,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
}
#ifdef CONFIG_PROFILER
-void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
+void tcg_dump_info(void)
{
TCGProfile prof = {};
const TCGProfile *s;
@@ -4029,52 +4029,53 @@ void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
tb_div_count = tb_count ? tb_count : 1;
tot = s->interm_time + s->code_time;
- cpu_fprintf(f, "JIT cycles %" PRId64 " (%0.3f s at 2.4 GHz)\n",
+ qemu_printf("JIT cycles %" PRId64 " (%0.3f s at 2.4 GHz)\n",
tot, tot / 2.4e9);
- cpu_fprintf(f, "translated TBs %" PRId64 " (aborted=%" PRId64 " %0.1f%%)\n",
+ qemu_printf("translated TBs %" PRId64 " (aborted=%" PRId64
+ " %0.1f%%)\n",
tb_count, s->tb_count1 - tb_count,
(double)(s->tb_count1 - s->tb_count)
/ (s->tb_count1 ? s->tb_count1 : 1) * 100.0);
- cpu_fprintf(f, "avg ops/TB %0.1f max=%d\n",
+ qemu_printf("avg ops/TB %0.1f max=%d\n",
(double)s->op_count / tb_div_count, s->op_count_max);
- cpu_fprintf(f, "deleted ops/TB %0.2f\n",
+ qemu_printf("deleted ops/TB %0.2f\n",
(double)s->del_op_count / tb_div_count);
- cpu_fprintf(f, "avg temps/TB %0.2f max=%d\n",
+ qemu_printf("avg temps/TB %0.2f max=%d\n",
(double)s->temp_count / tb_div_count, s->temp_count_max);
- cpu_fprintf(f, "avg host code/TB %0.1f\n",
+ qemu_printf("avg host code/TB %0.1f\n",
(double)s->code_out_len / tb_div_count);
- cpu_fprintf(f, "avg search data/TB %0.1f\n",
+ qemu_printf("avg search data/TB %0.1f\n",
(double)s->search_out_len / tb_div_count);
- cpu_fprintf(f, "cycles/op %0.1f\n",
+ qemu_printf("cycles/op %0.1f\n",
s->op_count ? (double)tot / s->op_count : 0);
- cpu_fprintf(f, "cycles/in byte %0.1f\n",
+ qemu_printf("cycles/in byte %0.1f\n",
s->code_in_len ? (double)tot / s->code_in_len : 0);
- cpu_fprintf(f, "cycles/out byte %0.1f\n",
+ qemu_printf("cycles/out byte %0.1f\n",
s->code_out_len ? (double)tot / s->code_out_len : 0);
- cpu_fprintf(f, "cycles/search byte %0.1f\n",
+ qemu_printf("cycles/search byte %0.1f\n",
s->search_out_len ? (double)tot / s->search_out_len : 0);
if (tot == 0) {
tot = 1;
}
- cpu_fprintf(f, " gen_interm time %0.1f%%\n",
+ qemu_printf(" gen_interm time %0.1f%%\n",
(double)s->interm_time / tot * 100.0);
- cpu_fprintf(f, " gen_code time %0.1f%%\n",
+ qemu_printf(" gen_code time %0.1f%%\n",
(double)s->code_time / tot * 100.0);
- cpu_fprintf(f, "optim./code time %0.1f%%\n",
+ qemu_printf("optim./code time %0.1f%%\n",
(double)s->opt_time / (s->code_time ? s->code_time : 1)
* 100.0);
- cpu_fprintf(f, "liveness/code time %0.1f%%\n",
+ qemu_printf("liveness/code time %0.1f%%\n",
(double)s->la_time / (s->code_time ? s->code_time : 1) * 100.0);
- cpu_fprintf(f, "cpu_restore count %" PRId64 "\n",
+ qemu_printf("cpu_restore count %" PRId64 "\n",
s->restore_count);
- cpu_fprintf(f, " avg cycles %0.1f\n",
+ qemu_printf(" avg cycles %0.1f\n",
s->restore_count ? (double)s->restore_time / s->restore_count : 0);
}
#else
-void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
+void tcg_dump_info(void)
{
- cpu_fprintf(f, "[TCG profiler not compiled]\n");
+ qemu_printf("[TCG profiler not compiled]\n");
}
#endif
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 9f2b03f119..a394d78237 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -1017,7 +1017,7 @@ int tcg_check_temp_count(void);
#endif
int64_t tcg_cpu_exec_time(void);
-void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf);
+void tcg_dump_info(void);
void tcg_dump_op_count(void);
#define TCG_CT_ALIAS 0x80