Merge branch 'master' into benchmark
authorDavid Goulet <dgoulet@efficios.com>
Thu, 8 Mar 2012 23:13:18 +0000 (18:13 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 8 Mar 2012 23:13:18 +0000 (18:13 -0500)
1  2 
configure.ac
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/shm.c

diff --cc configure.ac
Simple merge
index 09353374e0be885e2d9775f265025bc7401ca9d0,6c7ed1fd6e7839926c65e58f28fbfc526bef48f0..e341233ff0ae6cee85e04f85788716ef476779b2
@@@ -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 */
 +
        /* <fun> */
        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 */
        }
  
index 0bf3ff58f0dd138e553f9c1dafaa38d418b1d09c,432d07ecea5eb4462d36a6a4727737532e97791f..7f6040c4b65360c67df2a7b072ca47e66438705f
@@@ -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;
This page took 0.031164 seconds and 4 git commands to generate.