X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=36d154e1fff0cd5ebe46afa6b74700110c969b61;hb=df09ff2e14eeef441e1031cbfcea0114cab9bc2d;hp=48868820e74df4846d800638ce59695319867ad0;hpb=65da3cc731c72486d53d58c9b080f235121177d9;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 48868820e..36d154e1f 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -629,6 +629,9 @@ static void cleanup(void) } } + DBG("Cleaning up all agent apps"); + agent_app_ht_clean(); + DBG("Closing all UST sockets"); ust_app_clean_list(); buffer_reg_destroy_registries(); @@ -5077,6 +5080,9 @@ int main(int argc, char **argv) void *status; const char *home_path, *env_app_timeout; + /* Initialize agent apps ht global variable */ + agent_apps_ht_by_sock = NULL; + init_kernel_workarounds(); rcu_register_thread(); @@ -5268,20 +5274,24 @@ int main(int argc, char **argv) goto error; } + /* After this point, we can safely call cleanup() with "goto exit" */ + /* * Init UST app hash table. Alloc hash table before this point since * cleanup() can get called after that point. */ ust_app_ht_alloc(); - /* Initialize agent domain subsystem. */ - if ((ret = agent_setup()) < 0) { - /* ENOMEM at this point. */ - goto error; + /* + * Initialize agent app hash table. We allocate the hash table here + * since cleanup() can get called after this point. + */ + if (agent_app_ht_alloc()) { + ERR("Failed to allocate Agent app hash table"); + ret = -1; + goto exit; } - /* After this point, we can safely call cleanup() with "goto exit" */ - /* * These actions must be executed as root. We do that *after* setting up * the sockets path because we MUST make the check for another daemon using