[PATCH 7/8] trace: remove limitation on trace point name
Jerin Jacob
jerinjacobk at gmail.com
Wed Oct 12 11:41:36 CEST 2022
On Wed, Oct 12, 2022 at 1:18 PM David Marchand
<david.marchand at redhat.com> wrote:
>
> On Tue, Oct 11, 2022 at 4:49 PM Jerin Jacob <jerinjacobk at gmail.com> wrote:
> >
> > On Wed, Sep 21, 2022 at 5:35 PM David Marchand
> > <david.marchand at 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:
This is OK.
> @@ -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
>
More information about the dev
mailing list