2017-11-05 27 views
1

내가 얻을 :스택 및 GHCI를 사용하여 스택 트레이스를 얻는 방법?</p> <pre><code>stack ghci --profile --ghci-options '+RTS -xc -RTS' </code></pre> <p>와

-prof 이유와 내장되지 않은 프로그램
ghc: the flag -xc requires the program to be built with -prof 

?

+1

프로파일 링으로 빌드되지 않은 프로그램은 ghc라고 생각합니다. 프로그램을 프로파일 링하려면 ghci가 아니라 프로그램에'-xc'를 전달해야합니다. –

+0

나는 본다. 해석 된 코드와 그것이 실행되는 라이브러리에 대해'xc' 플래그를 사용할 수 있습니까? – sevo

+0

해석 된 코드를 프로파일 링하는 것이 가능하지 않다고 생각합니다. –

답변

0
stack ghci --profile app --ghci-options "-fexternal-interpreter -prof" 

위의 내용이 저에게 효과적으로 보입니다 (시작하는 데 몇 초 걸림). 나는 내 stack.yaml에 다음을 추가했다 :

build: 
    library-profiling: true 
    executable-profiling: true 

더 informotation : https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#debugging http://simonmar.github.io/posts/2016-02-12-Stack-traces-in-GHCi.html

내가 실제로이 가능 stack build --enable-library-profiling, 일부 추가 명령을 실행할 수 있습니다.