+/*
+ * The need for the _DECLARE_TRACEPOINT_NOARGS() is to handle the prototype
+ * (void). "void" is a special value in a function prototype and can
+ * not be combined with other arguments. Since the DECLARE_TRACEPOINT()
+ * macro adds a data element at the beginning of the prototype,
+ * we need a way to differentiate "(void *data, proto)" from
+ * "(void *data, void)". The second prototype is invalid.
+ *
+ * DECLARE_TRACEPOINT_NOARGS() passes "void" as the tracepoint prototype
+ * and "void *__tp_cb_data" as the callback prototype.
+ *
+ * DECLARE_TRACEPOINT() passes "proto" as the tracepoint protoype and
+ * "void *__tp_cb_data, proto" as the callback prototype.
+ */
+#define _DECLARE_TRACEPOINT_NOARGS(name) \
+ __DECLARE_TRACEPOINT(name, void, , void *__tp_cb_data, __tp_cb_data)
+
+#define _DECLARE_TRACEPOINT(name, proto, args) \
+ __DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args), \
+ TP_PARAMS(void *__tp_cb_data, proto), \
+ TP_PARAMS(__tp_cb_data, args))
+
+/*
+ * __tracepoints_ptrs section is not const (read-only) to let the linker update
+ * the pointer, allowing PIC code.
+ */
+#define _DEFINE_TRACEPOINT(name) \