Messages in this thread | | | Date | Tue, 01 Dec 2009 10:02:37 +0900 | From | Hidetoshi Seto <> | Subject | Re: [PATCH 2/2] cputime: introduce thread_group_times() |
| |
Stanislaw Gruszka wrote: > Idea is very good IMHO.
Thank you very much!
>> #ifndef CONFIG_VIRT_CPU_ACCOUNTING >> - cputime_t prev_utime, prev_stime; >> + cputime_t prev_utime, prev_stime, prev_tgutime, prev_tgstime; >> #endif > > I think the new values should be part of struct_signal (see below)
Good point. I'll update patch to do so.
>> /* >> + * Must be called with siglock held. >> + */ >> +void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st) >> +{ >> + struct task_cputime cputime; >> + >> + __thread_group_times(p, &cputime); >> + >> + if (ut) >> + *ut = cputime.utime; >> + if (st) >> + *st = cputime.stime; > > No thread_group_times() nor task_times() is called with NULL arguments, we > can get rid of "if ({u,s}t)" checks. Perhaps thread_group_times() should > have "struct task_cputime" argument as it is wrapper for > thread_group_cputime();
Removing "if ({u,s}t)" is OK with me. I expect all thread_group_times() user should have no interest in members of struct task_cputime other than {u,s}time, so I'd like to keep the argument as is.
Thanks, H.Seto
| |