2 * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; only version 2
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef _LTTNG_UST_CTL_H
21 #define _LTTNG_UST_CTL_H
23 #include <ust/lttng-ust-abi.h>
26 * Tracer channel attributes.
28 struct lttng_ust_channel_attr
{
29 int overwrite
; /* 1: overwrite, 0: discard */
30 uint64_t subbuf_size
; /* bytes */
31 uint64_t num_subbuf
; /* power of 2 */
32 unsigned int switch_timer_interval
; /* usec */
33 unsigned int read_timer_interval
; /* usec */
34 enum lttng_ust_output output
; /* splice, mmap */
41 uint64_t memory_map_size
;
44 int ustctl_register_done(int sock
);
45 int ustctl_create_session(int sock
);
46 int ustctl_open_metadata(int sock
, int session_handle
,
47 struct lttng_ust_channel_attr
*chops
,
48 struct object_data
**metadata_data
);
49 int ustctl_create_channel(int sock
, int session_handle
,
50 struct lttng_ust_channel_attr
*chops
,
51 struct object_data
**channel_data
);
52 int ustctl_create_stream(int sock
, struct object_data
*channel_data
,
53 struct object_data
**stream_data
);
54 int ustctl_create_event(int sock
, struct lttng_ust_event
*ev
,
55 struct object_data
*channel_data
,
56 struct object_data
**event_data
);
57 int ustctl_add_context(int sock
, struct lttng_ust_context
*ctx
,
58 struct object_data
*obj_data
,
59 struct object_data
**context_data
);
61 int ustctl_enable(int sock
, struct object_data
*object
);
62 int ustctl_disable(int sock
, struct object_data
*object
);
63 int ustctl_start_session(int sock
, int handle
);
64 int ustctl_stop_session(int sock
, int handle
);
66 int ustctl_tracepoint_list(int sock
); /* not implemented yet */
67 int ustctl_tracer_version(int sock
, struct lttng_ust_tracer_version
*v
);
68 int ustctl_wait_quiescent(int sock
);
70 /* Flush each buffers in this channel */
71 int ustctl_flush_buffer(int sock
, struct object_data
*channel_data
);
73 /* not implemented yet */
74 struct lttng_ust_calibrate
;
75 int ustctl_calibrate(int sock
, struct lttng_ust_calibrate
*calibrate
);
78 * Map channel shm_handle and add streams. Typically performed by the
79 * consumer to map the objects into its memory space.
81 struct shm_handle
*ustctl_map_channel(struct object_data
*chan_data
);
82 int ustctl_add_stream(struct shm_handle
*shm_handle
,
83 struct object_data
*stream_data
);
85 * Note: the object_data from which the shm_handle is derived can only
86 * be released after unmapping the handle.
88 void ustctl_unmap_channel(struct shm_handle
*shm_handle
);
90 /* Buffer operations */
93 struct lib_ring_buffer
;
95 void *ustctl_get_mmap_base(struct shm_handle
*handle
,
96 struct lib_ring_buffer
*buf
);
98 /* Open/close stream buffers for read */
99 struct lib_ring_buffer
*ustctl_open_stream_read(struct shm_handle
*handle
,
101 void ustctl_close_stream_read(struct shm_handle
*handle
,
102 struct lib_ring_buffer
*buf
);
104 /* For mmap mode, readable without "get" operation */
105 int ustctl_get_mmap_len(struct shm_handle
*handle
,
106 struct lib_ring_buffer
*buf
,
108 int ustctl_get_max_subbuf_size(struct shm_handle
*handle
,
109 struct lib_ring_buffer
*buf
,
113 * For mmap mode, operate on the current packet (between get/put or
114 * get_next/put_next).
116 void *ustctl_get_mmap_base(struct shm_handle
*handle
,
117 struct lib_ring_buffer
*buf
);
118 int ustctl_get_mmap_read_offset(struct shm_handle
*handle
,
119 struct lib_ring_buffer
*buf
, unsigned long *off
);
120 int ustctl_get_subbuf_size(struct shm_handle
*handle
,
121 struct lib_ring_buffer
*buf
, unsigned long *len
);
122 int ustctl_get_padded_subbuf_size(struct shm_handle
*handle
,
123 struct lib_ring_buffer
*buf
, unsigned long *len
);
124 int ustctl_get_next_subbuf(struct shm_handle
*handle
,
125 struct lib_ring_buffer
*buf
);
126 int ustctl_put_next_subbuf(struct shm_handle
*handle
,
127 struct lib_ring_buffer
*buf
);
131 int ustctl_snapshot(struct shm_handle
*handle
,
132 struct lib_ring_buffer
*buf
);
133 int ustctl_snapshot_get_consumed(struct shm_handle
*handle
,
134 struct lib_ring_buffer
*buf
, unsigned long *pos
);
135 int ustctl_snapshot_get_produced(struct shm_handle
*handle
,
136 struct lib_ring_buffer
*buf
, unsigned long *pos
);
137 int ustctl_get_subbuf(struct shm_handle
*handle
,
138 struct lib_ring_buffer
*buf
, unsigned long *pos
);
139 int ustctl_put_subbuf(struct shm_handle
*handle
,
140 struct lib_ring_buffer
*buf
);
142 /* Release object created by members of this API */
143 void release_object(int sock
, struct object_data
*data
);
145 #endif /* _LTTNG_UST_CTL_H */
This page took 0.053342 seconds and 5 git commands to generate.