#include "marker.h"
#include <stdio.h>
#include <errno.h>
+#include <sys/user.h>
-__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
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.
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;
}
}
-static __attribute__((destructor, visibility ("protected"))) void marker_fini(void)
+__attribute__((destructor, visibility ("protected")))
+void marker_fini(void)
{
struct marker *iter;
int ret;