projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename ltt_events_exit to lttng_ust_events_exit
[lttng-ust.git]
/
libustctl
/
ustctl.c
diff --git
a/libustctl/ustctl.c
b/libustctl/ustctl.c
index 51826c13fb0f2e31acd334dbb972499081a187b1..db9aa0c8dc4f824fd6882e03c57424722f9b7686 100644
(file)
--- a/
libustctl/ustctl.c
+++ b/
libustctl/ustctl.c
@@
-29,7
+29,7
@@
volatile enum ust_loglevel ust_loglevel;
static
volatile enum ust_loglevel ust_loglevel;
static
-void init_object(struct object_data *data)
+void init_object(struct
lttng_ust_
object_data *data)
{
data->handle = -1;
data->shm_fd = -1;
{
data->handle = -1;
data->shm_fd = -1;
@@
-37,7
+37,7
@@
void init_object(struct object_data *data)
data->memory_map_size = 0;
}
data->memory_map_size = 0;
}
-void release_object(int sock, struct object_data *data)
+void release_object(int sock, struct
lttng_ust_
object_data *data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
@@
-105,11
+105,11
@@
int ustctl_create_session(int sock)
/* open the metadata global channel */
int ustctl_open_metadata(int sock, int session_handle,
struct lttng_ust_channel_attr *chops,
/* open the metadata global channel */
int ustctl_open_metadata(int sock, int session_handle,
struct lttng_ust_channel_attr *chops,
- struct object_data **_metadata_data)
+ struct
lttng_ust_
object_data **_metadata_data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
- struct object_data *metadata_data;
+ struct
lttng_ust_
object_data *metadata_data;
int ret;
metadata_data = malloc(sizeof(*metadata_data));
int ret;
metadata_data = malloc(sizeof(*metadata_data));
@@
-158,11
+158,11
@@
error:
int ustctl_create_channel(int sock, int session_handle,
struct lttng_ust_channel_attr *chops,
int ustctl_create_channel(int sock, int session_handle,
struct lttng_ust_channel_attr *chops,
- struct object_data **_channel_data)
+ struct
lttng_ust_
object_data **_channel_data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
- struct object_data *channel_data;
+ struct
lttng_ust_
object_data *channel_data;
int ret;
channel_data = malloc(sizeof(*channel_data));
int ret;
channel_data = malloc(sizeof(*channel_data));
@@
-214,12
+214,12
@@
error:
* Return 0 on success.
* Return negative error value on error.
*/
* Return 0 on success.
* Return negative error value on error.
*/
-int ustctl_create_stream(int sock, struct object_data *channel_data,
- struct object_data **_stream_data)
+int ustctl_create_stream(int sock, struct
lttng_ust_
object_data *channel_data,
+ struct
lttng_ust_
object_data **_stream_data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
- struct object_data *stream_data;
+ struct
lttng_ust_
object_data *stream_data;
int ret, fd;
stream_data = malloc(sizeof(*stream_data));
int ret, fd;
stream_data = malloc(sizeof(*stream_data));
@@
-261,12
+261,12
@@
error:
}
int ustctl_create_event(int sock, struct lttng_ust_event *ev,
}
int ustctl_create_event(int sock, struct lttng_ust_event *ev,
- struct object_data *channel_data,
- struct object_data **_event_data)
+ struct
lttng_ust_
object_data *channel_data,
+ struct
lttng_ust_
object_data **_event_data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
- struct object_data *event_data;
+ struct
lttng_ust_
object_data *event_data;
int ret;
event_data = malloc(sizeof(*event_data));
int ret;
event_data = malloc(sizeof(*event_data));
@@
-291,12
+291,12
@@
int ustctl_create_event(int sock, struct lttng_ust_event *ev,
}
int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
}
int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
- struct
object_data *channel
_data,
- struct object_data **_context_data)
+ struct
lttng_ust_object_data *obj
_data,
+ struct
lttng_ust_
object_data **_context_data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
- struct object_data *context_data;
+ struct
lttng_ust_
object_data *context_data;
int ret;
context_data = malloc(sizeof(*context_data));
int ret;
context_data = malloc(sizeof(*context_data));
@@
-304,7
+304,7
@@
int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
return -ENOMEM;
init_object(context_data);
memset(&lum, 0, sizeof(lum));
return -ENOMEM;
init_object(context_data);
memset(&lum, 0, sizeof(lum));
- lum.handle =
channel
_data->handle;
+ lum.handle =
obj
_data->handle;
lum.cmd = LTTNG_UST_CONTEXT;
lum.u.context.ctx = ctx->ctx;
ret = ustcomm_send_app_cmd(sock, &lum, &lur);
lum.cmd = LTTNG_UST_CONTEXT;
lum.u.context.ctx = ctx->ctx;
ret = ustcomm_send_app_cmd(sock, &lum, &lur);
@@
-319,7
+319,7
@@
int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
}
/* Enable event, channel and session ioctl */
}
/* Enable event, channel and session ioctl */
-int ustctl_enable(int sock, struct object_data *object)
+int ustctl_enable(int sock, struct
lttng_ust_
object_data *object)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
@@
-336,7
+336,7
@@
int ustctl_enable(int sock, struct object_data *object)
}
/* Disable event, channel and session ioctl */
}
/* Disable event, channel and session ioctl */
-int ustctl_disable(int sock, struct object_data *object)
+int ustctl_disable(int sock, struct
lttng_ust_
object_data *object)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
@@
-352,14
+352,20
@@
int ustctl_disable(int sock, struct object_data *object)
return 0;
}
return 0;
}
-int ustctl_start_session(int sock,
struct object_data *object
)
+int ustctl_start_session(int sock,
int handle
)
{
{
- return ustctl_enable(sock, object);
+ struct lttng_ust_object_data obj;
+
+ obj.handle = handle;
+ return ustctl_enable(sock, &obj);
}
}
-int ustctl_stop_session(int sock,
struct object_data *object
)
+int ustctl_stop_session(int sock,
int handle
)
{
{
- return ustctl_disable(sock, object);
+ struct lttng_ust_object_data obj;
+
+ obj.handle = handle;
+ return ustctl_disable(sock, &obj);
}
}
@@
-401,14
+407,14
@@
int ustctl_wait_quiescent(int sock)
return 0;
}
return 0;
}
-int ustctl_flush_buffer
s(int sock, struct
object_data *channel_data)
+int ustctl_flush_buffer
(int sock, struct lttng_ust_
object_data *channel_data)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
memset(&lum, 0, sizeof(lum));
lum.handle = channel_data->handle;
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
memset(&lum, 0, sizeof(lum));
lum.handle = channel_data->handle;
- lum.cmd = LTTNG_UST_FLUSH_BUFFER
S
;
+ lum.cmd = LTTNG_UST_FLUSH_BUFFER;
return ustcomm_send_app_cmd(sock, &lum, &lur);
}
return ustcomm_send_app_cmd(sock, &lum, &lur);
}
@@
-420,9
+426,9
@@
int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate)
/* Buffer operations */
/* Map channel shm into process memory */
/* Buffer operations */
/* Map channel shm into process memory */
-struct
shm_handle *ustctl_map_channel(struct
object_data *chan_data)
+struct
lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_
object_data *chan_data)
{
{
- struct shm_handle *handle;
+ struct
lttng_ust_
shm_handle *handle;
struct channel *chan;
size_t chan_size;
struct channel *chan;
size_t chan_size;
@@
-434,7
+440,7
@@
struct shm_handle *ustctl_map_channel(struct object_data *chan_data)
return NULL;
}
/*
return NULL;
}
/*
- * Set to -1 because the shm_handle destruction will take care
+ * Set to -1 because the
lttng_ust_
shm_handle destruction will take care
* of closing shm_fd and wait_fd.
*/
chan_data->shm_fd = -1;
* of closing shm_fd and wait_fd.
*/
chan_data->shm_fd = -1;
@@
-458,8
+464,8
@@
struct shm_handle *ustctl_map_channel(struct object_data *chan_data)
}
/* Add stream to channel shm and map its shm into process memory */
}
/* Add stream to channel shm and map its shm into process memory */
-int ustctl_add_stream(struct shm_handle *handle,
- struct object_data *stream_data)
+int ustctl_add_stream(struct
lttng_ust_
shm_handle *handle,
+ struct
lttng_ust_
object_data *stream_data)
{
int ret;
{
int ret;
@@
-475,7
+481,7
@@
int ustctl_add_stream(struct shm_handle *handle,
return ret;
}
/*
return ret;
}
/*
- * Set to -1 because the shm_handle destruction will take care
+ * Set to -1 because the
lttng_ust_
shm_handle destruction will take care
* of closing shm_fd and wait_fd.
*/
stream_data->shm_fd = -1;
* of closing shm_fd and wait_fd.
*/
stream_data->shm_fd = -1;
@@
-483,7
+489,7
@@
int ustctl_add_stream(struct shm_handle *handle,
return 0;
}
return 0;
}
-void ustctl_unmap_channel(struct shm_handle *handle)
+void ustctl_unmap_channel(struct
lttng_ust_
shm_handle *handle)
{
struct channel *chan;
{
struct channel *chan;
@@
-491,13
+497,13
@@
void ustctl_unmap_channel(struct shm_handle *handle)
channel_destroy(chan, handle, 1);
}
channel_destroy(chan, handle, 1);
}
-struct l
ib_ring_buffer *ustctl_open_stream_read(struct
shm_handle *handle,
+struct l
ttng_ust_lib_ring_buffer *ustctl_open_stream_read(struct lttng_ust_
shm_handle *handle,
int cpu)
{
struct channel *chan = handle->shadow_chan;
int shm_fd, wait_fd;
uint64_t memory_map_size;
int cpu)
{
struct channel *chan = handle->shadow_chan;
int shm_fd, wait_fd;
uint64_t memory_map_size;
- struct lib_ring_buffer *buf;
+ struct l
ttng_ust_l
ib_ring_buffer *buf;
int ret;
buf = channel_get_ring_buffer(&chan->backend.config,
int ret;
buf = channel_get_ring_buffer(&chan->backend.config,
@@
-510,23
+516,23
@@
struct lib_ring_buffer *ustctl_open_stream_read(struct shm_handle *handle,
return buf;
}
return buf;
}
-void ustctl_close_stream_read(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+void ustctl_close_stream_read(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
lib_ring_buffer_release_read(buf, handle, 1);
}
/* For mmap mode, readable without "get" operation */
{
lib_ring_buffer_release_read(buf, handle, 1);
}
/* For mmap mode, readable without "get" operation */
-void *ustctl_get_mmap_base(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+void *ustctl_get_mmap_base(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
return shmp(handle, buf->backend.memory_map);
}
/* returns the length to mmap. */
{
return shmp(handle, buf->backend.memory_map);
}
/* returns the length to mmap. */
-int ustctl_get_mmap_len(struct shm_handle *handle,
- struct lib_ring_buffer *buf,
+int ustctl_get_mmap_len(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf,
unsigned long *len)
{
unsigned long mmap_buf_len;
unsigned long *len)
{
unsigned long mmap_buf_len;
@@
-544,8
+550,8
@@
int ustctl_get_mmap_len(struct shm_handle *handle,
}
/* returns the maximum size for sub-buffers. */
}
/* returns the maximum size for sub-buffers. */
-int ustctl_get_max_subbuf_size(struct shm_handle *handle,
- struct lib_ring_buffer *buf,
+int ustctl_get_max_subbuf_size(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf,
unsigned long *len)
{
struct channel *chan = handle->shadow_chan;
unsigned long *len)
{
struct channel *chan = handle->shadow_chan;
@@
-560,8
+566,8
@@
int ustctl_get_max_subbuf_size(struct shm_handle *handle,
*/
/* returns the offset of the subbuffer belonging to the mmap reader. */
*/
/* returns the offset of the subbuffer belonging to the mmap reader. */
-int ustctl_get_mmap_read_offset(struct shm_handle *handle,
- struct lib_ring_buffer *buf, unsigned long *off)
+int ustctl_get_mmap_read_offset(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, unsigned long *off)
{
struct channel *chan = handle->shadow_chan;
unsigned long sb_bindex;
{
struct channel *chan = handle->shadow_chan;
unsigned long sb_bindex;
@@
-575,8
+581,8
@@
int ustctl_get_mmap_read_offset(struct shm_handle *handle,
}
/* returns the size of the current sub-buffer, without padding (for mmap). */
}
/* returns the size of the current sub-buffer, without padding (for mmap). */
-int ustctl_get_subbuf_size(struct shm_handle *handle,
- struct lib_ring_buffer *buf, unsigned long *len)
+int ustctl_get_subbuf_size(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, unsigned long *len)
{
struct channel *chan = handle->shadow_chan;
{
struct channel *chan = handle->shadow_chan;
@@
-586,8
+592,8
@@
int ustctl_get_subbuf_size(struct shm_handle *handle,
}
/* returns the size of the current sub-buffer, without padding (for mmap). */
}
/* returns the size of the current sub-buffer, without padding (for mmap). */
-int ustctl_get_padded_subbuf_size(struct shm_handle *handle,
- struct lib_ring_buffer *buf, unsigned long *len)
+int ustctl_get_padded_subbuf_size(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, unsigned long *len)
{
struct channel *chan = handle->shadow_chan;
{
struct channel *chan = handle->shadow_chan;
@@
-598,16
+604,16
@@
int ustctl_get_padded_subbuf_size(struct shm_handle *handle,
}
/* Get exclusive read access to the next sub-buffer that can be read. */
}
/* Get exclusive read access to the next sub-buffer that can be read. */
-int ustctl_get_next_subbuf(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+int ustctl_get_next_subbuf(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
return lib_ring_buffer_get_next_subbuf(buf, handle);
}
/* Release exclusive sub-buffer access, move consumer forward. */
{
return lib_ring_buffer_get_next_subbuf(buf, handle);
}
/* Release exclusive sub-buffer access, move consumer forward. */
-int ustctl_put_next_subbuf(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+int ustctl_put_next_subbuf(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
lib_ring_buffer_put_next_subbuf(buf, handle);
return 0;
{
lib_ring_buffer_put_next_subbuf(buf, handle);
return 0;
@@
-616,46
+622,46
@@
int ustctl_put_next_subbuf(struct shm_handle *handle,
/* snapshot */
/* Get a snapshot of the current ring buffer producer and consumer positions */
/* snapshot */
/* Get a snapshot of the current ring buffer producer and consumer positions */
-int ustctl_snapshot(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+int ustctl_snapshot(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot,
&buf->prod_snapshot, handle);
}
/* Get the consumer position (iteration start) */
{
return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot,
&buf->prod_snapshot, handle);
}
/* Get the consumer position (iteration start) */
-int ustctl_snapshot_get_consumed(struct shm_handle *handle,
- struct lib_ring_buffer *buf, unsigned long *pos)
+int ustctl_snapshot_get_consumed(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, unsigned long *pos)
{
*pos = buf->cons_snapshot;
return 0;
}
/* Get the producer position (iteration end) */
{
*pos = buf->cons_snapshot;
return 0;
}
/* Get the producer position (iteration end) */
-int ustctl_snapshot_get_produced(struct shm_handle *handle,
- struct lib_ring_buffer *buf, unsigned long *pos)
+int ustctl_snapshot_get_produced(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, unsigned long *pos)
{
*pos = buf->prod_snapshot;
return 0;
}
/* Get exclusive read access to the specified sub-buffer position */
{
*pos = buf->prod_snapshot;
return 0;
}
/* Get exclusive read access to the specified sub-buffer position */
-int ustctl_get_subbuf(struct shm_handle *handle,
- struct lib_ring_buffer *buf, unsigned long *pos)
+int ustctl_get_subbuf(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, unsigned long *pos)
{
return lib_ring_buffer_get_subbuf(buf, *pos, handle);
}
/* Release exclusive sub-buffer access */
{
return lib_ring_buffer_get_subbuf(buf, *pos, handle);
}
/* Release exclusive sub-buffer access */
-int ustctl_put_subbuf(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+int ustctl_put_subbuf(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
lib_ring_buffer_put_subbuf(buf, handle);
return 0;
}
{
lib_ring_buffer_put_subbuf(buf, handle);
return 0;
}
-int ustctl_buffer_flush(struct shm_handle *handle,
- struct lib_ring_buffer *buf)
+int ustctl_buffer_flush(struct
lttng_ust_
shm_handle *handle,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE, handle);
return 0;
{
lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE, handle);
return 0;
This page took
0.031973 seconds
and
4
git commands to generate.