Move to kernel style SPDX license identifiers
[lttng-ust.git] / liblttng-ust / lttng-ring-buffer-client.h
index ab472352f96898625db0662b9399e5762088d897..579f650dbb4b3e9666668bc2069e8e05f0e331d8 100644 (file)
@@ -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 <mathieu.desnoyers@efficios.com>
  *
- * 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 <stddef.h>
 #include <stdint.h>
 #include <lttng/ust-events.h>
 #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);
@@ -607,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;
 }
@@ -844,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,
This page took 0.023806 seconds and 4 git commands to generate.