qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4538] TCG profiler clean up


From: Fabrice Bellard
Subject: [Qemu-devel] [4538] TCG profiler clean up
Date: Fri, 23 May 2008 09:57:35 +0000

Revision: 4538
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4538
Author:   bellard
Date:     2008-05-23 09:57:34 +0000 (Fri, 23 May 2008)

Log Message:
-----------
TCG profiler clean up

Modified Paths:
--------------
    trunk/cpu-all.h
    trunk/exec.c
    trunk/translate-all.c

Modified: trunk/cpu-all.h
===================================================================
--- trunk/cpu-all.h     2008-05-23 09:52:20 UTC (rev 4537)
+++ trunk/cpu-all.h     2008-05-23 09:57:34 UTC (rev 4538)
@@ -1063,19 +1063,6 @@
 extern int64_t kqemu_ret_int_count;
 extern int64_t kqemu_ret_excp_count;
 extern int64_t kqemu_ret_intr_count;
-
-extern int64_t dyngen_tb_count1;
-extern int64_t dyngen_tb_count;
-extern int64_t dyngen_op_count;
-extern int64_t dyngen_old_op_count;
-extern int64_t dyngen_tcg_del_op_count;
-extern int dyngen_op_count_max;
-extern int64_t dyngen_code_in_len;
-extern int64_t dyngen_code_out_len;
-extern int64_t dyngen_interm_time;
-extern int64_t dyngen_code_time;
-extern int64_t dyngen_restore_count;
-extern int64_t dyngen_restore_time;
 #endif
 
 #endif /* CPU_ALL_H */

Modified: trunk/exec.c
===================================================================
--- trunk/exec.c        2008-05-23 09:52:20 UTC (rev 4537)
+++ trunk/exec.c        2008-05-23 09:57:34 UTC (rev 4538)
@@ -36,6 +36,7 @@
 #include "cpu.h"
 #include "exec-all.h"
 #include "qemu-common.h"
+#include "tcg.h"
 #if defined(CONFIG_USER_ONLY)
 #include <qemu.h>
 #endif
@@ -3010,45 +3011,7 @@
     cpu_fprintf(f, "TB flush count      %d\n", tb_flush_count);
     cpu_fprintf(f, "TB invalidate count %d\n", tb_phys_invalidate_count);
     cpu_fprintf(f, "TLB flush count     %d\n", tlb_flush_count);
-#ifdef CONFIG_PROFILER
-    {
-        int64_t tot;
-        tot = dyngen_interm_time + dyngen_code_time;
-        cpu_fprintf(f, "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", 
-                    dyngen_tb_count, 
-                    dyngen_tb_count1 - dyngen_tb_count,
-                    dyngen_tb_count1 ? (double)(dyngen_tb_count1 - 
dyngen_tb_count) / dyngen_tb_count1 * 100.0 : 0);
-        cpu_fprintf(f, "avg ops/TB          %0.1f max=%d\n", 
-                    dyngen_tb_count ? (double)dyngen_op_count / 
dyngen_tb_count : 0, dyngen_op_count_max);
-        cpu_fprintf(f, "old ops/total ops   %0.1f%%\n", 
-                    dyngen_op_count ? (double)dyngen_old_op_count / 
dyngen_op_count * 100.0 : 0);
-        cpu_fprintf(f, "deleted ops/TB      %0.2f\n",
-                    dyngen_tb_count ? 
-                    (double)dyngen_tcg_del_op_count / dyngen_tb_count : 0);
-        cpu_fprintf(f, "cycles/op           %0.1f\n", 
-                    dyngen_op_count ? (double)tot / dyngen_op_count : 0);
-        cpu_fprintf(f, "cycles/in byte     %0.1f\n", 
-                    dyngen_code_in_len ? (double)tot / dyngen_code_in_len : 0);
-        cpu_fprintf(f, "cycles/out byte     %0.1f\n", 
-                    dyngen_code_out_len ? (double)tot / dyngen_code_out_len : 
0);
-        if (tot == 0)
-            tot = 1;
-        cpu_fprintf(f, "  gen_interm time   %0.1f%%\n", 
-                    (double)dyngen_interm_time / tot * 100.0);
-        cpu_fprintf(f, "  gen_code time     %0.1f%%\n", 
-                    (double)dyngen_code_time / tot * 100.0);
-        cpu_fprintf(f, "cpu_restore count   %" PRId64 "\n",
-                    dyngen_restore_count);
-        cpu_fprintf(f, "  avg cycles        %0.1f\n",
-                    dyngen_restore_count ? (double)dyngen_restore_time / 
dyngen_restore_count : 0);
-        {
-            extern void dump_op_count(void);
-            dump_op_count();
-        }
-    }
-#endif
+    tcg_dump_info(f, cpu_fprintf);
 }
 
 #if !defined(CONFIG_USER_ONLY)

Modified: trunk/translate-all.c
===================================================================
--- trunk/translate-all.c       2008-05-23 09:52:20 UTC (rev 4537)
+++ trunk/translate-all.c       2008-05-23 09:57:34 UTC (rev 4538)
@@ -48,21 +48,6 @@
 uint32_t gen_opc_hflags[OPC_BUF_SIZE];
 #endif
 
-#ifdef CONFIG_PROFILER
-int64_t dyngen_tb_count1;
-int64_t dyngen_tb_count;
-int64_t dyngen_op_count;
-int64_t dyngen_old_op_count;
-int64_t dyngen_tcg_del_op_count;
-int dyngen_op_count_max;
-int64_t dyngen_code_in_len;
-int64_t dyngen_code_out_len;
-int64_t dyngen_interm_time;
-int64_t dyngen_code_time;
-int64_t dyngen_restore_count;
-int64_t dyngen_restore_time;
-#endif
-
 /* XXX: suppress that */
 unsigned long code_gen_max_block_size(void)
 {
@@ -102,8 +87,8 @@
 #endif
 
 #ifdef CONFIG_PROFILER
-    dyngen_tb_count1++; /* includes aborted translations because of
-                           exceptions */
+    s->tb_count1++; /* includes aborted translations because of
+                       exceptions */
     ti = profile_getclock();
 #endif
     tcg_func_start(s);
@@ -129,16 +114,16 @@
 #endif
 
 #ifdef CONFIG_PROFILER
-    dyngen_tb_count++;
-    dyngen_interm_time += profile_getclock() - ti;
-    dyngen_code_time -= profile_getclock();
+    s->tb_count++;
+    s->interm_time += profile_getclock() - ti;
+    s->code_time -= profile_getclock();
 #endif
     gen_code_size = dyngen_code(s, gen_code_buf);
     *gen_code_size_ptr = gen_code_size;
 #ifdef CONFIG_PROFILER
-    dyngen_code_time += profile_getclock();
-    dyngen_code_in_len += tb->size;
-    dyngen_code_out_len += gen_code_size;
+    s->code_time += profile_getclock();
+    s->code_in_len += tb->size;
+    s->code_out_len += gen_code_size;
 #endif
 
 #ifdef DEBUG_DISAS
@@ -196,8 +181,8 @@
     gen_pc_load(env, tb, searched_pc, j, puc);
 
 #ifdef CONFIG_PROFILER
-    dyngen_restore_time += profile_getclock() - ti;
-    dyngen_restore_count++;
+    s->restore_time += profile_getclock() - ti;
+    s->restore_count++;
 #endif
     return 0;
 }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]