Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-20 Thread Jin, Yao
Hi Jiri, On 5/20/2020 3:50 PM, Jiri Olsa wrote: On Wed, May 20, 2020 at 01:36:40PM +0800, Jin, Yao wrote: Hi Jiri, On 5/18/2020 11:28 AM, Jin, Yao wrote: Hi Jiri, On 5/15/2020 4:33 PM, Jiri Olsa wrote: On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: SNIP I think I get the root

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-20 Thread Jiri Olsa
On Wed, May 20, 2020 at 01:36:40PM +0800, Jin, Yao wrote: > Hi Jiri, > > On 5/18/2020 11:28 AM, Jin, Yao wrote: > > Hi Jiri, > > > > On 5/15/2020 4:33 PM, Jiri Olsa wrote: > > > On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: > > > > > > SNIP > > > > > > > I think I get the root

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-19 Thread Jin, Yao
Hi Jiri, On 5/18/2020 11:28 AM, Jin, Yao wrote: Hi Jiri, On 5/15/2020 4:33 PM, Jiri Olsa wrote: On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: SNIP I think I get the root cause. That should be a serious bug in get_group_fd, access violation! For a group mixed with system-wide

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-17 Thread Jin, Yao
Hi Jiri, On 5/15/2020 4:33 PM, Jiri Olsa wrote: On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: SNIP I think I get the root cause. That should be a serious bug in get_group_fd, access violation! For a group mixed with system-wide event and per-core event and the group leader is

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-15 Thread Jiri Olsa
On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: SNIP > I think I get the root cause. That should be a serious bug in get_group_fd, > access violation! > > For a group mixed with system-wide event and per-core event and the group > leader is system-wide event, access violation will

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-15 Thread Jin, Yao
Hi Jiri, On 5/9/2020 3:37 PM, Jin, Yao wrote: Hi Jiri, On 5/5/2020 8:03 AM, Jiri Olsa wrote: On Sat, May 02, 2020 at 10:33:59AM +0800, Jin, Yao wrote: SNIP @@ -1461,6 +1461,9 @@ static int get_group_fd(struct evsel *evsel, int cpu, int thread)    BUG_ON(!leader->core.fd);    fd =

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-09 Thread Jin, Yao
Hi Jiri, On 5/5/2020 8:03 AM, Jiri Olsa wrote: On Sat, May 02, 2020 at 10:33:59AM +0800, Jin, Yao wrote: SNIP @@ -1461,6 +1461,9 @@ static int get_group_fd(struct evsel *evsel, int cpu, int thread) BUG_ON(!leader->core.fd); fd = FD(leader, cpu, thread); + if (fd == -1

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-04 Thread Jiri Olsa
On Sat, May 02, 2020 at 10:33:59AM +0800, Jin, Yao wrote: SNIP > > > @@ -1461,6 +1461,9 @@ static int get_group_fd(struct evsel *evsel, int > > > cpu, int thread) > > > BUG_ON(!leader->core.fd); > > > fd = FD(leader, cpu, thread); > > > + if (fd == -1 &&

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-01 Thread Jin, Yao
Hi Jiri, On 5/1/2020 6:23 PM, Jiri Olsa wrote: On Thu, Apr 30, 2020 at 09:34:51AM +0800, Jin Yao wrote: A metric may consist of system wide event and non system-wide event. The event group leader may be the system wide event. For example, the metric "C2_Pkg_Residency" consists of

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-01 Thread Jiri Olsa
On Thu, Apr 30, 2020 at 09:34:51AM +0800, Jin Yao wrote: > A metric may consist of system wide event and non system-wide event. > The event group leader may be the system wide event. > > For example, the metric "C2_Pkg_Residency" consists of > "cstate_pkg/c2-residency" and "msr/tsc". The former

[PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-04-29 Thread Jin Yao
A metric may consist of system wide event and non system-wide event. The event group leader may be the system wide event. For example, the metric "C2_Pkg_Residency" consists of "cstate_pkg/c2-residency" and "msr/tsc". The former counts on the first CPU of socket (tagged system-wide) and the