This is needed to support the LTTng JUL agent to connect to both user
and root session daemon, we have to enable different tracepoint for the
two cases in order to avoid duplicating the trace payload in both the
user and root trace output.
Signed-off-by: David Goulet <dgoulet@efficios.com>
memset(&uevent, 0, sizeof(uevent));
uevent.type = LTTNG_EVENT_TRACEPOINT;
uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
memset(&uevent, 0, sizeof(uevent));
uevent.type = LTTNG_EVENT_TRACEPOINT;
uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
- strncpy(uevent.name, DEFAULT_JUL_EVENT_NAME, sizeof(uevent.name));
+ if (is_root) {
+ strncpy(uevent.name, DEFAULT_SYS_JUL_EVENT_NAME,
+ sizeof(uevent.name));
+ } else {
+ strncpy(uevent.name, DEFAULT_USER_JUL_EVENT_NAME,
+ sizeof(uevent.name));
+ }
uevent.name[sizeof(uevent.name) - 1] = '\0';
/*
uevent.name[sizeof(uevent.name) - 1] = '\0';
/*
/* Create the default JUL tracepoint. */
uevent.type = LTTNG_EVENT_TRACEPOINT;
uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
/* Create the default JUL tracepoint. */
uevent.type = LTTNG_EVENT_TRACEPOINT;
uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
- strncpy(uevent.name, DEFAULT_JUL_EVENT_NAME, sizeof(uevent.name));
+ if (is_root) {
+ strncpy(uevent.name, DEFAULT_SYS_JUL_EVENT_NAME,
+ sizeof(uevent.name));
+ } else {
+ strncpy(uevent.name, DEFAULT_USER_JUL_EVENT_NAME,
+ sizeof(uevent.name));
+ }
uevent.name[sizeof(uevent.name) - 1] = '\0';
/*
uevent.name[sizeof(uevent.name) - 1] = '\0';
/*
*/
extern const char * const config_section_name;
*/
extern const char * const config_section_name;
+/* Is this daemon root or not. */
+extern int is_root;
+
int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size);
int sessiond_check_thread_quit_pipe(int fd, uint32_t events);
int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size);
int sessiond_check_thread_quit_pipe(int fd, uint32_t events);
static int opt_verbose_consumer;
static int opt_daemon, opt_background;
static int opt_no_kernel;
static int opt_verbose_consumer;
static int opt_daemon, opt_background;
static int opt_no_kernel;
-static int is_root; /* Set to 1 if the daemon is running as root */
static pid_t ppid; /* Parent PID for --sig-parent option */
static pid_t child_ppid; /* Internal parent PID use with daemonize. */
static char *rundir;
static pid_t ppid; /* Parent PID for --sig-parent option */
static pid_t child_ppid; /* Internal parent PID use with daemonize. */
static char *rundir;
/* JUL TCP port for registration. Used by the JUL thread. */
unsigned int jul_tcp_port = DEFAULT_JUL_TCP_PORT;
/* JUL TCP port for registration. Used by the JUL thread. */
unsigned int jul_tcp_port = DEFAULT_JUL_TCP_PORT;
+/* Am I root or not. */
+int is_root; /* Set to 1 if the daemon is running as root */
+
const char * const config_section_name = "sessiond";
/*
const char * const config_section_name = "sessiond";
/*
/* Default JUL domain channel name. */
#define DEFAULT_JUL_CHANNEL_NAME "lttng_jul_channel"
/* Default JUL tracepoint name. This is a wildcard for the JUL domain. */
/* Default JUL domain channel name. */
#define DEFAULT_JUL_CHANNEL_NAME "lttng_jul_channel"
/* Default JUL tracepoint name. This is a wildcard for the JUL domain. */
-#define DEFAULT_JUL_EVENT_NAME "lttng_jul*"
+#define DEFAULT_SYS_JUL_EVENT_NAME "lttng_jul:sys*"
+#define DEFAULT_USER_JUL_EVENT_NAME "lttng_jul:user*"
/* JUL default channel name. */
#define DEFAULT_CHANNEL_OVERWRITE 0
#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0
/* JUL default channel name. */
#define DEFAULT_CHANNEL_OVERWRITE 0
#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0