8

Is it possible to time profile a Haskell program without installing the profiling libraries?

When I pass the -prof option to ghc, I always get errors like this one:

src/MyPKG/FooBlah.lhs:7:7:
    Could not find module `Data.Time.Calendar':
      Perhaps you haven't installed the profiling libraries for package `time-1.1.4'?
      Use -v to see a list of the files searched for.

I know that the solution is to install with cabal profile versions of the libraries, but sometimes this is a pain in the ass (sorry for the bad language).

I think it should be possible to profile my program and the calls that have no symbols should appear as ???? or something like that in the output.

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431
Zhen
  • 4,171
  • 5
  • 38
  • 57
  • 5
    Relevant [question](http://stackoverflow.com/questions/1704421/cabal-not-installing-dependencies-when-needing-profiling-libraries). – danr Jan 31 '12 at 18:36
  • 2
    relevant *[answer.](http://stackoverflow.com/questions/9077799/a-change-in-my-library-made-it-much-slower-profiling-isnt-helping-me-what-mig/9084537#9084537)* – Mike Dunlavey Jan 31 '12 at 20:46
  • 1
    "I think it should be possible" - it is possible...GHC is open source after all. :) – Dan Burton Jan 31 '12 at 21:07

1 Answers1

9

No, it's not possible. Building for profiling changes the representation and function calls have extra parameters to keep track of the profiling data.

You have to install the profiling libraries to use GHC's profiler, even if it's a pain in the rear.

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431