in progress...
[lttv.git] / markers-userspace / marker-lib.c
index da5bcaa33802bbc2c9ae6acbf5d73f295eb26fa4..739c7580e8f1901519c88b0d34e4be25db2337dd 100644 (file)
@@ -1,5 +1,10 @@
 
 #include "marker.h"
+#include <stdio.h>
+#include <errno.h>
+
+extern struct marker __start___markers[];
+extern struct marker __stop___markers[];
 
 /**
  * __mark_empty_function - Empty probe callback
@@ -29,6 +34,22 @@ void __mark_empty_function(void *probe_private, void *call_private,
 void marker_probe_cb(const struct marker *mdata, void *call_private,
        const char *fmt, ...)
 {
+       static unsigned int count = 0;
+
+       printf("Test probe function %u\n", count++);
+}
 
+__attribute__((constructor)) void marker_init(void)
+{
+       struct marker *iter;
+       int ret;
 
+       printf("Marker section : from %p to %p\n",
+               __start___markers, __stop___markers);
+       ret = sys_marker(__start___markers, __stop___markers);
+       if (ret)
+               perror("Error connecting markers");
+       for (iter = __start___markers; iter < __stop___markers; iter++) {
+               printf("Marker : %s\n", iter->name);
+       }
 }
This page took 0.02373 seconds and 4 git commands to generate.