Re: [PATCH v2] perf record: Synthesize COMM event for a command line workload

From: Namhyung Kim
Date: Wed Sep 23 2015 - 01:07:05 EST


On Wed, Sep 23, 2015 at 12:09:20AM -0300, Arnaldo Carvalho de Melo wrote:
> Le 23 sept. 2015 12:04 AM, "Namhyung Kim" <namhyung@xxxxxxxxxx> a Ãcrit :
> >
> > Hi Arnaldo,
> >
> > On Tue, Sep 22, 2015 at 04:48:25PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Humm, I think it is working by accident, as you're not allocating space
> > > for machine->id_hdr_size, please take a look at
> > > perf_event__synthesize_thread_map().
> > >
> > > Right now its not a problem this line in perf_event__prepare_comm():
> > >
> > > memset(event->comm.comm + size, 0, machine->id_hdr_size);
> > >
> > > Because perf_event is an union and some of its elements, like mmap/mmap2
> > > have that PATH_MAX part, but its just a matter of the id_hdr_size
> > > becoming bigger than that and we'll have a problem...
> >
> > Right. I'll send a fix to include the id_hdr part.
>
> Thanks!