X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=markers-userspace%2Fmarker-lib.c;h=b2165b8b7ac542a86f4da1399a1be0c0a6bda1b1;hb=506b3caece634562c8d7d4d91fcd8ab791348c52;hp=2c42d4c8394ce9a86cefa05cd7e6b2e80f929212;hpb=20fd073e1da32c9f8511824f0080c4dcc07a1f52;p=lttv.git diff --git a/markers-userspace/marker-lib.c b/markers-userspace/marker-lib.c index 2c42d4c8..b2165b8b 100644 --- a/markers-userspace/marker-lib.c +++ b/markers-userspace/marker-lib.c @@ -3,8 +3,11 @@ #include #include -__attribute__ ((visibility ("protected"))) extern struct marker __start___markers[]; -__attribute__ ((visibility ("protected"))) extern struct marker __stop___markers[]; +__attribute__ ((visibility ("protected"))) +extern struct marker __start___markers[]; + +__attribute__ ((visibility ("protected"))) +extern struct marker __stop___markers[]; /** * __mark_empty_function - Empty probe callback @@ -36,9 +39,13 @@ __attribute__ ((visibility ("protected"))) void marker_probe_cb(const struct marker *mdata, void *call_private, const char *fmt, ...) { - static unsigned int count = 0; + char buf[PAGE_SIZE]; + va_list ap; - printf("Test probe function %u\n", count++); + va_start(ap, fmt); + vsnprintf(buf, PAGE_SIZE-1, fmt, ap); + sys_trace(0, 0, buf); + va_end(ap); } //FIXME : imv_read won't work with optimized immediate values. @@ -49,7 +56,8 @@ void testip(void) printf("addr : %p\n", __builtin_return_address(0)); } -__attribute__((constructor, visibility ("protected"))) void marker_init(void) +__attribute__((constructor, visibility ("protected"))) +void marker_init(void) { struct marker *iter; int ret; @@ -66,7 +74,8 @@ __attribute__((constructor, visibility ("protected"))) void marker_init(void) } } -static __attribute__((destructor, visibility ("protected"))) void marker_fini(void) +__attribute__((destructor, visibility ("protected"))) +void marker_fini(void) { struct marker *iter; int ret;