markers: fix use of ptrs
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 17 Feb 2011 19:55:57 +0000 (14:55 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 17 Feb 2011 19:55:57 +0000 (14:55 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/ust/marker.h
libust/marker.c

index cac71ffc59fe641ade37b47c8daa0a66dbc57275..8e20dad31fbdc97ca0a5b971e5465ad7dd581f26 100644 (file)
@@ -344,19 +344,19 @@ extern int marker_register_lib(struct marker * const *markers_start, int markers
 extern int marker_unregister_lib(struct marker * const *markers_start);
 
 #define MARKER_LIB                                                     \
-       extern struct marker * const __start___markers[] __attribute__((weak, visibility("hidden"))); \
-       extern struct marker * const __stop___markers[] __attribute__((weak, visibility("hidden"))); \
+       extern struct marker * const __start___markers_ptrs[] __attribute__((weak, visibility("hidden"))); \
+       extern struct marker * const __stop___markers_ptrs[] __attribute__((weak, visibility("hidden"))); \
                                                                        \
        static void __attribute__((constructor)) __markers__init(void)  \
        {                                                               \
-               marker_register_lib(__start___markers,                  \
-                       (((long)__stop___markers) - ((long)__start___markers))  \
-                               / sizeof(*__start___markers));          \
-       } \
-       \
-       static void __attribute__((destructor)) __markers__destroy(void)        \
+               marker_register_lib(__start___markers_ptrs,             \
+                                   __stop___markers_ptrs               \
+                                   - __start___markers_ptrs);          \
+       }                                                               \
+                                                                       \
+       static void __attribute__((destructor)) __markers__destroy(void)\
        {                                                               \
-               marker_unregister_lib(__start___markers); \
+               marker_unregister_lib(__start___markers_ptrs);          \
        }
 
 extern void marker_set_new_marker_cb(void (*cb)(struct marker *));
index 664f59c61c6495229ba4661206e267b5e5a7635c..8ca028c3e0f38f36cbadf18fabcb413452a6011c 100644 (file)
@@ -35,8 +35,8 @@
 __thread long ust_reg_stack[500];
 volatile __thread long *ust_reg_stack_ptr = (long *) 0;
 
-extern struct marker * const __start___markers[] __attribute__((visibility("hidden")));
-extern struct marker * const __stop___markers[] __attribute__((visibility("hidden")));
+extern struct marker * const __start___markers_ptrs[] __attribute__((visibility("hidden")));
+extern struct marker * const __stop___markers_ptrs[] __attribute__((visibility("hidden")));
 
 /* Set to 1 to enable marker debug output */
 static const int marker_debug;
@@ -743,10 +743,6 @@ static void lib_update_markers(void)
  */
 static void marker_update_probes(void)
 {
-       /* Core kernel markers */
-//ust//        marker_update_probe_range(__start___markers, __stop___markers);
-       /* Markers in modules. */
-//ust//        module_update_markers();
        lib_update_markers();
        tracepoint_probe_update_all();
        /* Update immediate values */
@@ -1132,17 +1128,7 @@ static void marker_get_iter(struct marker_iter *iter)
 {
        int found = 0;
 
-       /* Core kernel markers */
-       if (!iter->lib) {
-               /* ust FIXME: how come we cannot disable the following line? we shouldn't need core stuff */
-               found = marker_get_iter_range(&iter->marker,
-                               __start___markers, __stop___markers);
-               if (found)
-                       goto end;
-       }
-       /* Markers in modules. */
        found = lib_get_iter_markers(iter);
-end:
        if (!found)
                marker_iter_reset(iter);
 }
@@ -1415,15 +1401,15 @@ static int initialized = 0;
 
 void __attribute__((constructor)) init_markers(void)
 {
-       if(!initialized) {
-               marker_register_lib(__start___markers,
-                       (((long)__stop___markers) - ((long)__start___markers))
-                               / sizeof(*__start___markers));
+       if (!initialized) {
+               marker_register_lib(__start___markers_ptrs,
+                       __stop___markers_ptrs
+                       - __start___markers_ptrs);
                initialized = 1;
        }
 }
 
 void __attribute__((constructor)) destroy_markers(void)
 {
-       marker_unregister_lib(__start___markers);
+       marker_unregister_lib(__start___markers_ptrs);
 }
This page took 0.028189 seconds and 4 git commands to generate.