output_sym "CONFIG_FDATASYNC"
output_sym "CONFIG_GETTIMEOFDAY"
output_sym "CONFIG_CLOCK_GETTIME"
+ output_sym "CONFIG_SCHED_IDLE"
echo "CC=$CC" >> $config_host_mak
echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
exit 0
fi
echo "RUSAGE_THREAD $rusage_thread"
+##########################################
+# Check whether we have SCHED_IDLE
+sched_idle="no"
+cat > $TMPC << EOF
+#include <sched.h>
+int main(int argc, char **argv)
+{
+ struct sched_param p;
+ return sched_setscheduler(0, SCHED_IDLE, &p);
+}
+EOF
+if compile_prog "" "" "SCHED_IDLE"; then
+ sched_idle="yes"
+fi
+echo "SCHED_IDLE $sched_idle"
+
#############################################################################
echo "# Automatically generated by configure - do not modify" > $config_host_mak
if test "$rusage_thread" = "yes" ; then
output_sym "CONFIG_RUSAGE_THREAD"
fi
+if test "$sched_idle" = "yes" ; then
+ output_sym "CONFIG_SCHED_IDLE"
+fi
echo "LIBS+=$LIBS" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak
ipt->cali_time = calibrate_unit(ipt->data);
/* delay to set IDLE class till now for better calibration accuracy */
-#if defined(FIO_HAVE_SCHED_IDLE)
+#if defined(CONFIG_SCHED_IDLE)
if ((retval = fio_set_sched_idle()))
log_err("fio: fio_set_sched_idle failed\n");
#else
return -1;
}
-#if defined(FIO_HAVE_CPU_AFFINITY) && defined(FIO_HAVE_SCHED_IDLE)
+#if defined(FIO_HAVE_CPU_AFFINITY) && defined(CONFIG_SCHED_IDLE)
if (strcmp("calibrate", args) == 0) {
ipc.opt = IDLE_PROF_OPT_CALI;
fio_idle_prof_init();
#define FIO_HAVE_TRIM
#define FIO_HAVE_BINJECT
#define FIO_HAVE_GETTID
-#define FIO_HAVE_SCHED_IDLE
#define FIO_USE_GENERIC_INIT_RANDOM_STATE
#ifdef MAP_HUGETLB
return errno;
}
+#ifdef CONFIG_SCHED_IDLE
static inline int fio_set_sched_idle(void)
{
struct sched_param p = { .sched_priority = 0, };
return sched_setscheduler(gettid(), SCHED_IDLE, &p);
}
+#endif
#endif
#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"