예제 #1
0
파일: printgprof.c 프로젝트: metacore/spin
printprof()
{
    register nltype	*np;
    nltype		**sortednlp;
    int			index, timecmp();
    int			i;

    actime = 0.0;
    printf( "\f\n" );
    flatprofheader();
	/*
	 *	Sort the symbol table in by time
	 */
    sortednlp = (nltype **) calloc( nname , sizeof(nltype *) );
    if ( sortednlp == (nltype **) 0 ) {
	fprintf(stderr,
		MSGSTR(MEMSORT,
		       "[printprof] ran out of memory for time sorting\n"));
    }
    for ( index = 0 ; index < nname ; index += 1 ) {
	sortednlp[ index ] = &nl[ index ];
    }
    qsort( sortednlp , nname , sizeof(nltype *) , timecmp );
    for ( index = 0 ; index < nname ; index += 1 ) {
	np = sortednlp[ index ];
	/* Don't print routines excluded by default, e.g. _mcount */
        for(i = 0; defaultEnl[i] && np != defaultEnl[i]; i++)
		;
	if(np == defaultEnl[i])
           continue;
	flatprofline( np );
    }
    actime = 0.0;
    cfree( sortednlp );
}
예제 #2
0
printprof()
{
    register nltype	*np;
    nltype		**sortednlp;
    int			index, timecmp();

    actime = 0.0;
    printf( "\f\n" );
    flatprofheader();
	/*
	 *	Sort the symbol table in by time
	 */
    sortednlp = (nltype **) calloc( nname , sizeof(nltype *) );
    if ( sortednlp == (nltype **) 0 ) {
	fprintf( stderr , "[printprof] ran out of memory for time sorting\n" );
    }
    for ( index = 0 ; index < nname ; index += 1 ) {
	sortednlp[ index ] = &nl[ index ];
    }
    qsort( sortednlp , nname , sizeof(nltype *) , timecmp );
    for ( index = 0 ; index < nname ; index += 1 ) {
	np = sortednlp[ index ];
	flatprofline( np );
    }
    actime = 0.0;
    free( sortednlp );
}