Hello community, here is the log from the commit of package ghc-ghc-prof for openSUSE:Factory checked in at 2017-08-31 20:50:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-ghc-prof (Old) and /work/SRC/openSUSE:Factory/.ghc-ghc-prof.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-ghc-prof" Thu Aug 31 20:50:55 2017 rev:2 rq:513250 version:1.4.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-ghc-prof/ghc-ghc-prof.changes 2017-04-12 18:06:32.320062074 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-ghc-prof.new/ghc-ghc-prof.changes 2017-08-31 20:50:55.926034687 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:07:14 UTC 2017 - psimons@suse.com + +- Update to version 1.4.0.1. + +------------------------------------------------------------------- Old: ---- ghc-prof-1.3.0.2.tar.gz New: ---- ghc-prof-1.4.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-ghc-prof.spec ++++++ --- /var/tmp/diff_new_pack.oDj6a9/_old 2017-08-31 20:50:56.521951037 +0200 +++ /var/tmp/diff_new_pack.oDj6a9/_new 2017-08-31 20:50:56.525950476 +0200 @@ -19,7 +19,7 @@ %global pkg_name ghc-prof %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.3.0.2 +Version: 1.4.0.1 Release: 0 Summary: Library for parsing GHC time and allocation profiling reports License: BSD-3-Clause @@ -81,5 +81,6 @@ %files devel -f %{name}-devel.files %defattr(-,root,root,-) +%doc CHANGELOG.md README.md %changelog ++++++ ghc-prof-1.3.0.2.tar.gz -> ghc-prof-1.4.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/CHANGELOG.md new/ghc-prof-1.4.0.1/CHANGELOG.md --- old/ghc-prof-1.3.0.2/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 +++ new/ghc-prof-1.4.0.1/CHANGELOG.md 2017-04-02 05:47:08.000000000 +0200 @@ -0,0 +1,9 @@ +# Revision history for ghc-prof + +## 1.4.0.1 (2017-04-02) + +* Implement a workaround for a bug in the GHC profiler ([#6](https://github.com/maoe/ghc-prof/issues/6)) + +## 1.4.0 (2017-02-14) + +* Rename AggregateCostCentre to AggregatedCostCentre diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/README.md new/ghc-prof-1.4.0.1/README.md --- old/ghc-prof-1.3.0.2/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/ghc-prof-1.4.0.1/README.md 2017-02-13 21:41:07.000000000 +0100 @@ -0,0 +1,13 @@ +# ghc-prof: Library for parsing GHC time and allocation profiling reports + +[![Hackage](https://img.shields.io/hackage/v/ghc-prof.svg?maxAge=2592000)](https://hackage.haskell.org/package/ghc-prof) +[![Hackage-Deps](https://img.shields.io/hackage-deps/v/ghc-prof.svg?maxAge=2592000)](https://hackage.haskell.org/package/ghc-prof) +[![Stackage LTS](http://stackage.org/package/ghc-prof/badge/lts)](http://stackage.org/lts/package/ghc-prof) +[![Stackage Nightly](http://stackage.org/package/ghc-prof/badge/nightly)](http://stackage.org/nightly/package/ghc-prof) +[![Build Status](https://travis-ci.org/maoe/ghc-prof.svg?branch=master)](https://travis-ci.org/maoe/ghc-prof) +[![Gitter](https://img.shields.io/gitter/room/maoe/ghc-prof.svg?maxAge=2592000)](https://gitter.im/maoe/ghc-prof) + +## Applications + +* [profiteur](https://hackage.haskell.org/package/profiteur) +* [viewprof](https://hackage.haskell.org/package/viewprof) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/bin/dump.hs new/ghc-prof-1.4.0.1/bin/dump.hs --- old/ghc-prof-1.3.0.2/bin/dump.hs 2016-12-26 06:52:53.000000000 +0100 +++ new/ghc-prof-1.4.0.1/bin/dump.hs 2017-02-13 21:41:07.000000000 +0100 @@ -22,7 +22,7 @@ Left reason -> fail reason Right prof -> case optMode opts of AggregateMode -> - traverse_ (putStrLn . makeAggregateCCName) $ aggregateCostCentres prof + traverse_ (putStrLn . makeAggregateCCName) $ aggregatedCostCentres prof TreeMode -> case restArgs of [] -> traverse_ putStrLn $ drawTree . fmap makeCCName <$> costCentres prof @@ -44,13 +44,13 @@ (showScientific $ costCentreInhAlloc cc) (showScientific $ costCentreIndAlloc cc) -makeAggregateCCName :: AggregateCostCentre -> String +makeAggregateCCName :: AggregatedCostCentre -> String makeAggregateCCName aggregate = printf "%s%%\t%s%%\t%s.%s" - (showScientific $ aggregateCostCentreTime aggregate) - (showScientific $ aggregateCostCentreAlloc aggregate) - (T.unpack $ aggregateCostCentreModule aggregate) - (T.unpack $ aggregateCostCentreName aggregate) + (showScientific $ aggregatedCostCentreTime aggregate) + (showScientific $ aggregatedCostCentreAlloc aggregate) + (T.unpack $ aggregatedCostCentreModule aggregate) + (T.unpack $ aggregatedCostCentreName aggregate) showScientific :: Scientific -> String showScientific = formatScientific Fixed Nothing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/ghc-prof.cabal new/ghc-prof-1.4.0.1/ghc-prof.cabal --- old/ghc-prof-1.3.0.2/ghc-prof.cabal 2017-01-30 05:40:26.000000000 +0100 +++ new/ghc-prof-1.4.0.1/ghc-prof.cabal 2017-04-02 05:48:26.000000000 +0200 @@ -1,5 +1,5 @@ name: ghc-prof -version: 1.3.0.2 +version: 1.4.0.1 synopsis: Library for parsing GHC time and allocation profiling reports description: Library for parsing GHC time and allocation profiling reports homepage: https://github.com/maoe/ghc-prof @@ -7,9 +7,12 @@ license-file: LICENSE author: Mitsutoshi Aoe maintainer: Mitsutoshi Aoe <maoe@foldr.in> -copyright: Copyright (C) 2013-2016 Mitsutoshi Aoe +copyright: Copyright (C) 2013-2017 Mitsutoshi Aoe category: Development build-type: Simple +extra-source-files: + CHANGELOG.md + README.md cabal-version: >=1.10 tested-with: GHC >= 7.6 && <= 8.0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/src/GHC/Prof/CostCentreTree.hs new/ghc-prof-1.4.0.1/src/GHC/Prof/CostCentreTree.hs --- old/ghc-prof-1.3.0.2/src/GHC/Prof/CostCentreTree.hs 2017-01-30 00:24:13.000000000 +0100 +++ new/ghc-prof-1.4.0.1/src/GHC/Prof/CostCentreTree.hs 2017-04-01 00:05:08.000000000 +0200 @@ -5,8 +5,8 @@ module GHC.Prof.CostCentreTree ( -- * Cost center breakdown -- ** Aggregate cost centres - aggregateCostCentres - , aggregateCostCentresOrderBy + aggregatedCostCentres + , aggregatedCostCentresOrderBy -- ** Cost centre trees , costCentres @@ -26,7 +26,7 @@ , aggregateModulesOrderBy -- * Low level functions - , buildAggregateCostCentresOrderBy + , buildAggregatedCostCentresOrderBy , buildCostCentresOrderBy , buildCallSitesOrderBy , buildAggregateCallSitesOrderBy @@ -58,21 +58,21 @@ -- | Build a list of cost-centres from a profiling report ordered by the time -- spent and the amount of allocation. -aggregateCostCentres :: Profile -> [AggregateCostCentre] -aggregateCostCentres = aggregateCostCentresOrderBy sortKey +aggregatedCostCentres :: Profile -> [AggregatedCostCentre] +aggregatedCostCentres = aggregatedCostCentresOrderBy sortKey where - sortKey = aggregateCostCentreTime &&& aggregateCostCentreAlloc + sortKey = aggregatedCostCentreTime &&& aggregatedCostCentreAlloc -- | Build a list of cost-centres from a profling report ordered by the given -- key. -aggregateCostCentresOrderBy +aggregatedCostCentresOrderBy :: Ord a - => (AggregateCostCentre -> a) + => (AggregatedCostCentre -> a) -- ^ Sorting key function -> Profile - -> [AggregateCostCentre] -aggregateCostCentresOrderBy sortKey = - buildAggregateCostCentresOrderBy sortKey . profileCostCentreTree + -> [AggregatedCostCentre] +aggregatedCostCentresOrderBy sortKey = + buildAggregatedCostCentresOrderBy sortKey . profileCostCentreTree -- | Build a tree of cost-centres from a profiling report. costCentres :: Profile -> Maybe (Tree CostCentre) @@ -102,26 +102,26 @@ -> Text -- ^ Module name -> Profile - -> Maybe (AggregateCostCentre, [CallSite AggregateCostCentre]) + -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre]) aggregateCallSites = aggregateCallSitesOrderBy sortKey where sortKey = callSiteContribTime &&& callSiteContribAlloc - &&& aggregateCostCentreTime . callSiteCostCentre - &&& aggregateCostCentreAlloc . callSiteCostCentre + &&& aggregatedCostCentreTime . callSiteCostCentre + &&& aggregatedCostCentreAlloc . callSiteCostCentre -- | Build a list of call sites (caller functions of a cost centre) aggregated -- by their cost centre names and module names. Call sites are sorted by the -- given key function. aggregateCallSitesOrderBy :: Ord a - => (CallSite AggregateCostCentre -> a) + => (CallSite AggregatedCostCentre -> a) -- ^ Sorting key function -> Text -- ^ Cost centre name -> Text -- ^ Module name -> Profile - -> Maybe (AggregateCostCentre, [CallSite AggregateCostCentre]) + -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre]) aggregateCallSitesOrderBy sortKey name modName = buildAggregateCallSitesOrderBy sortKey name modName . profileCostCentreTree @@ -133,7 +133,7 @@ -> Text -- ^ Module name -> Profile - -> Maybe (AggregateCostCentre, [CallSite CostCentre]) + -> Maybe (AggregatedCostCentre, [CallSite CostCentre]) callSites = callSitesOrderBy sortKey where sortKey = callSiteContribTime &&& callSiteContribAlloc @@ -152,7 +152,7 @@ -> Text -- ^ Module name -> Profile - -> Maybe (AggregateCostCentre, [CallSite CostCentre]) + -> Maybe (AggregatedCostCentre, [CallSite CostCentre]) callSitesOrderBy sortKey name modName = buildCallSitesOrderBy sortKey name modName . profileCostCentreTree @@ -176,12 +176,12 @@ ----------------------------------------------------------- -buildAggregateCostCentresOrderBy +buildAggregatedCostCentresOrderBy :: Ord a - => (AggregateCostCentre -> a) + => (AggregatedCostCentre -> a) -> CostCentreTree - -> [AggregateCostCentre] -buildAggregateCostCentresOrderBy sortKey CostCentreTree {..} = + -> [AggregatedCostCentre] +buildAggregatedCostCentresOrderBy sortKey CostCentreTree {..} = sortBy (flip compare `on` sortKey) $ concatMap Map.elems $ Map.elems $ costCentreAggregate @@ -208,14 +208,14 @@ buildAggregateCallSitesOrderBy :: Ord a - => (CallSite AggregateCostCentre -> a) + => (CallSite AggregatedCostCentre -> a) -- ^ Sorting key function -> Text -- ^ Cost centre name -> Text -- ^ Module name -> CostCentreTree - -> Maybe (AggregateCostCentre, [CallSite AggregateCostCentre]) + -> Maybe (AggregatedCostCentre, [CallSite AggregatedCostCentre]) buildAggregateCallSitesOrderBy sortKey name modName tree@CostCentreTree {..} = (,) <$> callee <*> callers where @@ -227,9 +227,9 @@ buildAggregateCallSite :: CostCentreTree - -> Map.Map (Text, Text) (CallSite AggregateCostCentre) + -> Map.Map (Text, Text) (CallSite AggregatedCostCentre) -> CostCentre - -> Maybe (Map.Map (Text, Text) (CallSite AggregateCostCentre)) + -> Maybe (Map.Map (Text, Text) (CallSite AggregatedCostCentre)) buildAggregateCallSite CostCentreTree {..} parents CostCentre {..} = do parentNo <- IntMap.lookup costCentreNo costCentreParents parent <- IntMap.lookup parentNo costCentreNodes @@ -271,7 +271,7 @@ -> Text -- ^ Module name -> CostCentreTree - -> Maybe (AggregateCostCentre, [CallSite CostCentre]) + -> Maybe (AggregatedCostCentre, [CallSite CostCentre]) buildCallSitesOrderBy sortKey name modName tree@CostCentreTree {..} = (,) <$> callee <*> callers where @@ -311,25 +311,25 @@ costCentreAggregate where aggregateModule modName = Map.foldl' add (emptyAggregateModule modName) - add aggMod AggregateCostCentre {..} = aggMod + add aggMod AggregatedCostCentre {..} = aggMod { aggregateModuleEntries = seqM $ (+) <$> aggregateModuleEntries aggMod - <*> aggregateCostCentreEntries + <*> aggregatedCostCentreEntries , aggregateModuleTime = - aggregateModuleTime aggMod + aggregateCostCentreTime + aggregateModuleTime aggMod + aggregatedCostCentreTime , aggregateModuleAlloc = - aggregateModuleAlloc aggMod + aggregateCostCentreAlloc + aggregateModuleAlloc aggMod + aggregatedCostCentreAlloc , aggregateModuleTicks = seqM $ (+) <$> aggregateModuleTicks aggMod - <*> aggregateCostCentreTicks + <*> aggregatedCostCentreTicks , aggregateModuleBytes = seqM $ (+) <$> aggregateModuleBytes aggMod - <*> aggregateCostCentreBytes + <*> aggregatedCostCentreBytes } lookupAggregate :: Text -- ^ Cost centre name -> Text -- ^ Module name - -> Map.Map Text (Map.Map Text AggregateCostCentre) - -> Maybe AggregateCostCentre + -> Map.Map Text (Map.Map Text AggregatedCostCentre) + -> Maybe AggregatedCostCentre lookupAggregate name modName m = Map.lookup modName m >>= Map.lookup name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/src/GHC/Prof/Parser.hs new/ghc-prof-1.4.0.1/src/GHC/Prof/Parser.hs --- old/ghc-prof-1.3.0.2/src/GHC/Prof/Parser.hs 2017-01-30 05:39:48.000000000 +0100 +++ new/ghc-prof-1.4.0.1/src/GHC/Prof/Parser.hs 2017-04-02 05:46:52.000000000 +0200 @@ -13,13 +13,13 @@ , totalTime , totalAlloc , topCostCentres - , aggregateCostCentre + , aggregatedCostCentre , costCentres , costCentre ) where import Control.Applicative import Control.Monad -import Data.Char (isSpace) +import Data.Char (isDigit, isSpace) import Data.Foldable (asum, foldl') import Data.Maybe import Data.Time @@ -28,6 +28,7 @@ import Data.Attoparsec.Text as A import qualified Data.Set as Set import qualified Data.Text as T +import qualified Data.Text.Read as TR import Control.Monad.Extras (seqM) import GHC.Prof.Types @@ -151,13 +152,13 @@ return HeaderParams {..} -topCostCentres :: Parser [AggregateCostCentre] +topCostCentres :: Parser [AggregatedCostCentre] topCostCentres = do params <- header; skipSpace - aggregateCostCentre params `sepBy1` endOfLine + aggregatedCostCentre params `sepBy1` endOfLine -aggregateCostCentre :: HeaderParams -> Parser AggregateCostCentre -aggregateCostCentre HeaderParams {..} = AggregateCostCentre +aggregatedCostCentre :: HeaderParams -> Parser AggregatedCostCentre +aggregatedCostCentre HeaderParams {..} = AggregatedCostCentre <$> symbol <* skipHorizontalSpace -- name <*> symbol <* skipHorizontalSpace -- module <*> source <* skipHorizontalSpace -- src @@ -177,22 +178,10 @@ costCentreTree params costCentre :: HeaderParams -> Parser CostCentre -costCentre HeaderParams {..} = do +costCentre params = do name <- symbol; skipHorizontalSpace - modName <- symbol; skipHorizontalSpace - src <- if headerHasSrc - then do - !sym <- sourceSpan - return $ Just sym - else pure Nothing - skipHorizontalSpace - no <- decimal; skipHorizontalSpace - entries <- decimal; skipHorizontalSpace - indTime <- scientific; skipHorizontalSpace - indAlloc <- scientific; skipHorizontalSpace - inhTime <- scientific; skipHorizontalSpace - inhAlloc <- scientific; skipHorizontalSpace - optInfo <- optional optionalInfo + (modName, src, no, (entries, indTime, indAlloc, inhTime, inhAlloc, optInfo)) + <- validCostCentre params <|> jammedCostCentre return $! CostCentre { costCentreName = name , costCentreModule = modName @@ -207,11 +196,40 @@ , costCentreBytes = snd <$> optInfo } where - optionalInfo = do - !ticks <- decimal + validCostCentre HeaderParams {..} = do + modName <- symbol; skipHorizontalSpace + src <- if headerHasSrc + then do + !sym <- sourceSpan + return $ Just sym + else pure Nothing skipHorizontalSpace - !bytes <- decimal - return (ticks, bytes) + no <- decimal; skipHorizontalSpace + vals <- metrics + return (modName, src, no, vals) + -- Workaround for https://ghc.haskell.org/trac/ghc/ticket/8811. + -- This bug had been fixed before the SRC column was implemented so + -- @sourceSpan@ isn't parsed here. + -- Caveat: This parser can be confused if module name contains digits and + -- the digits are jammed with the cost centre number. In such cases, all + -- the digits are parsed as a number of entries. + jammedCostCentre = do + jammed <- symbol; skipHorizontalSpace + let modName = T.dropWhileEnd isDigit jammed + no <- either fail (return . fst) $ TR.decimal $ T.takeWhileEnd isDigit jammed + vals <- metrics + return (modName, Nothing, no, vals) + metrics = do + entries <- decimal; skipHorizontalSpace + indTime <- scientific; skipHorizontalSpace + indAlloc <- scientific; skipHorizontalSpace + inhTime <- scientific; skipHorizontalSpace + inhAlloc <- scientific; skipHorizontalSpace + optInfo <- optional $ do + !ticks <- decimal; skipHorizontalSpace + !bytes <- decimal + return (ticks, bytes) + return (entries, indTime, indAlloc, inhTime, inhAlloc, optInfo) costCentreTree :: HeaderParams -> Parser CostCentreTree costCentreTree params = buildTree <$> costCentreList @@ -282,19 +300,19 @@ (costCentreModule node) costCentreAggregate } - aggregate = AggregateCostCentre - { aggregateCostCentreName = costCentreName node - , aggregateCostCentreModule = costCentreModule node - , aggregateCostCentreSrc = costCentreSrc node - , aggregateCostCentreEntries = Just $! costCentreEntries node - , aggregateCostCentreTime = costCentreIndTime node - , aggregateCostCentreAlloc = costCentreIndAlloc node - , aggregateCostCentreTicks = costCentreTicks node - , aggregateCostCentreBytes = costCentreBytes node + aggregate = AggregatedCostCentre + { aggregatedCostCentreName = costCentreName node + , aggregatedCostCentreModule = costCentreModule node + , aggregatedCostCentreSrc = costCentreSrc node + , aggregatedCostCentreEntries = Just $! costCentreEntries node + , aggregatedCostCentreTime = costCentreIndTime node + , aggregatedCostCentreAlloc = costCentreIndAlloc node + , aggregatedCostCentreTicks = costCentreTicks node + , aggregatedCostCentreBytes = costCentreBytes node } updateCostCentre - :: Maybe (Map.Map Text AggregateCostCentre) - -> Map.Map Text AggregateCostCentre + :: Maybe (Map.Map Text AggregatedCostCentre) + -> Map.Map Text AggregatedCostCentre updateCostCentre = \case Nothing -> Map.singleton (costCentreName node) aggregate Just costCentreByName -> @@ -304,19 +322,19 @@ aggregate costCentreByName addCostCentre x y = x - { aggregateCostCentreEntries = seqM $ (+) - <$> aggregateCostCentreEntries x - <*> aggregateCostCentreEntries y - , aggregateCostCentreTime = - aggregateCostCentreTime x + aggregateCostCentreTime y - , aggregateCostCentreAlloc = - aggregateCostCentreAlloc x + aggregateCostCentreAlloc y - , aggregateCostCentreTicks = seqM $ (+) - <$> aggregateCostCentreTicks x - <*> aggregateCostCentreTicks y - , aggregateCostCentreBytes = seqM $ (+) - <$> aggregateCostCentreBytes x - <*> aggregateCostCentreBytes y + { aggregatedCostCentreEntries = seqM $ (+) + <$> aggregatedCostCentreEntries x + <*> aggregatedCostCentreEntries y + , aggregatedCostCentreTime = + aggregatedCostCentreTime x + aggregatedCostCentreTime y + , aggregatedCostCentreAlloc = + aggregatedCostCentreAlloc x + aggregatedCostCentreAlloc y + , aggregatedCostCentreTicks = seqM $ (+) + <$> aggregatedCostCentreTicks x + <*> aggregatedCostCentreTicks y + , aggregatedCostCentreBytes = seqM $ (+) + <$> aggregatedCostCentreBytes x + <*> aggregatedCostCentreBytes y } howMany :: Parser a -> Parser Int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/src/GHC/Prof/Types.hs new/ghc-prof-1.4.0.1/src/GHC/Prof/Types.hs --- old/ghc-prof-1.3.0.2/src/GHC/Prof/Types.hs 2017-01-30 00:24:13.000000000 +0100 +++ new/ghc-prof-1.4.0.1/src/GHC/Prof/Types.hs 2017-02-13 21:41:07.000000000 +0100 @@ -16,7 +16,7 @@ , profileCommandLine :: !Text , profileTotalTime :: !TotalTime , profileTotalAlloc :: !TotalAlloc - , profileTopCostCentres :: [AggregateCostCentre] + , profileTopCostCentres :: [AggregatedCostCentre] , profileCostCentreTree :: !CostCentreTree } deriving Show @@ -38,23 +38,23 @@ -- ^ Total memory allocation in bytes } deriving Show -data AggregateCostCentre = AggregateCostCentre - { aggregateCostCentreName :: !Text +data AggregatedCostCentre = AggregatedCostCentre + { aggregatedCostCentreName :: !Text -- ^ Name of the cost-centre - , aggregateCostCentreModule :: !Text + , aggregatedCostCentreModule :: !Text -- ^ Module name of the cost-centre - , aggregateCostCentreSrc :: !(Maybe Text) + , aggregatedCostCentreSrc :: !(Maybe Text) -- ^ Source location of the cost-centre - , aggregateCostCentreEntries :: !(Maybe Integer) + , aggregatedCostCentreEntries :: !(Maybe Integer) -- ^ Number of entries to the cost-centre - , aggregateCostCentreTime :: !Scientific + , aggregatedCostCentreTime :: !Scientific -- ^ Total time spent in the cost-centre - , aggregateCostCentreAlloc :: !Scientific + , aggregatedCostCentreAlloc :: !Scientific -- ^ Total allocation in the cost-centre - , aggregateCostCentreTicks :: !(Maybe Integer) + , aggregatedCostCentreTicks :: !(Maybe Integer) -- ^ Total ticks in the cost-centre. This number exists only if -- @-P@ or @-Pa@ option is given at run-time. - , aggregateCostCentreBytes :: !(Maybe Integer) + , aggregatedCostCentreBytes :: !(Maybe Integer) -- ^ Total memory allocation in the cost-centre. This number -- exists only if @-P@ or @-Pa@ option is given at run-time. } deriving (Show, Eq, Ord) @@ -92,7 +92,7 @@ , costCentreParents :: !(IntMap CostCentreNo) , costCentreChildren :: !(IntMap (Set CostCentre)) , costCentreCallSites :: !(Map (Text, Text) (Set CostCentre)) - , costCentreAggregate :: !(Map Text (Map Text AggregateCostCentre)) + , costCentreAggregate :: !(Map Text (Map Text AggregatedCostCentre)) } deriving Show emptyCostCentreTree :: CostCentreTree diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/src/GHC/Prof.hs new/ghc-prof-1.4.0.1/src/GHC/Prof.hs --- old/ghc-prof-1.3.0.2/src/GHC/Prof.hs 2017-01-30 00:24:13.000000000 +0100 +++ new/ghc-prof-1.4.0.1/src/GHC/Prof.hs 2017-04-01 00:05:08.000000000 +0200 @@ -6,8 +6,8 @@ -- * Cost-centre tree , CostCentreTree - , aggregateCostCentres - , aggregateCostCentresOrderBy + , aggregatedCostCentres + , aggregatedCostCentresOrderBy , costCentres , costCentresOrderBy , aggregateCallSites @@ -21,7 +21,7 @@ , Profile(..) , TotalTime(..) , TotalAlloc(..) - , AggregateCostCentre(..) + , AggregatedCostCentre(..) , CostCentre(..) , CostCentreNo , CallSite(..) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ghc-prof-1.3.0.2/tests/Regression.hs new/ghc-prof-1.4.0.1/tests/Regression.hs --- old/ghc-prof-1.3.0.2/tests/Regression.hs 2016-12-26 06:52:53.000000000 +0100 +++ new/ghc-prof-1.4.0.1/tests/Regression.hs 2017-04-02 05:48:26.000000000 +0200 @@ -62,36 +62,36 @@ text <- TL.readFile path case ATL.parse profile text of ATL.Done _ prof -> do - let actual = Set.fromList $ map Similar $ aggregateCostCentres prof + let actual = Set.fromList $ map Similar $ aggregatedCostCentres prof expected = Set.fromList $ map Similar $ profileTopCostCentres prof assertBool ("Missing cost centre(s): " ++ show (Set.difference expected actual)) $ Set.isSubsetOf expected actual ATL.Fail _ _ reason -> assertFailure reason -newtype Similar = Similar AggregateCostCentre +newtype Similar = Similar AggregatedCostCentre instance Show Similar where show (Similar a) = show a instance Eq Similar where Similar a == Similar b = - aggregateCostCentreName a == aggregateCostCentreName b - && aggregateCostCentreModule a == aggregateCostCentreModule b - && aggregateCostCentreTime a == aggregateCostCentreTime b - && aggregateCostCentreAlloc a == aggregateCostCentreAlloc b - && aggregateCostCentreTicks a == aggregateCostCentreTicks b - && aggregateCostCentreBytes a == aggregateCostCentreBytes b + aggregatedCostCentreName a == aggregatedCostCentreName b + && aggregatedCostCentreModule a == aggregatedCostCentreModule b + && aggregatedCostCentreTime a == aggregatedCostCentreTime b + && aggregatedCostCentreAlloc a == aggregatedCostCentreAlloc b + && aggregatedCostCentreTicks a == aggregatedCostCentreTicks b + && aggregatedCostCentreBytes a == aggregatedCostCentreBytes b instance Ord Similar where compare (Similar a) (Similar b) = - compare (aggregateCostCentreName a) (aggregateCostCentreName b) - <> compare (aggregateCostCentreModule a) (aggregateCostCentreModule b) - <> compare (aggregateCostCentreTime a) (aggregateCostCentreTime b) - <> compare (aggregateCostCentreAlloc a) (aggregateCostCentreAlloc b) - <> compare (aggregateCostCentreTicks a) (aggregateCostCentreTicks b) - <> compare (aggregateCostCentreBytes a) (aggregateCostCentreBytes b) + compare (aggregatedCostCentreName a) (aggregatedCostCentreName b) + <> compare (aggregatedCostCentreModule a) (aggregatedCostCentreModule b) + <> compare (aggregatedCostCentreTime a) (aggregatedCostCentreTime b) + <> compare (aggregatedCostCentreAlloc a) (aggregatedCostCentreAlloc b) + <> compare (aggregatedCostCentreTicks a) (aggregatedCostCentreTicks b) + <> compare (aggregatedCostCentreBytes a) (aggregatedCostCentreBytes b) #if !MIN_VERSION_directory(1, 2, 3) withCurrentDirectory :: FilePath -> IO a -> IO a