Fix: support log4j loglevel in mi
[lttng-tools.git] / src / common / mi-lttng.h
CommitLineData
c7e35b03
JR
1/*
2 * Copyright (C) 2014 - Jonathan Rajotte <jonathan.r.julien@gmail.com>
3 * - Olivier Cotte <olivier.cotte@polymtl.ca>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License, version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51
16 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef _MI_LTTNG_H
20#define _MI_LTTNG_H
21
22#include <stdint.h>
23
24#include <common/error.h>
25#include <common/macros.h>
26#include <common/config/config.h>
27#include <lttng/lttng.h>
28
50534d6f
JRJ
29/* Don't want to reference snapshot-internal.h here */
30struct lttng_snapshot_output;
31
c7e35b03
JR
32/* Instance of a machine interface writer. */
33struct mi_writer {
34 struct config_writer *writer;
35 enum lttng_mi_output_type type;
36};
37
38/*
39 * Version information for the machine interface.
40 */
41struct mi_lttng_version {
42 char version[NAME_MAX]; /* Version number of package */
43 uint32_t version_major; /* LTTng-Tools major version number */
44 uint32_t version_minor; /* LTTng-Tools minor version number */
45 uint32_t version_patchlevel; /* LTTng-Tools patchlevel version number */
314d5222 46 char version_commit[NAME_MAX]; /* Commit hash of the current version */
c7e35b03
JR
47 char version_name[NAME_MAX];
48 char package_url[NAME_MAX]; /* Define to the home page for this package. */
49};
50
51/* Strings related to command */
52const char * const mi_lttng_element_command;
50534d6f 53const char * const mi_lttng_element_command_action;
f4a088f7
JRJ
54const char * const mi_lttng_element_command_add_context;
55const char * const mi_lttng_element_command_calibrate;
37d03ff7 56const char * const mi_lttng_element_command_create;
65f25c66 57const char * const mi_lttng_element_command_destroy;
f4a088f7
JRJ
58const char * const mi_lttng_element_command_disable_channel;
59const char * const mi_lttng_element_command_disable_event;
acc09215 60const char * const mi_lttng_element_command_enable_channels;
f4a088f7
JRJ
61const char * const mi_lttng_element_command_enable_event;
62const char * const mi_lttng_element_command_list;
63const char * const mi_lttng_element_command_load;
64const char * const mi_lttng_element_command_name;
65const char * const mi_lttng_element_command_output;
66const char * const mi_lttng_element_command_save;
ce91cd0b 67const char * const mi_lttng_element_command_set_session;
50534d6f 68const char * const mi_lttng_element_command_snapshot;
f4a088f7
JRJ
69const char * const mi_lttng_element_command_snapshot_add;
70const char * const mi_lttng_element_command_snapshot_del;
71const char * const mi_lttng_element_command_snapshot_list;
72const char * const mi_lttng_element_command_snapshot_record;
73const char * const mi_lttng_element_command_start;
74const char * const mi_lttng_element_command_stop;
1734c658 75const char * const mi_lttng_element_command_success;
f4a088f7 76const char * const mi_lttng_element_command_version;
c7e35b03 77
1734c658 78/* Strings related to version command */
c7e35b03 79const char * const mi_lttng_element_version;
f4a088f7
JRJ
80const char * const mi_lttng_element_version_commit;
81const char * const mi_lttng_element_version_description;
82const char * const mi_lttng_element_version_license;
c7e35b03
JR
83const char * const mi_lttng_element_version_major;
84const char * const mi_lttng_element_version_minor;
c7e35b03 85const char * const mi_lttng_element_version_patch_level;
f4a088f7
JRJ
86const char * const mi_lttng_element_version_str;
87const char * const mi_lttng_element_version_web;
c7e35b03 88
5e18ec73
JR
89/* String related to a lttng_event_field */
90const char * const mi_lttng_element_event_field;
91const char * const mi_lttng_element_event_fields;
92
89b72577
JRJ
93/* String related to lttng_event_context */
94const char * const mi_lttng_context_type_perf_counter;
95const char * const mi_lttng_context_type_perf_cpu_counter;
96const char * const mi_lttng_context_type_perf_thread_counter;
97
98/* String related to lttng_event_perf_counter_ctx */
99const char * const mi_lttng_element_perf_counter_context;
100
5e18ec73
JR
101/* Strings related to pid */
102const char * const mi_lttng_element_pids;
103const char * const mi_lttng_element_pid;
104const char * const mi_lttng_element_pid_id;
105
1734c658
JRJ
106/* Strings related to save command */
107const char * const mi_lttng_element_save;
108
109/* Strings related to load command */
110const char * const mi_lttng_element_load;
111
5e18ec73 112/* General element of mi_lttng */
f4a088f7
JRJ
113const char * const mi_lttng_element_empty;
114const char * const mi_lttng_element_id;
115const char * const mi_lttng_element_nowrite;
116const char * const mi_lttng_element_success;
5e18ec73
JR
117const char * const mi_lttng_element_type_enum;
118const char * const mi_lttng_element_type_float;
f4a088f7
JRJ
119const char * const mi_lttng_element_type_integer;
120const char * const mi_lttng_element_type_other;
5e18ec73 121const char * const mi_lttng_element_type_string;
5e18ec73
JR
122
123/* String related to loglevel */
124const char * const mi_lttng_loglevel_str_alert;
125const char * const mi_lttng_loglevel_str_crit;
126const char * const mi_lttng_loglevel_str_debug;
127const char * const mi_lttng_loglevel_str_debug_function;
128const char * const mi_lttng_loglevel_str_debug_line;
129const char * const mi_lttng_loglevel_str_debug_module;
130const char * const mi_lttng_loglevel_str_debug_process;
131const char * const mi_lttng_loglevel_str_debug_program;
132const char * const mi_lttng_loglevel_str_debug_system;
133const char * const mi_lttng_loglevel_str_debug_unit;
134const char * const mi_lttng_loglevel_str_emerg;
135const char * const mi_lttng_loglevel_str_err;
136const char * const mi_lttng_loglevel_str_info;
137const char * const mi_lttng_loglevel_str_notice;
138const char * const mi_lttng_loglevel_str_unknown;
139const char * const mi_lttng_loglevel_str_warning;
140
136f2f81
JRJ
141/* String related to loglevel JUL */
142const char * const mi_lttng_loglevel_str_jul_all;
143const char * const mi_lttng_loglevel_str_jul_config;
144const char * const mi_lttng_loglevel_str_jul_fine;
145const char * const mi_lttng_loglevel_str_jul_finer;
146const char * const mi_lttng_loglevel_str_jul_finest;
147const char * const mi_lttng_loglevel_str_jul_info;
148const char * const mi_lttng_loglevel_str_jul_off;
149const char * const mi_lttng_loglevel_str_jul_severe;
150const char * const mi_lttng_loglevel_str_jul_warning;
151
970d848b
DG
152/* String related to loglevel Log4j */
153const char * const mi_lttng_loglevel_str_log4j_off;
154const char * const mi_lttng_loglevel_str_log4j_fatal;
155const char * const mi_lttng_loglevel_str_log4j_error;
156const char * const mi_lttng_loglevel_str_log4j_warn;
157const char * const mi_lttng_loglevel_str_log4j_info;
158const char * const mi_lttng_loglevel_str_log4j_debug;
159const char * const mi_lttng_loglevel_str_log4j_trace;
160const char * const mi_lttng_loglevel_str_log4j_all;
161
1734c658 162/* String related to loglevel type */
5e18ec73
JR
163const char * const mi_lttng_loglevel_type_all;
164const char * const mi_lttng_loglevel_type_range;
165const char * const mi_lttng_loglevel_type_single;
166const char * const mi_lttng_loglevel_type_unknown;
167
7e66b1b0
JRJ
168/* Sting related to lttng_calibrate */
169const char * const mi_lttng_element_calibrate;
170const char * const mi_lttng_element_calibrate_function;
171
136f2f81 172/* String related to a lttng_snapshot */
50534d6f 173const char * const mi_lttng_element_snapshot_ctrl_url;
f4a088f7 174const char * const mi_lttng_element_snapshot_data_url;
50534d6f 175const char * const mi_lttng_element_snapshot_max_size;
f4a088f7
JRJ
176const char * const mi_lttng_element_snapshot_n_ptr;
177const char * const mi_lttng_element_snapshot_session_name;
178const char * const mi_lttng_element_snapshots;
50534d6f 179
5e18ec73 180/* Utility string function */
970d848b 181const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain);
5e18ec73
JR
182const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value);
183const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type value);
184const char *mi_lttng_domaintype_string(enum lttng_domain_type value);
185const char *mi_lttng_buffertype_string(enum lttng_buffer_type value);
7e66b1b0 186const char *mi_lttng_calibratetype_string(enum lttng_calibrate_type val);
5e18ec73 187
c7e35b03
JR
188/*
189 * Create an instance of a machine interface writer.
190 *
191 * fd_output File to which the XML content must be written. The file will be
192 * closed once the mi_writer has been destroyed.
193 *
194 * Returns an instance of a machine interface writer on success, NULL on
195 * error.
196 */
197struct mi_writer *mi_lttng_writer_create(int fd_output, int mi_output_type);
198
199/*
200 * Destroy an instance of a machine interface writer.
201 *
202 * writer An instance of a machine interface writer.
203 *
204 * Returns zero if the XML document could be closed cleanly. Negative values
205 * indicate an error.
206 */
207int mi_lttng_writer_destroy(struct mi_writer *writer);
208
209/*
210 * Open a command tag and add it's name node.
211 *
212 * writer An instance of a machine interface writer.
c7e35b03
JR
213 * command The command name.
214 *
215 * Returns zero if the XML document could be closed cleanly.
216 * Negative values indicate an error.
217 */
218int mi_lttng_writer_command_open(struct mi_writer *writer, const char *command);
219
220/*
221 * Close a command tag.
222 *
223 * writer An instance of a machine interface writer.
224 *
225 * Returns zero if the XML document could be closed cleanly.
226 * Negative values indicate an error.
227 */
228int mi_lttng_writer_command_close(struct mi_writer *writer);
229
230/*
231 * Open an element tag.
232 *
233 * writer An instance of a machine interface writer.
c7e35b03
JR
234 * element_name Element tag name.
235 *
236 * Returns zero if the XML document could be closed cleanly.
237 * Negative values indicate an error.
238 */
239int mi_lttng_writer_open_element(struct mi_writer *writer,
240 const char *element_name);
241
242/*
243 * Close the current element tag.
244 *
245 * writer An instance of a machine interface writer.
246 *
247 * Returns zero if the XML document could be closed cleanly.
248 * Negative values indicate an error.
249 */
250int mi_lttng_writer_close_element(struct mi_writer *writer);
251
252/*
5e18ec73 253 * Close multiple element.
c7e35b03
JR
254 *
255 * writer An instance of a machine interface writer.
5e18ec73 256 * nb_element Number of elements.
c7e35b03 257 *
5e18ec73
JR
258 * Returns zero if the XML document could be closed cleanly.
259 * Negative values indicate an error.
260 */
261int mi_lttng_close_multi_element(struct mi_writer *writer,
262 unsigned int nb_element);
263
264/*
265 * Write an element of type unsigned int.
c7e35b03 266 *
5e18ec73
JR
267 * writer An instance of a machine interface writer.
268 * element_name Element name.
c7e35b03
JR
269 * value Unsigned int value of the element
270 *
271 * Returns zero if the element's value could be written.
272 * Negative values indicate an error.
273 */
274int mi_lttng_writer_write_element_unsigned_int(struct mi_writer *writer,
275 const char *element_name, uint64_t value);
276
277/*
278 * Write an element of type signed int.
279 *
280 * writer An instance of a machine interface writer.
c7e35b03 281 * element_name Element name.
5e18ec73 282 * value Signed int value of the element.
c7e35b03
JR
283 *
284 * Returns zero if the element's value could be written.
285 * Negative values indicate an error.
286 */
287int mi_lttng_writer_write_element_signed_int(struct mi_writer *writer,
288 const char *element_name, int64_t value);
289
290/*
291 * Write an element of type boolean.
292 *
293 * writer An instance of a machine interface writer.
c7e35b03 294 * element_name Element name.
5e18ec73 295 * value Boolean value of the element.
c7e35b03
JR
296 *
297 * Returns zero if the element's value could be written.
298 * Negative values indicate an error.
299 */
300int mi_lttng_writer_write_element_bool(struct mi_writer *writer,
301 const char *element_name, int value);
302
303/*
304 * Write an element of type string.
305 *
306 * writer An instance of a machine interface writer.
c7e35b03 307 * element_name Element name.
5e18ec73 308 * value String value of the element.
c7e35b03
JR
309 *
310 * Returns zero if the element's value could be written.
311 * Negative values indicate an error.
312 */
313int mi_lttng_writer_write_element_string(struct mi_writer *writer,
314 const char *element_name, const char *value);
315
316/*
317 * Machine interface of struct version.
318 *
319 * writer An instance of a machine interface writer.
c7e35b03 320 * version Version struct.
c7e35b03 321 * lttng_description String value of the version description.
c7e35b03
JR
322 * lttng_license String value of the version license.
323 *
324 * Returns zero if the element's value could be written.
325 * Negative values indicate an error.
326 */
327int mi_lttng_version(struct mi_writer *writer, struct mi_lttng_version *version,
328 const char *lttng_description, const char *lttng_license);
329
330/*
5e18ec73 331 * Machine interface: open a sessions element.
c7e35b03 332 *
5e18ec73 333 * writer An instance of a machine interface writer.
c7e35b03 334 *
5e18ec73
JR
335 * Returns zero if the element's value could be written.
336 * Negative values indicate an error.
337 */
338int mi_lttng_sessions_open(struct mi_writer *writer);
339
340/*
341 * Machine interface of struct session.
c7e35b03 342 *
5e18ec73
JR
343 * writer An instance of a machine interface writer.
344 * session An instance of a session.
345 * is_open Defines whether or not the session element shall be closed.
346 * This should be used carefully and the client
347 * must close the session element.
136f2f81 348 * Use case: nested additional information on a session
c7e35b03 349 * ex: domain,channel event.
c7e35b03
JR
350 *
351 * Returns zero if the element's value could be written.
352 * Negative values indicate an error.
353 */
354int mi_lttng_session(struct mi_writer *writer,
5e18ec73
JR
355 struct lttng_session *session, int is_open);
356
357/*
358 * Machine interface: open a domains element.
359 *
360 * writer An instance of a machine interface writer.
361 *
362 * Returns zero if the element's value could be written.
363 * Negative values indicate an error.
364 */
365int mi_lttng_domains_open(struct mi_writer *writer);
366
367/*
368 * Machine interface of struct domain.
369 *
370 * writer An instance of a machine interface writer.
371 * domain An instance of a domain.
372 *
373 * is_open Defines whether or not the session element shall be closed.
374 * This should be used carefully and the client
375 * must close the domain element.
376 * Use case: nested addition information on a domain
377 * ex: channel event.
378 *
379 * Returns zero if the element's value could be written.
380 * Negative values indicate an error.
381 */
382int mi_lttng_domain(struct mi_writer *writer,
383 struct lttng_domain *domain, int is_open);
384
385/*
386 * Machine interface: open a channels element.
387 *
388 * writer An instance of a machine interface writer.
389 *
390 * Returns zero if the element's value could be written.
391 * Negative values indicate an error.
392 */
393int mi_lttng_channels_open(struct mi_writer *writer);
394
395/*
396 * Machine interface of struct channel.
397 *
398 * writer An instance of a machine interface writer.
399 * channel An instance of a channel.
400 *
401 * is_open Defines whether or not the session element shall be closed.
402 * This should be used carefully and the client
403 * must close the channel element.
404 * Use case: nested addition information on a channel.
405 * ex: channel event.
406 *
407 * Returns zero if the element's value could be written.
408 * Negative values indicate an error.
409 */
410int mi_lttng_channel(struct mi_writer *writer,
411 struct lttng_channel *channel, int is_open);
412
413/*
414 * Machine interface of struct channel_attr.
415 *
416 * writer An instance of a machine interface writer.
417 * attr An instance of a channel_attr struct.
418 *
419 * Returns zero if the element's value could be written.
420 * Negative values indicate an error.
421 */
422int mi_lttng_channel_attr(struct mi_writer *writer,
423 struct lttng_channel_attr *attr);
424
425/*
426* Machine interface for event common attributes.
427*
428* writer An instance of a mi writer.
429* event single trace event.
430*
431* The common attribute are:
432* - mi event element
433* - event name
434* - event type
435* - enabled tag
436* - event filter
437*
438* Returns zero if the element's value could be written.
439* Negative values indicate an error.
440*/
441int mi_lttng_event_common_attributes(struct mi_writer *writer,
442 struct lttng_event *event);
443
444/*
445 * Machine interface for kernel tracepoint event with a loglevel.
446 *
447 * writer An instance of a mi writer.
448 * event single trace event.
970d848b 449 * domain Event's domain
5e18ec73
JR
450 *
451 * Returns zero if the element's value could be written.
452 * Negative values indicate an error.
453 */
454int mi_lttng_event_tracepoint_loglevel(struct mi_writer *writer,
970d848b 455 struct lttng_event *event, enum lttng_domain_type domain);
5e18ec73
JR
456
457/*
458 * Machine interface for kernel tracepoint event with no loglevel.
459 *
460 * writer An instance of a mi writer.
461 * event single trace event.
462 *
463 * Returns zero if the element's value could be written.
464 * Negative values indicate an error.
465 */
466int mi_lttng_event_tracepoint_no_loglevel(struct mi_writer *writer,
467 struct lttng_event *event);
468
469/*
470 * Machine interface for kernel function and probe event.
471 *
472 * writer An instance of a mi writer.
473 * event single trace event.
474 *
475 * Returns zero if the element's value could be written.
476 * Negative values indicate an error.
477 */
478int mi_lttng_event_function_probe(struct mi_writer *writer,
479 struct lttng_event *event);
480
481/*
482 * Machine interface for kernel function entry event.
483 *
484 * writer An instance of a mi writer.
485 * event single trace event.
486 *
487 * Returns zero if the element's value could be written.
488 * Negative values indicate an error.
489 */
490int mi_lttng_event_function_entry(struct mi_writer *writer,
491 struct lttng_event *event);
492
493/*
494 * Machine interface: open an events element.
495 *
496 * writer An instance of a machine interface writer.
497 *
498 * Returns zero if the element's value could be written.
499 * Negative values indicate an error.
500 */
501int mi_lttng_events_open(struct mi_writer *writer);
502
503/*
504 * Machine interface for printing an event.
505 * The trace event type currently supported are:
506 * TRACEPOINT,
507 * PROBE,
508 * FUNCTION,
509 * FUNCTION_ENTRY,
510 * SYSCALL
511 *
512 * writer An instance of a mi writer.
513 * event single trace event.
514 * is_open Defines whether or not the session element shall be closed.
515 * This should be used carefully and the client
516 * must close the event element.
517 * Use case: nested additional information
970d848b 518 * domain Event's domain
5e18ec73
JR
519 *
520 * Returns zero if the element's value could be written.
521 * Negative values indicate an error.
522 */
523int mi_lttng_event(struct mi_writer *writer, struct lttng_event *event,
970d848b 524 int is_open, enum lttng_domain_type domain);
5e18ec73
JR
525
526/*
527 * Machine interface for struct lttng_event_field.
528 *
529 * writer An instance of a mi writer.
530 * field An event_field instance.
531 *
532 * Returns zero if the element's value could be written.
533 * Negative values indicate an error.
534 */
535int mi_lttng_event_field(struct mi_writer *writer,
536 struct lttng_event_field *field);
537
538/*
539 * Machine interface: open a event_fields element.
540 *
541 * writer An instance of a machine interface writer.
542 *
e4d484a5 543 * Returns zero if the element have be written.
5e18ec73
JR
544 * Negative values indicate an error.
545 */
546int mi_lttng_event_fields_open(struct mi_writer *writer);
547
548/*
549 * Machine interface: open a PIDs element.
550 *
551 * writer An instance of a machine interface writer.
552 *
553 * Returns zero if the element's value could be written.
554 * Negative values indicate an error.
555 */
556int mi_lttng_pids_open(struct mi_writer *writer);
557
558/*
559 * Machine interface of a PID.
560 *
561 * writer An instance of a machine interface writer.
562 * pid A PID.
563 *
564 * is_open Defines whether or not the session element shall be closed.
565 * This should be used carefully and the client
566 * must close the pid element.
567 * Use case: nested addition information on a domain
568 * ex: channel event.
569 *
570 * Returns zero if the element's value could be written.
571 * Negative values indicate an error.
572 */
573int mi_lttng_pid(struct mi_writer *writer, pid_t pid , const char *cmdline,
574 int is_open);
c7e35b03 575
7e66b1b0
JRJ
576/*
577 * Machine interface for struct lttng_calibrate.
578 *
579 * writer An instance of a machine interface writer.
580 *
581 * calibrate A lttng_calibrate instance.
582 *
583 * Returns zero if the element's value could be written.
584 * Negative values indicate an error.
585 */
586int mi_lttng_calibrate(struct mi_writer *writer,
587 struct lttng_calibrate *calibrate);
588
89b72577
JRJ
589/*
590 * Machine interface of a context.
591 *
592 * writer An instance of a machine interface writer
593 *
594 * context An instance of a lttng_event_context
595 *
596 * is_open Define if we close the context element
597 * This should be used carefully and the client
598 * need to close the context element.
89b72577
JRJ
599 * Returns zero if the element's value could be written.
600 * Negative values indicate an error.
601 */
602int mi_lttng_context(struct mi_writer *writer,
603 struct lttng_event_context *context, int is_open);
604
605/*
606 * Machine interface of a perf_counter_context.
607 *
608 * writer An instance of a machine interface writer
609 *
610 * contest An instance of a lttng_event_perf_counter_ctx
611 *
612 * Returns zero if the element's value could be written.
613 * Negative values indicate an error.
614 */
615int mi_lttng_perf_counter_context(struct mi_writer *writer,
616 struct lttng_event_perf_counter_ctx *perf_context);
617
50534d6f
JRJ
618/*
619 * Machine interface of the snapshot list_output.
620 * It specifies the session for which we are listing snapshots,
621 * and it opens a snapshots element to list a sequence
622 * of snapshots.
623 *
624 * writer An instance of a machine interface writer.
625 *
626 * session_name: Snapshot output for session "session_name".
627 *
628 * Note: The client has to close the session and the snapshots elements after
629 * having listed every lttng_snapshot_output.
630 *
631 * Returns zero if the element's value could be written.
632 * Negative values indicate an error.
633 */
634int mi_lttng_snapshot_output_session_name(struct mi_writer *writer,
635 const char *session_name);
636
637/*
638 * Machine interface of the snapshot output.
639 * The machine interface serializes the following attributes:
640 * - id: ID of the snapshot output.
641 * - name: Name of the output.
642 * - data_url : Destination of the output.
643 * - ctrl_url: Destination of the output.
644 * - max_size: total size of all stream combined.
645 *
646 * writer An instance of a machine interface writer.
647 *
648 * output: A list of snapshot_output.
649 *
650 * Returns zero if the element's value could be written.
651 * Negative values indicate an error.
652 */
653int mi_lttng_snapshot_list_output(struct mi_writer *writer,
654 struct lttng_snapshot_output *output);
655
656/*
657 * Machine interface of the output of the command snapshot del output
658 * when deleting a snapshot either by id or by name.
659 * If the snapshot was found and successfully deleted using its id,
660 * it return the id of the snapshot and the current session name on which it
661 * was attached.
662 *
663 * Otherwise, it do the same process with the name of the snapshot, if the
664 * snapshot output id is undefined.
665 *
666 * writer An instance of a machine interface writer.
667 *
668 * id: ID of the snapshot output.
669 *
670 * name: Name of the snapshot.
671 *
672 * current_session_name: Session to which the snapshot belongs.
673 *
674 * Returns zero if the element's value could be written.
675 * Negative values indicate an error.
676 */
677int mi_lttng_snapshot_del_output(struct mi_writer *writer, int id,
678 const char *name, const char *current_session_name);
679
680/*
681 * Machine interface of the output of the command snapshot add output
682 * when adding a snapshot from a user URL.
683 *
684 * If the snapshot was successfully added, the machine interface lists
685 * these information:
686 * - id: ID of the newly add snapshot output.
687 * - current_session_name: Name of the session to which the output was added.
688 * - ctrl_url: Destination of the output.
689 * - max_size: total size of all stream combined.
690 *
691 * writer An instance of a machine interface writer.
692 *
693 * current_session_name: Session to which the snapshot belongs.
694 *
695 * n_ptr:
696 *
697 * output: iterator over a lttng_snapshot_output_list which contain
698 * the snapshot output informations.
699 *
700 * Returns zero if the element's value could be written.
701 * Negative values indicate an error.
702 */
703int mi_lttng_snapshot_add_output(struct mi_writer *writer,
704 const char *current_session_name, const char *n_ptr,
705 struct lttng_snapshot_output *output);
706
707/*
708 * Machine interface of the output of the command snapshot
709 * record from a URL (if given).
710 *
711 * If the snapshot is successfully recorded from a url, the machine interface
712 * output the following information:
713 * - url: Destination of the output stored in the snapshot.
714 *
715 * Otherwise, the machine interface output the data and ctrl url received
716 * from the command-line.
717 *
718 * writer An instance of a machine interface writer.
719 *
720 * current_session_name: Snapshot record for session "current_session_name".
721 *
722 * ctrl_url, data_url: Destination of the output receive from the command-line.
723 *
724 * Returns zero if the element's value could be written.
725 * Negative values indicate an error.
726 */
727int mi_lttng_snapshot_record(struct mi_writer *writer,
728 const char *current_session_name, const char *url,
729 const char *cmdline_ctrl_url, const char *cmdline_data_url);
730
c7e35b03 731#endif /* _MI_LTTNG_H */
This page took 0.054886 seconds and 5 git commands to generate.