From: Jérémie Galarneau Date: Thu, 30 Jul 2015 16:48:52 +0000 (-0400) Subject: Clean-up: Move agent_apps_ht_by_sock definition to main.c X-Git-Tag: v2.8.0-rc1~531 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7c1d2758d663ac5f119eae6849e50b56546a0c48;p=lttng-tools.git Clean-up: Move agent_apps_ht_by_sock definition to main.c Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/agent.h b/src/bin/lttng-sessiond/agent.h index d08ad6e22..7faae117e 100644 --- a/src/bin/lttng-sessiond/agent.h +++ b/src/bin/lttng-sessiond/agent.h @@ -30,9 +30,9 @@ /* * Hash table that contains the agent app created upon registration indexed by - * socket. + * socket. Global to the session daemon. */ -struct lttng_ht *agent_apps_ht_by_sock; +extern struct lttng_ht *agent_apps_ht_by_sock; struct agent_ht_key { const char *name; diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index a6ce344a4..11e288541 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -38,6 +38,7 @@ #include "lttng-sessiond.h" #include "utils.h" #include "syscall.h" +#include "agent.h" #include "cmd.h" diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index bedaa2e2f..08c7d4339 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -33,6 +33,7 @@ #include "ust-app.h" #include "trace-kernel.h" #include "trace-ust.h" +#include "agent.h" /* * Add unique UST event based on the event name, filter bytecode and loglevel. diff --git a/src/bin/lttng-sessiond/event.h b/src/bin/lttng-sessiond/event.h index cc4a3fa02..37f986087 100644 --- a/src/bin/lttng-sessiond/event.h +++ b/src/bin/lttng-sessiond/event.h @@ -18,9 +18,10 @@ #ifndef _LTT_EVENT_H #define _LTT_EVENT_H -#include "agent.h" #include "trace-kernel.h" +struct agent; + int event_kernel_disable_event(struct ltt_kernel_channel *kchan, char *event_name); int event_kernel_disable_event_type(struct ltt_kernel_channel *kchan, diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 2582e886d..c66548cd8 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -73,6 +73,7 @@ #include "save.h" #include "load-session-thread.h" #include "syscall.h" +#include "agent.h" #define CONSUMERD_FILE "lttng-consumerd" @@ -305,6 +306,9 @@ const char * const config_section_name = "sessiond"; /* Load session thread information to operate. */ struct load_session_thread_data *load_info; +/* Global hash tables */ +struct lttng_ht *agent_apps_ht_by_sock = NULL; + /* * Whether sessiond is ready for commands/health check requests. * NR_LTTNG_SESSIOND_READY must match the number of calls to diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 2740d0f80..248669616 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -30,6 +30,7 @@ #include "trace-ust.h" #include "utils.h" #include "ust-app.h" +#include "agent.h" /* * Match function for the events hash table lookup. diff --git a/src/bin/lttng-sessiond/trace-ust.h b/src/bin/lttng-sessiond/trace-ust.h index c4dbe06c5..a65bd30a9 100644 --- a/src/bin/lttng-sessiond/trace-ust.h +++ b/src/bin/lttng-sessiond/trace-ust.h @@ -27,9 +27,10 @@ #include #include "consumer.h" -#include "agent.h" #include "ust-ctl.h" +struct agent; + struct ltt_ust_ht_key { const char *name; const struct lttng_filter_bytecode *filter; diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index 66cda8c08..102b05b27 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -22,7 +22,6 @@ #include -#include "agent.h" #include "trace-ust.h" #include "ust-registry.h" diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index 6df66acbe..d7d2e3539 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -49,6 +49,9 @@ int lttng_opt_mi; int ust_consumerd32_fd; int ust_consumerd64_fd; +/* Global variable required by sessiond objects being linked-in */ +struct lttng_ht *agent_apps_ht_by_sock; + static const char alphanum[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"