6

我正在尝试使用进行一些分析stack --enable-profiling,但我对到底发生了什么感到有点困惑。

我还需要使用--enable-library吗?另外,它是在一个单独的目录中构建的吗?接下来我构建它会发生什么,我会记住我是处于分析模式还是我必须一直使用它--enable-profiling

通常建议与-O2选项结合使用配置文件。--enable-profiling会自动设置吗?

4

1 回答 1

5

Stack support for enabling profiling works great, example:

stack build --profile --executable-profiling --library-profiling
stack exec -- example <your prog args> +RTS -p

Then see example.prof for the default output.

Update: the stack support pointed me to the right correct for exec, see https://github.com/commercialhaskell/stack/issues/1655

于 2016-01-14T17:40:22.627 回答