[Toybox] ps -T

Rob Landley rob at landley.net
Sun Oct 15 11:10:46 PDT 2017


And this one was stuck in gmail's spam filter too. (Sorry for the delay,
the down arrow on my keyboard came off. I have a new keyboard but
swapping it out involves shutting this down and closing 6 desktops full
of windows full of tabs. Working on it...)

[Notices this email didn't get sent, while stopped at a McDonald's in
Oklahoma on the drive back from minneapolis to austin. Right, time to
press send...]

On 09/20/2017 05:08 PM, enh wrote:
> 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.

Alas, I don't personally use threads much so basically never test this.

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

Hmmm... Reasonably straightforward to fix, but my tree has local c
changes in ps.c. Looks like I'm adding -m to show maximum number of
lines (somebody asked, it's easy enough.) And -H to iotop (which is
where I left off; need to come up with a test for this and haven't got
one. Is chrome threads or processes? The big scott mccloud comic implied
processes, but the way google does everything implies threads, but
threads would defeat the entire VM sandboxing purpose of having each tab
in its own process...)

[Which is where I stopped doing the "this is simple, I should just fix
it before finishing the reply..." and 3 days later that part's not done
yet...]

[Rob]

[P.S. You can use two finger scrolling to replace a down arrow in
chrome, the "j" key instead of a down arrow in vi, and hit page down and
cursor back up a lot. I really should finish closing windows and shut
down so I can replace the keyboard one of these days...]



More information about the Toybox mailing list