Force usage of assert() condition when NDEBUG is defined
[lttng-tools.git] / src / common / health / health.c
index 2667e393002c8cbb21c22fdd70e384d90396d92d..8f147c678a95753d26f22584a5831af2c60ba2cb 100644 (file)
@@ -1,23 +1,12 @@
 /*
- * 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 _LGPL_SOURCE
-#include <assert.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -166,12 +155,12 @@ static int validate_state(struct health_app *ha, struct health_state *state)
        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, &current_time);
+       ret = lttng_clock_gettime(CLOCK_MONOTONIC, &current_time);
        if (ret < 0) {
                PERROR("Error reading time\n");
                /* error */
@@ -234,7 +223,7 @@ int health_check_state(struct health_app *ha, int type)
        int retval = 1;
        struct health_state *state;
 
-       assert(type < ha->nr_types);
+       LTTNG_ASSERT(type < ha->nr_types);
 
        state_lock(ha);
 
@@ -270,7 +259,7 @@ end:
  */
 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);
This page took 0.024411 seconds and 4 git commands to generate.