/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1998-1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdb_modapi.h>
/*
* simple_echo dcmd - Demonstrate some simple argument processing by iterating
* through the argument array and printing back each argument.
*/
static int
{
if (flags & DCMD_ADDRSPEC)
else
while (argc-- != 0) {
else
argv++;
}
mdb_printf("\n");
return (DCMD_OK);
}
/*
* vminfo dcmd - Print out the global vminfo structure, nicely formatted.
* This function illustrates one of the functions for reading data from
* the target program (or core file): mdb_readvar(). The vminfo_t
* structure contains cumulative counters for various system virtual
* memory statistics. Each second, these are incremented by the current
* values of freemem and the other corresponding statistical counters.
*/
/*ARGSUSED*/
static int
{
return (DCMD_USAGE);
/*
* If the mdb_warn string does not end in a \n, mdb will
* automatically append the reason for the failure.
*/
mdb_warn("failed to read vminfo structure");
return (DCMD_ERR);
}
mdb_printf("Cumulative memory statistics:\n");
return (DCMD_OK);
}
/*
* MDB module linkage information:
*
* We declare a list of structures describing our dcmds, and a function
* named _mdb_init to return a pointer to our module information.
*/
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}