packages feed

threadscope 0.1.2 → 0.1.3

raw patch · 4 files changed

+28/−14 lines, 4 filesdep ~containersdep ~ghc-eventsnew-uploader

Dependency ranges changed: containers, ghc-events

Files

About.hs view
@@ -8,6 +8,7 @@ -- Imports for GTK/Glade
 import Graphics.UI.Gtk
 import Paths_threadscope
+import Data.Version (showVersion)
 
 -------------------------------------------------------------------------------
 
@@ -18,7 +19,7 @@       logo <- pixbufNewFromFile logoPath
       set aboutDialog [
          aboutDialogName      := "ThreadScope",
-         aboutDialogVersion   := "0.1.1",
+         aboutDialogVersion   := showVersion version,
          aboutDialogCopyright := "Released under the GHC license as part of the Glasgow Haskell Compiler.",
          aboutDialogComments  := "A GHC eventlog profile viewer",
          aboutDialogAuthors   := ["Donnie Jones (donnie@darthik.com)",
EventsWindow.hs view
@@ -237,7 +237,7 @@       lines = ceiling (fromIntegral height / h)       end = min upper (val + lines) -      draw y ev = do moveTo 0 y; showText (ppEvent ev)+      draw y ev = do moveTo 0 y; showText (ppEvent' ev)    zipWithM_ draw [ h, h*2 .. ] [ arr ! n | n <- [ val .. end ] ] @@ -253,8 +253,8 @@ -------------------------------------------------------------------------------  -ppEvent :: CapEvent -> String-ppEvent (CapEvent cap (GHC.Event time spec)) =+ppEvent' :: CapEvent -> String+ppEvent' (CapEvent cap (GHC.Event time spec)) =   printf "%9d: " time ++   (case cap of     Nothing -> ""
Timeline/Ticks.hs view
@@ -109,7 +109,7 @@       "0s"
     else
       if pos < 1000000 then -- Show time as micro-seconds for times < 1e-6
-        reformatMS  (posf / 1000) ++ ('\x00b5':"s")  -- microsecond (1e-6s).
+        reformatMS  (posf / 1000) ++ (mu ++ "s")  -- microsecond (1e-6s).
     else
       if pos < 100000000 then -- Show miliseonds for time < 0.1s
         reformatMS (posf / 1000000) ++ "ms" -- miliseconds 1e-3
@@ -118,6 +118,16 @@     where
     posf :: Double
     posf = fromIntegral pos
+    mu :: String
+-- here we assume that cairo 0.12.1 will have proper Unicode support
+#if MIN_VERSION_cairo(0,12,0) && !MIN_VERSION_cairo(0,12,1)
+    -- this version of cairo doesn't handle Unicode properly.  Thus, we do the
+    -- encoding by hand:
+    mu = "\194\181"
+#else
+    mu = "\x00b5"
+#endif
+
 
 -------------------------------------------------------------------------------
 
threadscope.cabal view
@@ -1,5 +1,5 @@ Name:                threadscope
-Version:             0.1.2
+Version:             0.1.3
 Description:         A graphical viewer for GHC eventlog traces.
 License:             BSD3
 License-file:        LICENSE
@@ -19,9 +19,10 @@   Build-Depends:     base >= 4.0 && < 5, 
                      gtk, cairo, glade,
                      binary, array, mtl, filepath,
-                     ghc-events >= 0.2 && < 0.3,
-                     containers >= 0.2 && < 0.4
-  extensions:        RecordWildCards, BangPatterns, PatternGuards
+                     ghc-events >= 0.2,
+                     containers >= 0.2 && < 0.5
+  extensions:        RecordWildCards, BangPatterns, PatternGuards,
+                     CPP
   Other-Modules:     About, 
                      CairoDrawing, 
                      EventDuration, 
@@ -51,16 +52,18 @@                      Timeline.WithViewScale,
                      Timeline.Render.Constants
 
+  ghc-options:  -Wall -fno-warn-type-defaults -fno-warn-name-shadowing
+
+  if impl(ghc >= 7.0)
+     -- GHC 7.0 and later require a flag to enable the options in ghcrts.c
+     ghc-options:  -rtsopts -fno-warn-unused-do-bind
+
   if impl(ghc < 6.12)
      -- GHC before 6.12 gave spurious warnings for RecordWildCards
-     ghc-options:  -Wall -fno-warn-unused-matches
-  else
-     ghc-options:  -Wall
+     ghc-options:  -fno-warn-unused-matches
 
   if !os(windows)
      build-depends: unix >= 2.3 && < 2.5
-
-  ghc-options:  -fno-warn-type-defaults -fno-warn-name-shadowing
 
 -- Not yet: gtk2hs doesn't support -threaded at the moment.
 --  ghc-options: -threaded