/*
- * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2013 David Goulet <dgoulet@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 <inttypes.h>
#include <string.h>
#include <urcu/uatomic.h>
int ret;
struct lttng_ht_iter iter;
- assert(snapshot);
- assert(snapshot->output_ht);
- assert(output);
+ LTTNG_ASSERT(snapshot);
+ LTTNG_ASSERT(snapshot->output_ht);
+ LTTNG_ASSERT(output);
iter.iter.node = &output->node.node;
rcu_read_lock();
ret = lttng_ht_del(snapshot->output_ht, &iter);
rcu_read_unlock();
- assert(!ret);
+ LTTNG_ASSERT(!ret);
/*
* This is safe because the ownership of a snapshot object is in a session
* for which the session lock need to be acquired to read and modify it.
void snapshot_add_output(struct snapshot *snapshot,
struct snapshot_output *output)
{
- assert(snapshot);
- assert(snapshot->output_ht);
- assert(output);
+ LTTNG_ASSERT(snapshot);
+ LTTNG_ASSERT(snapshot->output_ht);
+ LTTNG_ASSERT(output);
rcu_read_lock();
lttng_ht_add_unique_ulong(snapshot->output_ht, &output->node);
*/
void snapshot_output_destroy(struct snapshot_output *obj)
{
- assert(obj);
+ LTTNG_ASSERT(obj);
if (obj->consumer) {
consumer_output_send_destroy_relayd(obj->consumer);
struct lttng_ht_iter iter;
struct snapshot_output *output = NULL;
- assert(snapshot);
- assert(name);
+ LTTNG_ASSERT(snapshot);
+ LTTNG_ASSERT(name);
cds_lfht_for_each_entry(snapshot->output_ht->ht, &iter.iter, output,
node.node) {
struct lttng_ht_iter iter;
struct snapshot_output *output = NULL;
- assert(snapshot);
+ LTTNG_ASSERT(snapshot);
lttng_ht_lookup(snapshot->output_ht, (void *)((unsigned long) id), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
{
int ret;
- assert(obj);
+ LTTNG_ASSERT(obj);
memset(obj, 0, sizeof(struct snapshot));