Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Stefan Parvu
> >>4518644 I/O wait statistic is still misleading > and should be dropped +1. > It really depends on the definition of idl. Is idl defined > to be the > rounded idle time or 100 - (sum of the rounded sys + > rounded usr). > They will be different (as in the example below). Which is > corre

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread David Miller
It really depends on the definition of idl. Is idl defined to be the rounded idle time or 100 - (sum of the rounded sys + rounded usr). They will be different (as in the example below). Which is correct is dependent on the definition you want to use. But as Jim points out, for most analysis the

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Jim Mauro
So that was you! I never know it was you that filed the wt bug (but I should have guessed! :^). I actually agree that the "adding up to 100" really does not matter. In terms of the practical use of CPU utilization data, I don't really distinguish between 90% idle and 88% idle, or %sys at 50% versu

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Phil Harman
Old news, I'm afraid. Any consumer of the cpu sys kstats will seem the same thing. I guess some people just didn't notice until we started discussing it :) At least I managed to get wt permanently set to zero ... 4518644 I/O wait statistic is still misleading and should be dropped http://bu

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread David Miller
Hi Stefan, I haven't looked at the code to see exactly what it does, but what you see could easily be explained by rounding. For example, in the line above the one you mark, usr and sys are both 1, with idl being 97. That doesn't add up to 100, either. But suppose usr and sys are both 1.3, whic

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Stefan Parvu
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 84 00 392 192 706 101001 3414 10 3 0 86 05 00 308 108 2309000 4221 1 0 97 00 00 308 108 2329000 4161

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Stefan Parvu
> >if (Kernel + User > 100) { >User = 100 - Kernel; >} >Idle = 100 - Kernel - User; > > If you want to be smart, you might want to round small > numbers up, and large numbers down (e.g. perhaps any > non-zero amount should always show as at least 1%?) I am working now to man

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Phil Harman
If you really need it to add up to 100, then it's simple ... if (Kernel + User > 100) { User = 100 - Kernel; } Idle = 100 - Kernel - User; If you want to be smart, you might want to round small numbers up, and large numbers down (e.g. perhaps any non-zero amount should always

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Stefan Parvu
> Just grab the nsec values. As I recall, the others are just > lower precision > numbers derived from them. using cpu::sys:cpu_nsec_user,kernel,idle does not fix the problem. I think this is more an issue about printing the output in Perl using print or printf and rounding the values. Example u

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Stefan Parvu
> Just grab the nsec values. As I recall, the others are just > lower precision > numbers derived from them. Cheers. These are most likely the goodies from S10+ regarding the new microstate accounting interface. I will try to experiment and see what I get. Thanks for pointers. stefan __

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Peter Tribble
On Wed, Jan 28, 2009 at 12:23 PM, Stefan Parvu wrote: > Hi, > > Thanks for tip. Are you saying I should have fetched in my script > cpu::sys:cpu_ticks_kernel,user,idle as mpstat does ? > > I had a version some time ago but with similar results. I checked it > and it seems it reports same bogus inf

Re: [perf-discuss] fetching from kstat per cpu stats, sometimes usr+sys+i

2009-01-28 Thread Stefan Parvu
Hi, Thanks for tip. Are you saying I should have fetched in my script cpu::sys:cpu_ticks_kernel,user,idle as mpstat does ? I had a version some time ago but with similar results. I checked it and it seems it reports same bogus information from time to time. Or are you saying that I should forget