Cleanup: rename `get_domain_str()` -> `lttng_domain_type_str()`
[lttng-tools.git] / src / bin / lttng / commands / enable_channels.c
index b4e2942c3bb5cab0477adb3bc08cc30c33f4475d..dd79926f81d6c80b3ef70d56cb8a188d4b491a9c 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
  *
- * 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
@@ -31,6 +21,8 @@
 #include <common/utils.h>
 #include <common/mi-lttng.h>
 
+#include <lttng/domain-internal.h>
+
 #include "../command.h"
 #include "../utils.h"
 
@@ -244,7 +236,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;
@@ -314,7 +306,8 @@ static int enable_channel(char *session_name)
                        }
                } else {
                        MSG("%s channel %s enabled for session %s",
-                                       get_domain_str(dom.type), channel_name, session_name);
+                                       lttng_domain_type_str(dom.type),
+                                       channel_name, session_name);
                        success = 1;
                }
 
@@ -654,7 +647,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;
This page took 0.024387 seconds and 4 git commands to generate.