Syscall detail mode: generate syscall table
[lttng-modules.git] / probes / lttng-probe-syscalls.c
index b1c5f39470984b35dd947f58462ece79c070ab34..6bc65fcf1be6ecba15c022febfc5ac5a96c7d1f4 100644 (file)
 
 #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 <trace/events/syscalls.h>
+#include <trace/events/syscalls.h>
+
+/*
+ * Create LTTng tracepoint probes.
+ */
+#define LTTNG_PACKAGE_BUILD
+#define CREATE_TRACE_POINTS
+#define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module
+
+#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
 
-#include "../instrumentation/syscalls/headers/syscall.h"
+#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>");
This page took 0.022847 seconds and 4 git commands to generate.