From: David Goulet Date: Thu, 8 Mar 2012 23:13:18 +0000 (-0500) Subject: Merge branch 'master' into benchmark X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=768102358c0646342496b2b07b4518e0d5258b6f;p=lttng-tools.git Merge branch 'master' into benchmark --- 768102358c0646342496b2b07b4518e0d5258b6f diff --cc src/bin/lttng-sessiond/main.c index 09353374e,6c7ed1fd6..e341233ff --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@@ -426,28 -440,35 +442,54 @@@ static void cleanup(void modprobe_remove_lttng_all(); } - close(thread_quit_pipe[0]); - close(thread_quit_pipe[1]); + /* + * Closing all pipes used for communication between threads. + */ + for (i = 0; i < 2; i++) { + if (kernel_poll_pipe[i] >= 0) { + ret = close(kernel_poll_pipe[i]); + if (ret) { + PERROR("close"); + } + + } + } + for (i = 0; i < 2; i++) { + if (thread_quit_pipe[i] >= 0) { + ret = close(thread_quit_pipe[i]); + if (ret) { + PERROR("close"); + } + } + } + for (i = 0; i < 2; i++) { + if (apps_cmd_pipe[i] >= 0) { + ret = close(apps_cmd_pipe[i]); + if (ret) { + PERROR("close"); + } + } + } + /* OUTPUT BENCHMARK RESULTS */ + bench_init(); + + if (getenv("BENCH_UST_NOTIFY")) { + bench_print_ust_notification(); + } + + if (getenv("BENCH_UST_REGISTER")) { + bench_print_ust_register(); + bench_print_ust_unregister(); + } + + if (getenv("BENCH_BOOT_PROCESS")) { + bench_print_boot_process(); + } + + bench_close(); + /* END BENCHMARK */ + /* */ DBG("%c[%d;%dm*** assert failed :-) *** ==> %c[%dm%c[%d;%dm" "Matthew, BEET driven development works!%c[%dm", @@@ -1169,12 -1186,10 +1225,12 @@@ static void *thread_manage_apps(void *d /* Empty pipe */ ret = read(apps_cmd_pipe[0], &ust_cmd, sizeof(ust_cmd)); if (ret < 0 || ret < sizeof(ust_cmd)) { - perror("read apps cmd pipe"); + PERROR("read apps cmd pipe"); goto error; } + tracepoint(ust_register_read_stop); + tracepoint(ust_register_add_start); /* Register applicaton to the session daemon */ ret = ust_app_register(&ust_cmd.reg_msg, ust_cmd.sock); @@@ -4560,11 -4633,9 +4707,11 @@@ int main(int argc, char **argv goto exit_kernel; } + tracepoint(sessiond_boot_end); + ret = pthread_join(kernel_thread, &status); if (ret != 0) { - perror("pthread_join"); + PERROR("pthread_join"); goto error; /* join error, exit without cleanup */ } diff --cc src/bin/lttng-sessiond/shm.c index 0bf3ff58f,432d07ece..7f6040c4b --- a/src/bin/lttng-sessiond/shm.c +++ b/src/bin/lttng-sessiond/shm.c @@@ -111,14 -104,16 +111,18 @@@ static int get_wait_shm(char *shm_path exit(EXIT_FAILURE); } + #ifndef __FreeBSD__ ret = fchmod(wait_shm_fd, mode); if (ret < 0) { - perror("fchmod"); + PERROR("fchmod"); exit(EXIT_FAILURE); } + #else + #warning "FreeBSD does not support setting file mode on shm FD. Remember that for secure use, lttng-sessiond should be started before applications linked on lttng-ust." + #endif + tracepoint(ust_notify_shm_stop); + DBG("Got the wait shm fd %d", wait_shm_fd); return wait_shm_fd;