Remove loglevel iter (will be performed by tracepoint iteration)
[lttng-ust.git] / include / lttng / ust-ctl.h
CommitLineData
f3105c67
MD
1/*
2 * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
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
8 * of the License.
9 *
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.
14 *
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.
18 */
19
20#ifndef _LTTNG_UST_CTL_H
21#define _LTTNG_UST_CTL_H
22
4318ae1b 23#include <lttng/ust-abi.h>
f3105c67 24
20d630cf
MD
25struct ustctl_tracepoint_iter {
26 char name[LTTNG_UST_SYM_NAME_LEN]; /* provider:name */
27 char loglevel[LTTNG_UST_SYM_NAME_LEN]; /* provider:loglevel */
28 int64_t loglevel_value;
29};
30
1c5e467e 31int ustctl_register_done(int sock);
f3105c67
MD
32int ustctl_create_session(int sock);
33int ustctl_open_metadata(int sock, int session_handle,
34 struct lttng_ust_channel_attr *chops,
61f02aea 35 struct lttng_ust_object_data **metadata_data);
f3105c67
MD
36int ustctl_create_channel(int sock, int session_handle,
37 struct lttng_ust_channel_attr *chops,
61f02aea
MD
38 struct lttng_ust_object_data **channel_data);
39int ustctl_create_stream(int sock, struct lttng_ust_object_data *channel_data,
40 struct lttng_ust_object_data **stream_data);
f3105c67 41int ustctl_create_event(int sock, struct lttng_ust_event *ev,
61f02aea
MD
42 struct lttng_ust_object_data *channel_data,
43 struct lttng_ust_object_data **event_data);
f3105c67 44int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
61f02aea
MD
45 struct lttng_ust_object_data *obj_data,
46 struct lttng_ust_object_data **context_data);
f3105c67 47
61f02aea
MD
48int ustctl_enable(int sock, struct lttng_ust_object_data *object);
49int ustctl_disable(int sock, struct lttng_ust_object_data *object);
4a6ca058
MD
50int ustctl_start_session(int sock, int handle);
51int ustctl_stop_session(int sock, int handle);
f3105c67 52
b115631f
MD
53/*
54 * ustctl_tracepoint_list returns a tracepoint list handle, or negative
55 * error value.
56 */
57int ustctl_tracepoint_list(int sock);
58/*
59 * ustctl_tracepoint_list_get is used to iterate on the tp list
60 * handle. End is iteration is reached when -ENOENT is returned.
61 */
62int ustctl_tracepoint_list_get(int sock, int tp_list_handle,
20d630cf 63 struct ustctl_tracepoint_iter *iter);
b115631f 64
f3105c67
MD
65int ustctl_tracer_version(int sock, struct lttng_ust_tracer_version *v);
66int ustctl_wait_quiescent(int sock);
67
68/* not implemented yet */
69struct lttng_ust_calibrate;
70int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate);
71
f3105c67 72/*
38fae1d3 73 * Map channel lttng_ust_shm_handle and add streams. Typically performed by the
f3105c67
MD
74 * consumer to map the objects into its memory space.
75 */
38fae1d3
MD
76struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *chan_data);
77int ustctl_add_stream(struct lttng_ust_shm_handle *lttng_ust_shm_handle,
61f02aea 78 struct lttng_ust_object_data *stream_data);
5224b5c8 79/*
38fae1d3 80 * Note: the lttng_ust_object_data from which the lttng_ust_shm_handle is derived can only
5224b5c8
MD
81 * be released after unmapping the handle.
82 */
38fae1d3 83void ustctl_unmap_channel(struct lttng_ust_shm_handle *lttng_ust_shm_handle);
f3105c67
MD
84
85/* Buffer operations */
86
38fae1d3 87struct lttng_ust_shm_handle;
4cfec15c 88struct lttng_ust_lib_ring_buffer;
f3105c67 89
6e922b24 90/* Open/close stream buffers for read */
4cfec15c 91struct lttng_ust_lib_ring_buffer *ustctl_open_stream_read(struct lttng_ust_shm_handle *handle,
6e922b24 92 int cpu);
38fae1d3 93void ustctl_close_stream_read(struct lttng_ust_shm_handle *handle,
4cfec15c 94 struct lttng_ust_lib_ring_buffer *buf);
6e922b24 95
f3105c67 96/* For mmap mode, readable without "get" operation */
38fae1d3 97int ustctl_get_mmap_len(struct lttng_ust_shm_handle *handle,
4cfec15c 98 struct lttng_ust_lib_ring_buffer *buf,
f3105c67 99 unsigned long *len);
38fae1d3 100int ustctl_get_max_subbuf_size(struct lttng_ust_shm_handle *handle,
4cfec15c 101 struct lttng_ust_lib_ring_buffer *buf,
f3105c67
MD
102 unsigned long *len);
103
104/*
105 * For mmap mode, operate on the current packet (between get/put or
106 * get_next/put_next).
107 */
38fae1d3 108void *ustctl_get_mmap_base(struct lttng_ust_shm_handle *handle,
4cfec15c 109 struct lttng_ust_lib_ring_buffer *buf);
38fae1d3 110int ustctl_get_mmap_read_offset(struct lttng_ust_shm_handle *handle,
4cfec15c 111 struct lttng_ust_lib_ring_buffer *buf, unsigned long *off);
38fae1d3 112int ustctl_get_subbuf_size(struct lttng_ust_shm_handle *handle,
4cfec15c 113 struct lttng_ust_lib_ring_buffer *buf, unsigned long *len);
38fae1d3 114int ustctl_get_padded_subbuf_size(struct lttng_ust_shm_handle *handle,
4cfec15c 115 struct lttng_ust_lib_ring_buffer *buf, unsigned long *len);
38fae1d3 116int ustctl_get_next_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 117 struct lttng_ust_lib_ring_buffer *buf);
38fae1d3 118int ustctl_put_next_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 119 struct lttng_ust_lib_ring_buffer *buf);
f3105c67
MD
120
121/* snapshot */
122
38fae1d3 123int ustctl_snapshot(struct lttng_ust_shm_handle *handle,
4cfec15c 124 struct lttng_ust_lib_ring_buffer *buf);
38fae1d3 125int ustctl_snapshot_get_consumed(struct lttng_ust_shm_handle *handle,
4cfec15c 126 struct lttng_ust_lib_ring_buffer *buf, unsigned long *pos);
38fae1d3 127int ustctl_snapshot_get_produced(struct lttng_ust_shm_handle *handle,
4cfec15c 128 struct lttng_ust_lib_ring_buffer *buf, unsigned long *pos);
38fae1d3 129int ustctl_get_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 130 struct lttng_ust_lib_ring_buffer *buf, unsigned long *pos);
38fae1d3 131int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 132 struct lttng_ust_lib_ring_buffer *buf);
f3105c67 133
02a15cfb 134void ustctl_flush_buffer(struct lttng_ust_shm_handle *handle,
b52190f2
MD
135 struct lttng_ust_lib_ring_buffer *buf,
136 int producer_active);
5f9d3dbc 137
f3105c67 138/* Release object created by members of this API */
d26228ae 139int ustctl_release_object(int sock, struct lttng_ust_object_data *data);
f3105c67
MD
140
141#endif /* _LTTNG_UST_CTL_H */
This page took 0.029993 seconds and 4 git commands to generate.