Beispiel #1
0
void spy_dump (spy_t s)
{
    tabstop t;
    open_output();
    spy_accumulate_children_stats(s);

    if (mode == SPY_DISPLAY_SAMPLES) {
	display_samples(s);
    } else {
	init_tabstop(&t);
	set_tabstop(s, &t);
	dump_header(&t);
	spy_dump_internal(s, &t);
    }
}
Beispiel #2
0
/*** Set preference to default settings ***/
void set_default_prefs( PREFS *prefs, struct Screen *def )
{
	memset(prefs, 0, sizeof(*prefs));
	CopyMem(&DefaultPens, &prefs->pen, sizeof(prefs->pen));
	prefs->auto_indent = 1;
	prefs->matchcase   = 0;
	prefs->tabsize = 8;
	prefs->scrfont = def->RastPort.Font;
	prefs->txtfont = GfxBase->DefaultFont;
	prefs->width   = prefs->txtfont->tf_XSize * 80;
	prefs->top     = def->BarHeight + 1;
	prefs->height  = def->Height - prefs->top;
	prefs->modeid  = PAL_MONITOR_ID | HIRES_KEY;

	/* Convert dynamic struct to static one */
	text_to_attr(prefs->scrfont, &prefs->attrscr);
	text_to_attr(prefs->txtfont, &prefs->attrtxt);
	unpack_separators(prefs->wordssep = WordsSep);
	info_screen(prefs, def);
	init_tabstop(8);
}
Beispiel #3
0
void
spy_dump_all ()
{
    int i;
    unsigned long total = 0;
    tabstop t;
    spy_t s;
    
    open_output();
    init_tabstop(&t);

    for (i = 0; i < nspys; i++) {
	s = &spys[i];
	spy_accumulate_children_stats(s);
	if (s->n == 0) continue;

	if (mode != SPY_DISPLAY_SAMPLES) set_tabstop(s, &t);
	total += spys[i].cumulative;
    }
    if (mode == SPY_DISPLAY_SAMPLES) {
	for (i = 0; i < nspys; i++) {
	    s = &spys[i];
	    if (s->n == 0) continue;
	    display_samples(s);
	}
    } else {
	dump_header(&t);
	for (i = 0; i < nspys; i++) {
	    s = &spys[i];
	    if (s->n == 0) continue;
	    spy_dump_internal(s, &t);
	}
	if (mode & SPY_DISPLAY_TOTAL) {
	    fprintf(out, "total: %s.\n", r_dtoa(cycle_to_usec(total)));
	}
    }
}