From d4f10e9cc72aed9d9bc4e96690eadc066a253c54 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 4 Dec 2006 18:45:01 +0000 Subject: [PATCH] improve sigar_thread_cpu_get resolution --- src/os/linux/linux_sigar.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index 92de6f20..6bbdc2eb 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -1036,9 +1036,6 @@ int sigar_proc_modules_get(sigar_t *sigar, sigar_pid_t pid, return SIGAR_OK; } -#define TIME_NSEC(t) \ - SIGAR_SEC2NANO(SIGAR_TICK2SEC(((sigar_uint64_t)(t)))) - int sigar_thread_cpu_get(sigar_t *sigar, sigar_uint64_t id, sigar_thread_cpu_t *cpu) @@ -1051,9 +1048,9 @@ int sigar_thread_cpu_get(sigar_t *sigar, times(&now); - cpu->user = TIME_NSEC(now.tms_utime); - cpu->sys = TIME_NSEC(now.tms_stime); - cpu->total = TIME_NSEC(now.tms_utime + now.tms_stime); + cpu->user = SIGAR_TICK2NSEC(now.tms_utime); + cpu->sys = SIGAR_TICK2NSEC(now.tms_stime); + cpu->total = SIGAR_TICK2NSEC(now.tms_utime + now.tms_stime); return SIGAR_OK; }