From: Xiao Guangrong Date: Wed, 9 Dec 2009 09:51:30 +0000 (+0800) Subject: perf sched: Fix for getting task's execution time X-Git-Tag: v2.6.33-rc1~306^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0c9e72150c07b4a6766cd24a6f685ec2dc9c343;p=pandora-kernel.git perf sched: Fix for getting task's execution time In current code, task's execute time is got by reading '/proc//sched' file, it's wrong if the task is created by pthread_create(), because every thread task has same pid. This way also has two demerits: 1: 'perf sched replay' can't work if the kernel is not compiled with the 'CONFIG_SCHED_DEBUG' option 2: perf tool should depend on proc file system So, this patch uses PERF_COUNT_SW_TASK_CLOCK to get task's execution time instead of reading /proc file. Changelog v2 -> v3: use PERF_COUNT_SW_TASK_CLOCK instead of rusage() as Ingo's suggestion Reported-by: Torok Edwin Signed-off-by: Xiao Guangrong Cc: Xiao Guangrong Cc: Peter Zijlstra Cc: Frederic Weisbecker Cc: Paul Mackerras LKML-Reference: <4B1F7322.80103@cn.fujitsu.com> Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed