X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Frotation.h;h=6091a7b988078039f73d641a6329cd6045f21701;hp=dbc0183da7e856a26df927c454df439b2e5f3a37;hb=dbd512ea8aa5349849aeeccda6130aa9e28cf23c;hpb=0ca413e056cf24ec5424cde5c78227138b0782c7 diff --git a/include/lttng/rotation.h b/include/lttng/rotation.h index dbc0183da..6091a7b98 100644 --- a/include/lttng/rotation.h +++ b/include/lttng/rotation.h @@ -88,25 +88,14 @@ struct lttng_rotation_schedule_attr; struct lttng_rotation_handle; /* - * Return a newly allocated immediate session rotation descriptor object or NULL - * on error. - */ -extern struct lttng_rotation_immediate_attr * -lttng_rotation_immediate_attr_create(void); - -/* - * Return a newly allocated scheduled rotate session descriptor object or NULL + * Return a newly allocated session rotation schedule descriptor object or NULL * on error. + * + * The rotation schedule may be expressed as a size or as a time period. */ extern struct lttng_rotation_schedule_attr * lttng_rotation_schedule_attr_create(void); -/* - * Destroy a given immediate session rotation descriptor object. - */ -extern void lttng_rotation_immediate_attr_destroy( - struct lttng_rotation_immediate_attr *attr); - /* * Destroy a given scheduled rotate session descriptor object. */ @@ -114,33 +103,13 @@ extern void lttng_rotation_schedule_attr_destroy( struct lttng_rotation_schedule_attr *attr); /* - * Set the name of the session to rotate immediately. - * - * The session_name parameter is copied to the immediate session rotation - * attributes. - */ -extern enum lttng_rotation_status lttng_rotation_immediate_attr_set_session_name( - struct lttng_rotation_immediate_attr *attr, - const char *session_name); - -/* - * Set the name of the session to rotate automatically. - * - * The session_name parameter is copied to the immediate session rotation - * attributes. - */ -extern enum lttng_rotation_status lttng_rotation_schedule_attr_set_session_name( - struct lttng_rotation_schedule_attr *attr, - const char *session_name); - -/* - * Set the timer to periodically rotate the session (µs, -1ULL to disable). + * Set the timer to periodically rotate the session (in µs). */ extern enum lttng_rotation_status lttng_rotation_schedule_attr_set_timer_period( struct lttng_rotation_schedule_attr *attr, uint64_t timer); /* - * Set the size to rotate the session (bytes, -1ULL to disable). + * Set the size to rotate the session (in bytes). */ void lttng_rotation_schedule_attr_set_size( struct lttng_rotation_schedule_attr *attr, uint64_t size); @@ -179,22 +148,26 @@ extern void lttng_rotation_handle_destroy( struct lttng_rotation_handle *rotation_handle); /* - * Rotate the output folder of the session + * Rotate the output folder of the session. * * On success, handle is allocated and can be used to monitor the progress * of the rotation with lttng_rotation_get_state(). The handle must be freed * by the caller with lttng_rotation_handle_destroy(). * + * Passing NULL as the immediate rotation attribute results in the default + * options being used. + * * Return 0 if the rotate action was successfully launched or a negative * LTTng error code on error. */ -extern int lttng_rotate_session(struct lttng_rotation_immediate_attr *attr, +extern int lttng_rotate_session(const char *session_name, + struct lttng_rotation_immediate_attr *attr, struct lttng_rotation_handle **rotation_handle); /* - * Configure a session to rotate periodically or based on the size written. + * Configure a session to rotate according to a given schedule. */ -extern int lttng_rotation_set_schedule( +extern int lttng_rotation_set_schedule(const char *session_name, struct lttng_rotation_schedule_attr *attr); /*