[Toybox] [PATCH] ps: widen the VSIZE field for Android's default view.

Rob Landley rob at landley.net
Tue Feb 28 08:23:36 PST 2023


On 2/27/23 12:05, enh wrote:
>> Sigh. I dunno, one possibility is to redefine -O work off a "PID,TTY,$STUFF,CMD"
>> base regardless of context? Modulo that could still break stuff for you, and the
>> current code is adding the various -f and -w nonsense to that base before
>> backing up and inserting -O at the next-to-last position...
> 
> yeah, i think probably the best we can do without risking the backward
> compatibility world of pain is to have better field auto-sizing
> (rather than the hardcoded "7" and the Android-override "11" we have
> atm). so at least then there's only the one special case, rather than
> a special case on top of a special case :-)

The at-the-time-ubuntu one had hardcoded widths, I made the output match
exactly. You're the one who decided Android should have cosmetic differences
that weren't "alias ps -o..."

Remember when top was autodetecting units and people got upset at the jitter? At
least top probably needs (to retain) stable spacing, and having two codepaths do
it two different  ways...

And the way field autosizing works is to load everything into memory ahead of
time, measure them all, and then display as a second pass, which is doable but
not ideal for embedded systems. It does bring up "ability to sort", but there's
no command line options for that I'm aware of because the unix way to do it is
pipe to sort -k...

> obviously "i don't know what i don't know", but i can't actually find
> anything internally at least that's parsing this. so maybe we could
> try removing it from the defaults and seeing what (if anything)
> _actually_ breaks. probably not right now though!

You need your own variant of pending that's "possible API changes queued up at
the start of a new AOSP dev cycle". (I need pending for tests. I've mostly
gotten pending cleaned out of lib, at least locally...)

>> Hmmm. I haven't implemented -x yet. (I have a whole second pass on ps to do the
>> "ps ax" and "ps -ax" are different thing. I have plumbing! FLAGS_NODASH is set
>> when you provided non-dash arguments...) There could be a new simpler type of
>> output. But "there's too much complexity let's add something" seldom ends well...
> 
> has anyone noticed yet? i feel like the BSD syntax has kind of died out?

I have "ps ax" hardwired into muscle memory because of SunOS workstations in
college. And "tar xvf" is similarly common. And I have "ar" in pending that uses
it, and I vaguely recall one or two other uses in my notes as TODO items...

The BSD syntax was never _that_ widespread, but it's a lot more
common/systematic than anything in dd. :)

>> >> Rob
>>
>> Rob

Still Rob


More information about the Toybox mailing list