File: timer.h

package info (click to toggle)
systemtap 5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 47,964 kB
  • sloc: cpp: 80,838; ansic: 54,757; xml: 49,725; exp: 43,665; sh: 11,527; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (46 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* -*- linux-c -*- 
 * Kernel Timer Functions
 * Copyright (C) 2012 Red Hat Inc.
 *
 * This file is part of systemtap, and is free software.  You can
 * redistribute it and/or modify it under the terms of the GNU General
 * Public License (GPL); either version 2, or (at your option) any
 * later version.
 */

#ifndef _LINUX_TIMER_H_
#define _LINUX_TIMER_H_

// If we're on kernels < 2.6.17, then hrtimers are not supported.
#include <linux/hrtimer.h>

static unsigned long stap_hrtimer_resolution = 0;

struct stap_hrtimer_probe {
	struct hrtimer hrtimer;
	const struct stap_probe * probe;
	int64_t intrv;
	int64_t rnd;
	unsigned enabled;
};

// The function signature changed in 2.6.21.
#ifdef STAPCONF_HRTIMER_REL
typedef int hrtimer_return_t;
#else
typedef enum hrtimer_restart hrtimer_return_t;
#endif


// autoconf: add get/set expires if missing (pre 2.6.28-rc1)
#ifndef STAPCONF_HRTIMER_GETSET_EXPIRES
#define hrtimer_get_expires(timer) ((timer)->expires)
#define hrtimer_set_expires(timer, time) (void)((timer)->expires = (time))
#endif

// autoconf: adapt to HRTIMER_REL -> HRTIMER_MODE_REL renaming near 2.6.21
#ifdef STAPCONF_HRTIMER_REL
#define HRTIMER_MODE_REL HRTIMER_REL
#endif

#endif /* _LINUX_TIMER_H_ */