[GHC] #12111: prof build flavour doesn't work

#12111: prof build flavour doesn't work -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Building with `prof` flavour on a fresh build doesn't work. I'm currently getting {{{ compiler/utils/Outputable.hs-boot:1:8: error: Failed to load interface for ‘Prelude’ Perhaps you haven't installed the "p_dyn" libraries for package ‘base-4.9.0.0’? Use -v to see a list of the files searched for. }}} In addition, I don't see any profiling flags passes to GHC in `prof.mk` (like `-fprof-auto`), so I'm not sure how effective default profiling build is. Am I missing something or do users need to add those manually to `GhcStage2HcOpts`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12111 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12111: prof build flavour doesn't work -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Build System | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => infoneeded Comment: I can not reproduce this problem, starting from commit ac38c025b99868d348e3797e85a4af9c6d6377ac. Here is what I tried: {{{ * git clone --recursive <the repo> * cp mk/build.mk.sample mk/build.mk * uncomment `BuildFlavour = prof` in mk/build.mk * ./boot && ./configure && make }}} Test that it works: {{{ $ ./inplace/bin/ghc-stage2 -fforce-recomp Test.hs +RTS -p $ ls ghc-stage2.prof ghc-stage2.prof }}} Some things to check: * do you have other settings in `mk/build.mk` that might interfer? * make sure there isn't a leftover `mk/are-validating.mk` file * run `make show VALUE=ghc_stage2_PROGRAM_WAY`. It should show `ghc_stage2_PROGRAM_WAY="p"`. * look at the build command that failed. It probably contains `-dynamic`. Figure out why. `-fprof-auto` gets added in `compiler/ghc.mk`. You shouldn't have to manually fiddle with `GhcStage2HcOpts`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12111#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12111: prof build flavour doesn't work
-------------------------------------+-------------------------------------
Reporter: osa1 | Owner:
Type: bug | Status: infoneeded
Priority: normal | Milestone:
Component: Build System | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by thomie):
This commit message is informative
(ce1f1607ed7f8fedd2f63c8610cafefd59baaf32):
{{{
Author: Simon Marlow

#12111: prof build flavour doesn't work -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: infoneeded => closed * resolution: => invalid Comment: OK; here what I think is happening: I can't pass `-fprof-auto` anything like that to `GhcStage2Opts` because I think it's also used when compiling some files that are supposed to be compiled in normal mode (as opposed to profiling mode). I'm still not sure if there's a way to do what I want, but at least profiling build works and I can add cost centers manually. Closing this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12111#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12111: prof build flavour doesn't work -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): Actually, you do need to fiddle with `-fprof-auto` a little. See this comment in `compiler/ghc.mk`: {{{ # If we're profiling GHC then we want SCCs. However, adding -auto-all # everywhere tends to give a hard-to-read profile, and adds lots of # overhead. A better approach is to proceed top-down; identify the # parts of the compiler of interest, and then add further cost centres # as necessary. Turn on -fprof-auto for individual modules like this: # compiler/main/DriverPipeline_HC_OPTS += -fprof-auto compiler/main/GhcMake_HC_OPTS += -fprof-auto compiler/main/GHC_HC_OPTS += -fprof-auto # or alternatively add {-# OPTIONS_GHC -fprof-auto #-} to the top of # modules you're interested in. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12111#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC