|
From: Caspar Z. <cz...@re...> - 2011-07-26 10:36:59
|
getrusage04 - accuracy of getrusage() with RUSAGE_THREAD This program is used for testing the following upstream commit: 761b1d26df542fd5eb348837351e4d2f3bc7bffe. getrusage() returns cpu resource usage with accuracy of 10000us when RUSAGE_THREAD is specified to the argument who. Meanwhile, accuracy is 1000us when RUSAGE_SELF is specified. This bad accuracy of getrusage() caused a big impact on some application which is critical to accuracy of cpu usage. The upstream fix removed casts to clock_t in task_u/stime(), to keep granularity of cputime_t over the calculation. Signed-off-by: Caspar Zhang <cz...@re...> --- runtest/syscalls | 11 +- testcases/kernel/syscalls/getrusage/getrusage04.c | 122 +++++++++++++++++++++ 2 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 testcases/kernel/syscalls/getrusage/getrusage04.c |