ghc-heap-view icon indicating copy to clipboard operation
ghc-heap-view copied to clipboard

Add support for profiled builds

Open facundominguez opened this issue 8 years ago • 6 comments

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?

facundominguez avatar Feb 21 '17 11:02 facundominguez

cc @mboes

facundominguez avatar Feb 21 '17 11:02 facundominguez

@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.

nomeata avatar Feb 21 '17 14:02 nomeata

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.

erikd avatar Feb 22 '17 23:02 erikd

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.

jberryman avatar Apr 20 '20 21:04 jberryman

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?

anka-213 avatar May 14 '22 10:05 anka-213

I actually don't know. You could try :-)

nomeata avatar May 14 '22 11:05 nomeata