Project

General

Profile

Bug #12037

ptree zone handling is broken

Added by John Levon about 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Since:

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


Related issues

Related to illumos gate - Feature #11906: Add line drawing characters to ptree(1)Closed

Actions

History

#2

Updated by Jason King about 2 months ago

  • Related to Feature #11906: Add line drawing characters to ptree(1) added
#3

Updated by Jason King about 2 months 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).

#4

Updated by Jason King about 2 months 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 PID_MAX.

#5

Updated by Jason King about 2 months ago

I also tested the man page update by manually running mandoc on the new man page and examining the output to make sure the formatting and content all looked correct.

#6

Updated by Electric Monk about 1 month ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit a63fed2a0384be5aa3f2ff7a38aac1153c549e87

commit  a63fed2a0384be5aa3f2ff7a38aac1153c549e87
Author: Jason King <jason.king@joyent.com>
Date:   2019-12-12T01:05:00.000Z

    12037 ptree zone handling is broken
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF