File: timer.c

package info (click to toggle)
systemtap 1.2-5%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,972 kB
  • ctags: 7,842
  • sloc: ansic: 35,121; cpp: 29,336; exp: 7,535; xml: 6,878; sh: 6,719; perl: 2,067; tcl: 821; makefile: 545; python: 473; ruby: 419
file content (32 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* COVERAGE: timer_create timer_gettime timer_settime timer_getoverrun timer_delete */
#include <sys/types.h>
#include <unistd.h>
#include <sys/time.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <sys/syscall.h>

int main()
{
  timer_t tid=0;
  struct itimerspec val, oval;

  syscall(SYS_timer_create, CLOCK_REALTIME, NULL, &tid);
  //staptest// timer_create (CLOCK_REALTIME, 0x[0]+, XXXX)

  syscall(SYS_timer_gettime, tid, &val);
  //staptest// timer_gettime (NNNN, XXXX)

  syscall(SYS_timer_settime, 0, tid, &val, &oval);
  //staptest// timer_settime (0, NNNN, \[0.000000,0.000000\], XXXX)

  syscall(SYS_timer_getoverrun, tid);
  //staptest// timer_getoverrun (NNNN)

  syscall(SYS_timer_delete, tid);
  //staptest// timer_delete (NNNN)

  return 0;
}