Re: [PATCH] perf util: Fix wrong processing when closing evsel fd

2017-10-18 Thread Arnaldo Carvalho de Melo
Em Wed, Oct 18, 2017 at 10:12:51AM +0200, Jiri Olsa escreveu: > On Wed, Oct 18, 2017 at 11:11:18PM +0800, Jin Yao wrote: > > SNIP > > > This change is introduced by "475fb533fb7d" > > ("perf evsel: Fix buffer overflow while freeing events") > > > > This fix is to let xyarray__max_x() return max_

Re: [PATCH] perf util: Fix wrong processing when closing evsel fd

2017-10-18 Thread Jiri Olsa
On Wed, Oct 18, 2017 at 11:11:18PM +0800, Jin Yao wrote: SNIP > This change is introduced by "475fb533fb7d" > ("perf evsel: Fix buffer overflow while freeing events") > > This fix is to let xyarray__max_x() return max_x (ncpus) and > let xyarry__max_y() return max_y (nthreads) > > Signed-off-by

[PATCH] perf util: Fix wrong processing when closing evsel fd

2017-10-18 Thread Jin Yao
In current xyarray code, xyarray__max_x() returns max_y, and xyarray__max_y() returns max_x. It's confusing and for code logic it looks not correct. Error happens when closing evsel fd. Let's see this scenario: 1. Allocate an fd (pseudo-code) --- perf_evsel__alloc_fd(