On Mon, Nov 06, 2023 at 05:40:12PM +0100, Thomas Monjalon wrote: > 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 > > Please could you elaborate what is the improvement?
well not intended to be an improvement, intended to align the msvc build with the gcc/clang builds placement of registered tracepoint in their own section. the alternate expansion for msvc is provided to place the trace point being registered in it's own section `__rte_trace_point' msvc doesn't have __attribute__(section("name")) instead as an alternate we use msvc's data_seg pragma to create and place the trace point into a named section. i.e. gcc/clang T __attribute__(section("__rte_trace_point") __##trace; msvc T __pragma(data_seg("__rte_trace_point")) __declspec(allocate("__rte_trace_point")) __##trace; > > > +#define RTE_TRACE_POINT_REGISTER(trace, name) \ > > +rte_trace_point_t \ > > +__pragma(data_seg("__rte_trace_point")) \ > > +__declspec(allocate("__rte_trace_point")) \ > > +__##trace; \ > > +static const char __##trace##_name[] = RTE_STR(name); \ > > +RTE_INIT(trace##_init) \ > > +{ \ > > + __rte_trace_point_register(&__##trace, __##trace##_name, \ > > + (void (*)(void)) trace); \ > > +} > >