projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Missing rcu_read_lock in cmd_list_events()
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
save.c
diff --git
a/src/bin/lttng-sessiond/save.c
b/src/bin/lttng-sessiond/save.c
index d268f33190698d6f9bd920a5bbdbab140a377d70..c6fc33e7bb83c5b02b6fdc7c4c8b38517d5f9aea 100644
(file)
--- a/
src/bin/lttng-sessiond/save.c
+++ b/
src/bin/lttng-sessiond/save.c
@@
-16,6
+16,7
@@
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <inttypes.h>
#include <string.h>
@@
-801,6
+802,11
@@
int save_kernel_contexts(struct config_writer *writer,
int ret;
struct ltt_kernel_context *ctx;
int ret;
struct ltt_kernel_context *ctx;
+ if (cds_list_empty(&kchan->ctx_list)) {
+ ret = 0;
+ goto end;
+ }
+
ret = config_writer_open_element(writer, config_element_contexts);
if (ret) {
ret = LTTNG_ERR_SAVE_IO_FAIL;
ret = config_writer_open_element(writer, config_element_contexts);
if (ret) {
ret = LTTNG_ERR_SAVE_IO_FAIL;
@@
-1156,7
+1162,8
@@
int save_ust_session(struct config_writer *writer,
ust_chan = caa_container_of(node, struct ltt_ust_channel, node);
agent_channel = !strcmp(DEFAULT_JUL_CHANNEL_NAME, ust_chan->name) ||
ust_chan = caa_container_of(node, struct ltt_ust_channel, node);
agent_channel = !strcmp(DEFAULT_JUL_CHANNEL_NAME, ust_chan->name) ||
- !strcmp(DEFAULT_LOG4J_CHANNEL_NAME, ust_chan->name);
+ !strcmp(DEFAULT_LOG4J_CHANNEL_NAME, ust_chan->name) ||
+ !strcmp(DEFAULT_PYTHON_CHANNEL_NAME, ust_chan->name);
if (!(save_agent ^ agent_channel)) {
ret = save_ust_channel(writer, ust_chan, session->ust_session);
if (ret) {
if (!(save_agent ^ agent_channel)) {
ret = save_ust_channel(writer, ust_chan, session->ust_session);
if (ret) {
@@
-1218,6
+1225,8
@@
int save_domains(struct config_writer *writer, struct ltt_session *session)
}
if (session->ust_session) {
}
if (session->ust_session) {
+ unsigned long agent_count;
+
ret = config_writer_open_element(writer,
config_element_domain);
if (ret) {
ret = config_writer_open_element(writer,
config_element_domain);
if (ret) {
@@
-1236,30
+1245,37
@@
int save_domains(struct config_writer *writer, struct ltt_session *session)
ret = LTTNG_ERR_SAVE_IO_FAIL;
goto end;
}
ret = LTTNG_ERR_SAVE_IO_FAIL;
goto end;
}
- }
- if (session->ust_session &&
- lttng_ht_get_count(session->ust_session->agents) > 0) {
- ret = config_writer_open_element(writer,
- config_element_domain);
- if (ret) {
- ret = LTTNG_ERR_SAVE_IO_FAIL;
- goto end;
- }
+ rcu_read_lock();
+ agent_count =
+ lttng_ht_get_count(session->ust_session->agents);
+ rcu_read_unlock();
- ret = save_ust_session(writer, session, 1);
- if (ret) {
- goto end;
- }
+ if (agent_count > 0) {
+ ret = config_writer_open_element(writer,
+ config_element_domain);
+ if (ret) {
+ ret = LTTNG_ERR_SAVE_IO_FAIL;
+ goto end;
+ }
- /* /domain */
- ret = config_writer_close_element(writer);
- if (ret) {
- ret = LTTNG_ERR_SAVE_IO_FAIL;
- goto end;
+ ret = save_ust_session(writer, session, 1);
+ if (ret) {
+ goto end;
+ }
+
+ /* /domain */
+ ret = config_writer_close_element(writer);
+ if (ret) {
+ ret = LTTNG_ERR_SAVE_IO_FAIL;
+ goto end;
+ }
}
}
}
}
+ if (session->ust_session) {
+ }
+
/* /domains */
ret = config_writer_close_element(writer);
if (ret) {
/* /domains */
ret = config_writer_close_element(writer);
if (ret) {
This page took
0.025434 seconds
and
4
git commands to generate.