Commit | Line | Data |
---|---|---|
4e3c1b9b MD |
1 | /* |
2 | * ltt-events.h | |
3 | * | |
4 | * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
5 | * | |
6 | * Holds LTTng per-session event registry. | |
7 | */ | |
8 | ||
9 | #include <linux/list.h> | |
10 | ||
11 | struct ltt_channel; | |
12 | struct ltt_session; | |
13 | ||
14 | /* | |
15 | * ltt_event structure is referred to by the tracing fast path. It must be | |
16 | * kept small. | |
17 | */ | |
18 | struct ltt_event { | |
19 | unsigned int id; | |
20 | struct ltt_channel *chan; | |
21 | void *filter; | |
22 | char *name; | |
23 | struct list_head list; /* Event list */ | |
24 | }; | |
25 | ||
26 | struct ltt_channel { | |
27 | struct channel *chan; /* Channel buffers */ | |
28 | /* Event ID management */ | |
29 | struct ltt_session *session; | |
e5382b6d | 30 | unsigned int free_event_id; /* Next event ID to allocate */ |
4e3c1b9b MD |
31 | struct list_head list; /* Channel list */ |
32 | char name[PATH_MAX]; | |
33 | }; | |
34 | ||
35 | struct ltt_session { | |
e5382b6d | 36 | int active; /* Is trace session active ? */ |
4e3c1b9b MD |
37 | struct list_head chan; /* Channel list head */ |
38 | struct list_head events; /* Event list head */ | |
39 | struct list_head list; /* Session list */ | |
40 | char name[PATH_MAX]; | |
41 | }; | |
42 | ||
43 | struct ltt_session *ltt_session_create(char *name); | |
44 | int ltt_session_destroy(struct ltt_session *session); | |
45 | ||
46 | struct ltt_channel *ltt_channel_create(struct ltt_session *session, char *name, | |
47 | int overwrite, void *buf_addr, | |
48 | size_t subbuf_size, size_t num_subbuf, | |
49 | unsigned int switch_timer_interval, | |
50 | unsigned int read_timer_interval); | |
51 | int _ltt_channel_destroy(struct ltt_channel *chan); | |
52 | ||
53 | struct ltt_event *ltt_event_create(struct ltt_channel *chan, char *name, | |
54 | void *filter); | |
55 | int _ltt_event_destroy(struct ltt_event *event); |