X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=benchmark%2Fbenchmark.c;h=b8f8516ef9447d64fbd6b6086884201272944f3e;hb=44749e83a5e86dfe35c87403133dccfab0937b66;hp=8fbe8ad78416bcfdd2843ef6b986fa486e9ab096;hpb=4c13f73f92c1cfdab179575450228f482a02135e;p=lttng-tools.git diff --git a/benchmark/benchmark.c b/benchmark/benchmark.c index 8fbe8ad78..b8f8516ef 100644 --- a/benchmark/benchmark.c +++ b/benchmark/benchmark.c @@ -37,6 +37,7 @@ static double calibrate_cpu_freq(void) for (i = 0; i < nb_calib; i++) { freq += (double) get_cpu_freq(); } + return (freq / (double)nb_calib); } @@ -141,6 +142,17 @@ void bench_print_ust_notification(void) total += res; + if (time_ust_notify_apps_start == 0 || time_ust_notify_apps_stop == 0) { + goto no_data; + } + + res = get_bench_time(time_ust_notify_apps_start, + time_ust_notify_apps_stop); + fprintf(fp, "futex wake\n"); + fprintf(fp, "Time: %.20f sec.\n", res); + + total += res; + fprintf(fp, "Global UST nonification time\n"); fprintf(fp, "Time: %.20f sec.\n", total); return; @@ -150,6 +162,29 @@ no_data: return; } +/* + * Time taken by an UST apps to unregister. + */ +void bench_print_ust_unregister(void) +{ + double res; + + fprintf(fp, "--- UST unregister time ---\n"); + + if (time_ust_unregister_start == 0 || time_ust_unregister_stop == 0) { + goto no_data; + } + + res = get_bench_time(time_ust_unregister_start, time_ust_unregister_stop); + fprintf(fp, "UST unregister time\n"); + fprintf(fp, "Time: %.20f sec.\n", res); + return; + +no_data: + fprintf(fp, "NO DATA\n"); + return; +} + /* * This time value is only coherent is an UST application registered. */