[GHC] #11645: Heap profiling - hp2ps: samples out of sequence

GHC ghc-devs at haskell.org
Tue Mar 8 14:41:15 UTC 2016


#11645: Heap profiling - hp2ps: samples out of sequence
-------------------------------------+-------------------------------------
        Reporter:  thomie            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Profiling         |              Version:  8.0.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  libraries/hpc/tests/fork/hpc_fork
      Blocked By:                    |             Blocking:
 Related Tickets:  #664              |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by jme):

 The problem is that the profiler doesn't work with `forkProcess`
 (''e.g.'', see #8862).  In this
 particular case, the issue is that the elapsed ''per-process'' time is
 being
 reported for each sample.  Since the parent
 spends more time performing the forks than each child does executing
 `threadDelay`, its elapsed time is the largest.  But the parent outputs
 its
 sample before either child, and so the samples appear out of order.

 The reason this behavior does not cause a problem when using 7.10.3 is
 that the sample times used to only be reported in hundredths of a second
 (and so were all 0.00).
 As of 1da3bbd2bd82ea11f8a1d760385df84708bbea63, they are being reported
 with
 full precision.

 One possible way to work around this
 is to simply increase the `threadDelay` intervals for each child (400000
 for the
 first and 800000 for the second worked for me).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11645#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list