Print this page
Add boot_hrtime to global and zone kstats.

@@ -20,10 +20,11 @@
  */
 
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2013, Joyent Inc. All rights reserved.
+ * Copyright 2016 Garrett D'Amore
  */
 
 /*
  * Zones
  *

@@ -1835,10 +1836,12 @@
         zmp->zm_stime.value.ui64 = tmp;
         tmp = zone->zone_wtime;
         scalehrtime(&tmp);
         zmp->zm_wtime.value.ui64 = tmp;
 
+        zmp->zm_boot_hrtime.value.t = zone->zone_boot_hrtime;
+
         zmp->zm_avenrun1.value.ui32 = zone->zone_avenrun[0];
         zmp->zm_avenrun5.value.ui32 = zone->zone_avenrun[1];
         zmp->zm_avenrun15.value.ui32 = zone->zone_avenrun[2];
 
         zmp->zm_ffcap.value.ui32 = zone->zone_ffcap;

@@ -1882,10 +1885,11 @@
         kstat_named_init(&zmp->zm_ffcap, "forkfail_cap", KSTAT_DATA_UINT32);
         kstat_named_init(&zmp->zm_ffnoproc, "forkfail_noproc",
             KSTAT_DATA_UINT32);
         kstat_named_init(&zmp->zm_ffnomem, "forkfail_nomem", KSTAT_DATA_UINT32);
         kstat_named_init(&zmp->zm_ffmisc, "forkfail_misc", KSTAT_DATA_UINT32);
+        kstat_named_init(&zmp->zm_boot_hrtime, "boot_hrtime", KSTAT_DATA_TIME);
 
 
         ksp->ks_update = zone_misc_kstat_update;
         ksp->ks_private = zone;
 

@@ -3963,10 +3967,11 @@
                         mutex_enter(&zone_status_lock);
                         zone_status_set(zone, ZONE_IS_SHUTTING_DOWN);
                         mutex_exit(&zone_status_lock);
                 } else {
                         zone->zone_boot_time = gethrestime_sec();
+                        zone->zone_boot_hrtime = gethrtime();
                 }
 
                 pool_unlock();
         }