Docs: relayd: document the lifetime of viewer session trace chunks
[lttng-tools.git] / src / bin / lttng-relayd / ctf-trace.c
index fdd0a5d0d9d6d52c9075df7deb5867cf03d50c1b..f2af1a3d0fb17229e2939e5e294deeae3ecc443b 100644 (file)
@@ -1,24 +1,13 @@
 /*
- * Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
- *                      David Goulet <dgoulet@efficios.com>
- *               2015 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
+ * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License, version 2 only, as
- * published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program 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 General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #define _LGPL_SOURCE
-#include <assert.h>
 
 #include <common/common.h>
 #include <common/utils.h>
@@ -44,14 +33,14 @@ static void rcu_destroy_ctf_trace(struct rcu_head *rcu_head)
  *
  * MUST be called with the RCU read side lock.
  */
-void ctf_trace_destroy(struct ctf_trace *trace)
+static void ctf_trace_destroy(struct ctf_trace *trace)
 {
        /*
         * Getting to this point, every stream referenced by that trace
         * have put back their ref since the've been closed by the
         * control side.
         */
-       assert(cds_list_empty(&trace->stream_list));
+       LTTNG_ASSERT(cds_list_empty(&trace->stream_list));
        session_put(trace->session);
        trace->session = NULL;
        free(trace->path);
@@ -59,7 +48,7 @@ void ctf_trace_destroy(struct ctf_trace *trace)
        call_rcu(&trace->rcu_node, rcu_destroy_ctf_trace);
 }
 
-void ctf_trace_release(struct urcu_ref *ref)
+static void ctf_trace_release(struct urcu_ref *ref)
 {
        struct ctf_trace *trace =
                caa_container_of(ref, struct ctf_trace, ref);
@@ -68,7 +57,7 @@ void ctf_trace_release(struct urcu_ref *ref)
 
        iter.iter.node = &trace->node.node;
        ret = lttng_ht_del(trace->session->ctf_traces_ht, &iter);
-       assert(!ret);
+       LTTNG_ASSERT(!ret);
        ctf_trace_destroy(trace);
 }
 
This page took 0.026417 seconds and 4 git commands to generate.