Movatterモバイル変換
[0]ホーム
{-# LINE1"GHC/Stats.hsc"#-}{-# LANGUAGE Trustworthy #-}{-# LANGUAGE NoImplicitPrelude #-}{-# LANGUAGE RecordWildCards #-}{-# OPTIONS_GHC -funbox-strict-fields #-}------------------------------------------------------------------------------- | This module provides access to internal garbage collection and-- memory usage statistics. These statistics are not available unless-- a program is run with the @-T@ RTS flag.---- This module is GHC-only and should not be considered portable.---- @since 4.5.0.0-----------------------------------------------------------------------------moduleGHC.Stats(-- * Runtime statisticsRTSStats(..),GCDetails(..),RtsTime,getRTSStats,getRTSStatsEnabled)whereimportControl.MonadimportData.IntimportData.WordimportGHC.BaseimportGHC.Read(Read)importGHC.Show(Show)importGHC.IO.ExceptionimportForeign.Marshal.AllocimportForeign.StorableimportForeign.Ptrforeignimportccall"getRTSStats"getRTSStats_::Ptr()->IO()-- | Returns whether GC stats have been enabled (with @+RTS -T@, for example).---- @since 4.10.0.0foreignimportccall"getRTSStatsEnabled"getRTSStatsEnabled::IOBool---- | Statistics about runtime activity since the start of the-- program. This is a mirror of the C @struct RTSStats@ in @RtsAPI.h@---- @since 4.10.0.0--dataRTSStats=RTSStats{-- ------------------------------------- Cumulative stats about memory use-- | Total number of GCsgcs::Word32-- | Total number of major (oldest generation) GCs,major_gcs::Word32-- | Total bytes allocated,allocated_bytes::Word64-- | Maximum live data (including large objects + compact regions) in the-- heap. Updated after a major GC.,max_live_bytes::Word64-- | Maximum live data in large objects,max_large_objects_bytes::Word64-- | Maximum live data in compact regions,max_compact_bytes::Word64-- | Maximum slop,max_slop_bytes::Word64-- | Maximum memory in use by the RTS,max_mem_in_use_bytes::Word64-- | Sum of live bytes across all major GCs. Divided by major_gcs-- gives the average live data over the lifetime of the program.,cumulative_live_bytes::Word64-- | Sum of copied_bytes across all GCs,copied_bytes::Word64-- | Sum of copied_bytes across all parallel GCs,par_copied_bytes::Word64-- | Sum of par_max_copied_bytes across all parallel GCs. Deprecated.,cumulative_par_max_copied_bytes::Word64-- | Sum of par_balanced_copied bytes across all parallel GCs,cumulative_par_balanced_copied_bytes::Word64-- ------------------------------------- Cumulative stats about time use-- (we use signed values here because due to inaccuracies in timers-- the values can occasionally go slightly negative)-- | Total CPU time used by the init phase-- @since 4.12.0.0,init_cpu_ns::RtsTime-- | Total elapsed time used by the init phase-- @since 4.12.0.0,init_elapsed_ns::RtsTime-- | Total CPU time used by the mutator,mutator_cpu_ns::RtsTime-- | Total elapsed time used by the mutator,mutator_elapsed_ns::RtsTime-- | Total CPU time used by the GC,gc_cpu_ns::RtsTime-- | Total elapsed time used by the GC,gc_elapsed_ns::RtsTime-- | Total CPU time (at the previous GC),cpu_ns::RtsTime-- | Total elapsed time (at the previous GC),elapsed_ns::RtsTime-- | Details about the most recent GC,gc::GCDetails}deriving(Read-- ^ @since 4.10.0.0,Show-- ^ @since 4.10.0.0)---- | Statistics about a single GC. This is a mirror of the C @struct-- GCDetails@ in @RtsAPI.h@, with the field prefixed with @gc_@ to-- avoid collisions with 'RTSStats'.--dataGCDetails=GCDetails{-- | The generation number of this GCgcdetails_gen::Word32-- | Number of threads used in this GC,gcdetails_threads::Word32-- | Number of bytes allocated since the previous GC,gcdetails_allocated_bytes::Word64-- | Total amount of live data in the heap (incliudes large + compact data).-- Updated after every GC. Data in uncollected generations (in minor GCs)-- are considered live.,gcdetails_live_bytes::Word64-- | Total amount of live data in large objects,gcdetails_large_objects_bytes::Word64-- | Total amount of live data in compact regions,gcdetails_compact_bytes::Word64-- | Total amount of slop (wasted memory),gcdetails_slop_bytes::Word64-- | Total amount of memory in use by the RTS,gcdetails_mem_in_use_bytes::Word64-- | Total amount of data copied during this GC,gcdetails_copied_bytes::Word64-- | In parallel GC, the max amount of data copied by any one thread.-- Deprecated.,gcdetails_par_max_copied_bytes::Word64-- | In parallel GC, the amount of balanced data copied by all threads,gcdetails_par_balanced_copied_bytes::Word64-- | The time elapsed during synchronisation before GC,gcdetails_sync_elapsed_ns::RtsTime-- | The CPU time used during GC itself,gcdetails_cpu_ns::RtsTime-- | The time elapsed during GC itself,gcdetails_elapsed_ns::RtsTime}deriving(Read-- ^ @since 4.10.0.0,Show-- ^ @since 4.10.0.0)-- | Time values from the RTS, using a fixed resolution of nanoseconds.typeRtsTime=Int64-- | Get current runtime system statistics.---- @since 4.10.0.0--getRTSStats::IORTSStatsgetRTSStats=dostatsEnabled<-getRTSStatsEnabledunlessstatsEnabled.ioError$IOErrorNothingUnsupportedOperation"""GHC.Stats.getRTSStats: GC stats not enabled. Use `+RTS -T -RTS' to enable them."NothingNothingallocaBytes((320))$\p->do{-# LINE171"GHC/Stats.hsc"#-}getRTSStats_pgcs<-((\hsc_ptr->peekByteOffhsc_ptr0))p{-# LINE173"GHC/Stats.hsc"#-}major_gcs<-((\hsc_ptr->peekByteOffhsc_ptr4))p{-# LINE174"GHC/Stats.hsc"#-}allocated_bytes<-((\hsc_ptr->peekByteOffhsc_ptr8))p{-# LINE175"GHC/Stats.hsc"#-}max_live_bytes<-((\hsc_ptr->peekByteOffhsc_ptr16))p{-# LINE176"GHC/Stats.hsc"#-}max_large_objects_bytes<-((\hsc_ptr->peekByteOffhsc_ptr24))p{-# LINE177"GHC/Stats.hsc"#-}max_compact_bytes<-((\hsc_ptr->peekByteOffhsc_ptr32))p{-# LINE178"GHC/Stats.hsc"#-}max_slop_bytes<-((\hsc_ptr->peekByteOffhsc_ptr40))p{-# LINE179"GHC/Stats.hsc"#-}max_mem_in_use_bytes<-((\hsc_ptr->peekByteOffhsc_ptr48))p{-# LINE180"GHC/Stats.hsc"#-}cumulative_live_bytes<-((\hsc_ptr->peekByteOffhsc_ptr56))p{-# LINE181"GHC/Stats.hsc"#-}copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr64))p{-# LINE182"GHC/Stats.hsc"#-}par_copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr72))p{-# LINE183"GHC/Stats.hsc"#-}cumulative_par_max_copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr80))p{-# LINE185"GHC/Stats.hsc"#-}cumulative_par_balanced_copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr88))p{-# LINE187"GHC/Stats.hsc"#-}init_cpu_ns<-((\hsc_ptr->peekByteOffhsc_ptr96))p{-# LINE188"GHC/Stats.hsc"#-}init_elapsed_ns<-((\hsc_ptr->peekByteOffhsc_ptr104))p{-# LINE189"GHC/Stats.hsc"#-}mutator_cpu_ns<-((\hsc_ptr->peekByteOffhsc_ptr112))p{-# LINE190"GHC/Stats.hsc"#-}mutator_elapsed_ns<-((\hsc_ptr->peekByteOffhsc_ptr120))p{-# LINE191"GHC/Stats.hsc"#-}gc_cpu_ns<-((\hsc_ptr->peekByteOffhsc_ptr128))p{-# LINE192"GHC/Stats.hsc"#-}gc_elapsed_ns<-((\hsc_ptr->peekByteOffhsc_ptr136))p{-# LINE193"GHC/Stats.hsc"#-}cpu_ns<-((\hsc_ptr->peekByteOffhsc_ptr144))p{-# LINE194"GHC/Stats.hsc"#-}elapsed_ns<-((\hsc_ptr->peekByteOffhsc_ptr152))p{-# LINE195"GHC/Stats.hsc"#-}letpgc=((\hsc_ptr->hsc_ptr`plusPtr`160))p{-# LINE196"GHC/Stats.hsc"#-}gc<-dogcdetails_gen<-((\hsc_ptr->peekByteOffhsc_ptr0))pgc{-# LINE198"GHC/Stats.hsc"#-}gcdetails_threads<-((\hsc_ptr->peekByteOffhsc_ptr4))pgc{-# LINE199"GHC/Stats.hsc"#-}gcdetails_allocated_bytes<-((\hsc_ptr->peekByteOffhsc_ptr8))pgc{-# LINE200"GHC/Stats.hsc"#-}gcdetails_live_bytes<-((\hsc_ptr->peekByteOffhsc_ptr16))pgc{-# LINE201"GHC/Stats.hsc"#-}gcdetails_large_objects_bytes<-((\hsc_ptr->peekByteOffhsc_ptr24))pgc{-# LINE203"GHC/Stats.hsc"#-}gcdetails_compact_bytes<-((\hsc_ptr->peekByteOffhsc_ptr32))pgc{-# LINE204"GHC/Stats.hsc"#-}gcdetails_slop_bytes<-((\hsc_ptr->peekByteOffhsc_ptr40))pgc{-# LINE205"GHC/Stats.hsc"#-}gcdetails_mem_in_use_bytes<-((\hsc_ptr->peekByteOffhsc_ptr48))pgc{-# LINE206"GHC/Stats.hsc"#-}gcdetails_copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr56))pgc{-# LINE207"GHC/Stats.hsc"#-}gcdetails_par_max_copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr64))pgc{-# LINE209"GHC/Stats.hsc"#-}gcdetails_par_balanced_copied_bytes<-((\hsc_ptr->peekByteOffhsc_ptr72))pgc{-# LINE211"GHC/Stats.hsc"#-}gcdetails_sync_elapsed_ns<-((\hsc_ptr->peekByteOffhsc_ptr80))pgc{-# LINE212"GHC/Stats.hsc"#-}gcdetails_cpu_ns<-((\hsc_ptr->peekByteOffhsc_ptr88))pgc{-# LINE213"GHC/Stats.hsc"#-}gcdetails_elapsed_ns<-((\hsc_ptr->peekByteOffhsc_ptr96))pgc{-# LINE214"GHC/Stats.hsc"#-}returnGCDetails{..}returnRTSStats{..}
[8]ページ先頭