Show the guest->host code expansion ratio when debug-printing
translations.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2624 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/main_main.c b/priv/main_main.c
index 2fdf49f..2304d5a 100644
--- a/priv/main_main.c
+++ b/priv/main_main.c
@@ -864,6 +864,16 @@
vexSetAllocModeTEMP_and_clear();
+ if (vex_traceflags) {
+ /* Print the expansion ratio for this SB. */
+ j = 0; /* total guest bytes */
+ for (i = 0; i < vta->guest_extents->n_used; i++) {
+ j += vta->guest_extents->len[i];
+ }
+ if (1) vex_printf("VexExpansionRatio %d %d %d :10\n\n",
+ j, out_used, (10 * out_used) / (j == 0 ? 1 : j));
+ }
+
vex_traceflags = 0;
res.status = VexTransOK;
return res;