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

Safe HaskellNone
LanguageHaskell2010

GHC.Prof

Contents

Synopsis

Documentation

decode :: Text -> Either String Profile Source #

Decode a GHC time allocation profiling report from a lazy Text

Parser

profile :: Parser Profile Source #

Parse a GHC time-allocation profiling report

Cost-centre tree

aggregatedCostCentres :: Profile -> [AggregatedCostCentre] Source #

Build a list of cost-centres from a profiling report ordered by the time spent and the amount of allocation.

aggregatedCostCentresOrderBy Source #

Arguments

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

Sorting key function

-> Profile 
-> [AggregatedCostCentre] 

Build a list of cost-centres from a profling report ordered by the given key.

costCentres :: Profile -> Maybe (Tree CostCentre) Source #

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

costCentresOrderBy Source #

Arguments

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

Sorting key function

-> Profile 
-> 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.

aggregateCallSites Source #

Arguments

:: Text

Cost centre name

-> Text

Module name

-> Profile 
-> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre]) 

Build a list of call sites (caller functions of a cost centre) aggregated by their cost centre names and module names.

aggregateCallSitesOrderBy Source #

Arguments

:: Ord a 
=> (CallSite AggregatedCostCentre -> a)

Sorting key function

-> Text

Cost centre name

-> Text

Module name

-> Profile 
-> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre]) 

Build a list of call sites (caller functions of a cost centre) aggregated by their cost centre names and module names. Call sites are sorted by the given key function.

callSites Source #

Arguments

:: Text

Cost-centre name

-> Text

Module name

-> Profile 
-> Maybe (AggregatedCostCentre, [CallSite CostCentre]) 

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

callSitesOrderBy Source #

Arguments

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

Sorting key function

-> Text

Cost-centre name

-> Text

Module name

-> Profile 
-> Maybe (AggregatedCostCentre, [CallSite CostCentre]) 

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.

aggregateModules :: Profile -> [AggregateModule] Source #

Break down aggregate cost centres by module sorted by total time and allocation.

aggregateModulesOrderBy Source #

Arguments

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

Sorting key function

-> Profile 
-> [AggregateModule] 

Break odwn aggregate cost centres by module.

Types

data TotalTime Source #

total time in the profiling reports

Constructors

TotalTime 

Fields

newtype TotalAlloc Source #

total alloc in the profiling reports

Constructors

TotalAlloc 

Fields

data AggregatedCostCentre Source #

Constructors

AggregatedCostCentre 

Fields

data CostCentre Source #

Cost-centre node

Constructors

CostCentre 

Fields

data CallSite cc Source #

Constructors

CallSite 

Fields

Instances

Show cc => Show (CallSite cc) Source # 

Methods

showsPrec :: Int -> CallSite cc -> ShowS #

show :: CallSite cc -> String #

showList :: [CallSite cc] -> ShowS #

data AggregateModule Source #

Constructors

AggregateModule 

Fields