X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fchannel.c;h=073965ac67bd708e6184915d62431f5342312675;hb=556124d78016aaf447607b5208b50c5fe802bf27;hp=46256208d58d11fcd2fc2524be97f2a2cbccded8;hpb=4b5ab17b3aec396cfa096ecac1b990242072d644;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 46256208d..073965ac6 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -1,19 +1,9 @@ /* - * Copyright (C) 2011 - David Goulet - * Copyright (C) 2016 - Jérémie Galarneau + * Copyright (C) 2011 David Goulet + * Copyright (C) 2016 Jérémie Galarneau * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -407,7 +397,7 @@ int channel_ust_create(struct ltt_ust_session *usess, /* * Invalid subbuffer size if it's lower then the page size. */ - if (attr->attr.subbuf_size < page_size) { + if (attr->attr.subbuf_size < the_page_size) { ret = LTTNG_ERR_INVALID; goto error; } @@ -532,6 +522,13 @@ int channel_ust_disable(struct ltt_ust_session *usess, DBG2("Channel UST %s already disabled", uchan->name); goto end; } + + uchan->enabled = 0; + + /* + * If session is inactive we don't notify the tracer right away. We + * wait for the next synchronization. + */ if (!usess->active) { goto end; } @@ -544,8 +541,6 @@ int channel_ust_disable(struct ltt_ust_session *usess, goto error; } - uchan->enabled = 0; - DBG2("Channel %s disabled successfully", uchan->name); return LTTNG_OK;