projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: don't stop a session that was not previously started
[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 5d2cba1d467befbde02cfcc44183304303259421..9b7306b794668b0b75831306a0a3eeacc9f20625 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-754,7
+754,7
@@
static int start_kernel_session(struct ltt_kernel_session *ksess, int wpipe)
/* Setup kernel consumer socket and send fds to it */
ret = init_kernel_tracing(ksess);
/* Setup kernel consumer socket and send fds to it */
ret = init_kernel_tracing(ksess);
- if (ret
<
0) {
+ if (ret
!=
0) {
ret = LTTNG_ERR_KERN_START_FAIL;
goto error;
}
ret = LTTNG_ERR_KERN_START_FAIL;
goto error;
}
@@
-1106,7
+1106,7
@@
int cmd_add_context(struct ltt_session *session, int domain,
if (chan_count == 0) {
struct lttng_channel *attr;
/* Create default channel */
if (chan_count == 0) {
struct lttng_channel *attr;
/* Create default channel */
- attr = channel_new_default_attr(domain);
+ attr = channel_new_default_attr(domain
, usess->buffer_type
);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1166,7
+1166,8
@@
int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
kchan = trace_kernel_get_channel_by_name(channel_name,
session->kernel_session);
if (kchan == NULL) {
kchan = trace_kernel_get_channel_by_name(channel_name,
session->kernel_session);
if (kchan == NULL) {
- attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1216,7
+1217,8
@@
int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
channel_name);
if (uchan == NULL) {
/* Create default channel */
channel_name);
if (uchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST,
+ usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1286,7
+1288,8
@@
int cmd_enable_event_all(struct ltt_session *session,
session->kernel_session);
if (kchan == NULL) {
/* Create default channel */
session->kernel_session);
if (kchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1350,7
+1353,8
@@
int cmd_enable_event_all(struct ltt_session *session,
channel_name);
if (uchan == NULL) {
/* Create default channel */
channel_name);
if (uchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST,
+ usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1549,7
+1553,7
@@
int cmd_stop_trace(struct ltt_session *session)
session->enabled = 0;
/* Kernel tracer */
session->enabled = 0;
/* Kernel tracer */
- if (ksession) {
+ if (ksession
&& ksession->started
) {
DBG("Stop kernel tracing");
/* Flush metadata if exist */
DBG("Stop kernel tracing");
/* Flush metadata if exist */
@@
-1579,7
+1583,7
@@
int cmd_stop_trace(struct ltt_session *session)
ksession->started = 0;
}
ksession->started = 0;
}
- if (usess) {
+ if (usess
&& usess->start_trace
) {
usess->start_trace = 0;
ret = ust_app_stop_trace_all(usess);
usess->start_trace = 0;
ret = ust_app_stop_trace_all(usess);
@@
-1827,7
+1831,7
@@
int cmd_register_consumer(struct ltt_session *session, int domain,
const char *sock_path, struct consumer_data *cdata)
{
int ret, sock;
const char *sock_path, struct consumer_data *cdata)
{
int ret, sock;
- struct consumer_socket *socket;
+ struct consumer_socket *socket
= NULL
;
assert(session);
assert(cdata);
assert(session);
assert(cdata);
@@
-1887,9
+1891,12
@@
int cmd_register_consumer(struct ltt_session *session, int domain,
goto error;
}
goto error;
}
- ret
=
LTTNG_OK;
+ ret
urn
LTTNG_OK;
error:
error:
+ if (socket) {
+ consumer_destroy_socket(socket);
+ }
return ret;
}
return ret;
}
This page took
0.026074 seconds
and
4
git commands to generate.