From: Rinigus Date: Tue, 5 Jul 2016 19:57:11 +0000 (+0300) Subject: adding configure check for clock boottime and monotonic X-Git-Tag: collectd-5.6.0~91^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b4415dd4b897dc69167d4a2fd0d7eba78eee1693;p=collectd.git adding configure check for clock boottime and monotonic --- 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"