Skip to content

Heap profiling on Windows doesn't work

C:\Temp>type Main.hs
main = print "neil"

C:\Temp>ghc --make -prof -auto-all Main.hs
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main.exe ...

C:\Temp>main +RTS -hc
"neil"

C:\Temp>hp2ps main
hp2ps: cannot open main.exe.hp

This can be fixed by either renaming the generated main.hp to main.exe.hp, or running "main.exe +RTS -hc" in the first place. I guess you are using argv [0]as the basis of where to put the heap profiling information, and using the executable name as the basis of where to find it.

My suggestion would be that heap profiling information should always go at basename.hp (so main.hp), ignoring any extension. This would require fixing up both the RTS and the hp2ps utility.

Trac metadata
Trac field Value
Version 6.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information