trace point symbols

Morten Brørup mb at smartsharesystems.com
Thu Jan 12 10:43:38 CET 2023


> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> Sent: Thursday, 12 January 2023 10.11
> 
> 15/12/2022 07:49, Jerin Jacob:
> > On Wed, Dec 14, 2022 at 5:40 PM Ferruh Yigit <ferruh.yigit at amd.com>
> wrote:
> > >
> > > On 12/14/2022 10:40 AM, Jerin Jacob wrote:
> > > > On Wed, Dec 14, 2022 at 1:37 AM Ferruh Yigit
> <ferruh.yigit at amd.com> wrote:
> > > >> 4) Why we need to export trace point variables in the .map
> files,
> > > >> like '__rte_eth_trace_allmulticast_disable' one...
> > > >
> > > > If you see app/test/test_trace.c example
> > > >
> > > > There are two-way to operate on trace point, We need to export
> symbol
> > > > iff we need option 1
> > > >
> > > > option1:
> > > > rte_trace_point_enable(&__app_dpdk_test_tp);
> > > >
> > > > option2:
> > > > rte_trace_point_t *trace =
> rte_trace_point_lookup("app.dpdk.test.tp");
> > > > rte_trace_point_enable(trace);

rte_trace_point_enable() allows passing a NULL pointer, so enabling a trace point can still be a one-liner:

rte_trace_point_enable(rte_trace_point_lookup("app.dpdk.test.tp"));

With option2, we lose the build-time error if trying to enable a non-existing trace point. But it's an acceptable tradeoff.

> > > >
> > >
> > > got it, do we really need direct access to trace point (option 1),
> I
> > > would be OK to remove that option to not expose all these trace
> point
> > > objects.
> >
> > Looks good to me.
> 
> I would like to see a policy regarding trace symbols.
> If we decide option 1 is not so useful,
> then we should not export trace symbols at all and document this
> policy.
> Also there are some trace symbols which could be cleaned up.

+1 for not exposing trace point symbols at all.

The trace point symbols are only used internally by DPDK, so they should not be part of DPDK's public API.

It might also make it easier for Bruce to move the trace library out of EAL.

I'm not familiar with the CTF format, but I assume that if we don't expose the trace point symbols, the trace points can still be identified when parsing the trace file.



More information about the dev mailing list