projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
consumerd: cleanup: use buffer view interface for mmap read subbuf
[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 0e24f8c8c73053f58c85439f788049567938b599..d1b04438b0d76956bd74ff2c8ddb2d8acb777418 100644
(file)
--- a/
src/common/ust-consumer/ust-consumer.c
+++ b/
src/common/ust-consumer/ust-consumer.c
@@
-1221,6
+1221,7
@@
static int snapshot_channel(struct lttng_consumer_channel *channel,
ssize_t read_len;
unsigned long len, padded_len;
const char *subbuf_addr;
ssize_t read_len;
unsigned long len, padded_len;
const char *subbuf_addr;
+ struct lttng_buffer_view subbuf_view;
health_code_update();
health_code_update();
@@
-1255,9
+1256,11
@@
static int snapshot_channel(struct lttng_consumer_channel *channel,
goto error_put_subbuf;
}
goto error_put_subbuf;
}
+ subbuf_view = lttng_buffer_view_init(
+ subbuf_addr, 0, padded_len);
read_len = lttng_consumer_on_read_subbuffer_mmap(ctx,
read_len = lttng_consumer_on_read_subbuffer_mmap(ctx,
- stream,
subbuf_addr,
len,
-
padded_len - len,
NULL);
+ stream,
&subbuf_view, padded_len -
len,
+ NULL);
if (use_relayd) {
if (read_len != len) {
ret = -EPERM;
if (use_relayd) {
if (read_len != len) {
ret = -EPERM;
@@
-2791,6
+2794,7
@@
int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
struct ustctl_consumer_stream *ustream;
struct ctf_packet_index index;
const char *subbuf_addr;
struct ustctl_consumer_stream *ustream;
struct ctf_packet_index index;
const char *subbuf_addr;
+ struct lttng_buffer_view subbuf_view;
assert(stream);
assert(stream->ustream);
assert(stream);
assert(stream->ustream);
@@
-2906,9
+2910,11
@@
retry:
goto error_put_subbuf;
}
goto error_put_subbuf;
}
+ subbuf_view = lttng_buffer_view_init(subbuf_addr, 0, len);
+
/* write the subbuffer to the tracefile */
ret = lttng_consumer_on_read_subbuffer_mmap(
/* write the subbuffer to the tracefile */
ret = lttng_consumer_on_read_subbuffer_mmap(
- ctx, stream,
subbuf_addr, subbuf_size
, padding, &index);
+ ctx, stream,
&subbuf_view
, padding, &index);
/*
* The mmap operation should write subbuf_size amount of data when
* network streaming or the full padding (len) size when we are _not_
/*
* The mmap operation should write subbuf_size amount of data when
* network streaming or the full padding (len) size when we are _not_
This page took
0.026405 seconds
and
4
git commands to generate.