Replace FIO_HAVE_RUSAGE_THREAD with RUSAGE_THREAD
authorYufei Ren <renyufei83@gmail.com>
Tue, 23 Oct 2012 01:29:37 +0000 (21:29 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Oct 2012 06:30:08 +0000 (08:30 +0200)
RUSAGE_THREAD is a more clear macro to enable getrusage() thread support.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/os-linux.h
stat.c

index 2b35f346217e88205c6022d87390ac577cb54602..9b7ff29e50af7f07d656cf3e763e7fafe409a669 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/unistd.h>
 #include <linux/raw.h>
 #include <linux/major.h>
 #include <linux/unistd.h>
 #include <linux/raw.h>
 #include <linux/major.h>
-#include <linux/version.h>
 #include <endian.h>
 
 #include "indirect.h"
 #include <endian.h>
 
 #include "indirect.h"
 #define FIO_HAVE_FALLOC_ENG
 #endif
 
 #define FIO_HAVE_FALLOC_ENG
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
-#define FIO_HAVE_RUSAGE_THREAD
-#endif
-
 #ifdef SYNC_FILE_RANGE_WAIT_BEFORE
 #define FIO_HAVE_SYNC_FILE_RANGE
 #endif
 #ifdef SYNC_FILE_RANGE_WAIT_BEFORE
 #define FIO_HAVE_SYNC_FILE_RANGE
 #endif
diff --git a/stat.c b/stat.c
index af6e1f2efe9a6864137e5600d2520f754863ae70..522901a993e89f70d6f075ac9e5c2ebd52e77eae 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -16,7 +16,7 @@ void update_rusage_stat(struct thread_data *td)
 {
        struct thread_stat *ts = &td->ts;
 
 {
        struct thread_stat *ts = &td->ts;
 
-#ifdef FIO_HAVE_RUSAGE_THREAD
+#ifdef RUSAGE_THREAD
        getrusage(RUSAGE_THREAD, &td->ru_end);
 #else
        getrusage(RUSAGE_SELF, &td->ru_end);
        getrusage(RUSAGE_THREAD, &td->ru_end);
 #else
        getrusage(RUSAGE_SELF, &td->ru_end);