-AM_CPPFLAGS = -DINSTALL_BIN_PATH=\""$(lttnglibexecdir)"\" \
++<<<<<<< HEAD
+AM_CPPFLAGS = -I$(top_srcdir)/benchmark \
- -DINSTALL_BIN_PATH=\""$(bindir)"\" \
++ -DINSTALL_BIN_PATH=\""$(lttnglibexecdir)"\" \
-DINSTALL_LIB_PATH=\""$(libdir)"\"
AM_CFLAGS = -fno-strict-aliasing
$(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
$(top_builddir)/src/common/hashtable/libhashtable.la \
$(top_builddir)/src/common/libcommon.la \
- $(top_builddir)/benchmark/liblttng-benchmark.la \
- $(top_builddir)/src/common/libcompat.la
- $(top_builddir)/src/common/compat/libcompat.la
++ $(top_builddir)/src/common/compat/libcompat.la \
++ $(top_builddir)/benchmark/liblttng-benchmark.la
if HAVE_LIBLTTNG_UST_CTL
lttng_sessiond_LDADD += -llttng-ust-ctl
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 */
+
/* <fun> */
DBG("%c[%d;%dm*** assert failed :-) *** ==> %c[%dm%c[%d;%dm"
"Matthew, BEET driven development works!%c[%dm",
/* Zeroed the poll events */
lttng_poll_reset(&events);
+ tracepoint(sessiond_th_kern_poll);
+
/* Poll infinite value of time */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
} else if (ret == 0) {
/* Should not happen since timeout is infinite */
nb_fd = LTTNG_POLL_GETNB(&events);
+ tracepoint(sessiond_th_kcon_poll);
+
/* Inifinite blocking call, waiting for transmission */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
}
DBG("Apps thread polling on %d fds", nb_fd);
+ tracepoint(sessiond_th_apps_poll);
+
/* Inifinite blocking call, waiting for transmission */
+ restart:
ret = lttng_poll_wait(&events, -1);
if (ret < 0) {
+ /*
+ * Restart interrupted system call.
+ */
+ if (errno == EINTR) {
+ goto restart;
+ }
goto error;
}
/* 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);
}
case LTTNG_DESTROY_SESSION:
{
+ tracepoint(destroy_session_start);
ret = cmd_destroy_session(cmd_ctx->session,
cmd_ctx->lsm->session.name);
+ tracepoint(destroy_session_end);
+ /*
+ * Set session to NULL so we do not unlock it after
+ * free.
+ */
+ cmd_ctx->session = NULL;
break;
}
case LTTNG_LIST_DOMAINS:
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 */
}