FreeBSD/usr.bin/gprof/gprof.c
/*
     *	calculate scaled entry point addresses (to save time in asgnsamples),
     *	and possibly push the scaled entry points over the entry mask,
     *	if it turns out that the entry point is in one bucket and the code
     *	for a routine is in the next bucket.
     */
calculate scaled entry point addresses (to save time in asgnsamples),
and possibly push the scaled entry points over the entry mask,
if it turns out that the entry point is in one bucket and the code
for a routine is in the next bucket.
calculate scaled entry point addresses ( to save time in asgnsamples ) and possibly push the scaled entry points over the entry mask if it turns out that the entry point is in one bucket and the code for a routine is in the next bucket .
void
alignentries(void)
{
    register struct nl	*nlp;
    unsigned long	bucket_of_entry;
    unsigned long	bucket_of_code;
    for (nlp = nl; nlp < npe; nlp++) {
	nlp -> svalue = nlp -> value / HISTORICAL_SCALE_2;
	bucket_of_entry = (nlp->svalue - lowpc) / scale;
	bucket_of_code = (nlp->svalue + OFFSET_OF_CODE / HISTORICAL_SCALE_2 -
	  lowpc) / scale;
	if (bucket_of_entry < bucket_of_code) {
#	    ifdef DEBUG
		if (debug & SAMPLEDEBUG) {
		    printf("[alignentries] pushing svalue 0x%lx to 0x%lx\n",
			    nlp->svalue,
			    nlp->svalue + OFFSET_OF_CODE / HISTORICAL_SCALE_2);
		}
#	    endif 
	    nlp->svalue += OFFSET_OF_CODE / HISTORICAL_SCALE_2;
	}
    }
}
void alignentries ( void ) { register struct nl * nlp ; unsigned long bucket_of_entry ; unsigned long bucket_of_code ; for ( nlp = nl ; nlp < npe ; nlp ++ ) { nlp -> svalue = nlp -> value / HISTORICAL_SCALE_2 ; bucket_of_entry = ( nlp -> svalue - lowpc ) / scale ; bucket_of_code = ( nlp -> svalue + OFFSET_OF_CODE / HISTORICAL_SCALE_2 - lowpc ) / scale ; if ( bucket_of_entry < bucket_of_code ) { #	    ifdef DEBUG if ( debug & SAMPLEDEBUG ) { printf ( " \n " , nlp -> svalue , nlp -> svalue + OFFSET_OF_CODE / HISTORICAL_SCALE_2 ) ; } #	    endif nlp -> svalue += OFFSET_OF_CODE / HISTORICAL_SCALE_2 ; } } }
calculate scaled entry point addresses (to save time in asgnsamples),
  and possibly push the scaled entry points over the entry mask,
  if it turns out that the entry point is in one bucket and the code
  for a routine is in the next bucket.
calculate scaled entry point addresses ( to save time in asgnsamples ) and possibly push the scaled entry points over the entry mask if it turns out that the entry point is in one bucket and the code for a routine is in the next bucket .
/* DEBUG */