projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: ust: conditionally enable the underscore prefix variant quirk
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.cpp
diff --git
a/src/bin/lttng-sessiond/main.cpp
b/src/bin/lttng-sessiond/main.cpp
index cf7aa9e9e67bc94c971982133ef8ea49ed7fd128..5d6e03775bf36cbd519744b3b76b671775272231 100644
(file)
--- a/
src/bin/lttng-sessiond/main.cpp
+++ b/
src/bin/lttng-sessiond/main.cpp
@@
-42,6
+42,8
@@
#include <common/config/session-config.hpp>
#include <common/ini-config/ini-config.hpp>
#include <common/dynamic-buffer.hpp>
#include <common/config/session-config.hpp>
#include <common/ini-config/ini-config.hpp>
#include <common/dynamic-buffer.hpp>
+#include <common/logging-utils.hpp>
+
#include <lttng/event-internal.hpp>
#include "lttng-sessiond.hpp"
#include "buffer-registry.hpp"
#include <lttng/event-internal.hpp>
#include "lttng-sessiond.hpp"
#include "buffer-registry.hpp"
@@
-166,17
+168,18
@@
static const char * const config_section_name = "sessiond";
static int is_root;
/*
static int is_root;
/*
- * Stop all threads by closing the thread quit pipe.
+ * Notify the main thread to initiate the teardown of the worker threads by
+ * writing to the main quit pipe.
*/
*/
-static void
stop_threads
(void)
+static void
notify_main_quit_pipe
(void)
{
int ret;
/* Stopping all threads */
{
int ret;
/* Stopping all threads */
- DBG("
Terminating all
threads");
- ret = sessiond_notify_quit_pipe();
+ DBG("
Notify the main thread to terminate all worker
threads");
+ ret = sessiond_notify_
main_
quit_pipe();
if (ret < 0) {
if (ret < 0) {
- ERR("write error on
thread
quit pipe");
+ ERR("write error on
main
quit pipe");
}
}
}
}
@@
-281,10
+284,12
@@
static void sessiond_cleanup(void)
DBG("Cleanup sessiond");
/*
DBG("Cleanup sessiond");
/*
- * Close the
thread quit pipe. It has already done its job,
- *
since we are now called
.
+ * Close the
main quit pipe. It has already done its job, since we are
+ *
now cleaning up
.
*/
*/
- sessiond_close_quit_pipe();
+ sessiond_close_main_quit_pipe();
+
+ /* Close all other pipes. */
utils_close_pipe(apps_cmd_pipe);
utils_close_pipe(apps_cmd_notify_pipe);
utils_close_pipe(the_kernel_poll_pipe);
utils_close_pipe(apps_cmd_pipe);
utils_close_pipe(apps_cmd_notify_pipe);
utils_close_pipe(the_kernel_poll_pipe);
@@
-1178,11
+1183,11
@@
static void sighandler(int sig, siginfo_t *siginfo,
switch (sig) {
case SIGINT:
DBG("SIGINT caught");
switch (sig) {
case SIGINT:
DBG("SIGINT caught");
-
stop_threads
();
+
notify_main_quit_pipe
();
break;
case SIGTERM:
DBG("SIGTERM caught");
break;
case SIGTERM:
DBG("SIGTERM caught");
-
stop_threads
();
+
notify_main_quit_pipe
();
break;
case SIGUSR1:
CMM_STORE_SHARED(recv_child_signal, 1);
break;
case SIGUSR1:
CMM_STORE_SHARED(recv_child_signal, 1);
@@
-1535,6
+1540,7
@@
int main(int argc, char **argv)
sessiond_config_log(&the_config);
sessiond_uuid_log();
sessiond_config_log(&the_config);
sessiond_uuid_log();
+ lttng::logging::log_system_information(PRINT_DBG);
if (opt_print_version) {
print_version();
if (opt_print_version) {
print_version();
@@
-1598,8
+1604,8
@@
int main(int argc, char **argv)
goto stop_threads;
}
goto stop_threads;
}
- /* Create
thread
quit pipe */
- if (sessiond_init_
thread
_quit_pipe()) {
+ /* Create
main
quit pipe */
+ if (sessiond_init_
main
_quit_pipe()) {
retval = -1;
goto stop_threads;
}
retval = -1;
goto stop_threads;
}
@@
-1824,7
+1830,6
@@
int main(int argc, char **argv)
if (!rotation_thread_handle) {
retval = -1;
ERR("Failed to create rotation thread shared data");
if (!rotation_thread_handle) {
retval = -1;
ERR("Failed to create rotation thread shared data");
- stop_threads();
goto stop_threads;
}
goto stop_threads;
}
@@
-1917,11
+1922,13
@@
int main(int argc, char **argv)
* signal that asks threads to teardown).
*/
* signal that asks threads to teardown).
*/
- /* Initiate teardown once activity occurs on the quit pipe. */
- sessiond_wait_for_quit_pipe(-1);
+ /* Initiate teardown once activity occurs on the
main
quit pipe. */
+ sessiond_wait_for_
main_
quit_pipe(-1);
stop_threads:
stop_threads:
+ DBG("Terminating all threads");
+
/*
* Ensure that the client thread is no longer accepting new commands,
* which could cause new sessions to be created.
/*
* Ensure that the client thread is no longer accepting new commands,
* which could cause new sessions to be created.
This page took
0.025608 seconds
and
4
git commands to generate.