How to build yi for profiling?

Showing 1-3 of 3 messages
How to build yi for profiling? Dmitry Ivanov 7/14/12 5:17 AM
I can't figure out a way to build yi so that time or heap profiling
reports anything. Is it even possible in dynamic binary? If not, how
to build static one?

I can't get -fhacking to work, and according to
, it is sort of deprecated anyway.
Re: How to build yi for profiling? Michał J Gajda 7/14/12 2:16 PM
I had similar problems.
As far as I understand it, one would have to first add a config option for passing GHC RTS arguments to Dyre library that Yi uses for configuration management.
Then one can add all ghc compilation options to ghcOptions in src/library/Yi/Main.hs, and RTS options to Dyre launch parameters.

--- a/yi/src/library/Yi/Main.hs
+++ b/yi/src/library/Yi/Main.hs
@@ -60,7 +60,7 @@ data ConsoleConfig =
 defaultConsoleConfig :: ConsoleConfig
 defaultConsoleConfig = 
   ConsoleConfig { 
-                  ghcOptions = [],
+                  ghcOptions = ["-auto-all", "-prof", "-osuf=p_o", "-hisuf=p_hi", "-rtsopts"],
                   selfCheck = False
The issue is that runtime system parameters are normally invisible to Haskell programs, and thus they do not get forwarded by Dyre when Yi real "main" is relaunched.
So probably one can have two issues to open:
1. Against GHC: access runtime system parameters or command line arguments before RTS processing.
2. Against Dyre: add runtime parameters, or just arbitrary parameters to be forwarded during program relaunch.
  Best regards
Re: How to build yi for profiling? Michał J Gajda 7/14/12 3:27 PM
Ok, I have got an ugly hack for you :-):

1. Change ghcOptions in yi/src/library/Yi/Main.hs:
-                  ghcOptions = [],
+                  ghcOptions = ["-auto-all", "-prof", "-osuf=p_o", "-hisuf=p_hi", "-rtsopts"],
2. Recompile yi with --enable-library-profiling:
cabal configure --enable-library-profiling && cabal install --reinstall
3. Run yi first to get a compiled "real" executable.
4. Then call "real" executable from cache with profiling options. On any XDG-compatible (Unix-like) system cached binary should be like:
~/.cache/yi/yi-linux-x86_64 +RTS -Pa