7 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * Holds LTTng per-session event registry.
12 #include <linux/list.h>
13 #include "ltt-debugfs-abi.h"
19 * ltt_event structure is referred to by the tracing fast path. It must be
24 struct ltt_channel
*chan
;
28 enum instrum_type itype
;
29 struct list_head list
; /* Event list */
32 struct ltt_channel_ops
{
33 struct channel
*(*channel_create
)(const char *name
,
34 struct ltt_session
*session
,
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
);
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
;
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 */
63 struct ltt_transport
{
66 struct list_head node
;
67 struct ltt_channel_ops ops
;
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
);
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
);
82 struct ltt_event
*ltt_event_create(struct ltt_channel
*chan
,
84 enum instrum_type itype
,
85 void *probe
, void *filter
);
86 int _ltt_event_destroy(struct ltt_event
*event
);
88 void ltt_transport_register(struct ltt_transport
*transport
);
89 void ltt_transport_unregister(struct ltt_transport
*transport
);
91 #endif /* _LTT_EVENTS_H */