X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt-sessiond%2Fmain.c;h=01e75cbb26488f0cd68aff386d5e76da98a85223;hb=26cc6b4e17dc888cd894ef1f42a83c59d7f8a95f;hp=4fba6a2cf53a701054601e88df4478f35b658342;hpb=d36b858358a8ef4e00de843379d670925f9c23b6;p=lttng-tools.git diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 4fba6a2cf..01e75cbb2 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -873,6 +873,35 @@ static int process_client_msg(struct command_ctx *cmd_ctx) ret = LTTCOMM_OK; break; } + case LTTNG_KERNEL_DISABLE_CHANNEL: + { + struct ltt_kernel_channel *chan; + + /* Setup lttng message with no payload */ + ret = setup_lttng_msg(cmd_ctx, 0); + if (ret < 0) { + goto setup_error; + } + + chan = get_kernel_channel_by_name(cmd_ctx->lsm->u.disable.channel_name, + cmd_ctx->session->kernel_session); + if (chan == NULL) { + ret = LTTCOMM_KERN_CHAN_NOT_FOUND; + goto error; + } else if (chan->enabled == 1) { + ret = kernel_disable_channel(chan); + if (ret < 0) { + if (ret != EEXIST) { + ret = LTTCOMM_KERN_CHAN_DISABLE_FAIL; + } + goto error; + } + } + + kernel_wait_quiescent(kernel_tracer_fd); + ret = LTTCOMM_OK; + break; + } case LTTNG_KERNEL_DISABLE_EVENT: { struct ltt_kernel_channel *chan;