X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Fhello2%2Fhello2.c;fp=tests%2Fhello2%2Fhello2.c;h=5e7383e5fa5dbbd9789e4c1400c70f752f6608c8;hb=09dcbc3d4aac11ca707228eef9ad56295eeca0f8;hp=836df53c7acb4d899c14954b3b151ba485d88e89;hpb=d6355fb2296dad2a7523630a3ab2cb7ff287d969;p=ust.git diff --git a/tests/hello2/hello2.c b/tests/hello2/hello2.c index 836df53..5e7383e 100644 --- a/tests/hello2/hello2.c +++ b/tests/hello2/hello2.c @@ -1,18 +1,27 @@ #include -#include +#include +#include + #include "marker.h" int main() { int i; + struct timespec tv; + struct timespec rem; + int result; + + tv.tv_sec = 1; + tv.tv_nsec = 0; -// sleep(1); + do { + result = nanosleep(&tv, &tv); + } while(result == -1 && errno == EINTR); printf("Hello, World!\n"); for(i=0; i<500; i++) { trace_mark(ust, bar, "str %d", i); trace_mark(ust, bar2, "number1 %d number2 %d", (int)53, (int)9800); - usleep(20); } return 0;