From b457837f2844972a59df3ed8718415cdefb96da8 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 29 Mar 2007 20:40:54 +0000 Subject: [PATCH] Fix cpu ticks to msec on linux/ia64 Submitted by: Jan Kneschke --- ChangeLog | 5 +++++ include/sigar_private.h | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba0f860b..532dbb72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-29 Doug MacEachern + + * Fix cpu ticks to msec on linux/ia64 + Submitted by: Jan Kneschke + 2007-03-24 Doug MacEachern * Implement proc_state_t.threads on OS X diff --git a/include/sigar_private.h b/include/sigar_private.h index 97994b78..36756502 100644 --- a/include/sigar_private.h +++ b/include/sigar_private.h @@ -118,8 +118,11 @@ ((sigar_uint64_t)(s) * (sigar_uint64_t)SIGAR_NSEC) /* cpu ticks to milliseconds */ -#define SIGAR_TICK2MSEC(s) ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_MSEC / sigar->ticks)) -#define SIGAR_TICK2NSEC(s) ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_NSEC / sigar->ticks)) +#define SIGAR_TICK2MSEC(s) \ + ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_MSEC / (double)sigar->ticks)) + +#define SIGAR_TICK2NSEC(s) \ + ((sigar_uint64_t)(s) * ((sigar_uint64_t)SIGAR_NSEC / (double)sigar->ticks)) #define IFTYPE_LO 2 #define IFTYPE_ETH 3