projects
/
deliverable
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
trackers: support tracking feature
[deliverable/lttng-tools.git]
/
src
/
lib
/
lttng-ctl
/
rotate.c
diff --git
a/src/lib/lttng-ctl/rotate.c
b/src/lib/lttng-ctl/rotate.c
index 5c5b1b70cc05b2eecee78809cce1309d716b9a14..bc3a63cc8aa67d8a0bd089e32b56677d0795039f 100644
(file)
--- a/
src/lib/lttng-ctl/rotate.c
+++ b/
src/lib/lttng-ctl/rotate.c
@@
-233,7
+233,7
@@
int lttng_rotate_session(const char *session_name,
sizeof(lsm.session.name));
ret = lttng_ctl_ask_sessiond(&lsm, (void **) &rotate_return);
sizeof(lsm.session.name));
ret = lttng_ctl_ask_sessiond(&lsm, (void **) &rotate_return);
- if (ret < 0) {
+ if (ret <
=
0) {
*rotation_handle = NULL;
goto end;
}
*rotation_handle = NULL;
goto end;
}
@@
-299,23
+299,33
@@
enum lttng_rotation_status lttng_rotation_update_schedule(
switch (schedule->type) {
case LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD:
{
switch (schedule->type) {
case LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD:
{
+ uint64_t threshold;
+
status = lttng_rotation_schedule_size_threshold_get_threshold(
status = lttng_rotation_schedule_size_threshold_get_threshold(
- schedule, &
lsm.u.rotation_set_schedule.value
);
+ schedule, &
threshold
);
if (status != LTTNG_ROTATION_STATUS_OK) {
if (status != LTTNG_ROTATION_STATUS_OK) {
+ if (status == LTTNG_ROTATION_STATUS_UNAVAILABLE) {
+ status = LTTNG_ROTATION_STATUS_INVALID;
+ }
goto end;
}
goto end;
}
-
+ lsm.u.rotation_set_schedule.value = threshold;
lsm.u.rotation_set_schedule.set = !!add;
break;
}
case LTTNG_ROTATION_SCHEDULE_TYPE_PERIODIC:
{
lsm.u.rotation_set_schedule.set = !!add;
break;
}
case LTTNG_ROTATION_SCHEDULE_TYPE_PERIODIC:
{
+ uint64_t period;
+
status = lttng_rotation_schedule_periodic_get_period(
status = lttng_rotation_schedule_periodic_get_period(
- schedule, &
lsm.u.rotation_set_schedule.value
);
+ schedule, &
period
);
if (status != LTTNG_ROTATION_STATUS_OK) {
if (status != LTTNG_ROTATION_STATUS_OK) {
+ if (status == LTTNG_ROTATION_STATUS_UNAVAILABLE) {
+ status = LTTNG_ROTATION_STATUS_INVALID;
+ }
goto end;
}
goto end;
}
-
+ lsm.u.rotation_set_schedule.value = period;
lsm.u.rotation_set_schedule.set = !!add;
break;
}
lsm.u.rotation_set_schedule.set = !!add;
break;
}
@@
-468,7
+478,8
@@
lttng_rotation_schedule_size_threshold_get_threshold(
enum lttng_rotation_status status = LTTNG_ROTATION_STATUS_OK;
struct lttng_rotation_schedule_size_threshold *size_schedule;
enum lttng_rotation_status status = LTTNG_ROTATION_STATUS_OK;
struct lttng_rotation_schedule_size_threshold *size_schedule;
- if (!schedule || !size_threshold_bytes) {
+ if (!schedule || !size_threshold_bytes ||
+ schedule->type != LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD) {
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
@@
-495,7
+506,8
@@
lttng_rotation_schedule_size_threshold_set_threshold(
struct lttng_rotation_schedule_size_threshold *size_schedule;
if (!schedule || size_threshold_bytes == 0 ||
struct lttng_rotation_schedule_size_threshold *size_schedule;
if (!schedule || size_threshold_bytes == 0 ||
- size_threshold_bytes == -1ULL) {
+ size_threshold_bytes == -1ULL ||
+ schedule->type != LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD) {
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
@@
-532,7
+544,8
@@
lttng_rotation_schedule_periodic_get_period(
enum lttng_rotation_status status = LTTNG_ROTATION_STATUS_OK;
struct lttng_rotation_schedule_periodic *periodic_schedule;
enum lttng_rotation_status status = LTTNG_ROTATION_STATUS_OK;
struct lttng_rotation_schedule_periodic *periodic_schedule;
- if (!schedule || !period_us) {
+ if (!schedule || !period_us ||
+ schedule->type != LTTNG_ROTATION_SCHEDULE_TYPE_PERIODIC) {
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
@@
-558,7
+571,8
@@
lttng_rotation_schedule_periodic_set_period(
enum lttng_rotation_status status = LTTNG_ROTATION_STATUS_OK;
struct lttng_rotation_schedule_periodic *periodic_schedule;
enum lttng_rotation_status status = LTTNG_ROTATION_STATUS_OK;
struct lttng_rotation_schedule_periodic *periodic_schedule;
- if (!schedule || period_us == 0 || period_us == -1ULL) {
+ if (!schedule || period_us == 0 || period_us == -1ULL ||
+ schedule->type != LTTNG_ROTATION_SCHEDULE_TYPE_PERIODIC) {
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
status = LTTNG_ROTATION_STATUS_INVALID;
goto end;
}
This page took
0.024905 seconds
and
5
git commands to generate.