diff options
Diffstat (limited to 'testsuite/buildok')
-rwxr-xr-x | testsuite/buildok/gtod_init.stp | 13 | ||||
-rwxr-xr-x | testsuite/buildok/gtod_noinit.stp | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/buildok/gtod_init.stp b/testsuite/buildok/gtod_init.stp new file mode 100755 index 00000000..1d76aeab --- /dev/null +++ b/testsuite/buildok/gtod_init.stp @@ -0,0 +1,13 @@ +#! stap -gp4 + +# check that STAP_NEED_GETTIMEOFDAY is defined with a gettimeofday +function check() %{ +#ifndef STAP_NEED_GETTIMEOFDAY +#error "gettimeofday should define STAP_NEED_GETTIMEOFDAY!" +#endif +%} + +probe begin { + check() + println(gettimeofday_s()) +} diff --git a/testsuite/buildok/gtod_noinit.stp b/testsuite/buildok/gtod_noinit.stp new file mode 100755 index 00000000..94a9dfdc --- /dev/null +++ b/testsuite/buildok/gtod_noinit.stp @@ -0,0 +1,13 @@ +#! stap -gp4 + +# check that STAP_NEED_GETTIMEOFDAY is NOT defined without a gettimeofday +function check() %{ +#ifdef STAP_NEED_GETTIMEOFDAY +#error "STAP_NEED_GETTIMEOFDAY should not be defined!" +#endif +%} + +probe begin { + check() + println(get_cycles()) +} |