Re: [PATCH 01/11] perf tools script: Handle missing fields with -F +..

From: Arnaldo Carvalho de Melo
Date: Mon Feb 25 2019 - 08:49:12 EST


Em Mon, Feb 25, 2019 at 01:56:42PM +0100, Jiri Olsa escreveu:
> On Sun, Feb 24, 2019 at 07:37:12AM -0800, Andi Kleen wrote:
> > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> >
> > When using -F + syntax to add a field the existing defaults
> > are currently all marked user_set. This can cause errors when
> > some field is missing in the perf.data
> >
> > This patch tracks the actually user set fields separately,
> > so that we don't error out in this case.
> >
> > Before:
> >
> > % perf record true
> > % perf script -F +metric
> > Samples for 'cycles:ppp' event do not have CPU attribute set. Cannot print 'cpu' field.
> > %
> >
> > After
> >
> > 5 perf record true
> > % perf script -F +metric
> > perf 28936 278636.237688: 1 cycles:ppp: ffffffff8117da99 perf_event_exec+0x59 (/lib/modules/4.20.0-odilo/build/vmlinux)
> > ...
> > %
> >
> > Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> nice, that one was annoying
>
> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

Applied.

- Arnaldo