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 <[email protected]> wrote: > On 04/23/2016 11:13 AM, enh wrote: >> On Sat, Apr 23, 2016 at 3:06 AM, Rob Landley <[email protected]> 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.
From 36f90cf74cd86c34480685d78aa1b26008dd6f50 Mon Sep 17 00:00:00 2001 From: Elliott Hughes <[email protected]> Date: Fri, 29 Apr 2016 13:44:01 -0700 Subject: [PATCH] Fix ps -O help output alignment. --- toys/posix/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 9251e04..e56a8e5 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -86,7 +86,7 @@ config PS -f Full listing (-o USER:8=UID,PID,PPID,C,STIME,TTY,TIME,CMD) -l Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD) -o Output FIELDs instead of defaults, each with optional :size and =title - -O Add FIELDS to defaults + -O Add FIELDS to defaults -Z Include LABEL Available -o FIELDs: -- 2.8.0.rc3.226.g39d4020
From 1619fc2a376b224ac688c9372b4c0c98a0c74654 Mon Sep 17 00:00:00 2001 From: Elliott Hughes <[email protected]> Date: Fri, 29 Apr 2016 14:04:40 -0700 Subject: [PATCH] Show "-" rather 0 if we don't know whether a process is 32- or 64-bit. --- toys/posix/ps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toys/posix/ps.c b/toys/posix/ps.c index e56a8e5..8b35e1c 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -409,7 +409,7 @@ static char *string_field(struct carveup *tb, struct strawberry *field) long long *slot = tb->slot, ll = (sl >= 0) ? slot[sl&63] : 0; // numbers, mostly from /proc/$PID/stat - if (which <= PS_CPU) { + if (which <= PS_BIT) { char *fmt = "%lld"; if (which==PS_PRI) ll = 39-ll; @@ -418,7 +418,7 @@ static char *string_field(struct carveup *tb, struct strawberry *field) else if (which==PS_RSS) ll <<= 2; else if (which==PS_VSZ) ll >>= 10; else if (which==PS_PR && ll<-9) fmt="RT"; - else if (which==PS_RTPRIO && ll == 0) fmt="-"; + else if ((which==PS_RTPRIO || which==PS_BIT) && ll == 0) fmt="-"; sprintf(out, fmt, ll); // String fields -- 2.8.0.rc3.226.g39d4020
_______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
