]> granicus.if.org Git - procps-ng/commit
ps: fix cpu utilization sorting
authorJan Görig <jgorig@redhat.com>
Mon, 23 Apr 2012 18:45:10 +0000 (20:45 +0200)
committerCraig Small <csmall@enc.com.au>
Tue, 24 Apr 2012 23:34:06 +0000 (09:34 +1000)
commitcdeb9a071ad2ae56f1395bca75845bfff7c76694
tree7212076093b7d3f9ce074c85411b2fb55ffdffa0
parent43d4aac43ffa9f276c3a3288926197b6b8c1572f
ps: fix cpu utilization sorting

The sniplet below resulted not to be sorted correctly.

for i in $(seq 1 50); do ls -R /usr &>/dev/null 2>&1 & done
    sleep 1; ps -e --sort=pcpu -o pcpu,comm=; pkill ls

Issue is present since older versions of procps (3.2.7/3.2.8).

Reference: http://www.freelists.org/post/procps/top-incorrect-sort,2
Reported-by: Jaromir Capik <jcapik@redhat.com>
Backported-by: Sami Kerola <kerolasa@iki.fi>
ps/display.c