愚蠢的问题。我有一个带有 library
和 executable
的 cabal 文件,我想用它来分析库,但我无法从我的库中看到成本中心(尽管我从其他模块中看到了一些,例如 GHC.IO.Encoding
)。
这是我的 cabal 文件的简化版本
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
我一直在做什么
$ cabal configure -fdev -w /usr/local/bin/ghc-7.6.3 --enable-library-profiling --enable-executable-profiling
$ cabal run dev-example -- +RTS -h -p
最佳答案
呃,问题只是我的库代码被内联(或至少标记为 INLINABLE
)。
关于haskell - 通过 cabal 中的可执行文件分析库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21844243/