Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/genunix/genunix.c
          +++ new/usr/src/cmd/mdb/common/modules/genunix/genunix.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23   23   * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2017 Joyent, Inc.
       24 + * Copyright (c) 2018, Joyent, Inc.
  25   25   * Copyright (c) 2013 by Delphix. All rights reserved.
  26   26   */
  27   27  
  28   28  #include <mdb/mdb_param.h>
  29   29  #include <mdb/mdb_modapi.h>
  30   30  #include <mdb/mdb_ks.h>
  31   31  #include <mdb/mdb_ctf.h>
  32   32  
  33   33  #include <sys/types.h>
  34   34  #include <sys/thread.h>
↓ open down ↓ 122 lines elided ↑ open up ↑
 157  157                  { "TS_ONPROC",  TS_ONPROC,      TS_ONPROC       },
 158  158                  { "TS_ZOMB",    TS_ZOMB,        TS_ZOMB         },
 159  159                  { "TS_STOPPED", TS_STOPPED,     TS_STOPPED      },
 160  160                  { "TS_WAIT",    TS_WAIT,        TS_WAIT         },
 161  161                  { NULL,         0,              0               }
 162  162          };
 163  163  
 164  164          if (prt_flags & PS_PRTTHREADS)
 165  165                  mdb_printf("\tT  %?a <%b>\n", addr, t->t_state, t_state_bits);
 166  166  
 167      -        if (prt_flags & PS_PRTLWPS)
 168      -                mdb_printf("\tL  %?a ID: %u\n", t->t_lwp, t->t_tid);
      167 +        if (prt_flags & PS_PRTLWPS) {
      168 +                char desc[128] = "";
 169  169  
      170 +                (void) thread_getdesc(addr, B_FALSE, desc, sizeof (desc));
      171 +
      172 +                mdb_printf("\tL  %?a ID: %s\n", t->t_lwp, desc);
      173 +        }
      174 +
 170  175          return (WALK_NEXT);
 171  176  }
 172  177  
 173  178  typedef struct mdb_pflags_proc {
 174      -        struct pid      *p_pidp;
      179 +        struct pid      *p_pidp;
 175  180          ushort_t        p_pidflag;
 176  181          uint_t          p_proc_flag;
 177  182          uint_t          p_flag;
 178  183  } mdb_pflags_proc_t;
 179  184  
 180  185  static int
 181  186  pflags(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 182  187  {
 183  188          mdb_pflags_proc_t pr;
 184  189          struct pid pid;
↓ open down ↓ 69 lines elided ↑ open up ↑
 254  259          mdb_printf("\tp_pidflag:   %08x <%b>\n", pr.p_pidflag, pr.p_pidflag,
 255  260              p_pidflag_bits);
 256  261          mdb_printf("\tp_proc_flag: %08x <%b>\n", pr.p_proc_flag, pr.p_proc_flag,
 257  262              p_proc_flag_bits);
 258  263  
 259  264          return (DCMD_OK);
 260  265  }
 261  266  
 262  267  typedef struct mdb_ps_proc {
 263  268          char            p_stat;
 264      -        struct pid      *p_pidp;
 265      -        struct pid      *p_pgidp;
      269 +        struct pid      *p_pidp;
      270 +        struct pid      *p_pgidp;
 266  271          struct cred     *p_cred;
 267  272          struct sess     *p_sessp;
 268  273          struct task     *p_task;
 269  274          struct zone     *p_zone;
 270  275          pid_t           p_ppid;
 271  276          uint_t          p_flag;
 272  277          struct {
 273  278                  char            u_comm[MAXCOMLEN + 1];
 274  279                  char            u_psargs[PSARGSZ];
 275  280          } p_user;
↓ open down ↓ 4554 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX