/*
* 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
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/mdb_modapi.h>
/*
* Walker for an array of sv_dev_t structures.
* A global walk is assumed to start at sv_devs.
*/
struct sv_dev_winfo {
};
static int
{
int sv_max_devices;
mdb_warn("failed to read 'sv_devs'");
return (WALK_ERR);
}
mdb_warn("failed to read 'sv_max_devices'");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
wsp->walk_cbdata);
return (status);
}
static void
{
}
/*
* Walker for an sv hash chain.
* Global walks are disallowed.
*/
static int
{
return (WALK_ERR);
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
static void
{
}
/*
* Walker for an array of sv_maj_t structures.
* A global walk is assumed to start at sv_majors.
*/
static int
{
mdb_warn("failed to read 'sv_majors'");
return (WALK_ERR);
}
} else {
}
return (WALK_NEXT);
}
static int
{
return (WALK_DONE);
return (WALK_DONE);
!= sizeof (sv_maj_t)) {
break;
}
wsp->walk_cbdata);
break;
}
return (status);
}
static void
{
}
/*
* Walker for an sv gclient chain.
* A global walk is assumed to start at sv_gclients.
*/
static int
{
mdb_warn("unable to read 'sv_gclients'");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
}
wsp->walk_cbdata);
return (status);
}
static void
{
}
/*
* Display a single sv_glcient_t structure.
* If called with no address, performs a global walk of all sv_gclients.
*/
static int
{
if (argc != 0)
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
/*
* paranoid mode on: qualify walker name with module name
* using '`' syntax.
*/
if (mdb_walk_dcmd("sv`sv_gclient",
mdb_warn("failed to walk 'sv_gclient'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
return (DCMD_ERR);
}
if (DCMD_HDRSPEC(flags)) {
mdb_printf("%-?s %8T%-?s %8T%-16s %8T%s\n",
"ADDR", "NEXT", "ID", "NAME");
}
return (DCMD_ERR);
}
mdb_printf("%p %8T%p %8T%llx %8T%s",
return (DCMD_OK);
}
/*
* Display a single sv_maj_t structure.
* If called with no address, performs a global walk of all sv_majs.
* -a : all (i.e. display all devices, even if disabled
* -v : verbose
*/
static int
{
int i;
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
/*
* paranoid mode on: qualify walker name with module name
* using '`' syntax.
*/
mdb_warn("failed to walk 'sv_maj'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (DCMD_HDRSPEC(flags)) {
}
return (DCMD_ERR);
}
return (DCMD_OK);
if (!v_opt)
return (DCMD_OK);
/*
* verbose - print the rest of the structure as well.
*/
mdb_inc_indent(4);
mdb_printf("\n");
mdb_printf("flag: %08x %8Tsequence: %d %8Tmajor: %d\n",
mdb_printf("function pointers:\n");
mdb_inc_indent(4);
mdb_printf("%-20a%-20a%\n%-20a%-20a%\n%-20a%-20a%\n%-20a%-20a%\n",
mdb_dec_indent(4);
mdb_printf("hash chain:\n");
mdb_inc_indent(4);
for (i = 0; i < SV_MINOR_HASH_CNT; i++) {
}
mdb_printf("\n\n");
mdb_dec_indent(4);
mdb_dec_indent(4);
return (DCMD_OK);
}
/*
* Display a sv_dev_t hash chain.
* Requires an address.
* Same options as sv_dev().
*/
static int
{
if (!(flags & DCMD_ADDRSPEC))
return (DCMD_USAGE);
/*
* paranoid mode on: qualify walker name with module name
* using '`' syntax.
*/
mdb_warn("failed to walk sv_dev hash chain");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*
* Display a single sv_dev_t structure.
* If called with no address, performs a global walk of all sv_devs.
* -a : all (i.e. display all devices, even if disabled
* -v : verbose
*/
{ NULL, 0, 0 }
};
static int
{
int dev_t_chars;
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
/*
* paranoid mode on: qualify walker name with module name
* using '`' syntax.
*/
mdb_warn("failed to walk 'sv_dev'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (DCMD_HDRSPEC(flags)) {
}
return (DCMD_ERR);
}
return (DCMD_OK);
mdb_printf("disabled");
mdb_printf("pending");
mdb_printf("enabled");
mdb_printf("\n");
if (!v_opt)
return (DCMD_OK);
/*
* verbose - print the rest of the structure as well.
*/
mdb_inc_indent(4);
mdb_printf("\n");
mdb_printf("hash chain: 0x%p %8Tlock: 0x%p %8Tolock: 0x%p\n",
mdb_printf("maxfbas: %d %8Tnblocks: %d %8Tstate: %d\n",
mdb_printf("gclients: 0x%llx %8Tgkernel: 0x%llx\n",
mdb_printf("openlcnt: %d %8Ttimestamp: 0x%lx\n",
mdb_printf("flags: 0x%08x <%b>\n",
mdb_printf("lh: 0x%p %8Tpending: 0x%p\n",
mdb_dec_indent(4);
return (DCMD_OK);
}
/*
* Display general sv module information.
*/
mdb_dec_indent(4); \
return (DCMD_ERR); \
} \
/* ARGSUSED */
static int
{
if (argc != 0)
return (DCMD_USAGE);
mdb_warn("unable to read 'sv_major_rev'");
return (DCMD_ERR);
}
mdb_warn("unable to read 'sv_minor_rev'");
return (DCMD_ERR);
}
mdb_warn("unable to read 'sv_micro_rev'");
return (DCMD_ERR);
}
mdb_warn("unable to read 'sv_baseline_rev'");
return (DCMD_ERR);
}
mdb_printf("SV module version: kernel %d.%d.%d.%d; mdb %d.%d.%d.%d\n",
mdb_inc_indent(4);
mdb_dec_indent(4);
return (DCMD_OK);
}
/*
* MDB module linkage information:
*/
{ NULL }
};
{ "sv_dev", "walk array of sv_dev structures",
{ "sv_gclient", "walk sb_gclient chain",
{ "sv_hash", "walk sv_dev hash chain",
{ "sv_maj", "walk array of sv_maj structures",
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}