dumpcfg
dumpcfg.pids = kmem_alloc(v.v_proc * sizeof (pid_t), KM_SLEEP);
dumpcfg.helpermap = kmem_zalloc(BT_SIZEOFMAP(NCPU), KM_SLEEP);
LOCK_INIT_HELD(&dumpcfg.helper_lock);
if (dumpcfg.bitmapsize != npages) {
if (dumpcfg.bitmap != NULL)
kmem_free(dumpcfg.bitmap, BT_SIZEOFMAP(dumpcfg.
if (dumpcfg.rbitmap != NULL)
kmem_free(dumpcfg.rbitmap, BT_SIZEOFMAP(dumpcfg.
dumpcfg.bitmap = map;
dumpcfg.bitmapsize = npages;
dumpcfg.rbitmap = rmap;
dumpcfg.rbitmapsize = rlen;
if (!BT_TEST(dumpcfg.bitmap, bitnum)) {
BT_SET(dumpcfg.bitmap, bitnum);
if (!BT_TEST(dumpcfg.bitmap, bitnum)) {
BT_SET(dumpcfg.bitmap, bitnum);
ASSERT(BT_TEST(dumpcfg.bitmap, cp->bitnum));
if (BT_TEST(dumpcfg.bitmap, cp->bitnum))
dumpsys_spinlock(&dumpcfg.helper_lock);
if (dumpcfg.helpers_wanted) {
helper_t *hp, *hpend = &dumpcfg.helper[dumpcfg.nhelper];
for (hp = dumpcfg.helper; hp != hpend; hp++) {
BT_SET(dumpcfg.helpermap, CPU->cpu_seqid);
dumpsys_spinunlock(&dumpcfg.helper_lock);
if (dumpcfg.clevel < DUMP_CLEVEL_BZIP2)
dumpcfg.helpers_wanted = 0;
dumpsys_spinunlock(&dumpcfg.helper_lock);
if (dumpcfg.helpers_wanted)
BT_ATOMIC_SET(dumpcfg.helpermap, CPU->cpu_seqid);
if (dumpcfg.clevel < DUMP_CLEVEL_BZIP2)
if (dump_plat_mincpu != 0 && dumpcfg.clevel != 0) {
if (dumpcfg.helpermap[i] != 0) {
dumpcfg.clevel = 0;
if (dumpcfg.helper[0].lzbuf == NULL) {
dumpcfg.helper[0].lzbuf =
dumpcfg.helper[1].page;
if (bitnum >= dumpcfg.bitmapsize)
bitnum = dumpcfg.bitmapsize;
for (; bitnum < dumpcfg.bitmapsize; bitnum++)
if (BT_TEST(dumpcfg.bitmap, bitnum))
if (bitnum >= dumpcfg.bitmapsize) {
ASSERT(bitnum + mlw.mpleft <= dumpcfg.bitmapsize);
if (BT_TEST(dumpcfg.bitmap, bitnum))
dumpsys_lzjb_page(dumpcfg.helper, cp);
if (bitnum >= dumpcfg.bitmapsize)
if (bitnum < dumpcfg.bitmapsize)
dumpcfg_t *cfg = &dumpcfg;
helper_t *hp, *hpend = &dumpcfg.helper[dumpcfg.nhelper];
dumpcfg.helpers_wanted = 0;
dumpsys_spinunlock(&dumpcfg.helper_lock);
ASSERT(dumpcfg.nhelper > 0);
bzero(dumpcfg.bitmap, BT_SIZEOFMAP(dumpcfg.bitmapsize));
dumpcfg.pids[npids++] = p->p_pid;
(void) dump_process(dumpcfg.pids[pidx]);
for (bitnum = 0; bitnum < dumpcfg.bitmapsize; bitnum++) {
BT_SET(dumpcfg.bitmap, bitnum);
dumphdr->dump_npages = dumpcfg.bitmapsize;
dumpcfg.pids[npids++] =
dumpcfg.pids[npids++] = curthread->t_procp->p_pid;
if (npids && dump_process(dumpcfg.pids[0]) == 0)
for (bitnum = 0; bitnum < dumpcfg.bitmapsize; bitnum++) {
if (!BT_TEST(dumpcfg.bitmap, bitnum))
bzero(dumpcfg.helpermap, BT_SIZEOFMAP(NCPU));
ds->live = dumpcfg.clevel > 0 &&
save_dump_clevel = dumpcfg.clevel;
else if (dumpcfg.clevel >= DUMP_CLEVEL_BZIP2)
dumpcfg.clevel = DUMP_CLEVEL_LZJB;
dumpcfg.nhelper_used = 0;
for (hp = dumpcfg.helper; hp != hpend; hp++) {
++dumpcfg.nhelper_used;
if (dumpcfg.clevel >= DUMP_CLEVEL_BZIP2)
dumpcfg.ncbuf_used = 0;
for (cp = dumpcfg.cbuf; cp != &dumpcfg.cbuf[dumpcfg.ncbuf]; cp++) {
++dumpcfg.ncbuf_used;
for (cp = dumpcfg.cmap; cp != &dumpcfg.cmap[dumpcfg.ncmap]; cp++)
int n = dumpcfg.nhelper_used;
for (hp = dumpcfg.helper; hp != hpend; hp++) {
hp->helper = hp - dumpcfg.helper;
dumpcfg.helpers_wanted = dumpcfg.clevel > 0;
dumpsys_spinunlock(&dumpcfg.helper_lock);
dumphdr->dump_npages += dump_plat_data(dumpcfg.cbuf[0].buf);
buf = dumpcfg.cbuf[0].buf;
size = MIN(dumpcfg.cbuf[0].size, DUMP_OFFSET - sizeof (dumphdr_t) -
datahdr.dump_nstreams = dumpcfg.nhelper_used;
datahdr.dump_clevel = dumpcfg.clevel;
dumpvp_write(dumpcfg.cbuf[0].buf, datahdr.dump_metrics);
dumpcfg.clevel = save_dump_clevel;
static dumpcfg_t dumpcfg; /* config vars */
dumpcfg_t *old = &dumpcfg;
ASSERT(rbitnum < dumpcfg.rbitmapsize);
BT_SET(dumpcfg.rbitmap, rbitnum);
ASSERT(rbitnum < dumpcfg.rbitmapsize);
return (BT_TEST(dumpcfg.rbitmap, rbitnum));
ret = dumpcfg.maxvm + *sz;
ASSERT(*sz <= dumpcfg.maxvmsize);
if (BT_TEST(dumpcfg.bitmap, start))
dumpcfg_t *cfg = &dumpcfg;
bzero(dumpcfg.rbitmap, BT_SIZEOFMAP(dumpcfg.rbitmapsize));
for (bitnum = 0; bitnum < dumpcfg.bitmapsize; bitnum = end) {
for (bitnum = 0; bitnum < dumpcfg.bitmapsize; bitnum = end) {
if (BT_TEST(dumpcfg.bitmap, bitnum))