Update to SPDX v3.0 identifiers
[lttng-modules.git] / lttng-ring-buffer-client.h
index 8b87db0d4ca47e3d7e0b696db0002efb30b59a34..f11c606b4eb07a5e24da081df8dda718278419d0 100644 (file)
@@ -1,23 +1,10 @@
-/*
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
  * lttng-ring-buffer-client.h
  *
  * LTTng lib ring buffer client template.
  *
  * 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
  */
 
 #include <linux/module.h>
@@ -492,9 +479,10 @@ static int client_stream_id(const struct lib_ring_buffer_config *config,
                        struct lib_ring_buffer *buf,
                        uint64_t *stream_id)
 {
-       struct packet_header *header = client_packet_header(config, buf);
-       *stream_id = header->stream_id;
+       struct channel *chan = buf->backend.chan;
+       struct lttng_channel *lttng_chan = channel_get_private(chan);
 
+       *stream_id = lttng_chan->id;
        return 0;
 }
 
@@ -523,8 +511,7 @@ int client_instance_id(const struct lib_ring_buffer_config *config,
                struct lib_ring_buffer *buf,
                uint64_t *id)
 {
-       struct packet_header *header = client_packet_header(config, buf);
-       *id = header->stream_instance_id;
+       *id = buf->backend.cpu;
 
        return 0;
 }
@@ -636,15 +623,15 @@ int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx,
        struct lttng_client_ctx client_ctx;
        int ret, cpu;
 
-       /* Compute internal size of context structures. */
-       ctx_get_struct_size(lttng_chan->ctx, &client_ctx.packet_context_len, lttng_chan, ctx);
-       ctx_get_struct_size(event->ctx, &client_ctx.event_context_len, lttng_chan, ctx);
-
        cpu = lib_ring_buffer_get_cpu(&client_config);
        if (unlikely(cpu < 0))
                return -EPERM;
        ctx->cpu = cpu;
 
+       /* Compute internal size of context structures. */
+       ctx_get_struct_size(lttng_chan->ctx, &client_ctx.packet_context_len, lttng_chan, ctx);
+       ctx_get_struct_size(event->ctx, &client_ctx.event_context_len, lttng_chan, ctx);
+
        switch (lttng_chan->header_type) {
        case 1: /* compact */
                if (event_id > 30)
@@ -794,6 +781,10 @@ static void __exit lttng_ring_buffer_client_exit(void)
 module_exit(lttng_ring_buffer_client_exit);
 
 MODULE_LICENSE("GPL and additional rights");
-MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
 MODULE_DESCRIPTION("LTTng ring buffer " RING_BUFFER_MODE_TEMPLATE_STRING
                   " client");
+MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "."
+       __stringify(LTTNG_MODULES_MINOR_VERSION) "."
+       __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)
+       LTTNG_MODULES_EXTRAVERSION);
This page took 0.024697 seconds and 4 git commands to generate.