add quickstart
[lttv.git] / ltt / branches / poly / libltt / libltt.c
index 196b1da459de2acd5cfcd4e97c8999219f454f67..662a05871521d5ac39c78649cfacf44ee4b01d85 100644 (file)
  *     
  */
 
-#include <sys/socket.h> // for broken Fedora Core 3
-#include <sys/types.h>
-#include <sys/time.h>
-#include <linux/netlink.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <libltt/libltt.h>
 #include <errno.h>
 #include <stdio.h>
@@ -292,7 +292,7 @@ int lttctl_destroy_handle(struct lttctl_handle *h)
 
 
 int lttctl_create_trace(const struct lttctl_handle *h,
-               char *name, enum trace_mode mode)
+               char *name, enum trace_mode mode, unsigned subbuf_size, unsigned n_subbufs)
 {
        int err;
        
@@ -315,7 +315,9 @@ int lttctl_create_trace(const struct lttctl_handle *h,
 
        strncpy(req.msg.trace_name, name, NAME_MAX);
        req.msg.op = OP_CREATE;
-       req.msg.args.mode = mode;
+       req.msg.args.new_trace.mode = mode;
+       req.msg.args.new_trace.subbuf_size = subbuf_size;
+       req.msg.args.new_trace.n_subbufs = n_subbufs;
 
        err = lttctl_netlink_sendto(h, (void *)&req, req.nlh.nlmsg_len);
        if(err < 0) goto senderr;
@@ -327,13 +329,14 @@ int lttctl_create_trace(const struct lttctl_handle *h,
        if(err != 0) {
                errno = err;
                lttctl_perror("Create Trace Error");
-               return -1;
+               return err;
        }
 
        return 0;
 
 senderr:
        lttctl_perror("Create Trace Error");
+  err = EPERM;
        return err;
 }
 
@@ -370,13 +373,14 @@ int lttctl_destroy_trace(const struct lttctl_handle *h,
        if(err != 0) {
                errno = err;
                lttctl_perror("Destroy Trace Channels Error");
-               return -1;
+               return err;
        }
 
        return 0;
 
 senderr:
        lttctl_perror("Destroy Trace Channels Error");
+  err = EPERM;
        return err;
 
 }
@@ -415,12 +419,13 @@ int lttctl_start(const struct lttctl_handle *h,
        if(err != 0) {
                errno = err;
                lttctl_perror("Start Trace Error");
-               return -1;
+               return err;
        }
 
        return 0;
 
 senderr:
+  err = EPERM;
        lttctl_perror("Start Trace Error");
        return err;
 
@@ -459,12 +464,14 @@ int lttctl_stop(const struct lttctl_handle *h,
        if(err != 0) {
                errno = err;
                lttctl_perror("Stop Trace Error");
-               return -1;
+               return err;
        }
 
        return 0;
 
 senderr:
+  err = EPERM;
        lttctl_perror("Stop Trace Error");
        return err;
 }
+
This page took 0.024675 seconds and 4 git commands to generate.