Skip to contentSkip to conversation

getrusage: RUSAGE_THREAD should return ru_utime and ru_stime

PATCH Applied KOSAKI Motohiro 3 participants 3 messages Jan 3, 2009 – Jan 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getrusage: RUSAGE_THREAD should return ru_utime and ru_stime

I believe that's bugfix. not new implement.

==
Subject: [PATCH] getrusage: RUSAGE_THREAD should return ru_utime and ru_stime
Impact: regression fix

Original getrusage(RUSAGE_THREAD) implementation can return ru_utime and ru_stime. but unforunately commit f06febc96ba8e0af80bcc3eaec0a109e88275fac break it.

this patch restore it.

CC Roland McGrath <[email protected]>
CC Sripathi Kodi <[email protected]>
Cc Ingo Molnar <[email protected]>
CC Frank Mayhar <[email protected]>
---
 kernel/sys.c |    2 ++
 1 file changed, 2 insertions(+)
kernel/sys.c +2 -0
Index: b/kernel/sys.c
===================================================================
@@ -1551,6 +1551,8 @@ static void k_getrusage(struct task_stru
 	utime = stime = cputime_zero;
 
 	if (who == RUSAGE_THREAD) {
+		utime = task_utime(current);
+		stime = task_stime(current);
 		accumulate_thread_rusage(p, r);
 		goto out;
 	}