#ifndef __KERNEL_API
#define __KERNEL_API
+#include <errno.h>
+#include <syscall.h>
+#include <string.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define DECLARE_IMV(type, name) extern __typeof__(type) name##__imv
#define DEFINE_IMV(type, name) __typeof__(type) name##__imv
*/
#define _imv_read(name) (name##__imv)
+#define __NR_marker 326
+
+#define sys_marker(...) syscall(__NR_marker, __VA_ARGS__)
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
#endif
#include "marker.h"
#include <stdio.h>
+#include <errno.h>
extern struct marker __start___markers[];
extern struct marker __stop___markers[];
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);
}
#include <stdio.h>
+#include <unistd.h>
#include "marker.h"
int main(int argc, char **argv)
void *ptr;
unsigned long val;
- trace_mark(test_marker, "ptr %p val %lu", ptr, val);
+ while (1) {
+ trace_mark(test_marker, "ptr %p val %lu", ptr, val);
+ sleep(2);
+ }
return 0;
}