projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: define _LGPL_SOURCE in C files
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index d882b074d54cd4f0348365ab4adb218ce263c48b..41b8502cfee8aeaab2c46e97d0b18a21e43bbdb1 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-16,6
+16,7
@@
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <inttypes.h>
#include <urcu/list.h>
#include <assert.h>
#include <inttypes.h>
#include <urcu/list.h>
@@
-1848,7
+1849,9
@@
int cmd_start_trace(struct ltt_session *session)
* possible to enable channel thus inform the client.
*/
if (usess && usess->domain_global.channels) {
* possible to enable channel thus inform the client.
*/
if (usess && usess->domain_global.channels) {
+ rcu_read_lock();
nb_chan += lttng_ht_get_count(usess->domain_global.channels);
nb_chan += lttng_ht_get_count(usess->domain_global.channels);
+ rcu_read_unlock();
}
if (ksession) {
nb_chan += ksession->channel_count;
}
if (ksession) {
nb_chan += ksession->channel_count;
@@
-2388,6
+2391,10
@@
ssize_t cmd_list_domains(struct ltt_session *session,
}
}
}
}
+ if (!nb_dom) {
+ goto end;
+ }
+
*domains = zmalloc(nb_dom * sizeof(struct lttng_domain));
if (*domains == NULL) {
ret = LTTNG_ERR_FATAL;
*domains = zmalloc(nb_dom * sizeof(struct lttng_domain));
if (*domains == NULL) {
ret = LTTNG_ERR_FATAL;
@@
-2413,7
+2420,7
@@
ssize_t cmd_list_domains(struct ltt_session *session,
}
}
}
}
}
}
-
+end:
return nb_dom;
error:
return nb_dom;
error:
@@
-2447,12
+2454,12
@@
ssize_t cmd_list_channels(int domain, struct ltt_session *session,
session->ust_session->domain_global.channels);
}
DBG3("Number of UST global channels %zd", nb_chan);
session->ust_session->domain_global.channels);
}
DBG3("Number of UST global channels %zd", nb_chan);
- if (nb_chan <
=
0) {
+ if (nb_chan < 0) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
+ goto error;
}
break;
default:
}
break;
default:
- *channels = NULL;
ret = LTTNG_ERR_UND;
goto error;
}
ret = LTTNG_ERR_UND;
goto error;
}
@@
-2465,10
+2472,6
@@
ssize_t cmd_list_channels(int domain, struct ltt_session *session,
}
list_lttng_channels(domain, session, *channels);
}
list_lttng_channels(domain, session, *channels);
- } else {
- *channels = NULL;
- /* Ret value was set in the domain switch case */
- goto error;
}
return nb_chan;
}
return nb_chan;
This page took
0.025804 seconds
and
5
git commands to generate.