}
static
-int process_channel_attr_node(xmlNodePtr attr_node,
- struct lttng_channel *channel, xmlNodePtr *contexts_node,
- xmlNodePtr *events_node)
+int process_channel_attr_node(xmlNodePtr attr_node, bool snapshot_mode,
+ enum lttng_domain_type domain, struct lttng_channel *channel,
+ xmlNodePtr *contexts_node, xmlNodePtr *events_node)
{
int ret;
bool name_set = false;
+ bool output_type_set = false;
assert(attr_node);
assert(channel);
}
channel->attr.output = ret;
+ output_type_set = true;
} else if (!strcmp((const char *) attr_node->name,
config_element_tracefile_size)) {
xmlChar *content;
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;
static
-int process_domain_node(xmlNodePtr domain_node, const char *session_name)
+int process_domain_node(xmlNodePtr domain_node, const char *session_name,
+ bool snapshot_mode)
{
int ret;
struct lttng_domain domain = { 0 };
channel_attr_node; channel_attr_node =
xmlNextElementSibling(channel_attr_node)) {
ret = process_channel_attr_node(channel_attr_node,
- &channel, &contexts_node, &events_node);
+ snapshot_mode, domain.type, &channel,
+ &contexts_node, &events_node);
if (ret) {
goto end;
}
for (node = xmlFirstElementChild(domains_node); node;
node = xmlNextElementSibling(node)) {
- ret = process_domain_node(node, (const char *) name);
+ ret = process_domain_node(node, (const char *) name,
+ snapshot_mode == 1);
if (ret) {
goto end;
}
<xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
<xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
<xs:element name="read_timer_interval" type="uint32_type"/> <!-- usec -->
- <xs:element name="output_type" type="event_output_type"/>
+ <xs:element name="output_type" type="event_output_type" minOccurs="0"/>
<xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
<xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
<xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->