linux/tools/perf/config/feature-checks/test-timerfd.c
David Ahern 87419c9aff perf kvm: Disable live command if timerfd is not supported
If the OS does not have timerfd support (e.g., older OS'es like RHEL5)
disable perf kvm stat live.

Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1383064996-20933-2-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-11-05 10:03:22 -03:00

19 lines
299 B
C

/*
* test for timerfd functions used by perf-kvm-stat-live
*/
#include <sys/timerfd.h>
int main(void)
{
struct itimerspec new_value;
int fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
if (fd < 0)
return 1;
if (timerfd_settime(fd, 0, &new_value, NULL) != 0)
return 1;
return 0;
}