[commit: ghc] master: rts: delint/detab/dewhitespace GetTime.c (cebd37f)
git at git.haskell.org
git at git.haskell.org
Mon Jul 28 14:34:50 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/cebd37f31bccd1f8038132a69a133b44b9b13648/ghc
>---------------------------------------------------------------
commit cebd37f31bccd1f8038132a69a133b44b9b13648
Author: Austin Seipp <austin at well-typed.com>
Date: Mon Jul 21 10:31:15 2014 -0500
rts: delint/detab/dewhitespace GetTime.c
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
cebd37f31bccd1f8038132a69a133b44b9b13648
rts/posix/GetTime.c | 43 +++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/rts/posix/GetTime.c b/rts/posix/GetTime.c
index 380e229..3e0e1ca 100644
--- a/rts/posix/GetTime.c
+++ b/rts/posix/GetTime.c
@@ -50,7 +50,11 @@ void initializeTimer()
Time getProcessCPUTime(void)
{
-#if !defined(BE_CONSERVATIVE) && defined(HAVE_CLOCK_GETTIME) && defined (_SC_CPUTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(HAVE_SYSCONF)
+#if !defined(BE_CONSERVATIVE) && \
+ defined(HAVE_CLOCK_GETTIME) && \
+ defined(_SC_CPUTIME) && \
+ defined(CLOCK_PROCESS_CPUTIME_ID) && \
+ defined(HAVE_SYSCONF)
static int checked_sysconf = 0;
static int sysconf_result = 0;
@@ -129,7 +133,7 @@ Time getProcessCPUTime(void)
#if !defined(THREADED_RTS) && USE_PAPI
long long usec;
if ((usec = PAPI_get_virt_usec()) < 0) {
- barf("PAPI_get_virt_usec: %lld", usec);
+ barf("PAPI_get_virt_usec: %lld", usec);
}
return USToTime(usec);
#else
@@ -152,22 +156,22 @@ void getProcessTimes(Time *user, Time *elapsed)
if (ClockFreq == 0) {
#if defined(HAVE_SYSCONF)
- long ticks;
- ticks = sysconf(_SC_CLK_TCK);
- if ( ticks == -1 ) {
- sysErrorBelch("sysconf");
- stg_exit(EXIT_FAILURE);
- }
- ClockFreq = ticks;
-#elif defined(CLK_TCK) /* defined by POSIX */
- ClockFreq = CLK_TCK;
+ long ticks;
+ ticks = sysconf(_SC_CLK_TCK);
+ if ( ticks == -1 ) {
+ sysErrorBelch("sysconf");
+ stg_exit(EXIT_FAILURE);
+ }
+ ClockFreq = ticks;
+#elif defined(CLK_TCK) /* defined by POSIX */
+ ClockFreq = CLK_TCK;
#elif defined(HZ)
- ClockFreq = HZ;
+ ClockFreq = HZ;
#elif defined(CLOCKS_PER_SEC)
- ClockFreq = CLOCKS_PER_SEC;
+ ClockFreq = CLOCKS_PER_SEC;
#else
- errorBelch("can't get clock resolution");
- stg_exit(EXIT_FAILURE);
+ errorBelch("can't get clock resolution");
+ stg_exit(EXIT_FAILURE);
#endif
}
@@ -184,11 +188,15 @@ Time getThreadCPUTime(void)
#if USE_PAPI
long long usec;
if ((usec = PAPI_get_virt_usec()) < 0) {
- barf("PAPI_get_virt_usec: %lld", usec);
+ barf("PAPI_get_virt_usec: %lld", usec);
}
return USToTime(usec);
-#elif !defined(BE_CONSERVATIVE) && defined(HAVE_CLOCK_GETTIME) && defined (_SC_THREAD_CPUTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(HAVE_SYSCONF)
+#elif !defined(BE_CONSERVATIVE) && \
+ defined(HAVE_CLOCK_GETTIME) && \
+ defined(_SC_CPUTIME) && \
+ defined(CLOCK_PROCESS_CPUTIME_ID) && \
+ defined(HAVE_SYSCONF)
{
static int checked_sysconf = 0;
static int sysconf_result = 0;
@@ -239,4 +247,3 @@ getPageFaults(void)
return(t.ru_majflt);
#endif
}
-
More information about the ghc-commits
mailing list