* Re: [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function
2017-08-07 8:44 ` [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function Xie XiuQi
@ 2017-08-08 6:42 ` kbuild test robot
2017-08-08 8:43 ` Xie XiuQi
2017-08-09 1:16 ` Xie XiuQi
2017-08-08 17:27 ` kbuild test robot
2017-08-10 12:10 ` [tip:sched/core] sched/debug: Intruduce task_state_to_char() " tip-bot for Xie XiuQi
2 siblings, 2 replies; 9+ messages in thread
From: kbuild test robot @ 2017-08-08 6:42 UTC (permalink / raw)
To: Xie XiuQi
Cc: kbuild-all, mingo, peterz, linux-kernel, huawei.libin,
cj.chengjian, xiexiuqi
[-- Attachment #1: Type: text/plain, Size: 12080 bytes --]
Hi Xie,
[auto build test ERROR on tip/sched/core]
[also build test ERROR on v4.13-rc4 next-20170807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Xie-XiuQi/sched-debug-show-task-state-on-proc-sched_debug/20170808-135825
config: i386-randconfig-x019-201732 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
kernel/sched/core.c: In function 'sched_show_task':
>> kernel/sched/core.c:5114:64: error: expected ')' before ';' token
printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p);
^
>> kernel/sched/core.c:5133:1: error: expected ';' before '}' token
}
^
kernel/sched/core.c:5109:6: warning: unused variable 'ppid' [-Wunused-variable]
int ppid;
^~~~
kernel/sched/core.c:5108:16: warning: unused variable 'free' [-Wunused-variable]
unsigned long free = 0;
^~~~
In file included from arch/x86/include/asm/current.h:4:0,
from include/linux/sched.h:11,
from kernel/sched/core.c:8:
kernel/sched/core.c: At top level:
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:390:2: note: in expansion of macro 'if'
if (p_size == (size_t)-1 && q_size == (size_t)-1)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:380:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:378:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:369:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:367:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:358:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:356:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:348:2: note: in expansion of macro 'if'
if (p_size < size || q_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:345:3: note: in expansion of macro 'if'
if (q_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:343:3: note: in expansion of macro 'if'
--
kernel/sched/debug.c: In function 'print_task':
>> kernel/sched/debug.c:432:24: error: implicit declaration of function 'task_sate_to_char' [-Werror=implicit-function-declaration]
SEQ_printf(m, " %c", task_sate_to_char(p));
^
kernel/sched/debug.c:33:17: note: in definition of macro 'SEQ_printf'
seq_printf(m, x); \
^
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/proc_fs.h:7,
from kernel/sched/debug.c:13:
kernel/sched/debug.c: At top level:
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:390:2: note: in expansion of macro 'if'
if (p_size == (size_t)-1 && q_size == (size_t)-1)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:380:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:378:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:369:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:367:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:358:2: note: in expansion of macro 'if'
if (p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:356:2: note: in expansion of macro 'if'
if (__builtin_constant_p(size) && p_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:348:2: note: in expansion of macro 'if'
if (p_size < size || q_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
include/linux/string.h:345:3: note: in expansion of macro 'if'
if (q_size < size)
^~
include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
______f = { \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
vim +5114 kernel/sched/core.c
5105
5106 void sched_show_task(struct task_struct *p)
5107 {
5108 unsigned long free = 0;
5109 int ppid;
5110
5111 if (!try_get_task_stack(p))
5112 return;
5113
> 5114 printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p);
5115
5116 if (p->state == TASK_RUNNING)
5117 printk(KERN_CONT " running task ");
5118 #ifdef CONFIG_DEBUG_STACK_USAGE
5119 free = stack_not_used(p);
5120 #endif
5121 ppid = 0;
5122 rcu_read_lock();
5123 if (pid_alive(p))
5124 ppid = task_pid_nr(rcu_dereference(p->real_parent));
5125 rcu_read_unlock();
5126 printk(KERN_CONT "%5lu %5d %6d 0x%08lx\n", free,
5127 task_pid_nr(p), ppid,
5128 (unsigned long)task_thread_info(p)->flags);
5129
5130 print_worker_info(KERN_INFO, p);
5131 show_stack(p, NULL);
5132 put_task_stack(p);
> 5133 }
5134
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28000 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function
2017-08-08 6:42 ` kbuild test robot
@ 2017-08-08 8:43 ` Xie XiuQi
2017-08-09 1:16 ` Xie XiuQi
1 sibling, 0 replies; 9+ messages in thread
From: Xie XiuQi @ 2017-08-08 8:43 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, mingo, peterz, linux-kernel, huawei.libin, cj.chengjian
Hi,
On 2017/8/8 14:42, kbuild test robot wrote:
> Hi Xie,
>
> [auto build test ERROR on tip/sched/core]
> [also build test ERROR on v4.13-rc4 next-20170807]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
Thanks for your testing, I'll fix it in v2.
--
Xie XiuQi
>
> url: https://github.com/0day-ci/linux/commits/Xie-XiuQi/sched-debug-show-task-state-on-proc-sched_debug/20170808-135825
> config: i386-randconfig-x019-201732 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
> kernel/sched/core.c: In function 'sched_show_task':
>>> kernel/sched/core.c:5114:64: error: expected ')' before ';' token
> printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p);
> ^
>>> kernel/sched/core.c:5133:1: error: expected ';' before '}' token
> }
> ^
> kernel/sched/core.c:5109:6: warning: unused variable 'ppid' [-Wunused-variable]
> int ppid;
> ^~~~
> kernel/sched/core.c:5108:16: warning: unused variable 'free' [-Wunused-variable]
> unsigned long free = 0;
> ^~~~
> In file included from arch/x86/include/asm/current.h:4:0,
> from include/linux/sched.h:11,
> from kernel/sched/core.c:8:
> kernel/sched/core.c: At top level:
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:390:2: note: in expansion of macro 'if'
> if (p_size == (size_t)-1 && q_size == (size_t)-1)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:380:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:378:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:369:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:367:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:358:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:356:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:348:2: note: in expansion of macro 'if'
> if (p_size < size || q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:345:3: note: in expansion of macro 'if'
> if (q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:343:3: note: in expansion of macro 'if'
> --
> kernel/sched/debug.c: In function 'print_task':
>>> kernel/sched/debug.c:432:24: error: implicit declaration of function 'task_sate_to_char' [-Werror=implicit-function-declaration]
> SEQ_printf(m, " %c", task_sate_to_char(p));
> ^
> kernel/sched/debug.c:33:17: note: in definition of macro 'SEQ_printf'
> seq_printf(m, x); \
> ^
> In file included from include/uapi/linux/stddef.h:1:0,
> from include/linux/stddef.h:4,
> from include/uapi/linux/posix_types.h:4,
> from include/uapi/linux/types.h:13,
> from include/linux/types.h:5,
> from include/linux/proc_fs.h:7,
> from kernel/sched/debug.c:13:
> kernel/sched/debug.c: At top level:
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:390:2: note: in expansion of macro 'if'
> if (p_size == (size_t)-1 && q_size == (size_t)-1)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:380:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:378:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:369:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:367:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:358:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:356:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:348:2: note: in expansion of macro 'if'
> if (p_size < size || q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:345:3: note: in expansion of macro 'if'
> if (q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
>
> vim +5114 kernel/sched/core.c
>
> 5105
> 5106 void sched_show_task(struct task_struct *p)
> 5107 {
> 5108 unsigned long free = 0;
> 5109 int ppid;
> 5110
> 5111 if (!try_get_task_stack(p))
> 5112 return;
> 5113
>> 5114 printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p);
> 5115
> 5116 if (p->state == TASK_RUNNING)
> 5117 printk(KERN_CONT " running task ");
> 5118 #ifdef CONFIG_DEBUG_STACK_USAGE
> 5119 free = stack_not_used(p);
> 5120 #endif
> 5121 ppid = 0;
> 5122 rcu_read_lock();
> 5123 if (pid_alive(p))
> 5124 ppid = task_pid_nr(rcu_dereference(p->real_parent));
> 5125 rcu_read_unlock();
> 5126 printk(KERN_CONT "%5lu %5d %6d 0x%08lx\n", free,
> 5127 task_pid_nr(p), ppid,
> 5128 (unsigned long)task_thread_info(p)->flags);
> 5129
> 5130 print_worker_info(KERN_INFO, p);
> 5131 show_stack(p, NULL);
> 5132 put_task_stack(p);
>> 5133 }
> 5134
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
--
Thanks,
Xie XiuQi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function
2017-08-08 6:42 ` kbuild test robot
2017-08-08 8:43 ` Xie XiuQi
@ 2017-08-09 1:16 ` Xie XiuQi
1 sibling, 0 replies; 9+ messages in thread
From: Xie XiuQi @ 2017-08-09 1:16 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, mingo, peterz, linux-kernel, huawei.libin, cj.chengjian
Hi,
I complied patch 2 incomplete, I'll fix it soon.
--
Xie XiuQi
On 2017/8/8 14:42, kbuild test robot wrote:
> Hi Xie,
>
> [auto build test ERROR on tip/sched/core]
> [also build test ERROR on v4.13-rc4 next-20170807]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Xie-XiuQi/sched-debug-show-task-state-on-proc-sched_debug/20170808-135825
> config: i386-randconfig-x019-201732 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
> kernel/sched/core.c: In function 'sched_show_task':
>>> kernel/sched/core.c:5114:64: error: expected ')' before ';' token
> printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p);
> ^
>>> kernel/sched/core.c:5133:1: error: expected ';' before '}' token
> }
> ^
> kernel/sched/core.c:5109:6: warning: unused variable 'ppid' [-Wunused-variable]
> int ppid;
> ^~~~
> kernel/sched/core.c:5108:16: warning: unused variable 'free' [-Wunused-variable]
> unsigned long free = 0;
> ^~~~
> In file included from arch/x86/include/asm/current.h:4:0,
> from include/linux/sched.h:11,
> from kernel/sched/core.c:8:
> kernel/sched/core.c: At top level:
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:390:2: note: in expansion of macro 'if'
> if (p_size == (size_t)-1 && q_size == (size_t)-1)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:380:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:378:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:369:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:367:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:358:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:356:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:348:2: note: in expansion of macro 'if'
> if (p_size < size || q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:345:3: note: in expansion of macro 'if'
> if (q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:343:3: note: in expansion of macro 'if'
> --
> kernel/sched/debug.c: In function 'print_task':
>>> kernel/sched/debug.c:432:24: error: implicit declaration of function 'task_sate_to_char' [-Werror=implicit-function-declaration]
> SEQ_printf(m, " %c", task_sate_to_char(p));
> ^
> kernel/sched/debug.c:33:17: note: in definition of macro 'SEQ_printf'
> seq_printf(m, x); \
> ^
> In file included from include/uapi/linux/stddef.h:1:0,
> from include/linux/stddef.h:4,
> from include/uapi/linux/posix_types.h:4,
> from include/uapi/linux/types.h:13,
> from include/linux/types.h:5,
> from include/linux/proc_fs.h:7,
> from kernel/sched/debug.c:13:
> kernel/sched/debug.c: At top level:
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:390:2: note: in expansion of macro 'if'
> if (p_size == (size_t)-1 && q_size == (size_t)-1)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:380:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:378:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:369:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:367:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:358:2: note: in expansion of macro 'if'
> if (p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:356:2: note: in expansion of macro 'if'
> if (__builtin_constant_p(size) && p_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:348:2: note: in expansion of macro 'if'
> if (p_size < size || q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
> include/linux/string.h:345:3: note: in expansion of macro 'if'
> if (q_size < size)
> ^~
> include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
> ______f = { \
> ^
> include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
> #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> ^~~~~~~~~~
>
> vim +5114 kernel/sched/core.c
>
> 5105
> 5106 void sched_show_task(struct task_struct *p)
> 5107 {
> 5108 unsigned long free = 0;
> 5109 int ppid;
> 5110
> 5111 if (!try_get_task_stack(p))
> 5112 return;
> 5113
>> 5114 printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p);
> 5115
> 5116 if (p->state == TASK_RUNNING)
> 5117 printk(KERN_CONT " running task ");
> 5118 #ifdef CONFIG_DEBUG_STACK_USAGE
> 5119 free = stack_not_used(p);
> 5120 #endif
> 5121 ppid = 0;
> 5122 rcu_read_lock();
> 5123 if (pid_alive(p))
> 5124 ppid = task_pid_nr(rcu_dereference(p->real_parent));
> 5125 rcu_read_unlock();
> 5126 printk(KERN_CONT "%5lu %5d %6d 0x%08lx\n", free,
> 5127 task_pid_nr(p), ppid,
> 5128 (unsigned long)task_thread_info(p)->flags);
> 5129
> 5130 print_worker_info(KERN_INFO, p);
> 5131 show_stack(p, NULL);
> 5132 put_task_stack(p);
>> 5133 }
> 5134
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
--
Thanks,
Xie XiuQi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function
2017-08-07 8:44 ` [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function Xie XiuQi
2017-08-08 6:42 ` kbuild test robot
@ 2017-08-08 17:27 ` kbuild test robot
2017-08-10 12:10 ` [tip:sched/core] sched/debug: Intruduce task_state_to_char() " tip-bot for Xie XiuQi
2 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2017-08-08 17:27 UTC (permalink / raw)
To: Xie XiuQi
Cc: kbuild-all, mingo, peterz, linux-kernel, huawei.libin,
cj.chengjian, xiexiuqi
[-- Attachment #1: Type: text/plain, Size: 4824 bytes --]
Hi Xie,
[auto build test ERROR on tip/sched/core]
[also build test ERROR on v4.13-rc4 next-20170808]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Xie-XiuQi/sched-debug-show-task-state-on-proc-sched_debug/20170808-135825
config: x86_64-randconfig-ws0-08082012 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/proc_fs.h:7,
from kernel/sched/debug.c:13:
kernel/sched/debug.c: In function 'print_task':
>> include/linux/compiler.h:159:17: error: implicit declaration of function 'task_sate_to_char' [-Werror=implicit-function-declaration]
static struct ftrace_branch_data \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^
>> kernel/sched/debug.c:32:2: note: in expansion of macro 'if'
if (m) \
^
>> kernel/sched/debug.c:432:3: note: in expansion of macro 'SEQ_printf'
SEQ_printf(m, " %c", task_sate_to_char(p));
^
cc1: some warnings being treated as errors
--
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/proc_fs.h:7,
from kernel//sched/debug.c:13:
kernel//sched/debug.c: In function 'print_task':
>> include/linux/compiler.h:159:17: error: implicit declaration of function 'task_sate_to_char' [-Werror=implicit-function-declaration]
static struct ftrace_branch_data \
^
include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^
kernel//sched/debug.c:32:2: note: in expansion of macro 'if'
if (m) \
^
kernel//sched/debug.c:432:3: note: in expansion of macro 'SEQ_printf'
SEQ_printf(m, " %c", task_sate_to_char(p));
^
cc1: some warnings being treated as errors
vim +/task_sate_to_char +159 include/linux/compiler.h
2bcd521a Steven Rostedt 2008-11-21 148
2bcd521a Steven Rostedt 2008-11-21 149 #ifdef CONFIG_PROFILE_ALL_BRANCHES
2bcd521a Steven Rostedt 2008-11-21 150 /*
2bcd521a Steven Rostedt 2008-11-21 151 * "Define 'is'", Bill Clinton
2bcd521a Steven Rostedt 2008-11-21 152 * "Define 'if'", Steven Rostedt
2bcd521a Steven Rostedt 2008-11-21 153 */
ab3c9c68 Linus Torvalds 2009-04-07 154 #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
ab3c9c68 Linus Torvalds 2009-04-07 155 #define __trace_if(cond) \
b33c8ff4 Arnd Bergmann 2016-02-12 156 if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
2bcd521a Steven Rostedt 2008-11-21 157 ({ \
2bcd521a Steven Rostedt 2008-11-21 158 int ______r; \
2bcd521a Steven Rostedt 2008-11-21 @159 static struct ftrace_branch_data \
2bcd521a Steven Rostedt 2008-11-21 160 __attribute__((__aligned__(4))) \
2bcd521a Steven Rostedt 2008-11-21 161 __attribute__((section("_ftrace_branch"))) \
2bcd521a Steven Rostedt 2008-11-21 162 ______f = { \
2bcd521a Steven Rostedt 2008-11-21 163 .func = __func__, \
2bcd521a Steven Rostedt 2008-11-21 164 .file = __FILE__, \
2bcd521a Steven Rostedt 2008-11-21 165 .line = __LINE__, \
2bcd521a Steven Rostedt 2008-11-21 166 }; \
2bcd521a Steven Rostedt 2008-11-21 167 ______r = !!(cond); \
97e7e4f3 Witold Baryluk 2009-03-17 168 ______f.miss_hit[______r]++; \
2bcd521a Steven Rostedt 2008-11-21 169 ______r; \
2bcd521a Steven Rostedt 2008-11-21 170 }))
2bcd521a Steven Rostedt 2008-11-21 171 #endif /* CONFIG_PROFILE_ALL_BRANCHES */
2bcd521a Steven Rostedt 2008-11-21 172
:::::: The code at line 159 was first introduced by commit
:::::: 2bcd521a684cc94befbe2ce7d5b613c841b0d304 trace: profile all if conditionals
:::::: TO: Steven Rostedt <srostedt@redhat.com>
:::::: CC: Ingo Molnar <mingo@elte.hu>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30027 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [tip:sched/core] sched/debug: Intruduce task_state_to_char() helper function
2017-08-07 8:44 ` [PATCH 2/2] sched/debug: intruduce task_state_to_char helper function Xie XiuQi
2017-08-08 6:42 ` kbuild test robot
2017-08-08 17:27 ` kbuild test robot
@ 2017-08-10 12:10 ` tip-bot for Xie XiuQi
2 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Xie XiuQi @ 2017-08-10 12:10 UTC (permalink / raw)
To: linux-tip-commits
Cc: xiexiuqi, tglx, hpa, mingo, cj.chengjian, linux-kernel, torvalds,
peterz, huawei.libin
Commit-ID: 20435d84e5f2041c64c792399ab6f2948a2c2252
Gitweb: http://git.kernel.org/tip/20435d84e5f2041c64c792399ab6f2948a2c2252
Author: Xie XiuQi <xiexiuqi@huawei.com>
AuthorDate: Mon, 7 Aug 2017 16:44:23 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 10 Aug 2017 12:18:20 +0200
sched/debug: Intruduce task_state_to_char() helper function
Now that we have more than one place to get the task state,
intruduce the task_state_to_char() helper function to save some code.
No functionality changed.
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <cj.chengjian@huawei.com>
Cc: <huawei.libin@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1502095463-160172-3-git-send-email-xiexiuqi@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/linux/sched.h | 13 +++++++++++++
kernel/sched/core.c | 15 ++++-----------
kernel/sched/debug.c | 10 +++-------
3 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8337e2d..c28b182 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1229,6 +1229,19 @@ static inline pid_t task_pgrp_nr(struct task_struct *tsk)
return task_pgrp_nr_ns(tsk, &init_pid_ns);
}
+static inline char task_state_to_char(struct task_struct *task)
+{
+ const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
+ unsigned long state = task->state;
+
+ state = state ? __ffs(state) + 1 : 0;
+
+ /* Make sure the string lines up properly with the number of task states: */
+ BUILD_BUG_ON(sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1);
+
+ return state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?';
+}
+
/**
* is_global_init - check if a task structure is init. Since init
* is free to have sub-threads we need to check tgid.
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6d91c10..f9f9948 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5103,24 +5103,17 @@ out_unlock:
return retval;
}
-static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
-
void sched_show_task(struct task_struct *p)
{
unsigned long free = 0;
int ppid;
- unsigned long state = p->state;
-
- /* Make sure the string lines up properly with the number of task states: */
- BUILD_BUG_ON(sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1);
if (!try_get_task_stack(p))
return;
- if (state)
- state = __ffs(state) + 1;
- printk(KERN_INFO "%-15.15s %c", p->comm,
- state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
- if (state == TASK_RUNNING)
+
+ printk(KERN_INFO "%-15.15s %c", p->comm, task_state_to_char(p));
+
+ if (p->state == TASK_RUNNING)
printk(KERN_CONT " running task ");
#ifdef CONFIG_DEBUG_STACK_USAGE
free = stack_not_used(p);
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index d8d2ea2..cfd84f7 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -426,14 +426,10 @@ static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
static void
print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
{
- unsigned long state;
-
- if (rq->curr == p) {
+ if (rq->curr == p)
SEQ_printf(m, ">R");
- } else {
- state = p->state ? __ffs(p->state) + 1 : 0;
- SEQ_printf(m, " %c", state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
- }
+ else
+ SEQ_printf(m, " %c", task_state_to_char(p));
SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
p->comm, task_pid_nr(p),
^ permalink raw reply related [flat|nested] 9+ messages in thread