diff --git a/src/rvprof_output.c b/src/rvprof_output.c new file mode 100644 index 0000000..56ed6f6 --- /dev/null +++ b/src/rvprof_output.c @@ -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; + } +} \ No newline at end of file