/*OUT*/VexGuestExtents* vge,
/*OUT*/UInt* n_sc_extents,
/*OUT*/UInt* n_guest_instrs, /* stats only */
+ /*OUT*/UShort* n_uncond_in_trace, /* stats only */
+ /*OUT*/UShort* n_cond_in_trace, /* stats only */
/*MOD*/VexRegisterUpdates* pxControl,
/*IN*/ void* callback_opaque,
/*IN*/ DisOneInstrFn dis_instr_fn,
vge->n_used = 0;
*n_sc_extents = 0;
*n_guest_instrs = 0;
+ *n_uncond_in_trace = 0;
+ *n_cond_in_trace = 0;
/* And a new IR superblock to dump the result into. */
IRSB* irsb = emptyIRSB();
add_extent(vge, bb_base, bb_len);
update_instr_budget(&instrs_avail, &verbose_mode,
bb_instrs_used, bb_verbose_seen);
+ *n_uncond_in_trace += 1;
} // if (be.tag == Be_Uncond)
// Try for an extend based on a conditional branch, specifically in the
add_extent(vge, sx_base, sx_len);
update_instr_budget(&instrs_avail, &verbose_mode,
sx_instrs_used, sx_verbose_seen);
+ *n_cond_in_trace += 1;
}
break;
} // if (be.tag == Be_Cond)
/*OUT*/VexGuestExtents* vge,
/*OUT*/UInt* n_sc_extents,
/*OUT*/UInt* n_guest_instrs, /* stats only */
+ /*OUT*/UShort* n_uncond_in_trace, /* stats only */
+ /*OUT*/UShort* n_cond_in_trace, /* stats only */
/*MOD*/VexRegisterUpdates* pxControl,
/*IN*/ void* callback_opaque,
/*IN*/ DisOneInstrFn dis_instr_fn,
res->n_sc_extents = 0;
res->offs_profInc = -1;
res->n_guest_instrs = 0;
+ res->n_uncond_in_trace = 0;
+ res->n_cond_in_trace = 0;
#ifndef VEXMULTIARCH
/* yet more sanity checks ... */
irsb = bb_to_IR ( vta->guest_extents,
&res->n_sc_extents,
&res->n_guest_instrs,
+ &res->n_uncond_in_trace,
+ &res->n_cond_in_trace,
pxControl,
vta->callback_opaque,
disInstrFn,
/* Stats only: the number of guest insns included in the
translation. It may be zero (!). */
UInt n_guest_instrs;
+ /* Stats only: the number of unconditional branches incorporated into the
+ trace. */
+ UShort n_uncond_in_trace;
+ /* Stats only: the number of conditional branches incorporated into the
+ trace. */
+ UShort n_cond_in_trace;
}
VexTranslateResult;
/*--- Stats ---*/
/*------------------------------------------------------------*/
+static ULong n_TRACE_total_constructed = 0;
+static ULong n_TRACE_total_guest_insns = 0;
+static ULong n_TRACE_total_uncond_branches_followed = 0;
+static ULong n_TRACE_total_cond_branches_followed = 0;
+
static ULong n_SP_updates_new_fast = 0;
static ULong n_SP_updates_new_generic_known = 0;
static ULong n_SP_updates_die_fast = 0;
void VG_(print_translation_stats) ( void )
{
+ VG_(message)
+ (Vg_DebugMsg,
+ "translate: %'llu guest insns, %'llu traces, "
+ "%'llu uncond chased, %llu cond chased\n",
+ n_TRACE_total_guest_insns, n_TRACE_total_constructed,
+ n_TRACE_total_uncond_branches_followed,
+ n_TRACE_total_cond_branches_followed);
UInt n_SP_updates = n_SP_updates_new_fast + n_SP_updates_new_generic_known
+ n_SP_updates_die_fast + n_SP_updates_die_generic_known
+ n_SP_updates_generic_unknown;
vg_assert(tres.n_sc_extents >= 0 && tres.n_sc_extents <= 3);
vg_assert(tmpbuf_used <= N_TMPBUF);
vg_assert(tmpbuf_used > 0);
+
+ n_TRACE_total_constructed += 1;
+ n_TRACE_total_guest_insns += tres.n_guest_instrs;
+ n_TRACE_total_uncond_branches_followed += tres.n_uncond_in_trace;
+ n_TRACE_total_cond_branches_followed += tres.n_cond_in_trace;
} /* END new scope specially for 'seg' */
/* Tell aspacem of all segments that have had translations taken