ust_cmd->sock, ust_cmd->reg_msg.name,
ust_cmd->reg_msg.major, ust_cmd->reg_msg.minor);
- if (ust_cmd->reg_msg.type == USTCTL_SOCKET_CMD) {
+ if (ust_cmd->reg_msg.type == LTTNG_UST_CTL_SOCKET_CMD) {
wait_node = zmalloc(sizeof(*wait_node));
if (!wait_node) {
PERROR("zmalloc wait_node dispatch");
struct urcu_ref ref;
struct lttng_ht_node_u64 node;
struct rcu_head rcu_head;
- struct ustctl_daemon_counter *daemon_counter;
+ struct lttng_ust_ctl_daemon_counter *daemon_counter;
/*
* Those `lttng_ust_abi_object_data` are anonymous handles to the
* counters objects.
* They are only used to be duplicated for each new applications of the
* user. To destroy them, call with the `sock` parameter set to -1.
- * e.g. `ustctl_release_object(-1, data)`;
+ * e.g. `lttng_ust_ctl_release_object(-1, data)`;
*/
struct lttng_ust_abi_object_data *counter;
struct lttng_ust_abi_object_data **cpu_counters;
caa_container_of(head, typeof(*entry), rcu_head);
for (i = 0; i < entry->nr_counter_cpu_fds; i++) {
- ustctl_release_object(-1, entry->cpu_counters[i]);
+ lttng_ust_ctl_release_object(-1, entry->cpu_counters[i]);
free(entry->cpu_counters[i]);
}
free(entry->cpu_counters);
- ustctl_release_object(-1, entry->counter);
+ lttng_ust_ctl_release_object(-1, entry->counter);
free(entry->counter);
- ustctl_destroy_counter(entry->daemon_counter);
+ lttng_ust_ctl_destroy_counter(entry->daemon_counter);
free(entry);
}
struct lttng_ht *uid_ht, const struct ust_app *app)
{
int i, ret, *cpu_counter_fds = NULL;
- struct ustctl_daemon_counter *daemon_counter;
+ struct lttng_ust_ctl_daemon_counter *daemon_counter;
struct lttng_ust_abi_object_data *counter, **cpu_counters;
struct ust_error_accounting_entry *entry = NULL;
- const struct ustctl_counter_dimension dimension = {
+ const struct lttng_ust_ctl_counter_dimension dimension = {
.size = ust_state.number_indices,
.has_underflow = false,
.has_overflow = false,
urcu_ref_init(&entry->ref);
entry->uid = app->uid;
- entry->nr_counter_cpu_fds = ustctl_get_nr_cpu_per_counter();
+ entry->nr_counter_cpu_fds = lttng_ust_ctl_get_nr_cpu_per_counter();
cpu_counter_fds = zmalloc(entry->nr_counter_cpu_fds * sizeof(*cpu_counter_fds));
if (!cpu_counter_fds) {
/*
* Ownership of the file descriptors transferred to the ustctl object.
*/
- daemon_counter = ustctl_create_counter(1, &dimension, 0, -1,
+ daemon_counter = lttng_ust_ctl_create_counter(1, &dimension, 0, -1,
entry->nr_counter_cpu_fds, cpu_counter_fds,
- USTCTL_COUNTER_BITNESS_32,
- USTCTL_COUNTER_ARITHMETIC_MODULAR,
- USTCTL_COUNTER_ALLOC_PER_CPU,
+ LTTNG_UST_CTL_COUNTER_BITNESS_32,
+ LTTNG_UST_CTL_COUNTER_ARITHMETIC_MODULAR,
+ LTTNG_UST_CTL_COUNTER_ALLOC_PER_CPU,
false);
if (!daemon_counter) {
goto error_create_daemon_counter;
}
- ret = ustctl_create_counter_data(daemon_counter, &counter);
+ ret = lttng_ust_ctl_create_counter_data(daemon_counter, &counter);
if (ret) {
ERR("Failed to create userspace tracer counter data for application user: uid = %d, pid = %d, application name = '%s'",
(int) app->uid, (int) app->pid, app->name);
}
for (i = 0; i < entry->nr_counter_cpu_fds; i++) {
- ret = ustctl_create_counter_cpu_data(daemon_counter, i,
+ ret = lttng_ust_ctl_create_counter_cpu_data(daemon_counter, i,
&cpu_counters[i]);
if (ret) {
ERR("Failed to create userspace tracer counter cpu data for application user: uid = %d, pid = %d, application name = '%s'",
break;
}
- ustctl_release_object(-1, cpu_counters[i]);
+ lttng_ust_ctl_release_object(-1, cpu_counters[i]);
free(cpu_counters[i]);
}
- ustctl_release_object(-1, entry->counter);
+ lttng_ust_ctl_release_object(-1, entry->counter);
free(entry->counter);
error_create_counter_data:
- ustctl_destroy_counter(daemon_counter);
+ lttng_ust_ctl_destroy_counter(daemon_counter);
error_create_daemon_counter:
error_shm_alloc:
/* Error occured before per-cpu SHMs were handed-off to ustctl. */
/* Attach counter to trigger group. */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_send_counter_data_to_ust(app->sock,
+ ret = lttng_ust_ctl_send_counter_data_to_ust(app->sock,
app->event_notifier_group.object->handle, new_counter);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
enum event_notifier_error_accounting_status status;
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_send_counter_cpu_data_to_ust(app->sock,
+ ret = lttng_ust_ctl_send_counter_cpu_data_to_ust(app->sock,
counter, counter_cpu);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
}
/* Duplicate counter object data. */
- ret = ustctl_duplicate_ust_object_data(&new_counter,
+ ret = lttng_ust_ctl_duplicate_ust_object_data(&new_counter,
entry->counter);
if (ret) {
ERR("Failed to duplicate event notifier error accounting counter for application user: application uid = %d, pid = %d, application name = '%s'",
for (i = 0; i < entry->nr_counter_cpu_fds; i++) {
struct lttng_ust_abi_object_data *new_counter_cpu = NULL;
- ret = ustctl_duplicate_ust_object_data(&new_counter_cpu,
+ ret = lttng_ust_ctl_duplicate_ust_object_data(&new_counter_cpu,
entry->cpu_counters[i]);
if (ret) {
ERR("Failed to duplicate userspace tracer counter cpu data for application user: uid = %d, pid = %d, application name = '%s'",
break;
}
- ustctl_release_object(-1, cpu_counters[i]);
+ lttng_ust_ctl_release_object(-1, cpu_counters[i]);
free(cpu_counters[i]);
}
error_allocate_cpu_counters:
error_send_counter_data:
- ustctl_release_object(-1, new_counter);
+ lttng_ust_ctl_release_object(-1, new_counter);
free(new_counter);
error_duplicate_counter:
ust_error_accounting_entry_put(entry);
}
for (i = 0; i < app->event_notifier_group.nr_counter_cpu; i++) {
- ustctl_release_object(app->sock,
+ lttng_ust_ctl_release_object(app->sock,
app->event_notifier_group.counter_cpu[i]);
free(app->event_notifier_group.counter_cpu[i]);
}
free(app->event_notifier_group.counter_cpu);
- ustctl_release_object(app->sock, app->event_notifier_group.counter);
+ lttng_ust_ctl_release_object(app->sock, app->event_notifier_group.counter);
free(app->event_notifier_group.counter);
status = EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
int64_t local_value = 0;
bool overflow = false, underflow = false;
- ret = ustctl_counter_aggregate(uid_entry->daemon_counter,
+ ret = lttng_ust_ctl_counter_aggregate(uid_entry->daemon_counter,
dimension_indexes, &local_value, &overflow,
&underflow);
if (ret || local_value < 0) {
*/
cds_lfht_for_each_entry(error_counter_uid_ht->ht, &iter.iter,
uid_entry, node.node) {
- const int ret = ustctl_counter_clear(uid_entry->daemon_counter,
+ const int ret = lttng_ust_ctl_counter_clear(uid_entry->daemon_counter,
&dimension_index);
if (ret) {
utype = LTTNG_UST_ABI_CONTEXT_IP;
break;
case LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER:
- if (!ustctl_has_perf_counters()) {
+ if (!lttng_ust_ctl_has_perf_counters()) {
utype = -1;
WARN("Perf counters not implemented in UST");
} else {
}
static void copy_channel_attr_to_ustctl(
- struct ustctl_consumer_channel_attr *attr,
+ struct lttng_ust_ctl_consumer_channel_attr *attr,
struct lttng_ust_abi_channel_attr *uattr)
{
/* Copy event attributes since the layout is different. */
if (ua_ctx->obj) {
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_release_object(sock, ua_ctx->obj);
+ ret = lttng_ust_ctl_release_object(sock, ua_ctx->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app sock %d release ctx obj handle %d failed with ret %d",
free(ua_event->exclusion);
if (ua_event->obj != NULL) {
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_release_object(sock, ua_event->obj);
+ ret = lttng_ust_ctl_release_object(sock, ua_event->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app sock %d release event obj failed with ret %d",
if (ua_event_notifier_rule->obj != NULL) {
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_release_object(sock, ua_event_notifier_rule->obj);
+ ret = lttng_ust_ctl_release_object(sock, ua_event_notifier_rule->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("Failed to release event notifier object: app = '%s' (ppid %d), ret = %d",
if (stream->obj) {
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_release_object(sock, stream->obj);
+ ret = lttng_ust_ctl_release_object(sock, stream->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app sock %d release stream obj failed with ret %d",
ret = lttng_ht_del(app->ust_objd, &iter);
assert(!ret);
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_release_object(sock, ua_chan->obj);
+ ret = lttng_ust_ctl_release_object(sock, ua_chan->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app sock %d release channel obj failed with ret %d",
int ret;
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_register_done(app->sock);
+ ret = lttng_ust_ctl_register_done(app->sock);
pthread_mutex_unlock(&app->sock_lock);
return ret;
}
} else {
sock = -1;
}
- ret = ustctl_release_object(sock, data);
+ ret = lttng_ust_ctl_release_object(sock, data);
if (app) {
pthread_mutex_unlock(&app->sock_lock);
}
if (ua_sess->handle != -1) {
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_release_handle(sock, ua_sess->handle);
+ ret = lttng_ust_ctl_release_handle(sock, ua_sess->handle);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app sock %d release session handle failed with ret %d",
ERR("Error unregistering app from event notifier error accounting");
}
- ustctl_release_object(sock, app->event_notifier_group.object);
+ lttng_ust_ctl_release_object(sock, app->event_notifier_group.object);
free(app->event_notifier_group.object);
}
/* Copy attributes */
if (attr) {
- /* Translate from lttng_ust_channel to ustctl_consumer_channel_attr. */
+ /* Translate from lttng_ust_channel to lttng_ust_ctl_consumer_channel_attr. */
ua_chan->attr.subbuf_size = attr->subbuf_size;
ua_chan->attr.num_subbuf = attr->num_subbuf;
ua_chan->attr.overwrite = attr->overwrite;
health_code_update();
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_add_context(app->sock, &ua_ctx->ctx,
+ ret = lttng_ust_ctl_add_context(app->sock, &ua_ctx->ctx,
ua_chan->obj, &ua_ctx->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
goto error;
}
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_set_filter(app->sock, ust_bytecode,
+ ret = lttng_ust_ctl_set_filter(app->sock, ust_bytecode,
ust_object);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
ust_bytecode->seqnum = capture_seqnum;
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_set_capture(app->sock, ust_bytecode,
+ ret = lttng_ust_ctl_set_capture(app->sock, ust_bytecode,
ust_object);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
goto error;
}
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_set_exclusion(app->sock, ust_exclusions, ust_object);
+ ret = lttng_ust_ctl_set_exclusion(app->sock, ust_exclusions, ust_object);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
health_code_update();
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_disable(app->sock, object);
+ ret = lttng_ust_ctl_disable(app->sock, object);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
health_code_update();
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_disable(app->sock, ua_chan->obj);
+ ret = lttng_ust_ctl_disable(app->sock, ua_chan->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
health_code_update();
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_enable(app->sock, ua_chan->obj);
+ ret = lttng_ust_ctl_enable(app->sock, ua_chan->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
health_code_update();
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_enable(app->sock, ust_object);
+ ret = lttng_ust_ctl_enable(app->sock, ust_object);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
/* Create UST event on tracer */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_create_event(app->sock, &ua_event->attr, ua_chan->obj,
+ ret = lttng_ust_ctl_create_event(app->sock, &ua_event->attr, ua_chan->obj,
&ua_event->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
/* Create UST event notifier against the tracer. */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_create_event_notifier(app->sock, &event_notifier,
+ ret = lttng_ust_ctl_create_event_notifier(app->sock, &event_notifier,
app->event_notifier_group.object,
&ua_event_notifier_rule->obj);
pthread_mutex_unlock(&app->sock_lock);
* be NULL.
*
* Returns 0 on success or else a negative code which is either -ENOMEM or
- * -ENOTCONN which is the default code if the ustctl_create_session fails.
+ * -ENOTCONN which is the default code if the lttng_ust_ctl_create_session fails.
*/
static int find_or_create_ust_app_session(struct ltt_ust_session *usess,
struct ust_app *app, struct ust_app_session **ua_sess_ptr,
if (ua_sess->handle == -1) {
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_create_session(app->sock);
+ ret = lttng_ust_ctl_create_session(app->sock);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
}
/* Duplicate object for stream once the original is in the registry. */
- ret = ustctl_duplicate_ust_object_data(&stream->obj,
+ ret = lttng_ust_ctl_duplicate_ust_object_data(&stream->obj,
reg_stream->obj.ust);
if (ret < 0) {
ERR("Duplicate stream obj from %p to %p failed with ret %d",
}
/* Duplicate object for stream once the original is in the registry. */
- ret = ustctl_duplicate_ust_object_data(&ua_chan->obj, buf_reg_chan->obj.ust);
+ ret = lttng_ust_ctl_duplicate_ust_object_data(&ua_chan->obj, buf_reg_chan->obj.ust);
if (ret < 0) {
ERR("Duplicate channel obj from %p to %p failed with ret: %d",
buf_reg_chan->obj.ust, ua_chan->obj, ret);
assert(app);
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_tracer_version(app->sock, &app->version);
+ ret = lttng_ust_ctl_tracer_version(app->sock, &app->version);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
app->event_notifier_group.event_pipe);
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_create_event_notifier_group(app->sock,
+ ret = lttng_ust_ctl_create_event_notifier_group(app->sock,
event_pipe_write_fd, &event_notifier_group);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
}
error:
- ustctl_release_object(app->sock, app->event_notifier_group.object);
+ lttng_ust_ctl_release_object(app->sock, app->event_notifier_group.object);
free(app->event_notifier_group.object);
app->event_notifier_group.object = NULL;
return ret;
continue;
}
pthread_mutex_lock(&app->sock_lock);
- handle = ustctl_tracepoint_list(app->sock);
+ handle = lttng_ust_ctl_tracepoint_list(app->sock);
if (handle < 0) {
if (handle != -EPIPE && handle != -LTTNG_UST_ERR_EXITING) {
ERR("UST app list events getting handle failed for app pid %d",
continue;
}
- while ((ret = ustctl_tracepoint_list_get(app->sock, handle,
+ while ((ret = lttng_ust_ctl_tracepoint_list_get(app->sock, handle,
&uiter)) != -LTTNG_UST_ERR_NOENT) {
/* Handle ustctl error. */
if (ret < 0) {
break;
}
free(tmp_event);
- release_ret = ustctl_release_handle(app->sock, handle);
+ release_ret = lttng_ust_ctl_release_handle(app->sock, handle);
if (release_ret < 0 &&
release_ret != -LTTNG_UST_ERR_EXITING &&
release_ret != -EPIPE) {
PERROR("realloc ust app events");
free(tmp_event);
ret = -ENOMEM;
- release_ret = ustctl_release_handle(app->sock, handle);
+ release_ret = lttng_ust_ctl_release_handle(app->sock, handle);
if (release_ret < 0 &&
release_ret != -LTTNG_UST_ERR_EXITING &&
release_ret != -EPIPE) {
tmp_event[count].enabled = -1;
count++;
}
- ret = ustctl_release_handle(app->sock, handle);
+ ret = lttng_ust_ctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
continue;
}
pthread_mutex_lock(&app->sock_lock);
- handle = ustctl_tracepoint_field_list(app->sock);
+ handle = lttng_ust_ctl_tracepoint_field_list(app->sock);
if (handle < 0) {
if (handle != -EPIPE && handle != -LTTNG_UST_ERR_EXITING) {
ERR("UST app list field getting handle failed for app pid %d",
continue;
}
- while ((ret = ustctl_tracepoint_field_list_get(app->sock, handle,
+ while ((ret = lttng_ust_ctl_tracepoint_field_list_get(app->sock, handle,
&uiter)) != -LTTNG_UST_ERR_NOENT) {
/* Handle ustctl error. */
if (ret < 0) {
break;
}
free(tmp_event);
- release_ret = ustctl_release_handle(app->sock, handle);
+ release_ret = lttng_ust_ctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
if (release_ret < 0 &&
release_ret != -LTTNG_UST_ERR_EXITING &&
PERROR("realloc ust app event fields");
free(tmp_event);
ret = -ENOMEM;
- release_ret = ustctl_release_handle(app->sock, handle);
+ release_ret = lttng_ust_ctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
if (release_ret &&
release_ret != -LTTNG_UST_ERR_EXITING &&
tmp_event[count].event.enabled = -1;
count++;
}
- ret = ustctl_release_handle(app->sock, handle);
+ ret = lttng_ust_ctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 &&
ret != -LTTNG_UST_ERR_EXITING &&
skip_setup:
/* This starts the UST tracing */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_start_session(app->sock, ua_sess->handle);
+ ret = lttng_ust_ctl_start_session(app->sock, ua_sess->handle);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
/* Quiescent wait after starting trace */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_wait_quiescent(app->sock);
+ ret = lttng_ust_ctl_wait_quiescent(app->sock);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app wait quiescent failed for app pid %d ret %d",
/* This inhibits UST tracing */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_stop_session(app->sock, ua_sess->handle);
+ ret = lttng_ust_ctl_stop_session(app->sock, ua_sess->handle);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
/* Quiescent wait after stopping trace */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_wait_quiescent(app->sock);
+ ret = lttng_ust_ctl_wait_quiescent(app->sock);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app wait quiescent failed for app pid %d ret %d",
/* Quiescent wait after stopping trace */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_wait_quiescent(app->sock);
+ ret = lttng_ust_ctl_wait_quiescent(app->sock);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0 && ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app wait quiescent failed for app pid %d ret %d",
assert(msg);
- ret = ustctl_recv_reg_msg(sock, &msg->type, &msg->major, &msg->minor,
+ ret = lttng_ust_ctl_recv_reg_msg(sock, &msg->type, &msg->major, &msg->minor,
&pid, &ppid, &uid, &gid,
&msg->bits_per_long,
&msg->uint8_t_alignment,
* On success 0 is returned else a negative value.
*/
static int reply_ust_register_channel(int sock, int cobjd,
- size_t nr_fields, struct ustctl_field *fields)
+ size_t nr_fields, struct lttng_ust_ctl_field *fields)
{
int ret, ret_code = 0;
uint32_t chan_id;
uint64_t chan_reg_key;
- enum ustctl_channel_header type;
+ enum lttng_ust_ctl_channel_header type;
struct ust_app *app;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
* this channel to better guess header type for per-pid
* buffers.
*/
- type = USTCTL_CHANNEL_HEADER_LARGE;
+ type = LTTNG_UST_CTL_CHANNEL_HEADER_LARGE;
ust_reg_chan->nr_ctx_fields = nr_fields;
ust_reg_chan->ctx_fields = fields;
fields = NULL;
" with id %u, type: %d, ret: %d", chan_reg_key, chan_id, type,
ret_code);
- ret = ustctl_reply_register_channel(sock, chan_id, type, ret_code);
+ ret = lttng_ust_ctl_reply_register_channel(sock, chan_id, type, ret_code);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app reply channel failed with ret %d", ret);
* On success 0 is returned else a negative value.
*/
static int add_event_ust_registry(int sock, int sobjd, int cobjd, char *name,
- char *sig, size_t nr_fields, struct ustctl_field *fields,
+ char *sig, size_t nr_fields, struct lttng_ust_ctl_field *fields,
int loglevel_value, char *model_emf_uri)
{
int ret, ret_code;
* application can be notified. In case of an error, it's important not to
* return a negative error or else the application will get closed.
*/
- ret = ustctl_reply_register_event(sock, event_id, ret_code);
+ ret = lttng_ust_ctl_reply_register_event(sock, event_id, ret_code);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app reply event failed with ret %d", ret);
* On success 0 is returned else a negative value.
*/
static int add_enum_ust_registry(int sock, int sobjd, char *name,
- struct ustctl_enum_entry *entries, size_t nr_entries)
+ struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries)
{
int ret = 0, ret_code;
struct ust_app *app;
* application can be notified. In case of an error, it's important not to
* return a negative error or else the application will get closed.
*/
- ret = ustctl_reply_register_enum(sock, enum_id, ret_code);
+ ret = lttng_ust_ctl_reply_register_enum(sock, enum_id, ret_code);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app reply enum failed with ret %d", ret);
int ust_app_recv_notify(int sock)
{
int ret;
- enum ustctl_notify_cmd cmd;
+ enum lttng_ust_ctl_notify_cmd cmd;
DBG3("UST app receiving notify from sock %d", sock);
- ret = ustctl_recv_notify(sock, &cmd);
+ ret = lttng_ust_ctl_recv_notify(sock, &cmd);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app recv notify failed with ret %d", ret);
}
switch (cmd) {
- case USTCTL_NOTIFY_CMD_EVENT:
+ case LTTNG_UST_CTL_NOTIFY_CMD_EVENT:
{
int sobjd, cobjd, loglevel_value;
char name[LTTNG_UST_ABI_SYM_NAME_LEN], *sig, *model_emf_uri;
size_t nr_fields;
- struct ustctl_field *fields;
+ struct lttng_ust_ctl_field *fields;
DBG2("UST app ustctl register event received");
- ret = ustctl_recv_register_event(sock, &sobjd, &cobjd, name,
+ ret = lttng_ust_ctl_recv_register_event(sock, &sobjd, &cobjd, name,
&loglevel_value, &sig, &nr_fields, &fields,
&model_emf_uri);
if (ret < 0) {
break;
}
- case USTCTL_NOTIFY_CMD_CHANNEL:
+ case LTTNG_UST_CTL_NOTIFY_CMD_CHANNEL:
{
int sobjd, cobjd;
size_t nr_fields;
- struct ustctl_field *fields;
+ struct lttng_ust_ctl_field *fields;
DBG2("UST app ustctl register channel received");
- ret = ustctl_recv_register_channel(sock, &sobjd, &cobjd, &nr_fields,
+ ret = lttng_ust_ctl_recv_register_channel(sock, &sobjd, &cobjd, &nr_fields,
&fields);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
break;
}
- case USTCTL_NOTIFY_CMD_ENUM:
+ case LTTNG_UST_CTL_NOTIFY_CMD_ENUM:
{
int sobjd;
char name[LTTNG_UST_ABI_SYM_NAME_LEN];
size_t nr_entries;
- struct ustctl_enum_entry *entries;
+ struct lttng_ust_ctl_enum_entry *entries;
DBG2("UST app ustctl register enum received");
- ret = ustctl_recv_register_enum(sock, &sobjd, name,
+ ret = lttng_ust_ctl_recv_register_enum(sock, &sobjd, name,
&entries, &nr_entries);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
}
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_regenerate_statedump(app->sock, ua_sess->handle);
+ ret = lttng_ust_ctl_regenerate_statedump(app->sock, ua_sess->handle);
pthread_mutex_unlock(&app->sock_lock);
end_unlock:
* Application registration data structure.
*/
struct ust_register_msg {
- enum ustctl_socket_type type;
+ enum lttng_ust_ctl_socket_type type;
uint32_t major;
uint32_t minor;
uint32_t abi_major;
unsigned int expected_stream_count;
char name[LTTNG_UST_ABI_SYM_NAME_LEN];
struct lttng_ust_abi_object_data *obj;
- struct ustctl_consumer_channel_attr attr;
+ struct lttng_ust_ctl_consumer_channel_attr attr;
struct ust_app_stream_list streams;
/* Session pointer that owns this object. */
struct ust_app_session *session;
unsigned int live_timer_interval; /* usec */
/* Metadata channel attributes. */
- struct ustctl_consumer_channel_attr metadata_attr;
+ struct lttng_ust_ctl_consumer_channel_attr metadata_attr;
char root_shm_path[PATH_MAX];
char shm_path[PATH_MAX];
}
/* First, get the channel from consumer. */
- ret = ustctl_recv_channel_from_consumer(*socket->fd_ptr, &ua_chan->obj);
+ ret = lttng_ust_ctl_recv_channel_from_consumer(*socket->fd_ptr, &ua_chan->obj);
if (ret < 0) {
if (ret != -EPIPE) {
ERR("Error recv channel from consumer %d with ret %d",
}
/* Stream object is populated by this call if successful. */
- ret = ustctl_recv_stream_from_consumer(*socket->fd_ptr, &stream->obj);
+ ret = lttng_ust_ctl_recv_stream_from_consumer(*socket->fd_ptr, &stream->obj);
if (ret < 0) {
free(stream);
if (ret == -LTTNG_UST_ERR_NOENT) {
/* Relay stream to application. */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_send_stream_to_ust(app->sock, channel->obj, stream->obj);
+ ret = lttng_ust_ctl_send_stream_to_ust(app->sock, channel->obj, stream->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
/* Send stream to application. */
pthread_mutex_lock(&app->sock_lock);
- ret = ustctl_send_channel_to_ust(app->sock, ua_sess->handle, channel->obj);
+ ret = lttng_ust_ctl_send_channel_to_ust(app->sock, ua_sess->handle, channel->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
struct lttng_ust_shm_handle;
struct lttng_ust_lib_ring_buffer;
-struct ustctl_consumer_channel_attr {
+struct lttng_ust_ctl_consumer_channel_attr {
enum lttng_ust_abi_chan_type type;
uint64_t subbuf_size; /* bytes */
uint64_t num_subbuf; /* power of 2 */
* >= 0: Success (LTTNG_UST_OK)
* < 0: error code.
*/
-int ustctl_register_done(int sock);
-int ustctl_create_session(int sock);
-int ustctl_create_event(int sock, struct lttng_ust_abi_event *ev,
+int lttng_ust_ctl_register_done(int sock);
+int lttng_ust_ctl_create_session(int sock);
+int lttng_ust_ctl_create_event(int sock, struct lttng_ust_abi_event *ev,
struct lttng_ust_abi_object_data *channel_data,
struct lttng_ust_abi_object_data **event_data);
-int ustctl_add_context(int sock, struct lttng_ust_context_attr *ctx,
+int lttng_ust_ctl_add_context(int sock, struct lttng_ust_context_attr *ctx,
struct lttng_ust_abi_object_data *obj_data,
struct lttng_ust_abi_object_data **context_data);
-int ustctl_set_filter(int sock, struct lttng_ust_abi_filter_bytecode *bytecode,
+int lttng_ust_ctl_set_filter(int sock, struct lttng_ust_abi_filter_bytecode *bytecode,
struct lttng_ust_abi_object_data *obj_data);
-int ustctl_set_capture(int sock, struct lttng_ust_abi_capture_bytecode *bytecode,
+int lttng_ust_ctl_set_capture(int sock, struct lttng_ust_abi_capture_bytecode *bytecode,
struct lttng_ust_abi_object_data *obj_data);
-int ustctl_set_exclusion(int sock, struct lttng_ust_abi_event_exclusion *exclusion,
+int lttng_ust_ctl_set_exclusion(int sock, struct lttng_ust_abi_event_exclusion *exclusion,
struct lttng_ust_abi_object_data *obj_data);
-int ustctl_enable(int sock, struct lttng_ust_abi_object_data *object);
-int ustctl_disable(int sock, struct lttng_ust_abi_object_data *object);
-int ustctl_start_session(int sock, int handle);
-int ustctl_stop_session(int sock, int handle);
+int lttng_ust_ctl_enable(int sock, struct lttng_ust_abi_object_data *object);
+int lttng_ust_ctl_disable(int sock, struct lttng_ust_abi_object_data *object);
+int lttng_ust_ctl_start_session(int sock, int handle);
+int lttng_ust_ctl_stop_session(int sock, int handle);
/*
- * ustctl_create_event notifier_group creates a event notifier group. It
+ * lttng_ust_ctl_create_event notifier_group creates a event notifier group. It
* establishes the connection with the application by providing a file
* descriptor of the pipe to be used by the application when a event notifier
* of that group is fired. It returns a handle to be used when creating event
* notifier in that group.
*/
-int ustctl_create_event_notifier_group(int sock, int pipe_fd,
+int lttng_ust_ctl_create_event_notifier_group(int sock, int pipe_fd,
struct lttng_ust_abi_object_data **event_notifier_group);
/*
- * ustctl_create_event notifier creates a event notifier in a event notifier
+ * lttng_ust_ctl_create_event notifier creates a event notifier in a event notifier
* group giving a event notifier description and a event notifier group handle.
* It returns a event notifier handle to be used when enabling the event
* notifier, attaching filter, attaching exclusion, and disabling the event
* notifier.
*/
-int ustctl_create_event_notifier(int sock,
+int lttng_ust_ctl_create_event_notifier(int sock,
struct lttng_ust_abi_event_notifier *event_notifier,
struct lttng_ust_abi_object_data *event_notifier_group,
struct lttng_ust_abi_object_data **event_notifier_data);
/*
- * ustctl_tracepoint_list returns a tracepoint list handle, or negative
+ * lttng_ust_ctl_tracepoint_list returns a tracepoint list handle, or negative
* error value.
*/
-int ustctl_tracepoint_list(int sock);
+int lttng_ust_ctl_tracepoint_list(int sock);
/*
- * ustctl_tracepoint_list_get is used to iterate on the tp list
+ * lttng_ust_ctl_tracepoint_list_get is used to iterate on the tp list
* handle. End is iteration is reached when -LTTNG_UST_ERR_NOENT is
* returned.
*/
-int ustctl_tracepoint_list_get(int sock, int tp_list_handle,
+int lttng_ust_ctl_tracepoint_list_get(int sock, int tp_list_handle,
struct lttng_ust_abi_tracepoint_iter *iter);
/*
- * ustctl_tracepoint_field_list returns a tracepoint field list handle,
+ * lttng_ust_ctl_tracepoint_field_list returns a tracepoint field list handle,
* or negative error value.
*/
-int ustctl_tracepoint_field_list(int sock);
+int lttng_ust_ctl_tracepoint_field_list(int sock);
/*
- * ustctl_tracepoint_field_list_get is used to iterate on the tp field
+ * lttng_ust_ctl_tracepoint_field_list_get is used to iterate on the tp field
* list handle. End is iteration is reached when -LTTNG_UST_ERR_NOENT is
* returned.
*/
-int ustctl_tracepoint_field_list_get(int sock, int tp_field_list_handle,
+int lttng_ust_ctl_tracepoint_field_list_get(int sock, int tp_field_list_handle,
struct lttng_ust_abi_field_iter *iter);
-int ustctl_tracer_version(int sock, struct lttng_ust_abi_tracer_version *v);
-int ustctl_wait_quiescent(int sock);
+int lttng_ust_ctl_tracer_version(int sock, struct lttng_ust_abi_tracer_version *v);
+int lttng_ust_ctl_wait_quiescent(int sock);
-int ustctl_sock_flush_buffer(int sock, struct lttng_ust_abi_object_data *object);
+int lttng_ust_ctl_sock_flush_buffer(int sock, struct lttng_ust_abi_object_data *object);
-int ustctl_calibrate(int sock, struct lttng_ust_abi_calibrate *calibrate);
+int lttng_ust_ctl_calibrate(int sock, struct lttng_ust_abi_calibrate *calibrate);
/* Release object created by members of this API. */
-int ustctl_release_object(int sock, struct lttng_ust_abi_object_data *data);
+int lttng_ust_ctl_release_object(int sock, struct lttng_ust_abi_object_data *data);
/* Release handle returned by create session. */
-int ustctl_release_handle(int sock, int handle);
+int lttng_ust_ctl_release_handle(int sock, int handle);
-int ustctl_recv_channel_from_consumer(int sock,
+int lttng_ust_ctl_recv_channel_from_consumer(int sock,
struct lttng_ust_abi_object_data **channel_data);
-int ustctl_recv_stream_from_consumer(int sock,
+int lttng_ust_ctl_recv_stream_from_consumer(int sock,
struct lttng_ust_abi_object_data **stream_data);
-int ustctl_send_channel_to_ust(int sock, int session_handle,
+int lttng_ust_ctl_send_channel_to_ust(int sock, int session_handle,
struct lttng_ust_abi_object_data *channel_data);
-int ustctl_send_stream_to_ust(int sock,
+int lttng_ust_ctl_send_stream_to_ust(int sock,
struct lttng_ust_abi_object_data *channel_data,
struct lttng_ust_abi_object_data *stream_data);
/*
- * ustctl_duplicate_ust_object_data allocated a new object in "dest" if
+ * lttng_ust_ctl_duplicate_ust_object_data allocated a new object in "dest" if
* it succeeds (returns 0). It must be released using
- * ustctl_release_object() and then freed with free().
+ * lttng_ust_ctl_release_object() and then freed with free().
*/
-int ustctl_duplicate_ust_object_data(struct lttng_ust_abi_object_data **dest,
+int lttng_ust_ctl_duplicate_ust_object_data(struct lttng_ust_abi_object_data **dest,
struct lttng_ust_abi_object_data *src);
/*
* API used by consumer.
*/
-struct ustctl_consumer_channel;
-struct ustctl_consumer_stream;
-struct ustctl_consumer_channel_attr;
+struct lttng_ust_ctl_consumer_channel;
+struct lttng_ust_ctl_consumer_stream;
+struct lttng_ust_ctl_consumer_channel_attr;
-int ustctl_get_nr_stream_per_channel(void);
+int lttng_ust_ctl_get_nr_stream_per_channel(void);
-struct ustctl_consumer_channel *
- ustctl_create_channel(struct ustctl_consumer_channel_attr *attr,
+struct lttng_ust_ctl_consumer_channel *
+ lttng_ust_ctl_create_channel(struct lttng_ust_ctl_consumer_channel_attr *attr,
const int *stream_fds, int nr_stream_fds);
/*
* Each stream created needs to be destroyed before calling
- * ustctl_destroy_channel().
+ * lttng_ust_ctl_destroy_channel().
*/
-void ustctl_destroy_channel(struct ustctl_consumer_channel *chan);
+void lttng_ust_ctl_destroy_channel(struct lttng_ust_ctl_consumer_channel *chan);
-int ustctl_send_channel_to_sessiond(int sock,
- struct ustctl_consumer_channel *channel);
-int ustctl_channel_close_wait_fd(struct ustctl_consumer_channel *consumer_chan);
-int ustctl_channel_close_wakeup_fd(struct ustctl_consumer_channel *consumer_chan);
-int ustctl_channel_get_wait_fd(struct ustctl_consumer_channel *consumer_chan);
-int ustctl_channel_get_wakeup_fd(struct ustctl_consumer_channel *consumer_chan);
+int lttng_ust_ctl_send_channel_to_sessiond(int sock,
+ struct lttng_ust_ctl_consumer_channel *channel);
+int lttng_ust_ctl_channel_close_wait_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
+int lttng_ust_ctl_channel_close_wakeup_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
+int lttng_ust_ctl_channel_get_wait_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
+int lttng_ust_ctl_channel_get_wakeup_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
-int ustctl_write_metadata_to_channel(
- struct ustctl_consumer_channel *channel,
+int lttng_ust_ctl_write_metadata_to_channel(
+ struct lttng_ust_ctl_consumer_channel *channel,
const char *metadata_str, /* NOT null-terminated */
size_t len); /* metadata length */
-ssize_t ustctl_write_one_packet_to_channel(
- struct ustctl_consumer_channel *channel,
+ssize_t lttng_ust_ctl_write_one_packet_to_channel(
+ struct lttng_ust_ctl_consumer_channel *channel,
const char *metadata_str, /* NOT null-terminated */
size_t len); /* metadata length */
* Send a NULL stream to finish iteration over all streams of a given
* channel.
*/
-int ustctl_send_stream_to_sessiond(int sock,
- struct ustctl_consumer_stream *stream);
-int ustctl_stream_close_wait_fd(struct ustctl_consumer_stream *stream);
-int ustctl_stream_close_wakeup_fd(struct ustctl_consumer_stream *stream);
-int ustctl_stream_get_wait_fd(struct ustctl_consumer_stream *stream);
-int ustctl_stream_get_wakeup_fd(struct ustctl_consumer_stream *stream);
+int lttng_ust_ctl_send_stream_to_sessiond(int sock,
+ struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_stream_close_wait_fd(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_stream_close_wakeup_fd(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_stream_get_wait_fd(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_stream_get_wakeup_fd(struct lttng_ust_ctl_consumer_stream *stream);
/* Create/destroy stream buffers for read */
-struct ustctl_consumer_stream *
- ustctl_create_stream(struct ustctl_consumer_channel *channel,
+struct lttng_ust_ctl_consumer_stream *
+ lttng_ust_ctl_create_stream(struct lttng_ust_ctl_consumer_channel *channel,
int cpu);
-void ustctl_destroy_stream(struct ustctl_consumer_stream *stream);
+void lttng_ust_ctl_destroy_stream(struct lttng_ust_ctl_consumer_stream *stream);
/* For mmap mode, readable without "get" operation */
-int ustctl_get_mmap_len(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_mmap_len(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *len);
-int ustctl_get_max_subbuf_size(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_max_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *len);
/*
* For mmap mode, operate on the current packet (between get/put or
* get_next/put_next).
*/
-void *ustctl_get_mmap_base(struct ustctl_consumer_stream *stream);
-int ustctl_get_mmap_read_offset(struct ustctl_consumer_stream *stream,
+void *lttng_ust_ctl_get_mmap_base(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_get_mmap_read_offset(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *off);
-int ustctl_get_subbuf_size(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *len);
-int ustctl_get_padded_subbuf_size(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_padded_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *len);
-int ustctl_get_next_subbuf(struct ustctl_consumer_stream *stream);
-int ustctl_put_next_subbuf(struct ustctl_consumer_stream *stream);
+int lttng_ust_ctl_get_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_put_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
/* snapshot */
-int ustctl_snapshot(struct ustctl_consumer_stream *stream);
-int ustctl_snapshot_sample_positions(struct ustctl_consumer_stream *stream);
-int ustctl_snapshot_get_consumed(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_snapshot(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_snapshot_sample_positions(struct lttng_ust_ctl_consumer_stream *stream);
+int lttng_ust_ctl_snapshot_get_consumed(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *pos);
-int ustctl_snapshot_get_produced(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_snapshot_get_produced(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *pos);
-int ustctl_get_subbuf(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_subbuf(struct lttng_ust_ctl_consumer_stream *stream,
unsigned long *pos);
-int ustctl_put_subbuf(struct ustctl_consumer_stream *stream);
+int lttng_ust_ctl_put_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
-void ustctl_flush_buffer(struct ustctl_consumer_stream *stream,
+void lttng_ust_ctl_flush_buffer(struct lttng_ust_ctl_consumer_stream *stream,
int producer_active);
-void ustctl_clear_buffer(struct ustctl_consumer_stream *stream);
+void lttng_ust_ctl_clear_buffer(struct lttng_ust_ctl_consumer_stream *stream);
/* index */
* or get_next/put_next.
*/
-int ustctl_get_timestamp_begin(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_timestamp_begin(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *timestamp_begin);
-int ustctl_get_timestamp_end(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_timestamp_end(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *timestamp_end);
-int ustctl_get_events_discarded(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_events_discarded(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *events_discarded);
-int ustctl_get_content_size(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_content_size(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *content_size);
-int ustctl_get_packet_size(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_packet_size(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *packet_size);
-int ustctl_get_sequence_number(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_sequence_number(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *seq);
/*
* without "get" operation.
*/
-int ustctl_get_stream_id(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_stream_id(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *stream_id);
-int ustctl_get_instance_id(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_instance_id(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *id);
/*
* Getter returning the current timestamp as perceived from the
* tracer.
*/
-int ustctl_get_current_timestamp(struct ustctl_consumer_stream *stream,
+int lttng_ust_ctl_get_current_timestamp(struct lttng_ust_ctl_consumer_stream *stream,
uint64_t *ts);
/* returns whether UST has perf counters support. */
-int ustctl_has_perf_counters(void);
+int lttng_ust_ctl_has_perf_counters(void);
/* Regenerate the statedump. */
-int ustctl_regenerate_statedump(int sock, int handle);
+int lttng_ust_ctl_regenerate_statedump(int sock, int handle);
/* event registry management */
-enum ustctl_socket_type {
- USTCTL_SOCKET_CMD = 0,
- USTCTL_SOCKET_NOTIFY = 1,
+enum lttng_ust_ctl_socket_type {
+ LTTNG_UST_CTL_SOCKET_CMD = 0,
+ LTTNG_UST_CTL_SOCKET_NOTIFY = 1,
};
-enum ustctl_notify_cmd {
- USTCTL_NOTIFY_CMD_EVENT = 0,
- USTCTL_NOTIFY_CMD_CHANNEL = 1,
- USTCTL_NOTIFY_CMD_ENUM = 2,
+enum lttng_ust_ctl_notify_cmd {
+ LTTNG_UST_CTL_NOTIFY_CMD_EVENT = 0,
+ LTTNG_UST_CTL_NOTIFY_CMD_CHANNEL = 1,
+ LTTNG_UST_CTL_NOTIFY_CMD_ENUM = 2,
};
-enum ustctl_channel_header {
- USTCTL_CHANNEL_HEADER_UNKNOWN = 0,
- USTCTL_CHANNEL_HEADER_COMPACT = 1,
- USTCTL_CHANNEL_HEADER_LARGE = 2,
+enum lttng_ust_ctl_channel_header {
+ LTTNG_UST_CTL_CHANNEL_HEADER_UNKNOWN = 0,
+ LTTNG_UST_CTL_CHANNEL_HEADER_COMPACT = 1,
+ LTTNG_UST_CTL_CHANNEL_HEADER_LARGE = 2,
};
/* event type structures */
-enum ustctl_abstract_types {
- ustctl_atype_integer,
- ustctl_atype_enum, /* legacy */
- ustctl_atype_array, /* legacy */
- ustctl_atype_sequence, /* legacy */
- ustctl_atype_string,
- ustctl_atype_float,
- ustctl_atype_variant, /* legacy */
- ustctl_atype_struct, /* legacy */
- ustctl_atype_enum_nestable,
- ustctl_atype_array_nestable,
- ustctl_atype_sequence_nestable,
- ustctl_atype_struct_nestable,
- ustctl_atype_variant_nestable,
- NR_USTCTL_ABSTRACT_TYPES,
+enum lttng_ust_ctl_abstract_types {
+ lttng_ust_ctl_atype_integer,
+ lttng_ust_ctl_atype_enum, /* legacy */
+ lttng_ust_ctl_atype_array, /* legacy */
+ lttng_ust_ctl_atype_sequence, /* legacy */
+ lttng_ust_ctl_atype_string,
+ lttng_ust_ctl_atype_float,
+ lttng_ust_ctl_atype_variant, /* legacy */
+ lttng_ust_ctl_atype_struct, /* legacy */
+ lttng_ust_ctl_atype_enum_nestable,
+ lttng_ust_ctl_atype_array_nestable,
+ lttng_ust_ctl_atype_sequence_nestable,
+ lttng_ust_ctl_atype_struct_nestable,
+ lttng_ust_ctl_atype_variant_nestable,
+ NR_LTTNG_UST_CTL_ABSTRACT_TYPES,
};
-enum ustctl_string_encodings {
- ustctl_encode_none = 0,
- ustctl_encode_UTF8 = 1,
- ustctl_encode_ASCII = 2,
- NR_USTCTL_STRING_ENCODINGS,
+enum lttng_ust_ctl_string_encodings {
+ lttng_ust_ctl_encode_none = 0,
+ lttng_ust_ctl_encode_UTF8 = 1,
+ lttng_ust_ctl_encode_ASCII = 2,
+ NR_LTTNG_UST_CTL_STRING_ENCODINGS,
};
-#define USTCTL_UST_INTEGER_TYPE_PADDING 24
-struct ustctl_integer_type {
+#define LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING 24
+struct lttng_ust_ctl_integer_type {
uint32_t size; /* in bits */
uint32_t signedness;
uint32_t reverse_byte_order;
uint32_t base; /* 2, 8, 10, 16, for pretty print */
- int32_t encoding; /* enum ustctl_string_encodings */
+ int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
uint16_t alignment; /* in bits */
- char padding[USTCTL_UST_INTEGER_TYPE_PADDING];
+ char padding[LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING];
} LTTNG_PACKED;
-#define USTCTL_UST_FLOAT_TYPE_PADDING 24
-struct ustctl_float_type {
+#define LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING 24
+struct lttng_ust_ctl_float_type {
uint32_t exp_dig; /* exponent digits, in bits */
uint32_t mant_dig; /* mantissa digits, in bits */
uint32_t reverse_byte_order;
uint16_t alignment; /* in bits */
- char padding[USTCTL_UST_FLOAT_TYPE_PADDING];
+ char padding[LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING];
} LTTNG_PACKED;
-#define USTCTL_UST_ENUM_VALUE_PADDING 15
-struct ustctl_enum_value {
+#define LTTNG_UST_CTL_UST_ENUM_VALUE_PADDING 15
+struct lttng_ust_ctl_enum_value {
uint64_t value;
uint8_t signedness;
- char padding[USTCTL_UST_ENUM_VALUE_PADDING];
+ char padding[LTTNG_UST_CTL_UST_ENUM_VALUE_PADDING];
} LTTNG_PACKED;
-enum ustctl_ust_enum_entry_options {
- USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO = 1U << 0,
+enum lttng_ust_ctl_ust_enum_entry_options {
+ LTTNG_UST_CTL_UST_ENUM_ENTRY_OPTION_IS_AUTO = 1U << 0,
};
-#define USTCTL_UST_ENUM_ENTRY_PADDING 32
-struct ustctl_enum_entry {
- struct ustctl_enum_value start, end; /* start and end are inclusive */
+#define LTTNG_UST_CTL_UST_ENUM_ENTRY_PADDING 32
+struct lttng_ust_ctl_enum_entry {
+ struct lttng_ust_ctl_enum_value start, end; /* start and end are inclusive */
char string[LTTNG_UST_ABI_SYM_NAME_LEN];
union {
struct {
uint32_t options;
} LTTNG_PACKED extra;
- char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
+ char padding[LTTNG_UST_CTL_UST_ENUM_ENTRY_PADDING];
} u;
} LTTNG_PACKED;
/* legacy */
-#define USTCTL_UST_BASIC_TYPE_PADDING 296
-union _ustctl_basic_type {
- struct ustctl_integer_type integer;
+#define LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING 296
+union _lttng_ust_ctl_basic_type {
+ struct lttng_ust_ctl_integer_type integer;
struct {
char name[LTTNG_UST_ABI_SYM_NAME_LEN];
- struct ustctl_integer_type container_type;
+ struct lttng_ust_ctl_integer_type container_type;
uint64_t id; /* enum ID in sessiond. */
} enumeration;
struct {
- int32_t encoding; /* enum ustctl_string_encodings */
+ int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
} string;
- struct ustctl_float_type _float;
- char padding[USTCTL_UST_BASIC_TYPE_PADDING];
+ struct lttng_ust_ctl_float_type _float;
+ char padding[LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING];
} LTTNG_PACKED;
/* legacy */
-struct ustctl_basic_type {
- enum ustctl_abstract_types atype;
+struct lttng_ust_ctl_basic_type {
+ enum lttng_ust_ctl_abstract_types atype;
union {
- union _ustctl_basic_type basic;
+ union _lttng_ust_ctl_basic_type basic;
} u;
} LTTNG_PACKED;
/*
* Padding is derived from largest member: u.legacy.sequence which
- * contains two basic types, each with USTCTL_UST_BASIC_TYPE_PADDING.
+ * contains two basic types, each with LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING.
*/
-#define USTCTL_UST_TYPE_PADDING (2 * USTCTL_UST_BASIC_TYPE_PADDING)
-struct ustctl_type {
- enum ustctl_abstract_types atype;
+#define LTTNG_UST_CTL_UST_TYPE_PADDING (2 * LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING)
+struct lttng_ust_ctl_type {
+ enum lttng_ust_ctl_abstract_types atype;
union {
- struct ustctl_integer_type integer;
- struct ustctl_float_type _float;
+ struct lttng_ust_ctl_integer_type integer;
+ struct lttng_ust_ctl_float_type _float;
struct {
- int32_t encoding; /* enum ustctl_string_encodings */
+ int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
} string;
struct {
char name[LTTNG_UST_ABI_SYM_NAME_LEN];
uint64_t id; /* enum ID in sessiond. */
- /* container_type follows after this struct ustctl_field. */
+ /* container_type follows after this struct lttng_ust_ctl_field. */
} enum_nestable;
struct {
uint32_t length; /* num. elems. */
uint32_t alignment;
- /* elem_type follows after this struct ustctl_field. */
+ /* elem_type follows after this struct lttng_ust_ctl_field. */
} array_nestable;
struct {
char length_name[LTTNG_UST_ABI_SYM_NAME_LEN];
struct {
uint32_t nr_fields;
uint32_t alignment;
- /* Followed by nr_fields struct ustctl_field. */
+ /* Followed by nr_fields struct lttng_ust_ctl_field. */
} struct_nestable;
struct {
uint32_t nr_choices;
char tag_name[LTTNG_UST_ABI_SYM_NAME_LEN];
uint32_t alignment;
- /* Followed by nr_choices struct ustctl_field. */
+ /* Followed by nr_choices struct lttng_ust_ctl_field. */
} variant_nestable;
/* Legacy ABI */
union {
- union _ustctl_basic_type basic;
+ union _lttng_ust_ctl_basic_type basic;
struct {
- struct ustctl_basic_type elem_type;
+ struct lttng_ust_ctl_basic_type elem_type;
uint32_t length; /* num. elems. */
} array;
struct {
- struct ustctl_basic_type length_type;
- struct ustctl_basic_type elem_type;
+ struct lttng_ust_ctl_basic_type length_type;
+ struct lttng_ust_ctl_basic_type elem_type;
} sequence;
struct {
uint32_t nr_fields;
- /* Followed by nr_fields struct ustctl_field. */
+ /* Followed by nr_fields struct lttng_ust_ctl_field. */
} _struct;
struct {
uint32_t nr_choices;
char tag_name[LTTNG_UST_ABI_SYM_NAME_LEN];
- /* Followed by nr_choices struct ustctl_field. */
+ /* Followed by nr_choices struct lttng_ust_ctl_field. */
} variant;
} legacy;
- char padding[USTCTL_UST_TYPE_PADDING];
+ char padding[LTTNG_UST_CTL_UST_TYPE_PADDING];
} u;
} LTTNG_PACKED;
-#define USTCTL_UST_FIELD_PADDING 28
-struct ustctl_field {
+#define LTTNG_UST_CTL_UST_FIELD_PADDING 28
+struct lttng_ust_ctl_field {
char name[LTTNG_UST_ABI_SYM_NAME_LEN];
- struct ustctl_type type;
- char padding[USTCTL_UST_FIELD_PADDING];
+ struct lttng_ust_ctl_type type;
+ char padding[LTTNG_UST_CTL_UST_FIELD_PADDING];
} LTTNG_PACKED;
/*
* If an error other than -LTTNG_UST_ERR_UNSUP_MAJOR is returned,
* the output fields are not populated.
*/
-int ustctl_recv_reg_msg(int sock,
- enum ustctl_socket_type *type,
+int lttng_ust_ctl_recv_reg_msg(int sock,
+ enum lttng_ust_ctl_socket_type *type,
uint32_t *major,
uint32_t *minor,
uint32_t *pid,
/*
* Returns 0 on success, negative UST or system error value on error.
* Receive the notification command. The "notify_cmd" can then be used
- * by the caller to find out which ustctl_recv_* function should be
- * called to receive the notification, and which ustctl_reply_* is
+ * by the caller to find out which lttng_ust_ctl_recv_* function should be
+ * called to receive the notification, and which lttng_ust_ctl_reply_* is
* appropriate.
*/
-int ustctl_recv_notify(int sock, enum ustctl_notify_cmd *notify_cmd);
+int lttng_ust_ctl_recv_notify(int sock, enum lttng_ust_ctl_notify_cmd *notify_cmd);
/*
* Returns 0 on success, negative UST or system error value on error.
*/
-int ustctl_recv_register_event(int sock,
+int lttng_ust_ctl_recv_register_event(int sock,
int *session_objd, /* session descriptor (output) */
int *channel_objd, /* channel descriptor (output) */
char *event_name, /*
* returns success.)
*/
size_t *nr_fields,
- struct ustctl_field **fields,
+ struct lttng_ust_ctl_field **fields,
char **model_emf_uri);
/*
* Returns 0 on success, negative error value on error.
*/
-int ustctl_reply_register_event(int sock,
+int lttng_ust_ctl_reply_register_event(int sock,
uint32_t id, /* event id (input) */
int ret_code); /* return code. 0 ok, negative error */
/*
* Returns 0 on success, negative UST or system error value on error.
*/
-int ustctl_recv_register_enum(int sock,
+int lttng_ust_ctl_recv_register_enum(int sock,
int *session_objd,
char *enum_name,
- struct ustctl_enum_entry **entries,
+ struct lttng_ust_ctl_enum_entry **entries,
size_t *nr_entries);
/*
* Returns 0 on success, negative error value on error.
*/
-int ustctl_reply_register_enum(int sock,
+int lttng_ust_ctl_reply_register_enum(int sock,
uint64_t id, /* enum id (input) */
int ret_code);
/*
* Returns 0 on success, negative UST or system error value on error.
*/
-int ustctl_recv_register_channel(int sock,
+int lttng_ust_ctl_recv_register_channel(int sock,
int *session_objd, /* session descriptor (output) */
int *channel_objd, /* channel descriptor (output) */
size_t *nr_fields, /* context fields */
- struct ustctl_field **fields);
+ struct lttng_ust_ctl_field **fields);
/*
* Returns 0 on success, negative error value on error.
*/
-int ustctl_reply_register_channel(int sock,
+int lttng_ust_ctl_reply_register_channel(int sock,
uint32_t chan_id,
- enum ustctl_channel_header header_type,
+ enum lttng_ust_ctl_channel_header header_type,
int ret_code); /* return code. 0 ok, negative error */
/*
* Counter API.
*/
-enum ustctl_counter_bitness {
- USTCTL_COUNTER_BITNESS_32 = 0,
- USTCTL_COUNTER_BITNESS_64 = 1,
+enum lttng_ust_ctl_counter_bitness {
+ LTTNG_UST_CTL_COUNTER_BITNESS_32 = 0,
+ LTTNG_UST_CTL_COUNTER_BITNESS_64 = 1,
};
-enum ustctl_counter_arithmetic {
- USTCTL_COUNTER_ARITHMETIC_MODULAR = 0,
- USTCTL_COUNTER_ARITHMETIC_SATURATION = 1,
+enum lttng_ust_ctl_counter_arithmetic {
+ LTTNG_UST_CTL_COUNTER_ARITHMETIC_MODULAR = 0,
+ LTTNG_UST_CTL_COUNTER_ARITHMETIC_SATURATION = 1,
};
/* Used as alloc flags. */
-enum ustctl_counter_alloc {
- USTCTL_COUNTER_ALLOC_PER_CPU = (1 << 0),
- USTCTL_COUNTER_ALLOC_GLOBAL = (1 << 1),
+enum lttng_ust_ctl_counter_alloc {
+ LTTNG_UST_CTL_COUNTER_ALLOC_PER_CPU = (1 << 0),
+ LTTNG_UST_CTL_COUNTER_ALLOC_GLOBAL = (1 << 1),
};
-struct ustctl_daemon_counter;
+struct lttng_ust_ctl_daemon_counter;
-int ustctl_get_nr_cpu_per_counter(void);
+int lttng_ust_ctl_get_nr_cpu_per_counter(void);
-struct ustctl_counter_dimension {
+struct lttng_ust_ctl_counter_dimension {
uint64_t size;
uint64_t underflow_index;
uint64_t overflow_index;
uint8_t has_overflow;
};
-struct ustctl_daemon_counter *
- ustctl_create_counter(size_t nr_dimensions,
- const struct ustctl_counter_dimension *dimensions,
+struct lttng_ust_ctl_daemon_counter *
+ lttng_ust_ctl_create_counter(size_t nr_dimensions,
+ const struct lttng_ust_ctl_counter_dimension *dimensions,
int64_t global_sum_step,
int global_counter_fd,
int nr_counter_cpu_fds,
const int *counter_cpu_fds,
- enum ustctl_counter_bitness bitness,
- enum ustctl_counter_arithmetic arithmetic,
+ enum lttng_ust_ctl_counter_bitness bitness,
+ enum lttng_ust_ctl_counter_arithmetic arithmetic,
uint32_t alloc_flags,
bool coalesce_hits);
-int ustctl_create_counter_data(struct ustctl_daemon_counter *counter,
+int lttng_ust_ctl_create_counter_data(struct lttng_ust_ctl_daemon_counter *counter,
struct lttng_ust_abi_object_data **counter_data);
-int ustctl_create_counter_global_data(struct ustctl_daemon_counter *counter,
+int lttng_ust_ctl_create_counter_global_data(struct lttng_ust_ctl_daemon_counter *counter,
struct lttng_ust_abi_object_data **counter_global_data);
-int ustctl_create_counter_cpu_data(struct ustctl_daemon_counter *counter, int cpu,
+int lttng_ust_ctl_create_counter_cpu_data(struct lttng_ust_ctl_daemon_counter *counter, int cpu,
struct lttng_ust_abi_object_data **counter_cpu_data);
/*
* Each counter data and counter cpu data created need to be destroyed
- * before calling ustctl_destroy_counter().
+ * before calling lttng_ust_ctl_destroy_counter().
*/
-void ustctl_destroy_counter(struct ustctl_daemon_counter *counter);
+void lttng_ust_ctl_destroy_counter(struct lttng_ust_ctl_daemon_counter *counter);
-int ustctl_send_counter_data_to_ust(int sock, int parent_handle,
+int lttng_ust_ctl_send_counter_data_to_ust(int sock, int parent_handle,
struct lttng_ust_abi_object_data *counter_data);
-int ustctl_send_counter_global_data_to_ust(int sock,
+int lttng_ust_ctl_send_counter_global_data_to_ust(int sock,
struct lttng_ust_abi_object_data *counter_data,
struct lttng_ust_abi_object_data *counter_global_data);
-int ustctl_send_counter_cpu_data_to_ust(int sock,
+int lttng_ust_ctl_send_counter_cpu_data_to_ust(int sock,
struct lttng_ust_abi_object_data *counter_data,
struct lttng_ust_abi_object_data *counter_cpu_data);
-int ustctl_counter_read(struct ustctl_daemon_counter *counter,
+int lttng_ust_ctl_counter_read(struct lttng_ust_ctl_daemon_counter *counter,
const size_t *dimension_indexes,
int cpu, int64_t *value,
bool *overflow, bool *underflow);
-int ustctl_counter_aggregate(struct ustctl_daemon_counter *counter,
+int lttng_ust_ctl_counter_aggregate(struct lttng_ust_ctl_daemon_counter *counter,
const size_t *dimension_indexes,
int64_t *value,
bool *overflow, bool *underflow);
-int ustctl_counter_clear(struct ustctl_daemon_counter *counter,
+int lttng_ust_ctl_counter_clear(struct lttng_ust_ctl_daemon_counter *counter,
const size_t *dimension_indexes);
#endif /* LTTNG_UST_CTL_INTERNAL_H */
#include "ust-field-utils.h"
/*
- * The ustctl_field is made of a combination of C basic types
- * ustctl_basic_type and _ustctl_basic_type.
+ * The lttng_ust_ctl_field is made of a combination of C basic types
+ * lttng_ust_ctl_basic_type and _lttng_ust_ctl_basic_type.
*
- * ustctl_basic_type contains an enumeration describing the abstract type.
- * _ustctl_basic_type does _NOT_ contain an enumeration describing the
+ * lttng_ust_ctl_basic_type contains an enumeration describing the abstract type.
+ * _lttng_ust_ctl_basic_type does _NOT_ contain an enumeration describing the
* abstract type.
*
* A layer is needed to use the same code for both structures.
- * When dealing with _ustctl_basic_type, we need to use the abstract type of
- * the ustctl_type struct.
+ * When dealing with _lttng_ust_ctl_basic_type, we need to use the abstract type of
+ * the lttng_ust_ctl_type struct.
*/
/*
- * Compare two ustctl_integer_type fields.
+ * Compare two lttng_ust_ctl_integer_type fields.
* Returns 1 if both are identical.
*/
-static bool match_ustctl_field_integer(const struct ustctl_integer_type *first,
- const struct ustctl_integer_type *second)
+static bool match_lttng_ust_ctl_field_integer(const struct lttng_ust_ctl_integer_type *first,
+ const struct lttng_ust_ctl_integer_type *second)
{
if (first->size != second->size) {
goto no_match;
}
/*
- * Compare two _ustctl_basic_type fields known to be of type integer.
+ * Compare two _lttng_ust_ctl_basic_type fields known to be of type integer.
* Returns 1 if both are identical.
*/
-static bool match_ustctl_field_integer_from_raw_basic_type(
- const union _ustctl_basic_type *first,
- const union _ustctl_basic_type *second)
+static bool match_lttng_ust_ctl_field_integer_from_raw_basic_type(
+ const union _lttng_ust_ctl_basic_type *first,
+ const union _lttng_ust_ctl_basic_type *second)
{
- return match_ustctl_field_integer(&first->integer, &second->integer);
+ return match_lttng_ust_ctl_field_integer(&first->integer, &second->integer);
}
/*
- * Compare two _ustctl_basic_type fields known to be of type enum.
+ * Compare two _lttng_ust_ctl_basic_type fields known to be of type enum.
* Returns 1 if both are identical.
*/
-static bool match_ustctl_field_enum_from_raw_basic_type(
- const union _ustctl_basic_type *first,
- const union _ustctl_basic_type *second)
+static bool match_lttng_ust_ctl_field_enum_from_raw_basic_type(
+ const union _lttng_ust_ctl_basic_type *first,
+ const union _lttng_ust_ctl_basic_type *second)
{
/*
* Compare enumeration ID. Enumeration ID is provided to the application by
LTTNG_UST_ABI_SYM_NAME_LEN)) {
goto no_match;
}
- if (!match_ustctl_field_integer(&first->enumeration.container_type,
+ if (!match_lttng_ust_ctl_field_integer(&first->enumeration.container_type,
&second->enumeration.container_type)) {
goto no_match;
}
}
/*
- * Compare two _ustctl_basic_type fields known to be of type string.
+ * Compare two _lttng_ust_ctl_basic_type fields known to be of type string.
* Returns 1 if both are identical.
*/
-static bool match_ustctl_field_string_from_raw_basic_type(
- const union _ustctl_basic_type *first,
- const union _ustctl_basic_type *second)
+static bool match_lttng_ust_ctl_field_string_from_raw_basic_type(
+ const union _lttng_ust_ctl_basic_type *first,
+ const union _lttng_ust_ctl_basic_type *second)
{
return first->string.encoding == second->string.encoding;
}
/*
- * Compare two _ustctl_basic_type fields known to be of type float.
+ * Compare two _lttng_ust_ctl_basic_type fields known to be of type float.
* Returns 1 if both are identical.
*/
-static bool match_ustctl_field_float_from_raw_basic_type(
- const union _ustctl_basic_type *first,
- const union _ustctl_basic_type *second)
+static bool match_lttng_ust_ctl_field_float_from_raw_basic_type(
+ const union _lttng_ust_ctl_basic_type *first,
+ const union _lttng_ust_ctl_basic_type *second)
{
if (first->_float.exp_dig != second->_float.exp_dig) {
goto no_match;
}
/*
- * Compare two _ustctl_basic_type fields given their respective abstract types.
+ * Compare two _lttng_ust_ctl_basic_type fields given their respective abstract types.
* Returns 1 if both are identical.
*/
-static bool match_ustctl_field_raw_basic_type(
- enum ustctl_abstract_types first_atype,
- const union _ustctl_basic_type *first,
- enum ustctl_abstract_types second_atype,
- const union _ustctl_basic_type *second)
+static bool match_lttng_ust_ctl_field_raw_basic_type(
+ enum lttng_ust_ctl_abstract_types first_atype,
+ const union _lttng_ust_ctl_basic_type *first,
+ enum lttng_ust_ctl_abstract_types second_atype,
+ const union _lttng_ust_ctl_basic_type *second)
{
if (first_atype != second_atype) {
goto no_match;
}
switch (first_atype) {
- case ustctl_atype_integer:
- if (!match_ustctl_field_integer_from_raw_basic_type(first, second)) {
+ case lttng_ust_ctl_atype_integer:
+ if (!match_lttng_ust_ctl_field_integer_from_raw_basic_type(first, second)) {
goto no_match;
}
break;
- case ustctl_atype_enum:
- if (!match_ustctl_field_enum_from_raw_basic_type(first, second)) {
+ case lttng_ust_ctl_atype_enum:
+ if (!match_lttng_ust_ctl_field_enum_from_raw_basic_type(first, second)) {
goto no_match;
}
break;
- case ustctl_atype_string:
- if (!match_ustctl_field_string_from_raw_basic_type(first, second)) {
+ case lttng_ust_ctl_atype_string:
+ if (!match_lttng_ust_ctl_field_string_from_raw_basic_type(first, second)) {
goto no_match;
}
break;
- case ustctl_atype_float:
- if (!match_ustctl_field_float_from_raw_basic_type(first, second)) {
+ case lttng_ust_ctl_atype_float:
+ if (!match_lttng_ust_ctl_field_float_from_raw_basic_type(first, second)) {
goto no_match;
}
break;
}
/*
- * Compatibility layer between the ustctl_basic_type struct and
- * _ustctl_basic_type union.
+ * Compatibility layer between the lttng_ust_ctl_basic_type struct and
+ * _lttng_ust_ctl_basic_type union.
*/
-static bool match_ustctl_field_basic_type(const struct ustctl_basic_type *first,
- const struct ustctl_basic_type *second)
+static bool match_lttng_ust_ctl_field_basic_type(const struct lttng_ust_ctl_basic_type *first,
+ const struct lttng_ust_ctl_basic_type *second)
{
- return match_ustctl_field_raw_basic_type(first->atype, &first->u.basic,
+ return match_lttng_ust_ctl_field_raw_basic_type(first->atype, &first->u.basic,
second->atype, &second->u.basic);
}
-int match_ustctl_field(const struct ustctl_field *first,
- const struct ustctl_field *second)
+int match_lttng_ust_ctl_field(const struct lttng_ust_ctl_field *first,
+ const struct lttng_ust_ctl_field *second)
{
/* Check the name of the field is identical. */
if (strncmp(first->name, second->name, LTTNG_UST_ABI_SYM_NAME_LEN)) {
/* Check the field layout. */
switch (first->type.atype) {
- case ustctl_atype_integer:
- case ustctl_atype_enum:
- case ustctl_atype_string:
- case ustctl_atype_float:
- if (!match_ustctl_field_raw_basic_type(first->type.atype,
+ case lttng_ust_ctl_atype_integer:
+ case lttng_ust_ctl_atype_enum:
+ case lttng_ust_ctl_atype_string:
+ case lttng_ust_ctl_atype_float:
+ if (!match_lttng_ust_ctl_field_raw_basic_type(first->type.atype,
&first->type.u.legacy.basic, second->type.atype,
&second->type.u.legacy.basic)) {
goto no_match;
}
break;
- case ustctl_atype_sequence:
+ case lttng_ust_ctl_atype_sequence:
/* Match element type of the sequence. */
- if (!match_ustctl_field_basic_type(&first->type.u.legacy.sequence.elem_type,
+ if (!match_lttng_ust_ctl_field_basic_type(&first->type.u.legacy.sequence.elem_type,
&second->type.u.legacy.sequence.elem_type)) {
goto no_match;
}
/* Match length type of the sequence. */
- if (!match_ustctl_field_basic_type(&first->type.u.legacy.sequence.length_type,
+ if (!match_lttng_ust_ctl_field_basic_type(&first->type.u.legacy.sequence.length_type,
&second->type.u.legacy.sequence.length_type)) {
goto no_match;
}
break;
- case ustctl_atype_array:
+ case lttng_ust_ctl_atype_array:
/* Match element type of the array. */
- if (!match_ustctl_field_basic_type(&first->type.u.legacy.array.elem_type,
+ if (!match_lttng_ust_ctl_field_basic_type(&first->type.u.legacy.array.elem_type,
&second->type.u.legacy.array.elem_type)) {
goto no_match;
}
goto no_match;
}
break;
- case ustctl_atype_variant:
+ case lttng_ust_ctl_atype_variant:
/* Compare number of choice of the variants. */
if (first->type.u.legacy.variant.nr_choices !=
second->type.u.legacy.variant.nr_choices) {
goto no_match;
}
break;
- case ustctl_atype_struct:
+ case lttng_ust_ctl_atype_struct:
/* Compare number of fields of the structs. */
if (first->type.u.legacy._struct.nr_fields != second->type.u.legacy._struct.nr_fields) {
goto no_match;
}
break;
- case ustctl_atype_sequence_nestable:
+ case lttng_ust_ctl_atype_sequence_nestable:
if (first->type.u.sequence_nestable.alignment != second->type.u.sequence_nestable.alignment) {
goto no_match;
}
}
/* Comparison will be done when marshalling following items. */
break;
- case ustctl_atype_array_nestable:
+ case lttng_ust_ctl_atype_array_nestable:
if (first->type.u.array_nestable.alignment != second->type.u.array_nestable.alignment) {
goto no_match;
}
}
/* Comparison of element type will be done when marshalling following item. */
break;
- case ustctl_atype_enum_nestable:
+ case lttng_ust_ctl_atype_enum_nestable:
if (first->type.u.enum_nestable.id != second->type.u.enum_nestable.id) {
goto no_match;
}
}
/* Comparison of element type will be done when marshalling following item. */
break;
- case ustctl_atype_struct_nestable:
+ case lttng_ust_ctl_atype_struct_nestable:
if (first->type.u.struct_nestable.alignment != second->type.u.struct_nestable.alignment) {
goto no_match;
}
goto no_match;
}
break;
- case ustctl_atype_variant_nestable:
+ case lttng_ust_ctl_atype_variant_nestable:
if (first->type.u.variant_nestable.alignment != second->type.u.variant_nestable.alignment) {
goto no_match;
}
* Compare two UST fields.
* Return 1 if both fields have identical definition, 0 otherwise.
*/
-int match_ustctl_field(const struct ustctl_field *first,
- const struct ustctl_field *second);
+int match_lttng_ust_ctl_field(const struct lttng_ust_ctl_field *first,
+ const struct lttng_ust_ctl_field *second);
#endif /* LTTNG_UST_FIELD_UTILS_H */
static
int _lttng_field_statedump(struct ust_registry_session *session,
- const struct ustctl_field *fields, size_t nr_fields,
+ const struct lttng_ust_ctl_field *fields, size_t nr_fields,
size_t *iter_field, size_t nesting);
static inline
int ust_metadata_enum_statedump(struct ust_registry_session *session,
const char *enum_name,
uint64_t enum_id,
- const struct ustctl_integer_type *container_type,
+ const struct lttng_ust_ctl_integer_type *container_type,
const char *field_name, size_t *iter_field, size_t nesting)
{
struct ust_registry_enum *reg_enum;
- const struct ustctl_enum_entry *entries;
+ const struct lttng_ust_ctl_enum_entry *entries;
size_t nr_entries;
int ret = 0;
size_t i;
container_type->size,
container_type->alignment,
container_type->signedness,
- (container_type->encoding == ustctl_encode_none)
+ (container_type->encoding == lttng_ust_ctl_encode_none)
? "none"
- : (container_type->encoding == ustctl_encode_UTF8)
+ : (container_type->encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII",
container_type->base);
nesting++;
/* Dump all entries */
for (i = 0; i < nr_entries; i++) {
- const struct ustctl_enum_entry *entry = &entries[i];
+ const struct lttng_ust_ctl_enum_entry *entry = &entries[i];
int j, len;
ret = print_tabs(session, nesting);
}
if (entry->u.extra.options &
- USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO) {
+ LTTNG_UST_CTL_UST_ENUM_ENTRY_OPTION_IS_AUTO) {
ret = lttng_metadata_printf(session, ",\n");
if (ret) {
goto end;
int _lttng_variant_statedump(struct ust_registry_session *session,
uint32_t nr_choices, const char *tag_name,
uint32_t alignment,
- const struct ustctl_field *fields, size_t nr_fields,
+ const struct lttng_ust_ctl_field *fields, size_t nr_fields,
size_t *iter_field, size_t nesting)
{
- const struct ustctl_field *variant = &fields[*iter_field];
+ const struct lttng_ust_ctl_field *variant = &fields[*iter_field];
uint32_t i;
int ret;
char identifier[LTTNG_UST_ABI_SYM_NAME_LEN];
- if (variant->type.atype != ustctl_atype_variant) {
+ if (variant->type.atype != lttng_ust_ctl_atype_variant) {
ret = -EINVAL;
goto end;
}
static
int _lttng_field_statedump(struct ust_registry_session *session,
- const struct ustctl_field *fields, size_t nr_fields,
+ const struct lttng_ust_ctl_field *fields, size_t nr_fields,
size_t *iter_field, size_t nesting)
{
int ret = 0;
const char *bo_le = " byte_order = le;";
const char *bo_native = "";
const char *bo_reverse;
- const struct ustctl_field *field;
+ const struct lttng_ust_ctl_field *field;
if (*iter_field >= nr_fields) {
ret = -EOVERFLOW;
}
switch (field->type.atype) {
- case ustctl_atype_integer:
+ case lttng_ust_ctl_atype_integer:
ret = print_tabs(session, nesting);
if (ret) {
goto end;
field->type.u.integer.size,
field->type.u.integer.alignment,
field->type.u.integer.signedness,
- (field->type.u.integer.encoding == ustctl_encode_none)
+ (field->type.u.integer.encoding == lttng_ust_ctl_encode_none)
? "none"
- : (field->type.u.integer.encoding == ustctl_encode_UTF8)
+ : (field->type.u.integer.encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII",
field->type.u.integer.base,
field->name);
(*iter_field)++;
break;
- case ustctl_atype_enum:
+ case lttng_ust_ctl_atype_enum:
ret = ust_metadata_enum_statedump(session,
field->type.u.legacy.basic.enumeration.name,
field->type.u.legacy.basic.enumeration.id,
&field->type.u.legacy.basic.enumeration.container_type,
field->name, iter_field, nesting);
break;
- case ustctl_atype_float:
+ case lttng_ust_ctl_atype_float:
ret = print_tabs(session, nesting);
if (ret) {
goto end;
field->name);
(*iter_field)++;
break;
- case ustctl_atype_array:
+ case lttng_ust_ctl_atype_array:
{
- const struct ustctl_basic_type *elem_type;
+ const struct lttng_ust_ctl_basic_type *elem_type;
ret = print_tabs(session, nesting);
if (ret) {
}
elem_type = &field->type.u.legacy.array.elem_type;
/* Only integers are currently supported in arrays. */
- if (elem_type->atype != ustctl_atype_integer) {
+ if (elem_type->atype != lttng_ust_ctl_atype_integer) {
ret = -EINVAL;
goto end;
}
elem_type->u.basic.integer.size,
elem_type->u.basic.integer.alignment,
elem_type->u.basic.integer.signedness,
- (elem_type->u.basic.integer.encoding == ustctl_encode_none)
+ (elem_type->u.basic.integer.encoding == lttng_ust_ctl_encode_none)
? "none"
- : (elem_type->u.basic.integer.encoding == ustctl_encode_UTF8)
+ : (elem_type->u.basic.integer.encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII",
elem_type->u.basic.integer.base,
(*iter_field)++;
break;
}
- case ustctl_atype_array_nestable:
+ case lttng_ust_ctl_atype_array_nestable:
{
uint32_t array_length;
- const struct ustctl_field *array_nestable;
- const struct ustctl_type *elem_type;
+ const struct lttng_ust_ctl_field *array_nestable;
+ const struct lttng_ust_ctl_type *elem_type;
array_length = field->type.u.array_nestable.length;
(*iter_field)++;
elem_type = &array_nestable->type;
/* Only integers are currently supported in arrays. */
- if (elem_type->atype != ustctl_atype_integer) {
+ if (elem_type->atype != lttng_ust_ctl_atype_integer) {
ret = -EINVAL;
goto end;
}
elem_type->u.integer.size,
elem_type->u.integer.alignment,
elem_type->u.integer.signedness,
- (elem_type->u.integer.encoding == ustctl_encode_none)
+ (elem_type->u.integer.encoding == lttng_ust_ctl_encode_none)
? "none"
- : (elem_type->u.integer.encoding == ustctl_encode_UTF8)
+ : (elem_type->u.integer.encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII",
elem_type->u.integer.base,
(*iter_field)++;
break;
}
- case ustctl_atype_sequence:
+ case lttng_ust_ctl_atype_sequence:
{
- const struct ustctl_basic_type *elem_type;
- const struct ustctl_basic_type *length_type;
+ const struct lttng_ust_ctl_basic_type *elem_type;
+ const struct lttng_ust_ctl_basic_type *length_type;
elem_type = &field->type.u.legacy.sequence.elem_type;
length_type = &field->type.u.legacy.sequence.length_type;
}
/* Only integers are currently supported in sequences. */
- if (elem_type->atype != ustctl_atype_integer) {
+ if (elem_type->atype != lttng_ust_ctl_atype_integer) {
ret = -EINVAL;
goto end;
}
length_type->u.basic.integer.size,
(unsigned int) length_type->u.basic.integer.alignment,
length_type->u.basic.integer.signedness,
- (length_type->u.basic.integer.encoding == ustctl_encode_none)
+ (length_type->u.basic.integer.encoding == lttng_ust_ctl_encode_none)
? "none"
- : ((length_type->u.basic.integer.encoding == ustctl_encode_UTF8)
+ : ((length_type->u.basic.integer.encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII"),
length_type->u.basic.integer.base,
elem_type->u.basic.integer.size,
(unsigned int) elem_type->u.basic.integer.alignment,
elem_type->u.basic.integer.signedness,
- (elem_type->u.basic.integer.encoding == ustctl_encode_none)
+ (elem_type->u.basic.integer.encoding == lttng_ust_ctl_encode_none)
? "none"
- : ((elem_type->u.basic.integer.encoding == ustctl_encode_UTF8)
+ : ((elem_type->u.basic.integer.encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII"),
elem_type->u.basic.integer.base,
(*iter_field)++;
break;
}
- case ustctl_atype_sequence_nestable:
+ case lttng_ust_ctl_atype_sequence_nestable:
{
- const struct ustctl_field *sequence_nestable;
- const struct ustctl_type *elem_type;
+ const struct lttng_ust_ctl_field *sequence_nestable;
+ const struct lttng_ust_ctl_type *elem_type;
(*iter_field)++;
if (*iter_field >= nr_fields) {
elem_type = &sequence_nestable->type;
/* Only integers are currently supported in sequences. */
- if (elem_type->atype != ustctl_atype_integer) {
+ if (elem_type->atype != lttng_ust_ctl_atype_integer) {
ret = -EINVAL;
goto end;
}
elem_type->u.integer.size,
(unsigned int) elem_type->u.integer.alignment,
elem_type->u.integer.signedness,
- (elem_type->u.integer.encoding == ustctl_encode_none)
+ (elem_type->u.integer.encoding == lttng_ust_ctl_encode_none)
? "none"
- : ((elem_type->u.integer.encoding == ustctl_encode_UTF8)
+ : ((elem_type->u.integer.encoding == lttng_ust_ctl_encode_UTF8)
? "UTF8"
: "ASCII"),
elem_type->u.integer.base,
(*iter_field)++;
break;
}
- case ustctl_atype_string:
+ case lttng_ust_ctl_atype_string:
/* Default encoding is UTF8 */
ret = print_tabs(session, nesting);
if (ret) {
}
ret = lttng_metadata_printf(session,
"string%s _%s;\n",
- field->type.u.string.encoding == ustctl_encode_ASCII ?
+ field->type.u.string.encoding == lttng_ust_ctl_encode_ASCII ?
" { encoding = ASCII; }" : "",
field->name);
(*iter_field)++;
break;
- case ustctl_atype_variant:
+ case lttng_ust_ctl_atype_variant:
ret = _lttng_variant_statedump(session,
field->type.u.legacy.variant.nr_choices,
field->type.u.legacy.variant.tag_name,
goto end;
}
break;
- case ustctl_atype_variant_nestable:
+ case lttng_ust_ctl_atype_variant_nestable:
ret = _lttng_variant_statedump(session,
field->type.u.variant_nestable.nr_choices,
field->type.u.variant_nestable.tag_name,
goto end;
}
break;
- case ustctl_atype_struct:
+ case lttng_ust_ctl_atype_struct:
if (field->type.u.legacy._struct.nr_fields != 0) {
/* Currently only 0-length structures are supported. */
ret = -EINVAL;
field->name);
(*iter_field)++;
break;
- case ustctl_atype_struct_nestable:
+ case lttng_ust_ctl_atype_struct_nestable:
if (field->type.u.struct_nestable.nr_fields != 0) {
/* Currently only 0-length structures are supported. */
ret = -EINVAL;
}
(*iter_field)++;
break;
- case ustctl_atype_enum_nestable:
+ case lttng_ust_ctl_atype_enum_nestable:
{
- const struct ustctl_field *container_field;
- const struct ustctl_type *container_type;
+ const struct lttng_ust_ctl_field *container_field;
+ const struct lttng_ust_ctl_type *container_type;
(*iter_field)++;
if (*iter_field >= nr_fields) {
container_type = &container_field->type;
/* Only integers are supported as container types. */
- if (container_type->atype != ustctl_atype_integer) {
+ if (container_type->atype != lttng_ust_ctl_atype_integer) {
ret = -EINVAL;
goto end;
}
static
int _lttng_context_metadata_statedump(struct ust_registry_session *session,
size_t nr_ctx_fields,
- struct ustctl_field *ctx)
+ struct lttng_ust_ctl_field *ctx)
{
int ret = 0;
size_t i = 0;
" event.header := %s;\n"
" packet.context := struct packet_context;\n",
chan->chan_id,
- chan->header_type == USTCTL_CHANNEL_HEADER_COMPACT ?
+ chan->header_type == LTTNG_UST_CTL_CHANNEL_HEADER_COMPACT ?
"struct event_header_compact" :
"struct event_header_large");
if (ret) {
/* Compare each field individually. */
for (i = 0; i < event->nr_fields; i++) {
- if (!match_ustctl_field(&event->fields[i], &key->fields[i])) {
+ if (!match_lttng_ust_ctl_field(&event->fields[i], &key->fields[i])) {
goto no_match;
}
}
goto end;
}
for (i = 0; i < reg_enum_a->nr_entries; i++) {
- const struct ustctl_enum_entry *entries_a, *entries_b;
+ const struct lttng_ust_ctl_enum_entry *entries_a, *entries_b;
entries_a = ®_enum_a->entries[i];
entries_b = ®_enum_b->entries[i];
* trace reader.
*/
static
-int validate_event_field(struct ustctl_field *field,
+int validate_event_field(struct lttng_ust_ctl_field *field,
const char *event_name,
struct ust_app *app)
{
int ret = 0;
switch(field->type.atype) {
- case ustctl_atype_integer:
- case ustctl_atype_enum:
- case ustctl_atype_array:
- case ustctl_atype_sequence:
- case ustctl_atype_string:
- case ustctl_atype_variant:
- case ustctl_atype_array_nestable:
- case ustctl_atype_sequence_nestable:
- case ustctl_atype_enum_nestable:
- case ustctl_atype_variant_nestable:
+ case lttng_ust_ctl_atype_integer:
+ case lttng_ust_ctl_atype_enum:
+ case lttng_ust_ctl_atype_array:
+ case lttng_ust_ctl_atype_sequence:
+ case lttng_ust_ctl_atype_string:
+ case lttng_ust_ctl_atype_variant:
+ case lttng_ust_ctl_atype_array_nestable:
+ case lttng_ust_ctl_atype_sequence_nestable:
+ case lttng_ust_ctl_atype_enum_nestable:
+ case lttng_ust_ctl_atype_variant_nestable:
break;
- case ustctl_atype_struct:
+ case lttng_ust_ctl_atype_struct:
if (field->type.u.legacy._struct.nr_fields != 0) {
WARN("Unsupported non-empty struct field.");
ret = -EINVAL;
goto end;
}
break;
- case ustctl_atype_struct_nestable:
+ case lttng_ust_ctl_atype_struct_nestable:
if (field->type.u.struct_nestable.nr_fields != 0) {
WARN("Unsupported non-empty struct field.");
ret = -EINVAL;
}
break;
- case ustctl_atype_float:
+ case lttng_ust_ctl_atype_float:
switch (field->type.u._float.mant_dig) {
case 0:
WARN("UST application '%s' (pid: %d) has unknown float mantissa '%u' "
}
static
-int validate_event_fields(size_t nr_fields, struct ustctl_field *fields,
+int validate_event_fields(size_t nr_fields, struct lttng_ust_ctl_field *fields,
const char *event_name, struct ust_app *app)
{
unsigned int i;
*/
static struct ust_registry_event *alloc_event(int session_objd,
int channel_objd, char *name, char *sig, size_t nr_fields,
- struct ustctl_field *fields, int loglevel_value,
+ struct lttng_ust_ctl_field *fields, int loglevel_value,
char *model_emf_uri, struct ust_app *app)
{
struct ust_registry_event *event = NULL;
*/
int ust_registry_create_event(struct ust_registry_session *session,
uint64_t chan_key, int session_objd, int channel_objd, char *name,
- char *sig, size_t nr_fields, struct ustctl_field *fields,
+ char *sig, size_t nr_fields, struct lttng_ust_ctl_field *fields,
int loglevel_value, char *model_emf_uri, int buffer_type,
uint32_t *event_id_p, struct ust_app *app)
{
*/
int ust_registry_create_or_find_enum(struct ust_registry_session *session,
int session_objd, char *enum_name,
- struct ustctl_enum_entry *entries, size_t nr_entries,
+ struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries,
uint64_t *enum_id)
{
int ret = 0;
uint64_t consumer_key;
/* Id set when replying to a register channel. */
uint32_t chan_id;
- enum ustctl_channel_header header_type;
+ enum lttng_ust_ctl_channel_header header_type;
/*
* Flag for this channel if the metadata was dumped once during
* register channel notification from the UST tracer.
*/
size_t nr_ctx_fields;
- struct ustctl_field *ctx_fields;
+ struct lttng_ust_ctl_field *ctx_fields;
struct lttng_ht_node_u64 node;
/* For delayed reclaim */
struct rcu_head rcu_head;
char *signature;
int loglevel_value;
size_t nr_fields;
- struct ustctl_field *fields;
+ struct lttng_ust_ctl_field *fields;
char *model_emf_uri;
/*
* Flag for this channel if the metadata was dumped once during
struct ust_registry_enum {
char name[LTTNG_UST_ABI_SYM_NAME_LEN];
- struct ustctl_enum_entry *entries;
+ struct lttng_ust_ctl_enum_entry *entries;
size_t nr_entries;
uint64_t id; /* enum id in session */
/* Enumeration node in session hash table. */
int ust_registry_create_event(struct ust_registry_session *session,
uint64_t chan_key, int session_objd, int channel_objd, char *name,
- char *sig, size_t nr_fields, struct ustctl_field *fields,
+ char *sig, size_t nr_fields, struct lttng_ust_ctl_field *fields,
int loglevel_value, char *model_emf_uri, int buffer_type,
uint32_t *event_id_p, struct ust_app *app);
struct ust_registry_event *ust_registry_find_event(
struct ust_registry_event *event);
int ust_registry_create_or_find_enum(struct ust_registry_session *session,
int session_objd, char *name,
- struct ustctl_enum_entry *entries, size_t nr_entries,
+ struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries,
uint64_t *enum_id);
struct ust_registry_enum *
ust_registry_lookup_enum_by_id(struct ust_registry_session *session,
static inline
int ust_registry_create_event(struct ust_registry_session *session,
uint64_t chan_key, int session_objd, int channel_objd, char *name,
- char *sig, size_t nr_fields, struct ustctl_field *fields,
+ char *sig, size_t nr_fields, struct lttng_ust_ctl_field *fields,
int loglevel_value, char *model_emf_uri, int buffer_type,
uint32_t *event_id_p)
{
static inline
int ust_registry_create_or_find_enum(struct ust_registry_session *session,
int session_objd, char *name,
- struct ustctl_enum_entry *entries, size_t nr_entries,
+ struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries,
uint64_t *enum_id)
{
return 0;
struct lttng_dynamic_buffer contents;
/*
* Lock to update the metadata cache and push into the ring_buffer
- * (ustctl_write_metadata_to_channel).
+ * (lttng_ust_ctl_write_metadata_to_channel).
*
* This is nested INSIDE the consumer_data lock.
*/
}
ret = lttng_ustconsumer_get_stream_id(stream, &stream_id);
if (ret < 0) {
- PERROR("ustctl_get_stream_id");
+ PERROR("lttng_ust_ctl_get_stream_id");
goto end;
}
DBG("Stream %" PRIu64 " empty, sending beacon", stream->key);
/* For UST */
uid_t ust_app_uid; /* Application UID. */
- struct ustctl_consumer_channel *uchan;
+ struct lttng_ust_ctl_consumer_channel *uchan;
unsigned char uuid[LTTNG_UUID_STR_LEN];
/*
* Temporary stream list used to store the streams once created and waiting
/* Stream name. Format is: <channel_name>_<cpu_number> */
char name[LTTNG_SYMBOL_NAME_LEN];
/* Internal state of libustctl. */
- struct ustctl_consumer_stream *ustream;
+ struct lttng_ust_ctl_consumer_stream *ustream;
struct cds_list_head send_node;
/* On-disk circular buffer */
uint64_t tracefile_size_current;
health_code_update();
cds_list_del(&stream->send_node);
- ustctl_destroy_stream(stream->ustream);
+ lttng_ust_ctl_destroy_stream(stream->ustream);
lttng_trace_chunk_put(stream->trace_chunk);
free(stream);
}
struct lttng_consumer_local_data *ctx)
{
int ret, cpu = 0;
- struct ustctl_consumer_stream *ustream;
+ struct lttng_ust_ctl_consumer_stream *ustream;
struct lttng_consumer_stream *stream;
pthread_mutex_t *current_stream_lock = NULL;
* While a stream is available from ustctl. When NULL is returned, we've
* reached the end of the possible stream for the channel.
*/
- while ((ustream = ustctl_create_stream(channel->uchan, cpu))) {
+ while ((ustream = lttng_ust_ctl_create_stream(channel->uchan, cpu))) {
int wait_fd;
int ust_metadata_pipe[2];
}
wait_fd = ust_metadata_pipe[0];
} else {
- wait_fd = ustctl_stream_get_wait_fd(ustream);
+ wait_fd = lttng_ust_ctl_stream_get_wait_fd(ustream);
}
/* Allocate consumer stream object. */
*/
cds_list_add_tail(&stream->send_node, &channel->streams.head);
- ret = ustctl_get_max_subbuf_size(stream->ustream,
+ ret = lttng_ust_ctl_get_max_subbuf_size(stream->ustream,
&stream->max_sb_size);
if (ret < 0) {
- ERR("ustctl_get_max_subbuf_size failed for stream %s",
+ ERR("lttng_ust_ctl_get_max_subbuf_size failed for stream %s",
stream->name);
goto error;
}
* Return 0 on success or else a negative value.
*/
static int create_ust_channel(struct lttng_consumer_channel *channel,
- struct ustctl_consumer_channel_attr *attr,
- struct ustctl_consumer_channel **ust_chanp)
+ struct lttng_ust_ctl_consumer_channel_attr *attr,
+ struct lttng_ust_ctl_consumer_channel **ust_chanp)
{
int ret, nr_stream_fds, i, j;
int *stream_fds;
- struct ustctl_consumer_channel *ust_channel;
+ struct lttng_ust_ctl_consumer_channel *ust_channel;
assert(channel);
assert(attr);
if (channel->type == CONSUMER_CHANNEL_TYPE_METADATA)
nr_stream_fds = 1;
else
- nr_stream_fds = ustctl_get_nr_stream_per_channel();
+ nr_stream_fds = lttng_ust_ctl_get_nr_stream_per_channel();
stream_fds = zmalloc(nr_stream_fds * sizeof(*stream_fds));
if (!stream_fds) {
ret = -1;
goto error_open;
}
}
- ust_channel = ustctl_create_channel(attr, stream_fds, nr_stream_fds);
+ ust_channel = lttng_ust_ctl_create_channel(attr, stream_fds, nr_stream_fds);
if (!ust_channel) {
ret = -1;
goto error_create;
DBG("UST consumer sending stream %" PRIu64 " to sessiond", stream->key);
/* Send stream to session daemon. */
- ret = ustctl_send_stream_to_sessiond(sock, stream->ustream);
+ ret = lttng_ust_ctl_send_stream_to_sessiond(sock, stream->ustream);
if (ret < 0) {
goto error;
}
}
/* Send channel to sessiond. */
- ret = ustctl_send_channel_to_sessiond(sock, channel->uchan);
+ ret = lttng_ust_ctl_send_channel_to_sessiond(sock, channel->uchan);
if (ret < 0) {
goto error;
}
- ret = ustctl_channel_close_wakeup_fd(channel->uchan);
+ ret = lttng_ust_ctl_channel_close_wakeup_fd(channel->uchan);
if (ret < 0) {
goto error;
}
}
/* Tell sessiond there is no more stream. */
- ret = ustctl_send_stream_to_sessiond(sock, NULL);
+ ret = lttng_ust_ctl_send_stream_to_sessiond(sock, NULL);
if (ret < 0) {
goto error;
}
*/
static int ask_channel(struct lttng_consumer_local_data *ctx,
struct lttng_consumer_channel *channel,
- struct ustctl_consumer_channel_attr *attr)
+ struct lttng_ust_ctl_consumer_channel_attr *attr)
{
int ret;
goto end;
}
- channel->wait_fd = ustctl_channel_get_wait_fd(channel->uchan);
+ channel->wait_fd = lttng_ust_ctl_channel_get_wait_fd(channel->uchan);
/*
* For the snapshots (no monitor), we create the metadata streams
}
if (!stream->quiescent) {
- ustctl_flush_buffer(stream->ustream, 0);
+ lttng_ust_ctl_flush_buffer(stream->ustream, 0);
stream->quiescent = true;
}
next:
unsigned long mmap_offset;
const char *mmap_base;
- mmap_base = ustctl_get_mmap_base(stream->ustream);
+ mmap_base = lttng_ust_ctl_get_mmap_base(stream->ustream);
if (!mmap_base) {
ERR("Failed to get mmap base for stream `%s`",
stream->name);
goto error;
}
- ret = ustctl_get_mmap_read_offset(stream->ustream, &mmap_offset);
+ ret = lttng_ust_ctl_get_mmap_read_offset(stream->ustream, &mmap_offset);
if (ret != 0) {
ERR("Failed to get mmap offset for stream `%s`", stream->name);
ret = -EINVAL;
* Else, if quiescent, it has already been done by the prior stop.
*/
if (!stream->quiescent) {
- ustctl_flush_buffer(stream->ustream, 0);
+ lttng_ust_ctl_flush_buffer(stream->ustream, 0);
}
ret = lttng_ustconsumer_take_snapshot(stream);
DBG("UST consumer taking snapshot at pos %lu", consumed_pos);
- ret = ustctl_get_subbuf(stream->ustream, &consumed_pos);
+ ret = lttng_ust_ctl_get_subbuf(stream->ustream, &consumed_pos);
if (ret < 0) {
if (ret != -EAGAIN) {
- PERROR("ustctl_get_subbuf snapshot");
+ PERROR("lttng_ust_ctl_get_subbuf snapshot");
goto error_close_stream;
}
DBG("UST consumer get subbuf failed. Skipping it.");
continue;
}
- ret = ustctl_get_subbuf_size(stream->ustream, &len);
+ ret = lttng_ust_ctl_get_subbuf_size(stream->ustream, &len);
if (ret < 0) {
- ERR("Snapshot ustctl_get_subbuf_size");
+ ERR("Snapshot lttng_ust_ctl_get_subbuf_size");
goto error_put_subbuf;
}
- ret = ustctl_get_padded_subbuf_size(stream->ustream, &padded_len);
+ ret = lttng_ust_ctl_get_padded_subbuf_size(stream->ustream, &padded_len);
if (ret < 0) {
- ERR("Snapshot ustctl_get_padded_subbuf_size");
+ ERR("Snapshot lttng_ust_ctl_get_padded_subbuf_size");
goto error_put_subbuf;
}
}
}
- ret = ustctl_put_subbuf(stream->ustream);
+ ret = lttng_ust_ctl_put_subbuf(stream->ustream);
if (ret < 0) {
- ERR("Snapshot ustctl_put_subbuf");
+ ERR("Snapshot lttng_ust_ctl_put_subbuf");
goto error_close_stream;
}
consumed_pos += stream->max_sb_size;
return 0;
error_put_subbuf:
- if (ustctl_put_subbuf(stream->ustream) < 0) {
- ERR("Snapshot ustctl_put_subbuf");
+ if (lttng_ust_ctl_put_subbuf(stream->ustream) < 0) {
+ ERR("Snapshot lttng_ust_ctl_put_subbuf");
}
error_close_stream:
consumer_stream_close(stream);
case LTTNG_CONSUMER_ASK_CHANNEL_CREATION:
{
int ret_ask_channel, ret_add_channel, ret_send;
- struct ustctl_consumer_channel_attr attr;
+ struct lttng_ust_ctl_consumer_channel_attr attr;
const uint64_t chunk_id = msg.u.ask_channel.chunk_id.value;
const struct lttng_credentials buffer_credentials = {
.uid = LTTNG_OPTIONAL_INIT_VALUE(msg.u.ask_channel.buffer_credentials.uid),
return ret_func;
}
-void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream,
+void lttng_lttng_ust_ctl_flush_buffer(struct lttng_consumer_stream *stream,
int producer_active)
{
assert(stream);
assert(stream->ustream);
- ustctl_flush_buffer(stream->ustream, producer_active);
+ lttng_ust_ctl_flush_buffer(stream->ustream, producer_active);
}
/*
assert(stream);
assert(stream->ustream);
- return ustctl_snapshot(stream->ustream);
+ return lttng_ust_ctl_snapshot(stream->ustream);
}
/*
assert(stream);
assert(stream->ustream);
- return ustctl_snapshot_sample_positions(stream->ustream);
+ return lttng_ust_ctl_snapshot_sample_positions(stream->ustream);
}
/*
assert(stream->ustream);
assert(pos);
- return ustctl_snapshot_get_produced(stream->ustream, pos);
+ return lttng_ust_ctl_snapshot_get_produced(stream->ustream, pos);
}
/*
assert(stream->ustream);
assert(pos);
- return ustctl_snapshot_get_consumed(stream->ustream, pos);
+ return lttng_ust_ctl_snapshot_get_consumed(stream->ustream, pos);
}
void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
assert(stream);
assert(stream->ustream);
- ustctl_flush_buffer(stream->ustream, producer);
+ lttng_ust_ctl_flush_buffer(stream->ustream, producer);
}
void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream)
assert(stream);
assert(stream->ustream);
- ustctl_clear_buffer(stream->ustream);
+ lttng_ust_ctl_clear_buffer(stream->ustream);
}
int lttng_ustconsumer_get_current_timestamp(
assert(stream->ustream);
assert(ts);
- return ustctl_get_current_timestamp(stream->ustream, ts);
+ return lttng_ust_ctl_get_current_timestamp(stream->ustream, ts);
}
int lttng_ustconsumer_get_sequence_number(
assert(stream->ustream);
assert(seq);
- return ustctl_get_sequence_number(stream->ustream, seq);
+ return lttng_ust_ctl_get_sequence_number(stream->ustream, seq);
}
/*
pthread_mutex_lock(&stream->lock);
if (!stream->quiescent) {
- ustctl_flush_buffer(stream->ustream, 0);
+ lttng_ust_ctl_flush_buffer(stream->ustream, 0);
stream->quiescent = true;
}
pthread_mutex_unlock(&stream->lock);
assert(chan->buffer_credentials.is_set);
consumer_metadata_cache_destroy(chan);
- ustctl_destroy_channel(chan->uchan);
+ lttng_ust_ctl_destroy_channel(chan->uchan);
/* Try to rmdir all directories under shm_path root. */
if (chan->root_shm_path[0]) {
(void) run_as_rmdir_recursive(chan->root_shm_path,
if (stream->chan->switch_timer_enabled == 1) {
consumer_timer_switch_stop(stream->chan);
}
- ustctl_destroy_stream(stream->ustream);
+ lttng_ust_ctl_destroy_stream(stream->ustream);
}
int lttng_ustconsumer_get_wakeup_fd(struct lttng_consumer_stream *stream)
assert(stream);
assert(stream->ustream);
- return ustctl_stream_get_wakeup_fd(stream->ustream);
+ return lttng_ust_ctl_stream_get_wakeup_fd(stream->ustream);
}
int lttng_ustconsumer_close_wakeup_fd(struct lttng_consumer_stream *stream)
assert(stream);
assert(stream->ustream);
- return ustctl_stream_close_wakeup_fd(stream->ustream);
+ return lttng_ust_ctl_stream_close_wakeup_fd(stream->ustream);
}
/*
}
}
- write_len = ustctl_write_one_packet_to_channel(stream->chan->uchan,
+ write_len = lttng_ust_ctl_write_one_packet_to_channel(stream->chan->uchan,
&stream->chan->metadata_cache->contents.data[stream->ust_metadata_pushed],
stream->chan->metadata_cache->contents.size -
stream->ust_metadata_pushed);
* a metadata packet. Since the subbuffer is fully filled (with padding,
* if needed), the stream is "quiescent" after this commit.
*/
- ustctl_flush_buffer(stream->ustream, 1);
+ lttng_ust_ctl_flush_buffer(stream->ustream, 1);
stream->quiescent = true;
end:
pthread_mutex_unlock(&stream->chan->metadata_cache->lock);
goto end;
}
- ret = ustctl_snapshot(metadata_stream->ustream);
+ ret = lttng_ust_ctl_snapshot(metadata_stream->ustream);
if (ret < 0) {
ERR("Failed to take a snapshot of the metadata ring-buffer positions, ret = %d", ret);
status = SYNC_METADATA_STATUS_ERROR;
struct lttng_consumer_local_data *ctx)
{
int ret;
- struct ustctl_consumer_stream *ustream;
+ struct lttng_ust_ctl_consumer_stream *ustream;
assert(stream);
assert(ctx);
* before reading the stream wait_fd.
*/
/* Get the next subbuffer */
- ret = ustctl_get_next_subbuf(ustream);
+ ret = lttng_ust_ctl_get_next_subbuf(ustream);
if (ret) {
/* No more data found, flag the stream. */
stream->has_data = 0;
goto end;
}
- ret = ustctl_put_subbuf(ustream);
+ ret = lttng_ust_ctl_put_subbuf(ustream);
assert(!ret);
/* This stream still has data. Flag it and wake up the data thread. */
{
int ret;
- ret = ustctl_get_subbuf_size(
+ ret = lttng_ust_ctl_get_subbuf_size(
stream->ustream, &subbuf->info.data.subbuf_size);
if (ret) {
goto end;
}
- ret = ustctl_get_padded_subbuf_size(
+ ret = lttng_ust_ctl_get_padded_subbuf_size(
stream->ustream, &subbuf->info.data.padded_subbuf_size);
if (ret) {
goto end;
goto end;
}
- ret = ustctl_get_packet_size(
+ ret = lttng_ust_ctl_get_packet_size(
stream->ustream, &subbuf->info.data.packet_size);
if (ret < 0) {
PERROR("Failed to get sub-buffer packet size");
goto end;
}
- ret = ustctl_get_content_size(
+ ret = lttng_ust_ctl_get_content_size(
stream->ustream, &subbuf->info.data.content_size);
if (ret < 0) {
PERROR("Failed to get sub-buffer content size");
goto end;
}
- ret = ustctl_get_timestamp_begin(
+ ret = lttng_ust_ctl_get_timestamp_begin(
stream->ustream, &subbuf->info.data.timestamp_begin);
if (ret < 0) {
PERROR("Failed to get sub-buffer begin timestamp");
goto end;
}
- ret = ustctl_get_timestamp_end(
+ ret = lttng_ust_ctl_get_timestamp_end(
stream->ustream, &subbuf->info.data.timestamp_end);
if (ret < 0) {
PERROR("Failed to get sub-buffer end timestamp");
goto end;
}
- ret = ustctl_get_events_discarded(
+ ret = lttng_ust_ctl_get_events_discarded(
stream->ustream, &subbuf->info.data.events_discarded);
if (ret) {
PERROR("Failed to get sub-buffer events discarded count");
goto end;
}
- ret = ustctl_get_sequence_number(stream->ustream,
+ ret = lttng_ust_ctl_get_sequence_number(stream->ustream,
&subbuf->info.data.sequence_number.value);
if (ret) {
/* May not be supported by older LTTng-modules. */
subbuf->info.data.sequence_number.is_set = true;
}
- ret = ustctl_get_stream_id(
+ ret = lttng_ust_ctl_get_stream_id(
stream->ustream, &subbuf->info.data.stream_id);
if (ret < 0) {
PERROR("Failed to get stream id");
goto end;
}
- ret = ustctl_get_instance_id(stream->ustream,
+ ret = lttng_ust_ctl_get_instance_id(stream->ustream,
&subbuf->info.data.stream_instance_id.value);
if (ret) {
/* May not be supported by older LTTng-modules. */
{
int ret;
- ret = ustctl_get_next_subbuf(stream->ustream);
+ ret = lttng_ust_ctl_get_next_subbuf(stream->ustream);
if (ret) {
goto end;
}
unsigned long consumed_pos, produced_pos;
do {
- ret = ustctl_get_next_subbuf(stream->ustream);
+ ret = lttng_ust_ctl_get_next_subbuf(stream->ustream);
if (ret == 0) {
got_subbuffer = true;
} else {
static int put_next_subbuffer(struct lttng_consumer_stream *stream,
struct stream_subbuffer *subbuffer)
{
- const int ret = ustctl_put_next_subbuf(stream->ustream);
+ const int ret = lttng_ust_ctl_put_next_subbuf(stream->ustream);
assert(ret == 0);
return ret;
goto end;
}
} else {
- ret = ustctl_get_next_subbuf(stream->ustream);
+ ret = lttng_ust_ctl_get_next_subbuf(stream->ustream);
if (ret == 0) {
/*
* There is still data so let's put back this
* subbuffer.
*/
- ret = ustctl_put_subbuf(stream->ustream);
+ ret = lttng_ust_ctl_put_subbuf(stream->ustream);
assert(ret == 0);
ret = 1; /* Data is pending */
goto end;
{
int ret;
- ret = ustctl_stream_close_wakeup_fd(stream->ustream);
+ ret = lttng_ust_ctl_stream_close_wakeup_fd(stream->ustream);
if (ret < 0) {
ERR("Unable to close wakeup fd");
}
assert(stream);
assert(stream_id);
- return ustctl_get_stream_id(stream->ustream, stream_id);
+ return lttng_ust_ctl_get_stream_id(stream->ustream, stream_id);
}
void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
-void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream,
+void lttng_lttng_ust_ctl_flush_buffer(struct lttng_consumer_stream *stream,
int producer_active);
int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
uint64_t *stream_id);
}
static inline
-int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
+int lttng_lttng_ust_ctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
unsigned long *off)
{
return -ENOSYS;
return -ENOSYS;
}
static inline
-void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream)
+void *lttng_lttng_ust_ctl_get_mmap_base(struct lttng_consumer_stream *stream)
{
return NULL;
}
static inline
-void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream,
+void lttng_lttng_ust_ctl_flush_buffer(struct lttng_consumer_stream *stream,
int producer_active)
{
}