| 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 | enum instrum_type itype { |
| 15 | INSTRUM_TRACEPOINTS, |
| 16 | }; |
| 17 | |
| 18 | /* |
| 19 | * ltt_event structure is referred to by the tracing fast path. It must be |
| 20 | * kept small. |
| 21 | */ |
| 22 | struct ltt_event { |
| 23 | unsigned int id; |
| 24 | struct ltt_channel *chan; |
| 25 | void *probe; |
| 26 | void *filter; |
| 27 | char *name; |
| 28 | enum instrum_type itype; |
| 29 | struct list_head list; /* Event list */ |
| 30 | }; |
| 31 | |
| 32 | struct ltt_channel { |
| 33 | struct channel *chan; /* Channel buffers */ |
| 34 | /* Event ID management */ |
| 35 | struct ltt_session *session; |
| 36 | unsigned int free_event_id; /* Next event ID to allocate */ |
| 37 | struct list_head list; /* Channel list */ |
| 38 | char name[PATH_MAX]; |
| 39 | }; |
| 40 | |
| 41 | struct ltt_session { |
| 42 | int active; /* Is trace session active ? */ |
| 43 | struct list_head chan; /* Channel list head */ |
| 44 | struct list_head events; /* Event list head */ |
| 45 | struct list_head list; /* Session list */ |
| 46 | char name[PATH_MAX]; |
| 47 | }; |
| 48 | |
| 49 | struct ltt_session *ltt_session_create(void); |
| 50 | int ltt_session_destroy(struct ltt_session *session); |
| 51 | |
| 52 | struct ltt_channel *ltt_channel_create(struct ltt_session *session, |
| 53 | int overwrite, void *buf_addr, |
| 54 | size_t subbuf_size, size_t num_subbuf, |
| 55 | unsigned int switch_timer_interval, |
| 56 | unsigned int read_timer_interval); |
| 57 | int _ltt_channel_destroy(struct ltt_channel *chan); |
| 58 | |
| 59 | struct ltt_event *ltt_event_create(struct ltt_channel *chan, char *name, |
| 60 | void *filter); |
| 61 | int _ltt_event_destroy(struct ltt_event *event); |