Commit ceb94649 authored by Ben Gamari's avatar Ben Gamari 🐢

cachegrind

parent b3cfe9c4
......@@ -284,19 +284,11 @@ buildRules nofib@Build{..} = do
"//Main.cachegrind.result" %> \out -> do
need [takeDirectory out </> "config.txt"]
need [replaceExtensions out exe]
let dir = unoutput out
liftIO $ print dir
runCachegrind nofib dir
return ()
runCachegrind :: Nofib -> String -> Action Bool
runCachegrind nofib@Build{..} test = do
resultsHdl <- liftIO $ openFile (test <.> "run.result") WriteMode
liftIO $ hPutStrLn resultsHdl $ "==nofib== " ++ takeDirectory1 test ++ ": time to run " ++ takeDirectory1 test ++ " follows..."
(stdin, args) <- liftIO $ getTestCmdline nofib test
executable <- liftIO $ IO.canonicalizePath $ output </> test </> "Main" <.> exe
cmd_ (Cwd test) "valgrind" "--tool=cachegrind" executable args
return True
let test = unoutput out
(stdin, args) <- liftIO $ getTestCmdline nofib test
executable <- liftIO $ IO.canonicalizePath $ output </> test </> "Main" <.> exe
out' <- liftIO $ IO.canonicalizePath out
cmd_ (Cwd test) "valgrind" "--tool=cachegrind" ("--cachegrind-out-file="++out') executable args
getTestCmdline :: Nofib -> String -> IO (FilePath, [String])
getTestCmdline nofib@Build{run=Just speed,..} test = do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment