Disable lttng ust domain not implemented
authorDavid Goulet <dgoulet@efficios.com>
Mon, 23 Jan 2012 21:42:30 +0000 (16:42 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 23 Jan 2012 21:42:30 +0000 (16:42 -0500)
Keep them in lttng.h to retain values for future development.

Also fix define alignment in lttng.h

Note that at this commit, "Not implemented" error is still returned.
This will be fix to "Unknown command" in next commit.

Signed-off-by: David Goulet <dgoulet@efficios.com>
13 files changed:
include/lttng/lttng.h
src/bin/lttng-sessiond/channel.c
src/bin/lttng-sessiond/context.c
src/bin/lttng-sessiond/event.c
src/bin/lttng-sessiond/main.c
src/bin/lttng/commands/add_context.c
src/bin/lttng/commands/calibrate.c
src/bin/lttng/commands/disable_channels.c
src/bin/lttng/commands/disable_events.c
src/bin/lttng/commands/enable_channels.c
src/bin/lttng/commands/enable_events.c
src/bin/lttng/commands/list.c
src/lib/lttng-ctl/lttng-ctl.c

index f1c913b66b639f5244bb0282e1b734282df85656..8bdfe121c44bdce2acac16e3b5699e4848310cbf 100644 (file)
 enum lttng_domain_type {
        LTTNG_DOMAIN_KERNEL                   = 1,
        LTTNG_DOMAIN_UST                      = 2,
+
+       /*
+        * For now, the domains below are not implemented. However, we keep them
+        * here in order to retain their enum values for future development. Note
+        * that it is on the roadmap to implement them.
+        *
        LTTNG_DOMAIN_UST_EXEC_NAME            = 3,
        LTTNG_DOMAIN_UST_PID                  = 4,
        LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN  = 5,
+       */
 };
 
 /*
@@ -75,26 +82,26 @@ enum lttng_event_type {
  * LTTng consumer mode
  */
 enum lttng_event_output {
-       LTTNG_EVENT_SPLICE = 0,
-       LTTNG_EVENT_MMAP   = 1,
+       LTTNG_EVENT_SPLICE                    = 0,
+       LTTNG_EVENT_MMAP                      = 1,
 };
 
 /* Event context possible type */
 enum lttng_event_context_type {
-       LTTNG_EVENT_CONTEXT_PID                = 0,
-       LTTNG_EVENT_CONTEXT_PERF_COUNTER       = 1,
-       LTTNG_EVENT_CONTEXT_COMM               = 2,
-       LTTNG_EVENT_CONTEXT_PRIO               = 3,
-       LTTNG_EVENT_CONTEXT_NICE               = 4,
-       LTTNG_EVENT_CONTEXT_VPID               = 5,
-       LTTNG_EVENT_CONTEXT_TID                = 6,
-       LTTNG_EVENT_CONTEXT_VTID               = 7,
-       LTTNG_EVENT_CONTEXT_PPID               = 8,
-       LTTNG_EVENT_CONTEXT_VPPID              = 9,
+       LTTNG_EVENT_CONTEXT_PID               = 0,
+       LTTNG_EVENT_CONTEXT_PERF_COUNTER      = 1,
+       LTTNG_EVENT_CONTEXT_COMM              = 2,
+       LTTNG_EVENT_CONTEXT_PRIO              = 3,
+       LTTNG_EVENT_CONTEXT_NICE              = 4,
+       LTTNG_EVENT_CONTEXT_VPID              = 5,
+       LTTNG_EVENT_CONTEXT_TID               = 6,
+       LTTNG_EVENT_CONTEXT_VTID              = 7,
+       LTTNG_EVENT_CONTEXT_PPID              = 8,
+       LTTNG_EVENT_CONTEXT_VPPID             = 9,
 };
 
 enum lttng_calibrate_type {
-       LTTNG_CALIBRATE_FUNCTION               = 0,
+       LTTNG_CALIBRATE_FUNCTION              = 0,
 };
 
 struct lttng_domain {
index b5202fe6abe0807a35088e5b88ef8cd82e0779ce..23b3b1feea0050490e3a895d3054507e91a88536 100644 (file)
@@ -59,7 +59,11 @@ struct lttng_channel *channel_new_default_attr(int dom)
                chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
                break;
        case LTTNG_DOMAIN_UST:
+#if 0
        case LTTNG_DOMAIN_UST_PID:
+       case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+       case LTTNG_DOMAIN_UST_EXEC_NAME:
+#endif
                chan->attr.subbuf_size = DEFAULT_UST_CHANNEL_SUBBUF_SIZE;
                chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM;
                chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
@@ -184,9 +188,12 @@ int channel_ust_enable(struct ltt_ust_session *usess, int domain,
                /* Enable channel for global domain */
                ret = ust_app_enable_channel_glb(usess, uchan);
                break;
+#if 0
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
        case LTTNG_DOMAIN_UST_EXEC_NAME:
+#endif
+       default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
        }
@@ -243,9 +250,11 @@ int channel_ust_create(struct ltt_ust_session *usess, int domain,
                /* Enable channel for global domain */
                ret = ust_app_create_channel_glb(usess, uchan);
                break;
+#if 0
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
        case LTTNG_DOMAIN_UST_EXEC_NAME:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error_free_chan;
@@ -298,9 +307,12 @@ int channel_ust_disable(struct ltt_ust_session *usess, int domain,
                /* Disable channel for global domain */
                ret = ust_app_disable_channel_glb(usess, uchan);
                break;
+#if 0
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
+#endif
+       default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
        }
index 0144f78248ee8c908077be0ec3b2f9aa66add057..bbed1e767a8ecb1dbed73e4578bc4cfbab1f677e 100644 (file)
@@ -292,9 +292,11 @@ int context_ust_add(struct ltt_ust_session *usess, int domain,
        case LTTNG_DOMAIN_UST:
                chan_ht = usess->domain_global.channels;
                break;
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
index 4a86c22cdd6aa694896c1314e026c837dd5a117d..0a82372bd57fdddf0d34061d56bc697c70a911c9 100644 (file)
@@ -334,9 +334,11 @@ int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, int domain,
                free(events);
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
@@ -401,9 +403,11 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, int domain,
                }
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto end;
@@ -468,9 +472,11 @@ int event_ust_disable_tracepoint(struct ltt_ust_session *usess, int domain,
                        goto error;
                }
                break;
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
@@ -539,9 +545,11 @@ int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, int domain,
                free(events);
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
index 7da0b7c686c314010bfd5106620e1892809b88c5..1b837c1fc52ed201bcc2e553d2c67ce71189bddc 100644 (file)
@@ -2159,11 +2159,11 @@ static int cmd_disable_channel(struct ltt_session *session,
                }
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
-               ret = LTTCOMM_NOT_IMPLEMENTED;
-               goto error;
+#endif
        default:
                ret = LTTCOMM_UNKNOWN_DOMAIN;
                goto error;
@@ -2222,11 +2222,11 @@ static int cmd_enable_channel(struct ltt_session *session,
                }
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
-               ret = LTTCOMM_NOT_IMPLEMENTED;
-               goto error;
+#endif
        default:
                ret = LTTCOMM_UNKNOWN_DOMAIN;
                goto error;
@@ -2289,9 +2289,11 @@ static int cmd_disable_event(struct ltt_session *session, int domain,
                                channel_name);
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
@@ -2356,9 +2358,11 @@ static int cmd_disable_event_all(struct ltt_session *session, int domain,
 
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
@@ -2397,9 +2401,11 @@ static int cmd_add_context(struct ltt_session *session, int domain,
                }
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
@@ -2512,9 +2518,11 @@ static int cmd_enable_event(struct ltt_session *session, int domain,
                }
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
@@ -2647,9 +2655,11 @@ static int cmd_enable_event_all(struct ltt_session *session, int domain,
 
                break;
        }
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
        default:
                ret = LTTCOMM_NOT_IMPLEMENTED;
                goto error;
index 23ae8f2a87ec6f414cf29c6b2b97498ae4176874..95fefa50c831486772eca28475a2612c0c10ed2d 100644 (file)
@@ -37,9 +37,12 @@ static char *opt_channel_name;
 static char *opt_session_name;
 static int opt_kernel;
 static int opt_userspace;
+static char *opt_type;
+#if 0
+/* Not implemented yet */
 static char *opt_cmd_name;
 static pid_t opt_pid;
-static char *opt_type;
+#endif
 
 enum {
        OPT_HELP = 1,
@@ -138,8 +141,13 @@ static struct poptOption long_options[] = {
        {"channel",        'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
        {"event",          'e', POPT_ARG_STRING, &opt_event_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
+#if 0
+       /* Not implemented yet */
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {"type",           't', POPT_ARG_STRING, &opt_type, OPT_TYPE, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
 };
@@ -303,10 +311,14 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -c, --channel NAME       Apply on channel\n");
        fprintf(ofp, "  -e, --event NAME         Apply on event\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
+#if 0
        fprintf(ofp, "  -u, --userspace [CMD]    Apply for the user-space tracer\n");
        fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
        fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
        fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
+#else
+       fprintf(ofp, "  -u, --userspace          Apply for the user-space tracer\n");
+#endif
        fprintf(ofp, "  -t, --type TYPE          Context type. You can repeat that option on\n");
        fprintf(ofp, "                           the command line.\n");
        fprintf(ofp, "                           TYPE can be one of the strings below:\n");
@@ -352,15 +364,8 @@ static int add_context(char *session_name)
 
        if (opt_kernel) {
                dom.type = LTTNG_DOMAIN_KERNEL;
-       } else if (opt_pid != 0) {
-               dom.type = LTTNG_DOMAIN_UST_PID;
-               dom.attr.pid = opt_pid;
-               DBG("PID %d set to lttng handle", opt_pid);
-       } else if (opt_userspace && opt_cmd_name == NULL) {
+       } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
-       } else if (opt_userspace && opt_cmd_name != NULL) {
-               dom.type = LTTNG_DOMAIN_UST_EXEC_NAME;
-               strncpy(dom.attr.exec_name, opt_cmd_name, NAME_MAX);
        } else {
                ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
                ret = CMD_NOT_IMPLEMENTED;
@@ -454,7 +459,9 @@ int cmd_add_context(int argc, const char **argv)
                        break;
                case OPT_USERSPACE:
                        opt_userspace = 1;
+#if 0
                        opt_cmd_name = poptGetOptArg(pc);
+#endif
                        break;
                default:
                        usage(stderr);
index ee2c76af1bb9ab879163c2e2450b1db4ab8425b9..023ea100e1fb6a8fcbdd4e712363421a050e72ae 100644 (file)
 
 static int opt_event_type;
 static char *opt_kernel;
-static int opt_pid_all;
 static int opt_userspace;
+#if 0
+/* Not implemented yet */
 static char *opt_cmd_name;
 static pid_t opt_pid;
+#endif
 
 enum {
        OPT_HELP = 1,
@@ -54,9 +56,13 @@ static struct poptOption long_options[] = {
        /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
        {"help",           'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
+#if 0
+       /* Not implemented yet */
        {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
-       {"all",            0,   POPT_ARG_VAL, &opt_pid_all, 1, 0, 0},
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {"tracepoint",     0,   POPT_ARG_NONE, 0, OPT_TRACEPOINT, 0, 0},
        {"marker",         0,   POPT_ARG_NONE, 0, OPT_MARKER, 0, 0},
        {"probe",          0,   POPT_ARG_NONE, 0, OPT_PROBE, 0, 0},
@@ -81,9 +87,14 @@ static void usage(FILE *ofp)
        fprintf(ofp, "\n");
        fprintf(ofp, "  -h, --help               Show this help\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
+#if 0
        fprintf(ofp, "  -u, --userspace [CMD]    Apply for the user-space tracer\n");
-       fprintf(ofp, "      --all                If -u, apply on all traceable apps\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply on a specific PID\n");
+       fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
+       fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
+       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
+#else
+       fprintf(ofp, "  -u, --userspace          Apply for the user-space tracer\n");
+#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Calibrate options:\n");
        fprintf(ofp, "    --tracepoint           Tracepoint event (default)\n");
@@ -147,12 +158,6 @@ static int calibrate_lttng(void)
                        goto end;
                }
        } else if (opt_userspace) {             /* User-space tracer action */
-               /*
-                * TODO: Waiting on lttng UST 2.0
-                */
-               if (opt_pid_all) {
-               } else if (opt_pid != 0) {
-               }
                ret = CMD_NOT_IMPLEMENTED;
                goto end;
        } else {
index f2e181971b50993ecd423a343e9d4615ad26d940..cc81b74c9e6ad70c603c9b363d11d17ea6ad9544 100644 (file)
@@ -31,8 +31,11 @@ static char *opt_channels;
 static int opt_kernel;
 static char *opt_session_name;
 static int opt_userspace;
+#if 0
+/* Not implemented yet */
 static char *opt_cmd_name;
 static pid_t opt_pid;
+#endif
 
 enum {
        OPT_HELP = 1,
@@ -46,8 +49,13 @@ static struct poptOption long_options[] = {
        {"help",           'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
        {"session",        's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
+#if 0
+       /* Not implemented yet */
        {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {0, 0, 0, 0, 0, 0, 0}
 };
 
@@ -61,10 +69,14 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -h, --help               Show this help\n");
        fprintf(ofp, "  -s, --session            Apply on session name\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
+#if 0
        fprintf(ofp, "  -u, --userspace [CMD]    Apply for the user-space tracer\n");
        fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
        fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
        fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
+#else
+       fprintf(ofp, "  -u, --userspace          Apply for the user-space tracer\n");
+#endif
        fprintf(ofp, "\n");
 }
 
@@ -77,17 +89,11 @@ static int disable_channels(char *session_name)
        char *channel_name;
        struct lttng_domain dom;
 
+       /* Create lttng domain */
        if (opt_kernel) {
                dom.type = LTTNG_DOMAIN_KERNEL;
-       } else if (opt_pid != 0) {
-               dom.type = LTTNG_DOMAIN_UST_PID;
-               dom.attr.pid = opt_pid;
-               DBG("PID %d set to lttng handle", opt_pid);
-       } else if (opt_userspace && opt_cmd_name == NULL) {
+       } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
-       } else if (opt_userspace && opt_cmd_name != NULL) {
-               dom.type = LTTNG_DOMAIN_UST_EXEC_NAME;
-               strncpy(dom.attr.exec_name, opt_cmd_name, NAME_MAX);
        } else {
                ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
                ret = CMD_NOT_IMPLEMENTED;
index 0e53b4228fb1439b67685b16a0be17199c2e16a3..e6c8b2d06971a18b901f4eb7a4364ac194e0d22d 100644 (file)
@@ -32,9 +32,12 @@ static int opt_kernel;
 static char *opt_channel_name;
 static char *opt_session_name;
 static int opt_userspace;
-static char *opt_cmd_name;
 static int opt_disable_all;
+#if 0
+/* Not implemented yet */
+static char *opt_cmd_name;
 static pid_t opt_pid;
+#endif
 
 enum {
        OPT_HELP = 1,
@@ -50,8 +53,13 @@ static struct poptOption long_options[] = {
        {"all-events",     'a', POPT_ARG_VAL, &opt_disable_all, 1, 0, 0},
        {"channel",        'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
+#if 0
+       /* Not implemented yet */
        {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {0, 0, 0, 0, 0, 0, 0}
 };
 
@@ -67,10 +75,14 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -c, --channel            Apply on this channel\n");
        fprintf(ofp, "  -a, --all-events         Disable all tracepoints\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
+#if 0
        fprintf(ofp, "  -u, --userspace [CMD]    Apply for the user-space tracer\n");
        fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
        fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
        fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
+#else
+       fprintf(ofp, "  -u, --userspace          Apply for the user-space tracer\n");
+#endif
        fprintf(ofp, "\n");
 }
 
@@ -101,19 +113,11 @@ static int disable_events(char *session_name)
                goto error;
        }
 
+       /* Create lttng domain */
        if (opt_kernel) {
                dom.type = LTTNG_DOMAIN_KERNEL;
-       } else if (opt_pid != 0) {
-               dom.type = LTTNG_DOMAIN_UST_PID;
-               dom.attr.pid = opt_pid;
-               DBG("PID %d set to lttng handle", opt_pid);
-       } else if (opt_userspace && opt_cmd_name == NULL) {
+       } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
-               DBG("UST global domain selected");
-       } else if (opt_userspace && opt_cmd_name != NULL) {
-               dom.type = LTTNG_DOMAIN_UST_EXEC_NAME;
-               strncpy(dom.attr.exec_name, opt_cmd_name, NAME_MAX);
-               dom.attr.exec_name[NAME_MAX - 1] = '\0';
        } else {
                ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
                ret = CMD_NOT_IMPLEMENTED;
@@ -145,11 +149,13 @@ static int disable_events(char *session_name)
                        DBG("Disabling kernel event %s in channel %s",
                                        event_name, channel_name);
                } else if (opt_userspace) {             /* User-space tracer action */
+#if 0
                        if (opt_cmd_name != NULL || opt_pid) {
                                MSG("Only supporting tracing all UST processes (-u) for now.");
                                ret = CMD_NOT_IMPLEMENTED;
                                goto error;
                        }
+#endif
                        DBG("Disabling UST event %s in channel %s",
                                        event_name, channel_name);
                } else {
index 3ec02ef4127d8cbff3052af6b0f7f8ce9e447f9c..2da06ad503f0d954c90252e4ab4710e68302ad92 100644 (file)
 
 static char *opt_channels;
 static int opt_kernel;
-static char *opt_cmd_name;
 static char *opt_session_name;
 static int opt_userspace;
+static struct lttng_channel chan;
+#if 0
+/* Not implemented yet */
 static char *opt_cmd_name;
 static pid_t opt_pid;
-static struct lttng_channel chan;
+#endif
 
 enum {
        OPT_HELP = 1,
@@ -55,8 +57,13 @@ static struct poptOption long_options[] = {
        {"help",           'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
        {"session",        's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
+#if 0
+       /* Not implemented yet */
        {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {"discard",        0,   POPT_ARG_NONE, 0, OPT_DISCARD, 0, 0},
        {"overwrite",      0,   POPT_ARG_NONE, 0, OPT_OVERWRITE, 0, 0},
        {"subbuf-size",    0,   POPT_ARG_DOUBLE, 0, OPT_SUBBUF_SIZE, 0, 0},
@@ -76,10 +83,14 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -h, --help               Show this help\n");
        fprintf(ofp, "  -s, --session            Apply on session name\n");
        fprintf(ofp, "  -k, --kernel             Apply on the kernel tracer\n");
+#if 0
        fprintf(ofp, "  -u, --userspace [CMD]    Apply for the user-space tracer\n");
        fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
        fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
        fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
+#else
+       fprintf(ofp, "  -u, --userspace          Apply for the user-space tracer\n");
+#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Channel options:\n");
        fprintf(ofp, "      --discard            Discard event when buffers are full%s\n",
@@ -141,17 +152,11 @@ static int enable_channel(char *session_name)
        char *channel_name;
        struct lttng_domain dom;
 
+       /* Create lttng domain */
        if (opt_kernel) {
                dom.type = LTTNG_DOMAIN_KERNEL;
-       } else if (opt_pid != 0) {
-               dom.type = LTTNG_DOMAIN_UST_PID;
-               dom.attr.pid = opt_pid;
-               DBG("PID %d set to lttng handle", opt_pid);
-       } else if (opt_userspace && opt_cmd_name == NULL) {
+       } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
-       } else if (opt_userspace && opt_cmd_name != NULL) {
-               dom.type = LTTNG_DOMAIN_UST_EXEC_NAME;
-               strncpy(dom.attr.exec_name, opt_cmd_name, NAME_MAX);
        } else {
                ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
                ret = CMD_NOT_IMPLEMENTED;
index ca18ccd4847edfea7407f02a425456c3149ce1ba..8360821fb09221304b386f3dc45fac19a7107c59 100644 (file)
@@ -34,13 +34,16 @@ static int opt_event_type;
 static int opt_kernel;
 static char *opt_session_name;
 static int opt_userspace;
-static char *opt_cmd_name;
 static int opt_enable_all;
-static pid_t opt_pid;
 static char *opt_probe;
 static char *opt_function;
 static char *opt_function_entry_symbol;
 static char *opt_channel_name;
+#if 0
+/* Not implemented yet */
+static char *opt_cmd_name;
+static pid_t opt_pid;
+#endif
 
 enum {
        OPT_HELP = 1,
@@ -62,8 +65,13 @@ static struct poptOption long_options[] = {
        {"all",            'a', POPT_ARG_VAL, &opt_enable_all, 1, 0, 0},
        {"channel",        'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
+#if 0
+       /* Not implemented yet */
        {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {"tracepoint",     0,   POPT_ARG_NONE, 0, OPT_TRACEPOINT, 0, 0},
        {"probe",          0,   POPT_ARG_STRING, &opt_probe, OPT_PROBE, 0, 0},
        {"function",       0,   POPT_ARG_STRING, &opt_function, OPT_FUNCTION, 0, 0},
@@ -91,10 +99,14 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -c, --channel            Apply on this channel\n");
        fprintf(ofp, "  -a, --all                Enable all tracepoints\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
+#if 0
        fprintf(ofp, "  -u, --userspace [CMD]    Apply for the user-space tracer\n");
        fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
        fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
        fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
+#else
+       fprintf(ofp, "  -u, --userspace          Apply for the user-space tracer\n");
+#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Event options:\n");
        fprintf(ofp, "    --tracepoint           Tracepoint event (default)\n");
@@ -216,15 +228,8 @@ static int enable_events(char *session_name)
        /* Create lttng domain */
        if (opt_kernel) {
                dom.type = LTTNG_DOMAIN_KERNEL;
-       } else if (opt_pid != 0) {
-               dom.type = LTTNG_DOMAIN_UST_PID;
-               dom.attr.pid = opt_pid;
-               DBG("PID %d set to lttng handle", opt_pid);
-       } else if (opt_userspace && opt_cmd_name == NULL) {
+       } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
-       } else if (opt_userspace && opt_cmd_name != NULL) {
-               dom.type = LTTNG_DOMAIN_UST_EXEC_NAME;
-               strncpy(dom.attr.exec_name, opt_cmd_name, NAME_MAX);
        } else {
                ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
                ret = CMD_NOT_IMPLEMENTED;
@@ -326,11 +331,13 @@ static int enable_events(char *session_name)
                                goto error;
                        }
                } else if (opt_userspace) {             /* User-space tracer action */
+#if 0
                        if (opt_cmd_name != NULL || opt_pid) {
                                MSG("Only supporting tracing all UST processes (-u) for now.");
                                ret = CMD_NOT_IMPLEMENTED;
                                goto error;
                        }
+#endif
 
                        DBG("Enabling UST event %s for channel %s", event_name,
                                        channel_name);
index 7698bb6ed12515555ffc3bf72e7541e3d3cf3f85..f09edaef474ce76660fd67aad1867d42bc7b4550 100644 (file)
 
 #include "../command.h"
 
-static int opt_pid;
 static int opt_userspace;
-static char *opt_cmd_name;
 static int opt_kernel;
 static char *opt_channel;
 static int opt_domain;
+#if 0
+/* Not implemented yet */
+static char *opt_cmd_name;
+static pid_t opt_pid;
+#endif
 
 const char *indent4 = "    ";
 const char *indent6 = "      ";
@@ -48,8 +51,13 @@ static struct poptOption long_options[] = {
        /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
        {"help",      'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
        {"kernel",    'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-       {"userspace", 'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
-       {"pid",       'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#if 0
+       /* Not implemented yet */
+       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
+       {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
+#else
+       {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
+#endif
        {"channel",   'c', POPT_ARG_STRING, &opt_channel, 0, 0, 0},
        {"domain",    'd', POPT_ARG_VAL, &opt_domain, 1, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
@@ -70,7 +78,9 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -h, --help              Show this help\n");
        fprintf(ofp, "  -k, --kernel            Select kernel domain\n");
        fprintf(ofp, "  -u, --userspace         Select user-space domain.\n");
+#if 0
        fprintf(ofp, "  -p, --pid PID           List user-space events by PID\n");
+#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Options:\n");
        fprintf(ofp, "  -c, --channel NAME      List details of a channel\n");
@@ -553,10 +563,6 @@ int cmd_list(int argc, const char **argv)
                }
        }
 
-       if (opt_pid != 0) {
-               MSG("*** Userspace tracing not implemented for PID ***\n");
-       }
-
        /* Get session name (trailing argument) */
        session_name = poptGetArg(pc);
        DBG2("Session name: %s", session_name);
index 9fbc7358c0e4b583b231603e08a7b8a1ee3aa3e2..0858c1a74ef6ce1f2c312e832e0d1b43cc6aac2f 100644 (file)
@@ -66,9 +66,11 @@ static void copy_lttng_domain(struct lttng_domain *dst, struct lttng_domain *src
                switch (src->type) {
                        case LTTNG_DOMAIN_KERNEL:
                        case LTTNG_DOMAIN_UST:
+                       /*
                        case LTTNG_DOMAIN_UST_EXEC_NAME:
                        case LTTNG_DOMAIN_UST_PID:
                        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+                       */
                                memcpy(dst, src, sizeof(struct lttng_domain));
                                break;
                        default:
@@ -847,9 +849,11 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain,
                attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
                break;
        case LTTNG_DOMAIN_UST:
+#if 0
        case LTTNG_DOMAIN_UST_EXEC_NAME:
        case LTTNG_DOMAIN_UST_PID:
        case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
                attr->overwrite = DEFAULT_CHANNEL_OVERWRITE;
                attr->switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
                attr->read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
This page took 0.056508 seconds and 4 git commands to generate.