Re: [PATCH v4 03/15] perf tools script: Filter COMM/FORK/.. events by CPU

From: Andi Kleen
Date: Fri Mar 08 2019 - 10:08:30 EST


On Fri, Mar 08, 2019 at 10:39:01AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Mar 07, 2019 at 12:02:31PM +0100, Jiri Olsa escreveu:
> > On Wed, Mar 06, 2019 at 04:23:40PM +0200, Adrian Hunter wrote:
> > > On 5/03/19 4:47 PM, Andi Kleen wrote:
> > > > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> > > >
> > > > The --cpu option only filtered samples. Filter other perf events,
> > > > such as COMM, FORK, SWITCH by the CPU too.
> > >
> > > Because tasks can migrate from cpu to cpu, we probably need to process most
> > > of the events anyway, even if they are not printed.
> >
> > agreed, I wonder we could just make the perf_event__fprintf conditional
>
> Humm, probably just do the filtering on PERF_RECORD_SAMPLE is enough?
> I.e. having the other PERF_RECORD_{COMM,MMAP,} etc is required in face
> of migration.

The goal was to only show the output for the correct CPU in the perf
sample context browser. Otherwise the output on larger systems
is very confusing because most of it is for irrelevant CPUs.

-andi