From: Pierre-Marc Fournier Date: Thu, 7 Jan 2010 17:00:19 +0000 (-0500) Subject: remove usage of the marker_addr section X-Git-Tag: v0.1~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bf961c7e84409d672614256de395430db2dbecb7;p=ust.git remove usage of the marker_addr section --- diff --git a/include/ust/marker.h b/include/ust/marker.h index 7760500..27dd8fe 100644 --- a/include/ust/marker.h +++ b/include/ust/marker.h @@ -350,40 +350,18 @@ struct lib { struct list_head list; }; -extern int marker_register_lib(struct marker *markers_start, - struct marker_addr *marker_addr_start, - int markers_count); - -#ifdef CONFIG_UST_GDB_INTEGRATION +extern int marker_register_lib(struct marker *markers_start, int markers_count); #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*/ NULL, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); \ + marker_register_lib(__start___markers, (((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); -#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 */ diff --git a/libust/marker.c b/libust/marker.c index 01a515d..8e2a398 100644 --- a/libust/marker.c +++ b/libust/marker.c @@ -47,11 +47,6 @@ volatile __thread long *ust_reg_stack_ptr = (long *) 0; extern struct marker __start___markers[] __attribute__((visibility("hidden"))); extern struct marker __stop___markers[] __attribute__((visibility("hidden"))); -#ifdef CONFIG_UST_GDB_INTEGRATION -extern struct marker_addr __start___marker_addr[] __attribute__((visibility("hidden"))); -extern struct marker_addr __stop___marker_addr[] __attribute__((visibility("hidden"))); -#endif - /* Set to 1 to enable marker debug output */ static const int marker_debug; @@ -1522,7 +1517,7 @@ static void new_markers(struct marker *start, struct marker *end) } } -int marker_register_lib(struct marker *markers_start, struct marker_addr *marker_addr_start, int markers_count) +int marker_register_lib(struct marker *markers_start, int markers_count) { struct lib *pl; struct marker_addr *addr; @@ -1530,18 +1525,8 @@ int marker_register_lib(struct marker *markers_start, struct marker_addr *marker pl = (struct lib *) malloc(sizeof(struct lib)); pl->markers_start = markers_start; -#ifdef CONFIG_UST_GDB_INTEGRATION - pl->markers_addr_start = marker_addr_start; -#endif pl->markers_count = markers_count; -#ifdef CONFIG_UST_GDB_INTEGRATION - lock_markers(); - for(addr = marker_addr_start; addr < marker_addr_start + markers_count; addr++) - addr->marker->location = addr->addr; - unlock_markers(); -#endif - /* FIXME: maybe protect this with its own mutex? */ lock_markers(); list_add(&pl->list, &libs); @@ -1570,11 +1555,7 @@ static int initialized = 0; void __attribute__((constructor)) init_markers(void) { if(!initialized) { -#ifdef CONFIG_UST_GDB_INTEGRATION - marker_register_lib(__start___markers, __start___marker_addr, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); -#else - marker_register_lib(__start___markers, NULL, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); -#endif + marker_register_lib(__start___markers, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker)); //DBG("markers_start: %p, markers_stop: %p\n", __start___markers, __stop___markers); initialized = 1; }