static double calibrate_cpu_freq(void)
{
int i, nb_calib = 10;
- double freq;
+ double freq = 0;
printf("CPU frequency calibration, this should take 10 seconds\n");
for (i = 0; i < nb_calib; i++) {
freq += (double) get_cpu_freq();
}
+
return (freq / (double)nb_calib);
}
return get_bench_time(time_destroy_session_start, time_destroy_session_end);
}
+void bench_print_create_session(void)
+{
+ fprintf(fp, "Create session time:\n");
+ fprintf(fp, " %.20f sec.\n", bench_get_create_session());
+}
+
+void bench_print_enable_ust_channel(void)
+{
+ double res;
+
+ if ((time_enable_ust_channel_start == 0) &&
+ (time_enable_ust_channel_end == 0)) {
+ fprintf(fp, "NO DATA\n");
+ return;
+ }
+
+ res = get_bench_time(time_enable_ust_channel_start,
+ time_enable_ust_channel_end);
+ fprintf(fp, "Enable lttng-ust channel time:\n");
+ fprintf(fp, " %.20f sec.\n", res);
+}
+
+void bench_print_enable_ust_event(void)
+{
+ double res;
+
+ if ((time_enable_ust_event_start== 0) &&
+ (time_enable_ust_event_end == 0)) {
+ fprintf(fp, "NO DATA\n");
+ return;
+ }
+
+ res = get_bench_time(time_enable_ust_event_start,
+ time_enable_ust_event_end);
+ fprintf(fp, "Enable lttng-ust event time:\n");
+ fprintf(fp, " %.20f sec.\n", res);
+}
+
+void bench_print_start_ust(void)
+{
+ double res;
+
+ if ((time_start_ust_start== 0) && (time_start_ust_end == 0)) {
+ fprintf(fp, "NO DATA\n");
+ return;
+ }
+
+ res = get_bench_time(time_start_ust_start, time_start_ust_end);
+ fprintf(fp, "Start lttng-ust tracing time:\n");
+ fprintf(fp, " %.20f sec.\n", res);
+}
+
/*
* Complete UST notification process time break down in different actions.
*/
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;