|
From: <sv...@va...> - 2012-04-24 11:50:56
|
sewardj 2012-04-24 12:50:49 +0100 (Tue, 24 Apr 2012)
New Revision: 12542
Log:
For --profile-flags=, weight the counts by the number of guest insns
in each IRSB, rather than considering each IRSB to have a weight of 1.
This probably gives more representative profiles, especially post
t-chain merge, which made inter-SB transitions more or less free
compared to what they were before.
Modified files:
trunk/coregrind/m_translate.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_transtab.h
Modified: trunk/coregrind/m_transtab.c (+5 -1)
===================================================================
--- trunk/coregrind/m_transtab.c 2012-04-23 12:22:05 +01:00 (rev 12541)
+++ trunk/coregrind/m_transtab.c 2012-04-24 12:50:49 +01:00 (rev 12542)
@@ -1446,6 +1446,7 @@
UInt code_len,
Bool is_self_checking,
Int offs_profInc,
+ UInt n_guest_instrs,
VexArch arch_host )
{
Int tcAvailQ, reqdQ, y, i;
@@ -1459,6 +1460,9 @@
/* 60000: should agree with N_TMPBUF in m_translate.c. */
vg_assert(code_len > 0 && code_len < 60000);
+ /* Generally stay sane */
+ vg_assert(n_guest_instrs < 200); /* it can be zero, tho */
+
if (0)
VG_(printf)("add_to_transtab(entry = 0x%llx, len = %d)\n",
entry, code_len);
@@ -1548,7 +1552,7 @@
sectors[y].tt[i].status = InUse;
sectors[y].tt[i].tcptr = tcptr;
sectors[y].tt[i].count = 0;
- sectors[y].tt[i].weight = 1;
+ sectors[y].tt[i].weight = n_guest_instrs == 0 ? 1 : n_guest_instrs;
sectors[y].tt[i].vge = *vge;
sectors[y].tt[i].entry = entry;
Modified: trunk/coregrind/m_translate.c (+1 -0)
===================================================================
--- trunk/coregrind/m_translate.c 2012-04-23 12:22:05 +01:00 (rev 12541)
+++ trunk/coregrind/m_translate.c 2012-04-24 12:50:49 +01:00 (rev 12542)
@@ -1579,6 +1579,7 @@
tmpbuf_used,
tres.n_sc_extents > 0,
tres.offs_profInc,
+ tres.n_guest_instrs,
vex_arch );
} else {
vg_assert(tres.offs_profInc == -1); /* -1 == unset */
Modified: trunk/coregrind/pub_core_transtab.h (+1 -0)
===================================================================
--- trunk/coregrind/pub_core_transtab.h 2012-04-23 12:22:05 +01:00 (rev 12541)
+++ trunk/coregrind/pub_core_transtab.h 2012-04-24 12:50:49 +01:00 (rev 12542)
@@ -62,6 +62,7 @@
UInt code_len,
Bool is_self_checking,
Int offs_profInc,
+ UInt n_guest_instrs,
VexArch arch_host );
extern
|