add stats comparison
This commit is contained in:
parent
2a1b8f9617
commit
bfa35f7d62
|
@ -0,0 +1,15 @@
|
|||
#include "rvprof_internal.h"
|
||||
|
||||
// comparison used to sort regions by exclusive time
|
||||
static int compare_functions(const void* fn_a, const void* fn_b){
|
||||
const function_stats_t* stats_a = (const function_stats_t*)fn_a;
|
||||
const function_stats_t* stats_b = (const function_stats_t*)fn_b;
|
||||
|
||||
if (stats_a->total_exclusive_time > stats_b->total_exclusive_time){
|
||||
return -1;
|
||||
} else if (stats_a->total_exclusive_time < stats_b->total_exclusive_time){
|
||||
return 1;
|
||||
} else{
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue