Question

Silly question. I have a cabal file with a library and an executable that I would like to use to profile the library, but I can't manage to see cost centers from my library (although I see some from other modules like GHC.IO.Encoding).

Here's a simplified version of my cabal file

flag dev
  default: False
  manual: True

library
  exposed-modules:     Foo

  ghc-options:        -Wall
  ghc-prof-options:   -fprof-auto
  build-depends:       base

executable dev-example
  if !flag(dev)
    buildable: False

  ghc-options: -ddump-to-file -ddump-simpl -dsuppress-module-prefixes -dsuppress-uniques -ddump-core-stats -ddump-inlinings
  ghc-options: -O2  -rtsopts  
  ghc-prof-options: -fprof-auto


  hs-source-dirs: dev-example, ./
  main-is: Main.hs
  build-depends:       base

Where I've been doing

$ cabal configure -fdev  -w /usr/local/bin/ghc-7.6.3 --enable-library-profiling --enable-executable-profiling
$ cabal run dev-example -- +RTS -h -p
Was it helpful?

Solution

Ugh, the issue was simply that my library code was being inlined (or at least marked INLINABLE).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top