Hello community, here is the log from the commit of package ghc-clock for openSUSE:Factory checked in at 2016-01-08 15:23:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-clock (Old) and /work/SRC/openSUSE:Factory/.ghc-clock.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-clock" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-clock/ghc-clock.changes 2015-08-23 17:38:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-clock.new/ghc-clock.changes 2016-01-08 15:23:10.000000000 +0100 @@ -1,0 +2,10 @@ +Mon Dec 21 09:09:09 UTC 2015 - [email protected] + +- update to 0.6.0.1 + +------------------------------------------------------------------- +Thu Dec 17 10:36:50 UTC 2015 - [email protected] + +- update to 0.5.2 + +------------------------------------------------------------------- Old: ---- clock-0.5.1.tar.gz New: ---- clock-0.6.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-clock.spec ++++++ --- /var/tmp/diff_new_pack.F87mha/_old 2016-01-08 15:23:10.000000000 +0100 +++ /var/tmp/diff_new_pack.F87mha/_new 2016-01-08 15:23:10.000000000 +0100 @@ -19,7 +19,7 @@ %global pkg_name clock Name: ghc-clock -Version: 0.5.1 +Version: 0.6.0.1 Release: 0 Summary: High-resolution clock functions: monotonic, realtime, cputime License: BSD-3-Clause ++++++ clock-0.5.1.tar.gz -> clock-0.6.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clock-0.5.1/System/Clock.hsc new/clock-0.6.0.1/System/Clock.hsc --- old/clock-0.5.1/System/Clock.hsc 2015-06-28 01:57:26.000000000 +0200 +++ new/clock-0.6.0.1/System/Clock.hsc 2015-12-15 12:42:48.000000000 +0100 @@ -43,8 +43,10 @@ -- | Clock types. A clock may be system-wide (that is, visible to all processes) -- or per-process (measuring time that is meaningful only within a process). --- All implementations shall support CLOCK_REALTIME. +-- All implementations shall support CLOCK_REALTIME. (The only suspend-aware +-- monotonic is CLOCK_BOOTTIME on Linux.) data Clock + -- | The identifier for the system-wide monotonic clock, which is defined as -- a clock measuring real time, whose value cannot be set via -- @clock_settime@ and which cannot have negative clock jumps. The maximum @@ -57,18 +59,52 @@ -- thus there is no need to set it. Furthermore, realtime applications can -- rely on the fact that the value of this clock is never set. = Monotonic + -- | The identifier of the system-wide clock measuring real time. For this -- clock, the value returned by getTime represents the amount of time (in -- seconds and nanoseconds) since the Epoch. | Realtime + -- | The identifier of the CPU-time clock associated with the calling -- process. For this clock, the value returned by getTime represents the -- amount of execution time of the current process. | ProcessCPUTime - -- | The identifier of the CPU-time clock associated with the calling OS - -- thread. For this clock, the value returned by getTime represents the - -- amount of execution time of the current OS thread. + + -- | The identifier of the CPU-time clock associated with the calling OS + -- thread. For this clock, the value returned by getTime represents the + -- amount of execution time of the current OS thread. | ThreadCPUTime + +#if defined (linux_HOST_OS) + + -- | (since Linux 2.6.28; Linux-specific) + -- Similar to CLOCK_MONOTONIC, but provides access to a + -- raw hardware-based time that is not subject to NTP + -- adjustments or the incremental adjustments performed by + -- adjtime(3). + | MonotonicRaw + + -- | (since Linux 2.6.39; Linux-specific) + -- Identical to CLOCK_MONOTONIC, except it also includes + -- any time that the system is suspended. This allows + -- applications to get a suspend-aware monotonic clock + -- without having to deal with the complications of + -- CLOCK_REALTIME, which may have discontinuities if the + -- time is changed using settimeofday(2). + | Boottime + + -- | (since Linux 2.6.32; Linux-specific) + -- A faster but less precise version of CLOCK_MONOTONIC. + -- Use when you need very fast, but not fine-grained timestamps. + | MonotonicCoarse + + -- | (since Linux 2.6.32; Linux-specific) + -- A faster but less precise version of CLOCK_REALTIME. + -- Use when you need very fast, but not fine-grained timestamps. + | RealtimeCoarse + +#endif + deriving (Eq, Enum, Generic, Read, Show, Typeable) #if defined(_WIN32) @@ -92,15 +128,21 @@ #elif defined(__MACH__) && defined(__APPLE__) clockToConst :: Clock -> #{type clock_id_t} clockToConst Monotonic = #const SYSTEM_CLOCK -clockToConst Realtime = #const CALENDAR_CLOCK +clockToConst Realtime = #const CALENDAR_CLOCK clockToConst ProcessCPUTime = #const SYSTEM_CLOCK -clockToConst ThreadCPUTime = #const SYSTEM_CLOCK +clockToConst ThreadCPUTime = #const SYSTEM_CLOCK #else clockToConst :: Clock -> #{type clockid_t} clockToConst Monotonic = #const CLOCK_MONOTONIC -clockToConst Realtime = #const CLOCK_REALTIME +clockToConst Realtime = #const CLOCK_REALTIME clockToConst ProcessCPUTime = #const CLOCK_PROCESS_CPUTIME_ID -clockToConst ThreadCPUTime = #const CLOCK_THREAD_CPUTIME_ID +clockToConst ThreadCPUTime = #const CLOCK_THREAD_CPUTIME_ID +#if defined (linux_HOST_OS) +clockToConst MonotonicRaw = #const CLOCK_MONOTONIC_RAW +clockToConst Boottime = #const CLOCK_BOOTTIME +clockToConst MonotonicCoarse = #const CLOCK_MONOTONIC_COARSE +clockToConst RealtimeCoarse = #const CLOCK_REALTIME_COARSE +#endif #endif allocaAndPeek :: Storable a => (Ptr a -> IO ()) -> IO a @@ -170,57 +212,36 @@ #endif normalize :: TimeSpec -> TimeSpec -normalize (TimeSpec xs xn) - | xn < 0 || xn >= 10^9 = - let (q, r) = xn `divMod` (10^9) - in TimeSpec (xs + q) r - | otherwise = TimeSpec xs xn +normalize (TimeSpec xs xn) | xn < 0 || xn >= 10^9 = TimeSpec (xs + q) r + | otherwise = TimeSpec xs xn + where (q, r) = xn `divMod` (10^9) instance Num TimeSpec where - (TimeSpec xs xn) + (TimeSpec ys yn) = - normalize $ TimeSpec (xs + ys) (xn + yn) - (TimeSpec xs xn) - (TimeSpec ys yn) = - normalize $ TimeSpec (xs - ys) (xn - yn) - (normalize -> TimeSpec xs xn) * (normalize -> TimeSpec ys yn) = - let - -- convert to arbitraty Integer type to avoid int overflow - xsi = toInteger xs - xni = toInteger xn - ysi = toInteger ys - yni = toInteger yn - in - normalize $ TimeSpec - -- seconds - (fromInteger $ xsi * ysi) - -- nanoseconds - (fromInteger $ (xni * yni + (xni * ysi + xsi * yni) * (10^9)) - `div` (10^9)) + (TimeSpec xs xn) + (TimeSpec ys yn) = normalize $! TimeSpec (xs + ys) (xn + yn) + (TimeSpec xs xn) - (TimeSpec ys yn) = normalize $! TimeSpec (xs - ys) (xn - yn) + (TimeSpec xs xn) * (TimeSpec ys yn) = + let xsi = toInteger xs -- convert to arbitraty Integer type to avoid int overflow + xni = toInteger xn + ysi = toInteger ys + yni = toInteger yn -- seconds -- nanoseconds + in normalize $! TimeSpec (fromInteger $! xsi * ysi) (fromInteger $! (xni * yni + (xni * ysi + xsi * yni) * (10^9)) `div` (10^9)) negate (TimeSpec xs xn) = normalize $ TimeSpec (negate xs) (negate xn) - abs (normalize -> TimeSpec xs xn) - | xs == 0 = normalize $ TimeSpec 0 xn - | otherwise = normalize $ TimeSpec (abs xs) (signum xs * xn) - signum (normalize -> TimeSpec xs xn) - | xs == 0 = TimeSpec (signum xn) 0 - | otherwise = TimeSpec (signum xs) 0 - fromInteger x = - -- For range, compute div, mod over integers, not any bounded type. - let (q, r) = x `divMod` (10^9) - in TimeSpec (fromInteger q) (fromInteger r) + abs (normalize -> TimeSpec xs xn) | xs == 0 = normalize $! TimeSpec 0 xn + | otherwise = normalize $! TimeSpec (abs xs) (signum xs * xn) + signum (normalize -> TimeSpec xs xn) | xs == 0 = TimeSpec (signum xn) 0 + | otherwise = TimeSpec (signum xs) 0 +--fromInteger x = TimeSpec (fromInteger q) (fromInteger r) where (q, r) = x `divMod` (10^9) instance Eq TimeSpec where - (normalize -> TimeSpec xs xn) == (normalize -> TimeSpec ys yn) - | True == equality = xn == yn - | otherwise = equality - where - equality = xs == ys + (normalize -> TimeSpec xs xn) == (normalize -> TimeSpec ys yn) | True == es = xn == yn + | otherwise = es + where es = xs == ys instance Ord TimeSpec where - compare (normalize -> TimeSpec xs xn) (normalize -> TimeSpec ys yn) - | EQ == ordering = compare xn yn - | otherwise = ordering - where - ordering = compare xs ys + compare (normalize -> TimeSpec xs xn) (normalize -> TimeSpec ys yn) | EQ == os = compare xn yn + | otherwise = os + where os = compare xs ys -- | Compute the absolute difference. diffTimeSpec :: TimeSpec -> TimeSpec -> TimeSpec @@ -228,4 +249,4 @@ -- | TimeSpec as nano seconds. timeSpecAsNanoSecs :: TimeSpec -> Integer -timeSpecAsNanoSecs t = toInteger (sec t) * (10^9) + toInteger (nsec t) +timeSpecAsNanoSecs t = toInteger (sec t) * (10^9) + toInteger (nsec t) \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clock-0.5.1/clock.cabal new/clock-0.6.0.1/clock.cabal --- old/clock-0.5.1/clock.cabal 2015-06-28 01:57:26.000000000 +0200 +++ new/clock-0.6.0.1/clock.cabal 2015-12-15 12:42:48.000000000 +0100 @@ -1,5 +1,5 @@ name: clock -version: 0.5.1 +version: 0.6.0.1 stability: stable synopsis: High-resolution clock functions: monotonic, realtime, cputime. description: A package for convenient access to high-resolution clock and @@ -25,12 +25,16 @@ . Unit tests and instance fixes by Christian Burger on 2015-06-25. . + Removal of fromInteger : Integer -> TimeSpec by Cetin Sert on 2015-12-15. + . + New Linux-specific Clocks: MonotonicRaw, Boottime, MonotonicCoarse, RealtimeCoarse by Cetin Sert on 2015-12-15. + . [Version Scheme] Major-@/R/@-ewrite . New-@/F/@-unctionality . @/I/@-mprovementAndBugFixes . @/P/@-ackagingOnly . * @PackagingOnly@ changes are made for quality assurance reasons. -copyright: Copyright © Cetin Sert 2009-2013, Eugene Kirpichov 2010, Finn Espen Gundersen 2013, Gerolf Seitz 2013, Mathieu Boespflug 2014 2015, Chris Done 2015, Dimitri Sabadie 2015, Christian Burger 2015 +copyright: Copyright © Cetin Sert 2009-2016, Eugene Kirpichov 2010, Finn Espen Gundersen 2013, Gerolf Seitz 2013, Mathieu Boespflug 2014 2015, Chris Done 2015, Dimitri Sabadie 2015, Christian Burger 2015 license: BSD3 license-file: LICENSE author: Cetin Sert <[email protected]>, Corsis Research @@ -67,7 +71,7 @@ if os(windows) c-sources: cbits/hs_clock_win32.c include-dirs: cbits - ghc-options: -O2 -Wall + ghc-options: -O3 -Wall if flag(llvm) ghc-options: -fllvm -optlo-O3
