projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: session_list lock must be held to launch a rotation
[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 2e9796cc2892ad7f5b687d709ef63bd1b73d35f6..3256a1e9b6581899380cb47f16cb35b10a90b32c 100644
(file)
--- a/
src/bin/lttng-sessiond/rotation-thread.c
+++ b/
src/bin/lttng-sessiond/rotation-thread.c
@@
-72,7
+72,6
@@
struct rotation_thread_timer_queue {
};
struct rotation_thread_handle {
};
struct rotation_thread_handle {
- int quit_pipe;
struct rotation_thread_timer_queue *rotation_timer_queue;
/* Access to the notification thread cmd_queue */
struct notification_thread_handle *notification_thread_handle;
struct rotation_thread_timer_queue *rotation_timer_queue;
/* Access to the notification thread cmd_queue */
struct notification_thread_handle *notification_thread_handle;
@@
-169,7
+168,6
@@
void rotation_thread_handle_destroy(
}
struct rotation_thread_handle *rotation_thread_handle_create(
}
struct rotation_thread_handle *rotation_thread_handle_create(
- int quit_pipe,
struct rotation_thread_timer_queue *rotation_timer_queue,
struct notification_thread_handle *notification_thread_handle,
sem_t *notification_thread_ready)
struct rotation_thread_timer_queue *rotation_timer_queue,
struct notification_thread_handle *notification_thread_handle,
sem_t *notification_thread_ready)
@@
-181,7
+179,6
@@
struct rotation_thread_handle *rotation_thread_handle_create(
goto end;
}
goto end;
}
- handle->quit_pipe = quit_pipe;
handle->rotation_timer_queue = rotation_timer_queue;
handle->notification_thread_handle = notification_thread_handle;
handle->notification_thread_ready = notification_thread_ready;
handle->rotation_timer_queue = rotation_timer_queue;
handle->notification_thread_handle = notification_thread_handle;
handle->notification_thread_ready = notification_thread_ready;
@@
-276,15
+273,8
@@
int init_poll_set(struct lttng_poll_event *poll_set,
* - quit pipe,
* - rotation thread timer queue pipe,
*/
* - quit pipe,
* - rotation thread timer queue pipe,
*/
- ret = lttng_poll_create(poll_set, 2, LTTNG_CLOEXEC);
- if (ret < 0) {
- goto end;
- }
-
- ret = lttng_poll_add(poll_set, handle->quit_pipe,
- LPOLLIN | LPOLLERR);
- if (ret < 0) {
- ERR("[rotation-thread] Failed to add quit_pipe fd to pollset");
+ ret = sessiond_set_thread_pollset(poll_set, 2);
+ if (ret) {
goto error;
}
ret = lttng_poll_add(poll_set,
goto error;
}
ret = lttng_poll_add(poll_set,
@@
-295,7
+285,6
@@
int init_poll_set(struct lttng_poll_event *poll_set,
goto error;
}
goto error;
}
-end:
return ret;
error:
lttng_poll_clean(poll_set);
return ret;
error:
lttng_poll_clean(poll_set);
@@
-653,7
+642,7
@@
end:
return ret;
}
return ret;
}
-/* Call with the session
lock
held. */
+/* Call with the session
and session_list locks
held. */
static
int launch_session_rotation(struct ltt_session *session)
{
static
int launch_session_rotation(struct ltt_session *session)
{
@@
-747,10
+736,9
@@
int handle_job_queue(struct rotation_thread_handle *handle,
}
session_lock(session);
}
session_lock(session);
- session_unlock_list();
-
ret = run_job(job, session, handle->notification_thread_handle);
session_unlock(session);
ret = run_job(job, session, handle->notification_thread_handle);
session_unlock(session);
+ session_unlock_list();
free(job);
if (ret) {
goto end;
free(job);
if (ret) {
goto end;
@@
-815,7
+803,7
@@
int handle_condition(const struct lttng_condition *condition,
ret = unsubscribe_session_consumed_size_rotation(session,
notification_thread_handle);
if (ret) {
ret = unsubscribe_session_consumed_size_rotation(session,
notification_thread_handle);
if (ret) {
- goto end;
+ goto end
_unlock
;
}
ret = cmd_rotate_session(session, NULL);
}
ret = cmd_rotate_session(session, NULL);
@@
-960,7
+948,7
@@
void *thread_rotation(void *data)
goto error;
}
goto error;
}
- if (
fd == handle->quit_pipe
) {
+ if (
sessiond_check_thread_quit_pipe(fd, revents)
) {
DBG("[rotation-thread] Quit pipe activity");
/* TODO flush the queue. */
goto exit;
DBG("[rotation-thread] Quit pipe activity");
/* TODO flush the queue. */
goto exit;
This page took
0.036291 seconds
and
5
git commands to generate.