4 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * Holds LTTng per-session event registry.
9 #include <linux/list.h>
14 enum instrum_type itype
{
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 */
33 struct channel
*chan
; /* Channel buffers */
34 /* Event ID management */
35 struct ltt_session
*session
;
36 struct file
*file
; /* File associated to channel */
37 unsigned int free_event_id
; /* Next event ID to allocate */
38 struct list_head list
; /* Channel list */
39 wait_queue_head_t notify_wait
; /* Channel addition notif. waitqueue */
43 int active
; /* Is trace session active ? */
44 struct file
*file
; /* File associated to session */
45 struct list_head chan
; /* Channel list head */
46 struct list_head events
; /* Event list head */
47 struct list_head list
; /* Session list */
50 struct ltt_trace_ops
{
51 struct channel
*(*channel_create
)(const char *name
,
52 struct ltt_trace
*trace
,
54 size_t subbuf_size
, size_t num_subbuf
,
55 unsigned int switch_timer_interval
,
56 unsigned int read_timer_interval
);
57 void (*channel_destroy
)(struct channel
*chan
);
58 struct lib_ring_buffer
*(*buffer_read_open
)(struct channel
*chan
);
59 struct lib_ring_buffer
*(*buffer_read_close
)(struct lib_ring_buffer
*buf
);
62 struct ltt_transport
{
65 struct list_head node
;
66 struct ltt_trace_ops ops
;
69 struct ltt_session
*ltt_session_create(void);
70 int ltt_session_start(struct ltt_session
*session
);
71 int ltt_session_stop(struct ltt_session
*session
);
72 int ltt_session_destroy(struct ltt_session
*session
);
74 struct ltt_channel
*ltt_channel_create(struct ltt_session
*session
,
75 int overwrite
, void *buf_addr
,
76 size_t subbuf_size
, size_t num_subbuf
,
77 unsigned int switch_timer_interval
,
78 unsigned int read_timer_interval
);
79 int _ltt_channel_destroy(struct ltt_channel
*chan
);
81 struct ltt_event
*ltt_event_create(struct ltt_channel
*chan
,
82 enum instrum_type itype
,
85 int _ltt_event_destroy(struct ltt_event
*event
);
87 void ltt_transport_register(struct ltt_transport
*transport
);
88 void ltt_transport_unregister(struct ltt_transport
*transport
);