HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebase-4.20.2.0Haskell2010

GHC.Stack.CCS

Access to GHC's call-stack simulation

  • 2 types
  • 12 values
  • Packagebase-4.20.2.0
  • Exports14
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCCS.hs

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.