X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_channels.c;h=fa65b1eaa9257d84e3be698a7e10a9960683c0d8;hp=3314bde0d6da4f7ff37d8747d2b1129e746bda92;hb=ce0b1d61919f37517a6212f7af2afe0fa1b1dcb0;hpb=c72196171a55e7cabeebe19d68352452e2bf6b25 diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 3314bde0d..fa65b1eaa 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2011 - David Goulet + * Copyright (C) 2011 David Goulet * - * 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 @@ -244,7 +234,7 @@ static int enable_channel(char *session_name) void *extended_ptr; /* Validate channel name's length */ - if (strlen(channel_name) >= NAME_MAX) { + if (strlen(channel_name) >= sizeof(chan_opts.name)) { ERR("Channel name is too long (max. %zu characters)", sizeof(chan_opts.name) - 1); error = 1; @@ -510,7 +500,9 @@ int cmd_enable_channels(int argc, const char **argv) goto end; } chan_opts.attr.switch_timer_interval = (uint32_t) v; - DBG("Channel switch timer interval set to %d", chan_opts.attr.switch_timer_interval); + DBG("Channel switch timer interval set to %d %s", + chan_opts.attr.switch_timer_interval, + USEC_UNIT); break; } case OPT_READ_TIMER: @@ -532,7 +524,9 @@ int cmd_enable_channels(int argc, const char **argv) goto end; } chan_opts.attr.read_timer_interval = (uint32_t) v; - DBG("Channel read timer interval set to %d", chan_opts.attr.read_timer_interval); + DBG("Channel read timer interval set to %d %s", + chan_opts.attr.read_timer_interval, + USEC_UNIT); break; } case OPT_MONITOR_TIMER: @@ -549,7 +543,9 @@ int cmd_enable_channels(int argc, const char **argv) } opt_monitor_timer.interval = (uint64_t) v; opt_monitor_timer.set = true; - DBG("Channel monitor timer interval set to %" PRIu64" (µs)", opt_monitor_timer.interval); + DBG("Channel monitor timer interval set to %" PRIu64 " %s", + opt_monitor_timer.interval, + USEC_UNIT); break; } case OPT_BLOCKING_TIMEOUT: @@ -597,8 +593,9 @@ int cmd_enable_channels(int argc, const char **argv) opt_blocking_timeout.value = (int64_t) v; opt_blocking_timeout.set = true; - DBG("Channel blocking timeout set to %" PRId64 " µs%s", + DBG("Channel blocking timeout set to %" PRId64 " %s%s", opt_blocking_timeout.value, + USEC_UNIT, opt_blocking_timeout.value == 0 ? " (non-blocking)" : ""); break; @@ -647,7 +644,8 @@ int cmd_enable_channels(int argc, const char **argv) } } - ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace); + ret = print_missing_or_multiple_domains( + opt_kernel + opt_userspace, false); if (ret) { ret = CMD_ERROR; goto end;