/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <mdb/mdb_modapi.h>
#include <libuutil.h>
#include <libuutil_impl.h>
#include <librestart_priv.h> /* instance_data_t */
#include <startd.h>
/*
* To count the elements of a uu_list_t without knowing its implementation, we
* must walk & count them.
*/
/* ARGSUSED */
static int
{
++(*sz);
return (WALK_NEXT);
}
/*ARGSUSED*/
static int
{
mdb_warn("failed to read 'dictionary_lookups' value\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'dictionary_ns_total' value\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'dep_inserts' value\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'dep_cycle_ns' value\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'dep_insert_ns' value\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'dgraph' value\n");
return (DCMD_ERR);
}
graph_num = 0;
mdb_warn("failed to read uu_list\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'instance_list' value\n");
return (DCMD_ERR);
}
restarter_num = 0;
mdb_warn("failed to read uu_list\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_maint'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_hwerr'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_service'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_global'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_noprefs'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_from_uninit'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_bad_state'\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'stev_ct_ovr_prefs'\n");
return (DCMD_ERR);
}
"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,
return (DCMD_OK);
}
static char
{
switch (s) {
case RESTARTER_STATE_UNINIT: return ('u');
case RESTARTER_STATE_DISABLED: return ('d');
case RESTARTER_STATE_OFFLINE: return ('0');
case RESTARTER_STATE_DEGRADED: return ('D');
case RESTARTER_STATE_ONLINE: return ('1');
case RESTARTER_STATE_MAINT: return ('m');
case RESTARTER_STATE_NONE: return ('n');
default: return ('?');
}
}
/*ARGSUSED*/
static int
{
char *iname;
char typechr;
if ((flags & DCMD_ADDRSPEC) == 0) {
mdb_warn("failed to read 'instance_list' value\n");
return (DCMD_ERR);
}
mdb_warn("can't walk instances\n");
return (DCMD_ERR);
}
return (DCMD_OK);
}
mdb_warn("couldn't read instance at %a\n");
return (DCMD_ERR);
}
if (DCMD_HDRSPEC(flags))
"FMRI");
mdb_warn("couldn't read instance name\n");
}
iname);
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
char *vname;
int id;
char typechr;
if ((flags & DCMD_ADDRSPEC) == 0) {
mdb_warn("failed to read 'dgraph' value\n");
return (DCMD_ERR);
}
mdb_warn("can't walk vertices");
return (DCMD_ERR);
}
return (DCMD_OK);
}
mdb_warn("couldn't read vertex at %a\n");
return (DCMD_ERR);
}
if (DCMD_HDRSPEC(flags))
"FMRI");
mdb_warn("couldn't read vertex name\n");
}
case GVT_FILE:
typechr = 'f';
break;
case GVT_GROUP:
switch (gv.gv_depgroup) {
case DEPGRP_REQUIRE_ANY:
typechr = 'r';
break;
case DEPGRP_REQUIRE_ALL:
typechr = 'R';
break;
case DEPGRP_EXCLUDE_ALL:
typechr = 'X';
break;
case DEPGRP_OPTIONAL_ALL:
typechr = 'o';
break;
default:
typechr = '?';
break;
}
break;
case GVT_INST:
break;
case GVT_SVC:
typechr = 's';
break;
default:
typechr = '?';
break;
}
return (DCMD_OK);
}
/* ARGSUSED */
static int
{
char *buf;
char *cp;
mdb_warn("The 'logbuf' symbol is missing.\n");
return (DCMD_ERR);
}
mdb_warn("failed to read 'logbuf'\n");
return (DCMD_ERR);
}
/* Empty */
return (DCMD_OK);
mdb_warn("'logbuf' is corrupt\n");
return (DCMD_ERR);
}
return (DCMD_OK);
}
pr_instance },
logbuf },
pr_vertex },
{ NULL }
};
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}