On May 28, 2014, at 9:54, John Baldwin <j...@freebsd.org> wrote:

> Yes, I actually started by sorting on the raw delta and ended up going back 
> and fixing
> pctcpu instead.  However, there is a problem in this case which is that you
> still want to fall back to ki_pctcpu if you don't have a valid previous delta
> to compare against.  It's a lot simpler to just fixup ki_pctcpu and not have 
> to go
> change the sorting code explicitly. :(  I actually started out having a 
> function that
> returned a double for the pctcpu, but that would mean recalculating the raw 
> pctcpu
> many, many times during the sort.  Just updating ki_pctcpu once per each 
> process/thread
> per fetch scales a bit better.  I could perhaps use an array to cache raw 
> percentages
> as doubles.
> 
> Ok, try people.freebsd.org/~jhb/patches/top_pctcpu2.patch
> 

Hey, all the 0.00% processes on my server now show up in top with measurable 
usage. Nice. (They're all between 0.3% and 0.9%)
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to