From b4415dd4b897dc69167d4a2fd0d7eba78eee1693 Mon Sep 17 00:00:00 2001 From: Rinigus Date: Tue, 5 Jul 2016 22:57:11 +0300 Subject: [PATCH] adding configure check for clock boottime and monotonic --- configure.ac | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2a4d98d2..8be837f9 100644 --- a/configure.ac +++ b/configure.ac @@ -735,6 +735,23 @@ AC_CHECK_HEADERS(net/pfvar.h, have_termios_h="no" AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) +# For cpusleep plugin +AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported], + [c_cv_have_clock_boottime_monotonic], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +]]], +[[[ + struct timespec b, m; + clock_gettime(CLOCK_BOOTTIME, &b ); + clock_gettime(CLOCK_MONOTONIC, &m ); +]]] + )], + [c_cv_have_clock_boottime_monotonic="yes"], + [c_cv_have_clock_boottime_monotonic="no"])) + + # For the turbostat plugin have_asm_msrindex_h="no" AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"]) @@ -5491,7 +5508,6 @@ then plugin_contextswitch="yes" plugin_cpu="yes" plugin_cpufreq="yes" - plugin_cpusleep="yes" plugin_disk="yes" plugin_drbd="yes" plugin_entropy="yes" @@ -5525,6 +5541,11 @@ then then plugin_turbostat="yes" fi + + if test "x$c_cv_have_clock_boottime_monotonic" = "xyes" + then + plugin_cpusleep="yes" + fi fi if test "x$ac_system" = "xOpenBSD" -- 2.11.0