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_create
;
57 extern const char * const mi_lttng_element_command_destroy
;
58 extern const char * const mi_lttng_element_command_disable_channel
;
59 extern const char * const mi_lttng_element_command_disable_event
;
60 extern const char * const mi_lttng_element_command_enable_channels
;
61 extern const char * const mi_lttng_element_command_enable_event
;
62 extern const char * const mi_lttng_element_command_list
;
63 extern const char * const mi_lttng_element_command_load
;
64 extern const char * const mi_lttng_element_command_metadata
;
65 extern const char * const mi_lttng_element_command_metadata_action
;
66 extern const char * const mi_lttng_element_command_regenerate
;
67 extern const char * const mi_lttng_element_command_regenerate_action
;
68 extern const char * const mi_lttng_element_command_name
;
69 extern const char * const mi_lttng_element_command_output
;
70 extern const char * const mi_lttng_element_command_save
;
71 extern const char * const mi_lttng_element_command_set_session
;
72 extern const char * const mi_lttng_element_command_snapshot
;
73 extern const char * const mi_lttng_element_command_snapshot_add
;
74 extern const char * const mi_lttng_element_command_snapshot_del
;
75 extern const char * const mi_lttng_element_command_snapshot_list
;
76 extern const char * const mi_lttng_element_command_snapshot_record
;
77 extern const char * const mi_lttng_element_command_start
;
78 extern const char * const mi_lttng_element_command_stop
;
79 extern const char * const mi_lttng_element_command_success
;
80 extern const char * const mi_lttng_element_command_track
;
81 extern const char * const mi_lttng_element_command_untrack
;
82 extern const char * const mi_lttng_element_command_version
;
84 /* Strings related to version command */
85 extern const char * const mi_lttng_element_version
;
86 extern const char * const mi_lttng_element_version_commit
;
87 extern const char * const mi_lttng_element_version_description
;
88 extern const char * const mi_lttng_element_version_license
;
89 extern const char * const mi_lttng_element_version_major
;
90 extern const char * const mi_lttng_element_version_minor
;
91 extern const char * const mi_lttng_element_version_patch_level
;
92 extern const char * const mi_lttng_element_version_str
;
93 extern const char * const mi_lttng_element_version_web
;
95 /* String related to a lttng_event_field */
96 extern const char * const mi_lttng_element_event_field
;
97 extern const char * const mi_lttng_element_event_fields
;
99 /* String related to lttng_event_perf_counter_ctx */
100 extern const char * const mi_lttng_element_perf_counter_context
;
102 /* Strings related to pid */
103 extern const char * const mi_lttng_element_pid_id
;
105 /* Strings related to save command */
106 extern const char * const mi_lttng_element_save
;
108 /* Strings related to load command */
109 extern const char * const mi_lttng_element_load
;
110 LTTNG_HIDDEN
const char * const mi_lttng_element_load_overrides
;
111 LTTNG_HIDDEN
const char * const mi_lttng_element_load_override_url
;
113 /* General element of mi_lttng */
114 extern const char * const mi_lttng_element_empty
;
115 extern const char * const mi_lttng_element_id
;
116 extern const char * const mi_lttng_element_nowrite
;
117 extern const char * const mi_lttng_element_success
;
118 extern const char * const mi_lttng_element_type_enum
;
119 extern const char * const mi_lttng_element_type_float
;
120 extern const char * const mi_lttng_element_type_integer
;
121 extern const char * const mi_lttng_element_type_other
;
122 extern const char * const mi_lttng_element_type_string
;
124 /* String related to loglevel */
125 extern const char * const mi_lttng_loglevel_str_alert
;
126 extern const char * const mi_lttng_loglevel_str_crit
;
127 extern const char * const mi_lttng_loglevel_str_debug
;
128 extern const char * const mi_lttng_loglevel_str_debug_function
;
129 extern const char * const mi_lttng_loglevel_str_debug_line
;
130 extern const char * const mi_lttng_loglevel_str_debug_module
;
131 extern const char * const mi_lttng_loglevel_str_debug_process
;
132 extern const char * const mi_lttng_loglevel_str_debug_program
;
133 extern const char * const mi_lttng_loglevel_str_debug_system
;
134 extern const char * const mi_lttng_loglevel_str_debug_unit
;
135 extern const char * const mi_lttng_loglevel_str_emerg
;
136 extern const char * const mi_lttng_loglevel_str_err
;
137 extern const char * const mi_lttng_loglevel_str_info
;
138 extern const char * const mi_lttng_loglevel_str_notice
;
139 extern const char * const mi_lttng_loglevel_str_unknown
;
140 extern const char * const mi_lttng_loglevel_str_warning
;
142 /* String related to loglevel JUL */
143 extern const char * const mi_lttng_loglevel_str_jul_all
;
144 extern const char * const mi_lttng_loglevel_str_jul_config
;
145 extern const char * const mi_lttng_loglevel_str_jul_fine
;
146 extern const char * const mi_lttng_loglevel_str_jul_finer
;
147 extern const char * const mi_lttng_loglevel_str_jul_finest
;
148 extern const char * const mi_lttng_loglevel_str_jul_info
;
149 extern const char * const mi_lttng_loglevel_str_jul_off
;
150 extern const char * const mi_lttng_loglevel_str_jul_severe
;
151 extern const char * const mi_lttng_loglevel_str_jul_warning
;
153 /* String related to loglevel Log4j */
154 extern const char * const mi_lttng_loglevel_str_log4j_off
;
155 extern const char * const mi_lttng_loglevel_str_log4j_fatal
;
156 extern const char * const mi_lttng_loglevel_str_log4j_error
;
157 extern const char * const mi_lttng_loglevel_str_log4j_warn
;
158 extern const char * const mi_lttng_loglevel_str_log4j_info
;
159 extern const char * const mi_lttng_loglevel_str_log4j_debug
;
160 extern const char * const mi_lttng_loglevel_str_log4j_trace
;
161 extern const char * const mi_lttng_loglevel_str_log4j_all
;
163 /* String related to loglevel Python */
164 extern const char * const mi_lttng_loglevel_str_python_critical
;
165 extern const char * const mi_lttng_loglevel_str_python_error
;
166 extern const char * const mi_lttng_loglevel_str_python_warning
;
167 extern const char * const mi_lttng_loglevel_str_python_info
;
168 extern const char * const mi_lttng_loglevel_str_python_debug
;
169 extern const char * const mi_lttng_loglevel_str_python_notset
;
171 /* String related to loglevel type */
172 extern const char * const mi_lttng_loglevel_type_all
;
173 extern const char * const mi_lttng_loglevel_type_range
;
174 extern const char * const mi_lttng_loglevel_type_single
;
175 extern const char * const mi_lttng_loglevel_type_unknown
;
177 /* String related to a lttng_snapshot */
178 extern const char * const mi_lttng_element_snapshot_ctrl_url
;
179 extern const char * const mi_lttng_element_snapshot_data_url
;
180 extern const char * const mi_lttng_element_snapshot_max_size
;
181 extern const char * const mi_lttng_element_snapshot_n_ptr
;
182 extern const char * const mi_lttng_element_snapshot_session_name
;
183 extern const char * const mi_lttng_element_snapshots
;
185 /* String related to track/untrack command */
186 const char * const mi_lttng_element_track_untrack_all_wildcard
;
188 /* Utility string function */
189 const char *mi_lttng_loglevel_string(int value
, enum lttng_domain_type domain
);
190 const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value
);
191 const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type value
);
192 const char *mi_lttng_domaintype_string(enum lttng_domain_type value
);
193 const char *mi_lttng_buffertype_string(enum lttng_buffer_type value
);
196 * Create an instance of a machine interface writer.
198 * fd_output File to which the XML content must be written. The file will be
199 * closed once the mi_writer has been destroyed.
201 * Returns an instance of a machine interface writer on success, NULL on
204 struct mi_writer
*mi_lttng_writer_create(int fd_output
, int mi_output_type
);
207 * Destroy an instance of a machine interface writer.
209 * writer An instance of a machine interface writer.
211 * Returns zero if the XML document could be closed cleanly. Negative values
214 int mi_lttng_writer_destroy(struct mi_writer
*writer
);
217 * Open a command tag and add it's name node.
219 * writer An instance of a machine interface writer.
220 * command The command name.
222 * Returns zero if the XML document could be closed cleanly.
223 * Negative values indicate an error.
225 int mi_lttng_writer_command_open(struct mi_writer
*writer
, const char *command
);
228 * Close a command tag.
230 * writer An instance of a machine interface writer.
232 * Returns zero if the XML document could be closed cleanly.
233 * Negative values indicate an error.
235 int mi_lttng_writer_command_close(struct mi_writer
*writer
);
238 * Open an element tag.
240 * writer An instance of a machine interface writer.
241 * element_name Element tag name.
243 * Returns zero if the XML document could be closed cleanly.
244 * Negative values indicate an error.
246 int mi_lttng_writer_open_element(struct mi_writer
*writer
,
247 const char *element_name
);
250 * Close the current element tag.
252 * writer An instance of a machine interface writer.
254 * Returns zero if the XML document could be closed cleanly.
255 * Negative values indicate an error.
257 int mi_lttng_writer_close_element(struct mi_writer
*writer
);
260 * Close multiple element.
262 * writer An instance of a machine interface writer.
263 * nb_element Number of elements.
265 * Returns zero if the XML document could be closed cleanly.
266 * Negative values indicate an error.
268 int mi_lttng_close_multi_element(struct mi_writer
*writer
,
269 unsigned int nb_element
);
272 * Write an element of type unsigned int.
274 * writer An instance of a machine interface writer.
275 * element_name Element name.
276 * value Unsigned int value of the element
278 * Returns zero if the element's value could be written.
279 * Negative values indicate an error.
281 int mi_lttng_writer_write_element_unsigned_int(struct mi_writer
*writer
,
282 const char *element_name
, uint64_t value
);
285 * Write an element of type signed int.
287 * writer An instance of a machine interface writer.
288 * element_name Element name.
289 * value Signed int value of the element.
291 * Returns zero if the element's value could be written.
292 * Negative values indicate an error.
294 int mi_lttng_writer_write_element_signed_int(struct mi_writer
*writer
,
295 const char *element_name
, int64_t value
);
298 * Write an element of type boolean.
300 * writer An instance of a machine interface writer.
301 * element_name Element name.
302 * value Boolean value of the element.
304 * Returns zero if the element's value could be written.
305 * Negative values indicate an error.
307 int mi_lttng_writer_write_element_bool(struct mi_writer
*writer
,
308 const char *element_name
, int value
);
311 * Write an element of type string.
313 * writer An instance of a machine interface writer.
314 * element_name Element name.
315 * value String value of the element.
317 * Returns zero if the element's value could be written.
318 * Negative values indicate an error.
320 int mi_lttng_writer_write_element_string(struct mi_writer
*writer
,
321 const char *element_name
, const char *value
);
324 * Machine interface of struct version.
326 * writer An instance of a machine interface writer.
327 * version Version struct.
328 * lttng_description String value of the version description.
329 * lttng_license String value of the version license.
331 * Returns zero if the element's value could be written.
332 * Negative values indicate an error.
334 int mi_lttng_version(struct mi_writer
*writer
, struct mi_lttng_version
*version
,
335 const char *lttng_description
, const char *lttng_license
);
338 * Machine interface: open a sessions element.
340 * writer An instance of a machine interface writer.
342 * Returns zero if the element's value could be written.
343 * Negative values indicate an error.
345 int mi_lttng_sessions_open(struct mi_writer
*writer
);
348 * Machine interface of struct session.
350 * writer An instance of a machine interface writer.
351 * session An instance of a session.
352 * is_open Defines whether or not the session element shall be closed.
353 * This should be used carefully and the client
354 * must close the session element.
355 * Use case: nested additional information on a session
356 * ex: domain,channel event.
358 * Returns zero if the element's value could be written.
359 * Negative values indicate an error.
361 int mi_lttng_session(struct mi_writer
*writer
,
362 struct lttng_session
*session
, int is_open
);
365 * Machine interface: open a domains element.
367 * writer An instance of a machine interface writer.
369 * Returns zero if the element's value could be written.
370 * Negative values indicate an error.
372 int mi_lttng_domains_open(struct mi_writer
*writer
);
375 * Machine interface of struct domain.
377 * writer An instance of a machine interface writer.
378 * domain An instance of a domain.
380 * is_open Defines whether or not the session element shall be closed.
381 * This should be used carefully and the client
382 * must close the domain element.
383 * Use case: nested addition information on a domain
386 * Returns zero if the element's value could be written.
387 * Negative values indicate an error.
389 int mi_lttng_domain(struct mi_writer
*writer
,
390 struct lttng_domain
*domain
, int is_open
);
393 * Machine interface: open a channels element.
395 * writer An instance of a machine interface writer.
397 * Returns zero if the element's value could be written.
398 * Negative values indicate an error.
400 int mi_lttng_channels_open(struct mi_writer
*writer
);
403 * Machine interface of struct channel.
405 * writer An instance of a machine interface writer.
406 * channel An instance of a channel.
408 * is_open Defines whether or not the session element shall be closed.
409 * This should be used carefully and the client
410 * must close the channel element.
411 * Use case: nested addition information on a channel.
414 * Returns zero if the element's value could be written.
415 * Negative values indicate an error.
417 int mi_lttng_channel(struct mi_writer
*writer
,
418 struct lttng_channel
*channel
, int is_open
);
421 * Machine interface of struct channel_attr.
423 * writer An instance of a machine interface writer.
424 * attr An instance of a channel_attr struct.
426 * Returns zero if the element's value could be written.
427 * Negative values indicate an error.
429 int mi_lttng_channel_attr(struct mi_writer
*writer
,
430 struct lttng_channel_attr
*attr
);
433 * Machine interface for event common attributes.
435 * writer An instance of a mi writer.
436 * event single trace event.
438 * The common attribute are:
445 * Returns zero if the element's value could be written.
446 * Negative values indicate an error.
448 int mi_lttng_event_common_attributes(struct mi_writer
*writer
,
449 struct lttng_event
*event
);
452 * Machine interface for kernel tracepoint event with a loglevel.
454 * writer An instance of a mi writer.
455 * event single trace event.
456 * domain Event's domain
458 * Returns zero if the element's value could be written.
459 * Negative values indicate an error.
461 int mi_lttng_event_tracepoint_loglevel(struct mi_writer
*writer
,
462 struct lttng_event
*event
, enum lttng_domain_type domain
);
465 * Machine interface for kernel tracepoint event with no loglevel.
467 * writer An instance of a mi writer.
468 * event single trace event.
470 * Returns zero if the element's value could be written.
471 * Negative values indicate an error.
473 int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer
*writer
,
474 struct lttng_event
*event
);
477 * Machine interface for kernel function and probe event.
479 * writer An instance of a mi writer.
480 * event single trace event.
482 * Returns zero if the element's value could be written.
483 * Negative values indicate an error.
485 int mi_lttng_event_function_probe(struct mi_writer
*writer
,
486 struct lttng_event
*event
);
489 * Machine interface for kernel function entry event.
491 * writer An instance of a mi writer.
492 * event single trace event.
494 * Returns zero if the element's value could be written.
495 * Negative values indicate an error.
497 int mi_lttng_event_function_entry(struct mi_writer
*writer
,
498 struct lttng_event
*event
);
501 * Machine interface: open an events element.
503 * writer An instance of a machine interface writer.
505 * Returns zero if the element's value could be written.
506 * Negative values indicate an error.
508 int mi_lttng_events_open(struct mi_writer
*writer
);
511 * Machine interface for printing an event.
512 * The trace event type currently supported are:
519 * writer An instance of a mi writer.
520 * event single trace event.
521 * is_open Defines whether or not the session element shall be closed.
522 * This should be used carefully and the client
523 * must close the event element.
524 * Use case: nested additional information
525 * domain Event's domain
527 * Returns zero if the element's value could be written.
528 * Negative values indicate an error.
530 int mi_lttng_event(struct mi_writer
*writer
, struct lttng_event
*event
,
531 int is_open
, enum lttng_domain_type domain
);
534 * Machine interface for struct lttng_event_field.
536 * writer An instance of a mi writer.
537 * field An event_field instance.
539 * Returns zero if the element's value could be written.
540 * Negative values indicate an error.
542 int mi_lttng_event_field(struct mi_writer
*writer
,
543 struct lttng_event_field
*field
);
546 * Machine interface: open a event_fields element.
548 * writer An instance of a machine interface writer.
550 * Returns zero if the element have be written.
551 * Negative values indicate an error.
553 int mi_lttng_event_fields_open(struct mi_writer
*writer
);
556 * Machine interface: open a trackers element.
558 * writer An instance of a machine interface writer.
560 * Returns zero if the element's value could be written.
561 * Negative values indicate an error.
563 int mi_lttng_trackers_open(struct mi_writer
*writer
);
566 * Machine interface: open a pid_tracker element.
568 * writer An instance of a machine interface writer.
570 * Returns zero if the element's value could be written.
571 * Negative values indicate an error.
573 * Note: A targets element is also opened for each tracker definition
575 int mi_lttng_pid_tracker_open(struct mi_writer
*writer
);
578 * Machine interface: open a PIDs element.
580 * writer An instance of a machine interface writer.
582 * Returns zero if the element's value could be written.
583 * Negative values indicate an error.
585 int mi_lttng_pids_open(struct mi_writer
*writer
);
588 * Machine interface: open a processes element.
590 * writer An instance of a machine interface writer.
592 * Returns zero if the element's value could be written.
593 * Negative values indicate an error.
595 int mi_lttng_processes_open(struct mi_writer
*writer
);
598 * Machine interface of a Process.
600 * writer An instance of a machine interface writer.
603 * is_open Defines whether or not the session element shall be closed.
604 * This should be used carefully and the client
605 * must close the pid element.
606 * Use case: nested addition information on a domain
609 * Returns zero if the element's value could be written.
610 * Negative values indicate an error.
612 int mi_lttng_process(struct mi_writer
*writer
, pid_t pid
, const char *name
,
616 * TODO: move pid of lttng list -u to process semantic on mi api bump
617 * Machine interface of a Process.
619 * writer An instance of a machine interface writer.
622 * is_open Defines whether or not the session element shall be closed.
623 * This should be used carefully and the client
624 * must close the pid element.
625 * Use case: nested addition information on a domain
628 * Returns zero if the element's value could be written.
629 * Negative values indicate an error.
631 int mi_lttng_pid(struct mi_writer
*writer
, pid_t pid
, const char *name
,
634 * Machine interface: open a targets element.
636 * writer An instance of a machine interface writer.
638 * Returns zero if the element's value could be written.
639 * Negative values indicate an error.
641 int mi_lttng_targets_open(struct mi_writer
*writer
);
644 * Machine interface for track/untrack a pid_target
646 * writer An instance of a machine interface writer.
648 * Returns zero if the element's value could be written.
649 * Negative values indicate an error.
651 int mi_lttng_pid_target(struct mi_writer
*writer
, pid_t pid
, int is_open
);
654 * Machine interface of a context.
656 * writer An instance of a machine interface writer
658 * context An instance of a lttng_event_context
660 * is_open Define if we close the context element
661 * This should be used carefully and the client
662 * need to close the context element.
663 * Returns zero if the element's value could be written.
664 * Negative values indicate an error.
666 int mi_lttng_context(struct mi_writer
*writer
,
667 struct lttng_event_context
*context
, int is_open
);
670 * Machine interface of a perf_counter_context.
672 * writer An instance of a machine interface writer
674 * contest An instance of a lttng_event_perf_counter_ctx
676 * Returns zero if the element's value could be written.
677 * Negative values indicate an error.
679 int mi_lttng_perf_counter_context(struct mi_writer
*writer
,
680 struct lttng_event_perf_counter_ctx
*perf_context
);
683 * Machine interface of the snapshot list_output.
684 * It specifies the session for which we are listing snapshots,
685 * and it opens a snapshots element to list a sequence
688 * writer An instance of a machine interface writer.
690 * session_name: Snapshot output for session "session_name".
692 * Note: The client has to close the session and the snapshots elements after
693 * having listed every lttng_snapshot_output.
695 * Returns zero if the element's value could be written.
696 * Negative values indicate an error.
698 int mi_lttng_snapshot_output_session_name(struct mi_writer
*writer
,
699 const char *session_name
);
702 * Machine interface of the snapshot output.
703 * The machine interface serializes the following attributes:
704 * - id: ID of the snapshot output.
705 * - name: Name of the output.
706 * - data_url : Destination of the output.
707 * - ctrl_url: Destination of the output.
708 * - max_size: total size of all stream combined.
710 * writer An instance of a machine interface writer.
712 * output: A list of snapshot_output.
714 * Returns zero if the element's value could be written.
715 * Negative values indicate an error.
717 int mi_lttng_snapshot_list_output(struct mi_writer
*writer
,
718 struct lttng_snapshot_output
*output
);
721 * Machine interface of the output of the command snapshot del output
722 * when deleting a snapshot either by id or by name.
723 * If the snapshot was found and successfully deleted using its id,
724 * it return the id of the snapshot and the current session name on which it
727 * Otherwise, it do the same process with the name of the snapshot, if the
728 * snapshot output id is undefined.
730 * writer An instance of a machine interface writer.
732 * id: ID of the snapshot output.
734 * name: Name of the snapshot.
736 * current_session_name: Session to which the snapshot belongs.
738 * Returns zero if the element's value could be written.
739 * Negative values indicate an error.
741 int mi_lttng_snapshot_del_output(struct mi_writer
*writer
, int id
,
742 const char *name
, const char *current_session_name
);
745 * Machine interface of the output of the command snapshot add output
746 * when adding a snapshot from a user URL.
748 * If the snapshot was successfully added, the machine interface lists
750 * - id: ID of the newly add snapshot output.
751 * - current_session_name: Name of the session to which the output was added.
752 * - ctrl_url: Destination of the output.
753 * - max_size: total size of all stream combined.
755 * writer An instance of a machine interface writer.
757 * current_session_name: Session to which the snapshot belongs.
761 * output: iterator over a lttng_snapshot_output_list which contain
762 * the snapshot output informations.
764 * Returns zero if the element's value could be written.
765 * Negative values indicate an error.
767 int mi_lttng_snapshot_add_output(struct mi_writer
*writer
,
768 const char *current_session_name
, const char *n_ptr
,
769 struct lttng_snapshot_output
*output
);
772 * Machine interface of the output of the command snapshot
773 * record from a URL (if given).
775 * If the snapshot is successfully recorded from a url, the machine interface
776 * output the following information:
777 * - url: Destination of the output stored in the snapshot.
779 * Otherwise, the machine interface output the data and ctrl url received
780 * from the command-line.
782 * writer An instance of a machine interface writer.
784 * current_session_name: Snapshot record for session "current_session_name".
786 * ctrl_url, data_url: Destination of the output receive from the command-line.
788 * Returns zero if the element's value could be written.
789 * Negative values indicate an error.
791 int mi_lttng_snapshot_record(struct mi_writer
*writer
,
792 const char *current_session_name
, const char *url
,
793 const char *cmdline_ctrl_url
, const char *cmdline_data_url
);
795 #endif /* _MI_LTTNG_H */