projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: add missing rcu_barrier before daemon teardown
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index 67df2fa2fbd0d5fd92545955327ba3bd81ba0f0d..40670ddd52a5c150053e0ae0fe60ca6f1b252184 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-760,12
+760,6
@@
static void sessiond_cleanup_options(void)
free(kmod_extra_probes_list);
run_as_destroy_worker();
free(kmod_extra_probes_list);
run_as_destroy_worker();
-
- /* <fun> */
- DBG("%c[%d;%dm*** assert failed :-) *** ==> %c[%dm%c[%d;%dm"
- "Matthew, BEET driven development works!%c[%dm",
- 27, 1, 31, 27, 0, 27, 1, 33, 27, 0);
- /* </fun> */
}
/*
}
/*
@@
-1357,7
+1351,6
@@
restart:
consumer_data->metadata_sock.lock = zmalloc(sizeof(pthread_mutex_t));
if (consumer_data->metadata_sock.lock == NULL) {
PERROR("zmalloc pthread mutex");
consumer_data->metadata_sock.lock = zmalloc(sizeof(pthread_mutex_t));
if (consumer_data->metadata_sock.lock == NULL) {
PERROR("zmalloc pthread mutex");
- ret = -1;
goto error;
}
pthread_mutex_init(consumer_data->metadata_sock.lock, NULL);
goto error;
}
pthread_mutex_init(consumer_data->metadata_sock.lock, NULL);
@@
-2202,10
+2195,12
@@
static void *thread_registration_apps(void *data)
* lttcomm_setsockopt_snd_timeout expect msec as
* parameter.
*/
* lttcomm_setsockopt_snd_timeout expect msec as
* parameter.
*/
- (void) lttcomm_setsockopt_rcv_timeout(sock,
- app_socket_timeout * 1000);
- (void) lttcomm_setsockopt_snd_timeout(sock,
- app_socket_timeout * 1000);
+ if (app_socket_timeout >= 0) {
+ (void) lttcomm_setsockopt_rcv_timeout(sock,
+ app_socket_timeout * 1000);
+ (void) lttcomm_setsockopt_snd_timeout(sock,
+ app_socket_timeout * 1000);
+ }
/*
* Set the CLOEXEC flag. Return code is useless because
/*
* Set the CLOEXEC flag. Return code is useless because
@@
-2379,7
+2374,7
@@
static int spawn_consumer_thread(struct consumer_data *consumer_data)
pthread_mutex_lock(&consumer_data->cond_mutex);
/* Get time for sem_timedwait absolute timeout */
pthread_mutex_lock(&consumer_data->cond_mutex);
/* Get time for sem_timedwait absolute timeout */
- clock_ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
+ clock_ret =
lttng_
clock_gettime(CLOCK_MONOTONIC, &timeout);
/*
* Set the timeout for the condition timed wait even if the clock gettime
* call fails since we might loop on that call and we want to avoid to
/*
* Set the timeout for the condition timed wait even if the clock gettime
* call fails since we might loop on that call and we want to avoid to
@@
-3063,7
+3058,6
@@
static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
case LTTNG_CREATE_SESSION:
case LTTNG_CREATE_SESSION_SNAPSHOT:
case LTTNG_CREATE_SESSION_LIVE:
case LTTNG_CREATE_SESSION:
case LTTNG_CREATE_SESSION_SNAPSHOT:
case LTTNG_CREATE_SESSION_LIVE:
- case LTTNG_CALIBRATE:
case LTTNG_LIST_SESSIONS:
case LTTNG_LIST_TRACEPOINTS:
case LTTNG_LIST_SYSCALLS:
case LTTNG_LIST_SESSIONS:
case LTTNG_LIST_TRACEPOINTS:
case LTTNG_LIST_SYSCALLS:
@@
-3905,12
+3899,6
@@
error_add_context:
ret = LTTNG_OK;
break;
}
ret = LTTNG_OK;
break;
}
- case LTTNG_CALIBRATE:
- {
- ret = cmd_calibrate(cmd_ctx->lsm->domain.type,
- &cmd_ctx->lsm->u.calibrate);
- break;
- }
case LTTNG_REGISTER_CONSUMER:
{
struct consumer_data *cdata;
case LTTNG_REGISTER_CONSUMER:
{
struct consumer_data *cdata;
@@
-4292,7
+4280,6
@@
restart:
if (ret) {
PERROR("close");
}
if (ret) {
PERROR("close");
}
- new_sock = -1;
continue;
}
continue;
}
@@
-4321,7
+4308,6
@@
restart:
if (ret) {
PERROR("close");
}
if (ret) {
PERROR("close");
}
- new_sock = -1;
}
exit:
}
exit:
@@
-4339,7
+4325,7
@@
error:
}
lttng_poll_clean(&events);
}
lttng_poll_clean(&events);
-
+ stop_threads();
rcu_unregister_thread();
return NULL;
}
rcu_unregister_thread();
return NULL;
}
@@
-5377,9
+5363,6
@@
error:
static void sighandler(int sig)
{
switch (sig) {
static void sighandler(int sig)
{
switch (sig) {
- case SIGPIPE:
- DBG("SIGPIPE caught");
- return;
case SIGINT:
DBG("SIGINT caught");
stop_threads();
case SIGINT:
DBG("SIGINT caught");
stop_threads();
@@
-5411,9
+5394,10
@@
static int set_signal_handler(void)
return ret;
}
return ret;
}
- sa.sa_handler = sighandler;
sa.sa_mask = sigset;
sa.sa_flags = 0;
sa.sa_mask = sigset;
sa.sa_flags = 0;
+
+ sa.sa_handler = sighandler;
if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
@@
-5424,12
+5408,13
@@
static int set_signal_handler(void)
return ret;
}
return ret;
}
- if ((ret = sigaction(SIG
PIPE
, &sa, NULL)) < 0) {
+ if ((ret = sigaction(SIG
USR1
, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
}
PERROR("sigaction");
return ret;
}
- if ((ret = sigaction(SIGUSR1, &sa, NULL)) < 0) {
+ sa.sa_handler = SIG_IGN;
+ if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
}
PERROR("sigaction");
return ret;
}
@@
-6162,6
+6147,12
@@
exit_client:
exit_health:
exit_init_data:
exit_health:
exit_init_data:
+ /*
+ * Wait for all pending call_rcu work to complete before tearing
+ * down data structures. call_rcu worker may be trying to
+ * perform lookups in those structures.
+ */
+ rcu_barrier();
/*
* sessiond_cleanup() is called when no other thread is running, except
* the ht_cleanup thread, which is needed to destroy the hash tables.
/*
* sessiond_cleanup() is called when no other thread is running, except
* the ht_cleanup thread, which is needed to destroy the hash tables.
This page took
0.036688 seconds
and
5
git commands to generate.