Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for era event types #103

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/GHC/RTS/EventTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ data HeapProfBreakdown
| HeapProfBreakdownBiography
| HeapProfBreakdownClosureType
| HeapProfBreakdownInfoTable
| HeapProfBreakdownEra
deriving Show

instance Binary HeapProfBreakdown where
Expand All @@ -647,6 +648,7 @@ instance Binary HeapProfBreakdown where
6 -> return HeapProfBreakdownBiography
7 -> return HeapProfBreakdownClosureType
8 -> return HeapProfBreakdownInfoTable
9 -> return HeapProfBreakdownEra
_ -> fail $ "Unknown HeapProfBreakdown: " ++ show n
put breakdown = put $ case breakdown of
HeapProfBreakdownCostCentre -> (1 :: Word32)
Expand All @@ -657,6 +659,9 @@ instance Binary HeapProfBreakdown where
HeapProfBreakdownBiography -> 6
HeapProfBreakdownClosureType -> 7
HeapProfBreakdownInfoTable -> 8
HeapProfBreakdownEra -> 9



newtype HeapProfFlags = HeapProfFlags Word8
deriving (Show, Binary)
Expand Down
3 changes: 2 additions & 1 deletion src/GHC/RTS/Events.hs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ replaceUnprintableWith
:: Char -- ^ Replacement character
-> B.ByteString -- ^ Binary message which may contain unprintable bytes
-> T.Text
replaceUnprintableWith replacement = T.map replace . TE.decodeUtf8With (\_ _ -> Just replacement)
replaceUnprintableWith replacement = T.map replace . TE.decodeUtf8With (\_ _ -> Just replacement)
where
replace c
| isPrint c = c
Expand Down Expand Up @@ -592,6 +592,7 @@ showHeapProfBreakdown breakdown = case breakdown of
HeapProfBreakdownBiography -> "biography"
HeapProfBreakdownClosureType -> "closure type"
HeapProfBreakdownInfoTable -> "info table"
HeapProfBreakdownEra -> "era"

-- | How to format event timestamps
data TimeFormat = RawTime | PrettyTime
Expand Down
Loading