2 * Copyright (C) 2014 - Jonathan Rajotte <jonathan.r.julien@gmail.com>
3 * - Olivier Cotte <olivier.cotte@polymtl.ca>
4 * Copyright (C) 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License, version 2 only, as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include <common/error.h>
26 #include <common/macros.h>
27 #include <common/config/session-config.h>
28 #include <lttng/lttng.h>
30 /* Don't want to reference snapshot-internal.h here */
31 struct lttng_snapshot_output
;
33 /* Instance of a machine interface writer. */
35 struct config_writer
*writer
;
36 enum lttng_mi_output_type type
;
40 * Version information for the machine interface.
42 struct mi_lttng_version
{
43 char version
[LTTNG_NAME_MAX
]; /* Version number of package */
44 uint32_t version_major
; /* LTTng-Tools major version number */
45 uint32_t version_minor
; /* LTTng-Tools minor version number */
46 uint32_t version_patchlevel
; /* LTTng-Tools patchlevel version number */
47 char version_commit
[LTTNG_NAME_MAX
]; /* Commit hash of the current version */
48 char version_name
[LTTNG_NAME_MAX
];
49 char package_url
[LTTNG_NAME_MAX
]; /* Define to the home page for this package. */
52 /* Strings related to command */
53 extern const char * const mi_lttng_element_command
;
54 extern const char * const mi_lttng_element_command_action
;
55 extern const char * const mi_lttng_element_command_add_context
;
56 extern const char * const mi_lttng_element_command_calibrate
;
57 extern const char * const mi_lttng_element_command_create
;
58 extern const char * const mi_lttng_element_command_destroy
;
59 extern const char * const mi_lttng_element_command_disable_channel
;
60 extern const char * const mi_lttng_element_command_disable_event
;
61 extern const char * const mi_lttng_element_command_enable_channels
;
62 extern const char * const mi_lttng_element_command_enable_event
;
63 extern const char * const mi_lttng_element_command_list
;
64 extern const char * const mi_lttng_element_command_load
;
65 extern const char * const mi_lttng_element_command_metadata
;
66 extern const char * const mi_lttng_element_command_metadata_action
;
67 extern const char * const mi_lttng_element_command_regenerate
;
68 extern const char * const mi_lttng_element_command_regenerate_action
;
69 extern const char * const mi_lttng_element_command_name
;
70 extern const char * const mi_lttng_element_command_output
;
71 extern const char * const mi_lttng_element_command_save
;
72 extern const char * const mi_lttng_element_command_set_session
;
73 extern const char * const mi_lttng_element_command_snapshot
;
74 extern const char * const mi_lttng_element_command_snapshot_add
;
75 extern const char * const mi_lttng_element_command_snapshot_del
;
76 extern const char * const mi_lttng_element_command_snapshot_list
;
77 extern const char * const mi_lttng_element_command_snapshot_record
;
78 extern const char * const mi_lttng_element_command_start
;
79 extern const char * const mi_lttng_element_command_stop
;
80 extern const char * const mi_lttng_element_command_success
;
81 extern const char * const mi_lttng_element_command_track
;
82 extern const char * const mi_lttng_element_command_untrack
;
83 extern const char * const mi_lttng_element_command_version
;
85 /* Strings related to version command */
86 extern const char * const mi_lttng_element_version
;
87 extern const char * const mi_lttng_element_version_commit
;
88 extern const char * const mi_lttng_element_version_description
;
89 extern const char * const mi_lttng_element_version_license
;
90 extern const char * const mi_lttng_element_version_major
;
91 extern const char * const mi_lttng_element_version_minor
;
92 extern const char * const mi_lttng_element_version_patch_level
;
93 extern const char * const mi_lttng_element_version_str
;
94 extern const char * const mi_lttng_element_version_web
;
96 /* String related to a lttng_event_field */
97 extern const char * const mi_lttng_element_event_field
;
98 extern const char * const mi_lttng_element_event_fields
;
100 /* String related to lttng_event_perf_counter_ctx */
101 extern const char * const mi_lttng_element_perf_counter_context
;
103 /* Strings related to pid */
104 extern const char * const mi_lttng_element_pid_id
;
106 /* Strings related to save command */
107 extern const char * const mi_lttng_element_save
;
109 /* Strings related to load command */
110 extern const char * const mi_lttng_element_load
;
112 /* General element of mi_lttng */
113 extern const char * const mi_lttng_element_empty
;
114 extern const char * const mi_lttng_element_id
;
115 extern const char * const mi_lttng_element_nowrite
;
116 extern const char * const mi_lttng_element_success
;
117 extern const char * const mi_lttng_element_type_enum
;
118 extern const char * const mi_lttng_element_type_float
;
119 extern const char * const mi_lttng_element_type_integer
;
120 extern const char * const mi_lttng_element_type_other
;
121 extern const char * const mi_lttng_element_type_string
;
123 /* String related to loglevel */
124 extern const char * const mi_lttng_loglevel_str_alert
;
125 extern const char * const mi_lttng_loglevel_str_crit
;
126 extern const char * const mi_lttng_loglevel_str_debug
;
127 extern const char * const mi_lttng_loglevel_str_debug_function
;
128 extern const char * const mi_lttng_loglevel_str_debug_line
;
129 extern const char * const mi_lttng_loglevel_str_debug_module
;
130 extern const char * const mi_lttng_loglevel_str_debug_process
;
131 extern const char * const mi_lttng_loglevel_str_debug_program
;
132 extern const char * const mi_lttng_loglevel_str_debug_system
;
133 extern const char * const mi_lttng_loglevel_str_debug_unit
;
134 extern const char * const mi_lttng_loglevel_str_emerg
;
135 extern const char * const mi_lttng_loglevel_str_err
;
136 extern const char * const mi_lttng_loglevel_str_info
;
137 extern const char * const mi_lttng_loglevel_str_notice
;
138 extern const char * const mi_lttng_loglevel_str_unknown
;
139 extern const char * const mi_lttng_loglevel_str_warning
;
141 /* String related to loglevel JUL */
142 extern const char * const mi_lttng_loglevel_str_jul_all
;
143 extern const char * const mi_lttng_loglevel_str_jul_config
;
144 extern const char * const mi_lttng_loglevel_str_jul_fine
;
145 extern const char * const mi_lttng_loglevel_str_jul_finer
;
146 extern const char * const mi_lttng_loglevel_str_jul_finest
;
147 extern const char * const mi_lttng_loglevel_str_jul_info
;
148 extern const char * const mi_lttng_loglevel_str_jul_off
;
149 extern const char * const mi_lttng_loglevel_str_jul_severe
;
150 extern const char * const mi_lttng_loglevel_str_jul_warning
;
152 /* String related to loglevel Log4j */
153 extern const char * const mi_lttng_loglevel_str_log4j_off
;
154 extern const char * const mi_lttng_loglevel_str_log4j_fatal
;
155 extern const char * const mi_lttng_loglevel_str_log4j_error
;
156 extern const char * const mi_lttng_loglevel_str_log4j_warn
;
157 extern const char * const mi_lttng_loglevel_str_log4j_info
;
158 extern const char * const mi_lttng_loglevel_str_log4j_debug
;
159 extern const char * const mi_lttng_loglevel_str_log4j_trace
;
160 extern const char * const mi_lttng_loglevel_str_log4j_all
;
162 /* String related to loglevel Python */
163 extern const char * const mi_lttng_loglevel_str_python_critical
;
164 extern const char * const mi_lttng_loglevel_str_python_error
;
165 extern const char * const mi_lttng_loglevel_str_python_warning
;
166 extern const char * const mi_lttng_loglevel_str_python_info
;
167 extern const char * const mi_lttng_loglevel_str_python_debug
;
168 extern const char * const mi_lttng_loglevel_str_python_notset
;
170 /* String related to loglevel type */
171 extern const char * const mi_lttng_loglevel_type_all
;
172 extern const char * const mi_lttng_loglevel_type_range
;
173 extern const char * const mi_lttng_loglevel_type_single
;
174 extern const char * const mi_lttng_loglevel_type_unknown
;
176 /* Sting related to lttng_calibrate */
177 extern const char * const mi_lttng_element_calibrate
;
178 extern const char * const mi_lttng_element_calibrate_function
;
180 /* String related to a lttng_snapshot */
181 extern const char * const mi_lttng_element_snapshot_ctrl_url
;
182 extern const char * const mi_lttng_element_snapshot_data_url
;
183 extern const char * const mi_lttng_element_snapshot_max_size
;
184 extern const char * const mi_lttng_element_snapshot_n_ptr
;
185 extern const char * const mi_lttng_element_snapshot_session_name
;
186 extern const char * const mi_lttng_element_snapshots
;
188 /* String related to track/untrack command */
189 const char * const mi_lttng_element_track_untrack_all_wildcard
;
191 /* Utility string function */
192 const char *mi_lttng_loglevel_string(int value
, enum lttng_domain_type domain
);
193 const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value
);
194 const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type value
);
195 const char *mi_lttng_domaintype_string(enum lttng_domain_type value
);
196 const char *mi_lttng_buffertype_string(enum lttng_buffer_type value
);
197 const char *mi_lttng_calibratetype_string(enum lttng_calibrate_type val
);
200 * Create an instance of a machine interface writer.
202 * fd_output File to which the XML content must be written. The file will be
203 * closed once the mi_writer has been destroyed.
205 * Returns an instance of a machine interface writer on success, NULL on
208 struct mi_writer
*mi_lttng_writer_create(int fd_output
, int mi_output_type
);
211 * Destroy an instance of a machine interface writer.
213 * writer An instance of a machine interface writer.
215 * Returns zero if the XML document could be closed cleanly. Negative values
218 int mi_lttng_writer_destroy(struct mi_writer
*writer
);
221 * Open a command tag and add it's name node.
223 * writer An instance of a machine interface writer.
224 * command The command name.
226 * Returns zero if the XML document could be closed cleanly.
227 * Negative values indicate an error.
229 int mi_lttng_writer_command_open(struct mi_writer
*writer
, const char *command
);
232 * Close a command tag.
234 * writer An instance of a machine interface writer.
236 * Returns zero if the XML document could be closed cleanly.
237 * Negative values indicate an error.
239 int mi_lttng_writer_command_close(struct mi_writer
*writer
);
242 * Open an element tag.
244 * writer An instance of a machine interface writer.
245 * element_name Element tag name.
247 * Returns zero if the XML document could be closed cleanly.
248 * Negative values indicate an error.
250 int mi_lttng_writer_open_element(struct mi_writer
*writer
,
251 const char *element_name
);
254 * Close the current element tag.
256 * writer An instance of a machine interface writer.
258 * Returns zero if the XML document could be closed cleanly.
259 * Negative values indicate an error.
261 int mi_lttng_writer_close_element(struct mi_writer
*writer
);
264 * Close multiple element.
266 * writer An instance of a machine interface writer.
267 * nb_element Number of elements.
269 * Returns zero if the XML document could be closed cleanly.
270 * Negative values indicate an error.
272 int mi_lttng_close_multi_element(struct mi_writer
*writer
,
273 unsigned int nb_element
);
276 * Write an element of type unsigned int.
278 * writer An instance of a machine interface writer.
279 * element_name Element name.
280 * value Unsigned int value of the element
282 * Returns zero if the element's value could be written.
283 * Negative values indicate an error.
285 int mi_lttng_writer_write_element_unsigned_int(struct mi_writer
*writer
,
286 const char *element_name
, uint64_t value
);
289 * Write an element of type signed int.
291 * writer An instance of a machine interface writer.
292 * element_name Element name.
293 * value Signed int value of the element.
295 * Returns zero if the element's value could be written.
296 * Negative values indicate an error.
298 int mi_lttng_writer_write_element_signed_int(struct mi_writer
*writer
,
299 const char *element_name
, int64_t value
);
302 * Write an element of type boolean.
304 * writer An instance of a machine interface writer.
305 * element_name Element name.
306 * value Boolean value of the element.
308 * Returns zero if the element's value could be written.
309 * Negative values indicate an error.
311 int mi_lttng_writer_write_element_bool(struct mi_writer
*writer
,
312 const char *element_name
, int value
);
315 * Write an element of type string.
317 * writer An instance of a machine interface writer.
318 * element_name Element name.
319 * value String value of the element.
321 * Returns zero if the element's value could be written.
322 * Negative values indicate an error.
324 int mi_lttng_writer_write_element_string(struct mi_writer
*writer
,
325 const char *element_name
, const char *value
);
328 * Machine interface of struct version.
330 * writer An instance of a machine interface writer.
331 * version Version struct.
332 * lttng_description String value of the version description.
333 * lttng_license String value of the version license.
335 * Returns zero if the element's value could be written.
336 * Negative values indicate an error.
338 int mi_lttng_version(struct mi_writer
*writer
, struct mi_lttng_version
*version
,
339 const char *lttng_description
, const char *lttng_license
);
342 * Machine interface: open a sessions element.
344 * writer An instance of a machine interface writer.
346 * Returns zero if the element's value could be written.
347 * Negative values indicate an error.
349 int mi_lttng_sessions_open(struct mi_writer
*writer
);
352 * Machine interface of struct session.
354 * writer An instance of a machine interface writer.
355 * session An instance of a session.
356 * is_open Defines whether or not the session element shall be closed.
357 * This should be used carefully and the client
358 * must close the session element.
359 * Use case: nested additional information on a session
360 * ex: domain,channel event.
362 * Returns zero if the element's value could be written.
363 * Negative values indicate an error.
365 int mi_lttng_session(struct mi_writer
*writer
,
366 struct lttng_session
*session
, int is_open
);
369 * Machine interface: open a domains element.
371 * writer An instance of a machine interface writer.
373 * Returns zero if the element's value could be written.
374 * Negative values indicate an error.
376 int mi_lttng_domains_open(struct mi_writer
*writer
);
379 * Machine interface of struct domain.
381 * writer An instance of a machine interface writer.
382 * domain An instance of a domain.
384 * is_open Defines whether or not the session element shall be closed.
385 * This should be used carefully and the client
386 * must close the domain element.
387 * Use case: nested addition information on a domain
390 * Returns zero if the element's value could be written.
391 * Negative values indicate an error.
393 int mi_lttng_domain(struct mi_writer
*writer
,
394 struct lttng_domain
*domain
, int is_open
);
397 * Machine interface: open a channels element.
399 * writer An instance of a machine interface writer.
401 * Returns zero if the element's value could be written.
402 * Negative values indicate an error.
404 int mi_lttng_channels_open(struct mi_writer
*writer
);
407 * Machine interface of struct channel.
409 * writer An instance of a machine interface writer.
410 * channel An instance of a channel.
412 * is_open Defines whether or not the session element shall be closed.
413 * This should be used carefully and the client
414 * must close the channel element.
415 * Use case: nested addition information on a channel.
418 * Returns zero if the element's value could be written.
419 * Negative values indicate an error.
421 int mi_lttng_channel(struct mi_writer
*writer
,
422 struct lttng_channel
*channel
, int is_open
);
425 * Machine interface of struct channel_attr.
427 * writer An instance of a machine interface writer.
428 * attr An instance of a channel_attr struct.
430 * Returns zero if the element's value could be written.
431 * Negative values indicate an error.
433 int mi_lttng_channel_attr(struct mi_writer
*writer
,
434 struct lttng_channel_attr
*attr
);
437 * Machine interface for event common attributes.
439 * writer An instance of a mi writer.
440 * event single trace event.
442 * The common attribute are:
449 * Returns zero if the element's value could be written.
450 * Negative values indicate an error.
452 int mi_lttng_event_common_attributes(struct mi_writer
*writer
,
453 struct lttng_event
*event
);
456 * Machine interface for kernel tracepoint event with a loglevel.
458 * writer An instance of a mi writer.
459 * event single trace event.
460 * domain Event's domain
462 * Returns zero if the element's value could be written.
463 * Negative values indicate an error.
465 int mi_lttng_event_tracepoint_loglevel(struct mi_writer
*writer
,
466 struct lttng_event
*event
, enum lttng_domain_type domain
);
469 * Machine interface for kernel tracepoint event with no loglevel.
471 * writer An instance of a mi writer.
472 * event single trace event.
474 * Returns zero if the element's value could be written.
475 * Negative values indicate an error.
477 int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer
*writer
,
478 struct lttng_event
*event
);
481 * Machine interface for kernel function and probe event.
483 * writer An instance of a mi writer.
484 * event single trace event.
486 * Returns zero if the element's value could be written.
487 * Negative values indicate an error.
489 int mi_lttng_event_function_probe(struct mi_writer
*writer
,
490 struct lttng_event
*event
);
493 * Machine interface for kernel function entry event.
495 * writer An instance of a mi writer.
496 * event single trace event.
498 * Returns zero if the element's value could be written.
499 * Negative values indicate an error.
501 int mi_lttng_event_function_entry(struct mi_writer
*writer
,
502 struct lttng_event
*event
);
505 * Machine interface: open an events element.
507 * writer An instance of a machine interface writer.
509 * Returns zero if the element's value could be written.
510 * Negative values indicate an error.
512 int mi_lttng_events_open(struct mi_writer
*writer
);
515 * Machine interface for printing an event.
516 * The trace event type currently supported are:
523 * writer An instance of a mi writer.
524 * event single trace event.
525 * is_open Defines whether or not the session element shall be closed.
526 * This should be used carefully and the client
527 * must close the event element.
528 * Use case: nested additional information
529 * domain Event's domain
531 * Returns zero if the element's value could be written.
532 * Negative values indicate an error.
534 int mi_lttng_event(struct mi_writer
*writer
, struct lttng_event
*event
,
535 int is_open
, enum lttng_domain_type domain
);
538 * Machine interface for struct lttng_event_field.
540 * writer An instance of a mi writer.
541 * field An event_field instance.
543 * Returns zero if the element's value could be written.
544 * Negative values indicate an error.
546 int mi_lttng_event_field(struct mi_writer
*writer
,
547 struct lttng_event_field
*field
);
550 * Machine interface: open a event_fields element.
552 * writer An instance of a machine interface writer.
554 * Returns zero if the element have be written.
555 * Negative values indicate an error.
557 int mi_lttng_event_fields_open(struct mi_writer
*writer
);
560 * Machine interface: open a trackers element.
562 * writer An instance of a machine interface writer.
564 * Returns zero if the element's value could be written.
565 * Negative values indicate an error.
567 int mi_lttng_trackers_open(struct mi_writer
*writer
);
570 * Machine interface: open a pid_tracker element.
572 * writer An instance of a machine interface writer.
574 * Returns zero if the element's value could be written.
575 * Negative values indicate an error.
577 * Note: A targets element is also opened for each tracker definition
579 int mi_lttng_pid_tracker_open(struct mi_writer
*writer
);
582 * Machine interface: open a PIDs element.
584 * writer An instance of a machine interface writer.
586 * Returns zero if the element's value could be written.
587 * Negative values indicate an error.
589 int mi_lttng_pids_open(struct mi_writer
*writer
);
592 * Machine interface: open a processes element.
594 * writer An instance of a machine interface writer.
596 * Returns zero if the element's value could be written.
597 * Negative values indicate an error.
599 int mi_lttng_processes_open(struct mi_writer
*writer
);
602 * Machine interface of a Process.
604 * writer An instance of a machine interface writer.
607 * is_open Defines whether or not the session element shall be closed.
608 * This should be used carefully and the client
609 * must close the pid element.
610 * Use case: nested addition information on a domain
613 * Returns zero if the element's value could be written.
614 * Negative values indicate an error.
616 int mi_lttng_process(struct mi_writer
*writer
, pid_t pid
, const char *name
,
620 * TODO: move pid of lttng list -u to process semantic on mi api bump
621 * Machine interface of a Process.
623 * writer An instance of a machine interface writer.
626 * is_open Defines whether or not the session element shall be closed.
627 * This should be used carefully and the client
628 * must close the pid element.
629 * Use case: nested addition information on a domain
632 * Returns zero if the element's value could be written.
633 * Negative values indicate an error.
635 int mi_lttng_pid(struct mi_writer
*writer
, pid_t pid
, const char *name
,
638 * Machine interface: open a targets element.
640 * writer An instance of a machine interface writer.
642 * Returns zero if the element's value could be written.
643 * Negative values indicate an error.
645 int mi_lttng_targets_open(struct mi_writer
*writer
);
648 * Machine interface for track/untrack a pid_target
650 * writer An instance of a machine interface writer.
652 * Returns zero if the element's value could be written.
653 * Negative values indicate an error.
655 int mi_lttng_pid_target(struct mi_writer
*writer
, pid_t pid
, int is_open
);
658 * Machine interface for struct lttng_calibrate.
660 * writer An instance of a machine interface writer.
662 * calibrate A lttng_calibrate instance.
664 * Returns zero if the element's value could be written.
665 * Negative values indicate an error.
667 int mi_lttng_calibrate(struct mi_writer
*writer
,
668 struct lttng_calibrate
*calibrate
);
671 * Machine interface of a context.
673 * writer An instance of a machine interface writer
675 * context An instance of a lttng_event_context
677 * is_open Define if we close the context element
678 * This should be used carefully and the client
679 * need to close the context element.
680 * Returns zero if the element's value could be written.
681 * Negative values indicate an error.
683 int mi_lttng_context(struct mi_writer
*writer
,
684 struct lttng_event_context
*context
, int is_open
);
687 * Machine interface of a perf_counter_context.
689 * writer An instance of a machine interface writer
691 * contest An instance of a lttng_event_perf_counter_ctx
693 * Returns zero if the element's value could be written.
694 * Negative values indicate an error.
696 int mi_lttng_perf_counter_context(struct mi_writer
*writer
,
697 struct lttng_event_perf_counter_ctx
*perf_context
);
700 * Machine interface of the snapshot list_output.
701 * It specifies the session for which we are listing snapshots,
702 * and it opens a snapshots element to list a sequence
705 * writer An instance of a machine interface writer.
707 * session_name: Snapshot output for session "session_name".
709 * Note: The client has to close the session and the snapshots elements after
710 * having listed every lttng_snapshot_output.
712 * Returns zero if the element's value could be written.
713 * Negative values indicate an error.
715 int mi_lttng_snapshot_output_session_name(struct mi_writer
*writer
,
716 const char *session_name
);
719 * Machine interface of the snapshot output.
720 * The machine interface serializes the following attributes:
721 * - id: ID of the snapshot output.
722 * - name: Name of the output.
723 * - data_url : Destination of the output.
724 * - ctrl_url: Destination of the output.
725 * - max_size: total size of all stream combined.
727 * writer An instance of a machine interface writer.
729 * output: A list of snapshot_output.
731 * Returns zero if the element's value could be written.
732 * Negative values indicate an error.
734 int mi_lttng_snapshot_list_output(struct mi_writer
*writer
,
735 struct lttng_snapshot_output
*output
);
738 * Machine interface of the output of the command snapshot del output
739 * when deleting a snapshot either by id or by name.
740 * If the snapshot was found and successfully deleted using its id,
741 * it return the id of the snapshot and the current session name on which it
744 * Otherwise, it do the same process with the name of the snapshot, if the
745 * snapshot output id is undefined.
747 * writer An instance of a machine interface writer.
749 * id: ID of the snapshot output.
751 * name: Name of the snapshot.
753 * current_session_name: Session to which the snapshot belongs.
755 * Returns zero if the element's value could be written.
756 * Negative values indicate an error.
758 int mi_lttng_snapshot_del_output(struct mi_writer
*writer
, int id
,
759 const char *name
, const char *current_session_name
);
762 * Machine interface of the output of the command snapshot add output
763 * when adding a snapshot from a user URL.
765 * If the snapshot was successfully added, the machine interface lists
767 * - id: ID of the newly add snapshot output.
768 * - current_session_name: Name of the session to which the output was added.
769 * - ctrl_url: Destination of the output.
770 * - max_size: total size of all stream combined.
772 * writer An instance of a machine interface writer.
774 * current_session_name: Session to which the snapshot belongs.
778 * output: iterator over a lttng_snapshot_output_list which contain
779 * the snapshot output informations.
781 * Returns zero if the element's value could be written.
782 * Negative values indicate an error.
784 int mi_lttng_snapshot_add_output(struct mi_writer
*writer
,
785 const char *current_session_name
, const char *n_ptr
,
786 struct lttng_snapshot_output
*output
);
789 * Machine interface of the output of the command snapshot
790 * record from a URL (if given).
792 * If the snapshot is successfully recorded from a url, the machine interface
793 * output the following information:
794 * - url: Destination of the output stored in the snapshot.
796 * Otherwise, the machine interface output the data and ctrl url received
797 * from the command-line.
799 * writer An instance of a machine interface writer.
801 * current_session_name: Snapshot record for session "current_session_name".
803 * ctrl_url, data_url: Destination of the output receive from the command-line.
805 * Returns zero if the element's value could be written.
806 * Negative values indicate an error.
808 int mi_lttng_snapshot_record(struct mi_writer
*writer
,
809 const char *current_session_name
, const char *url
,
810 const char *cmdline_ctrl_url
, const char *cmdline_data_url
);
812 #endif /* _MI_LTTNG_H */