+ struct lttng_kernel_old_channel old_channel;
+ struct lttng_kernel_channel channel;
+
+ if (lttng_kernel_use_old_abi) {
+ old_channel.overwrite = chops->overwrite;
+ old_channel.subbuf_size = chops->subbuf_size;
+ old_channel.num_subbuf = chops->num_subbuf;
+ old_channel.switch_timer_interval = chops->switch_timer_interval;
+ old_channel.read_timer_interval = chops->read_timer_interval;
+ old_channel.output = chops->output;
+
+ memset(old_channel.padding, 0, sizeof(old_channel.padding));
+ /*
+ * The new channel padding is smaller than the old ABI so we use the
+ * new ABI padding size for the memcpy.
+ */
+ memcpy(old_channel.padding, chops->padding, sizeof(chops->padding));
+
+ return ioctl(fd, LTTNG_KERNEL_OLD_METADATA, &old_channel);
+ }
+
+ channel.overwrite = chops->overwrite;
+ channel.subbuf_size = chops->subbuf_size;
+ channel.num_subbuf = chops->num_subbuf;
+ channel.switch_timer_interval = chops->switch_timer_interval;
+ channel.read_timer_interval = chops->read_timer_interval;
+ channel.output = chops->output;
+ memcpy(channel.padding, chops->padding, sizeof(channel.padding));
+
+ return ioctl(fd, LTTNG_KERNEL_METADATA, &channel);