HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulebase-4.23.0.0Haskell2010

GHC.Stack.CCS

Access to GHC's call-stack simulation

Contents
  1. Call stacks
  2. Internals
Synopsis
  • Packagebase-4.23.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.