tracepoint.h: move code after used prototype declaration
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Aug 2011 17:23:59 +0000 (13:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Aug 2011 17:23:59 +0000 (13:23 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/ust/tracepoint.h

index 76645dd6a1d1fce7181022f88151aa033f508a46..d793e58ca8da5b2ca18f0179709255c4b1e5b788 100644 (file)
@@ -45,37 +45,6 @@ struct tracepoint {
  */
 #define tracepoint(name, args...)      __trace_##name(args)
 
-/*
- * These weak symbols, the constructor, and destructor take care of
- * registering only _one_ instance of the tracepoints per shared-ojbect
- * (or for the whole main program).
- * The dummy tracepoint entry ensures that the start/stop pointers get
- * initialized by the linker when no tracepoints are present in a
- * shared-object (or main program).
- */
-extern struct tracepoint * const __start___tracepoints_ptrs[]
-       __attribute__((weak, visibility("hidden")));
-extern struct tracepoint * const __stop___tracepoints_ptrs[]
-       __attribute__((weak, visibility("hidden")));
-int __tracepoint_registered
-       __attribute__((weak, visibility("hidden")));
-
-static void __attribute__((constructor)) __tracepoints__init(void)
-{
-       if (__tracepoint_registered++)
-               return;
-       tracepoint_register_lib(__start___tracepoints_ptrs,
-                               __stop___tracepoints_ptrs -
-                               __start___tracepoints_ptrs);
-}
-
-static void __attribute__((destructor)) __tracepoints__destroy(void)
-{
-       if (--__tracepoint_registered)
-               return;
-       tracepoint_unregister_lib(__start___tracepoints_ptrs);
-}
-
 /*
  * it_func[0] is never NULL because there is at least one element in the array
  * when the array itself is non NULL.
@@ -197,6 +166,36 @@ int tracepoint_register_lib(struct tracepoint * const *tracepoints_start,
 extern
 int tracepoint_unregister_lib(struct tracepoint * const *tracepoints_start);
 
+/*
+ * These weak symbols, the constructor, and destructor take care of
+ * registering only _one_ instance of the tracepoints per shared-ojbect
+ * (or for the whole main program).
+ * The dummy tracepoint entry ensures that the start/stop pointers get
+ * initialized by the linker when no tracepoints are present in a
+ * shared-object (or main program).
+ */
+extern struct tracepoint * const __start___tracepoints_ptrs[]
+       __attribute__((weak, visibility("hidden")));
+extern struct tracepoint * const __stop___tracepoints_ptrs[]
+       __attribute__((weak, visibility("hidden")));
+int __tracepoint_registered
+       __attribute__((weak, visibility("hidden")));
+
+static void __attribute__((constructor)) __tracepoints__init(void)
+{
+       if (__tracepoint_registered++)
+               return;
+       tracepoint_register_lib(__start___tracepoints_ptrs,
+                               __stop___tracepoints_ptrs -
+                               __start___tracepoints_ptrs);
+}
+
+static void __attribute__((destructor)) __tracepoints__destroy(void)
+{
+       if (--__tracepoint_registered)
+               return;
+       tracepoint_unregister_lib(__start___tracepoints_ptrs);
+}
 
 #ifndef TRACEPOINT_EVENT
 /*
This page took 0.025097 seconds and 4 git commands to generate.