projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: implement EXECUTE_ERROR_QUERY command
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
session.c
diff --git
a/src/bin/lttng-sessiond/session.c
b/src/bin/lttng-sessiond/session.c
index c3a65aafbfa6b44e327b32b165e155200afcdfbb..bb3b63b3a31dc407d7dde1ba3c9680e74e221925 100644
(file)
--- a/
src/bin/lttng-sessiond/session.c
+++ b/
src/bin/lttng-sessiond/session.c
@@
-471,7
+471,7
@@
int _session_set_trace_chunk_no_lock_check(struct ltt_session *session,
CONSUMER_DST_LOCAL;
session->ust_session->current_trace_chunk = new_trace_chunk;
CONSUMER_DST_LOCAL;
session->ust_session->current_trace_chunk = new_trace_chunk;
-
if (is_local_trace) {
+ if (is_local_trace) {
enum lttng_error_code ret_error_code;
ret_error_code = ust_app_create_channel_subdirectories(
enum lttng_error_code ret_error_code;
ret_error_code = ust_app_create_channel_subdirectories(
@@
-479,7
+479,7
@@
int _session_set_trace_chunk_no_lock_check(struct ltt_session *session,
if (ret_error_code != LTTNG_OK) {
goto error;
}
if (ret_error_code != LTTNG_OK) {
goto error;
}
-
}
+ }
cds_lfht_for_each_entry(
session->ust_session->consumer->socks->ht,
&iter, socket, node.node) {
cds_lfht_for_each_entry(
session->ust_session->consumer->socks->ht,
&iter, socket, node.node) {
@@
-489,11
+489,11
@@
int _session_set_trace_chunk_no_lock_check(struct ltt_session *session,
session->id, new_trace_chunk,
DEFAULT_UST_TRACE_DIR);
pthread_mutex_unlock(socket->lock);
session->id, new_trace_chunk,
DEFAULT_UST_TRACE_DIR);
pthread_mutex_unlock(socket->lock);
-
if (ret) {
+ if (ret) {
goto error;
goto error;
-
}
-
}
-
}
+ }
+ }
+ }
if (session->kernel_session) {
const uint64_t relayd_id =
session->kernel_session->consumer->net_seq_index;
if (session->kernel_session) {
const uint64_t relayd_id =
session->kernel_session->consumer->net_seq_index;
@@
-510,7
+510,7
@@
int _session_set_trace_chunk_no_lock_check(struct ltt_session *session,
if (ret_error_code != LTTNG_OK) {
goto error;
}
if (ret_error_code != LTTNG_OK) {
goto error;
}
-
}
+ }
cds_lfht_for_each_entry(
session->kernel_session->consumer->socks->ht,
&iter, socket, node.node) {
cds_lfht_for_each_entry(
session->kernel_session->consumer->socks->ht,
&iter, socket, node.node) {
@@
-520,11
+520,11
@@
int _session_set_trace_chunk_no_lock_check(struct ltt_session *session,
session->id, new_trace_chunk,
DEFAULT_KERNEL_TRACE_DIR);
pthread_mutex_unlock(socket->lock);
session->id, new_trace_chunk,
DEFAULT_KERNEL_TRACE_DIR);
pthread_mutex_unlock(socket->lock);
-
if (ret) {
+ if (ret) {
goto error;
goto error;
-
}
-
}
-
}
+ }
+ }
+ }
/*
* Update local current trace chunk state last, only if all remote
/*
* Update local current trace chunk state last, only if all remote
@@
-548,7
+548,7
@@
error:
if (session->kernel_session) {
session->kernel_session->current_trace_chunk = NULL;
}
if (session->kernel_session) {
session->kernel_session->current_trace_chunk = NULL;
}
-
/*
+ /*
* Release references taken in the case where all references could not
* be acquired.
*/
* Release references taken in the case where all references could not
* be acquired.
*/
@@
-574,8
+574,8
@@
struct lttng_trace_chunk *session_create_new_trace_chunk(
const char *base_path;
struct lttng_directory_handle *session_output_directory = NULL;
const struct lttng_credentials session_credentials = {
const char *base_path;
struct lttng_directory_handle *session_output_directory = NULL;
const struct lttng_credentials session_credentials = {
- .uid =
session->uid
,
- .gid =
session->gid
,
+ .uid =
LTTNG_OPTIONAL_INIT_VALUE(session->uid)
,
+ .gid =
LTTNG_OPTIONAL_INIT_VALUE(session->gid)
,
};
uint64_t next_chunk_id;
const struct consumer_output *output;
};
uint64_t next_chunk_id;
const struct consumer_output *output;
@@
-932,7
+932,7
@@
void session_release(struct urcu_ref *ref)
usess = session->ust_session;
ksess = session->kernel_session;
usess = session->ust_session;
ksess = session->kernel_session;
-
/* Clean kernel session teardown, keeping data for destroy notifier. */
+ /* Clean kernel session teardown, keeping data for destroy notifier. */
kernel_destroy_session(ksess);
/* UST session teardown, keeping data for destroy notifier. */
kernel_destroy_session(ksess);
/* UST session teardown, keeping data for destroy notifier. */
@@
-954,7
+954,7
@@
void session_release(struct urcu_ref *ref)
* Must notify the kernel thread here to update it's poll set in order to
* remove the channel(s)' fd just destroyed.
*/
* Must notify the kernel thread here to update it's poll set in order to
* remove the channel(s)' fd just destroyed.
*/
- ret = notify_thread_pipe(kernel_poll_pipe[1]);
+ ret = notify_thread_pipe(
the_
kernel_poll_pipe[1]);
if (ret < 0) {
PERROR("write kernel poll pipe");
}
if (ret < 0) {
PERROR("write kernel poll pipe");
}
@@
-989,6
+989,7
@@
void session_release(struct urcu_ref *ref)
* Broadcast after free-ing to ensure the memory is
* reclaimed before the main thread exits.
*/
* Broadcast after free-ing to ensure the memory is
* reclaimed before the main thread exits.
*/
+ ASSERT_LOCKED(ltt_session_list.lock);
pthread_cond_broadcast(<t_session_list.removal_cond);
}
}
pthread_cond_broadcast(<t_session_list.removal_cond);
}
}
@@
-1296,18
+1297,13
@@
error:
}
/*
}
/*
- * Check if the UID
or GID match
the session. Root user has access to all
+ * Check if the UID
matches
the session. Root user has access to all
* sessions.
*/
* sessions.
*/
-
int session_access_ok(struct ltt_session *session, uid_t uid, gid_t g
id)
+
bool session_access_ok(struct ltt_session *session, uid_t u
id)
{
assert(session);
{
assert(session);
-
- if (uid != session->uid && gid != session->gid && uid != 0) {
- return 0;
- } else {
- return 1;
- }
+ return (uid == session->uid) || uid == 0;
}
/*
}
/*
This page took
0.026481 seconds
and
4
git commands to generate.