arp: Allocate context memory on owner cpu.
[dragonfly.git] / test / interbench / interbench.h
blobf94ad5d92ee1b312a55945220361fd8e0f6b49f8
1 /* Interbench.h */
2 #ifndef INTERBENCH_H
3 #define INTERBENCH_H
5 extern void *hackbench_thread(void *t);
6 extern void terminal_error(const char *name);
7 extern inline void post_sem(sem_t *s);
8 extern inline void wait_sem(sem_t *s);
9 extern inline int trywait_sem(sem_t *s);
10 extern inline ssize_t Read(int fd, void *buf, size_t count);
12 #define THREADS 13 /* The total number of different loads */
14 struct sems {
15 sem_t ready;
16 sem_t start;
17 sem_t stop;
18 sem_t complete;
19 sem_t stopchild;
22 struct tk_thread {
23 struct sems sem;
24 unsigned long sleep_interval;
25 unsigned long slept_interval;
28 struct data_table {
29 unsigned long long total_latency;
30 unsigned long long sum_latency_squared;
31 unsigned long max_latency;
32 unsigned long nr_samples;
33 unsigned long deadlines_met;
34 unsigned long missed_deadlines;
35 unsigned long long missed_burns;
36 unsigned long long achieved_burns;
39 struct thread {
40 void (*name)(struct thread *);
41 char *label;
42 int bench; /* This thread is suitable for benchmarking */
43 int rtbench; /* Suitable for real time benchmarking */
44 int load; /* Suitable as a background load */
45 int rtload; /* Suitable as a background load for rt benches */
46 int nodeadlines; /* Deadlines_met are meaningless for this load */
47 unsigned long decasecond_deadlines; /* Expected deadlines / 10s */
48 pthread_t pthread;
49 pthread_t tk_pthread;
50 struct sems sem;
51 struct data_table benchmarks[THREADS + 1], *dt;
52 struct tk_thread tkthread;
53 long threadno;
55 extern struct thread hackthread;
56 #endif