Fix: streamline ret/errno of run_as()
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.h
CommitLineData
2f77fc4b
DG
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"
2f77fc4b
DG
22#include "session.h"
23
24/*
25 * Init the command subsystem. Must be called before using any of the functions
26 * above. This is called in the main() of the session daemon.
27 */
28void cmd_init(void);
29
30/* Session commands */
31int cmd_create_session_uri(char *name, struct lttng_uri *uris,
ecc48a90 32 size_t nb_uri, lttng_sock_cred *creds, unsigned int live_timer);
27babd3a
DG
33int cmd_create_session_snapshot(char *name, struct lttng_uri *uris,
34 size_t nb_uri, lttng_sock_cred *creds);
2f77fc4b
DG
35int cmd_destroy_session(struct ltt_session *session, int wpipe);
36
37/* Channel commands */
56a37563
JG
38int cmd_disable_channel(struct ltt_session *session,
39 enum lttng_domain_type domain, char *channel_name);
7972aab2 40int cmd_enable_channel(struct ltt_session *session,
56a37563
JG
41 struct lttng_domain *domain, struct lttng_channel *attr,
42 int wpipe);
43int cmd_track_pid(struct ltt_session *session, enum lttng_domain_type domain,
44 int pid);
45int cmd_untrack_pid(struct ltt_session *session, enum lttng_domain_type domain,
46 int pid);
2f77fc4b
DG
47
48/* Event commands */
56a37563
JG
49int cmd_disable_event(struct ltt_session *session,
50 enum lttng_domain_type domain,
6e911cad
MD
51 char *channel_name,
52 struct lttng_event *event);
56a37563 53int cmd_add_context(struct ltt_session *session, enum lttng_domain_type domain,
601d5acf 54 char *channel_name, struct lttng_event_context *ctx, int kwpipe);
56a37563 55int cmd_set_filter(struct ltt_session *session, enum lttng_domain_type domain,
178191b3 56 char *channel_name, struct lttng_event *event,
2f77fc4b 57 struct lttng_filter_bytecode *bytecode);
7972aab2 58int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
025faf73 59 char *channel_name, struct lttng_event *event,
6b453b5e 60 char *filter_expression,
db8f1377
JI
61 struct lttng_filter_bytecode *filter,
62 struct lttng_event_exclusion *exclusion,
63 int wpipe);
2f77fc4b
DG
64
65/* Trace session action commands */
66int cmd_start_trace(struct ltt_session *session);
67int cmd_stop_trace(struct ltt_session *session);
68
69/* Consumer commands */
56a37563
JG
70int cmd_register_consumer(struct ltt_session *session,
71 enum lttng_domain_type domain,
2f77fc4b 72 const char *sock_path, struct consumer_data *cdata);
bda32d56
JG
73int cmd_set_consumer_uri(struct ltt_session *session, size_t nb_uri,
74 struct lttng_uri *uris);
ffe60014 75int cmd_setup_relayd(struct ltt_session *session);
2f77fc4b
DG
76
77/* Listing commands */
78ssize_t cmd_list_domains(struct ltt_session *session,
79 struct lttng_domain **domains);
56a37563
JG
80ssize_t cmd_list_events(enum lttng_domain_type domain,
81 struct ltt_session *session, char *channel_name,
82 struct lttng_event **events);
83ssize_t cmd_list_channels(enum lttng_domain_type domain,
84 struct ltt_session *session, struct lttng_channel **channels);
2f77fc4b
DG
85ssize_t cmd_list_domains(struct ltt_session *session,
86 struct lttng_domain **domains);
87void cmd_list_lttng_sessions(struct lttng_session *sessions, uid_t uid,
88 gid_t gid);
56a37563 89ssize_t cmd_list_tracepoint_fields(enum lttng_domain_type domain,
2f77fc4b 90 struct lttng_event_field **fields);
56a37563
JG
91ssize_t cmd_list_tracepoints(enum lttng_domain_type domain,
92 struct lttng_event **events);
6dc3064a
DG
93ssize_t cmd_snapshot_list_outputs(struct ltt_session *session,
94 struct lttng_snapshot_output **outputs);
834978fd 95ssize_t cmd_list_syscalls(struct lttng_event **events);
a5dfbb9d 96ssize_t cmd_list_tracker_pids(struct ltt_session *session,
56a37563 97 enum lttng_domain_type domain, int32_t **pids);
2f77fc4b 98
56a37563
JG
99int cmd_calibrate(enum lttng_domain_type domain,
100 struct lttng_calibrate *calibrate);
6d805429 101int cmd_data_pending(struct ltt_session *session);
2f77fc4b 102
6dc3064a
DG
103/* Snapshot */
104int cmd_snapshot_add_output(struct ltt_session *session,
105 struct lttng_snapshot_output *output, uint32_t *id);
106int cmd_snapshot_del_output(struct ltt_session *session,
107 struct lttng_snapshot_output *output);
108int cmd_snapshot_record(struct ltt_session *session,
109 struct lttng_snapshot_output *output, int wait);
110
d7ba1388
MD
111int cmd_set_session_shm_path(struct ltt_session *session,
112 const char *shm_path);
113
2f77fc4b 114#endif /* CMD_H */
This page took 0.04098 seconds and 4 git commands to generate.