projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change malloc to zmalloc in lttng-sessiond code
[lttng-tools.git]
/
lttng-sessiond
/
ust-consumer.c
diff --git
a/lttng-sessiond/ust-consumer.c
b/lttng-sessiond/ust-consumer.c
index b83fcc435f8aaf9ced379aa3fd512572b5aa502f..df569368ae04f2e8faafb1b9ebbfde069fc618aa 100644
(file)
--- a/
lttng-sessiond/ust-consumer.c
+++ b/
lttng-sessiond/ust-consumer.c
@@
-38,7
+38,7
@@
static int send_channel_streams(int sock,
{
int ret, fd;
struct lttcomm_consumer_msg lum;
{
int ret, fd;
struct lttcomm_consumer_msg lum;
- struct ltt_ust_stream *stream;
+ struct ltt_ust_stream *stream
, *tmp
;
DBG("Sending streams of channel %s to UST consumer", uchan->name);
DBG("Sending streams of channel %s to UST consumer", uchan->name);
@@
-65,7
+65,7
@@
static int send_channel_streams(int sock,
goto error;
}
goto error;
}
- cds_list_for_each_entry
(stream
, &uchan->streams.head, list) {
+ cds_list_for_each_entry
_safe(stream, tmp
, &uchan->streams.head, list) {
int fds[2];
if (!stream->obj->shm_fd) {
int fds[2];
if (!stream->obj->shm_fd) {
@@
-75,7
+75,11
@@
static int send_channel_streams(int sock,
lum.u.stream.channel_key = uchan->obj->shm_fd;
lum.u.stream.stream_key = stream->obj->shm_fd;
lum.u.stream.state = LTTNG_CONSUMER_ACTIVE_STREAM;
lum.u.stream.channel_key = uchan->obj->shm_fd;
lum.u.stream.stream_key = stream->obj->shm_fd;
lum.u.stream.state = LTTNG_CONSUMER_ACTIVE_STREAM;
- lum.u.stream.output = uchan->attr.output;
+ /*
+ * FIXME Hack alert! we force MMAP for now. Mixup
+ * between EVENT and UST enums elsewhere.
+ */
+ lum.u.stream.output = DEFAULT_UST_CHANNEL_OUTPUT;
lum.u.stream.mmap_len = stream->obj->memory_map_size;
strncpy(lum.u.stream.path_name, stream->pathname, PATH_MAX - 1);
lum.u.stream.path_name[PATH_MAX - 1] = '\0';
lum.u.stream.mmap_len = stream->obj->memory_map_size;
strncpy(lum.u.stream.path_name, stream->pathname, PATH_MAX - 1);
lum.u.stream.path_name[PATH_MAX - 1] = '\0';
@@
-93,7
+97,18
@@
static int send_channel_streams(int sock,
perror("send consumer stream ancillary data");
goto error;
}
perror("send consumer stream ancillary data");
goto error;
}
+
+ /*
+ * We release the stream object here, as we have passed
+ * it to the consumer.
+ */
+ /* Ensure we don't let the app know (sock = -1). */
+ ustctl_release_object(-1, stream->obj);
+ cds_list_del(&stream->list);
+ free(stream);
}
}
+ /* Ensure we don't let the app know (sock = -1). */
+ ustctl_release_object(-1, uchan->obj);
DBG("consumer channel streams sent");
DBG("consumer channel streams sent");
@@
-161,6
+176,10
@@
int ust_consumer_send_session(int consumer_fd, struct ust_app_session *usess)
perror("send consumer stream");
goto error;
}
perror("send consumer stream");
goto error;
}
+ /* Metadata fds passed to consumer, release them. */
+ /* Ensure we don't let the app know (sock = -1). */
+ ustctl_release_object(-1, usess->metadata->stream_obj);
+ ustctl_release_object(-1, usess->metadata->obj);
}
/* Send each channel fd streams of session */
}
/* Send each channel fd streams of session */
This page took
0.025882 seconds
and
4
git commands to generate.