[Toybox] ps -T

enh enh at google.com
Wed Sep 20 15:08:51 PDT 2017


ps -T doesn't really work if you have any filters. so ps -AT is fine,
but ps -p <chrome pid> -T only shows the main thread.

why? because slots[SLOT_pid] is "wrong" in shared_match_process (where
by wrong i mean "is the tid").

why? because toybox reads (say) /proc/147047/task/147058/stat and sees

147058 (CompositorTileW) S 31782 6249 6249 0 -1 1077952576 4 0 0 0 0 0
0 0 20 0 11 0 1211910244 928649216 35602 18446744073709551615
94558515900416 94558627572512 140720560858928 140506510343072
140506833892356 0 0 4098 1073827581 1 0 0 -1 31 0 0 0 0 0
94558627579744 94558633602584 94558666661888 140720560866826
140720560866928 140720560866928 140720560869342 0

and copies 147058 into SLOT_pid because that code no longer knows the real pid.

not sure how best to fix this.

-- 
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