lttng: Add list-triggers command
[lttng-tools.git] / src / bin / lttng / command.h
1 /*
2 * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8 #ifndef _LTTNG_CMD_H
9 #define _LTTNG_CMD_H
10
11 #include <lttng/lttng.h>
12 #include <common/common.h>
13 #include <common/defaults.h>
14
15 #include "conf.h"
16 #include "utils.h"
17
18 #define DECL_COMMAND(_name) \
19 extern int cmd_##_name(int, const char **)
20
21 #ifdef LTTNG_EMBED_HELP
22 # define HELP_MSG_NAME help_msg
23 # define SHOW_HELP_ERROR_LINE ERR("Cannot show --help for `lttng-%s`", argv[0]);
24 #else
25 # define HELP_MSG_NAME NULL
26 # define SHOW_HELP_ERROR_LINE ;
27 #endif
28
29 #define SHOW_HELP() \
30 do { \
31 ret = show_cmd_help(argv[0], HELP_MSG_NAME); \
32 \
33 if (ret) { \
34 SHOW_HELP_ERROR_LINE \
35 ret = CMD_ERROR; \
36 } \
37 } while (0)
38
39 enum cmd_error_code {
40 CMD_SUCCESS = 0,
41 CMD_ERROR,
42 CMD_UNDEFINED,
43 CMD_FATAL,
44 CMD_WARNING,
45 CMD_UNSUPPORTED,
46 };
47
48 struct cmd_struct {
49 const char *name;
50 int (*func)(int argc, const char **argv);
51 };
52
53 DECL_COMMAND(list);
54 DECL_COMMAND(status);
55 DECL_COMMAND(create);
56 DECL_COMMAND(destroy);
57 DECL_COMMAND(start);
58 DECL_COMMAND(stop);
59 DECL_COMMAND(enable_events);
60 DECL_COMMAND(disable_events);
61 DECL_COMMAND(enable_channels);
62 DECL_COMMAND(disable_channels);
63 DECL_COMMAND(add_context);
64 DECL_COMMAND(set_session);
65 DECL_COMMAND(version);
66 DECL_COMMAND(view);
67 DECL_COMMAND(enable_consumer);
68 DECL_COMMAND(disable_consumer);
69 DECL_COMMAND(snapshot);
70 DECL_COMMAND(save);
71 DECL_COMMAND(load);
72 DECL_COMMAND(track);
73 DECL_COMMAND(untrack);
74 DECL_COMMAND(metadata);
75 DECL_COMMAND(regenerate);
76 DECL_COMMAND(rotate);
77 DECL_COMMAND(enable_rotation);
78 DECL_COMMAND(disable_rotation);
79 DECL_COMMAND(clear);
80 DECL_COMMAND(add_trigger);
81 DECL_COMMAND(list_triggers);
82
83 extern int cmd_help(int argc, const char **argv,
84 const struct cmd_struct commands[]);
85
86 #endif /* _LTTNG_CMD_H */
This page took 0.030274 seconds and 4 git commands to generate.