haskell / ghc-events

Library and tool for parsing .eventlog files from GHC
http://www.haskell.org/haskellwiki/ThreadScope
Other
33 stars 33 forks source link

Allow parsing UserBinaryMessage events that have non-utf payloads #91

Closed TeofilC closed 2 years ago

TeofilC commented 2 years ago

This keeps behaviour pretty much in line with what we have currently. Instead of failing on non-utf binary payloads, we just replace non-utf8 text with '.' as we do for non-printable characters.

Fixes #90

Mikolaj commented 2 years ago

This changes a bit more than seems necessary (perhaps for the better). One can hope decodeUtf8With doesn't crash if it encounters "unprintable bytes". Do you think a test (a little eventlog with some unprintable bytes, non-utf payloads and both) would be reasonably easy to add?

maoe commented 2 years ago

LGTM.

One can hope decodeUtf8With doesn't crash if it encounters "unprintable bytes".

As far as I can see, it never crashes unless you pass a function that crashes, which is not the case here.

Do you think a test (a little eventlog with some unprintable bytes, non-utf payloads and both) would be reasonably easy to add?

That would be great.

TeofilC commented 2 years ago

I've added a test that contains an event with some non-utf text

TeofilC commented 2 years ago

Is this ready to merge or would you like anything changed @maoe ?

Mikolaj commented 2 years ago

If @maoe is busy, I can merge once I remember what it's about, but for a release we'd better wait for @maoe.

maoe commented 2 years ago

Sorry for the delay. I'll take a look again tomorrow.

maoe commented 2 years ago

LGTM. Thanks!

TeofilC commented 2 years ago

Thanks both! Literally no worries about the delay

maoe commented 2 years ago

Released https://hackage.haskell.org/package/ghc-events-0.18.0