Remove localerr.h
[ust.git] / libust / marker.h
index 122fca72993b90f60d9c06e950baeddf909e21c1..ad813bc2c07537009bdb4719cf3849c2a9344a8f 100644 (file)
@@ -6,8 +6,19 @@
  * (C) Copyright 2006 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
  * (C) Copyright 2009 Pierre-Marc Fournier <pierre-marc dot fournier at polymtl dot ca>
  *
- * This file is released under the GPLv2.
- * See the file COPYING for more details.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
 #ifndef _LINUX_MARKER_H
@@ -18,8 +29,8 @@
 #include "immediate.h"
 //ust// #include <linux/ltt-channels.h>
 #include "kernelcompat.h"
-#include "compiler.h"
 #include <kcompat/list.h>
+#include "usterr.h"
 
 //ust// struct module;
 //ust// struct task_struct;
@@ -65,7 +76,8 @@ struct marker {
        void *tp_cb;            /* Optional tracepoint callback */
 } __attribute__((aligned(8)));
 
-//ust// #ifdef CONFIG_MARKERS
+#define CONFIG_MARKERS
+#ifdef CONFIG_MARKERS
 
 #define _DEFINE_MARKER(channel, name, tp_name_str, tp_cb, format)      \
                static const char __mstrtab_##channel##_##name[]        \
@@ -133,24 +145,24 @@ extern void marker_update_probe_range(struct marker *begin,
 
 #define GET_MARKER(channel, name)      (__mark_##channel##_##name)
 
-//ust// #else /* !CONFIG_MARKERS */
-//ust// #define DEFINE_MARKER(channel, name, tp_name, tp_cb, format)
-//ust// #define __trace_mark(generic, channel, name, call_private, format, args...) \
-//ust//                __mark_check_format(format, ## args)
-//ust// #define __trace_mark_tp(channel, name, call_private, tp_name, tp_cb,   \
-//ust//                format, args...)                                        \
-//ust//        do {                                                            \
-//ust//                void __check_tp_type(void)                              \
-//ust//                {                                                       \
-//ust//                        register_trace_##tp_name(tp_cb);                \
-//ust//                }                                                       \
-//ust//                __mark_check_format(format, ## args);                   \
-//ust//        } while (0)
-//ust// static inline void marker_update_probe_range(struct marker *begin,
-//ust//        struct marker *end)
-//ust// { }
-//ust// #define GET_MARKER(channel, name)
-//ust// #endif /* CONFIG_MARKERS */
+#else /* !CONFIG_MARKERS */
+#define DEFINE_MARKER(channel, name, tp_name, tp_cb, format)
+#define __trace_mark(generic, channel, name, call_private, format, args...) \
+               __mark_check_format(format, ## args)
+#define __trace_mark_tp(channel, name, call_private, tp_name, tp_cb,   \
+               format, args...)                                        \
+       do {                                                            \
+               void __check_tp_type(void)                              \
+               {                                                       \
+                       register_trace_##tp_name(tp_cb);                \
+               }                                                       \
+               __mark_check_format(format, ## args);                   \
+       } while (0)
+static inline void marker_update_probe_range(struct marker *begin,
+       struct marker *end)
+{ }
+#define GET_MARKER(channel, name)
+#endif /* CONFIG_MARKERS */
 
 /**
  * trace_mark - Marker using code patching
@@ -282,17 +294,20 @@ struct lib {
        struct list_head list;
 };
 
-int marker_register_lib(struct marker *markers_start, int markers_count);
+extern int marker_register_lib(struct marker *markers_start,
+                              int markers_count);
 
-#define MARKER_LIB                                                                     \
-extern struct marker __start___markers[] __attribute__((visibility("hidden")));                \
+#define MARKER_LIB                                                     \
+extern struct marker __start___markers[] __attribute__((visibility("hidden")));        \
 extern struct marker __stop___markers[] __attribute__((visibility("hidden")));         \
                                                                                        \
 static void __attribute__((constructor)) __markers__init(void)                                 \
 {                                                                                      \
+       DBG("next registration in "__FILE__"\n");\
        marker_register_lib(__start___markers, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker));\
 }
 
-void marker_set_new_marker_cb(void (*cb)(struct marker *));
+extern void marker_set_new_marker_cb(void (*cb)(struct marker *));
+extern void init_markers(void);
 
 #endif
This page took 0.02461 seconds and 4 git commands to generate.