Re: [PATCH 03/10] perf sched timehist: Handle zero sample->tid properly

2016-12-08 Thread Namhyung Kim
On Wed, Dec 07, 2016 at 11:06:29AM +0900, Namhyung Kim wrote: > On Mon, Dec 05, 2016 at 07:52:57PM -0800, David Ahern wrote: > > On 12/5/16 7:40 PM, Namhyung Kim wrote: > > > Sometimes samples have tid of 0 but non-0 pid. It ends up having a > > > > Any idea how that happens? > > It seems that a

Re: [PATCH 03/10] perf sched timehist: Handle zero sample->tid properly

2016-12-06 Thread Namhyung Kim
On Mon, Dec 05, 2016 at 07:52:57PM -0800, David Ahern wrote: > On 12/5/16 7:40 PM, Namhyung Kim wrote: > > Sometimes samples have tid of 0 but non-0 pid. It ends up having a > > Any idea how that happens? It seems that an exiting task wakes up its parent and the parent might call wait(2) concurr

Re: [PATCH 03/10] perf sched timehist: Handle zero sample->tid properly

2016-12-05 Thread David Ahern
On 12/5/16 7:59 PM, Namhyung Kim wrote: > No, I didn't investigate it yet. Looking at the original code, you > seemed to have same issue and workaround like checking prev_pid or > callchains, right? most likely. As I responded on another patch, the sched timehist command has been used for years

Re: [PATCH 03/10] perf sched timehist: Handle zero sample->tid properly

2016-12-05 Thread Namhyung Kim
Hi David, On Tue, Dec 6, 2016 at 12:52 PM, David Ahern wrote: > On 12/5/16 7:40 PM, Namhyung Kim wrote: >> Sometimes samples have tid of 0 but non-0 pid. It ends up having a > > Any idea how that happens? No, I didn't investigate it yet. Looking at the original code, you seemed to have same is

Re: [PATCH 03/10] perf sched timehist: Handle zero sample->tid properly

2016-12-05 Thread David Ahern
On 12/5/16 7:40 PM, Namhyung Kim wrote: > Sometimes samples have tid of 0 but non-0 pid. It ends up having a Any idea how that happens? > new thread of 0 tid/pid (instead of referring idle task) since tid is > used to search matching task. But I guess it's wrong to use 0 as a > tid when pid is

[PATCH 03/10] perf sched timehist: Handle zero sample->tid properly

2016-12-05 Thread Namhyung Kim
Sometimes samples have tid of 0 but non-0 pid. It ends up having a new thread of 0 tid/pid (instead of referring idle task) since tid is used to search matching task. But I guess it's wrong to use 0 as a tid when pid is set. This patch uses tid only if it has a non-zero value or same as pid (of