RE: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-10-06 Thread Song Bao Hua (Barry Song)
lo ; > linux-kernel ; Peter Zijlstra > ; Andi Kleen ; Libin (Huawei) > ; Ingo Molnar ; > linux-arm-ker...@lists.infradead.org > Subject: Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu > events > > On Thu, Sep 24, 2020 at 11:36:23PM +0900, Namhyung Kim wrote:

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-10-02 Thread Jiri Olsa
On Thu, Sep 24, 2020 at 11:36:23PM +0900, Namhyung Kim wrote: > On Wed, Sep 23, 2020 at 10:19:00PM +0200, Jiri Olsa wrote: > > On Wed, Sep 23, 2020 at 11:15:06PM +0900, Namhyung Kim wrote: > > > I think the problem is that armv8_pmu has a cpumask, > > > and the user requested per-task events. > >

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-25 Thread Jiri Olsa
On Thu, Sep 24, 2020 at 11:36:23PM +0900, Namhyung Kim wrote: > On Wed, Sep 23, 2020 at 10:19:00PM +0200, Jiri Olsa wrote: > > On Wed, Sep 23, 2020 at 11:15:06PM +0900, Namhyung Kim wrote: > > > I think the problem is that armv8_pmu has a cpumask, > > > and the user requested per-task events. > >

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-24 Thread Namhyung Kim
On Wed, Sep 23, 2020 at 10:19:00PM +0200, Jiri Olsa wrote: > On Wed, Sep 23, 2020 at 11:15:06PM +0900, Namhyung Kim wrote: > > I think the problem is that armv8_pmu has a cpumask, > > and the user requested per-task events. > > > > The code tried to open the event with a dummy cpu map > > since

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-24 Thread liwei (GF)
Hi Andi, On 2020/9/23 3:50, Andi Kleen wrote: > On Tue, Sep 22, 2020 at 12:23:21PM -0700, Andi Kleen wrote: >>> After debugging, i found the root reason is that the xyarray fd is created >>> by evsel__open_per_thread() ignoring the cpu passed in >>> create_perf_stat_counter(), while the evsel'

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-23 Thread Jiri Olsa
On Wed, Sep 23, 2020 at 11:15:06PM +0900, Namhyung Kim wrote: > On Wed, Sep 23, 2020 at 11:08 PM Jiri Olsa wrote: > > > > On Wed, Sep 23, 2020 at 10:49:52PM +0900, Namhyung Kim wrote: > > > On Wed, Sep 23, 2020 at 2:44 PM Jiri Olsa wrote: > > > > > > > > On Tue, Sep 22, 2020 at 11:13:45AM +0800,

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-23 Thread Namhyung Kim
On Wed, Sep 23, 2020 at 11:08 PM Jiri Olsa wrote: > > On Wed, Sep 23, 2020 at 10:49:52PM +0900, Namhyung Kim wrote: > > On Wed, Sep 23, 2020 at 2:44 PM Jiri Olsa wrote: > > > > > > On Tue, Sep 22, 2020 at 11:13:45AM +0800, Wei Li wrote: > > > > When executing perf stat with armv8_pmu events with

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-23 Thread Jiri Olsa
On Wed, Sep 23, 2020 at 10:49:52PM +0900, Namhyung Kim wrote: > On Wed, Sep 23, 2020 at 2:44 PM Jiri Olsa wrote: > > > > On Tue, Sep 22, 2020 at 11:13:45AM +0800, Wei Li wrote: > > > When executing perf stat with armv8_pmu events with a workload, it will > > > report a segfault as result. > > > >

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-23 Thread Namhyung Kim
On Wed, Sep 23, 2020 at 2:44 PM Jiri Olsa wrote: > > On Tue, Sep 22, 2020 at 11:13:45AM +0800, Wei Li wrote: > > When executing perf stat with armv8_pmu events with a workload, it will > > report a segfault as result. > > please share the perf stat command line you see that segfault for It seems

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-22 Thread Jiri Olsa
On Tue, Sep 22, 2020 at 11:13:45AM +0800, Wei Li wrote: > When executing perf stat with armv8_pmu events with a workload, it will > report a segfault as result. please share the perf stat command line you see that segfault for thanks, jirka > > (gdb) bt > #0 0x00603fc8 in

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-22 Thread Andi Kleen
On Tue, Sep 22, 2020 at 12:23:21PM -0700, Andi Kleen wrote: > > After debugging, i found the root reason is that the xyarray fd is created > > by evsel__open_per_thread() ignoring the cpu passed in > > create_perf_stat_counter(), while the evsel' cpumap is assigned as the > > corresponding PMU's

Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-22 Thread Andi Kleen
> After debugging, i found the root reason is that the xyarray fd is created > by evsel__open_per_thread() ignoring the cpu passed in > create_perf_stat_counter(), while the evsel' cpumap is assigned as the > corresponding PMU's cpumap in __add_event(). Thus, the xyarray fd is created > with ncpus

[PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events

2020-09-21 Thread Wei Li
When executing perf stat with armv8_pmu events with a workload, it will report a segfault as result. (gdb) bt #0 0x00603fc8 in perf_evsel__close_fd_cpu (evsel=, cpu=) at evsel.c:122 #1 perf_evsel__close_cpu (evsel=evsel@entry=0x716e950, cpu=7) at evsel.c:156 #2 0x004d4718