FreeBSD/usr.sbin/pmcstat/pmcpl_calltree.c
/*
 * Compare two top line by sum.
 */
Compare two top line by sum.
Compare two top line by sum .
static int
pmcpl_ct_line_compare(const void *a, const void *b)
{
	const struct pmcpl_ct_line *ct1, *ct2;
	ct1 = (const struct pmcpl_ct_line *) a;
	ct2 = (const struct pmcpl_ct_line *) b;
	if (ct1->ln_sum < ct2->ln_sum)
		return (1);
	if (ct1->ln_sum > ct2->ln_sum)
		return (-1);
	return (0);
}
static int pmcpl_ct_line_compare ( const void * a , const void * b ) { const struct pmcpl_ct_line * ct1 , * ct2 ; ct1 = ( const struct pmcpl_ct_line * ) a ; ct2 = ( const struct pmcpl_ct_line * ) b ; if ( ct1 -> ln_sum < ct2 -> ln_sum ) return ( 1 ) ; if ( ct1 -> ln_sum > ct2 -> ln_sum ) return ( -1 ) ; return ( 0 ) ; }
Compare two top line by sum.
Compare two top line by sum .
/* Sort in reverse order */