Implement LTTNG_UST_TRACEPOINT_LIST
[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
1c5e467e 25int ustctl_register_done(int sock);
f3105c67
MD
26int ustctl_create_session(int sock);
27int ustctl_open_metadata(int sock, int session_handle,
28 struct lttng_ust_channel_attr *chops,
61f02aea 29 struct lttng_ust_object_data **metadata_data);
f3105c67
MD
30int ustctl_create_channel(int sock, int session_handle,
31 struct lttng_ust_channel_attr *chops,
61f02aea
MD
32 struct lttng_ust_object_data **channel_data);
33int ustctl_create_stream(int sock, struct lttng_ust_object_data *channel_data,
34 struct lttng_ust_object_data **stream_data);
f3105c67 35int ustctl_create_event(int sock, struct lttng_ust_event *ev,
61f02aea
MD
36 struct lttng_ust_object_data *channel_data,
37 struct lttng_ust_object_data **event_data);
f3105c67 38int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
61f02aea
MD
39 struct lttng_ust_object_data *obj_data,
40 struct lttng_ust_object_data **context_data);
f3105c67 41
61f02aea
MD
42int ustctl_enable(int sock, struct lttng_ust_object_data *object);
43int ustctl_disable(int sock, struct lttng_ust_object_data *object);
4a6ca058
MD
44int ustctl_start_session(int sock, int handle);
45int ustctl_stop_session(int sock, int handle);
f3105c67
MD
46
47int ustctl_tracepoint_list(int sock); /* not implemented yet */
48int ustctl_tracer_version(int sock, struct lttng_ust_tracer_version *v);
49int ustctl_wait_quiescent(int sock);
50
51/* not implemented yet */
52struct lttng_ust_calibrate;
53int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate);
54
f3105c67 55/*
38fae1d3 56 * Map channel lttng_ust_shm_handle and add streams. Typically performed by the
f3105c67
MD
57 * consumer to map the objects into its memory space.
58 */
38fae1d3
MD
59struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *chan_data);
60int ustctl_add_stream(struct lttng_ust_shm_handle *lttng_ust_shm_handle,
61f02aea 61 struct lttng_ust_object_data *stream_data);
5224b5c8 62/*
38fae1d3 63 * Note: the lttng_ust_object_data from which the lttng_ust_shm_handle is derived can only
5224b5c8
MD
64 * be released after unmapping the handle.
65 */
38fae1d3 66void ustctl_unmap_channel(struct lttng_ust_shm_handle *lttng_ust_shm_handle);
f3105c67
MD
67
68/* Buffer operations */
69
38fae1d3 70struct lttng_ust_shm_handle;
4cfec15c 71struct lttng_ust_lib_ring_buffer;
f3105c67 72
6e922b24 73/* Open/close stream buffers for read */
4cfec15c 74struct lttng_ust_lib_ring_buffer *ustctl_open_stream_read(struct lttng_ust_shm_handle *handle,
6e922b24 75 int cpu);
38fae1d3 76void ustctl_close_stream_read(struct lttng_ust_shm_handle *handle,
4cfec15c 77 struct lttng_ust_lib_ring_buffer *buf);
6e922b24 78
f3105c67 79/* For mmap mode, readable without "get" operation */
38fae1d3 80int ustctl_get_mmap_len(struct lttng_ust_shm_handle *handle,
4cfec15c 81 struct lttng_ust_lib_ring_buffer *buf,
f3105c67 82 unsigned long *len);
38fae1d3 83int ustctl_get_max_subbuf_size(struct lttng_ust_shm_handle *handle,
4cfec15c 84 struct lttng_ust_lib_ring_buffer *buf,
f3105c67
MD
85 unsigned long *len);
86
87/*
88 * For mmap mode, operate on the current packet (between get/put or
89 * get_next/put_next).
90 */
38fae1d3 91void *ustctl_get_mmap_base(struct lttng_ust_shm_handle *handle,
4cfec15c 92 struct lttng_ust_lib_ring_buffer *buf);
38fae1d3 93int ustctl_get_mmap_read_offset(struct lttng_ust_shm_handle *handle,
4cfec15c 94 struct lttng_ust_lib_ring_buffer *buf, unsigned long *off);
38fae1d3 95int ustctl_get_subbuf_size(struct lttng_ust_shm_handle *handle,
4cfec15c 96 struct lttng_ust_lib_ring_buffer *buf, unsigned long *len);
38fae1d3 97int ustctl_get_padded_subbuf_size(struct lttng_ust_shm_handle *handle,
4cfec15c 98 struct lttng_ust_lib_ring_buffer *buf, unsigned long *len);
38fae1d3 99int ustctl_get_next_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 100 struct lttng_ust_lib_ring_buffer *buf);
38fae1d3 101int ustctl_put_next_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 102 struct lttng_ust_lib_ring_buffer *buf);
f3105c67
MD
103
104/* snapshot */
105
38fae1d3 106int ustctl_snapshot(struct lttng_ust_shm_handle *handle,
4cfec15c 107 struct lttng_ust_lib_ring_buffer *buf);
38fae1d3 108int ustctl_snapshot_get_consumed(struct lttng_ust_shm_handle *handle,
4cfec15c 109 struct lttng_ust_lib_ring_buffer *buf, unsigned long *pos);
38fae1d3 110int ustctl_snapshot_get_produced(struct lttng_ust_shm_handle *handle,
4cfec15c 111 struct lttng_ust_lib_ring_buffer *buf, unsigned long *pos);
38fae1d3 112int ustctl_get_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 113 struct lttng_ust_lib_ring_buffer *buf, unsigned long *pos);
38fae1d3 114int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle,
4cfec15c 115 struct lttng_ust_lib_ring_buffer *buf);
f3105c67 116
02a15cfb 117void ustctl_flush_buffer(struct lttng_ust_shm_handle *handle,
b52190f2
MD
118 struct lttng_ust_lib_ring_buffer *buf,
119 int producer_active);
5f9d3dbc 120
f3105c67 121/* Release object created by members of this API */
5f9d3dbc 122void ustctl_release_object(int sock, struct lttng_ust_object_data *data);
f3105c67
MD
123
124#endif /* _LTTNG_UST_CTL_H */
This page took 0.030183 seconds and 4 git commands to generate.