[Toybox] [PATCH] top -H is more useful if it shows thread names.

enh enh at google.com
Fri Jan 27 13:08:18 PST 2017


I knew that just showing the process name was a divergence from
traditional Android behavior, but I was curious to see whether anyone
cared. Bug reports show that they do. I've not made this conditional on
CFG_TOYBOX_ON_ANDROID on the assumption that this is more useful for
everyone else too. (Why are you asking for per-thread information if
you don't actually want to be able to identify individual threads?)

Why not _just_ show the thread name? Because on Android at least, every
process has lots of identically-named threads; everyone has GC threads,
everyone has JIT threads, and so knowing _just_ the thread name is
rarely useful.

Why show thread name first? Because the kernel limits thread names to 15
bytes plus a NUL, so any left-over space should go to the process name,
so that should come last.

Why call the thread name THREAD? Because "CMD" isn't obviously "thread
name" to folks who don't know how this is implemented behind the scenes.

This change also removes an incorrect "usage:" comment. None of the
other commands in this file duplicated their "usage:" lines, and this
copy wasn't even close to being correct.

Bug: http://b/34610082
---
 toys/posix/ps.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-top-H-is-more-useful-if-it-shows-thread-names.patch
Type: text/x-patch
Size: 2128 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170127/7dda1002/attachment.bin>


More information about the Toybox mailing list