Fix: enable-channel accepts mismatched option
authorDavid Goulet <dgoulet@efficios.com>
Thu, 11 Apr 2013 18:19:55 +0000 (14:19 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 11 Apr 2013 20:19:06 +0000 (16:19 -0400)
Also fixes a small typo in an error message of enable-channel. This
commit adds the buffer type for the UST domain with lttng list.

Fixes #489

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng/commands/enable_channels.c
src/bin/lttng/commands/list.c

index 687c06d42d2b7a3bff15338cec62749a3647ab4b..9ef1fde3694eddd90b67d18c3aa68d410d309a27 100644 (file)
@@ -1920,6 +1920,7 @@ ssize_t cmd_list_domains(struct ltt_session *session,
 
        if (session->ust_session != NULL) {
                (*domains)[index].type = LTTNG_DOMAIN_UST;
+               (*domains)[index].buf_type = session->ust_session->buffer_type;
                index++;
        }
 
index d026af4337332ddfa08c05b3f912aa40085e9b18..f53a941a297358443bda9e18adf68d7de879ba86 100644 (file)
@@ -179,11 +179,21 @@ static int enable_channel(char *session_name)
        if (opt_kernel) {
                dom.type = LTTNG_DOMAIN_KERNEL;
                dom.buf_type = LTTNG_BUFFER_GLOBAL;
+               if (opt_buffer_uid || opt_buffer_pid) {
+                       ERR("Buffer type not supported for domain -k");
+                       ret = CMD_ERROR;
+                       goto error;
+               }
        } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
                if (opt_buffer_uid) {
                        dom.buf_type = LTTNG_BUFFER_PER_UID;
                } else {
+                       if (opt_buffer_global) {
+                               ERR("Buffer type not supported for domain -u");
+                               ret = CMD_ERROR;
+                               goto error;
+                       }
                        dom.buf_type = LTTNG_BUFFER_PER_PID;
                }
        } else {
@@ -238,7 +248,7 @@ static int enable_channel(char *session_name)
                        switch (-ret) {
                        case LTTNG_ERR_KERN_CHAN_EXIST:
                        case LTTNG_ERR_UST_CHAN_EXIST:
-                               WARN("Channel %s: %s (session %s", channel_name,
+                               WARN("Channel %s: %s (session %s)", channel_name,
                                                lttng_strerror(ret), session_name);
                                goto error;
                        default:
index 0554732c0ea60318d8b3811f21d45eb94b9bd92a..db993df75d8d15b111fb0f4a6c93a74bd8073c0c 100644 (file)
@@ -815,6 +815,9 @@ int cmd_list(int argc, const char **argv)
                                        break;
                                case LTTNG_DOMAIN_UST:
                                        MSG("=== Domain: UST global ===\n");
+                                       MSG("Buffer type: %s\n",
+                                                       domains[i].buf_type ==
+                                                       LTTNG_BUFFER_PER_PID ? "per PID" : "per UID");
                                        break;
                                default:
                                        MSG("=== Domain: Unimplemented ===\n");
This page took 0.029982 seconds and 4 git commands to generate.