FreeBSD/usr.sbin/pmcstat/pmcpl_callgraph.c
/*
 * Compare two callgraph nodes for sorting.
 */
Compare two callgraph nodes for sorting.
Compare two callgraph nodes for sorting .
static int
pmcstat_cgnode_compare(const void *a, const void *b)
{
	const struct pmcstat_cgnode *const *pcg1, *const *pcg2, *cg1, *cg2;
	pcg1 = (const struct pmcstat_cgnode *const *) a;
	cg1 = *pcg1;
	pcg2 = (const struct pmcstat_cgnode *const *) b;
	cg2 = *pcg2;
	if (cg1->pcg_count < cg2->pcg_count)
		return (1);
	if (cg1->pcg_count > cg2->pcg_count)
		return (-1);
	return (0);
}
static int pmcstat_cgnode_compare ( const void * a , const void * b ) { const struct pmcstat_cgnode * const * pcg1 , * const * pcg2 , * cg1 , * cg2 ; pcg1 = ( const struct pmcstat_cgnode * const * ) a ; cg1 = * pcg1 ; pcg2 = ( const struct pmcstat_cgnode * const * ) b ; cg2 = * pcg2 ; if ( cg1 -> pcg_count < cg2 -> pcg_count ) return ( 1 ) ; if ( cg1 -> pcg_count > cg2 -> pcg_count ) return ( -1 ) ; return ( 0 ) ; }
Compare two callgraph nodes for sorting.
Compare two callgraph nodes for sorting .
/* Sort in reverse order */