X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flttng-ring-buffer-metadata-client.h;h=86ec78f16abf7af75bc0ed9a3fae5ce66f64766b;hb=0e41488f1d347fe2f4988acc4b7c63ee02fe4026;hp=bd2ca4753b2e4c5b9f4f6a2d46bf375f500af536;hpb=f5ffbd770ec2b9d1ac9b7059eb33a01432043bce;p=lttng-modules.git diff --git a/src/lttng-ring-buffer-metadata-client.h b/src/lttng-ring-buffer-metadata-client.h index bd2ca475..86ec78f1 100644 --- a/src/lttng-ring-buffer-metadata-client.h +++ b/src/lttng-ring-buffer-metadata-client.h @@ -110,7 +110,8 @@ static void client_buffer_begin(struct lttng_kernel_ring_buffer *buf, u64 tsc, * subbuffer. data_size is between 1 and subbuf_size. */ static void client_buffer_end(struct lttng_kernel_ring_buffer *buf, u64 tsc, - unsigned int subbuf_idx, unsigned long data_size) + unsigned int subbuf_idx, unsigned long data_size, + const struct lttng_kernel_ring_buffer_ctx *ctx) { struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; struct metadata_packet_header *header = @@ -125,9 +126,9 @@ static void client_buffer_end(struct lttng_kernel_ring_buffer *buf, u64 tsc, * We do not care about the records lost count, because the metadata * channel waits and retry. */ - (void) lib_ring_buffer_get_records_lost_full(&client_config, buf); - records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf); - records_lost += lib_ring_buffer_get_records_lost_big(&client_config, buf); + (void) lib_ring_buffer_get_records_lost_full(&client_config, ctx); + records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, ctx); + records_lost += lib_ring_buffer_get_records_lost_big(&client_config, ctx); WARN_ON_ONCE(records_lost != 0); } @@ -354,6 +355,13 @@ void lttng_event_strcpy(struct lttng_kernel_ring_buffer_ctx *ctx, const char *sr lib_ring_buffer_strcpy(&client_config, ctx, src, len, '#'); } +static +void lttng_event_pstrcpy_pad(struct lttng_kernel_ring_buffer_ctx *ctx, const char *src, + size_t len) +{ + lib_ring_buffer_pstrcpy(&client_config, ctx, src, len, '\0'); +} + static size_t lttng_packet_avail_size(struct lttng_kernel_ring_buffer_channel *chan) { @@ -429,6 +437,7 @@ static struct lttng_transport lttng_relay_transport = { .event_memset = lttng_event_memset, .event_write = lttng_event_write, .event_strcpy = lttng_event_strcpy, + .event_pstrcpy_pad = lttng_event_pstrcpy_pad, }, };