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 destroy the sockets if the snapshot was successful
[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 9d742536852b4880f30d7245f71d32567a94bc5e..16f4849bc7c7a4b888ee0e788c42c7443b8a0bda 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-51,6
+51,7
@@
#include "buffer-registry.h"
#include "notification-thread.h"
#include "notification-thread-commands.h"
#include "buffer-registry.h"
#include "notification-thread.h"
#include "notification-thread-commands.h"
+#include "agent-thread.h"
#include "cmd.h"
#include "cmd.h"
@@
-1380,9
+1381,15
@@
int cmd_enable_channel(struct ltt_session *session,
break;
}
case LTTNG_DOMAIN_UST:
break;
}
case LTTNG_DOMAIN_UST:
+ break;
case LTTNG_DOMAIN_JUL:
case LTTNG_DOMAIN_LOG4J:
case LTTNG_DOMAIN_PYTHON:
case LTTNG_DOMAIN_JUL:
case LTTNG_DOMAIN_LOG4J:
case LTTNG_DOMAIN_PYTHON:
+ if (!agent_tracing_is_enabled()) {
+ DBG("Attempted to enable a channel in an agent domain but the agent thread is not running");
+ ret = LTTNG_ERR_AGENT_TRACING_DISABLED;
+ goto error;
+ }
break;
default:
ret = LTTNG_ERR_UNKNOWN_DOMAIN;
break;
default:
ret = LTTNG_ERR_UNKNOWN_DOMAIN;
@@
-2090,6
+2097,12
@@
static int _cmd_enable_event(struct ltt_session *session,
assert(usess);
assert(usess);
+ if (!agent_tracing_is_enabled()) {
+ DBG("Attempted to enable an event in an agent domain but the agent thread is not running");
+ ret = LTTNG_ERR_AGENT_TRACING_DISABLED;
+ goto error;
+ }
+
agt = trace_ust_find_agent(usess, domain->type);
if (!agt) {
agt = agent_create(domain->type);
agt = trace_ust_find_agent(usess, domain->type);
if (!agt) {
agt = agent_create(domain->type);
@@
-3420,10
+3433,12
@@
static
int clear_metadata_file(int fd)
{
int ret;
int clear_metadata_file(int fd)
{
int ret;
+ off_t lseek_ret;
- ret = lseek(fd, 0, SEEK_SET);
- if (ret < 0) {
+
lseek_
ret = lseek(fd, 0, SEEK_SET);
+ if (
lseek_
ret < 0) {
PERROR("lseek");
PERROR("lseek");
+ ret = -1;
goto end;
}
goto end;
}
@@
-3831,11
+3846,13
@@
static int record_ust_snapshot(struct ltt_ust_session *usess,
}
ret = LTTNG_OK;
}
ret = LTTNG_OK;
+ goto end;
error_snapshot:
/* Clean up copied sockets so this output can use some other later on. */
consumer_destroy_output_sockets(output->consumer);
error:
error_snapshot:
/* Clean up copied sockets so this output can use some other later on. */
consumer_destroy_output_sockets(output->consumer);
error:
+end:
return ret;
}
return ret;
}
This page took
0.0267 seconds
and
4
git commands to generate.