X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommand.h;h=8a318c6f7529e7fd7830565cf2856ef73cc9070d;hp=b5c968d39c2b2cdf210d5c2b32830d6706cc90b7;hb=0de2479d5f5a287d31c69e34ea5202a69019f224;hpb=95057847c7adfe3bc351ca61be77848dc91138b7 diff --git a/src/bin/lttng/command.h b/src/bin/lttng/command.h index b5c968d39..8a318c6f7 100644 --- a/src/bin/lttng/command.h +++ b/src/bin/lttng/command.h @@ -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. */ #ifndef _LTTNG_CMD_H @@ -28,13 +18,20 @@ #define DECL_COMMAND(_name) \ extern int cmd_##_name(int, const char **) +#ifdef LTTNG_EMBED_HELP +# define HELP_MSG_NAME help_msg +# define SHOW_HELP_ERROR_LINE ERR("Cannot show --help for `lttng-%s`", argv[0]); +#else +# define HELP_MSG_NAME NULL +# define SHOW_HELP_ERROR_LINE ; +#endif + #define SHOW_HELP() \ do { \ - ret = show_cmd_man_page(argv[0]); \ + ret = show_cmd_help(argv[0], HELP_MSG_NAME); \ \ if (ret) { \ - ERR("Cannot view man page lttng-%s(1)", argv[0]); \ - perror("exec"); \ + SHOW_HELP_ERROR_LINE \ ret = CMD_ERROR; \ } \ } while (0) @@ -76,6 +73,12 @@ DECL_COMMAND(track); DECL_COMMAND(untrack); DECL_COMMAND(metadata); DECL_COMMAND(regenerate); +DECL_COMMAND(rotate); +DECL_COMMAND(enable_rotation); +DECL_COMMAND(disable_rotation); +DECL_COMMAND(clear); +DECL_COMMAND(add_trigger); +DECL_COMMAND(list_triggers); extern int cmd_help(int argc, const char **argv, const struct cmd_struct commands[]);