Date: Mon, 9 Jan 2012 08:59:05 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-stable@freebsd.org Cc: Phil Kulin <schors@gmail.com> Subject: Re: kproc_info system and user time is broken for processes with threads Message-ID: <201201090859.05709.jhb@freebsd.org> In-Reply-To: <CAK=u2EWbAxkg-ka3o07-J_R0eDtm=G_AsX6XRB8rWfz0jCk5JQ@mail.gmail.com> References: <CAK=u2EWbAxkg-ka3o07-J_R0eDtm=G_AsX6XRB8rWfz0jCk5JQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, January 07, 2012 5:06:46 pm Phil Kulin wrote: > kproc_info system and user time is broken for processes with threads, > when fetch then by kvm_getprocs() function call. > For example, modern 'ps' on server running mysqld (145 precached threads) > > # ps -ax -o comm,cputime,systime,usertime | grep mysqld > mysqld 16872:35.39 5249:07.68 3353:36.79 > # ps -ax -o comm,cputime,systime,usertime | grep httpd > httpd 0:00.02 0:00.00 0:00.02 > httpd 0:00.00 0:00.00 0:00.00 > httpd 0:02.51 0:01.77 0:00.75 > > Sum systime+usertime=cputime for httpd, but different for mysqld. > systime and usertime for mysqld not changed many times, but cputime increased. > Modern ps uses ki_rusage.ru_stime and ki_rusage.ru_utime from > kproc_info for systime and usertime statistic. > > What wrong? Hmm, I can't see anything that would explain this. What if you look at individual threads of mysqld (using 'H') flag? Also, which OS version are you using? -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201090859.05709.jhb>