total += res;
- if (time_ust_manage_register_start == 0 ||
- time_ust_manage_register_stop == 0) {
- goto no_data;
- }
+ fprintf(fp, "--> Manage registration breakdown\n");
+
+ res = get_bench_time(time_ust_register_read_start,
+ time_ust_register_read_stop);
+ fprintf(fp, "read() from pipe time\n");
+ fprintf(fp, "Time: %.20f sec.\n", res);
- res = get_bench_time(time_ust_manage_register_start,
- time_ust_manage_register_stop);
- fprintf(fp, "Manage UST registration time\n");
+ total += res;
+
+ res = get_bench_time(time_ust_register_add_start,
+ time_ust_register_add_stop);
+ fprintf(fp, "register_traceable_app time\n");
+ fprintf(fp, "Time: %.20f sec.\n", res);
+
+ total += res;
+
+ res = get_bench_time(time_ust_register_done_start,
+ time_ust_register_done_stop);
+ fprintf(fp, "send register done command time\n");
fprintf(fp, "Time: %.20f sec.\n", res);
total += res;
res = get_bench_time(time_sessiond_boot_start, time_sessiond_boot_end);
- fprintf(fp, "Boot time inside main() from start to first pthread_join (blocking state)\n");
+ fprintf(fp, "Inside main() from start to first pthread_join"
+ "(blocking state)\n");
+ fprintf(fp, "Time: %.20f sec.\n", res);
+
+ global_boot_time += res;
+
+ res = get_bench_time(time_sessiond_th_kern_start,
+ time_sessiond_th_kern_poll);
+
+ fprintf(fp, "Kernel thread from start to poll() (ready state)\n");
fprintf(fp, "Time: %.20f sec.\n", res);
global_boot_time += res;
- res = get_bench_time(time_sessiond_th_kern_start, time_sessiond_th_kern_poll);
+ res = get_bench_time(time_sessiond_th_apps_start,
+ time_sessiond_th_apps_poll);
- fprintf(fp, "Boot time of the kernel thread from start to poll() (ready state)\n");
+ fprintf(fp, "Application thread from start to poll() (ready state)\n");
fprintf(fp, "Time: %.20f sec.\n", res);
global_boot_time += res;
- res = get_bench_time(time_sessiond_th_apps_start, time_sessiond_th_apps_poll);
+ res = get_bench_time(time_sessiond_th_cli_start,
+ time_sessiond_th_cli_poll);
- fprintf(fp, "Boot time of the application thread from start to poll() (ready state)\n");
+ fprintf(fp, "Client thread from start to poll() (ready state)\n");
fprintf(fp, "Time: %.20f sec.\n", res);
global_boot_time += res;
- res = get_bench_time(time_sessiond_th_cli_start, time_sessiond_th_cli_poll);
+ res = get_bench_time(time_sessiond_th_dispatch_start,
+ time_sessiond_th_dispatch_block);
- fprintf(fp, "Boot time of the client thread from start to poll() (ready state)\n");
+ fprintf(fp, "Dispatch registration thread from start to poll()"
+ "(ready state)\n");
fprintf(fp, "Time: %.20f sec.\n", res);
global_boot_time += res;
- fprintf(fp, "Global Boot Time of ltt-sessiond: %0.20f sec.\n", global_boot_time);
+ fprintf(fp, "Global Boot Time\n");
+ fprintf(fp, "Time: %0.20f sec.\n", global_boot_time);
}
cycles_t time_sessiond_th_reg_start;
cycles_t time_sessiond_th_reg_poll;
+/* Session daemon thread registration apps time */
+cycles_t time_sessiond_th_dispatch_start;
+cycles_t time_sessiond_th_dispatch_block;
+
/* Session daemon thread manage client time */
cycles_t time_sessiond_th_cli_start;
cycles_t time_sessiond_th_cli_poll;
/*
* UST managing registration time
- *
- * Start *before* the thread reads the pipe containing the registration data.
- */
-cycles_t time_ust_manage_register_start;
-/*
- * Stop time taken *after* the register command is sent to the application.
*/
-cycles_t time_ust_manage_register_stop;
+/* read() from pipe */
+cycles_t time_ust_register_read_start;
+cycles_t time_ust_register_read_stop;
+/* register_traceable_app() time */
+cycles_t time_ust_register_add_start;
+cycles_t time_ust_register_add_stop;
+/* send register done command */
+cycles_t time_ust_register_done_start;
+cycles_t time_ust_register_done_stop;
/*
* UST notification time (using the shm/futex scheme). Those times were break
RESULTS_PATH="/tmp/lttng-bench-results.txt"
BASEDIR=`dirname $0`
-echo "Session daemon boot process benchmark"
+echo "Starting session daemon"
-`BENCH_BOOT_PROCESS=1 $BASEDIR/../ltt-sessiond/$SESSIOND_BIN --daemonize --quiet`
-if [ $? -ne 0 ]; then
+BENCH_BOOT_PROCESS=1 $BASEDIR/../ltt-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
+
+PID_SESSIOND=$!
+if [ -z $PID_SESSIOND ]; then
echo -e '\e[1;31mFAILED\e[0m'
exit 1
else
echo -e "\e[1;32mOK\e[0m"
+ echo "PID session daemon: $PID_SESSIOND"
fi
-PID_SESSIOND=`pidof lt-$SESSIOND_BIN`
-
# Wait for the benchmark to run
echo -n "Waiting."
sleep 1
echo -n "."
sleep 1
-echo -n "."
+echo "."
sleep 1
kill $PID_SESSIOND
-# Trick to wait for a PID which is not a child
-tail --pid=$PID_SESSIOND --quiet -F $RESULTS_PATH > /dev/null 2>&1
+wait $PID_SESSIOND
+
+echo "Benchmarks done in $RESULTS_PATH"
exit 0
echo "Session daemon boot"
-`BENCH_UST_NOTIFY=1 $BASEDIR/../ltt-sessiond/$SESSIOND_BIN --daemonize --quiet`
-if [ $? -ne 0 ]; then
+BENCH_UST_NOTIFY=1 $BASEDIR/../ltt-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
+
+PID_SESSIOND=$!
+if [ -z $PID_SESSIOND ]; then
echo -e '\e[1;31mFAILED\e[0m'
exit 1
else
echo -e "\e[1;32mOK\e[0m"
+ echo "PID session daemon: $PID_SESSIOND"
fi
-PID_SESSIOND=`pidof lt-$SESSIOND_BIN`
-
kill $PID_SESSIOND
-# Trick to wait for a PID which is not a child
-tail --pid=$PID_SESSIOND --quiet -F $RESULTS_PATH > /dev/null 2>&1
+wait $PID_SESSIOND
exit 0
BASEDIR=`dirname $0`
echo "Session daemon boot"
+BENCH_UST_REGISTER=1 $BASEDIR/../ltt-sessiond/$SESSIOND_BIN -v >/dev/null 2>&1 &
-`BENCH_UST_REGISTER=1 $BASEDIR/../ltt-sessiond/$SESSIOND_BIN --daemonize --quiet`
-if [ $? -ne 0 ]; then
+PID_SESSIOND=$!
+if [ -z $PID_SESSIOND ]; then
echo -e '\e[1;31mFAILED\e[0m'
exit 1
else
echo -e "\e[1;32mOK\e[0m"
+ echo "PID session daemon: $PID_SESSIOND"
fi
-PID_SESSIOND=`pidof lt-$SESSIOND_BIN`
-
# Wait for sessiond to settle
sleep 2
kill $PID_SESSIOND
-# Trick to wait for a PID which is not a child
-tail --pid=$PID_SESSIOND --quiet -F $RESULTS_PATH > /dev/null 2>&1
+wait $PID_SESSIOND
exit 0
struct pollfd *pollfd = NULL;
struct ust_command ust_cmd;
+ tracepoint(sessiond_th_apps_start);
+
DBG("[thread] Manage application started");
ust_cmd.sock = -1;
DBG("Apps thread polling on %d fds", nb_fd);
+ tracepoint(sessiond_th_apps_poll);
+
/* Inifinite blocking call, waiting for transmission */
ret = poll(pollfd, nb_fd, -1);
if (ret < 0) {
ERR("Apps command pipe poll error");
goto error;
case POLLIN:
- tracepoint(ust_manage_register_start);
+ tracepoint(ust_register_read_start);
/* Empty pipe */
ret = read(apps_cmd_pipe[0], &ust_cmd, sizeof(ust_cmd));
goto error;
}
+ tracepoint(ust_register_read_stop);
+
+ tracepoint(ust_register_add_start);
/* Register applicaton to the session daemon */
ret = register_traceable_app(&ust_cmd.reg_msg, ust_cmd.sock);
if (ret < 0) {
/* Only critical ENOMEM error can be returned here */
goto error;
}
+ tracepoint(ust_register_add_stop);
+ tracepoint(ust_register_done_start);
ret = ustctl_register_done(ust_cmd.sock);
if (ret < 0) {
/*
unregister_traceable_app(ust_cmd.sock);
}
- tracepoint(ust_manage_register_stop);
+ tracepoint(ust_register_done_stop);
break;
}
}
struct cds_wfq_node *node;
struct ust_command *ust_cmd = NULL;
+ tracepoint(sessiond_th_dispatch_start);
+
DBG("[thread] Dispatch UST command started");
while (!dispatch_thread_exit) {
futex_nto1_prepare(&ust_cmd_queue.futex);
do {
+ tracepoint(sessiond_th_dispatch_block);
+
/* Dequeue command for registration */
node = cds_wfq_dequeue_blocking(&ust_cmd_queue.queue);
if (node == NULL) {