[GHC] #11094: Cost-center heap profiler should be able to emit samples to eventlog

GHC ghc-devs at haskell.org
Wed Dec 30 13:48:33 UTC 2015


#11094: Cost-center heap profiler should be able to emit samples to eventlog
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 Here is a proposed eventlog sample format.

 = Event types =
 == Beginning of sample stream ==

 A single fixed-width event emitted during program start-up describing the
 samples that follow.

  * `Word64`: Sampling period in nanoseconds
  * `Word64`: Sample break-down type. One of,
      * `SAMPLE_TYPE_COST_CENTER` (output from `-hc`)
      * `SAMPLE_TYPE_CLOSURE_TYPE` (output from `-hC`)
      * `SAMPLE_TYPE_RETAINER` (output from `-hr`)
      * `SAMPLE_TYPE_BIOGRAPHY` (output from `-hb`)
      * `SAMPLE_TYPE_MODULE` (output from `-hm`)
      * `SAMPLE_TYPE_TYPE_DESCR` (output from `-hy`)

 == Cost center ==

 A variable-length packet produced once for each cost center,

   * `Word32`: cost center number
   * `Word16`: name length in bytes
   * UTF-8 string: name

 == Cost-center sample ==

 A variable-length packet encoding a heap profile sample broken down by
 cost-center. Since events may only be up to 2^16^ bytes in length a single
 sample may need to be split among multiple events.

 The event shall contain packed pairs of,
   * `Word32`: cost center number
   * `Word32`: heap residency in bytes


 == Type description sample ==

 A variable-length event encoding a heap sample broken down by type
 description.

 The event shall contain packed triplets of,
   * `Word8`; type description length in bytes
   * UTF-8 string: type description
   * `Word32`: heap residency in bytes


 == Closure type sample ==

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


More information about the ghc-tickets mailing list