HORIZON HASKELLDocslts/ghc-9.14.xb9228482026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · b922848 · 2026-10-12

Modulebase-4.22.0.0Haskell2010

GHC.Stack.CCS

Access to GHC's call-stack simulation

Contents
  1. Call stacks
  2. Internals
Synopsis
  • Packagebase-4.22.0.0
  • Exports14
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCCS.hs

Call stacks

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

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.