please help me make sense of top's CPU output

View: New views
4 Messages — Rating Filter:   Alert me  

please help me make sense of top's CPU output

by chrisstankevitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I recently performed a CPU intensive task with Xorg.  When I completed the task and Xorg no longer was using the CPU, I got this result from top:

===

last pid:  1201;  load averages:  0.24,  0.10,  0.09    up 0+00:29:42
63 processes:  1 running, 62 sleeping
CPU:  1.0% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.0% idle
Mem: 161M Active, 67M Inact, 68M Wired, 1240K Cache, 41M Buf, 1676M Free
Swap: 4060M Total, 4060M Free

  PID USERNAME     THR PRI NICE   SIZE    RES STATE  C   TIME    CPU
 1017 cstankevitz    1 104    0   366M   331M select 0   3:25 35.89% Xorg

===

Note that the "CPU" row reports 99% idle.
Note that the "CPU" column reports 36% Xorg

I have two questions:

1. Why do these two numbers seem to not agree?  One reports the CPU is not being used, the other reports Xorg is using the CPU.

2. How can I change my system so that these two numbers seem to agree?

Thank you,

Chris

PS: conky does the same thing -- I assume this means the seemingly disagreeing numbers are coming from the FreeBSD kernel.





     
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: please help me make sense of top's CPU output

by Dan Nelson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In the last episode (Nov 02), Chris Stankevitz said:

> I recently performed a CPU intensive task with Xorg.  When I completed the
> task and Xorg no longer was using the CPU, I got this result from top:
>
> ===
>
> last pid:  1201;  load averages:  0.24,  0.10,  0.09    up 0+00:29:42
> 63 processes:  1 running, 62 sleeping
> CPU:  1.0% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.0% idle
> Mem: 161M Active, 67M Inact, 68M Wired, 1240K Cache, 41M Buf, 1676M Free
> Swap: 4060M Total, 4060M Free
>
>   PID USERNAME     THR PRI NICE   SIZE    RES STATE  C   TIME    CPU
>  1017 cstankevitz    1 104    0   366M   331M select 0   3:25 35.89% Xorg

The CPU column in the process list is a decaying average (more useful to the
kernel scheduler than an instantaneous value).  You'll see it slowly drop to
0 over 10-15 seconds.

Junior Hacker Project: add an instantaneous-CPU value (calculated by
subtracting successive ki_runtime values) to the list of things top
calculates and toggle it and weighted-CPU when pressing C.  The toggling
code is already there; it just toggles between two different weighted-cpu
values at the moment.

--
        Dan Nelson
        dnelson@...
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: please help me make sense of top's CPU output

by Chris Stankevitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan Nelson wrote:
> Junior Hacker Project: add an instantaneous-CPU value (calculated by
> subtracting successive ki_runtime values) to the list of things top
> calculates and toggle it and weighted-CPU when pressing C.  The toggling
> code is already there; it just toggles between two different weighted-cpu
> values at the moment.
>

Makes sense, thank you.  If I want to hack a port program, I go to the
"work" directory, edit the source, and rebuild.  How do I hack a
non-port program like top?

Chris
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: please help me make sense of top's CPU output

by Chris Rees :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/3 Chris Stankevitz <cstankevitz@...>:

> Dan Nelson wrote:
>>
>> Junior Hacker Project: add an instantaneous-CPU value (calculated by
>> subtracting successive ki_runtime values) to the list of things top
>> calculates and toggle it and weighted-CPU when pressing C.  The toggling
>> code is already there; it just toggles between two different weighted-cpu
>> values at the moment.
>>
>
> Makes sense, thank you.  If I want to hack a port program, I go to the
> "work" directory, edit the source, and rebuild.  How do I hack a non-port
> program like top?
>
> Chris

Look in the Makefile for /usr/src/usr.bin/top, and you'll see the
source is in /usr/src/contrib/top

Hack away!

Chris
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in a mailing list?
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."