Tracepoint.h: replace assertion by fprintf and abort()
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 18 Jun 2013 14:07:57 +0000 (10:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 19 Jun 2013 00:05:04 +0000 (20:05 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h

index 0629af23e67e21f121478e1da3cbaff869c249e6..0327c11dead59e3f0894726b76f4f15120923088 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <lttng/tracepoint-types.h>
 #include <lttng/tracepoint-rcu.h>
 #include <urcu/compiler.h>
 #include <dlfcn.h>     /* for dlopen */
 #include <string.h>    /* for memset */
-#include <assert.h>
 #include <lttng/ust-config.h>  /* for sdt */
 #include <lttng/ust-compiler.h>
 
@@ -289,7 +290,10 @@ __tracepoints__destroy(void)
                return;
        if (tracepoint_dlopen.liblttngust_handle && !__tracepoint_ptrs_registered) {
                ret = dlclose(tracepoint_dlopen.liblttngust_handle);
-               assert(!ret);
+               if (ret) {
+                       fprintf(stderr, "Error (%d) in dlclose\n", ret);
+                       abort();
+               }
                memset(&tracepoint_dlopen, 0, sizeof(tracepoint_dlopen));
        }
 }
@@ -389,7 +393,10 @@ __tracepoints__ptrs_destroy(void)
                tracepoint_dlopen.tracepoint_unregister_lib(__start___tracepoints_ptrs);
        if (tracepoint_dlopen.liblttngust_handle && !__tracepoint_registered) {
                ret = dlclose(tracepoint_dlopen.liblttngust_handle);
-               assert(!ret);
+               if (ret) {
+                       fprintf(stderr, "Error (%d) in dlclose\n", ret);
+                       abort();
+               }
                memset(&tracepoint_dlopen, 0, sizeof(tracepoint_dlopen));
        }
 }
This page took 0.025932 seconds and 4 git commands to generate.