Skip to content
Snippets Groups Projects

Cachegrind fixes

Merged Ben Gamari requested to merge cachegrind-fixes into master
1 file
+ 11
6
Compare changes
  • Side-by-side
  • Inline
+ 11
6
@@ -444,13 +444,18 @@ buildRules nofib@Build{..} = do
runTest nofib (ModeWrapped args parse_perf) resultsTsv
-- Run tests under cachegrind
["//Main.cachegrind.result", "//Main.cachegrind.results.tsv"] &%> \[out, resultsTsv] -> do
out' <- liftIO $ IO.canonicalizePath out
["//Main.cachegrind.results.tsv"] &%> \[resultsTsv] -> do
out' <- liftIO $ IO.canonicalizePath resultsTsv
let test = testFromResultTsv nofib resultsTsv
let wrapper_args n = ["valgrind", "--tool=cachegrind"] <> cachegrind_args <>
[("--cachegrind-out-file="<>out'<.>show n)]
let cachegrindOut n = FP.replaceFileName out' ("Main.cachegrind.result" <.> show n)
let wrapper_args n =
["valgrind", "--tool=cachegrind"] <> cachegrind_args <>
[ "--cachegrind-out-file="<>cachegrindOut n
, "--log-file=cachegrind.log"
]
let parse_cachegrind n = do
stats <- CachegrindParse.parse (out' <.> show n)
stats <- CachegrindParse.parse (cachegrindOut n)
return $ Ms.fromList
[ (testLabel test <> ml "run" <> ml "cachegrind" <> lbl, realToFrac v)
| (eventName, v) <- M.toList stats
@@ -748,4 +753,4 @@ removeDirectoryRecursive x = do
when b $ IO.removeDirectoryRecursive x
printM :: (MonadIO m, Show a) => a -> m ()
printM x = liftIO $ print x
\ No newline at end of file
printM x = liftIO $ print x
Loading