HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-internal-9.1003.0Haskell2010

GHC.Internal.Stack.CCS

Access to GHC's call-stack simulation

  • 2 types
  • 12 values

Call stacks

2 declarations
valuecurrentCallStack :: IO [String]
#

Returns a [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.

Internals

12 declarations
datadata CostCentreStack
#

A cost-centre stack from GHC's cost-center profiler.

datadata CostCentre
#

A cost-centre from GHC's cost-center profiler.

valuegetCurrentCCS :: dummy -> IO (Ptr CostCentreStack)
#

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

valueclearCCS :: IO a -> IO a
#

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.