#include "rotate.h"
#include "event.h"
#include "event-notifier-error-accounting.h"
-
+#include "ust-field-utils.h"
struct lttng_ht *ust_app_ht;
struct lttng_ht *ust_app_ht_by_sock;
/*
* Push metadata to consumer socket.
*
- * RCU read-side lock must be held to guarantee existance of socket.
+ * RCU read-side lock must be held to guarantee existence of socket.
* Must be called with the ust app session lock held.
* Must be called with the registry lock held.
*
* socket to send the metadata is retrieved from consumer, if sock
* is not NULL we use it to send the metadata.
* RCU read-side lock must be held while calling this function,
- * therefore ensuring existance of registry. It also ensures existance
+ * therefore ensuring existence of registry. It also ensures existence
* of socket throughout this function.
*
* Return 0 on success else a negative error.
ua_event_notifier_rule->handle = ua_event_notifier_rule->obj->handle;
- DBG2("UST app event notifier %s created successfully: app = '%s': pid = %d), object = %p",
+ DBG2("UST app event notifier %s created successfully: app = '%s': pid = %d, object = %p",
event_notifier.event.name, app->name, app->pid,
ua_event_notifier_rule->obj);
lttng_ht_add_unique_u64(app->token_to_event_notifier_rule_ht,
&ua_event_notifier_rule->node);
- DBG2("UST app create token event rule completed: app = '%s', pid = %d), token = %" PRIu64,
+ DBG2("UST app create token event rule completed: app = '%s', pid = %d, token = %" PRIu64,
app->name, app->pid, lttng_trigger_get_tracer_token(trigger));
goto end;
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret == -EPIPE || ret == -LTTNG_UST_ERR_EXITING) {
- DBG3("UST app wait quiescent failed. Application is dead: pid= %d, sock = %d)",
+ DBG3("UST app wait quiescent failed. Application is dead: pid= %d, sock = %d",
app->pid, app->sock);
} else if (ret == -EAGAIN) {
- WARN("UST app wait quiescent failed. Communication time out: pid= %d, sock = %d)",
+ WARN("UST app wait quiescent failed. Communication time out: pid= %d, sock = %d",
app->pid, app->sock);
} else {
- ERR("UST app wait quiescent failed with ret %d: pid= %d, sock = %d)",
+ ERR("UST app wait quiescent failed with ret %d: pid= %d, sock = %d",
ret, app->pid, app->sock);
}
}
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret == -EPIPE || ret == -LTTNG_UST_ERR_EXITING) {
- DBG3("UST app wait quiescent failed. Application is dead: pid= %d, sock = %d)",
+ DBG3("UST app wait quiescent failed. Application is dead: pid= %d, sock = %d",
app->pid, app->sock);
} else if (ret == -EAGAIN) {
- WARN("UST app wait quiescent failed. Communication time out: pid= %d, sock = %d)",
+ WARN("UST app wait quiescent failed. Communication time out: pid= %d, sock = %d",
app->pid, app->sock);
} else {
- ERR("UST app wait quiescent failed with ret %d: pid= %d, sock = %d)",
+ ERR("UST app wait quiescent failed with ret %d: pid= %d, sock = %d",
ret, app->pid, app->sock);
}
}
*/
void ust_app_global_update_event_notifier_rules(struct ust_app *app)
{
- DBG2("UST application global event notifier rules update: app = '%s', pid = %d)",
+ DBG2("UST application global event notifier rules update: app = '%s', pid = %d",
app->name, app->pid);
if (!app->compatible || !ust_app_supports_notifiers(app)) {
}
if (app->event_notifier_group.object == NULL) {
- WARN("UST app global update of event notifiers for app skipped since communication handle is null: app = '%s' pid = %d)",
+ WARN("UST app global update of event notifiers for app skipped since communication handle is null: app = '%s', pid = %d",
app->name, app->pid);
return;
}
ust_reg_chan = ust_registry_channel_find(registry, chan_reg_key);
LTTNG_ASSERT(ust_reg_chan);
+ /* Channel id is set during the object creation. */
+ chan_id = ust_reg_chan->chan_id;
+
if (!ust_reg_chan->register_done) {
/*
* TODO: eventually use the registry event count for
} else {
/* Get current already assigned values. */
type = ust_reg_chan->header_type;
+ /*
+ * Validate that the context fields match between
+ * registry and newcoming application.
+ */
+ if (!match_lttng_ust_ctl_field_array(ust_reg_chan->ctx_fields,
+ ust_reg_chan->nr_ctx_fields,
+ fields, nr_fields)) {
+ ERR("Registering application channel due to context field mismatch: pid = %d, sock = %d",
+ app->pid, app->sock);
+ ret_code = -EINVAL;
+ goto reply;
+ }
}
- /* Channel id is set during the object creation. */
- chan_id = ust_reg_chan->chan_id;
/* Append to metadata */
if (!ust_reg_chan->metadata_dumped) {
WARN("UST app recv channel failed. Communication time out: sock = %d",
sock);
} else {
- ERR("UST app recv channel failed with ret %d: sock = %d)",
+ ERR("UST app recv channel failed with ret %d: sock = %d",
ret, sock);
}
goto error;