Commit f3a251e3 authored by keithw's avatar keithw
Browse files

[project @ 2002-02-28 18:50:40 by keithw]

Un-rot nofib-analyse, so it compiles with ghc-5.02.2.

* add a regexp for GNU time 1.7

* import Html hiding ((!)) now hides Html.! as well as !, so add an
  import qualified Html ((!)) as well.

* compile Printf with -fvia-c to work around bug in foreign import of
  snprintf (was always printing "0.00" no matter what input given).
parent fe4844f7
-----------------------------------------------------------------------------
-- $Id: Main.hs,v 1.5 2001/02/21 16:24:34 simonmar Exp $
-- $Id: Main.hs,v 1.6 2002/02/28 18:50:40 keithw Exp $
-- (c) Simon Marlow 1997-1999
-----------------------------------------------------------------------------
......@@ -12,6 +12,7 @@ import Slurp
import CmdLine
import Html hiding ((!))
import qualified Html ((!))
import GlaExts
import FiniteMap
import GetOpt
......
# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.3 2001/02/21 16:24:34 simonmar Exp $
# $Id: Makefile,v 1.4 2002/02/28 18:50:42 keithw Exp $
# (c) Simon Marlow 1999-2000
TOP=..
......@@ -8,4 +8,6 @@ include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -fglasgow-exts -package util -package data -package text -cpp
HS_PROG = nofib-analyse
Printf_HC_OPTS += -fvia-c
include $(TOP)/mk/target.mk
-----------------------------------------------------------------------------
-- $Id: Slurp.hs,v 1.2 2000/02/18 10:25:53 simonmar Exp $
-- $Id: Slurp.hs,v 1.3 2002/02/28 18:50:42 keithw Exp $
-- (c) Simon Marlow 1997-1999
-----------------------------------------------------------------------------
......@@ -81,6 +81,10 @@ of "time" will need different regexps.
time_re = mkRegex "^[ \t]*([0-9.]+)[ \t]+real[ \t]+([0-9.]+)[ \t]+user[ \t]+([0-9.]+)[ \t]+sys[ \t]*$"
time_gnu17_re = mkRegex "^[ \t]*([0-9.]+)user[ \t]+([0-9.]+)system[ \t]+([0-9.:]+)elapsed"
-- /usr/bin/time --version reports: GNU time 1.7
-- notice the order is different, and the elapsed time is [hh:]mm:ss.s
size_re = mkRegex "^[ \t]*([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)"
{-
......@@ -185,6 +189,13 @@ parse_compile_time prog mod (l:ls) =
[(prog,emptyResults{compile_time = ct})];
Nothing ->
case matchRegex time_gnu17_re l of {
Just (user:system:elapsed:_) ->
let ct = addToFM emptyFM mod (read user)
in
[(prog,emptyResults{compile_time = ct})];
Nothing ->
case matchRegex ghc1_re l of {
Just (allocs:_:_:_:_:init:_:mut:_:gc:_) ->
let
......@@ -230,14 +241,22 @@ parse_compile_time prog mod (l:ls) =
Nothing ->
parse_compile_time prog mod ls
}}}}}
}}}}}}
parse_link_time prog [] = []
parse_link_time prog (l:ls) =
case matchRegex time_re l of
Nothing -> parse_link_time prog ls
case matchRegex time_re l of {
Just (real:user:system:_) ->
[(prog,emptyResults{link_time = Just (read user)})]
[(prog,emptyResults{link_time = Just (read user)})];
Nothing ->
case matchRegex time_gnu17_re l of {
Just (user:system:elapsed:_) ->
[(prog,emptyResults{link_time = Just (read user)})];
Nothing ->
parse_link_time prog ls
}}
parse_run_time prog [] NotDone = []
parse_run_time prog [] ex =[(prog,emptyResults{run_status=ex})]
......
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