ps not showing CPU# correctly

Nikola Knežević laladelausanne at gmail.com
Sat Dec 27 04:04:34 PST 2008


On 27 Dec 2008, at 02:30 , Mateusz Guzik wrote:

>> on my system, I noticed that ps(1) is not showing the CPU#  
>> correctly (it
>> always displays 0). There was a bug in it, and it was fetching  
>> ki_estcpu
>> instead of ki_lastcpu.
>>
>
> From the man page:
>     cpu        short-term CPU usage factor (for scheduling)
>
> Apparently not last cpu's number. :) You're probably using SCHED_ULE -
> this scheduler does not alter td_estcpu and that's why ps -o cpu gives
> you only 0.

Ups :)
I got mislead with top showing the cpu on which process executes.

I find the information on which cpu is process/thread executed quite  
useful for performance debugging. Maybe I should add it to ps as cpu#  
or cpuno or cpuid?

Cheers,
Nikola


More information about the freebsd-hackers mailing list