|Copyright||(c) The University of Glasgow 2011|
|Portability||non-portable (GHC Extensions)|
Access to GHC's call-stack simulation
currentCallStack :: IO [String] Source
[String] representing the current call stack. This can be useful for debugging.
The implementation uses the call-stack simulation maintained by the profiler, so it only works if the program was compiled with
-prof and contains suitable SCC annotations (e.g. by using
-fprof-auto). Otherwise, the list returned is likely to be empty or uninformative.
whoCreated :: a -> IO [String] Source
Get the stack trace attached to an object.
data CostCentreStack Source
A cost-centre stack from GHC's cost-center profiler.
data CostCentre Source
A cost-centre from GHC's cost-center profiler.
getCurrentCCS :: dummy -> IO (Ptr CostCentreStack) Source
Returns the current
CostCentreStack (value is
nullPtr if the current program was not compiled with profiling support). Takes a dummy argument which can be used to avoid the call to
getCurrentCCS being floated out by the simplifier, which would result in an uninformative stack (CAF).
getCCSOf :: a -> IO (Ptr CostCentreStack) Source
CostCentreStack associated with the given value.
clearCCS :: IO a -> IO a Source
Run a computation with an empty cost-center stack. For example, this is used by the interpreter to run an interpreted computation without the call stack showing that it was invoked from GHC.
ccsCC :: Ptr CostCentreStack -> IO (Ptr CostCentre) Source
CostCentre at the head of a
ccsParent :: Ptr CostCentreStack -> IO (Ptr CostCentreStack) Source
Get the tail of a
ccLabel :: Ptr CostCentre -> IO CString Source
Get the label of a
ccModule :: Ptr CostCentre -> IO CString Source
Get the module of a
ccSrcSpan :: Ptr CostCentre -> IO CString Source
Get the source span of a
ccsToStrings :: Ptr CostCentreStack -> IO [String] Source
CostCentreStack as a list of lines.
renderStack :: [String] -> String Source
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).