Re: [PATCH 2/2] cputime: introduce thread_group_times()

From: Hidetoshi Seto
Date: Mon Nov 30 2009 - 20:03:26 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/