Syscall detail mode: generate syscall table
[lttng-modules.git] / probes / lttng-probe-syscalls.c
index 3889b5071175eac85111da2b2d40e243642a1fb5..6bc65fcf1be6ecba15c022febfc5ac5a96c7d1f4 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <linux/module.h>
 
+#ifndef SYSCALL_DETAIL
+
 /*
  * Create the tracepoint static inlines from the kernel to validate that our
  * trace event macros match the kernel we run on.
 
 #include "../instrumentation/events/lttng-module/syscalls.h"
 
+#else  /* SYSCALL_DETAIL */
+
+/*
+ * Create LTTng tracepoint probes.
+ */
+#define LTTNG_PACKAGE_BUILD
+#define CREATE_TRACE_POINTS
+
+#define TRACE_INCLUDE_PATH ../instrumentation/syscalls/headers
+
+#define TRACE_SYSCALL_TABLE(_name, _nr, _nrargs)
+
+#include "../instrumentation/syscalls/headers/syscalls.h"
+
+#undef LTTNG_PACKAGE_BUILD
+#undef CREATE_TRACE_POINTS
+
+struct trace_syscall_entry {
+       void *func;
+       unsigned int nrargs;
+};
+
+#define CREATE_SYSCALL_TABLE
+
+#undef TRACE_SYSCALL_TABLE
+#define TRACE_SYSCALL_TABLE(_name, _nr, _nrargs)       \
+       [ _nr ] = { .func = __event_probe__##_name, .nrargs = (_nrargs) },
+
+static struct trace_syscall_entry sc_table[] = {
+#include "../instrumentation/syscalls/headers/syscalls.h"
+};
+#undef CREATE_SYSCALL_TABLE
+
+#endif /* SYSCALL_DETAIL */
+
 MODULE_LICENSE("GPL and additional rights");
 MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
 MODULE_DESCRIPTION("LTTng sched probes");
This page took 0.024333 seconds and 4 git commands to generate.