[v9,07/12] eal/windows: add tracing support stubs
Checks
Commit Message
EAL common code depends on tracepoint calls, but generic implementation
cannot be enabled on Windows due to missing standard library facilities.
Add stub functions to support tracepoint compilation, so that common
code does not have to conditionally include tracepoints until proper
support is added.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
lib/librte_eal/common/eal_common_thread.c | 5 +---
lib/librte_eal/common/meson.build | 1 +
lib/librte_eal/windows/eal.c | 34 ++++++++++++++++++++++-
3 files changed, 35 insertions(+), 5 deletions(-)
@@ -15,9 +15,7 @@
#include <rte_lcore.h>
#include <rte_memory.h>
#include <rte_log.h>
-#ifndef RTE_EXEC_ENV_WINDOWS
#include <rte_trace_point.h>
-#endif
#include "eal_internal_cfg.h"
#include "eal_private.h"
@@ -169,9 +167,8 @@ static void *rte_thread_init(void *arg)
free(params);
}
-#ifndef RTE_EXEC_ENV_WINDOWS
__rte_trace_mem_per_thread_alloc();
-#endif
+
return start_routine(routine_arg);
}
@@ -14,6 +14,7 @@ if is_windows
'eal_common_log.c',
'eal_common_options.c',
'eal_common_thread.c',
+ 'eal_common_trace_points.c',
)
subdir_done()
endif
@@ -17,6 +17,7 @@
#include <eal_filesystem.h>
#include <eal_options.h>
#include <eal_private.h>
+#include <rte_trace_point.h>
#include "eal_windows.h"
@@ -221,7 +222,38 @@ rte_eal_init_alert(const char *msg)
RTE_LOG(ERR, EAL, "%s\n", msg);
}
- /* Launch threads, called at application init(). */
+/* Stubs to enable EAL trace point compilation
+ * until eal_common_trace.c can be compiled.
+ */
+
+RTE_DEFINE_PER_LCORE(volatile int, trace_point_sz);
+RTE_DEFINE_PER_LCORE(void *, trace_mem);
+
+void
+__rte_trace_mem_per_thread_alloc(void)
+{
+}
+
+void
+__rte_trace_point_emit_field(size_t sz, const char *field,
+ const char *type)
+{
+ RTE_SET_USED(sz);
+ RTE_SET_USED(field);
+ RTE_SET_USED(type);
+}
+
+int
+__rte_trace_point_register(rte_trace_point_t *trace, const char *name,
+ void (*register_fn)(void))
+{
+ RTE_SET_USED(trace);
+ RTE_SET_USED(name);
+ RTE_SET_USED(register_fn);
+ return -ENOTSUP;
+}
+
+/* Launch threads, called at application init(). */
int
rte_eal_init(int argc, char **argv)
{