[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sorting processes by "pri"
From: |
Bob Proulx |
Subject: |
Re: Sorting processes by "pri" |
Date: |
Sat, 15 Nov 2014 15:25:31 -0700 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hello Artem,
Artem Yegorov wrote:
> Hi, why does not the sort processes by priority? This is a bug or not?
> I attached a screenshot with a problem.
> I use VMware Workstation and Ubuntu 14.04 LTS
Thank you for taking this discussion here to help-gnu-utils from
bug-bash. That is great!
However you did not take my request NOT to attach graphical
screenshots. Why did you attach a graphical image again?
This mailing list appears to strip image attachments. Which is a good thing.
Since I saw the previous message in bug-bash with the screenshot there
I will reference it here.
http://lists.gnu.org/archive/html/bug-bash/2014-11/msg00084.html
http://lists.gnu.org/archive/html/bug-bash/2014-11/pngbErR9YjqXZ.png
That would be much better for a cut and paste of the text of the
output.
> Hi, why does not the sort processes by priority? This is a bug or not?
The smallest reproducer I found is:
ps -Ao pri --sort pri
I am not familiar with this action but the man page says:
--sort spec
Specify sorting order. Sorting syntax is
[+|-]key[,[+|-]key[,...]]. Choose a multi-letter key from the
STANDARD FORMAT SPECIFIERS section. The "+" is optional since
default direction is increasing numerical or lexicographic
order. Identical to k. For example: ps jax --sort=uid,-ppid,
+pid
And later there is an example using it this way:
For example: ps -eo pid,user,args --sort user
Therefore it looks like it should work. However I can confirm that
while sorting for user as above works that sorting for pri as below
does not.
ps -eo pid,user,args --sort pri
Further reading of the man page finds this statement just above the
list of format specifiers.
Some keywords may not be available for sorting.
That is an escape clause. With that documented then perhaps none of
them could be available for sorting and it would be documented
behavior. I think that is quite poor.
Therefore to me this looks like an unimplemented feature. A feature
that should exist but hasn't been implemented. And the documentation
of it in the man page is poor. I would like to see the docs list out
which format specifiers are available and which are not.
Further reading of the man page says:
Please send bug reports to ⟨procps@freelists.org⟩. No subscription is
required or suggested.
Therefore if you wish to pursue this further with the upstream I would
take the discussion to them directly. The 'ps' command is not a GNU
project program. On my Debian system it is distributed in the procps
package. The package is a packaging of the procps-ng fork of the
previous project. Since you are using Ubuntu it will be a fork of the
Debian package too. The package lists the following information that
may be useful.
https://gitorious.org/procps/pages/Home
The FAQ is interesting:
http://procps.sourceforge.net/faq.html
Mailing lists for the procps project:
http://www.freelists.org/archive/procps/
Officially since you are using Ubuntu you would be expected to make a
bug report to the Ubuntu bug tracker. There are currently already
quite a few bug reports listed there.
https://launchpad.net/ubuntu/+source/procps
Good luck!
Bob