diff options
author | Xiao Guangrong <[email protected]> | 2009-12-09 17:51:30 +0800 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2009-12-09 10:59:12 +0100 |
commit | c0c9e72150c07b4a6766cd24a6f685ec2dc9c343 (patch) | |
tree | 1672baebe9ef71d560820e70e3f6865bc6aaaf5b /lib/cpu-notifier-error-inject.c | |
parent | 822a6961112f0c9101d3359d8524604c3309ee6c (diff) |
perf sched: Fix for getting task's execution time
In current code, task's execute time is got by reading
'/proc/<pid>/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 <[email protected]>
Signed-off-by: Xiao Guangrong <[email protected]>
Cc: Xiao Guangrong <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Paul Mackerras <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions