2 * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
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.
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
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.
24 struct notification_thread_handle
;
27 * Init the command subsystem. Must be called before using any of the functions
28 * above. This is called in the main() of the session daemon.
32 /* Session commands */
33 int cmd_create_session_uri(char *name
, struct lttng_uri
*uris
,
34 size_t nb_uri
, lttng_sock_cred
*creds
, unsigned int live_timer
);
35 int cmd_create_session_snapshot(char *name
, struct lttng_uri
*uris
,
36 size_t nb_uri
, lttng_sock_cred
*creds
);
37 int cmd_destroy_session(struct ltt_session
*session
, int wpipe
);
39 /* Channel commands */
40 int cmd_disable_channel(struct ltt_session
*session
,
41 enum lttng_domain_type domain
, char *channel_name
);
42 int cmd_enable_channel(struct ltt_session
*session
,
43 struct lttng_domain
*domain
, struct lttng_channel
*attr
,
45 int cmd_track_pid(struct ltt_session
*session
, enum lttng_domain_type domain
,
47 int cmd_untrack_pid(struct ltt_session
*session
, enum lttng_domain_type domain
,
51 int cmd_disable_event(struct ltt_session
*session
,
52 enum lttng_domain_type domain
,
54 struct lttng_event
*event
);
55 int cmd_add_context(struct ltt_session
*session
, enum lttng_domain_type domain
,
56 char *channel_name
, struct lttng_event_context
*ctx
, int kwpipe
);
57 int cmd_set_filter(struct ltt_session
*session
, enum lttng_domain_type domain
,
58 char *channel_name
, struct lttng_event
*event
,
59 struct lttng_filter_bytecode
*bytecode
);
60 int cmd_enable_event(struct ltt_session
*session
, struct lttng_domain
*domain
,
61 char *channel_name
, struct lttng_event
*event
,
62 char *filter_expression
,
63 struct lttng_filter_bytecode
*filter
,
64 struct lttng_event_exclusion
*exclusion
,
67 /* Trace session action commands */
68 int cmd_start_trace(struct ltt_session
*session
);
69 int cmd_stop_trace(struct ltt_session
*session
);
71 /* Consumer commands */
72 int cmd_register_consumer(struct ltt_session
*session
,
73 enum lttng_domain_type domain
,
74 const char *sock_path
, struct consumer_data
*cdata
);
75 int cmd_set_consumer_uri(struct ltt_session
*session
, size_t nb_uri
,
76 struct lttng_uri
*uris
);
77 int cmd_setup_relayd(struct ltt_session
*session
);
79 /* Listing commands */
80 ssize_t
cmd_list_domains(struct ltt_session
*session
,
81 struct lttng_domain
**domains
);
82 ssize_t
cmd_list_events(enum lttng_domain_type domain
,
83 struct ltt_session
*session
, char *channel_name
,
84 struct lttng_event
**events
, size_t *total_size
);
85 ssize_t
cmd_list_channels(enum lttng_domain_type domain
,
86 struct ltt_session
*session
, struct lttng_channel
**channels
);
87 ssize_t
cmd_list_domains(struct ltt_session
*session
,
88 struct lttng_domain
**domains
);
89 void cmd_list_lttng_sessions(struct lttng_session
*sessions
, uid_t uid
,
91 ssize_t
cmd_list_tracepoint_fields(enum lttng_domain_type domain
,
92 struct lttng_event_field
**fields
);
93 ssize_t
cmd_list_tracepoints(enum lttng_domain_type domain
,
94 struct lttng_event
**events
);
95 ssize_t
cmd_snapshot_list_outputs(struct ltt_session
*session
,
96 struct lttng_snapshot_output
**outputs
);
97 ssize_t
cmd_list_syscalls(struct lttng_event
**events
);
98 ssize_t
cmd_list_tracker_pids(struct ltt_session
*session
,
99 enum lttng_domain_type domain
, int32_t **pids
);
101 int cmd_data_pending(struct ltt_session
*session
);
104 int cmd_snapshot_add_output(struct ltt_session
*session
,
105 struct lttng_snapshot_output
*output
, uint32_t *id
);
106 int cmd_snapshot_del_output(struct ltt_session
*session
,
107 struct lttng_snapshot_output
*output
);
108 int cmd_snapshot_record(struct ltt_session
*session
,
109 struct lttng_snapshot_output
*output
, int wait
);
111 int cmd_set_session_shm_path(struct ltt_session
*session
,
112 const char *shm_path
);
113 int cmd_regenerate_metadata(struct ltt_session
*session
);
114 int cmd_regenerate_statedump(struct ltt_session
*session
);
116 int cmd_register_trigger(struct command_ctx
*cmd_ctx
, int sock
,
117 struct notification_thread_handle
*notification_thread_handle
);
118 int cmd_unregister_trigger(struct command_ctx
*cmd_ctx
, int sock
,
119 struct notification_thread_handle
*notification_thread_handle
);
121 int cmd_rotate_session(struct ltt_session
*session
,
122 struct lttng_rotate_session_return
*rotate_return
);
123 int cmd_rotate_get_info(struct ltt_session
*session
,
124 struct lttng_rotation_get_info_return
*info_return
,
126 int cmd_session_get_current_output(struct ltt_session
*session
,
127 struct lttng_session_get_current_output_return
*output_return
);