[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 12/13] tb-stats: adding TBStatistics info into perf dump
From: |
Alex Bennée |
Subject: |
[PATCH v9 12/13] tb-stats: adding TBStatistics info into perf dump |
Date: |
Mon, 7 Oct 2019 16:28:38 +0100 |
From: "Vanderson M. do Rosario" <address@hidden>
Adding TBStatistics information to linux perf TB's symbol names.
Signed-off-by: Vanderson M. do Rosario <address@hidden>
Message-Id: <address@hidden>
[AJB: fix authorship, auto-strings]
Signed-off-by: Alex Bennée <address@hidden>
---
AJB:
- use g_string and auto free
---
accel/tcg/perf/jitdump.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/perf/jitdump.c b/accel/tcg/perf/jitdump.c
index e1d6f2214e..e7b86173e0 100644
--- a/accel/tcg/perf/jitdump.c
+++ b/accel/tcg/perf/jitdump.c
@@ -146,7 +146,20 @@ void start_jitdump_file(void)
void append_load_in_jitdump_file(TranslationBlock *tb)
{
- gchar *func_name = g_strdup_printf("TB virt:0x"TARGET_FMT_lx, tb->pc);
+ g_autoptr(GString) func_name = g_string_new("TB virt:");
+
+ g_string_append_printf(func_name, "0x"TARGET_FMT_lx, tb->pc);
+
+ if (tb->tb_stats) {
+ TBStatistics *tbs = tb->tb_stats;
+ unsigned g = stat_per_translation(tbs, code.num_guest_inst);
+ unsigned ops = stat_per_translation(tbs, code.num_tcg_ops);
+ unsigned ops_opt = stat_per_translation(tbs, code.num_tcg_ops_opt);
+ unsigned spills = stat_per_translation(tbs, code.spills);
+
+ g_string_append_printf(func_name, " (g:%u op:%u opt:%u spills:%d)",
+ g, ops, ops_opt, spills);
+ }
/* Serialise the writing of the dump file */
qemu_mutex_lock(&dumpfile_lock);
@@ -167,7 +180,6 @@ void append_load_in_jitdump_file(TranslationBlock *tb)
fwrite(func_name->str, func_name->len + 1, 1, dumpfile);
fwrite(tb->tc.ptr, tb->tc.size, 1, dumpfile);
- g_free(func_name);
fflush(dumpfile);
qemu_mutex_unlock(&dumpfile_lock);
--
2.20.1
- Re: [PATCH v9 07/13] monitor: adding tb_stats hmp command, (continued)
- [PATCH v9 04/13] accel: replacing part of CONFIG_PROFILER with TBStats, Alex Bennée, 2019/10/07
- [PATCH v9 08/13] tb-stats: reset the tracked TBs on a tb_flush, Alex Bennée, 2019/10/07
- [PATCH v9 10/13] tb-stats: dump hot TBs at the end of the execution, Alex Bennée, 2019/10/07
- [PATCH v9 05/13] accel: adding TB_JIT_TIME and full replacing CONFIG_PROFILER, Alex Bennée, 2019/10/07
- [PATCH v9 12/13] tb-stats: adding TBStatistics info into perf dump,
Alex Bennée <=
- [PATCH v9 13/13] configure: remove the final bits of --profiler support, Alex Bennée, 2019/10/07
- [PATCH v9 09/13] Adding info [tb-list|tb] commands to HMP (WIP), Alex Bennée, 2019/10/07
- [PATCH v9 11/13] accel/tcg: adding integration with linux perf, Alex Bennée, 2019/10/07
- Re: [PATCH v9 00/13] TCG code quality tracking and perf integration, no-reply, 2019/10/07