Compilation fixes
[lttng-modules.git] / ltt-events.h
1 #ifndef _LTT_EVENTS_H
2 #define _LTT_EVENTS_H
3
4 /*
5 * ltt-events.h
6 *
7 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * Holds LTTng per-session event registry.
10 */
11
12 #include <linux/list.h>
13 #include "ltt-debugfs-abi.h"
14
15 struct ltt_channel;
16 struct ltt_session;
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_ops {
33 struct channel *(*channel_create)(const char *name,
34 struct ltt_session *session,
35 void *buf_addr,
36 size_t subbuf_size, size_t num_subbuf,
37 unsigned int switch_timer_interval,
38 unsigned int read_timer_interval);
39 void (*channel_destroy)(struct channel *chan);
40 struct lib_ring_buffer *(*buffer_read_open)(struct channel *chan);
41 struct lib_ring_buffer *(*buffer_read_close)(struct lib_ring_buffer *buf);
42 };
43
44 struct ltt_channel {
45 struct channel *chan; /* Channel buffers */
46 /* Event ID management */
47 struct ltt_session *session;
48 struct file *file; /* File associated to channel */
49 unsigned int free_event_id; /* Next event ID to allocate */
50 struct list_head list; /* Channel list */
51 wait_queue_head_t notify_wait; /* Channel addition notif. waitqueue */
52 struct ltt_channel_ops *ops;
53 };
54
55 struct ltt_session {
56 int active; /* Is trace session active ? */
57 struct file *file; /* File associated to session */
58 struct list_head chan; /* Channel list head */
59 struct list_head events; /* Event list head */
60 struct list_head list; /* Session list */
61 };
62
63 struct ltt_transport {
64 char *name;
65 struct module *owner;
66 struct list_head node;
67 struct ltt_channel_ops ops;
68 };
69
70 struct ltt_session *ltt_session_create(void);
71 int ltt_session_start(struct ltt_session *session);
72 int ltt_session_stop(struct ltt_session *session);
73 void ltt_session_destroy(struct ltt_session *session);
74
75 struct ltt_channel *ltt_channel_create(struct ltt_session *session,
76 int overwrite, void *buf_addr,
77 size_t subbuf_size, size_t num_subbuf,
78 unsigned int switch_timer_interval,
79 unsigned int read_timer_interval);
80 void _ltt_channel_destroy(struct ltt_channel *chan);
81
82 struct ltt_event *ltt_event_create(struct ltt_channel *chan,
83 char *name,
84 enum instrum_type itype,
85 void *probe, void *filter);
86 int _ltt_event_destroy(struct ltt_event *event);
87
88 void ltt_transport_register(struct ltt_transport *transport);
89 void ltt_transport_unregister(struct ltt_transport *transport);
90
91 #endif /* _LTT_EVENTS_H */
This page took 0.033404 seconds and 4 git commands to generate.