[PATCH] eal: provide trace point register macro for MSVC

Thomas Monjalon thomas at monjalon.net
Sun Nov 12 13:04:28 CET 2023


01/11/2023 23:47, Tyler Retzlaff:
> Provide an alternate RTE_TRACE_POINT_REGISTER macro when building with
> MSVC that allocates segments for the trace point using MSVC specific
> features
> 
> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> ---
> +#ifdef RTE_TOOLCHAIN_MSVC
> +#define RTE_TRACE_POINT_REGISTER(trace, name) \
> +rte_trace_point_t \
> +__pragma(data_seg("__rte_trace_point")) \
> +__declspec(allocate("__rte_trace_point")) \
> +__##trace; \

You could indent lines which are part of the define.

> +static const char __##trace##_name[] = RTE_STR(name); \
> +RTE_INIT(trace##_init) \
> +{ \
> +	__rte_trace_point_register(&__##trace, __##trace##_name, \
> +		(void (*)(void)) trace); \
> +}

This part is common to both implementation.

It would be clearer to define a private macro for the trace point allocation
which is what differs, so it can be reused in a single common macro.





More information about the dev mailing list