ptree zone handling is broken
11906 Add line drawing characters to ptree(1)
ptree zone handling is broken.
The problem is that proc_walk is defined not to iterate on SSYS procs. But this
means we don't include zone's "zsched" processes. As a result, all zone processes
end up as orphaned children of proc0, and are therefore ignored unless -a is also specified.
This can hopefully be fixed by adding a PROC_WALK_SYS flag to proc_walk().
Updated by Jason King about 3 years ago
To test, I built new versions of libproc and ptree w/ the changes. I then ran ptree, setting LD_LIBRARY_PATH so ptree used the updated libproc (verified by running ldd after setting LD_LIBRARY_PATH), and then compared the output to a copy of ptree from prior to #11906 (without LD_LIBRARY_PATH set as well). Aside from the pid for each respective ptree invocation, the output was identical (ignoring minor whitespace differences).
I then preformed the same test, but on a SmartOS zone that was up and running (ptree -z zonename). The output from both the older ptree and the new ptree were identical (ignoring minor whitespace differences).
Updated by Jason King almost 3 years ago
To expound, the whitespace differences are that the #11906 changed PIDWIDTH from 5 to 6 to match the value of PID_MAX which causes the spacing between the pid value and the psargs output to differ.
ptree -g formatting gets messed up with 6 digit pids without the that change. The output of
ptree is unstable, so it seemed both sensible and permissible to make the
PIDWIDTH agree with
Updated by Electric Monk almost 3 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit a63fed2a0384be5aa3f2ff7a38aac1153c549e87 Author: Jason King <email@example.com> Date: 2019-12-12T01:05:00.000Z 12037 ptree zone handling is broken Reviewed by: John Levon <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>