diff usr/src/cmd/mdb/common/modules/svc.startd/startd.c @ 12979:ab9ae749152f

PSARC/2009/617 Software Events Notification Parameters CLI PSARC/2009/618 snmp-notify: SNMP Notification Daemon for Software Events PSARC/2009/619 smtp-notify: Email Notification Daemon for Software Events PSARC/2010/225 fmd for non-global Solaris zones PSARC/2010/226 Solaris Instance UUID PSARC/2010/227 nvlist_nvflag(3NVPAIR) PSARC/2010/228 libfmevent additions PSARC/2010/257 sysevent_evc_setpropnvl and sysevent_evc_getpropnvl PSARC/2010/265 FMRI and FMA Event Stabilty, 'ireport' category 1 event class, and the 'sw' FMRI scheme PSARC/2010/278 FMA/SMF integration: instance state transitions PSARC/2010/279 Modelling panics within FMA PSARC/2010/290 logadm.conf upgrade 6392476 fmdump needs to pretty-print 6393375 userland ereport/ireport event generation interfaces 6445732 Add email notification agent for FMA and software events 6804168 RFE: Allow an efficient means to monitor SMF services status changes 6866661 scf_values_destroy(3SCF) will segfault if is passed NULL 6884709 Add snmp notification agent for FMA and software events 6884712 Add private interface to tap into libfmd_msg macro expansion capabilities 6897919 fmd to run in a non-global zone 6897937 fmd use of non-private doors is not safe 6900081 add a UUID to Solaris kernel image for use in crashdump identification 6914884 model panic events as a defect diagnosis in FMA 6944862 fmd_case_open_uuid, fmd_case_uuisresolved, fmd_nvl_create_defect 6944866 log legacy sysevents in fmd 6944867 enumerate svc scheme in topo 6944868 software-diagnosis and software-response fmd modules 6944870 model SMF maintenance state as a defect diagnosis in FMA 6944876 savecore runs in foreground for systems with zfs root and dedicated dump 6965796 Implement notification parameters for SMF state transitions and FMA events 6968287 SUN-FM-MIB.mib needs to be updated to reflect Oracle information 6972331 logadm.conf upgrade PSARC/2010/290
author Gavin Maltby <gavin.maltby@oracle.com>
date Fri, 30 Jul 2010 17:04:17 +1000
parents 87ae3ca2e4c8
children
line wrap: on
line diff
--- a/usr/src/cmd/mdb/common/modules/svc.startd/startd.c	Thu Jul 29 22:45:58 2010 -0700
+++ b/usr/src/cmd/mdb/common/modules/svc.startd/startd.c	Fri Jul 30 17:04:17 2010 +1000
@@ -19,12 +19,9 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <mdb/mdb_modapi.h>
 
 #include <libuutil.h>
@@ -59,6 +56,14 @@
 	u_longlong_t lookups;
 	u_longlong_t dep_inserts, dep_cycle_ns, dep_insert_ns;
 	size_t graph_num, restarter_num;
+	uint64_t ct_maint;
+	uint64_t ct_hwerr;
+	uint64_t ct_service;
+	uint64_t ct_global;
+	uint64_t ct_noprefs;
+	uint64_t ct_from_uninit;
+	uint64_t ct_bad_state;
+	uint64_t ct_ovr_prefs;
 
 	if (mdb_readvar(&lookups, "dictionary_lookups") == -1) {
 		mdb_warn("failed to read 'dictionary_lookups' value\n");
@@ -109,18 +114,71 @@
 		return (DCMD_ERR);
 	}
 
+	if (mdb_readvar(&ct_maint, "stev_ct_maint") == -1) {
+		mdb_warn("failed to read 'stev_ct_maint'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_hwerr, "stev_ct_hwerr") == -1) {
+		mdb_warn("failed to read 'stev_ct_hwerr'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_service, "stev_ct_service") == -1) {
+		mdb_warn("failed to read 'stev_ct_service'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_global, "stev_ct_global") == -1) {
+		mdb_warn("failed to read 'stev_ct_global'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_noprefs, "stev_ct_noprefs") == -1) {
+		mdb_warn("failed to read 'stev_ct_noprefs'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_from_uninit, "stev_ct_from_uninit") == -1) {
+		mdb_warn("failed to read 'stev_ct_from_uninit'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_bad_state, "stev_ct_bad_state") == -1) {
+		mdb_warn("failed to read 'stev_ct_bad_state'\n");
+		return (DCMD_ERR);
+	}
+
+	if (mdb_readvar(&ct_ovr_prefs, "stev_ct_ovr_prefs") == -1) {
+		mdb_warn("failed to read 'stev_ct_ovr_prefs'\n");
+		return (DCMD_ERR);
+	}
+
 	mdb_printf(
-	    "         dictionary lookups: %llu\n"
-	    "        average lookup time: %llu us\n"
-	    "graph dependency insertions: %llu\n"
-	    "   average cycle-check time: %llu us\n"
-	    " avg dependency insert time: %llu us\n"
-	    "number of nodes in dgraph: %llu\n"
-	    "number of nodes in instance_list: %llu\n", lookups,
+	    "General stats\n"
+	    "              dictionary lookups: %llu\n"
+	    "             average lookup time: %llu us\n"
+	    "     graph dependency insertions: %llu\n"
+	    "        average cycle-check time: %llu us\n"
+	    "      avg dependency insert time: %llu us\n"
+	    "       number of nodes in dgraph: %llu\n"
+	    "number of nodes in instance_list: %llu\n"
+	    "\nState Transition Events\n"
+	    "                     maintenance: %llu\n"
+	    "                  hardware error: %llu\n"
+	    "           service specific pref: %llu\n"
+	    "                system wide pref: %llu\n"
+	    "            no prefs, not raised: %llu\n"
+	    "          from unint, not raised: %llu\n"
+	    "           bad state, not raised: %llu\n"
+	    "           override pref, raised: %llu\n", lookups,
 	    lookups ? ns_total / (1000 * lookups) : 0, dep_inserts,
 	    dep_inserts ? dep_cycle_ns / (1000 * dep_inserts) : 0,
 	    dep_inserts ? dep_insert_ns / (1000 * dep_inserts) : 0,
-	    (u_longlong_t)graph_num, (u_longlong_t)restarter_num);
+	    (u_longlong_t)graph_num, (u_longlong_t)restarter_num,
+	    ct_maint, ct_hwerr, ct_service, ct_global, ct_noprefs,
+	    ct_from_uninit, ct_bad_state, ct_ovr_prefs);
+
 
 	return (DCMD_OK);
 }