[HOpenGL] HOpenGL profiling problem

Sven Panne Sven.Panne@informatik.uni-muenchen.de
Sun, 18 Nov 2001 17:59:24 +0100


Andre W B Furtado wrote:
> When I use profiling with HOpenGL, the <prog.prof> file is empty (0 bytes)
> unless I change "mainLoop" for "return ()" in <prog.hs>. Obviously, this
> program will terminate just after the window is created.

Alas, this is not HOpenGL-specific...

> Does anyone know the reason for this? (I'm using HOpenGL-1.01, GHC-5.02.1
> under Windows98 + cygwin).

The reason is that the only way to exit GLUT programs is via System.exitWith
or System.exitFailure. But GHC's RTS currently doesn't like calls to these
functions in callbacks, so the program terminates abnormally and nothing is
written to <prog.prof>.

SimonM, almighty master of the RTS, hear our plea...:   ;-)

   * Is there an easy way to fix exit{With,Failure} in callbacks?

   * Looking at shutdownHaskell(), it looks like profiling data should be
     written anyway, but it doesn't (at least for Andre and me). Any clues?

Cheers,
   S.