projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reference count ltt_session objects
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
rotation-thread.c
diff --git
a/src/bin/lttng-sessiond/rotation-thread.c
b/src/bin/lttng-sessiond/rotation-thread.c
index 3256a1e9b6581899380cb47f16cb35b10a90b32c..a9f9967a3b49ee04d3fab5beba7b3d27c268c627 100644
(file)
--- a/
src/bin/lttng-sessiond/rotation-thread.c
+++ b/
src/bin/lttng-sessiond/rotation-thread.c
@@
-431,7
+431,12
@@
end:
session->rotation_pending_local = false;
}
if (ret) {
session->rotation_pending_local = false;
}
if (ret) {
- session->rotation_state = LTTNG_ROTATION_STATE_ERROR;
+ ret = session_reset_rotation_state(session,
+ LTTNG_ROTATION_STATE_ERROR);
+ if (ret) {
+ ERR("Failed to reset rotation state of session \"%s\"",
+ session->name);
+ }
}
return 0;
}
}
return 0;
}
@@
-491,14
+496,19
@@
int check_session_rotation_pending_relay(struct ltt_session *session)
ERR("[rotation-thread] Encountered an error when checking if rotation of trace archive %" PRIu64 " of session \"%s\" is pending on the relay",
session->current_archive_id - 1,
session->name);
ERR("[rotation-thread] Encountered an error when checking if rotation of trace archive %" PRIu64 " of session \"%s\" is pending on the relay",
session->current_archive_id - 1,
session->name);
- session->rotation_state = LTTNG_ROTATION_STATE_ERROR;
+ ret = session_reset_rotation_state(session,
+ LTTNG_ROTATION_STATE_ERROR);
+ if (ret) {
+ ERR("Failed to reset rotation state of session \"%s\"",
+ session->name);
+ }
rotation_completed = false;
}
rcu_read_unlock();
if (rotation_completed) {
rotation_completed = false;
}
rcu_read_unlock();
if (rotation_completed) {
- DBG("[rotation-thread]
T
otation of trace archive %" PRIu64 " of session \"%s\" is complete on the relay",
+ DBG("[rotation-thread]
R
otation of trace archive %" PRIu64 " of session \"%s\" is complete on the relay",
session->current_archive_id - 1,
session->name);
session->rotation_pending_relay = false;
session->current_archive_id - 1,
session->name);
session->rotation_pending_relay = false;
@@
-555,7
+565,12
@@
int check_session_rotation_pending(struct ltt_session *session,
/* Rename the completed trace archive's location. */
now = time(NULL);
if (now == (time_t) -1) {
/* Rename the completed trace archive's location. */
now = time(NULL);
if (now == (time_t) -1) {
- session->rotation_state = LTTNG_ROTATION_STATE_ERROR;
+ ret = session_reset_rotation_state(session,
+ LTTNG_ROTATION_STATE_ERROR);
+ if (ret) {
+ ERR("Failed to reset rotation state of session \"%s\"",
+ session->name);
+ }
ret = LTTNG_ERR_UNK;
goto end;
}
ret = LTTNG_ERR_UNK;
goto end;
}
@@
-691,7
+706,6
@@
int handle_job_queue(struct rotation_thread_handle *handle,
{
int ret = 0;
int fd = lttng_pipe_get_readfd(queue->event_pipe);
{
int ret = 0;
int fd = lttng_pipe_get_readfd(queue->event_pipe);
- struct ltt_session *session;
char buf;
ret = lttng_read(fd, &buf, 1);
char buf;
ret = lttng_read(fd, &buf, 1);
@@
-702,6
+716,7
@@
int handle_job_queue(struct rotation_thread_handle *handle,
}
for (;;) {
}
for (;;) {
+ struct ltt_session *session;
struct rotation_thread_job *job;
/* Take the queue lock only to pop an element from the list. */
struct rotation_thread_job *job;
/* Take the queue lock only to pop an element from the list. */
@@
-732,12
+747,14
@@
int handle_job_queue(struct rotation_thread_handle *handle,
*/
session_unlock_list();
free(job);
*/
session_unlock_list();
free(job);
+ session_put(session);
continue;
}
session_lock(session);
ret = run_job(job, session, handle->notification_thread_handle);
session_unlock(session);
continue;
}
session_lock(session);
ret = run_job(job, session, handle->notification_thread_handle);
session_unlock(session);
+ session_put(session);
session_unlock_list();
free(job);
if (ret) {
session_unlock_list();
free(job);
if (ret) {
@@
-826,6
+843,7
@@
int handle_condition(const struct lttng_condition *condition,
end_unlock:
session_unlock(session);
end_unlock:
session_unlock(session);
+ session_put(session);
end:
return ret;
}
end:
return ret;
}
@@
-845,7
+863,7
@@
int handle_notification_channel(int fd,
status = lttng_notification_channel_has_pending_notification(
rotate_notification_channel, ¬ification_pending);
if (status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
status = lttng_notification_channel_has_pending_notification(
rotate_notification_channel, ¬ification_pending);
if (status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
- ERR("[rotation-thread ]Error occured while checking for pending notification");
+ ERR("[rotation-thread ]Error occur
r
ed while checking for pending notification");
ret = -1;
goto end;
}
ret = -1;
goto end;
}
@@
-963,7
+981,7
@@
void *thread_rotation(void *data)
ret = handle_notification_channel(fd, handle,
&thread);
if (ret) {
ret = handle_notification_channel(fd, handle,
&thread);
if (ret) {
- ERR("[rotation-thread] Error occured while handling activity on notification channel socket");
+ ERR("[rotation-thread] Error occur
r
ed while handling activity on notification channel socket");
goto error;
}
}
goto error;
}
}
This page took
0.027284 seconds
and
5
git commands to generate.