[Toybox] Moving ps name fields around.

enh enh at google.com
Mon Jun 20 09:14:05 PDT 2016


On Sun, Jun 19, 2016 at 5:09 AM, Rob Landley <rob at landley.net> wrote:
> On 06/15/2016 12:25 PM, enh wrote:
>> On Tue, Jun 14, 2016 at 1:50 PM, Rob Landley <rob at landley.net> wrote:
>>> On 06/13/2016 07:29 PM, enh wrote:
>>>> AOSP is now using this, and ps lgtm.
>>>
>>> Yay!
>>
>> the netstat cleanup doesn't seem to have broken anything obvious either :-)
>
> You mean the first round of netstat cleanup didn't. :)

okay, i'll keep an eye out :-)

> Although actually it did: DGRAM sockets used to have a blank state and
> now they say LISTENING. (I'm diffing this netstat's output with the
> host's, using -w to workaround the fact that the host left justifies
> the inode field and this one right justifies. I left that alone because
> right justifying numbers is probably better from a readability
> standpoint.)
>
> The other big difference (not introduced by me, it was there in the
> version from last week) is that the "Foreign address" field truncates
> differently:
>
> -tcp        0      0 driftwood:47114         r-199-59-148-23.t:https ESTABLISHED
> +tcp        0      0 driftwood:47114         r-199-59-148-23.twttr.c ESTABLISHED
>
> I.E. the Ubuntu version carves enough space out the right edge of the
> name to show the full protocol, and this appends the protocol to the
> name and _then_ truncates it. (The append is in addr2str(), the truncate
> is in display_routes(). The first hasn't got the length information
> so it _can't_ produce the expected output string.)
>
> I also confirmed that expanding the window width doesn't affect the
> ubuntu version's behavior: it's hardwired column sizes adding up to
> 80 columns. (Actually 79. But it was worth a look...)

ugh. given feedback internally and from lipi lee off-list -- basically
everyone under the age of 65 thinks that netstat truncating addresses
is a bug rather than a feature and when you tell them the workaround
they wonder why -W isn't the default -- i was tempted to suggest we
make -W the default.

netstat is one of those commands (like readelf) where i just
automatically type the -W. even when i *was* on a VT100, having
correct output always seemed more useful than having short output. (at
least GUIs that truncate tend to leave an ellipsis so you know they
screwed you over.)

> Rob



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list