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

@@ -20,10 +20,11 @@
  */
 /*
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
 #include <mdb/mdb_param.h>
 #include <mdb/mdb_modapi.h>
 #include <mdb/mdb_ks.h>

@@ -73,10 +74,11 @@
 #include "damap.h"
 #include "ddi_periodic.h"
 #include "devinfo.h"
 #include "findstack.h"
 #include "fm.h"
+#include "gcore.h"
 #include "group.h"
 #include "irm.h"
 #include "kgrep.h"
 #include "kmem.h"
 #include "ldi.h"

@@ -4186,10 +4188,15 @@
         /* from zone.c */
         { "zone", "?[-r [-v]]", "display kernel zone(s)", zoneprt },
         { "zsd", ":[-v] [zsd_key]", "display zone-specific-data entries for "
             "selected zones", zsd },
 
+#ifndef _KMDB
+        { "gcore", NULL, "generate a user core for the given process",
+            gcore_dcmd },
+#endif
+
         { NULL }
 };
 
 static const mdb_walker_t walkers[] = {
 

@@ -4603,10 +4610,14 @@
         kmem_init();
 
         (void) mdb_callback_add(MDB_CALLBACK_STCHG,
             genunix_statechange_cb, NULL);
 
+#ifndef _KMDB
+        gcore_init();
+#endif
+
         return (&modinfo);
 }
 
 void
 _mdb_fini(void)