|
From: <sv...@va...> - 2015-03-24 14:02:52
|
Author: philippe
Date: Tue Mar 24 14:02:44 2015
New Revision: 15037
Log:
* Add in helgrind stats the nr of live/exit/joined/exit and joined threads
* avoid division by 0 in m_transtab.c stats before anything was done
Modified:
trunk/coregrind/m_transtab.c
trunk/helgrind/libhb_core.c
Modified: trunk/coregrind/m_transtab.c
==============================================================================
--- trunk/coregrind/m_transtab.c (original)
+++ trunk/coregrind/m_transtab.c Tue Mar 24 14:02:44 2015
@@ -2410,7 +2410,7 @@
n_in_count, n_in_osize, n_in_tsize,
safe_idiv(10*n_in_tsize, n_in_osize),
n_in_sc_count,
- (int) (n_in_tsize / n_in_count));
+ (int) (n_in_tsize / (n_in_count ? n_in_count : 1)));
VG_(message)(Vg_DebugMsg,
" transtab: dumped %'llu (%'llu -> ?" "?) "
"(sectors recycled %'llu)\n",
Modified: trunk/helgrind/libhb_core.c
==============================================================================
--- trunk/helgrind/libhb_core.c (original)
+++ trunk/helgrind/libhb_core.c Tue Mar 24 14:02:44 2015
@@ -6232,6 +6232,34 @@
VG_(sizeFM)( vts_set ) );
VG_(printf)("%s","\n");
+ {
+ UInt live = 0;
+ UInt llexit_done = 0;
+ UInt joinedwith_done = 0;
+ UInt llexit_and_joinedwith_done = 0;
+
+ Thread* hgthread = get_admin_threads();
+ tl_assert(hgthread);
+ while (hgthread) {
+ Thr* hbthr = hgthread->hbthr;
+ tl_assert(hbthr);
+ if (hbthr->llexit_done && hbthr->joinedwith_done)
+ llexit_and_joinedwith_done++;
+ else if (hbthr->llexit_done)
+ llexit_done++;
+ else if (hbthr->joinedwith_done)
+ joinedwith_done++;
+ else
+ live++;
+ hgthread = hgthread->admin;
+ }
+ VG_(printf)(" libhb: threads live: %d exit_and_joinedwith %d"
+ " exit %d joinedwith %d\n",
+ live, llexit_and_joinedwith_done,
+ llexit_done, joinedwith_done);
+ }
+
+ VG_(printf)("%s","\n");
VG_(printf)( " libhb: ctxt__rcdec: 1=%lu(%lu eq), 2=%lu, 3=%lu\n",
stats__ctxt_rcdec1, stats__ctxt_rcdec1_eq,
stats__ctxt_rcdec2,
|