Skip to content

Commit 927c479

Browse files
author
philippe
committed
* 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 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15037 a5019735-40e9-0310-863c-91ae7b9d1cf9
1 parent 58d43db commit 927c479

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

coregrind/m_transtab.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,7 @@ void VG_(print_tt_tc_stats) ( void )
24102410
n_in_count, n_in_osize, n_in_tsize,
24112411
safe_idiv(10*n_in_tsize, n_in_osize),
24122412
n_in_sc_count,
2413-
(int) (n_in_tsize / n_in_count));
2413+
(int) (n_in_tsize / (n_in_count ? n_in_count : 1)));
24142414
VG_(message)(Vg_DebugMsg,
24152415
" transtab: dumped %'llu (%'llu -> ?" "?) "
24162416
"(sectors recycled %'llu)\n",

helgrind/libhb_core.c

+28
Original file line numberDiff line numberDiff line change
@@ -6231,6 +6231,34 @@ void libhb_shutdown ( Bool show_stats )
62316231
VG_(printf)( " libhb: %lu entries in vts_set\n",
62326232
VG_(sizeFM)( vts_set ) );
62336233

6234+
VG_(printf)("%s","\n");
6235+
{
6236+
UInt live = 0;
6237+
UInt llexit_done = 0;
6238+
UInt joinedwith_done = 0;
6239+
UInt llexit_and_joinedwith_done = 0;
6240+
6241+
Thread* hgthread = get_admin_threads();
6242+
tl_assert(hgthread);
6243+
while (hgthread) {
6244+
Thr* hbthr = hgthread->hbthr;
6245+
tl_assert(hbthr);
6246+
if (hbthr->llexit_done && hbthr->joinedwith_done)
6247+
llexit_and_joinedwith_done++;
6248+
else if (hbthr->llexit_done)
6249+
llexit_done++;
6250+
else if (hbthr->joinedwith_done)
6251+
joinedwith_done++;
6252+
else
6253+
live++;
6254+
hgthread = hgthread->admin;
6255+
}
6256+
VG_(printf)(" libhb: threads live: %d exit_and_joinedwith %d"
6257+
" exit %d joinedwith %d\n",
6258+
live, llexit_and_joinedwith_done,
6259+
llexit_done, joinedwith_done);
6260+
}
6261+
62346262
VG_(printf)("%s","\n");
62356263
VG_(printf)( " libhb: ctxt__rcdec: 1=%lu(%lu eq), 2=%lu, 3=%lu\n",
62366264
stats__ctxt_rcdec1, stats__ctxt_rcdec1_eq,

0 commit comments

Comments
 (0)