Store the version of the tracer in the UID registry
[lttng-tools.git] / src / bin / lttng / lttng.c
index 4d2df2deb999832f1d816eefc44ebb441e7ce614..d4dbe2697a8d2a591ed1c045267a559cee69420f 100644 (file)
@@ -15,7 +15,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <getopt.h>
 #include <signal.h>
@@ -25,7 +24,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include <config.h>
 #include <ctype.h>
 
 #include <lttng/lttng.h>
@@ -38,8 +36,6 @@
 static char *progname;
 int opt_no_sessiond;
 char *opt_sessiond_path;
-pid_t sessiond_pid;
-volatile int recv_child_signal;
 
 char *opt_relayd_path;
 
@@ -69,6 +65,7 @@ static struct option long_options[] = {
 /* First level command */
 static struct cmd_struct commands[] =  {
        { "list", cmd_list},
+       { "status", cmd_status},
        { "create", cmd_create},
        { "destroy", cmd_destroy},
        { "start", cmd_start},
@@ -123,6 +120,7 @@ static void usage(FILE *ofp)
        fprintf(ofp, "    set-session       Set current session name\n");
        fprintf(ofp, "    snapshot          Snapshot buffers of current session name\n");
        fprintf(ofp, "    start             Start tracing\n");
+       fprintf(ofp, "    status            Show current session's details\n");
        fprintf(ofp, "    stop              Stop tracing\n");
        fprintf(ofp, "    version           Show version information\n");
        fprintf(ofp, "    view              Start trace viewer\n");
@@ -203,26 +201,11 @@ static void clean_exit(int code)
  */
 static void sighandler(int sig)
 {
-       int status;
-
        switch (sig) {
                case SIGTERM:
                        DBG("SIGTERM caught");
                        clean_exit(EXIT_FAILURE);
                        break;
-               case SIGCHLD:
-                       DBG("SIGCHLD caught");
-                       waitpid(sessiond_pid, &status, 0);
-                       recv_child_signal = 1;
-                       /* Indicate that the session daemon died */
-                       sessiond_pid = 0;
-                       ERR("Session daemon died (exit status %d)", WEXITSTATUS(status));
-                       break;
-               case SIGUSR1:
-                       /* Notify is done */
-                       recv_child_signal = 1;
-                       DBG("SIGUSR1 caught");
-                       break;
                default:
                        DBG("Unknown signal %d caught", sig);
                        break;
@@ -250,21 +233,12 @@ static int set_signal_handler(void)
        sa.sa_handler = sighandler;
        sa.sa_mask = sigset;
        sa.sa_flags = 0;
-       if ((ret = sigaction(SIGUSR1, &sa, NULL)) < 0) {
-               PERROR("sigaction");
-               goto end;
-       }
 
        if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
                PERROR("sigaction");
                goto end;
        }
 
-       if ((ret = sigaction(SIGCHLD, &sa, NULL)) < 0) {
-               PERROR("sigaction");
-               goto end;
-       }
-
 end:
        return ret;
 }
This page took 0.0236420000000001 seconds and 4 git commands to generate.