Print this page
3946 ::gcore
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

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 ↓ 14 lines elided ↑ open up ↑
  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   24   * Copyright (c) 2013 Joyent, Inc. All rights reserved.
       25 + * Copyright (c) 2013 by Delphix. All rights reserved.
  25   26   */
  26   27  
  27   28  #include <mdb/mdb_param.h>
  28   29  #include <mdb/mdb_modapi.h>
  29   30  #include <mdb/mdb_ks.h>
  30   31  #include <mdb/mdb_ctf.h>
  31   32  
  32   33  #include <sys/types.h>
  33   34  #include <sys/thread.h>
  34   35  #include <sys/session.h>
↓ open down ↓ 33 lines elided ↑ open up ↑
  68   69  #include "contract.h"
  69   70  #include "cpupart_mdb.h"
  70   71  #include "cred.h"
  71   72  #include "ctxop.h"
  72   73  #include "cyclic.h"
  73   74  #include "damap.h"
  74   75  #include "ddi_periodic.h"
  75   76  #include "devinfo.h"
  76   77  #include "findstack.h"
  77   78  #include "fm.h"
       79 +#include "gcore.h"
  78   80  #include "group.h"
  79   81  #include "irm.h"
  80   82  #include "kgrep.h"
  81   83  #include "kmem.h"
  82   84  #include "ldi.h"
  83   85  #include "leaky.h"
  84   86  #include "lgrp.h"
  85   87  #include "list.h"
  86   88  #include "log.h"
  87   89  #include "mdi.h"
↓ open down ↓ 4093 lines elided ↑ open up ↑
4181 4183          /* from vfs.c */
4182 4184          { "fsinfo", "?[-v]", "print mounted filesystems", fsinfo },
4183 4185          { "pfiles", ":[-fp]", "print process file information", pfiles,
4184 4186                  pfiles_help },
4185 4187  
4186 4188          /* from zone.c */
4187 4189          { "zone", "?[-r [-v]]", "display kernel zone(s)", zoneprt },
4188 4190          { "zsd", ":[-v] [zsd_key]", "display zone-specific-data entries for "
4189 4191              "selected zones", zsd },
4190 4192  
     4193 +#ifndef _KMDB
     4194 +        { "gcore", NULL, "generate a user core for the given process",
     4195 +            gcore_dcmd },
     4196 +#endif
     4197 +
4191 4198          { NULL }
4192 4199  };
4193 4200  
4194 4201  static const mdb_walker_t walkers[] = {
4195 4202  
4196 4203          /* from genunix.c */
4197 4204          { "callouts_bytime", "walk callouts by list chain (expiration time)",
4198 4205                  callout_walk_init, callout_walk_step, callout_walk_fini,
4199 4206                  (void *)CALLOUT_WALK_BYLIST },
4200 4207          { "callouts_byid", "walk callouts by id hash chain",
↓ open down ↓ 397 lines elided ↑ open up ↑
4598 4605  }
4599 4606  
4600 4607  const mdb_modinfo_t *
4601 4608  _mdb_init(void)
4602 4609  {
4603 4610          kmem_init();
4604 4611  
4605 4612          (void) mdb_callback_add(MDB_CALLBACK_STCHG,
4606 4613              genunix_statechange_cb, NULL);
4607 4614  
     4615 +#ifndef _KMDB
     4616 +        gcore_init();
     4617 +#endif
     4618 +
4608 4619          return (&modinfo);
4609 4620  }
4610 4621  
4611 4622  void
4612 4623  _mdb_fini(void)
4613 4624  {
4614 4625          leaky_cleanup(1);
4615 4626          stacks_cleanup(1);
4616 4627  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX