sessiond: clean-up: typo in ust-app.c comment
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.h
1 /*
2 * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #ifndef CMD_H
19 #define CMD_H
20
21 #include "context.h"
22 #include "session.h"
23
24 struct notification_thread_handle;
25
26 /*
27 * A callback (and associated user data) that should be run after a command
28 * has been executed. No locks should be taken while executing this handler.
29 *
30 * The command's reply should not be sent until the handler has run and
31 * completed successfully. On failure, the handler's return code should
32 * be the only reply sent to the client.
33 */
34 typedef enum lttng_error_code (*completion_handler_function)(void *);
35 struct cmd_completion_handler {
36 completion_handler_function run;
37 void *data;
38 };
39
40 /*
41 * Init the command subsystem. Must be called before using any of the functions
42 * above. This is called in the main() of the session daemon.
43 */
44 void cmd_init(void);
45
46 /* Session commands */
47 enum lttng_error_code cmd_create_session(struct command_ctx *cmd_ctx, int sock,
48 struct lttng_session_descriptor **return_descriptor);
49 int cmd_destroy_session(struct ltt_session *session,
50 struct notification_thread_handle *notification_thread_handle,
51 int *sock_fd);
52
53 /* Channel commands */
54 int cmd_disable_channel(struct ltt_session *session,
55 enum lttng_domain_type domain, char *channel_name);
56 int cmd_enable_channel(struct ltt_session *session,
57 const struct lttng_domain *domain, const struct lttng_channel *attr,
58 int wpipe);
59 int cmd_track_pid(struct ltt_session *session, enum lttng_domain_type domain,
60 int pid);
61 int cmd_untrack_pid(struct ltt_session *session, enum lttng_domain_type domain,
62 int pid);
63
64 /* Event commands */
65 int cmd_disable_event(struct ltt_session *session,
66 enum lttng_domain_type domain,
67 const char *channel_name,
68 const struct lttng_event *event);
69 int cmd_add_context(struct ltt_session *session, enum lttng_domain_type domain,
70 char *channel_name, const struct lttng_event_context *ctx, int kwpipe);
71 int cmd_set_filter(struct ltt_session *session, enum lttng_domain_type domain,
72 char *channel_name, struct lttng_event *event,
73 struct lttng_filter_bytecode *bytecode);
74 int cmd_enable_event(struct ltt_session *session, const struct lttng_domain *domain,
75 char *channel_name, struct lttng_event *event,
76 char *filter_expression,
77 struct lttng_filter_bytecode *filter,
78 struct lttng_event_exclusion *exclusion,
79 int wpipe);
80
81 /* Trace session action commands */
82 int cmd_start_trace(struct ltt_session *session);
83 int cmd_stop_trace(struct ltt_session *session);
84
85 /* Consumer commands */
86 int cmd_register_consumer(struct ltt_session *session,
87 enum lttng_domain_type domain,
88 const char *sock_path, struct consumer_data *cdata);
89 int cmd_set_consumer_uri(struct ltt_session *session, size_t nb_uri,
90 struct lttng_uri *uris);
91 int cmd_setup_relayd(struct ltt_session *session);
92
93 /* Listing commands */
94 ssize_t cmd_list_domains(struct ltt_session *session,
95 struct lttng_domain **domains);
96 ssize_t cmd_list_events(enum lttng_domain_type domain,
97 struct ltt_session *session, char *channel_name,
98 struct lttng_event **events, size_t *total_size);
99 ssize_t cmd_list_channels(enum lttng_domain_type domain,
100 struct ltt_session *session, struct lttng_channel **channels);
101 ssize_t cmd_list_domains(struct ltt_session *session,
102 struct lttng_domain **domains);
103 void cmd_list_lttng_sessions(struct lttng_session *sessions,
104 size_t session_count, uid_t uid, gid_t gid);
105 ssize_t cmd_list_tracepoint_fields(enum lttng_domain_type domain,
106 struct lttng_event_field **fields);
107 ssize_t cmd_list_tracepoints(enum lttng_domain_type domain,
108 struct lttng_event **events);
109 ssize_t cmd_snapshot_list_outputs(struct ltt_session *session,
110 struct lttng_snapshot_output **outputs);
111 ssize_t cmd_list_syscalls(struct lttng_event **events);
112 ssize_t cmd_list_tracker_pids(struct ltt_session *session,
113 enum lttng_domain_type domain, int32_t **pids);
114
115 int cmd_data_pending(struct ltt_session *session);
116
117 /* Snapshot */
118 int cmd_snapshot_add_output(struct ltt_session *session,
119 const struct lttng_snapshot_output *output, uint32_t *id);
120 int cmd_snapshot_del_output(struct ltt_session *session,
121 const struct lttng_snapshot_output *output);
122 int cmd_snapshot_record(struct ltt_session *session,
123 const struct lttng_snapshot_output *output, int wait);
124
125 int cmd_set_session_shm_path(struct ltt_session *session,
126 const char *shm_path);
127 int cmd_regenerate_metadata(struct ltt_session *session);
128 int cmd_regenerate_statedump(struct ltt_session *session);
129
130 int cmd_register_trigger(struct command_ctx *cmd_ctx, int sock,
131 struct notification_thread_handle *notification_thread_handle);
132 int cmd_unregister_trigger(struct command_ctx *cmd_ctx, int sock,
133 struct notification_thread_handle *notification_thread_handle);
134
135 int cmd_rotate_session(struct ltt_session *session,
136 struct lttng_rotate_session_return *rotate_return,
137 bool quiet_rotation);
138 int cmd_rotate_get_info(struct ltt_session *session,
139 struct lttng_rotation_get_info_return *info_return,
140 uint64_t rotate_id);
141 int cmd_rotation_set_schedule(struct ltt_session *session,
142 bool activate, enum lttng_rotation_schedule_type schedule_type,
143 uint64_t value,
144 struct notification_thread_handle *notification_thread_handle);
145
146 const struct cmd_completion_handler *cmd_pop_completion_handler(void);
147
148 #endif /* CMD_H */
This page took 0.032238 seconds and 4 git commands to generate.