Skip to content

Commit 984fadb

Browse files
mpickeringMikolaj
authored andcommitted
Add support for era event types
1 parent 16ad227 commit 984fadb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/GHC/RTS/EventTypes.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ data HeapProfBreakdown
633633
| HeapProfBreakdownBiography
634634
| HeapProfBreakdownClosureType
635635
| HeapProfBreakdownInfoTable
636+
| HeapProfBreakdownEra
636637
deriving Show
637638

638639
instance Binary HeapProfBreakdown where
@@ -647,6 +648,7 @@ instance Binary HeapProfBreakdown where
647648
6 -> return HeapProfBreakdownBiography
648649
7 -> return HeapProfBreakdownClosureType
649650
8 -> return HeapProfBreakdownInfoTable
651+
9 -> return HeapProfBreakdownEra
650652
_ -> fail $ "Unknown HeapProfBreakdown: " ++ show n
651653
put breakdown = put $ case breakdown of
652654
HeapProfBreakdownCostCentre -> (1 :: Word32)
@@ -657,6 +659,9 @@ instance Binary HeapProfBreakdown where
657659
HeapProfBreakdownBiography -> 6
658660
HeapProfBreakdownClosureType -> 7
659661
HeapProfBreakdownInfoTable -> 8
662+
HeapProfBreakdownEra -> 9
663+
664+
660665

661666
newtype HeapProfFlags = HeapProfFlags Word8
662667
deriving (Show, Binary)

src/GHC/RTS/Events.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ replaceUnprintableWith
538538
:: Char -- ^ Replacement character
539539
-> B.ByteString -- ^ Binary message which may contain unprintable bytes
540540
-> T.Text
541-
replaceUnprintableWith replacement = T.map replace . TE.decodeUtf8With (\_ _ -> Just replacement)
541+
replaceUnprintableWith replacement = T.map replace . TE.decodeUtf8With (\_ _ -> Just replacement)
542542
where
543543
replace c
544544
| isPrint c = c
@@ -592,6 +592,7 @@ showHeapProfBreakdown breakdown = case breakdown of
592592
HeapProfBreakdownBiography -> "biography"
593593
HeapProfBreakdownClosureType -> "closure type"
594594
HeapProfBreakdownInfoTable -> "info table"
595+
HeapProfBreakdownEra -> "era"
595596

596597
-- | How to format event timestamps
597598
data TimeFormat = RawTime | PrettyTime

0 commit comments

Comments
 (0)