|
From: <sv...@va...> - 2015-03-26 22:12:47
|
Author: philippe
Date: Thu Mar 26 22:12:40 2015
New Revision: 15041
Log:
Improve --stats=yes:
* give the avg nr of IPs per execontext
* use the newly introduced %f in m_transtab.c ratio
and in the avg nr of execontext per list
Modified:
trunk/coregrind/m_execontext.c
trunk/coregrind/m_transtab.c
Modified: trunk/coregrind/m_execontext.c
==============================================================================
--- trunk/coregrind/m_execontext.c (original)
+++ trunk/coregrind/m_execontext.c Thu Mar 26 22:12:40 2015
@@ -159,11 +159,13 @@
/* Print stats. */
void VG_(print_ExeContext_stats) ( Bool with_stacktraces )
{
+ Int i;
+ ULong total_n_ips;
+ ExeContext* ec;
+
init_ExeContext_storage();
if (with_stacktraces) {
- Int i;
- ExeContext* ec;
VG_(message)(Vg_DebugMsg, " exectx: Printing contexts stacktraces\n");
for (i = 0; i < ec_htab_size; i++) {
for (ec = ec_htab[i]; ec; ec = ec->chain) {
@@ -176,10 +178,17 @@
" exectx: Printed %'llu contexts stacktraces\n",
ec_totstored);
}
-
+
+ total_n_ips = 0;
+ for (i = 0; i < ec_htab_size; i++) {
+ for (ec = ec_htab[i]; ec; ec = ec->chain)
+ total_n_ips += ec->n_ips;
+ }
VG_(message)(Vg_DebugMsg,
- " exectx: %'lu lists, %'llu contexts (avg %'llu per list)\n",
- ec_htab_size, ec_totstored, ec_totstored / (ULong)ec_htab_size
+ " exectx: %'lu lists, %'llu contexts (avg %3.2f per list)"
+ " (avg %3.2f IP per context)\n",
+ ec_htab_size, ec_totstored, (Double)ec_totstored / (Double)ec_htab_size,
+ (Double)total_n_ips / (Double)ec_htab_size
);
VG_(message)(Vg_DebugMsg,
" exectx: %'llu searches, %'llu full compares (%'llu per 1000)\n",
Modified: trunk/coregrind/m_transtab.c
==============================================================================
--- trunk/coregrind/m_transtab.c (original)
+++ trunk/coregrind/m_transtab.c Thu Mar 26 22:12:40 2015
@@ -2384,9 +2384,9 @@
/*--- Printing out statistics. ---*/
/*------------------------------------------------------------*/
-static ULong safe_idiv( ULong a, ULong b )
+static Double safe_idiv( ULong a, ULong b )
{
- return (b == 0 ? 0 : a / b);
+ return (b == 0 ? 0 : (Double)a / (Double)b);
}
UInt VG_(get_bbs_translated) ( void )
@@ -2405,10 +2405,10 @@
VG_(message)(Vg_DebugMsg,
" transtab: new %'lld "
- "(%'llu -> %'llu; ratio %'llu:10) [%'llu scs] "
+ "(%'llu -> %'llu; ratio %3.1f) [%'llu scs] "
"avg tce size %d\n",
n_in_count, n_in_osize, n_in_tsize,
- safe_idiv(10*n_in_tsize, n_in_osize),
+ safe_idiv(n_in_tsize, n_in_osize),
n_in_sc_count,
(int) (n_in_tsize / (n_in_count ? n_in_count : 1)));
VG_(message)(Vg_DebugMsg,
|