Re: [PATCH] perf, script: Fix crash with printing mixed trace point and other events

From: Arnaldo Carvalho de Melo
Date: Fri Jan 18 2019 - 07:59:27 EST


Em Fri, Jan 18, 2019 at 10:49:19AM +0100, Jiri Olsa escreveu:
> On Thu, Jan 17, 2019 at 11:48:34AM -0800, Andi Kleen wrote:
> > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

> > perf script crashes currently when printing mixed trace points and other
> > events because the trace format does not handle events without trace
> > meta data. Add a simple check to avoid that.

> > % cat > test.c
> > main()
> > {
> > printf("Hello world\n");
> > }
> > ^D
> > % gcc -g -o test test.c
> > % sudo perf probe -x test 'test.c:3'
> > % perf record -e '{cpu/cpu-cycles,period=10000/,probe_test:main}:S' ./test
> > % perf script
> > <segfault>

> > Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

Thanks, tested and applied.

While testing I found something odd, the cycles events are not showing
the CPU and the probe events shows a "negative" CPU column,
investigating.

- Arnaldo