projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: consumerd: add missing put_subbuf for ust and kernel errors
[lttng-tools.git]
/
src
/
common
/
ust-consumer
/
ust-consumer.c
diff --git
a/src/common/ust-consumer/ust-consumer.c
b/src/common/ust-consumer/ust-consumer.c
index a66f305cd02e433f41bf31d0591c0e545d524a1a..97f0497cb12b14a71da7289c5030b256a8848ebd 100644
(file)
--- a/
src/common/ust-consumer/ust-consumer.c
+++ b/
src/common/ust-consumer/ust-consumer.c
@@
-510,7
+510,7
@@
error_open:
}
/* Try to rmdir all directories under shm_path root. */
if (channel->root_shm_path[0]) {
}
/* Try to rmdir all directories under shm_path root. */
if (channel->root_shm_path[0]) {
- (void) run_as_r
ecursive_rmdir
(channel->root_shm_path,
+ (void) run_as_r
mdir_recursive
(channel->root_shm_path,
channel->uid, channel->gid);
}
free(stream_fds);
channel->uid, channel->gid);
}
free(stream_fds);
@@
-1111,7
+1111,13
@@
static int snapshot_channel(uint64_t key, char *path, uint64_t relayd_id,
}
}
}
}
- ustctl_flush_buffer(stream->ustream, 1);
+ /*
+ * If tracing is active, we want to perform a "full" buffer flush.
+ * Else, if quiescent, it has already been done by the prior stop.
+ */
+ if (!stream->quiescent) {
+ ustctl_flush_buffer(stream->ustream, 0);
+ }
ret = lttng_ustconsumer_take_snapshot(stream);
if (ret < 0) {
ret = lttng_ustconsumer_take_snapshot(stream);
if (ret < 0) {
@@
-2061,7
+2067,7
@@
void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
ustctl_destroy_channel(chan->uchan);
/* Try to rmdir all directories under shm_path root. */
if (chan->root_shm_path[0]) {
ustctl_destroy_channel(chan->uchan);
/* Try to rmdir all directories under shm_path root. */
if (chan->root_shm_path[0]) {
- (void) run_as_r
ecursive_rmdir
(chan->root_shm_path,
+ (void) run_as_r
mdir_recursive
(chan->root_shm_path,
chan->uid, chan->gid);
}
free(chan->stream_fds);
chan->uid, chan->gid);
}
free(chan->stream_fds);
@@
-2267,10
+2273,10
@@
int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
* because we locked the metadata thread.
*/
ret = lttng_ustconsumer_request_metadata(ctx, metadata->chan, 0, 0);
* because we locked the metadata thread.
*/
ret = lttng_ustconsumer_request_metadata(ctx, metadata->chan, 0, 0);
+ pthread_mutex_lock(&metadata->lock);
if (ret < 0) {
goto end;
}
if (ret < 0) {
goto end;
}
- pthread_mutex_lock(&metadata->lock);
ret = commit_one_metadata_packet(metadata);
if (ret <= 0) {
ret = commit_one_metadata_packet(metadata);
if (ret <= 0) {
@@
-2392,8
+2398,8
@@
int update_stream_stats(struct lttng_consumer_stream *stream)
}
if (discarded < stream->last_discarded_events) {
/*
}
if (discarded < stream->last_discarded_events) {
/*
- * Overflow has occured. We assume only one wrap-around
- * has occured.
+ * Overflow has occur
r
ed. We assume only one wrap-around
+ * has occur
r
ed.
*/
stream->chan->discarded_events +=
(1ULL << (CAA_BITS_PER_LONG - 1)) -
*/
stream->chan->discarded_events +=
(1ULL << (CAA_BITS_PER_LONG - 1)) -
@@
-2490,6
+2496,8
@@
retry:
index.offset = htobe64(stream->out_fd_offset);
ret = get_index_values(&index, ustream);
if (ret < 0) {
index.offset = htobe64(stream->out_fd_offset);
ret = get_index_values(&index, ustream);
if (ret < 0) {
+ err = ustctl_put_subbuf(ustream);
+ assert(err == 0);
goto end;
}
goto end;
}
@@
-2497,6
+2505,8
@@
retry:
ret = update_stream_stats(stream);
if (ret < 0) {
PERROR("kernctl_get_events_discarded");
ret = update_stream_stats(stream);
if (ret < 0) {
PERROR("kernctl_get_events_discarded");
+ err = ustctl_put_subbuf(ustream);
+ assert(err == 0);
goto end;
}
} else {
goto end;
}
} else {
@@
-2614,14
+2624,18
@@
int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
stream->tracefile_size_current = 0;
if (!stream->metadata_flag) {
stream->tracefile_size_current = 0;
if (!stream->metadata_flag) {
- ret = index_create_file(stream->chan->pathname,
+ struct lttng_index_file *index_file;
+
+ index_file = lttng_index_file_create(stream->chan->pathname,
stream->name, stream->uid, stream->gid,
stream->chan->tracefile_size,
stream->name, stream->uid, stream->gid,
stream->chan->tracefile_size,
- stream->tracefile_count_current);
- if (ret < 0) {
+ stream->tracefile_count_current,
+ CTF_INDEX_MAJOR, CTF_INDEX_MINOR);
+ if (!index_file) {
goto error;
}
goto error;
}
- stream->index_fd = ret;
+ assert(!stream->index_file);
+ stream->index_file = index_file;
}
}
ret = 0;
}
}
ret = 0;
This page took
0.025398 seconds
and
4
git commands to generate.