Profiling a library through an executable in cabal

Stupid question. I have a cab file with libraryand executablethat I would like to use to profile the library, but I can’t see the cost center from my library (although I can see some of the other modules, such as GHC.IO.Encoding).

Here's a simplified version of my cache 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 did i do

$ cabal configure -fdev  -w /usr/local/bin/ghc-7.6.3 --enable-library-profiling --enable-executable-profiling
$ cabal run dev-example -- +RTS -h -p
+3
source share
1 answer

Wow, the problem was that my library code was embedded (or at least marked INLINABLE).

+1
source

All Articles