+ switch (channel_type) {
+ case PER_CPU_CHANNEL:
+ transport_name = chan_param.overwrite ?
+ "relay-overwrite" : "relay-discard";
+ fops = <tng_channel_fops;
+ break;
+ case METADATA_CHANNEL:
+ transport_name = "relay-metadata";
+ fops = <tng_metadata_fops;
+ break;
+ default:
+ transport_name = "<unknown>";
+ break;
+ }
+ /*
+ * We tolerate no failure path after channel creation. It will stay
+ * invariant for the rest of the session.
+ */
+ chan = ltt_channel_create(session, transport_name, NULL,
+ chan_param.subbuf_size,
+ chan_param.num_subbuf,
+ chan_param.switch_timer_interval,
+ chan_param.read_timer_interval);
+ if (!chan) {
+ ret = -EINVAL;
+ goto chan_error;
+ }
+ chan->file = chan_file;
+ chan_file->private_data = chan;
+ fd_install(chan_fd, chan_file);
+ if (channel_type == METADATA_CHANNEL) {
+ lttng_metadata_create_events(chan_file);
+ session->metadata = chan;
+ }