trace: implement registration payload
[dpdk.git] / lib / librte_eal / include / rte_trace_point.h
index 3c2f880..34dcba3 100644 (file)
@@ -227,6 +227,60 @@ __rte_trace_point_fp_is_enabled(void)
 #endif
 }
 
+/**
+ * @internal
+ *
+ * Allocate trace memory buffer per thread.
+ *
+ */
+__rte_experimental
+void __rte_trace_mem_per_thread_alloc(void);
+
+/**
+ * @internal
+ *
+ * Helper function to emit field.
+ *
+ * @param sz
+ *   The tracepoint size.
+ * @param field
+ *   The name of the trace event.
+ * @param type
+ *   The datatype of the trace event as string.
+ * @return
+ *   - 0: Success.
+ *   - <0: Failure.
+ */
+__rte_experimental
+void __rte_trace_point_emit_field(size_t sz, const char *field,
+       const char *type);
+
+/**
+ * @internal
+ *
+ * Helper function to register a dynamic tracepoint.
+ * Use RTE_TRACE_POINT_REGISTER macro for tracepoint registration.
+ *
+ * @param trace
+ *   The tracepoint object created using RTE_TRACE_POINT_DEFINE.
+ * @param name
+ *   The name of the tracepoint object.
+ * @param register_fn
+ *   Trace registration function.
+ * @return
+ *   - 0: Successfully registered the tracepoint.
+ *   - <0: Failure to register the tracepoint.
+ */
+__rte_experimental
+int __rte_trace_point_register(rte_trace_point_t *trace, const char *name,
+       void (*register_fn)(void));
+
+#ifdef RTE_TRACE_POINT_REGISTER_SELECT
+#include <rte_trace_point_register.h>
+#else
+#include <rte_trace_point_provider.h>
+#endif
+
 #ifdef __cplusplus
 }
 #endif