add stats comparison

This commit is contained in:
Patrick Lipka 2025-08-08 15:54:28 +02:00
parent 2a1b8f9617
commit bfa35f7d62
1 changed files with 15 additions and 0 deletions

15
src/rvprof_output.c Normal file
View File

@ -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;
}
}