tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: top(1) WCPU value output for threaded application on SMP systems



In article <20090424183403.GA431698%medusa.sis.pasteur.fr@localhost>,
Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
>-=-=-=-=-=-
>
>
>Hi,
>
>While working on some threaded application; i noticed that, on SMP
>systems, the WCPU percent value displayed by top(1) can now overflows
>the provided 5 columns :
>
>CPU0 states: 95.0% user,  0.0% nice,  5.0% system,  0.0% interrupt,  0.0% idle
>CPU1 states: 94.1% user,  0.0% nice,  0.0% system,  0.0% interrupt,  5.9% idle
>Memory: 1111M Act, 555M Inact, 7364K Wired, 30M Exec, 1589M File, 28M Free
>Swap: 10G Total, 10G Free
>
>  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
>15891 njoly     25    0    57M   23M RUN/0      0:13 146.63% 48.39% thread_test
>    0 root     124    0     0K   15M CPU/0      1:32  0.00%  0.00% [system]
>
>The attached patch ensure that it won't escape anymore, by discarding
>the decimal part when the value reaches 100.0% :
>
>  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
>15891 njoly     25    0    57M   23M RUN/0      0:13   146% 48.39% thread_test
>    0 root     124    0     0K   15M CPU/0      1:32  0.00%  0.00% [system]
>
>Comments ?

commit it.

christos



Home | Main Index | Thread Index | Old Index