Skip to content

Commit

Permalink
Add support for the NonmovingPrunedSegments event
Browse files Browse the repository at this point in the history
  • Loading branch information
TeofilC committed Aug 9, 2024
1 parent 2168f61 commit cceb84e
Show file tree
Hide file tree
Showing 7 changed files with 627 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/EventLogFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
#define EVENT_CONC_SWEEP_END 205
#define EVENT_CONC_UPD_REM_SET_FLUSH 206
#define EVENT_NONMOVING_HEAP_CENSUS 207
#define EVENT_NONMOVING_PRUNED_SEGMENTS 208

#define EVENT_TICKY_COUNTER_DEF 210
#define EVENT_TICKY_COUNTER_SAMPLE 211
Expand Down
8 changes: 8 additions & 0 deletions src/GHC/RTS/EventTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,14 @@ data EventInfo
, nonmovingCensusFilledSegs :: !Word32
, nonmovingCensusLiveBlocks :: !Word32
}
| NonmovingPrunedSegments
{ -- | The number of pruned segments.
nonmovingPrunedSegments :: !Word32
-- | The number of leftover free segments.
-- These could not be pruned as they belong to megablocks
-- with at least one non-free segment.
, nonmovingFreeSegments :: !Word32
}
| TickyCounterDef
{ tickyCtrDefId :: !Word64
, tickyCtrDefArity :: !Word16
Expand Down
4 changes: 4 additions & 0 deletions src/GHC/RTS/Events.hs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ buildEventInfo spec' =
<> ": " <> TB.decimal nonmovingCensusActiveSegs <> " active segments"
<> ", " <> TB.decimal nonmovingCensusFilledSegs <> " filled segments"
<> ", " <> TB.decimal nonmovingCensusLiveBlocks <> " live blocks"
NonmovingPrunedSegments {..} ->
"nonmoving segments pruned: "
<> TB.decimal nonmovingPrunedSegments <> " pruned segments, "
<> TB.decimal nonmovingFreeSegments <> " free segments retained"
TickyCounterDef {..} ->
"ticky counter definition " <> TB.decimal tickyCtrDefId
<> ", " <> "arity: " <> TB.decimal tickyCtrDefArity
Expand Down
9 changes: 9 additions & 0 deletions src/GHC/RTS/Events/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ standardParsers = [
nonmovingCensusLiveBlocks <- get :: Get Word32
return NonmovingHeapCensus{..}
)),
(FixedSizeParser EVENT_NONMOVING_PRUNED_SEGMENTS 8 (do -- (pruned_segments, free_segments)
nonmovingPrunedSegments <- get :: Get Word32
nonmovingFreeSegments <- get :: Get Word32
return NonmovingPrunedSegments{..}
)),

(FixedSizeParser EVENT_CREATE_THREAD sz_tid (do -- (thread)
t <- get
Expand Down Expand Up @@ -991,6 +996,7 @@ eventTypeNum e = case e of
ConcSweepEnd {} -> EVENT_CONC_SWEEP_END
ConcUpdRemSetFlush {} -> EVENT_CONC_UPD_REM_SET_FLUSH
NonmovingHeapCensus {} -> EVENT_NONMOVING_HEAP_CENSUS
NonmovingPrunedSegments {} -> EVENT_NONMOVING_PRUNED_SEGMENTS
TickyCounterDef {} -> EVENT_TICKY_COUNTER_DEF
TickyCounterSample {} -> EVENT_TICKY_COUNTER_SAMPLE
InfoTableProv {} -> EVENT_IPE
Expand Down Expand Up @@ -1446,6 +1452,9 @@ putEventSpec NonmovingHeapCensus {..} = do
putE nonmovingCensusActiveSegs
putE nonmovingCensusFilledSegs
putE nonmovingCensusLiveBlocks
putEventSpec NonmovingPrunedSegments {..} = do
putE nonmovingPrunedSegments
putE nonmovingFreeSegments
putEventSpec TickyCounterDef {..} = do
putE tickyCtrDefId
putE tickyCtrDefArity
Expand Down
1 change: 1 addition & 0 deletions test/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ files = map ("test/"++)
[ "nonmoving-gc.eventlog"
, "nonmoving-gc-census.eventlog"
, "nonmoving-gc-census-T23340.eventlog"
, "nonmoving-gc-pruned-segments.eventlog"
, "parallelTest.eventlog"
, "sleep.h.eventlog"
, "sleep.hC.eventlog"
Expand Down
Binary file added test/nonmoving-gc-pruned-segments.eventlog
Binary file not shown.
604 changes: 604 additions & 0 deletions test/nonmoving-gc-pruned-segments.eventlog.reference

Large diffs are not rendered by default.

0 comments on commit cceb84e

Please sign in to comment.