X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Fkernel-ctl.c;h=e42ab872e487890b8c01072aa1784bb10b9ffb19;hp=bc92ffca918cb07b524aa8b9a6865308e455761b;hb=26cc6b4e17dc888cd894ef1f42a83c59d7f8a95f;hpb=d36b858358a8ef4e00de843379d670925f9c23b6 diff --git a/ltt-sessiond/kernel-ctl.c b/ltt-sessiond/kernel-ctl.c index bc92ffca9..e42ab872e 100644 --- a/ltt-sessiond/kernel-ctl.c +++ b/ltt-sessiond/kernel-ctl.c @@ -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 *