>-----Original Message----- >From: David Marchand <david.march...@redhat.com> >Sent: Thursday, October 29, 2020 3:33 PM >To: Sunil Kumar Kori <sk...@marvell.com> >Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jer...@marvell.com> >Subject: Re: [EXT] [PATCH v2 2/4] trace: remove size limit on CTF event >description > >On Thu, Oct 29, 2020 at 10:36 AM Sunil Kumar Kori <sk...@marvell.com> >wrote: >> Yes but I am not able to understand that how tp->ctf_field will be >> populated with latest memory because RTE_PER_LCORE(ctf_field) is being >free and re-allocated at runtime. > >Initially, RTE_PER_LCORE(ctf_field) is NULL. > >Then registration for a trace point happens: > >__rte_trace_point_register() calls register_fn() which for each field in the >trace >point calls __rte_trace_point_emit_field(). > >Each call to __rte_trace_point_emit_field accumulates the previous ctf_field >with the new field. > > rc = asprintf(&field, "%s %s %s;\n", > RTE_PER_LCORE(ctf_field) != NULL ? > RTE_PER_LCORE(ctf_field) : "", > datatype, in); > free(RTE_PER_LCORE(ctf_field)); > RTE_PER_LCORE(ctf_field) = field; > >Here, RTE_PER_LCORE(ctf_field) is != NULL. > >Back to __rte_trace_point_register: > > /* Copy the accumulated fields description and clear it for the next > * trace point. > */ > tp->ctf_field = RTE_PER_LCORE(ctf_field); > >Once stored, RTE_PER_LCORE(ctf_field) is cleared again for the next trace >point registration. > > RTE_PER_LCORE(ctf_field) = NULL; > > >
Acked-by: Sunil Kumar Kori <sk...@mavell.com> >-- >David Marchand