[Toybox] ps down, top to go

Rob Landley rob at landley.net
Sun May 22 10:19:42 PDT 2016


On 05/21/2016 11:52 AM, enh wrote:
> On Fri, May 20, 2016 at 3:37 PM, Rob Landley <rob at landley.net> wrote:
>>> toolbox top wasn't trying to be consistent with ps, and
>>> neither supported all the traditional CMD/COMM/CMDLINE/ARGS variants,
>>> so effectively just went with a new field that's explicitly the
>>> process name. so if you don't mind adding yet another field name, i
>>> think that's the simplest option (and simplest to explain in the
>>> --help output too).
>>
>> Or I can do that, but when you say "process name" do you mean:
>>
>> 1) stat[2]
>> 2) argv[0] with path
>> 3) argv[0] minus path
>> 4) argv[]
>> 5) something else?
> 
> /me checks the source... looks like /proc/%d/cmdline up to the first
> '\0'. which i think is 2.

So "COMMAND", when I was proposing "CMDLINE"  (4 above).

Hmmm, COMMAND is already showing the readlink of /proc/$PID/exe, which
is _also_ blanked for threads, but overriding that one doesn't change
the behavior of the other fields. (It has its own string slot...)

[half a day of working out how to rejuggle object lifetime rules so
get_ps can take a previous get_ps into account, eventually breaking down
and adding another global.]

Ok, try now.

>> That's it, I'm breaking the 6 we've already got out into their own
>> section in the help text...
> 
> yeah, however you think the others should be order, this subset is
> crazy enough to warrant it.

Also large enough. :)

Rob


More information about the Toybox mailing list