improve create_listener()
[ust.git] / libust / tracectl.c
index 23f02466d8a4aa3014ebb57726675edce2f14e09..2d4341d3b418cd4957b8ab2efc95fbf564f6520e 100644 (file)
@@ -63,10 +63,6 @@ struct tracecmd { /* no padding */
 /* volatile because shared between the listener and the main thread */
 volatile sig_atomic_t buffers_to_export = 0;
 
-//struct listener_arg {
-//     int pipe_fd;
-//};
-
 struct trctl_msg {
        /* size: the size of all the fields except size itself */
        uint32_t size;
@@ -778,15 +774,18 @@ void create_listener(void)
 {
 #ifdef USE_CLONE
        static char listener_stack[16384];
+       int result;
 #else
        pthread_t thread;
 #endif
 
-       if(have_listener)
+       if(have_listener) {
+               WARN("not creating listener because we already had one");
                return;
+       }
 
 #ifdef USE_CLONE
-       result = clone(listener_main, listener_stack+sizeof(listener_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL);
+       result = clone((int (*)(void *)) listener_main, listener_stack+sizeof(listener_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL);
        if(result == -1) {
                perror("clone");
                return;
@@ -1128,10 +1127,12 @@ static void __attribute__((destructor)) keepalive()
        ustcomm_fini_app(&ustcomm_app);
 }
 
-noinline void ust_potential_exec(void)
+void ust_potential_exec(void)
 {
        trace_mark(ust, potential_exec, MARK_NOARGS);
 
+       DBG("test");
+
        keepalive();
 }
 
@@ -1141,7 +1142,7 @@ noinline void ust_potential_exec(void)
  * of the new process will not be collected.
  */
 
-noinline void ust_fork(void)
+void ust_fork(void)
 {
        struct blocked_consumer *bc;
        struct blocked_consumer *deletable_bc = NULL;
This page took 0.023715 seconds and 4 git commands to generate.