random.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdb_modapi.h>
/*
* rnd_stats dcmd - Print out the global rnd_stats structure, nicely formatted.
*/
/*ARGSUSED*/
static int
{
int i;
return (DCMD_USAGE);
mdb_warn("failed to read rnd_stats structure");
return (DCMD_ERR);
}
/* Can't find per-cpu stats. Don't add them in. */
random_max_ncpus = 0;
}
rndmag_t_offset /= 8;
/*
* Read and aggregate per-cpu stats if we have them.
*/
for (i = 0; i < random_max_ncpus; i++) {
}
mdb_printf("Random number device statistics:\n");
mdb_printf("%8llu bytes generated for /dev/random\n",
mdb_printf("%8llu bytes read from /dev/random cache\n",
mdb_printf("%8llu bytes generated for /dev/urandom\n",
return (DCMD_OK);
}
/*
* swrand_stats dcmd - Print out the global swrand_stats structure,
* nicely formatted.
*/
/*ARGSUSED*/
static int
{
return (DCMD_USAGE);
mdb_warn("failed to read swrand_stats structure");
return (DCMD_ERR);
}
mdb_printf("Software-based Random number generator statistics:\n");
mdb_printf("%8llu bits of entropy added to the pool\n",
mdb_printf("%8llu bits of entropy extracted from the pool\n",
mdb_printf("%8llu bytes added to the random pool\n",
mdb_printf("%8llu bytes extracted from the random pool\n",
return (DCMD_OK);
}
static const mdb_dcmd_t dcmds[] = {
{ "rnd_stats",
NULL,
"print random number device statistics",
{ "swrand_stats",
NULL,
"print kernel random number provider statistics",
{ NULL }
};
static const mdb_modinfo_t modinfo = {
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}