/*
- * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
- * Copyright (C) 2013 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2013 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 _GNU_SOURCE
-#include <assert.h>
+#define _LGPL_SOURCE
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
if (!ha) {
return NULL;
}
- ha->flags = zmalloc(sizeof(*ha->flags));
+ ha->flags = zmalloc(sizeof(*ha->flags) * nr_types);
if (!ha->flags) {
goto error_flags;
}
unsigned long current, last;
struct timespec current_time;
- assert(state);
+ LTTNG_ASSERT(state);
last = state->last;
current = uatomic_read(&state->current);
- ret = clock_gettime(CLOCK_MONOTONIC, ¤t_time);
+ ret = lttng_clock_gettime(CLOCK_MONOTONIC, ¤t_time);
if (ret < 0) {
PERROR("Error reading time\n");
/* error */
int retval = 1;
struct health_state *state;
- assert(type < ha->nr_types);
+ LTTNG_ASSERT(type < ha->nr_types);
state_lock(ha);
*/
void health_register(struct health_app *ha, int type)
{
- assert(type < ha->nr_types);
+ LTTNG_ASSERT(type < ha->nr_types);
/* Init TLS state. */
uatomic_set(&URCU_TLS(health_state).last, 0);