projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add multiple FreeBSD compat layer
[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 e990c34843f7eba9d21d0f2df5e8d43dbc750882..283868970f74e9eb2317e9a7e883c99d3b55f8bf 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-769,12
+769,18
@@
static void update_ust_app(int app_sock)
{
struct ltt_session *sess, *stmp;
{
struct ltt_session *sess, *stmp;
+ session_lock_list();
+
/* For all tracing session(s) */
cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) {
/* For all tracing session(s) */
cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) {
+ session_lock(sess);
if (sess->ust_session) {
ust_app_global_update(sess->ust_session, app_sock);
}
if (sess->ust_session) {
ust_app_global_update(sess->ust_session, app_sock);
}
+ session_unlock(sess);
}
}
+
+ session_unlock_list();
}
/*
}
/*
@@
-2032,14
+2038,16
@@
static int list_lttng_ust_global_events(char *channel_name,
tmp[i].type = LTTNG_EVENT_FUNCTION;
break;
}
tmp[i].type = LTTNG_EVENT_FUNCTION;
break;
}
- strncpy(tmp[i].loglevel, uevent->attr.loglevel, LTTNG_SYMBOL_NAME_LEN);
- tmp[i].loglevel[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
+ tmp[i].loglevel = uevent->attr.loglevel;
switch (uevent->attr.loglevel_type) {
switch (uevent->attr.loglevel_type) {
- case LTTNG_UST_LOGLEVEL:
- tmp[i].type = LTTNG_EVENT_LOGLEVEL;
+ case LTTNG_UST_LOGLEVEL_ALL:
+ tmp[i].loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
+ break;
+ case LTTNG_UST_LOGLEVEL_RANGE:
+ tmp[i].loglevel_type = LTTNG_EVENT_LOGLEVEL_RANGE;
break;
break;
- case LTTNG_UST_LOGLEVEL_
ONLY
:
- tmp[i].
type = LTTNG_EVENT_LOGLEVEL_ONLY
;
+ case LTTNG_UST_LOGLEVEL_
SINGLE
:
+ tmp[i].
loglevel_type = LTTNG_EVENT_LOGLEVEL_SINGLE
;
break;
}
i++;
break;
}
i++;
@@
-3469,11
+3477,7
@@
static int process_client_msg(struct command_ctx *cmd_ctx)
session_lock_list();
nr_sessions = lttng_sessions_count(cmd_ctx->creds.uid, cmd_ctx->creds.gid);
session_lock_list();
nr_sessions = lttng_sessions_count(cmd_ctx->creds.uid, cmd_ctx->creds.gid);
- if (nr_sessions == 0) {
- ret = LTTCOMM_NO_SESSION;
- session_unlock_list();
- goto error;
- }
+
ret = setup_lttng_msg(cmd_ctx, sizeof(struct lttng_session) * nr_sessions);
if (ret < 0) {
session_unlock_list();
ret = setup_lttng_msg(cmd_ctx, sizeof(struct lttng_session) * nr_sessions);
if (ret < 0) {
session_unlock_list();
@@
-3897,24
+3901,19
@@
end:
*/
static int check_existing_daemon(void)
{
*/
static int check_existing_daemon(void)
{
- if (access(client_unix_sock_path, F_OK) < 0 &&
- access(apps_unix_sock_path, F_OK) < 0) {
- return 0;
- }
-
/* Is there anybody out there ? */
if (lttng_session_daemon_alive()) {
return -EEXIST;
/* Is there anybody out there ? */
if (lttng_session_daemon_alive()) {
return -EEXIST;
- } else {
- return 0;
}
}
+
+ return 0;
}
/*
* Set the tracing group gid onto the client socket.
*
* Race window between mkdir and chown is OK because we are going from more
}
/*
* Set the tracing group gid onto the client socket.
*
* Race window between mkdir and chown is OK because we are going from more
- * permissive (root.root) to les permissive (root.tracing).
+ * permissive (root.root) to les
s
permissive (root.tracing).
*/
static int set_permissions(char *rundir)
{
*/
static int set_permissions(char *rundir)
{
@@
-3935,6
+3934,13
@@
static int set_permissions(char *rundir)
perror("chown");
}
perror("chown");
}
+ /* Ensure tracing group can search the run dir */
+ ret = chmod(rundir, S_IRWXU | S_IXGRP);
+ if (ret < 0) {
+ ERR("Unable to set permissions on %s", rundir);
+ perror("chmod");
+ }
+
/* lttng client socket path */
ret = chown(client_unix_sock_path, 0, gid);
if (ret < 0) {
/* lttng client socket path */
ret = chown(client_unix_sock_path, 0, gid);
if (ret < 0) {
@@
-3994,7
+4000,7
@@
static int create_lttng_rundir(const char *rundir)
DBG3("Creating LTTng run directory: %s", rundir);
DBG3("Creating LTTng run directory: %s", rundir);
- ret = mkdir(rundir, S_IRWXU
| S_IRWXG
);
+ ret = mkdir(rundir, S_IRWXU);
if (ret < 0) {
if (errno != EEXIST) {
ERR("Unable to create %s", rundir);
if (ret < 0) {
if (errno != EEXIST) {
ERR("Unable to create %s", rundir);
@@
-4036,7
+4042,7
@@
static int set_consumer_sockets(struct consumer_data *consumer_data,
DBG2("Creating consumer directory: %s", path);
DBG2("Creating consumer directory: %s", path);
- ret = mkdir(path, S_IRWXU
| S_IRWXG
);
+ ret = mkdir(path, S_IRWXU);
if (ret < 0) {
if (errno != EEXIST) {
ERR("Failed to create %s", path);
if (ret < 0) {
if (errno != EEXIST) {
ERR("Failed to create %s", path);
This page took
0.027571 seconds
and
4
git commands to generate.