summaryrefslogtreecommitdiff
path: root/rts/eventlog
diff options
context:
space:
mode:
authorDouglas Wilson <douglas.wilson@gmail.com>2017-07-11 11:54:09 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-11 13:41:54 -0400
commit7c9e356de1114ab3e31f2d6d03e83672076dd533 (patch)
tree5a89a142a31a53486e41c75673024548ce4c39ce /rts/eventlog
parent905dc8bc74bebf5370eb9237cc8756cd9fe871ae (diff)
downloadhaskell-7c9e356de1114ab3e31f2d6d03e83672076dd533.tar.gz
Fix Work Balance computation in RTS stats
An additional stat is tracked per gc: par_balanced_copied This is the the number of bytes copied by each gc thread under the balanced lmit, which is simply (copied_bytes / num_gc_threads). The stat is added to all the appropriate GC structures, so is visible in the eventlog and in GHC.Stats. A note is added explaining how work balance is computed. Remove some end of line whitespace Test Plan: ./validate experiment with the program attached to the ticket examine code changes carefully Reviewers: simonmar, austin, hvr, bgamari, erikd Reviewed By: simonmar Subscribers: Phyx, rwbarton, thomie GHC Trac Issues: #13830 Differential Revision: https://phabricator.haskell.org/D3658
Diffstat (limited to 'rts/eventlog')
-rw-r--r--rts/eventlog/EventLog.c13
-rw-r--r--rts/eventlog/EventLog.h3
2 files changed, 11 insertions, 5 deletions
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index c175aecd3e..ed297b879e 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -412,12 +412,14 @@ initEventLogging(const EventLogWriter *ev_writer)
case EVENT_GC_STATS_GHC: // (heap_capset, generation,
// copied_bytes, slop_bytes, frag_bytes,
// par_n_threads,
- // par_max_copied, par_tot_copied)
+ // par_max_copied, par_tot_copied,
+ // par_balanced_copied
+ // )
eventTypes[t].size = sizeof(EventCapsetID)
+ sizeof(StgWord16)
+ sizeof(StgWord64) * 3
+ sizeof(StgWord32)
- + sizeof(StgWord64) * 2;
+ + sizeof(StgWord64) * 3;
break;
case EVENT_TASK_CREATE: // (taskId, cap, tid)
@@ -903,7 +905,8 @@ void postEventGcStats (Capability *cap,
W_ fragmentation,
uint32_t par_n_threads,
W_ par_max_copied,
- W_ par_tot_copied)
+ W_ par_tot_copied,
+ W_ par_balanced_copied)
{
EventsBuf *eb = &capEventBuf[cap->no];
ensureRoomForEvent(eb, EVENT_GC_STATS_GHC);
@@ -911,7 +914,8 @@ void postEventGcStats (Capability *cap,
postEventHeader(eb, EVENT_GC_STATS_GHC);
/* EVENT_GC_STATS_GHC (heap_capset, generation,
copied_bytes, slop_bytes, frag_bytes,
- par_n_threads, par_max_copied, par_tot_copied) */
+ par_n_threads, par_max_copied,
+ par_tot_copied, par_balanced_copied) */
postCapsetID(eb, heap_capset);
postWord16(eb, gen);
postWord64(eb, copied);
@@ -920,6 +924,7 @@ void postEventGcStats (Capability *cap,
postWord32(eb, par_n_threads);
postWord64(eb, par_max_copied);
postWord64(eb, par_tot_copied);
+ postWord64(eb, par_balanced_copied);
}
void postTaskCreateEvent (EventTaskId taskId,
diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h
index 11c2577745..eae11ede45 100644
--- a/rts/eventlog/EventLog.h
+++ b/rts/eventlog/EventLog.h
@@ -121,7 +121,8 @@ void postEventGcStats (Capability *cap,
W_ fragmentation,
uint32_t par_n_threads,
W_ par_max_copied,
- W_ par_tot_copied);
+ W_ par_tot_copied,
+ W_ par_balanced_copied);
void postTaskCreateEvent (EventTaskId taskId,
EventCapNo cap,