/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <mdb/mdb_modapi.h>
#include <configd.h>
static void
{
const char *cp;
} else {
}
}
static void
{
out++;
sz--;
}
}
/*ARGSUSED*/
static int
{
int num_servers;
int num_started;
if (argc != 0)
return (DCMD_USAGE);
mdb_warn("unable to read num_servers");
return (DCMD_ERR);
}
mdb_warn("unable to read num_started");
return (DCMD_ERR);
}
"\nserver threads:\t%d running, %d starting\n\n", num_servers,
argv) == -1) {
mdb_warn("can't walk 'configd_threads'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/*ARGSUSED*/
static int
{
if (!(flags & DCMD_ADDRSPEC)) {
argv) == -1) {
mdb_warn("can't walk 'configd_threads'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (argc != 0)
return (DCMD_USAGE);
if (DCMD_HDRSPEC(flags)) {
mdb_printf("%<u>%-?s %5s %-12s %-12s %-?s %-?s %-?s%</u>\n",
"ADDR", "TID", "STATE", "PREV_STATE", "CLIENT", "CLIENTRQ",
"MAINREQ");
}
return (DCMD_ERR);
}
mdb_printf("%0?p %5d %-12s %-12s %?p %?p %?p\n",
return (DCMD_OK);
}
static int
{
mdb_warn("unable to read thread_list");
return (WALK_ERR);
}
mdb_warn("couldn't walk 'uu_list_node'");
return (WALK_ERR);
}
return (WALK_NEXT);
}
static int
{
return (WALK_ERR);
}
}
static int
{
int idx;
if (!(flags & DCMD_ADDRSPEC)) {
argv) == -1) {
mdb_warn("can't walk 'configd_log'");
return (DCMD_ERR);
}
return (DCMD_OK);
}
return (DCMD_USAGE);
if (DCMD_HDRSPEC(flags)) {
mdb_printf("%<u>%-?s %-4s %-14s %9s %-22s %-17s\n%</u>",
"ADDR", "THRD", "START", "DURATION", "REQUEST",
"RESPONSE");
}
return (DCMD_ERR);
}
/*
* apply filters, if any.
*/
return (DCMD_OK);
return (DCMD_OK);
if (node != 0) {
node = 0; /* found it */
break;
}
}
if (node != 0)
return (DCMD_OK);
}
"REP_PROTOCOL_", "");
if (dursec <= 9)
"%lld.%06lld",
else if (dursec <= 9999)
"%lld.%03lld",
else
"%lld", dursec);
} else {
}
if (dursec <= 99ULL)
else if (dursec <= 99999ULL)
"-%lld.%06lld",
else if (dursec <= 99999999ULL)
"-%lld.%03lld",
else
"-%lld", dursec);
} else {
}
mdb_printf("%0?x %4d T%13s %9s %-22s %-17s\n",
if (opt_v) {
mdb_printf("\tclient: %?p (%d)\tptrs: %d\tstamp: %llx\n",
}
mdb_printf("\n");
}
return (DCMD_OK);
}
struct request_log_walk {
struct request_entry {
} *rlw_list;
};
/*
* we want newer items at the top
*/
static int
request_entry_compare(const void *l, const void *r)
{
return (0);
/*
* 0 timestamps go first.
*/
return (1);
return (-1);
return (1);
return (-1);
}
/*ARGSUSED*/
static int
{
(*arg)++;
return (WALK_NEXT);
}
static int
struct request_entry **arg)
{
else
++*arg;
}
return (WALK_NEXT);
}
static int
{
mdb_warn("couldn't read 'request_log'");
return (WALK_ERR);
}
mdb_warn("couldn't read 'request_log_size'");
return (WALK_ERR);
}
&size) == -1) {
mdb_warn("couldn't walk 'configd_threads'");
return (WALK_ERR);
}
&listp) == -1) {
mdb_warn("couldn't walk 'configd_threads'");
return (WALK_ERR);
}
return (WALK_ERR);
}
pos++;
}
}
return (WALK_NEXT);
}
static int
{
return (WALK_DONE);
return (WALK_ERR);
}
}
static void
{
}
{ "configd_thread", "?", "Print a thread_info_t tabularly",
{ "configd_log", "?[-v] [-c clientptr] [-i clientid]",
"Print the request log, or a single entry", request_log },
{ NULL }
};
{ "configd_threads", "walks the thread_info_ts for all "
{ "configd_log", "walks the request_log_entry_ts",
{ NULL }
};
};
const mdb_modinfo_t *
_mdb_init(void)
{
if (mdb_ctf_lookup_by_name("enum rep_protocol_requestid",
&request_enum) == -1) {
mdb_warn("enum rep_protocol_requestid not found");
}
if (mdb_ctf_lookup_by_name("enum rep_protocol_responseid",
&response_enum) == -1) {
mdb_warn("enum rep_protocol_responseid not found");
}
if (mdb_ctf_lookup_by_name("enum rc_ptr_type",
&ptr_type_enum) == -1) {
mdb_warn("enum rc_ptr_type not found");
}
if (mdb_ctf_lookup_by_name("enum thread_state",
&thread_state_enum) == -1) {
mdb_warn("enum thread_state not found");
}
return (&modinfo);
}