eft_mdb.c revision 6cb1ca52bfd0f546d1001d9204d8ab93039de44b
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdb_modapi.h>
#include <lut.h>
#include <itree.h>
#include "ipath_impl.h"
#include "lut_impl.h"
#include "config_impl.h"
#include "stats_impl.h"
#define LUT_SIZE_INIT 300
#define LUT_SIZE_INCR 100
struct lut_cp {
};
struct lut_dump_desc {
int ld_arraysz;
int ld_nents;
};
static void
{
return;
}
}
static void
{
}
}
static void
{
}
static int
{
if (root) {
sizeof (struct lut)) {
return (WALK_ERR);
}
return (WALK_ERR);
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
return (WALK_ERR);
} else {
return (WALK_NEXT); /* caller must free dump array */
}
}
static int
{
mdb_warn("lut walker requires a lut table address\n");
return (WALK_ERR);
}
return (WALK_NEXT);
} else {
mdb_warn("failed to suck in full lut\n");
return (WALK_ERR);
}
}
static int
{
return (WALK_DONE);
++*ip;
wsp->walk_cbdata));
}
static int
{
return (WALK_ERR);
}
return (WALK_DONE);
else
return (WALK_NEXT);
}
static void
{
}
static int
{
int status;
return (WALK_DONE);
wsp->walk_cbdata);
return (WALK_ERR);
}
return (status);
}
static void
{
}
/*ARGSUSED*/
static int
{
char buf[128];
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
if (argc)
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC))
addr = mdb_get_dot();
return (DCMD_ERR);
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
struct istat_entry istat_entry;
char buf[128];
if (argc)
return (DCMD_USAGE);
if (!(flags & DCMD_ADDRSPEC)) {
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_ERR);
return (DCMD_OK);
}
return (DCMD_ERR);
}
return (DCMD_ERR);
}
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
unsigned long long val;
unsigned long long ull;
int opt_p = 0;
if (!(flags & DCMD_ADDRSPEC))
addr = mdb_get_dot();
if (argc) {
MDB_OPT_UINT64) != argc) {
return (DCMD_USAGE);
}
}
if (opt_p) {
return (DCMD_ERR);
}
}
if (ull == 0)
mdb_printf("0us");
else if (ull >= TIMEVAL_EVENTUALLY)
mdb_printf("infinity");
else
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
int opt_v = 0;
char buf[128];
if (!(flags & DCMD_ADDRSPEC))
addr = mdb_get_dot();
if (argc) {
return (DCMD_USAGE);
}
}
return (DCMD_OK);
return (DCMD_ERR);
}
if (opt_v) {
}
switch (node.t) {
case T_NOTHING: /* used to keep going on error cases */
mdb_printf("nothing");
break;
case T_NAME: /* identifiers, sometimes chained */
mdb_warn("failed to read struct config at %p",
return (DCMD_ERR);
}
mdb_printf("<");
DCMD_ADDRSPEC, 0, NULL);
mdb_printf(">");
} else {
mdb_printf("<> ");
}
mdb_printf("[");
DCMD_ADDRSPEC, 0, NULL);
mdb_printf("]");
}
mdb_printf(".");
else
mdb_printf("/");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_GLOBID: /* globals (e.g. $a) */
break;
case T_EVENT: /* class@path{expr} */
NULL);
mdb_printf("@");
0, NULL);
mdb_printf(" { ");
DCMD_ADDRSPEC, 0, NULL);
mdb_printf(" }");
}
break;
case T_ENGINE: /* upset threshold engine (e.g. SERD) */
mdb_printf("engine ");
NULL);
break;
case T_ASRU: /* ASRU declaration */
mdb_printf("asru ");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_FRU: /* FRU declaration */
mdb_printf("fru ");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
{
break;
}
case T_NUM: /* num (ull internally) */
break;
case T_QUOTE: /* quoted string */
break;
case T_FUNC: /* func(arglist) */
0, NULL);
mdb_printf(")");
break;
case T_NVPAIR: /* name=value pair in decl */
NULL);
mdb_printf(" = ");
NULL);
break;
case T_ASSIGN: /* assignment statement */
mdb_printf("(");
NULL);
mdb_printf(" = ");
NULL);
mdb_printf(")");
break;
case T_CONDIF: /* a and T_CONDELSE in (a ? b : c ) */
mdb_printf("(");
NULL);
mdb_printf(" ? ");
NULL);
mdb_printf(")");
break;
case T_CONDELSE: /* lists b and c in (a ? b : c ) */
NULL);
mdb_printf(" : ");
NULL);
break;
case T_NOT: /* boolean ! operator */
mdb_printf("!");
NULL);
break;
case T_AND: /* boolean && operator */
NULL);
mdb_printf(" && ");
NULL);
break;
case T_OR: /* boolean || operator */
NULL);
mdb_printf(" || ");
NULL);
break;
case T_EQ: /* boolean == operator */
NULL);
mdb_printf(" == ");
NULL);
break;
case T_NE: /* boolean != operator */
NULL);
mdb_printf(" != ");
NULL);
break;
case T_SUB: /* integer - operator */
NULL);
mdb_printf(" - ");
NULL);
break;
case T_ADD: /* integer + operator */
NULL);
mdb_printf(" + ");
NULL);
break;
case T_MUL: /* integer * operator */
NULL);
mdb_printf(" * ");
NULL);
break;
case T_DIV: /* integer / operator */
NULL);
mdb_printf(" / ");
NULL);
break;
case T_MOD: /* integer % operator */
NULL);
mdb_printf(" % ");
NULL);
break;
case T_LT: /* boolean < operator */
NULL);
mdb_printf(" < ");
NULL);
break;
case T_LE: /* boolean <= operator */
NULL);
mdb_printf(" <= ");
NULL);
break;
case T_GT: /* boolean > operator */
NULL);
mdb_printf(" > ");
NULL);
break;
case T_GE: /* boolean >= operator */
NULL);
mdb_printf(" >= ");
NULL);
break;
case T_BITAND: /* bitwise & operator */
NULL);
mdb_printf(" & ");
NULL);
break;
case T_BITOR: /* bitwise | operator */
NULL);
mdb_printf(" | ");
NULL);
break;
case T_BITXOR: /* bitwise ^ operator */
NULL);
mdb_printf(" ^ ");
NULL);
break;
case T_BITNOT: /* bitwise ~ operator */
mdb_printf(" ~");
NULL);
break;
case T_LSHIFT: /* bitwise << operator */
NULL);
mdb_printf(" << ");
NULL);
break;
case T_RSHIFT: /* bitwise >> operator */
NULL);
mdb_printf(" >> ");
NULL);
break;
case T_ARROW: /* lhs (N)->(K) rhs */
NULL);
mdb_printf("(");
DCMD_ADDRSPEC, 0, NULL);
mdb_printf(")");
}
mdb_printf("->");
mdb_printf("(");
DCMD_ADDRSPEC, 0, NULL);
mdb_printf(")");
}
NULL);
break;
case T_LIST: /* comma-separated list */
NULL);
mdb_printf(", ");
NULL);
break;
case T_FAULT: /* fault declaration */
mdb_printf("fault.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_UPSET: /* upset declaration */
mdb_printf("upset.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_DEFECT: /* defect declaration */
mdb_printf("defect.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_ERROR: /* error declaration */
mdb_printf("error.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_EREPORT: /* ereport declaration */
mdb_printf("ereport.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
case T_SERD: /* SERD engine declaration */
mdb_printf("serd.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
return (DCMD_ERR);
}
break;
case T_STAT: /* STAT engine declaration */
mdb_printf("stat.");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
return (DCMD_ERR);
}
break;
case T_PROP: /* prop statement */
mdb_printf("prop ");
NULL);
break;
case T_MASK: /* mask statement */
mdb_printf("mask ");
NULL);
break;
case T_CONFIG: /* config statement */
mdb_printf("config ");
NULL);
mdb_printf(" ");
DCMD_ADDRSPEC, 0, NULL);
}
break;
default:
mdb_printf("not a eversholt node\n");
break;
}
return (DCMD_OK);
}
static const mdb_walker_t walkers[] = {
lut_walk_fini, NULL },
ipath_walk_fini, NULL },
};
static const mdb_dcmd_t dcmds[] = {
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}