Handle sys_socket
[lttngtop.git] / src / lttngtop.c
index c29c5a5443efc9a7d5e3c8f49d2a6ba4f67cb67b..27bf8c8cb8c5b6608b53f98af8eda405db980e78 100644 (file)
 #include "lttngtoptypes.h"
 #include "cputop.h"
 #include "iostreamtop.h"
-#include "cursesdisplay.h"
 #include "common.h"
 #include "network-live.h"
 
+#ifdef HAVE_LIBNCURSES
+#include "cursesdisplay.h"
+#endif
+
 #define NET_URL_PREFIX "net://"
 #define NET4_URL_PREFIX        "net4://"
 #define NET6_URL_PREFIX        "net6://"
@@ -153,6 +156,7 @@ void *refresh_thread(void *p)
        }
 }
 
+#ifdef HAVE_LIBNCURSES
 void *ncurses_display(void *p)
 {
        unsigned int current_display_index = 0;
@@ -184,6 +188,7 @@ void *ncurses_display(void *p)
                sem_post(&pause_sem);
        }
 }
+#endif /* HAVE_LIBNCURSES */
 
 void print_fields(struct bt_ctf_event *event, const char *procname,
                int pid)
@@ -903,6 +908,9 @@ void iter_trace(struct bt_context *bt_ctx)
        bt_ctf_iter_add_callback(iter,
                        g_quark_from_static_string("sys_open"),
                        NULL, 0, handle_sys_open, NULL, NULL, NULL);
+       bt_ctf_iter_add_callback(iter,
+                       g_quark_from_static_string("sys_socket"),
+                       NULL, 0, handle_sys_socket, NULL, NULL, NULL);
        bt_ctf_iter_add_callback(iter,
                        g_quark_from_static_string("sys_close"),
                        NULL, 0, handle_sys_close, NULL, NULL, NULL);
@@ -1269,10 +1277,16 @@ int main(int argc, char **argv, char **envp)
                }
 
                if (!opt_textdump) {
+#ifdef HAVE_LIBNCURSES
                        pthread_create(&display_thread, NULL, ncurses_display,
                                        (void *) NULL);
                        pthread_create(&timer_thread, NULL, refresh_thread,
                                        (void *) NULL);
+#else
+                       printf("Ncurses support not compiled, please install "
+                                       "the missing dependencies and recompile\n");
+                       goto end;
+#endif
                }
 
                iter_trace(bt_ctx);
This page took 0.023247 seconds and 4 git commands to generate.