ghc-heap-view
ghc-heap-view copied to clipboard
Add support for profiled builds
The package inline-java
is using ghc-heap-view
to discern the types of some ConsClosure
values which types are otherwise ignored at runtime.
This is likely to change soon, but in the meantime, the dependency on ghc-heap-view
prevents any user of inline-java
to make profiled builds.
What's involved in making ghc-heap-view
work with the profiling RTS?
cc @mboes
@erikd is trying to get this code into GHC proper. This is being discussed at https://phabricator.haskell.org/D3055, so maybe raise your point there too.
What's involved in making ghc-heap-view work with the profiling RTS?
I’m not completely certain on all the details. Probably just a way of detecting that we are using profiling, and adjusting to the different closure layout.
The idea of adding ghc-heap-view
to GHC has turned into a bit of a rabbit hole.
Currently, ghc-heap-view
doesn't support unlifted types and it looks like closure types like MUT_ARR_*
contain Array# a
where the Array#
is unlifted, but the a
may be lifted. I think its possible to support this, but it doesn't seem trivial.
I'm only using the assertNF
family of functions. It seems as though that could be moved into its own library and simply disabled with a warning when there is a profile build, somehow.
Since the code has now been merged into GHC and this package now depends on it, can the check be removed now or is there any other problems for profiled builds?
I actually don't know. You could try :-)