Print this page
11691 ptree could show service FMRIs
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/ptree.1
          +++ new/usr/src/man/man1/ptree.1
   1    1  '\" te
   2    2  .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
        3 +.\" Copyright 2019 Joyent, Inc.
   3    4  .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4    5  .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5    6  .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6      -.TH PTREE 1 "Oct 11, 2005"
        7 +.TH PTREE 1 "Sep 3, 2019"
   7    8  .SH NAME
   8    9  ptree \- print process trees
   9   10  .SH SYNOPSIS
  10      -.LP
  11   11  .nf
  12      -\fB/usr/bin/ptree\fR [\fB-a\fR] [\fB-c\fR] [\fB-z\fR \fIzone\fR] [\fIpid\fR | \fIuser\fR]...
       12 +\fB/usr/bin/ptree\fR [\fB-a\fR] [\fB-c\fR] [\fB-s\fR \fIsvc\fR] [\fB-z\fR \fIzone\fR] [\fIpid\fR | \fIuser\fR]...
  13   13  .fi
  14   14  
  15   15  .SH DESCRIPTION
  16      -.sp
  17      -.LP
  18   16  The \fBptree\fR utility prints the process trees containing the specified
  19   17  \fIpid\fRs or \fIuser\fRs, with child processes indented from their respective
  20   18  parent processes. An argument of all digits is taken to be a process-ID,
  21   19  otherwise it is assumed to be a user login name. The default is all processes.
  22   20  .SH OPTIONS
  23      -.sp
  24      -.LP
  25   21  The following options are supported:
  26   22  .sp
  27   23  .ne 2
  28   24  .na
  29   25  \fB\fB-a\fR\fR
  30   26  .ad
  31   27  .RS 11n
  32   28  All. Print all processes, including children of process 0.
  33   29  .RE
  34   30  
  35   31  .sp
  36   32  .ne 2
  37   33  .na
  38   34  \fB\fB-c\fR\fR
  39   35  .ad
  40   36  .RS 11n
  41      -Contracts. Print process contract memberships in addition to parent-child
  42      -relationships. See \fBprocess\fR(4). This option implies the \fB-a\fR option.
       37 +Contracts. Print process contract memberships and their associated SMF FMRIs,
       38 +in addition to parent-child relationships. See \fBprocess\fR(4).
       39 +This option implies the \fB-a\fR option.
  43   40  .RE
  44   41  
  45   42  .sp
  46   43  .ne 2
  47   44  .na
       45 +\fB\fB-s\fR \fIsvc\fR\fR
       46 +.ad
       47 +.RS 11n
       48 +Print only processes with an SMF service FMRI matching the argument. The FMRI
       49 +may be in truncated form (such as 'console-login'). This includes child
       50 +processes even if they are not members of the service contract.
       51 +See \fBprocess\fR(4).
       52 +.RE
       53 +
       54 +.sp
       55 +.ne 2
       56 +.na
  48   57  \fB\fB-z\fR \fIzone\fR\fR
  49   58  .ad
  50   59  .RS 11n
  51   60  Zones. Print only processes in the specified \fIzone\fR. Each zone \fBID\fR can
  52   61  be specified as either a zone name or a numerical zone \fBID\fR.
  53   62  .sp
  54   63  This option is only useful when executed in the global zone.
  55   64  .RE
  56   65  
  57   66  .SH OPERANDS
  58      -.sp
  59      -.LP
  60   67  The following operands are supported:
  61   68  .sp
  62   69  .ne 2
  63   70  .na
  64   71  \fB\fIpid\fR\fR
  65   72  .ad
  66   73  .RS 8n
  67   74  Process-id or a list of process-ids. \fBptree\fR also accepts
  68   75  \fB/proc/\fR\fInnn\fR as a process-id, so the shell expansion \fB/proc/*\fR can
  69   76  be used to specify all processes in the system.
↓ open down ↓ 3 lines elided ↑ open up ↑
  73   80  .ne 2
  74   81  .na
  75   82  \fB\fIuser\fR\fR
  76   83  .ad
  77   84  .RS 8n
  78   85  Username or list of usernames. Processes whose effective user IDs match those
  79   86  given are displayed.
  80   87  .RE
  81   88  
  82   89  .SH EXAMPLES
  83      -.LP
  84   90  \fBExample 1 \fRUsing ptree
  85   91  .sp
  86   92  .LP
  87   93  The following example prints the process tree (including children of process 0)
  88   94  for processes which match the command name \fBssh\fR:
  89   95  
  90   96  .sp
  91   97  .in +2
  92   98  .nf
  93   99  $ ptree -a `pgrep ssh`
↓ open down ↓ 3 lines elided ↑ open up ↑
  97  103                569157 /usr/lib/ssh/sshd
  98  104                  569159 -ksh
  99  105                    569171 bash
 100  106                      569173 /bin/ksh
 101  107                        569193 bash
 102  108  .fi
 103  109  .in -2
 104  110  .sp
 105  111  
 106  112  .SH EXIT STATUS
 107      -.sp
 108      -.LP
 109  113  The following exit values are returned:
 110  114  .sp
 111  115  .ne 2
 112  116  .na
 113  117  \fB\fB0\fR\fR
 114  118  .ad
 115  119  .RS 12n
 116  120  Successful operation.
 117  121  .RE
 118  122  
 119  123  .sp
 120  124  .ne 2
 121  125  .na
 122  126  \fBnon-zero\fR
 123  127  .ad
 124  128  .RS 12n
 125  129  An error has occurred.
 126  130  .RE
 127  131  
 128  132  .SH FILES
 129      -.sp
 130  133  .ne 2
 131  134  .na
 132  135  \fB\fB/proc/*\fR\fR
 133  136  .ad
 134  137  .RS 11n
 135  138  process files
 136  139  .RE
 137  140  
 138  141  .SH ATTRIBUTES
 139      -.sp
 140      -.LP
 141  142  See \fBattributes\fR(5) for descriptions of the following attributes:
 142  143  .sp
 143  144  
 144  145  .sp
 145  146  .TS
 146  147  box;
 147  148  c | c
 148  149  l | l .
 149  150  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 150  151  _
 151  152  Interface Stability     See below.
 152  153  .TE
 153  154  
 154  155  .sp
 155  156  .LP
 156  157  The human readable output is Unstable. The options are Evolving.
 157  158  .SH SEE ALSO
 158      -.sp
 159      -.LP
 160  159  \fBgcore\fR(1), \fBldd\fR(1), \fBpargs\fR(1), \fBpgrep\fR(1), \fBpkill\fR(1),
 161  160  \fBplimit\fR(1), \fBpmap\fR(1), \fBpreap\fR(1), \fBproc\fR(1), \fBps\fR(1),
 162  161  \fBppgsz\fR(1), \fBpwd\fR(1), \fBrlogin\fR(1), \fBtime\fR(1), \fBtruss\fR(1),
 163  162  \fBwait\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2), \fBsetuid\fR(2),
 164  163  \fBdlopen\fR(3C), \fBsignal.h\fR(3HEAD), \fBcore\fR(4), \fBproc\fR(4),
 165  164  \fBprocess\fR(4), \fBattributes\fR(5), \fBzones\fR(5)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX