X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ring-buffer-client.h;h=579f650dbb4b3e9666668bc2069e8e05f0e331d8;hb=c0c0989ab70574e09b2f7e8b48c2da6af664a849;hp=0fae88787c8b263a93f29b865153f22aff7ca3cf;hpb=b2c5f61a9cb94a79c35167450666e540b3e0fffe;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ring-buffer-client.h b/liblttng-ust/lttng-ring-buffer-client.h index 0fae8878..579f650d 100644 --- a/liblttng-ust/lttng-ring-buffer-client.h +++ b/liblttng-ust/lttng-ring-buffer-client.h @@ -1,25 +1,12 @@ /* - * lttng-ring-buffer-client.h - * - * LTTng lib ring buffer client template. + * SPDX-License-Identifier: LGPL-2.1-only * * Copyright (C) 2010-2012 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * LTTng lib ring buffer client template. */ +#include #include #include #include "lttng/bitfield.h" @@ -473,7 +460,7 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts header->ctx.content_size = (uint64_t) data_size * CHAR_BIT; /* in bits */ header->ctx.packet_size = - (uint64_t) PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */ + (uint64_t) LTTNG_UST_PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */ records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf); @@ -580,12 +567,11 @@ static int client_stream_id(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle, uint64_t *stream_id) { - struct packet_header *header; + struct channel *chan = shmp(handle, buf->backend.chan); + struct lttng_channel *lttng_chan = channel_get_private(chan); + + *stream_id = lttng_chan->id; - header = client_packet_header(buf, handle); - if (!header) - return -1; - *stream_id = header->stream_id; return 0; } @@ -608,6 +594,8 @@ static int client_sequence_number(struct lttng_ust_lib_ring_buffer *buf, struct packet_header *header; header = client_packet_header(buf, handle); + if (!header) + return -1; *seq = header->ctx.packet_seq_num; return 0; } @@ -616,10 +604,8 @@ static int client_instance_id(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle, uint64_t *id) { - struct packet_header *header; + *id = buf->backend.cpu; - header = client_packet_header(buf, handle); - *id = header->stream_instance_id; return 0; } @@ -847,13 +833,10 @@ static struct lttng_transport lttng_relay_transport = { .ops = { .channel_create = _channel_create, .channel_destroy = lttng_channel_destroy, - .u.has_strcpy = 1, .event_reserve = lttng_event_reserve, .event_commit = lttng_event_commit, .event_write = lttng_event_write, .packet_avail_size = NULL, /* Would be racy anyway */ - //.get_reader_wait_queue = lttng_get_reader_wait_queue, - //.get_hp_wait_queue = lttng_get_hp_wait_queue, .is_finalized = lttng_is_finalized, .is_disabled = lttng_is_disabled, .flush_buffer = lttng_flush_buffer,