Fix benchmark and missing tracepoint
authorDavid Goulet <dgoulet@efficios.com>
Thu, 8 Mar 2012 23:02:10 +0000 (18:02 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 8 Mar 2012 23:02:10 +0000 (18:02 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
benchmark/benchmark.c
benchmark/run-boot-time.sh
benchmark/run-ust-notify.sh
benchmark/run-ust-register.sh
src/bin/lttng-sessiond/main.c

index 9100fae5735c64bdc3cc41001908afdfa3597a4a..b8f8516ef9447d64fbd6b6086884201272944f3e 100644 (file)
@@ -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;
index 4871ab90bb67395ba661ac04737cfb3ec1b057f0..002ebf84b13aa2a237ce39a7cd56476457bf7e21 100755 (executable)
@@ -23,7 +23,7 @@ BASEDIR=`dirname $0`
 
 echo "Starting session daemon"
 
-BENCH_BOOT_PROCESS=1 $BASEDIR/../lttng-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
+BENCH_BOOT_PROCESS=1 $BASEDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
 
 PID_SESSIOND=$!
 if [ -z $PID_SESSIOND ]; then
index 723ed2925995a7eb2670a751e47906770a57638c..971831817a85edd5165b483716bba9508c82e973 100755 (executable)
@@ -23,7 +23,7 @@ BASEDIR=`dirname $0`
 
 echo "Session daemon boot"
 
-BENCH_UST_NOTIFY=1 $BASEDIR/../lttng-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
+BENCH_UST_NOTIFY=1 $BASEDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
 
 PID_SESSIOND=$!
 if [ -z $PID_SESSIOND ]; then
index 96d70a26850d43a133ba0e4605ada7094bd7f0d7..ef6d6f311b12ede732a85000313ca8dc4c1f15f1 100755 (executable)
@@ -22,7 +22,7 @@ RESULTS_PATH="/tmp/lttng-bench-results.txt"
 BASEDIR=`dirname $0`
 
 echo "Session daemon boot"
-BENCH_UST_REGISTER=1 $BASEDIR/../lttng-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
+BENCH_UST_REGISTER=1 $BASEDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
 
 PID_SESSIOND=$!
 if [ -z $PID_SESSIOND ]; then
index 023c11213d9fc6003465ad9e9806a65faa1753a0..09353374e0be885e2d9775f265025bc7401ca9d0 100644 (file)
@@ -630,14 +630,14 @@ static int notify_ust_apps(int active)
 
        DBG("Notifying applications of session daemon state: %d", active);
 
-       tracepoint(ust_notify_apps_start);
-
        /* See shm.c for this call implying mmap, shm and futex calls */
        wait_shm_mmap = shm_ust_get_mmap(wait_shm_path, is_root);
        if (wait_shm_mmap == NULL) {
                goto error;
        }
 
+       tracepoint(ust_notify_apps_start);
+
        /* Wake waiting process */
        futex_wait_update((int32_t *) wait_shm_mmap, active);
 
@@ -1164,6 +1164,7 @@ static void *thread_manage_apps(void *data)
                                        ERR("Apps command pipe error");
                                        goto error;
                                } else if (revents & LPOLLIN) {
+                                       system("sysctl vm.drop_caches=3");
                                        tracepoint(ust_register_read_start);
                                        /* Empty pipe */
                                        ret = read(apps_cmd_pipe[0], &ust_cmd, sizeof(ust_cmd));
@@ -1184,7 +1185,6 @@ static void *thread_manage_apps(void *data)
                                        }
                                        tracepoint(ust_register_add_stop);
 
-                                       tracepoint(ust_register_done_start);
                                        /*
                                         * Validate UST version compatibility.
                                         */
@@ -1197,6 +1197,7 @@ static void *thread_manage_apps(void *data)
                                                update_ust_app(ust_cmd.sock);
                                        }
 
+                                       tracepoint(ust_register_done_start);
                                        ret = ust_app_register_done(ust_cmd.sock);
                                        if (ret < 0) {
                                                /*
@@ -1205,6 +1206,7 @@ static void *thread_manage_apps(void *data)
                                                 */
                                                ust_app_unregister(ust_cmd.sock);
                                        } else {
+                                               tracepoint(ust_register_done_stop);
                                                /*
                                                 * We just need here to monitor the close of the UST
                                                 * socket and poll set monitor those by default.
@@ -1217,7 +1219,6 @@ static void *thread_manage_apps(void *data)
                                                DBG("Apps with sock %d added to poll set",
                                                                ust_cmd.sock);
                                        }
-                                       tracepoint(ust_register_done_stop);
                                        break;
                                }
                        } else {
This page took 0.029833 seconds and 4 git commands to generate.