> -----Original Message-----
> From: David Marchand <david.march...@redhat.com>
> Sent: Thursday, October 13, 2022 9:22 PM
> To: Harman Kalra <hka...@marvell.com>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jer...@marvell.com>; Sunil
> Kumar Kori <sk...@marvell.com>; sta...@dpdk.org
> Subject: Re: [EXT] [PATCH v3 5/9] trace: fix dynamically enabling trace points
> 
> On Thu, Oct 13, 2022 at 4:53 PM Harman Kalra <hka...@marvell.com> wrote:
> >
> >
> > > -int
> > > +static int
> > >  trace_mkdir(void)
> > >  {
> > >       struct trace *trace = trace_obj_get();
> > >       char session[TRACE_DIR_STR_LEN];
> > > +     static bool already_done;
> > >       char *dir_path;
> > >       int rc;
> > >
> > > +     if (already_done)
> > > +             return 0;
> > > +
> > Hi David
> >
> > I was trying out "trace: take live traces via telemetry" patch I came
> > across following scenario
> > - Started testpmd with trace=.*
> > - Executed /trace/save from telemetry script, trace file saved
> > successfully
> > - Later after stopping application, rte_eal_cleanup() did not save the 
> > trace.
> >
> > With this we lost traces after /trace/save executed
> 
> Sorry, I must be missing something.
> What patches did you apply and how are you testing?

I applied the whole trace fixes series and then tested live traces

> 
> With the whole traces fixes series applied first, then the new "trace:
> take live traces via telemetry" patch applied, I can't reproduce your issue.
> 
> 

Yes, you replicated the same scenario what I tried.
Sorry, I realized that actually it's not an issue, traces generated after 
/trace/save are getting
appended but in the same file (timestamped on /trace/save) on rte_eal_cleanup().

I assumed that trace dir generated with a timestamp will include all the trace 
points emitted
before that timestamp. But in the above scenario same  trace dir includes trace 
points emitted
after this timestamp. I think this is bit confusing. Shall we add a logic where 
if already_done is
set, rename the original trace dir to latest timestamp?

Thanks
Harman

> 
> >
> > This happened because "already_done" was set after rte_trace_save()
> called via telemetry.
> > Later rte_eal_cleanup returned from this point without saving later traces.
> >
> > What is the purpose of already_done flag?
> 
> already_done is used to create the trace directory once, and log a message
> with this directory path once.
> 
> 
> --
> David Marchand

Reply via email to