xmlNodePtr *contexts_node, xmlNodePtr *events_node)
{
int ret;
- bool name_set = false;
- bool output_type_set = false;
assert(attr_node);
assert(channel);
strncpy(channel->name, (const char *) content, name_len);
free(content);
- name_set = true;
} else if (!strcmp((const char *) attr_node->name,
config_element_enabled)) {
xmlChar *content;
}
channel->attr.output = ret;
- output_type_set = true;
} else if (!strcmp((const char *) attr_node->name,
config_element_tracefile_size)) {
xmlChar *content;
*contexts_node = attr_node;
}
- if (!name_set) {
- ERR("Encountered a channel with no name attribute.");
- ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
- goto end;
- }
-
- if (!output_type_set) {
- /* Set default output type associated with the domain. */
- channel->attr.output =
- (domain == LTTNG_DOMAIN_KERNEL && !snapshot_mode) ?
- LTTNG_EVENT_SPLICE : LTTNG_EVENT_MMAP;
- }
ret = 0;
end:
return ret;
}
}
+ if (!channel.name) {
+ ERR("Encountered a channel with no name attribute.");
+ ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
+ goto end;
+ }
+
ret = lttng_enable_channel(handle, &channel);
if (ret < 0) {
goto end;