update ltt control
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 27 Jul 2006 21:05:33 +0000 (21:05 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 27 Jul 2006 21:05:33 +0000 (21:05 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2022 04897980-b3bd-0310-b5e0-8ef037075253

ltt-control/liblttctl/liblttctl.c
ltt-control/liblttctl/lttctl.h
ltt-control/lttctl/lttctl.c

index d6f411b921d65c841c3e0faaa49a0b064fb62999..c73c7e59e7fb67fb83bcb171320cc38b7cb68651 100644 (file)
@@ -298,7 +298,7 @@ int lttctl_destroy_handle(struct lttctl_handle *h)
 
 
 int lttctl_create_trace(const struct lttctl_handle *h,
-               char *name, enum trace_mode mode, unsigned subbuf_size, unsigned n_subbufs)
+               char *name, enum trace_mode mode, char *trace_type, unsigned subbuf_size, unsigned n_subbufs)
 {
        int err;
        
@@ -320,6 +320,7 @@ int lttctl_create_trace(const struct lttctl_handle *h,
        req.nlh.nlmsg_seq = 0;
 
        strncpy(req.msg.trace_name, name, NAME_MAX);
+       strncpy(req.msg.trace_type, trace_type, NAME_MAX);
        req.msg.op = OP_CREATE;
        req.msg.args.new_trace.mode = mode;
        req.msg.args.new_trace.subbuf_size = subbuf_size;
index cc028a574520a51c93da83c2040ddf29112c1cba..fc5a4f9cbbb9aa33cd2d4efec3b43cd1f4ddca88 100644 (file)
@@ -47,6 +47,7 @@ enum trace_mode {
 
 typedef struct lttctl_peer_msg {
        char trace_name[NAME_MAX];
+       char trace_type[NAME_MAX];
        enum trace_op op;
        union {
     struct {
@@ -76,7 +77,7 @@ int lttctl_destroy_handle(struct lttctl_handle *h);
 
 
 int lttctl_create_trace(const struct lttctl_handle *h,
-               char *name, enum trace_mode mode, unsigned subbuf_size, unsigned n_subbufs);
+               char *name, enum trace_mode mode, char *trace_type, unsigned subbuf_size, unsigned n_subbufs);
 
 int lttctl_destroy_trace(const struct lttctl_handle *handle, char *name);
 
index 11483c99a7002dd5834a76ffa45a6234824ad0b3..bdf6f98ab1be9fc2822e1e61f3c68b1d1d54234f 100644 (file)
@@ -40,6 +40,7 @@ enum trace_ctl_op {
 };
 
 static char *trace_name = NULL;
+static char *trace_type = "relay";
 static char *mode_name = NULL;
 static unsigned subbuf_size = 0;
 static unsigned n_subbufs = 0;
@@ -81,6 +82,7 @@ void show_arguments(void)
        printf("              (optionnaly, you can set LTT_DAEMON\n");
        printf("              and the LTT_FACILITIES env. vars.)\n");
        printf("-t            Trace root path. (ex. /root/traces/example_trace)\n");
+       printf("-T            Type of trace (ex. relay)\n");
        printf("-l            LTT channels root path. (ex. /mnt/relayfs/ltt)\n");
        printf("-z            Size of the subbuffers (will be rounded to next page size)\n");
        printf("-x            Number of subbuffers\n");
@@ -217,6 +219,16 @@ int parse_arguments(int argc, char **argv)
                                                        argn++;
                                                }
                                                break;
+                                       case 'T':
+                                               if(argn+1 < argc) {
+                                                       trace_type = argv[argn+1];
+                                                       argn++;
+                                               } else {
+                                                       printf("Specify a trace type after -T.\n");
+                                                       printf("\n");
+                                                       ret = EINVAL;
+                                               }
+                                               break;
                                        default:
                                                printf("Invalid argument '%s'.\n", argv[argn]);
                                                printf("\n");
@@ -390,7 +402,7 @@ int lttctl_daemon(struct lttctl_handle *handle, char *trace_name)
        strcat(channel_path, trace_name);
 
        
-       ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size, n_subbufs);
+       ret = lttctl_create_trace(handle, trace_name, mode, trace_type, subbuf_size, n_subbufs);
        if(ret != 0) goto create_error;
 
        act.sa_handler = sigchld_handler;
@@ -466,13 +478,13 @@ int main(int argc, char ** argv)
        
        switch(op) {
     case CTL_OP_CREATE_START:
-                       ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size,
+                       ret = lttctl_create_trace(handle, trace_name, mode, trace_type, subbuf_size,
                                                                                                                                n_subbufs);
       if(!ret)
         ret = lttctl_start(handle, trace_name);
       break;
        case CTL_OP_CREATE:
-                       ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size,
+                       ret = lttctl_create_trace(handle, trace_name, mode, trace_type, subbuf_size,
                                                                                                                                n_subbufs);
       break;
                case CTL_OP_DESTROY:
This page took 0.025508 seconds and 4 git commands to generate.