On Tue, Oct 11, 2022 at 4:49 PM Jerin Jacob <jerinjac...@gmail.com> wrote: > > On Wed, Sep 21, 2022 at 5:35 PM David Marchand > <david.march...@redhat.com> wrote: > > > > The name of a trace point is provided as a constant string via the > > RTE_TRACE_POINT_REGISTER macro. > > We can rely on the constant string in the binary and simply point at it. > > I am not sure about this. If we compile with -Os (optimized for space) > compiler may decide to use stack instead of rodata. > If so, we will have segfaults with specific compiler or compiler build > options. > Thoughts?
Good point. We need an explicit storage for the string. What do you think of: @@ -20,9 +20,10 @@ RTE_DECLARE_PER_LCORE(volatile int, trace_point_sz); #define RTE_TRACE_POINT_REGISTER(trace, name) \ rte_trace_point_t __attribute__((section("__rte_trace_point"))) __##trace; \ +static const char __##trace##_name[] = RTE_STR(name); \ RTE_INIT(trace##_init) \ { \ - __rte_trace_point_register(&__##trace, RTE_STR(name), \ + __rte_trace_point_register(&__##trace, __##trace##_name, \ (void (*)(void)) trace); \ } -- David Marchand