ghc-time-alloc-prof-0.0.0: Library for parsing GHC time and allocation profiling reports

Safe HaskellNone

GHC.RTS.TimeAllocProfile

Contents

Synopsis

Documentation

data TotalTime Source

total time in the profiling reports

Constructors

TotalTime 

Fields

totalTimeElapsed :: DiffTime

Total elapsed time in seconds

totalTimeTicks :: Integer

Total number of ticks

totalTimeResolution :: DiffTime

Duration of a tick

totalTimeProcessors :: Int

Number of processors

Instances

newtype TotalAlloc Source

total alloc in the profiling reports

Constructors

TotalAlloc 

Fields

totalAllocBytes :: Integer

Total memory allocation in bytes

Instances

data BriefCostCentre Source

Constructors

BriefCostCentre 

Fields

briefCostCentreName :: Text

Name of the cost-centre

briefCostCentreModule :: Text

Module name of the cost-centre

briefCostCentreTime :: Double

Total time spent in the cost-centre

briefCostCentreAlloc :: Double

Total allocation in the cost-centre

briefCostCentreTicks :: Maybe Integer

Total ticks in the cost-centre. This number exists only if -P or -Pa option is given at run-time.

briefCostCentreBytes :: Maybe Integer

Total memory allocation in the cost-centre. This number exists only if -P or -Pa option is given at run-time.

data CostCentre Source

Cost-centre node

Constructors

CostCentre 

Fields

costCentreName :: Text

Name of the cost-centre

costCentreModule :: Text

Module name of the cost-centre

costCentreNo :: CostCentreNo

Identifier of the cost-centre

costCentreEntries :: Integer

Number of entries to the cost-centre

costCentreIndTime :: Double

Time spent in the cost-centre itself

costCentreIndAlloc :: Double

Allocation incurred by the cost-centre itself

costCentreInhTime :: Double

Time spent in the cost-centre's children

costCentreInhAlloc :: Double

Allocation incurred by the cost-centre's children

costCentreTicks :: Maybe Integer

Number of ticks in the cost-centre.

costCentreBytes :: Maybe Integer

Number of allocated bytes in the cost-centre.

Instances

data Callee Source

Constructors

Callee 

Fields

calleeName :: Text

Name of the callee function

calleeModule :: Text

Module name of the calle function

calleeEntries :: !Integer

Number of entries to the callee function

calleeTime :: !Double

Time spent in the callee function

calleeAlloc :: !Double

Allocation incurred by the callee function

calleeTicks :: !(Maybe Integer)

Number of ticks in the callee function

calleeBytes :: !(Maybe Integer)

Number of allocated bytes in the callee function

Instances

data CallSite Source

Constructors

CallSite 

Fields

callSiteCostCentre :: CostCentre

Metrics for the caller function

callSiteContribEntries :: !Integer

Number of entries contriubted by the caller function

callSiteContribTime :: !Double

Time contributed by the caller function

callSiteContribAlloc :: !Double

Allocation contributed by the caller function

callSiteContribTicks :: !(Maybe Integer)

Number of tikcs contributed by the caller function

callSiteContribBytes :: !(Maybe Integer)

Number of allocated bytes contributed byt hte caller function

Instances

Parser

Cost-centre tree

profileCostCentres :: TimeAllocProfile -> Maybe (Tree CostCentre)Source

Build a tree of cost-centres from a profiling report.

profileCostCentresOrderBySource

Arguments

:: Ord a 
=> (CostCentre -> a)

Sorting key function

-> TimeAllocProfile 
-> Maybe (Tree CostCentre) 

Build a tree of cost-centres from a profiling report. Nodes are sorted by the given key function for each level of the tree.

profileCallSitesSource

Arguments

:: Text

Cost-centre name

-> Text

Module name

-> TimeAllocProfile 
-> Maybe (Callee, Seq CallSite) 

Build a list of call-sites (caller functions) for a specified cost-centre name and module name.

profileCallSitesOrderBySource

Arguments

:: Ord a 
=> (CostCentre -> a)

Sorting key function

-> Text

Cost-centre name

-> Text

Module name

-> TimeAllocProfile 
-> Maybe (Callee, Seq CallSite) 

Build a list of call-sites (caller function) for a specified cost-centre name and module name. Nodes are sorted by the given key function.