Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 109967 - procps-3.2.5: `ps --sort cputime` does not sort properly
Summary: procps-3.2.5: `ps --sort cputime` does not sort properly
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-20 15:41 UTC by Dmitri Pogosian
Modified: 2006-03-08 19:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitri Pogosian 2005-10-20 15:41:11 UTC
Trying to sort the output of ps on TIME column, like ps -ef --sort time 
does not produce sorted output.  Sorting on any other field, including 
ps -ef --sort start_time works as expected. 

Reproducible: Always
Steps to Reproduce:
1. ps -ef -- sort time 
2. 
3. 
 
Actual Results:  
output is not sorted on TIME field 

Expected Results:  
Expect output to be sorted on TIME field
Comment 1 SpanKY gentoo-dev 2005-10-20 18:38:58 UTC
works fine for me with procps-:
ps -ef --sort time
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Sep07 ?        00:00:01 init [3]         
root         2     1  0 Sep07 ?        00:00:03 [ksoftirqd/0]
root         3     1  0 Sep07 ?        00:00:14 [events/0]
root         4     1  0 Sep07 ?        00:00:00 [khelper]
<snip>
root     19199 26704  0 Sep15 tty1     00:44:47 e16
root     28170     1  0 Sep24 ?        00:00:00 SCREEN
root     26610 28170  0 Sep24 pts/4    00:00:00 -/bin/bash
nobody    6026     1  0 Oct08 ?        00:00:00 /sbin/rpc.statd
root     21904     1  0 Oct17 ?        00:00:00 /usr/sbin/smbd -D
root     16671     1  0 Oct17 ?        00:00:00 /usr/sbin/nmbd -D
<snip>

you didnt say what version of procps you're using or `emerge info` like the bug
report page told you to though
Comment 2 SpanKY gentoo-dev 2005-10-20 18:39:28 UTC
(procps-3.2.5 that is)
Comment 3 Dmitri Pogosian 2005-10-20 22:55:56 UTC
My mistake,  procps-3.2.5-r1,  amd64,  dual processor machine

#ps -fu pogosyan --sort time

pogosyan  9480  9457  0 Oct12 ?        00:00:00 /bin/sh
pogosyan  9508     1  0 Oct12 ?        00:00:02 kdeinit Running...
pogosyan  9511     1  0 Oct12 ?        00:00:07 dcopserver [kdeinit] --nosid
pogosyan  9513  9508  0 Oct12 ?        00:00:00 klauncher [kdeinit]
pogosyan  9516     1  0 Oct12 ?        00:01:45 kded [kdeinit]  
pogosyan  9527     1  0 Oct12 ?        00:00:00 kxkb [kdeinit]  
pogosyan  9537     1  0 Oct12 ?        00:00:00 kaccess [kdeinit]
pogosyan  9538  9480  0 Oct12 ?        00:00:00 kwrapper ksmserver
pogosyan  9540     1  0 Oct12 ?        00:00:00 ksmserver [kdeinit]
pogosyan  9541  9508  0 Oct12 ?        00:00:13 kwin [kdeinit] -session 
pogosyan  9543     1  0 Oct12 ?        00:00:04 kdesktop [kdeinit]
pogosyan  9545     1  0 Oct12 ?        00:00:24 kicker [kdeinit]
pogosyan  9547     1  0 Oct12 ?        00:00:00 klipper [kdeinit]
pogosyan  9550  9508  0 Oct12 ?        00:00:20 konsole [kdeinit] -session
pogosyan  9561     1  0 Oct12 ?        00:00:01 korgac --miniicon korganizer
pogosyan  9563  9508  0 Oct12 ?        00:23:27 konqueror [kdeinit] -session
pogosyan  9567  9550  0 Oct12 pts/2    00:00:00 /bin/bash
pogosyan  9766     1  0 Oct12 ?        00:00:01 kio_uiserver [kdeinit]
pogosyan 17435  9550  0 Oct16 pts/1    00:00:00 /bin/bash
pogosyan 18386  9508  0 Oct19 ?        00:00:03 konsole [kdeinit]
pogosyan 18387 18386  0 Oct19 pts/5    00:00:00 /bin/bash


Don't see it sorted in your output as well !
Comment 4 SpanKY gentoo-dev 2005-10-21 06:17:21 UTC
indeed, i was confusing time with start_time when it's really cputime
Comment 5 Dmitri Pogosian 2005-10-21 08:29:27 UTC
yes, start_time sort works fine. 
 
What I was suprised to find today is that "ps --sort time" does not work 
on my FC2 machine (procps-3.2.3) nor even on my ancient RH8.something 
home desktop with procps-2.0.x either.  So it seems not a recent release issue 
but a long broken functionality.  Interestingly, 'top' does things right, so 
the 'sort time' is not that difficult to make work, it seems. 
Comment 6 Albert Cahalan 2005-10-29 20:25:38 UTC
This feature was never implemented. The sort function for that specifier
is a do-nothing function called sr_nop.

Perhaps ps should exit with an error message when this happens.

(and I guess it would be nice to implement sorting for that item)
Comment 7 SpanKY gentoo-dev 2006-03-08 19:49:11 UTC
known upstream issue