static void _lttng_enum_destroy(struct lttng_enum *_enum);
static
-void lttng_session_lazy_sync_event_enablers(struct lttng_session *session);
+void lttng_session_lazy_sync_event_enablers(struct lttng_ust_session *session);
static
-void lttng_session_sync_event_enablers(struct lttng_session *session);
+void lttng_session_sync_event_enablers(struct lttng_ust_session *session);
static
void lttng_event_notifier_group_sync_enablers(
struct lttng_event_notifier_group *event_notifier_group);
}
}
-struct lttng_session *lttng_session_create(void)
+struct lttng_ust_session *lttng_session_create(void)
{
- struct lttng_session *session;
+ struct lttng_ust_session *session;
struct lttng_ust_session_private *session_priv;
int i;
- session = zmalloc(sizeof(struct lttng_session));
+ session = zmalloc(sizeof(struct lttng_ust_session));
if (!session)
return NULL;
- session->struct_size = sizeof(struct lttng_session);
+ session->struct_size = sizeof(struct lttng_ust_session);
session_priv = zmalloc(sizeof(struct lttng_ust_session_private));
if (!session_priv) {
free(session);
static
void _lttng_channel_unmap(struct lttng_channel *lttng_chan)
{
- struct channel *chan;
+ struct lttng_ust_lib_ring_buffer_channel *chan;
struct lttng_ust_shm_handle *handle;
cds_list_del(<tng_chan->node);
void register_event(struct lttng_ust_event_common *event)
{
int ret;
- const struct lttng_event_desc *desc;
+ struct lttng_ust_event_desc *desc;
assert(event->priv->registered == 0);
desc = event->priv->desc;
- ret = __tracepoint_probe_register_queue_release(desc->name,
+ ret = lttng_ust_tp_probe_register_queue_release(desc->name,
desc->probe_callback,
event, desc->signature);
WARN_ON_ONCE(ret);
void unregister_event(struct lttng_ust_event_common *event)
{
int ret;
- const struct lttng_event_desc *desc;
+ struct lttng_ust_event_desc *desc;
assert(event->priv->registered == 1);
desc = event->priv->desc;
- ret = __tracepoint_probe_unregister_queue_release(desc->name,
+ ret = lttng_ust_tp_probe_unregister_queue_release(desc->name,
desc->probe_callback,
event);
WARN_ON_ONCE(ret);
unregister_event(event);
}
-void lttng_session_destroy(struct lttng_session *session)
+void lttng_session_destroy(struct lttng_ust_session *session)
{
struct lttng_channel *chan, *tmpchan;
struct lttng_ust_event_recorder_private *event_recorder_priv, *tmpevent_recorder_priv;
_lttng_event_unregister(event_recorder_priv->parent.pub);
}
lttng_ust_urcu_synchronize_rcu(); /* Wait for in-flight events to complete */
- __tracepoint_probe_prune_release_queue();
+ lttng_ust_tp_probe_prune_release_queue();
cds_list_for_each_entry_safe(event_enabler, event_tmpenabler,
&session->priv->enablers_head, node)
lttng_event_enabler_destroy(event_enabler);
}
static
-int lttng_enum_create(const struct lttng_enum_desc *desc,
- struct lttng_session *session)
+int lttng_enum_create(struct lttng_ust_enum_desc *desc,
+ struct lttng_ust_session *session)
{
const char *enum_name = desc->name;
struct lttng_enum *_enum;
}
static
-int lttng_create_enum_check(const struct lttng_type *type,
- struct lttng_session *session)
+int lttng_create_enum_check(struct lttng_ust_type_common *type,
+ struct lttng_ust_session *session)
{
- switch (type->atype) {
- case atype_enum_nestable:
+ switch (type->type) {
+ case lttng_ust_type_enum:
{
- const struct lttng_enum_desc *enum_desc;
+ struct lttng_ust_enum_desc *enum_desc;
int ret;
- enum_desc = type->u.enum_nestable.desc;
+ enum_desc = lttng_ust_get_type_enum(type)->desc;
ret = lttng_enum_create(enum_desc, session);
if (ret && ret != -EEXIST) {
DBG("Unable to create enum error: (%d)", ret);
}
break;
}
- case atype_dynamic:
+ case lttng_ust_type_dynamic:
{
- const struct lttng_event_field *tag_field_generic;
- const struct lttng_enum_desc *enum_desc;
+ struct lttng_ust_event_field *tag_field_generic;
+ struct lttng_ust_enum_desc *enum_desc;
int ret;
tag_field_generic = lttng_ust_dynamic_type_tag_field();
- enum_desc = tag_field_generic->type.u.enum_nestable.desc;
+ enum_desc = lttng_ust_get_type_enum(tag_field_generic->type)->desc;
ret = lttng_enum_create(enum_desc, session);
if (ret && ret != -EEXIST) {
DBG("Unable to create enum error: (%d)", ret);
static
int lttng_create_all_event_enums(size_t nr_fields,
- const struct lttng_event_field *event_fields,
- struct lttng_session *session)
+ struct lttng_ust_event_field **event_fields,
+ struct lttng_ust_session *session)
{
size_t i;
int ret;
/* For each field, ensure enum is part of the session. */
for (i = 0; i < nr_fields; i++) {
- const struct lttng_type *type = &event_fields[i].type;
+ struct lttng_ust_type_common *type = event_fields[i]->type;
ret = lttng_create_enum_check(type, session);
if (ret)
static
int lttng_create_all_ctx_enums(size_t nr_fields,
- const struct lttng_ctx_field *ctx_fields,
- struct lttng_session *session)
+ struct lttng_ust_ctx_field **ctx_fields,
+ struct lttng_ust_session *session)
{
size_t i;
int ret;
/* For each field, ensure enum is part of the session. */
for (i = 0; i < nr_fields; i++) {
- const struct lttng_type *type = &ctx_fields[i].event_field.type;
+ struct lttng_ust_type_common *type = ctx_fields[i]->event_field->type;
ret = lttng_create_enum_check(type, session);
if (ret)
* Ensure that a state-dump will be performed for this session at the end
* of the current handle_message().
*/
-int lttng_session_statedump(struct lttng_session *session)
+int lttng_session_statedump(struct lttng_ust_session *session)
{
session->priv->statedump_pending = 1;
lttng_ust_sockinfo_session_enabled(session->priv->owner);
return 0;
}
-int lttng_session_enable(struct lttng_session *session)
+int lttng_session_enable(struct lttng_ust_session *session)
{
int ret = 0;
struct lttng_channel *chan;
* we need to use.
*/
cds_list_for_each_entry(chan, &session->priv->chan_head, node) {
- const struct lttng_ctx *ctx;
- const struct lttng_ctx_field *fields = NULL;
+ struct lttng_ust_ctx *ctx;
+ struct lttng_ust_ctx_field **fields = NULL;
size_t nr_fields = 0;
uint32_t chan_id;
return ret;
}
-int lttng_session_disable(struct lttng_session *session)
+int lttng_session_disable(struct lttng_ust_session *session)
{
int ret = 0;
struct cds_hlist_head *borrow_hash_table_bucket(
struct cds_hlist_head *hash_table,
unsigned int hash_table_size,
- const struct lttng_event_desc *desc)
+ struct lttng_ust_event_desc *desc)
{
const char *event_name;
size_t name_len;
* Supports event creation while tracing session is active.
*/
static
-int lttng_event_recorder_create(const struct lttng_event_desc *desc,
+int lttng_event_recorder_create(struct lttng_ust_event_desc *desc,
struct lttng_channel *chan)
{
struct lttng_ust_event_recorder *event_recorder;
struct lttng_ust_event_recorder_private *event_recorder_priv;
- struct lttng_session *session = chan->session;
+ struct lttng_ust_session *session = chan->session;
struct cds_hlist_head *head;
int ret = 0;
int notify_socket, loglevel;
loglevel = *(*event_recorder->parent->priv->desc->loglevel);
else
loglevel = TRACE_DEFAULT;
- if (desc->u.ext.model_emf_uri)
- uri = *(desc->u.ext.model_emf_uri);
+ if (desc->model_emf_uri)
+ uri = *(desc->model_emf_uri);
else
uri = NULL;
}
static
-int lttng_event_notifier_create(const struct lttng_event_desc *desc,
+int lttng_event_notifier_create(struct lttng_ust_event_desc *desc,
uint64_t token, uint64_t error_counter_index,
struct lttng_event_notifier_group *event_notifier_group)
{
}
static
-int lttng_desc_match_star_glob_enabler(const struct lttng_event_desc *desc,
+int lttng_desc_match_star_glob_enabler(struct lttng_ust_event_desc *desc,
struct lttng_enabler *enabler)
{
int loglevel = 0;
}
static
-int lttng_desc_match_event_enabler(const struct lttng_event_desc *desc,
+int lttng_desc_match_event_enabler(struct lttng_ust_event_desc *desc,
struct lttng_enabler *enabler)
{
int loglevel = 0;
}
static
-int lttng_desc_match_enabler(const struct lttng_event_desc *desc,
+int lttng_desc_match_enabler(struct lttng_ust_event_desc *desc,
struct lttng_enabler *enabler)
{
switch (enabler->format_type) {
static
void lttng_create_event_recorder_if_missing(struct lttng_event_enabler *event_enabler)
{
- struct lttng_session *session = event_enabler->chan->session;
- struct lttng_probe_desc *probe_desc;
- const struct lttng_event_desc *desc;
+ struct lttng_ust_session *session = event_enabler->chan->session;
+ struct lttng_ust_probe_desc *probe_desc;
+ struct lttng_ust_event_desc *desc;
struct lttng_ust_event_recorder_private *event_recorder_priv;
int i;
struct cds_list_head *probe_list;
}
static
-void probe_provider_event_for_each(struct lttng_probe_desc *provider_desc,
+void probe_provider_event_for_each(struct lttng_ust_probe_desc *provider_desc,
void (*event_func)(struct lttng_ust_event_common *event))
{
struct cds_hlist_node *node, *tmp_node;
* sessions to queue the unregistration of the events.
*/
for (i = 0; i < provider_desc->nr_events; i++) {
- const struct lttng_event_desc *event_desc;
+ struct lttng_ust_event_desc *event_desc;
struct lttng_event_notifier_group *event_notifier_group;
struct lttng_ust_event_recorder_private *event_recorder_priv;
struct lttng_ust_event_notifier_private *event_notifier_priv;
case LTTNG_UST_EVENT_TYPE_RECORDER:
{
struct lttng_ust_event_recorder *event_recorder = event->child;
- struct lttng_session *session = event_recorder->chan->session;
+ struct lttng_ust_session *session = event_recorder->chan->session;
unsigned int i;
/* Destroy enums of the current event. */
for (i = 0; i < event_recorder->parent->priv->desc->nr_fields; i++) {
- const struct lttng_enum_desc *enum_desc;
- const struct lttng_event_field *field;
+ struct lttng_ust_enum_desc *enum_desc;
+ struct lttng_ust_event_field *field;
struct lttng_enum *curr_enum;
- field = &(event_recorder->parent->priv->desc->fields[i]);
- switch (field->type.atype) {
- case atype_enum_nestable:
- enum_desc = field->type.u.enum_nestable.desc;
+ field = event_recorder->parent->priv->desc->fields[i];
+ switch (field->type->type) {
+ case lttng_ust_type_enum:
+ enum_desc = lttng_ust_get_type_enum(field->type)->desc;
break;
default:
continue;
* ust_lock held.
*/
void lttng_probe_provider_unregister_events(
- struct lttng_probe_desc *provider_desc)
+ struct lttng_ust_probe_desc *provider_desc)
{
/*
* Iterate over all events in the probe provider descriptions and sessions
/* Wait for grace period. */
lttng_ust_urcu_synchronize_rcu();
/* Prune the unregistration queue. */
- __tracepoint_probe_prune_release_queue();
+ lttng_ust_tp_probe_prune_release_queue();
/*
* It is now safe to destroy the events and remove them from the event list
static
int lttng_event_enabler_ref_event_recorders(struct lttng_event_enabler *event_enabler)
{
- struct lttng_session *session = event_enabler->chan->session;
+ struct lttng_ust_session *session = event_enabler->chan->session;
struct lttng_ust_event_recorder_private *event_recorder_priv;
if (!lttng_event_enabler_as_enabler(event_enabler)->enabled)
int lttng_attach_context(struct lttng_ust_abi_context *context_param,
union lttng_ust_abi_args *uargs,
- struct lttng_ctx **ctx, struct lttng_session *session)
+ struct lttng_ust_ctx **ctx, struct lttng_ust_session *session)
{
/*
* We cannot attach a context after trace has been started for a
* session.
*/
static
-void lttng_session_sync_event_enablers(struct lttng_session *session)
+void lttng_session_sync_event_enablers(struct lttng_ust_session *session)
{
struct lttng_event_enabler *event_enabler;
struct lttng_ust_event_recorder_private *event_recorder_priv;
*/
cds_list_for_each_entry(event_recorder_priv, &session->priv->events_head, node) {
struct lttng_enabler_ref *enabler_ref;
- struct lttng_bytecode_runtime *runtime;
+ struct lttng_ust_bytecode_runtime *runtime;
int enabled = 0, has_enablers_without_bytecode = 0;
/* Enable events */
lttng_bytecode_filter_sync_state(runtime);
}
}
- __tracepoint_probe_prune_release_queue();
+ lttng_ust_tp_probe_prune_release_queue();
}
/* Support for event notifier is introduced by probe provider major version 2. */
static
-bool lttng_ust_probe_supports_event_notifier(struct lttng_probe_desc *probe_desc)
+bool lttng_ust_probe_supports_event_notifier(struct lttng_ust_probe_desc *probe_desc)
{
return probe_desc->major >= 2;
}
struct lttng_event_notifier_enabler *event_notifier_enabler)
{
struct lttng_event_notifier_group *event_notifier_group = event_notifier_enabler->group;
- struct lttng_probe_desc *probe_desc;
+ struct lttng_ust_probe_desc *probe_desc;
struct cds_list_head *probe_list;
int i;
for (i = 0; i < probe_desc->nr_events; i++) {
int ret;
bool found = false;
- const struct lttng_event_desc *desc;
+ struct lttng_ust_event_desc *desc;
struct lttng_ust_event_notifier_private *event_notifier_priv;
struct cds_hlist_head *head;
struct cds_hlist_node *node;
*/
cds_list_for_each_entry(event_notifier_priv, &event_notifier_group->event_notifiers_head, node) {
struct lttng_enabler_ref *enabler_ref;
- struct lttng_bytecode_runtime *runtime;
+ struct lttng_ust_bytecode_runtime *runtime;
int enabled = 0, has_enablers_without_bytecode = 0;
/* Enable event_notifiers */
lttng_bytecode_capture_sync_state(runtime);
}
}
- __tracepoint_probe_prune_release_queue();
+ lttng_ust_tp_probe_prune_release_queue();
}
/*
* "lazy" sync means we only sync if required.
*/
static
-void lttng_session_lazy_sync_event_enablers(struct lttng_session *session)
+void lttng_session_lazy_sync_event_enablers(struct lttng_ust_session *session)
{
/* We can skip if session is not active */
if (!session->active)
* context (either app context callbacks, or dummy callbacks).
*/
void lttng_ust_context_set_session_provider(const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value))
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value))
{
struct lttng_ust_session_private *session_priv;
* context (either app context callbacks, or dummy callbacks).
*/
void lttng_ust_context_set_event_notifier_group_provider(const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value))
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value))
{
struct lttng_event_notifier_group *event_notifier_group;