Re: [PATCH] perf sched: fix wrong conversion of task state

From: 関山友輝 / SEKIYAMA,TOMOKI
Date: Thu Jul 28 2016 - 22:30:26 EST


On 2016/07/28 23:26、David Ahern wrote:
>> But that means we cannot handle preemption correctly as far as
>> sched:sched_switch
>> event uses TASK_STATE_MAX to mark preempted tasks.
>>
>> Should we stop using TASK_STATE_MAX for preempted tasks in ftrace and
>> use (1 << 63) or something that doesn't change on kernel version instead?
>
> ftrace printing is within the kernel so it has consistency.
Agreed.

> It is the save data and analyze later use case that can not assume TASK_STATE_MAX means preemption since the value of TASK_STATE_MAX is kernel version dependent.

That means we cannot measure delay by preemption using perf sched latency. :(
It might be helpful if the preemption mark becomes kernel-version-independent at least for future kernel version..

Anyway, this time I will post the patch to fix only invalid conversion issue of task state with this patch.

Thanks,
Tomoki Sekiyama