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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libproc/common/Pgcore.c
          +++ new/usr/src/lib/libproc/common/Pgcore.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  /*
  27   27   * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  28      - * Copyright 2015 Joyent, Inc.
       28 + * Copyright 2018 Joyent, Inc.
  29   29   * Copyright (c) 2013 by Delphix. All rights reserved.
  30   30   */
  31   31  
  32   32  #define _STRUCTURED_PROC        1
  33   33  
  34   34  #include <stdlib.h>
  35   35  #include <ctype.h>
  36   36  #include <string.h>
  37   37  #include <strings.h>
  38   38  #include <errno.h>
↓ open down ↓ 463 lines elided ↑ open up ↑
 502  502  #endif  /* sparc */
 503  503  
 504  504          return (0);
 505  505  }
 506  506  
 507  507  static int
 508  508  new_per_lwp(void *data, const lwpstatus_t *lsp, const lwpsinfo_t *lip)
 509  509  {
 510  510          pgcore_t *pgc = data;
 511  511          struct ps_prochandle *P = pgc->P;
      512 +        prlwpname_t name = { 0, "" };
 512  513          psinfo_t ps;
 513  514  
 514  515          /*
 515  516           * If lsp is NULL this indicates that this is a zombie LWP in
 516  517           * which case we dump only the lwpsinfo_t structure and none of
 517  518           * the other ancillary LWP state data.
 518  519           */
 519  520          if (P->status.pr_dmodel == PR_MODEL_NATIVE) {
 520  521                  if (write_note(pgc->pgc_fd, NT_LWPSINFO, lip,
 521  522                      sizeof (lwpsinfo_t), pgc->pgc_doff) != 0)
↓ open down ↓ 48 lines elided ↑ open up ↑
 570  571                  asrset_t asrs;
 571  572                  if (Plwp_getasrs(P, lsp->pr_lwpid, asrs) == 0) {
 572  573                          if (write_note(pgc->pgc_fd, NT_ASRS, &asrs,
 573  574                              sizeof (asrset_t), pgc->pgc_doff) != 0)
 574  575                                  return (1);
 575  576                  }
 576  577          }
 577  578  #endif  /* __sparcv9 */
 578  579  #endif  /* sparc */
 579  580  
      581 +        if (Plwp_getname(P, lsp->pr_lwpid, name.pr_lwpname,
      582 +            sizeof (name.pr_lwpname)) == 0) {
      583 +                name.pr_lwpid = lsp->pr_lwpid;
      584 +                if (write_note(pgc->pgc_fd, NT_LWPNAME, &name,
      585 +                    sizeof (name), pgc->pgc_doff) != 0)
      586 +                        return (1);
      587 +        }
      588 +
 580  589          if (!(lsp->pr_flags & PR_AGENT))
 581  590                  return (0);
 582  591  
 583  592          if (Plwp_getspymaster(P, lsp->pr_lwpid, &ps) != 0)
 584  593                  return (0);
 585  594  
 586  595          if (P->status.pr_dmodel == PR_MODEL_NATIVE) {
 587  596                  if (write_note(pgc->pgc_fd, NT_SPYMASTER, &ps,
 588  597                      sizeof (psinfo_t), pgc->pgc_doff) != 0)
 589  598                          return (1);
↓ open down ↓ 1083 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX