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_name
;
68 extern const char * const mi_lttng_element_command_output
;
69 extern const char * const mi_lttng_element_command_save
;
70 extern const char * const mi_lttng_element_command_set_session
;
71 extern const char * const mi_lttng_element_command_snapshot
;
72 extern const char * const mi_lttng_element_command_snapshot_add
;
73 extern const char * const mi_lttng_element_command_snapshot_del
;
74 extern const char * const mi_lttng_element_command_snapshot_list
;
75 extern const char * const mi_lttng_element_command_snapshot_record
;
76 extern const char * const mi_lttng_element_command_start
;
77 extern const char * const mi_lttng_element_command_stop
;
78 extern const char * const mi_lttng_element_command_success
;
79 extern const char * const mi_lttng_element_command_track
;
80 extern const char * const mi_lttng_element_command_untrack
;
81 extern const char * const mi_lttng_element_command_version
;
83 /* Strings related to version command */
84 extern const char * const mi_lttng_element_version
;
85 extern const char * const mi_lttng_element_version_commit
;
86 extern const char * const mi_lttng_element_version_description
;
87 extern const char * const mi_lttng_element_version_license
;
88 extern const char * const mi_lttng_element_version_major
;
89 extern const char * const mi_lttng_element_version_minor
;
90 extern const char * const mi_lttng_element_version_patch_level
;
91 extern const char * const mi_lttng_element_version_str
;
92 extern const char * const mi_lttng_element_version_web
;
94 /* String related to a lttng_event_field */
95 extern const char * const mi_lttng_element_event_field
;
96 extern const char * const mi_lttng_element_event_fields
;
98 /* String related to lttng_event_perf_counter_ctx */
99 extern const char * const mi_lttng_element_perf_counter_context
;
101 /* Strings related to pid */
102 extern const char * const mi_lttng_element_pid_id
;
104 /* Strings related to save command */
105 extern const char * const mi_lttng_element_save
;
107 /* Strings related to load command */
108 extern const char * const mi_lttng_element_load
;
110 /* General element of mi_lttng */
111 extern const char * const mi_lttng_element_empty
;
112 extern const char * const mi_lttng_element_id
;
113 extern const char * const mi_lttng_element_nowrite
;
114 extern const char * const mi_lttng_element_success
;
115 extern const char * const mi_lttng_element_type_enum
;
116 extern const char * const mi_lttng_element_type_float
;
117 extern const char * const mi_lttng_element_type_integer
;
118 extern const char * const mi_lttng_element_type_other
;
119 extern const char * const mi_lttng_element_type_string
;
121 /* String related to loglevel */
122 extern const char * const mi_lttng_loglevel_str_alert
;
123 extern const char * const mi_lttng_loglevel_str_crit
;
124 extern const char * const mi_lttng_loglevel_str_debug
;
125 extern const char * const mi_lttng_loglevel_str_debug_function
;
126 extern const char * const mi_lttng_loglevel_str_debug_line
;
127 extern const char * const mi_lttng_loglevel_str_debug_module
;
128 extern const char * const mi_lttng_loglevel_str_debug_process
;
129 extern const char * const mi_lttng_loglevel_str_debug_program
;
130 extern const char * const mi_lttng_loglevel_str_debug_system
;
131 extern const char * const mi_lttng_loglevel_str_debug_unit
;
132 extern const char * const mi_lttng_loglevel_str_emerg
;
133 extern const char * const mi_lttng_loglevel_str_err
;
134 extern const char * const mi_lttng_loglevel_str_info
;
135 extern const char * const mi_lttng_loglevel_str_notice
;
136 extern const char * const mi_lttng_loglevel_str_unknown
;
137 extern const char * const mi_lttng_loglevel_str_warning
;
139 /* String related to loglevel JUL */
140 extern const char * const mi_lttng_loglevel_str_jul_all
;
141 extern const char * const mi_lttng_loglevel_str_jul_config
;
142 extern const char * const mi_lttng_loglevel_str_jul_fine
;
143 extern const char * const mi_lttng_loglevel_str_jul_finer
;
144 extern const char * const mi_lttng_loglevel_str_jul_finest
;
145 extern const char * const mi_lttng_loglevel_str_jul_info
;
146 extern const char * const mi_lttng_loglevel_str_jul_off
;
147 extern const char * const mi_lttng_loglevel_str_jul_severe
;
148 extern const char * const mi_lttng_loglevel_str_jul_warning
;
150 /* String related to loglevel Log4j */
151 extern const char * const mi_lttng_loglevel_str_log4j_off
;
152 extern const char * const mi_lttng_loglevel_str_log4j_fatal
;
153 extern const char * const mi_lttng_loglevel_str_log4j_error
;
154 extern const char * const mi_lttng_loglevel_str_log4j_warn
;
155 extern const char * const mi_lttng_loglevel_str_log4j_info
;
156 extern const char * const mi_lttng_loglevel_str_log4j_debug
;
157 extern const char * const mi_lttng_loglevel_str_log4j_trace
;
158 extern const char * const mi_lttng_loglevel_str_log4j_all
;
160 /* String related to loglevel Python */
161 extern const char * const mi_lttng_loglevel_str_python_critical
;
162 extern const char * const mi_lttng_loglevel_str_python_error
;
163 extern const char * const mi_lttng_loglevel_str_python_warning
;
164 extern const char * const mi_lttng_loglevel_str_python_info
;
165 extern const char * const mi_lttng_loglevel_str_python_debug
;
166 extern const char * const mi_lttng_loglevel_str_python_notset
;
168 /* String related to loglevel type */
169 extern const char * const mi_lttng_loglevel_type_all
;
170 extern const char * const mi_lttng_loglevel_type_range
;
171 extern const char * const mi_lttng_loglevel_type_single
;
172 extern const char * const mi_lttng_loglevel_type_unknown
;
174 /* Sting related to lttng_calibrate */
175 extern const char * const mi_lttng_element_calibrate
;
176 extern const char * const mi_lttng_element_calibrate_function
;
178 /* String related to a lttng_snapshot */
179 extern const char * const mi_lttng_element_snapshot_ctrl_url
;
180 extern const char * const mi_lttng_element_snapshot_data_url
;
181 extern const char * const mi_lttng_element_snapshot_max_size
;
182 extern const char * const mi_lttng_element_snapshot_n_ptr
;
183 extern const char * const mi_lttng_element_snapshot_session_name
;
184 extern const char * const mi_lttng_element_snapshots
;
186 /* String related to track/untrack command */
187 const char * const mi_lttng_element_track_untrack_all_wildcard
;
189 /* Utility string function */
190 const char *mi_lttng_loglevel_string(int value
, enum lttng_domain_type domain
);
191 const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value
);
192 const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type value
);
193 const char *mi_lttng_domaintype_string(enum lttng_domain_type value
);
194 const char *mi_lttng_buffertype_string(enum lttng_buffer_type value
);
195 const char *mi_lttng_calibratetype_string(enum lttng_calibrate_type val
);
198 * Create an instance of a machine interface writer.
200 * fd_output File to which the XML content must be written. The file will be
201 * closed once the mi_writer has been destroyed.
203 * Returns an instance of a machine interface writer on success, NULL on
206 struct mi_writer
*mi_lttng_writer_create(int fd_output
, int mi_output_type
);
209 * Destroy an instance of a machine interface writer.
211 * writer An instance of a machine interface writer.
213 * Returns zero if the XML document could be closed cleanly. Negative values
216 int mi_lttng_writer_destroy(struct mi_writer
*writer
);
219 * Open a command tag and add it's name node.
221 * writer An instance of a machine interface writer.
222 * command The command name.
224 * Returns zero if the XML document could be closed cleanly.
225 * Negative values indicate an error.
227 int mi_lttng_writer_command_open(struct mi_writer
*writer
, const char *command
);
230 * Close a command tag.
232 * writer An instance of a machine interface writer.
234 * Returns zero if the XML document could be closed cleanly.
235 * Negative values indicate an error.
237 int mi_lttng_writer_command_close(struct mi_writer
*writer
);
240 * Open an element tag.
242 * writer An instance of a machine interface writer.
243 * element_name Element tag name.
245 * Returns zero if the XML document could be closed cleanly.
246 * Negative values indicate an error.
248 int mi_lttng_writer_open_element(struct mi_writer
*writer
,
249 const char *element_name
);
252 * Close the current element tag.
254 * writer An instance of a machine interface writer.
256 * Returns zero if the XML document could be closed cleanly.
257 * Negative values indicate an error.
259 int mi_lttng_writer_close_element(struct mi_writer
*writer
);
262 * Close multiple element.
264 * writer An instance of a machine interface writer.
265 * nb_element Number of elements.
267 * Returns zero if the XML document could be closed cleanly.
268 * Negative values indicate an error.
270 int mi_lttng_close_multi_element(struct mi_writer
*writer
,
271 unsigned int nb_element
);
274 * Write an element of type unsigned int.
276 * writer An instance of a machine interface writer.
277 * element_name Element name.
278 * value Unsigned int value of the element
280 * Returns zero if the element's value could be written.
281 * Negative values indicate an error.
283 int mi_lttng_writer_write_element_unsigned_int(struct mi_writer
*writer
,
284 const char *element_name
, uint64_t value
);
287 * Write an element of type signed int.
289 * writer An instance of a machine interface writer.
290 * element_name Element name.
291 * value Signed int value of the element.
293 * Returns zero if the element's value could be written.
294 * Negative values indicate an error.
296 int mi_lttng_writer_write_element_signed_int(struct mi_writer
*writer
,
297 const char *element_name
, int64_t value
);
300 * Write an element of type boolean.
302 * writer An instance of a machine interface writer.
303 * element_name Element name.
304 * value Boolean value of the element.
306 * Returns zero if the element's value could be written.
307 * Negative values indicate an error.
309 int mi_lttng_writer_write_element_bool(struct mi_writer
*writer
,
310 const char *element_name
, int value
);
313 * Write an element of type string.
315 * writer An instance of a machine interface writer.
316 * element_name Element name.
317 * value String value of the element.
319 * Returns zero if the element's value could be written.
320 * Negative values indicate an error.
322 int mi_lttng_writer_write_element_string(struct mi_writer
*writer
,
323 const char *element_name
, const char *value
);
326 * Machine interface of struct version.
328 * writer An instance of a machine interface writer.
329 * version Version struct.
330 * lttng_description String value of the version description.
331 * lttng_license String value of the version license.
333 * Returns zero if the element's value could be written.
334 * Negative values indicate an error.
336 int mi_lttng_version(struct mi_writer
*writer
, struct mi_lttng_version
*version
,
337 const char *lttng_description
, const char *lttng_license
);
340 * Machine interface: open a sessions element.
342 * writer An instance of a machine interface writer.
344 * Returns zero if the element's value could be written.
345 * Negative values indicate an error.
347 int mi_lttng_sessions_open(struct mi_writer
*writer
);
350 * Machine interface of struct session.
352 * writer An instance of a machine interface writer.
353 * session An instance of a session.
354 * is_open Defines whether or not the session element shall be closed.
355 * This should be used carefully and the client
356 * must close the session element.
357 * Use case: nested additional information on a session
358 * ex: domain,channel event.
360 * Returns zero if the element's value could be written.
361 * Negative values indicate an error.
363 int mi_lttng_session(struct mi_writer
*writer
,
364 struct lttng_session
*session
, int is_open
);
367 * Machine interface: open a domains element.
369 * writer An instance of a machine interface writer.
371 * Returns zero if the element's value could be written.
372 * Negative values indicate an error.
374 int mi_lttng_domains_open(struct mi_writer
*writer
);
377 * Machine interface of struct domain.
379 * writer An instance of a machine interface writer.
380 * domain An instance of a domain.
382 * is_open Defines whether or not the session element shall be closed.
383 * This should be used carefully and the client
384 * must close the domain element.
385 * Use case: nested addition information on a domain
388 * Returns zero if the element's value could be written.
389 * Negative values indicate an error.
391 int mi_lttng_domain(struct mi_writer
*writer
,
392 struct lttng_domain
*domain
, int is_open
);
395 * Machine interface: open a channels element.
397 * writer An instance of a machine interface writer.
399 * Returns zero if the element's value could be written.
400 * Negative values indicate an error.
402 int mi_lttng_channels_open(struct mi_writer
*writer
);
405 * Machine interface of struct channel.
407 * writer An instance of a machine interface writer.
408 * channel An instance of a channel.
410 * is_open Defines whether or not the session element shall be closed.
411 * This should be used carefully and the client
412 * must close the channel element.
413 * Use case: nested addition information on a channel.
416 * Returns zero if the element's value could be written.
417 * Negative values indicate an error.
419 int mi_lttng_channel(struct mi_writer
*writer
,
420 struct lttng_channel
*channel
, int is_open
);
423 * Machine interface of struct channel_attr.
425 * writer An instance of a machine interface writer.
426 * attr An instance of a channel_attr struct.
428 * Returns zero if the element's value could be written.
429 * Negative values indicate an error.
431 int mi_lttng_channel_attr(struct mi_writer
*writer
,
432 struct lttng_channel_attr
*attr
);
435 * Machine interface for event common attributes.
437 * writer An instance of a mi writer.
438 * event single trace event.
440 * The common attribute are:
447 * Returns zero if the element's value could be written.
448 * Negative values indicate an error.
450 int mi_lttng_event_common_attributes(struct mi_writer
*writer
,
451 struct lttng_event
*event
);
454 * Machine interface for kernel tracepoint event with a loglevel.
456 * writer An instance of a mi writer.
457 * event single trace event.
458 * domain Event's domain
460 * Returns zero if the element's value could be written.
461 * Negative values indicate an error.
463 int mi_lttng_event_tracepoint_loglevel(struct mi_writer
*writer
,
464 struct lttng_event
*event
, enum lttng_domain_type domain
);
467 * Machine interface for kernel tracepoint event with no loglevel.
469 * writer An instance of a mi writer.
470 * event single trace event.
472 * Returns zero if the element's value could be written.
473 * Negative values indicate an error.
475 int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer
*writer
,
476 struct lttng_event
*event
);
479 * Machine interface for kernel function and probe event.
481 * writer An instance of a mi writer.
482 * event single trace event.
484 * Returns zero if the element's value could be written.
485 * Negative values indicate an error.
487 int mi_lttng_event_function_probe(struct mi_writer
*writer
,
488 struct lttng_event
*event
);
491 * Machine interface for kernel function entry event.
493 * writer An instance of a mi writer.
494 * event single trace event.
496 * Returns zero if the element's value could be written.
497 * Negative values indicate an error.
499 int mi_lttng_event_function_entry(struct mi_writer
*writer
,
500 struct lttng_event
*event
);
503 * Machine interface: open an events element.
505 * writer An instance of a machine interface writer.
507 * Returns zero if the element's value could be written.
508 * Negative values indicate an error.
510 int mi_lttng_events_open(struct mi_writer
*writer
);
513 * Machine interface for printing an event.
514 * The trace event type currently supported are:
521 * writer An instance of a mi writer.
522 * event single trace event.
523 * is_open Defines whether or not the session element shall be closed.
524 * This should be used carefully and the client
525 * must close the event element.
526 * Use case: nested additional information
527 * domain Event's domain
529 * Returns zero if the element's value could be written.
530 * Negative values indicate an error.
532 int mi_lttng_event(struct mi_writer
*writer
, struct lttng_event
*event
,
533 int is_open
, enum lttng_domain_type domain
);
536 * Machine interface for struct lttng_event_field.
538 * writer An instance of a mi writer.
539 * field An event_field instance.
541 * Returns zero if the element's value could be written.
542 * Negative values indicate an error.
544 int mi_lttng_event_field(struct mi_writer
*writer
,
545 struct lttng_event_field
*field
);
548 * Machine interface: open a event_fields element.
550 * writer An instance of a machine interface writer.
552 * Returns zero if the element have be written.
553 * Negative values indicate an error.
555 int mi_lttng_event_fields_open(struct mi_writer
*writer
);
558 * Machine interface: open a trackers element.
560 * writer An instance of a machine interface writer.
562 * Returns zero if the element's value could be written.
563 * Negative values indicate an error.
565 int mi_lttng_trackers_open(struct mi_writer
*writer
);
568 * Machine interface: open a pid_tracker element.
570 * writer An instance of a machine interface writer.
572 * Returns zero if the element's value could be written.
573 * Negative values indicate an error.
575 * Note: A targets element is also opened for each tracker definition
577 int mi_lttng_pid_tracker_open(struct mi_writer
*writer
);
580 * Machine interface: open a PIDs element.
582 * writer An instance of a machine interface writer.
584 * Returns zero if the element's value could be written.
585 * Negative values indicate an error.
587 int mi_lttng_pids_open(struct mi_writer
*writer
);
590 * Machine interface: open a processes element.
592 * writer An instance of a machine interface writer.
594 * Returns zero if the element's value could be written.
595 * Negative values indicate an error.
597 int mi_lttng_processes_open(struct mi_writer
*writer
);
600 * Machine interface of a Process.
602 * writer An instance of a machine interface writer.
605 * is_open Defines whether or not the session element shall be closed.
606 * This should be used carefully and the client
607 * must close the pid element.
608 * Use case: nested addition information on a domain
611 * Returns zero if the element's value could be written.
612 * Negative values indicate an error.
614 int mi_lttng_process(struct mi_writer
*writer
, pid_t pid
, const char *name
,
618 * TODO: move pid of lttng list -u to process semantic on mi api bump
619 * Machine interface of a Process.
621 * writer An instance of a machine interface writer.
624 * is_open Defines whether or not the session element shall be closed.
625 * This should be used carefully and the client
626 * must close the pid element.
627 * Use case: nested addition information on a domain
630 * Returns zero if the element's value could be written.
631 * Negative values indicate an error.
633 int mi_lttng_pid(struct mi_writer
*writer
, pid_t pid
, const char *name
,
636 * Machine interface: open a targets element.
638 * writer An instance of a machine interface writer.
640 * Returns zero if the element's value could be written.
641 * Negative values indicate an error.
643 int mi_lttng_targets_open(struct mi_writer
*writer
);
646 * Machine interface for track/untrack a pid_target
648 * writer An instance of a machine interface writer.
650 * Returns zero if the element's value could be written.
651 * Negative values indicate an error.
653 int mi_lttng_pid_target(struct mi_writer
*writer
, pid_t pid
, int is_open
);
656 * Machine interface for struct lttng_calibrate.
658 * writer An instance of a machine interface writer.
660 * calibrate A lttng_calibrate instance.
662 * Returns zero if the element's value could be written.
663 * Negative values indicate an error.
665 int mi_lttng_calibrate(struct mi_writer
*writer
,
666 struct lttng_calibrate
*calibrate
);
669 * Machine interface of a context.
671 * writer An instance of a machine interface writer
673 * context An instance of a lttng_event_context
675 * is_open Define if we close the context element
676 * This should be used carefully and the client
677 * need to close the context element.
678 * Returns zero if the element's value could be written.
679 * Negative values indicate an error.
681 int mi_lttng_context(struct mi_writer
*writer
,
682 struct lttng_event_context
*context
, int is_open
);
685 * Machine interface of a perf_counter_context.
687 * writer An instance of a machine interface writer
689 * contest An instance of a lttng_event_perf_counter_ctx
691 * Returns zero if the element's value could be written.
692 * Negative values indicate an error.
694 int mi_lttng_perf_counter_context(struct mi_writer
*writer
,
695 struct lttng_event_perf_counter_ctx
*perf_context
);
698 * Machine interface of the snapshot list_output.
699 * It specifies the session for which we are listing snapshots,
700 * and it opens a snapshots element to list a sequence
703 * writer An instance of a machine interface writer.
705 * session_name: Snapshot output for session "session_name".
707 * Note: The client has to close the session and the snapshots elements after
708 * having listed every lttng_snapshot_output.
710 * Returns zero if the element's value could be written.
711 * Negative values indicate an error.
713 int mi_lttng_snapshot_output_session_name(struct mi_writer
*writer
,
714 const char *session_name
);
717 * Machine interface of the snapshot output.
718 * The machine interface serializes the following attributes:
719 * - id: ID of the snapshot output.
720 * - name: Name of the output.
721 * - data_url : Destination of the output.
722 * - ctrl_url: Destination of the output.
723 * - max_size: total size of all stream combined.
725 * writer An instance of a machine interface writer.
727 * output: A list of snapshot_output.
729 * Returns zero if the element's value could be written.
730 * Negative values indicate an error.
732 int mi_lttng_snapshot_list_output(struct mi_writer
*writer
,
733 struct lttng_snapshot_output
*output
);
736 * Machine interface of the output of the command snapshot del output
737 * when deleting a snapshot either by id or by name.
738 * If the snapshot was found and successfully deleted using its id,
739 * it return the id of the snapshot and the current session name on which it
742 * Otherwise, it do the same process with the name of the snapshot, if the
743 * snapshot output id is undefined.
745 * writer An instance of a machine interface writer.
747 * id: ID of the snapshot output.
749 * name: Name of the snapshot.
751 * current_session_name: Session to which the snapshot belongs.
753 * Returns zero if the element's value could be written.
754 * Negative values indicate an error.
756 int mi_lttng_snapshot_del_output(struct mi_writer
*writer
, int id
,
757 const char *name
, const char *current_session_name
);
760 * Machine interface of the output of the command snapshot add output
761 * when adding a snapshot from a user URL.
763 * If the snapshot was successfully added, the machine interface lists
765 * - id: ID of the newly add snapshot output.
766 * - current_session_name: Name of the session to which the output was added.
767 * - ctrl_url: Destination of the output.
768 * - max_size: total size of all stream combined.
770 * writer An instance of a machine interface writer.
772 * current_session_name: Session to which the snapshot belongs.
776 * output: iterator over a lttng_snapshot_output_list which contain
777 * the snapshot output informations.
779 * Returns zero if the element's value could be written.
780 * Negative values indicate an error.
782 int mi_lttng_snapshot_add_output(struct mi_writer
*writer
,
783 const char *current_session_name
, const char *n_ptr
,
784 struct lttng_snapshot_output
*output
);
787 * Machine interface of the output of the command snapshot
788 * record from a URL (if given).
790 * If the snapshot is successfully recorded from a url, the machine interface
791 * output the following information:
792 * - url: Destination of the output stored in the snapshot.
794 * Otherwise, the machine interface output the data and ctrl url received
795 * from the command-line.
797 * writer An instance of a machine interface writer.
799 * current_session_name: Snapshot record for session "current_session_name".
801 * ctrl_url, data_url: Destination of the output receive from the command-line.
803 * Returns zero if the element's value could be written.
804 * Negative values indicate an error.
806 int mi_lttng_snapshot_record(struct mi_writer
*writer
,
807 const char *current_session_name
, const char *url
,
808 const char *cmdline_ctrl_url
, const char *cmdline_data_url
);
810 #endif /* _MI_LTTNG_H */