Add disable kernel channel support
[lttng-tools.git] / ltt-sessiond / kernel-ctl.c
index bc92ffca918cb07b524aa8b9a6865308e455761b..e42ab872e487890b8c01072aa1784bb10b9ffb19 100644 (file)
@@ -159,6 +159,31 @@ error:
        return -1;
 }
 
+/*
+ *  kernel_disable_channel
+ *
+ *  Disable a kernel channel.
+ */
+int kernel_disable_channel(struct ltt_kernel_channel *chan)
+{
+       int ret;
+
+       ret = kernctl_disable(chan->fd);
+       if (ret < 0) {
+               perror("disable chan ioctl");
+               ret = errno;
+               goto error;
+       }
+
+       chan->enabled = 0;
+       DBG("Kernel channel %s disabled (fd: %d)", chan->channel->name, chan->fd);
+
+       return 0;
+
+error:
+       return ret;
+}
+
 /*
  *  kernel_enable_channel
  *
This page took 0.022808 seconds and 4 git commands to generate.