fix 32 bit support by conditionally compiling gdb support
[ust.git] / include / ust / marker.h
index 5c7d1b362b7b3f22dd153d1bdefab7ac3c09ee46..79b861cb0a2a1633ff7711f77b1b99ff91af7989 100644 (file)
@@ -21,8 +21,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef _LINUX_MARKER_H
-#define _LINUX_MARKER_H
+#ifndef _UST_MARKER_H
+#define _UST_MARKER_H
 
 #include <stdarg.h>
 //ust// #include <linux/types.h>
@@ -30,7 +30,7 @@
 //ust// #include <linux/ltt-channels.h>
 #include <ust/kernelcompat.h>
 #include <kcompat/list.h>
-#include "processor.h"
+#include <ust/processor.h>
 
 //ust// struct module;
 //ust// struct task_struct;
@@ -94,15 +94,10 @@ struct marker {
                  0, 0, 0, 0, marker_probe_cb,                          \
                  { __mark_empty_function, NULL},                       \
                  NULL, tp_name_str, tp_cb, NULL };                     \
-               asm (".section __marker_addr,\"aw\",@progbits\n\t"      \
-                      _ASM_PTR "%c[marker_struct], (1f)\n\t"           \
-                      ".previous\n\t"                                  \
-                      "1:\n\t"                                         \
-                       :: [marker_struct] "i" (&__mark_##channel##_##name));\
+               save_ip();                                              \
                save_registers(&regs)
 
 
-
 #define DEFINE_MARKER(channel, name, format)                           \
                _DEFINE_MARKER(channel, name, NULL, NULL, format)
 
@@ -304,25 +299,47 @@ struct marker_addr {
 
 struct lib {
        struct marker *markers_start;
+#ifdef CONFIG_UST_GDB_INTEGRATION
        struct marker_addr *markers_addr_start;
+#endif
        int markers_count;
        struct list_head list;
 };
 
-extern int marker_register_lib(struct marker *markers_start, struct marker_addr *marker_addr_start, int markers_count);
-
-#define MARKER_LIB                                                                             \
-extern struct marker __start___markers[] __attribute__((visibility("hidden")));                        \
-extern struct marker __stop___markers[] __attribute__((visibility("hidden")));                 \
-extern struct marker_addr __start___marker_addr[] __attribute__((visibility("hidden")));       \
-extern struct marker_addr __stop___marker_addr[] __attribute__((visibility("hidden")));                \
-                                                                                               \
-static void __attribute__((constructor)) __markers__init(void)                                 \
-{                                                                                              \
-       marker_register_lib(__start___markers, __start___marker_addr, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); \
-}
+extern int marker_register_lib(struct marker *markers_start,
+                              struct marker_addr *marker_addr_start,
+                              int markers_count);
+
+#ifdef CONFIG_UST_GDB_INTEGRATION
+
+#define MARKER_LIB                                                     \
+       extern struct marker __start___markers[] __attribute__((weak, visibility("hidden"))); \
+       extern struct marker __stop___markers[] __attribute__((weak, visibility("hidden"))); \
+       extern struct marker_addr __start___marker_addr[] __attribute__((weak, visibility("hidden"))); \
+       extern struct marker_addr __stop___marker_addr[] __attribute__((weak, visibility("hidden"))); \
+                                                                       \
+       static void __attribute__((constructor)) __markers__init(void)  \
+       {                                                               \
+               marker_register_lib(__start___markers, __start___marker_addr, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); \
+       }
 
 extern void marker_set_new_marker_cb(void (*cb)(struct marker *));
 extern void init_markers(void);
 
-#endif
+#else /* CONFIG_UST_GDB_INTEGRATION */
+
+#define MARKER_LIB                                                     \
+       extern struct marker __start___markers[] __attribute__((weak, visibility("hidden"))); \
+       extern struct marker __stop___markers[] __attribute__((weak, visibility("hidden"))); \
+                                                                       \
+       static void __attribute__((constructor)) __markers__init(void)  \
+       {                                                               \
+               marker_register_lib(__start___markers, NULL, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); \
+       }
+
+extern void marker_set_new_marker_cb(void (*cb)(struct marker *));
+extern void init_markers(void);
+
+#endif /* CONFIG_UST_GDB_INTEGRATION */
+
+#endif /* _UST_MARKER_H */
This page took 0.023034 seconds and 4 git commands to generate.