From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758781AbcG1O04 (ORCPT ); Thu, 28 Jul 2016 10:26:56 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35664 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757539AbcG1O0s (ORCPT ); Thu, 28 Jul 2016 10:26:48 -0400 Subject: Re: [PATCH] perf sched: fix wrong conversion of task state To: Tomoki Sekiyama , linux-kernel@vger.kernel.org References: <1469624093-16601-1-git-send-email-tomoki.sekiyama.qu@hitachi.com> <63263328-bde5-8cc1-e98b-08448fc163ea@gmail.com> <17B1347950C8C843BCB8CE95F55D63BAB5241488@GSjpTKYDCembx32.service.hitachi.net> <329ca7da-d6ca-2067-0789-63d75f345a90@gmail.com> <000001d1e87d$9b28e680$d17ab380$@hitachi.com> Cc: ltc-kernel@rdgml.intra.hitachi.co.jp, =?UTF-8?B?5qOu6LC355yf5a+/576OIC8gTU9SSVRBTknvvIxNQVNVTUk=?= , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Masami Hiramatsu From: David Ahern Message-ID: <6f116f1a-bcca-d32c-09b1-8464b16e9210@gmail.com> Date: Thu, 28 Jul 2016 08:26:45 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <000001d1e87d$9b28e680$d17ab380$@hitachi.com> Content-Type: text/plain; charset=iso-2022-jp; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/16 9:10 PM, Tomoki Sekiyama 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. 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.