Basic tracepoint event implementation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Nov 2011 17:05:43 +0000 (12:05 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Nov 2011 17:05:43 +0000 (12:05 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint-event.h [new file with mode: 0644]
include/lttng/ust-tracepoint-event.h [new file with mode: 0644]
liblttng-ust/probes/lttng-probe-ust.h
tests/demo/ust_tests_demo.h
tests/hello/ust_tests_hello.h

diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h
new file mode 100644 (file)
index 0000000..2cbe447
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose,  provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TRACEPOINT_CREATE_PROBES
+
+#define __tp_stringify1(x)     #x
+#define __tp_stringify(x)      __tp_stringify1(x)
+
+#undef TRACEPOINT_EVENT_INSTANCE
+#define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args)  \
+       _DEFINE_TRACEPOINT(provider, name)
+
+#undef TRACEPOINT_EVENT
+#define TRACEPOINT_EVENT(_provider, _name, _args, _fields)             \
+       TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name, _TP_PARAMS(_args))
+
+#define TRACEPOINT_INCLUDE     __tp_stringify(TRACEPOINT_INCLUDE_FILE)
+
+#undef TRACEPOINT_CREATE_PROBES
+
+#define TRACEPOINT_HEADER_MULTI_READ
+#include TRACEPOINT_INCLUDE
+#undef TRACEPOINT_HEADER_MULTI_READ
+
+#define TRACEPOINT_CREATE_PROBES
+
+#endif /* TRACEPOINT_CREATE_PROBES */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h
new file mode 100644 (file)
index 0000000..e69de29
index 5fd016ae5c6e686586d1cb945aa08374e92501c5..1c55ccd74c8a7a2a60bbf18d51a71031880363e1 100644 (file)
@@ -38,10 +38,8 @@ TRACEPOINT_EVENT(lttng_ust, metadata,
        )
 )
 
-#undef TRACEPOINT_INCLUDE_PATH
-#define TRACEPOINT_INCLUDE_PATH ./probes
 #undef TRACEPOINT_INCLUDE_FILE
-#define TRACEPOINT_INCLUDE_FILE lttng-probe-ust
+#define TRACEPOINT_INCLUDE_FILE ./probes/lttng-probe-ust.h
 
 #endif /* _TRACEPOINT_LTTNG_UST_H */
 
index f0aa5d1a5e697762efb0806bd47da1a9917b9eab..486b3ae9459d00e498301909b7826bf483eca321 100644 (file)
@@ -61,10 +61,8 @@ TRACEPOINT_EVENT(ust_tests_demo, done,
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO_H */
 
-#undef TRACEPOINT_INCLUDE_PATH
-#define TRACEPOINT_INCLUDE_PATH .
 #undef TRACEPOINT_INCLUDE_FILE
-#define TRACEPOINT_INCLUDE_FILE ust_tests_demo
+#define TRACEPOINT_INCLUDE_FILE ./ust_tests_demo.h
 
 /* This part must be outside ifdef protection */
 #include <lttng/tracepoint-event.h>
index d0f5b5c86b08e9283ea1350872c6f91062586a08..a54bc595650da4dadd505ef5d1ec152f55b4c26b 100644 (file)
@@ -52,10 +52,8 @@ TRACEPOINT_EVENT(ust_tests_hello, tptest_sighandler,
 
 #endif /* _TRACEPOINT_UST_TESTS_HELLO_H */
 
-#undef TRACEPOINT_INCLUDE_PATH
-#define TRACEPOINT_INCLUDE_PATH .
 #undef TRACEPOINT_INCLUDE_FILE
-#define TRACEPOINT_INCLUDE_FILE ust_tests_hello
+#define TRACEPOINT_INCLUDE_FILE ./ust_tests_hello.h
 
 /* This part must be outside ifdef protection */
 #include <lttng/tracepoint-event.h>
This page took 0.028894 seconds and 4 git commands to generate.