-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser.h
59 lines (47 loc) · 990 Bytes
/
user.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef __USER__H__
#define __USER__H__
#include "ylog.h"
/*
*===========================
* User defined section
* data structures and callback functions
*==========================
*/
struct time_trace {
uint64_t start;
uint64_t end;
};
struct user_defined_struct {
int i;
int j;
};
void
user_record_fn(struct user_defined_struct *uds, int i, int j)
{
uds->i = i;
uds->j = j;
}
void
user_view_fn(void *arg)
{
struct user_defined_struct *u = (struct user_defined_struct *)arg;
SET_USER_CONTENT_STRING("i is %d\nj is %d\n", u->i, u->j);
}
void
time_view_fn(void *arg)
{
struct time_trace *t = (struct time_trace *)arg;
SET_USER_CONTENT_STRING("start time stamp %ld\n\
\rend time stamp %ld\n", t->start, t->end);
}
int
user_trigger_fn(void *arg)
{
struct user_defined_struct *s = (struct user_defined_struct *)arg;
if (s->i == 1000) {
return 1;
} else {
return 0;
}
}
#endif