2 * Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
11 #include <lttng/lttng-export.h>
18 * The lttng_save_session_attr object is opaque to the user. Use the helper
19 * functions below to use them.
21 struct lttng_save_session_attr
;
24 * Return a newly allocated save session attribute object or NULL on error.
26 LTTNG_EXPORT
extern struct lttng_save_session_attr
*lttng_save_session_attr_create(void);
29 * Free a given save session attribute object.
31 LTTNG_EXPORT
extern void lttng_save_session_attr_destroy(struct lttng_save_session_attr
*output
);
34 * Save session attribute getter family functions.
37 /* Return session name. NULL indicated all sessions must be saved. */
38 LTTNG_EXPORT
extern const char *
39 lttng_save_session_attr_get_session_name(struct lttng_save_session_attr
*attr
);
41 * Return destination URL. A NULL value indicates the default session
42 * configuration location. The URL format used is documented in lttng(1).
43 * NULL indicates that the default session configuration path is used.
45 LTTNG_EXPORT
extern const char *
46 lttng_save_session_attr_get_output_url(struct lttng_save_session_attr
*attr
);
48 * Return the configuration overwrite attribute. This attribute indicates
49 * whether or not existing configuration files must be overwritten.
51 LTTNG_EXPORT
extern int lttng_save_session_attr_get_overwrite(struct lttng_save_session_attr
*attr
);
53 * Return the omit name configuration attribute. This attribute indicates
54 * whether or not the saved sessions' names should be omitted.
56 LTTNG_EXPORT
extern int lttng_save_session_attr_get_omit_name(struct lttng_save_session_attr
*attr
);
58 * Return the omit output configuration attribute. This attribute indicates
59 * whether or not the saved sessions' output configuration should be omitted.
61 LTTNG_EXPORT
extern int
62 lttng_save_session_attr_get_omit_output(struct lttng_save_session_attr
*attr
);
65 * Save session attribute setter family functions.
67 * For every set* call, 0 is returned on success or else -LTTNG_ERR_INVALID is
68 * returned indicating that at least one given parameter is invalid.
72 * Set the name of the session to save. A NULL name means all sessions
73 * known to the session daemon will be saved.
75 LTTNG_EXPORT
extern int
76 lttng_save_session_attr_set_session_name(struct lttng_save_session_attr
*attr
,
77 const char *session_name
);
79 * Set the URL of the session configuration to save. A NULL value indicates the
80 * use of the default location being the session one. The URL's format is is
81 * documented in lttng(1).
83 LTTNG_EXPORT
extern int lttng_save_session_attr_set_output_url(struct lttng_save_session_attr
*attr
,
86 * Set the overwrite attribute. If set to true, files of the same name as the
87 * current session configuration URL will be overwritten.
89 LTTNG_EXPORT
extern int lttng_save_session_attr_set_overwrite(struct lttng_save_session_attr
*attr
,
92 * Set the omit name attribute. If set to true, the sessions' names are omitted
93 * from the resulting session configuration file.
95 LTTNG_EXPORT
extern int lttng_save_session_attr_set_omit_name(struct lttng_save_session_attr
*attr
,
98 * Set the omit output attribute. If set to true, the sessions' output
99 * configurations are omitted from the resulting session configuration file.
101 LTTNG_EXPORT
extern int
102 lttng_save_session_attr_set_omit_output(struct lttng_save_session_attr
*attr
, int omit_output
);
105 * Save session configuration(s).
107 * The lttng_save_session_attr object must not be NULL. No ownership of the
108 * object is kept by the function; it must be released by the caller.
110 * Returns 0 on success or a negative LTTNG_ERR value on error.
112 LTTNG_EXPORT
extern int lttng_save_session(struct lttng_save_session_attr
*attr
);
118 #endif /* LTTNG_SAVE_H */
This page took 0.033541 seconds and 4 git commands to generate.