Add support for idletime profiling
[fio.git] / os / os-windows.h
index ef71dd708c56c04912f40f8d5a4c8a97f1a18370..2d57891f411bdab6debcbe587ffd0813d1a7df5d 100644 (file)
@@ -21,6 +21,7 @@
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_HAVE_GETTID
+#define FIO_HAVE_SCHED_IDLE
 #define FIO_USE_GENERIC_RAND
 
 #define FIO_PREFERRED_ENGINE           "windowsaio"
@@ -247,4 +248,11 @@ static inline int init_random_state(struct thread_data *td, unsigned long *rand_
 }
 
 
+static inline int fio_set_sched_idle(void)
+{
+       /* SetThreadPriority returns nonzero for success */
+       return (SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE))? 0 : -1;
+}
+
+
 #endif /* FIO_OS_WINDOWS_H */