[Toybox] ps and top (and Android)

enh enh at google.com
Fri Apr 29 14:06:13 PDT 2016


sorry, hadn't had time to look until now. notes:

* the tid column seems very wrong. in particular, i see a lot of
duplicate tids. ah, the pid/tid columns don't auto-expand and are
truncating...

GNU: 147139 130820 ?        00:00:00 default_ThreadM
toybox: 14713 13082 ?        00:00:00 default_ThreadM

* your -T is (like the desktop) showing the process name for each
thread. Android shows the thread name, which is probably what you want
if you're asking to see the threads in the first place.

* you say 0 for BIT when you don't know, rather than leaving it blank
(like Android) or using '-' (like some other ps fields). i don't think
this matters, but i've attached a patch anyway.

* there's a whitespace mixup in the help text for -O. patch attached.

* i need to send you the Android-specific cruft for scheduling policy.

other than that, i went through my old notes and i think everything
else is now done. i'll get AOSP synced this afternoon (must be friday
again!) and send you a patch for the scheduling policy names.

On Mon, Apr 25, 2016 at 11:59 PM, Rob Landley <rob at landley.net> wrote:
> On 04/23/2016 11:13 AM, enh wrote:
>> On Sat, Apr 23, 2016 at 3:06 AM, Rob Landley <rob at landley.net> wrote:
>>>>> Android's top is showing thread count as field #5, and "PCY" (scheduling
>>>>> policy) as field #8. And that's fetched with infrastructure that doesn't
>>>>> exist on Ubuntu: get_sched_policy() and get_sched_policy_name(). Um,
>>>>> does this need to be fixed up too? (My top has "pr" and "ni" in the
>>>>> default output. You can add SCHED with -o, but it's numeric, and the
>>>>> help text doesn't match the android fields (audio?).)
>>>>
>>>> yeah, don't worry about that stuff --- i'll send you patches for those
>>>> things later. (it's more cutils cruft. it's hairy enough and changes
>>>> from release to release that i think it would be a mistake for toybox
>>>> to try to do it itself.)
>>>
>>> Works for me. Lemme see what I can do with ps...
>
> I added -T to ps, and "-o tid,tcnt,bit".
>
> Does that cover it, or is there more?
>
> I haven't done top or pgrep yet. Open to suggestions on what changes I
> should make to top, actually. (New default behavior should be...?)
>
> Rob



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-ps-O-help-output-alignment.patch
Type: text/x-patch
Size: 789 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20160429/dbc2dd2d/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Show-rather-0-if-we-don-t-know-whether-a-process-is-.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20160429/dbc2dd2d/attachment-0009.bin>


More information about the Toybox mailing list