/*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
* Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* SPDX-License-Identifier: GPL-2.0-only
#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;
case LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_NONE:
break;
default:
- /* Error occured. */
+ /* Error occurred. */
ERR("Failed to generate exclusions from trigger while allocating an event notifier rule");
goto error_put_trigger;
}
ust_reg_chan = ust_registry_channel_find(registry, chan_reg_key);
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) {