I understand that top and ps are facilities built onto of /proc//*
information. One thing I am not 100% confident is how these number are
collected under the hood. I have two questions reguarding this:

1.The duration used to get the CPU utilization:
1) cpu utilization number from 'ps aux' gives the average CPU
utilization over 'a certain period', but I am not sure how this
'certain' is defined (seems to be undefined in the Document).

2) I can use another approach to collect the numbers, using 'top -b -n
1'
I think this gives me the CPU utilization of a process over a time
period as well, still how long such a time period is unclear to me.

But according to the number I get, I believe the period for approach
(2) is much shorter than the period for approach (1)---because the
number I got from (1) is almost constant.


2. For SMP or Multi-core,
For example, I am running a multithreaded server on a dual-core box,
each core is hyperthreading enabled (4 logic CPU). As shown in the
following example, threads in "myapplication" used 29.2% 17.8% 6.5% and
4.5% CPU resources individually. I guess is that this is for a single
processor's utilization, is it correct? i.e., conceptually, if we can
simply sum up the full horsepower of the processors (i.e., 400% total),
thread 8521 actually used 29.2%/ 400% = 7% of the total horsepower.

to put this question in another way, if I sum up the numbers in %CPU
field, it is possible to get a sum over 100%. Is my understanding
correct?

-------------------------------------
sean$top -b -n 1
top - 15:09:34 up 74 days, 3:58, 1 user, load average: 0.16, 0.33,
0.29
Tasks: 47 total, 1 running, 46 sleeping, 0 stopped, 0 zombie
Cpu(s): 7.7% user, 3.9% system, 0.2% nice, 88.2% idle
Mem: 3863420k total, 3844656k used, 18764k free, 6812k
buffers
Swap: 0k total, 0k used, 0k free, 1726916k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13185 root 18 0 884 880 704 R 31.8 0.0 0:00.55 top
8521 root 13 0 1941m 1.5g 3328 S 29.2 41.1 3022:25 appliction
8520 root 16 0 1941m 1.5g 3328 S 17.8 41.1 2761:19
application
8523 root 9 0 1941m 1.5g 3328 S 6.5 41.1 586:04.67
application
8522 root 9 0 1941m 1.5g 3328 S 4.5 41.1 586:04.67
application


Thanks,
Sean