projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.lttng.org/lttng-tools
[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 9a5775b8ed3bff1bf996dc244516b1dce2685257..8dec2d78366af35793e56797c0db537fcfd6bc6a 100644
(file)
--- a/
src/common/ust-consumer/ust-consumer.c
+++ b/
src/common/ust-consumer/ust-consumer.c
@@
-19,7
+19,6
@@
#define _GNU_SOURCE
#include <assert.h>
#define _GNU_SOURCE
#include <assert.h>
-#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <stdlib.h>
#include <poll.h>
#include <pthread.h>
#include <stdlib.h>
@@
-44,9
+43,9
@@
extern volatile int consumer_quit;
/*
* Mmap the ring buffer, read it and write the data to the tracefile.
*
/*
* Mmap the ring buffer, read it and write the data to the tracefile.
*
- * Returns the number of bytes written
+ * Returns the number of bytes written
, else negative value on error.
*/
*/
-
in
t lttng_ustconsumer_on_read_subbuffer_mmap(
+
ssize_
t lttng_ustconsumer_on_read_subbuffer_mmap(
struct lttng_consumer_local_data *ctx,
struct lttng_consumer_stream *stream, unsigned long len)
{
struct lttng_consumer_local_data *ctx,
struct lttng_consumer_stream *stream, unsigned long len)
{
@@
-59,8
+58,8
@@
int lttng_ustconsumer_on_read_subbuffer_mmap(
ret = ustctl_get_mmap_read_offset(stream->chan->handle,
stream->buf, &mmap_offset);
if (ret != 0) {
ret = ustctl_get_mmap_read_offset(stream->chan->handle,
stream->buf, &mmap_offset);
if (ret != 0) {
-
ret = -errno
;
-
perror
("ustctl_get_mmap_read_offset");
+
errno = -ret
;
+
PERROR
("ustctl_get_mmap_read_offset");
goto end;
}
while (len > 0) {
goto end;
}
while (len > 0) {
@@
-68,8
+67,8
@@
int lttng_ustconsumer_on_read_subbuffer_mmap(
if (ret >= len) {
len = 0;
} else if (ret < 0) {
if (ret >= len) {
len = 0;
} else if (ret < 0) {
-
ret = -errno
;
-
perror
("Error in file write");
+
errno = -ret
;
+
PERROR
("Error in file write");
goto end;
}
/* This won't block, but will start writeout asynchronously */
goto end;
}
/* This won't block, but will start writeout asynchronously */
@@
-91,7
+90,7
@@
end:
*
* Returns the number of bytes spliced.
*/
*
* Returns the number of bytes spliced.
*/
-
in
t lttng_ustconsumer_on_read_subbuffer_splice(
+
ssize_
t lttng_ustconsumer_on_read_subbuffer_splice(
struct lttng_consumer_local_data *ctx,
struct lttng_consumer_stream *stream, unsigned long len)
{
struct lttng_consumer_local_data *ctx,
struct lttng_consumer_stream *stream, unsigned long len)
{
@@
-110,8
+109,8
@@
int lttng_ustconsumer_take_snapshot(struct lttng_consumer_local_data *ctx,
ret = ustctl_snapshot(stream->chan->handle, stream->buf);
if (ret != 0) {
ret = ustctl_snapshot(stream->chan->handle, stream->buf);
if (ret != 0) {
-
ret = errno
;
-
perror
("Getting sub-buffer snapshot.");
+
errno = -ret
;
+
PERROR
("Getting sub-buffer snapshot.");
}
return ret;
}
return ret;
@@
-132,8
+131,8
@@
int lttng_ustconsumer_get_produced_snapshot(
ret = ustctl_snapshot_get_produced(stream->chan->handle,
stream->buf, pos);
if (ret != 0) {
ret = ustctl_snapshot_get_produced(stream->chan->handle,
stream->buf, pos);
if (ret != 0) {
-
ret = errno
;
-
perror
("kernctl_snapshot_get_produced");
+
errno = -ret
;
+
PERROR
("kernctl_snapshot_get_produced");
}
return ret;
}
return ret;
@@
-262,7
+261,7
@@
end:
/* signal the poll thread */
ret = write(ctx->consumer_poll_pipe[1], "4", 1);
if (ret < 0) {
/* signal the poll thread */
ret = write(ctx->consumer_poll_pipe[1], "4", 1);
if (ret < 0) {
-
perror
("write consumer poll");
+
PERROR
("write consumer poll");
}
end_nosignal:
return 0;
}
end_nosignal:
return 0;
@@
-348,7
+347,7
@@
int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
if (!stream->hangup_flush_done) {
do {
readlen = read(stream->wait_fd, &dummy, 1);
if (!stream->hangup_flush_done) {
do {
readlen = read(stream->wait_fd, &dummy, 1);
- } while (readlen == -1 && errno ==
-
EINTR);
+ } while (readlen == -1 && errno == EINTR);
if (readlen == -1) {
ret = readlen;
goto end;
if (readlen == -1) {
ret = readlen;
goto end;
@@
-402,7
+401,7
@@
int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
stream->uid, stream->gid);
if (ret < 0) {
ERR("Opening %s", stream->path_name);
stream->uid, stream->gid);
if (ret < 0) {
ERR("Opening %s", stream->path_name);
-
perror
("open");
+
PERROR
("open");
goto error;
}
stream->out_fd = ret;
goto error;
}
stream->out_fd = ret;
This page took
0.025403 seconds
and
4
git commands to generate.