projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Solaris 10 build: use lttng_strnlen() wrapper
[lttng-tools.git]
/
src
/
common
/
consumer
/
consumer.c
diff --git
a/src/common/consumer/consumer.c
b/src/common/consumer/consumer.c
index 7911a5b4e8d4d0701d40e88d3ebdd6841c4061af..7ce294e815397a9da9f641b18f1dee3019b7916f 100644
(file)
--- a/
src/common/consumer/consumer.c
+++ b/
src/common/consumer/consumer.c
@@
-1021,7
+1021,7
@@
struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key,
CDS_INIT_LIST_HEAD(&channel->streams.head);
CDS_INIT_LIST_HEAD(&channel->streams.head);
- DBG("Allocated channel (key %" PRIu64 ")", channel->key)
+ DBG("Allocated channel (key %" PRIu64 ")", channel->key)
;
end:
return channel;
end:
return channel;
@@
-1232,6
+1232,7
@@
void lttng_consumer_should_exit(struct lttng_consumer_local_data *ctx)
void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream,
off_t orig_offset)
{
void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream,
off_t orig_offset)
{
+ int ret;
int outfd = stream->out_fd;
/*
int outfd = stream->out_fd;
/*
@@
-1262,8
+1263,12
@@
void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream,
* defined. So it can be expected to lead to lower throughput in
* streaming.
*/
* defined. So it can be expected to lead to lower throughput in
* streaming.
*/
- posix_fadvise(outfd, orig_offset - stream->max_sb_size,
+
ret =
posix_fadvise(outfd, orig_offset - stream->max_sb_size,
stream->max_sb_size, POSIX_FADV_DONTNEED);
stream->max_sb_size, POSIX_FADV_DONTNEED);
+ if (ret && ret != -ENOSYS) {
+ errno = -ret;
+ PERROR("posix_fadvise");
+ }
}
/*
}
/*
@@
-1556,6
+1561,16
@@
ssize_t lttng_consumer_on_read_subbuffer_mmap(
if (stream->metadata_flag) {
/* Metadata requires the control socket. */
pthread_mutex_lock(&relayd->ctrl_sock_mutex);
if (stream->metadata_flag) {
/* Metadata requires the control socket. */
pthread_mutex_lock(&relayd->ctrl_sock_mutex);
+ if (stream->reset_metadata_flag) {
+ ret = relayd_reset_metadata(&relayd->control_sock,
+ stream->relayd_stream_id,
+ stream->metadata_version);
+ if (ret < 0) {
+ relayd_hang_up = 1;
+ goto write_error;
+ }
+ stream->reset_metadata_flag = 0;
+ }
netlen += sizeof(struct lttcomm_relayd_metadata_payload);
}
netlen += sizeof(struct lttcomm_relayd_metadata_payload);
}
@@
-1579,6
+1594,15
@@
ssize_t lttng_consumer_on_read_subbuffer_mmap(
/* No streaming, we have to set the len with the full padding */
len += padding;
/* No streaming, we have to set the len with the full padding */
len += padding;
+ if (stream->metadata_flag && stream->reset_metadata_flag) {
+ ret = utils_truncate_stream_file(stream->out_fd, 0);
+ if (ret < 0) {
+ ERR("Reset metadata file");
+ goto end;
+ }
+ stream->reset_metadata_flag = 0;
+ }
+
/*
* Check if we need to change the tracefile before writing the packet.
*/
/*
* Check if we need to change the tracefile before writing the packet.
*/
@@
-1744,6
+1768,16
@@
ssize_t lttng_consumer_on_read_subbuffer_splice(
*/
pthread_mutex_lock(&relayd->ctrl_sock_mutex);
*/
pthread_mutex_lock(&relayd->ctrl_sock_mutex);
+ if (stream->reset_metadata_flag) {
+ ret = relayd_reset_metadata(&relayd->control_sock,
+ stream->relayd_stream_id,
+ stream->metadata_version);
+ if (ret < 0) {
+ relayd_hang_up = 1;
+ goto write_error;
+ }
+ stream->reset_metadata_flag = 0;
+ }
ret = write_relayd_metadata_id(splice_pipe[1], stream, relayd,
padding);
if (ret < 0) {
ret = write_relayd_metadata_id(splice_pipe[1], stream, relayd,
padding);
if (ret < 0) {
@@
-1767,6
+1801,14
@@
ssize_t lttng_consumer_on_read_subbuffer_splice(
/* No streaming, we have to set the len with the full padding */
len += padding;
/* No streaming, we have to set the len with the full padding */
len += padding;
+ if (stream->metadata_flag && stream->reset_metadata_flag) {
+ ret = utils_truncate_stream_file(stream->out_fd, 0);
+ if (ret < 0) {
+ ERR("Reset metadata file");
+ goto end;
+ }
+ stream->reset_metadata_flag = 0;
+ }
/*
* Check if we need to change the tracefile before writing the packet.
*/
/*
* Check if we need to change the tracefile before writing the packet.
*/
@@
-2224,10
+2266,10
@@
restart:
DBG("Metadata poll return from wait with %d fd(s)",
LTTNG_POLL_GETNB(&events));
health_poll_exit();
DBG("Metadata poll return from wait with %d fd(s)",
LTTNG_POLL_GETNB(&events));
health_poll_exit();
- DBG("Metadata event ca
tched
in thread");
+ DBG("Metadata event ca
ught
in thread");
if (ret < 0) {
if (errno == EINTR) {
if (ret < 0) {
if (errno == EINTR) {
- ERR("Poll EINTR ca
tched
");
+ ERR("Poll EINTR ca
ught
");
goto restart;
}
if (LTTNG_POLL_GETNB(&events) == 0) {
goto restart;
}
if (LTTNG_POLL_GETNB(&events) == 0) {
@@
-2807,10
+2849,10
@@
restart:
DBG("Channel poll return from wait with %d fd(s)",
LTTNG_POLL_GETNB(&events));
health_poll_exit();
DBG("Channel poll return from wait with %d fd(s)",
LTTNG_POLL_GETNB(&events));
health_poll_exit();
- DBG("Channel event ca
tched
in thread");
+ DBG("Channel event ca
ught
in thread");
if (ret < 0) {
if (errno == EINTR) {
if (ret < 0) {
if (errno == EINTR) {
- ERR("Poll EINTR ca
tched
");
+ ERR("Poll EINTR ca
ught
");
goto restart;
}
if (LTTNG_POLL_GETNB(&events) == 0) {
goto restart;
}
if (LTTNG_POLL_GETNB(&events) == 0) {
This page took
0.026493 seconds
and
4
git commands to generate.