Sync ioctl headers with kernel
authorJulien Desfossez <julien.desfossez@polymtl.ca>
Tue, 24 May 2011 14:20:42 +0000 (10:20 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Tue, 24 May 2011 14:23:27 +0000 (10:23 -0400)
Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
include/lttng-kernel.h
libkernelctl/kernel-ioctl.h
libkernelctl/libkernelctl.c
libkernelctl/libkernelctl.h
ltt-sessiond/kernel-ctl.c
ltt-sessiond/trace.h

index 142de0706ef670bdbcd7680961333adcb2da37d5..1ce9fc5e4b96157cb23896805f2ca4bf58e8afca 100644 (file)
 
 #include "lttng-share.h"
 
+#define LTTNG_SYM_NAME_LEN  128
+
+enum lttng_kernel_instrumentation {
+       LTTNG_KERNEL_TRACEPOINTS,
+       LTTNG_KERNEL_KPROBES,
+       LTTNG_KERNEL_FUNCTION_TRACER,
+};
+
 /*
  * LTTng DebugFS ABI structures.
  */
-enum lttng_instrum_type {
-       INSTRUM_TRACEPOINTS,
+
+struct lttng_kernel_channel {
+       int overwrite;              /* 1: overwrite, 0: discard */
+       uint64_t subbuf_size;           /* in bytes */
+       uint64_t num_subbuf;
+       unsigned int switch_timer_interval; /* usecs */
+       unsigned int read_timer_interval;   /* usecs */
+};
+
+struct lttng_kernel_tracepoint {
+};
+
+/*
+ * Either addr is used, or symbol_name and offset.
+ */
+struct lttng_kernel_kprobe {
+       uint64_t addr;
+
+       uint64_t offset;
+       char symbol_name[LTTNG_SYM_NAME_LEN];
+};
+
+struct lttng_kernel_function_tracer {
+       char symbol_name[LTTNG_SYM_NAME_LEN];
 };
 
-struct lttng_channel {
-       int overwrite;         /* 1: overwrite, 0: discard */
-       u64 subbuf_size;
-       u64 num_subbuf;
-       unsigned int switch_timer_interval;
-       unsigned int read_timer_interval;
+struct lttng_kernel_event {
+       char name[LTTNG_SYM_NAME_LEN];  /* event name */
+       enum lttng_kernel_instrumentation instrumentation;
+       /* Per instrumentation type configuration */
+       union {
+               struct lttng_kernel_tracepoint tracepoint;
+               struct lttng_kernel_kprobe kprobe;
+               struct lttng_kernel_function_tracer ftrace;
+       } u;
 };
 
-struct lttng_event {
-       enum lttng_instrum_type itype;
-       char name[];
+struct lttng_kernel_tracer_version {
+       uint32_t version;
+       uint32_t patchlevel;
+       uint32_t sublevel;
 };
 
 #endif /* _LTTNG_KERNEL_H */
index 9aa0407b4c2fa36a6aac36847c6a9ecbc90032ca..5e2358c8d5242adf43ce98234f502e989e00dc59 100644 (file)
 /* returns the offset of the subbuffer belonging to the mmap reader. */
 #define RING_BUFFER_GET_MMAP_READ_OFFSET    _IOR(0xF6, 0x0B, unsigned long)
 
-/* Create session LTTNG_SESSION */
-#define KERNEL_CREATE_SESSION       _IO(0xF6, 0x40)
-#define KERNEL_SESSION_START _IO(0xF6, 0x41)
-#define KERNEL_SESSION_STOP  _IO(0xF6, 0x42)
-
-/* Create channel LTTNG_CHANNEL */
-#define KERNEL_CREATE_CHANNEL       _IOW(0xF6, 0x43, struct lttng_channel)
-#define KERNEL_CREATE_STREAM        _IO(0xF6, 0x44)
-#define KERNEL_CREATE_EVENT     _IOW(0xF6, 0x45, struct lttng_event)
-
-#define KERNEL_OPEN_METADATA   _IOW(0xF6, 0x46, struct lttng_channel)
+#define LTTNG_KERNEL_SESSION        _IO(0xF6, 0x40)
+#define LTTNG_KERNEL_SESSION_START  _IO(0xF6, 0x41)
+#define LTTNG_KERNEL_SESSION_STOP   _IO(0xF6, 0x42)
+#define LTTNG_KERNEL_CHANNEL        \
+           _IOW(0xF6, 0x43, struct lttng_kernel_channel)
+#define LTTNG_KERNEL_STREAM     _IO(0xF6, 0x44)
+#define LTTNG_KERNEL_EVENT      \
+           _IOW(0xF6, 0x45, struct lttng_kernel_event)
+#define LTTNG_KERNEL_METADATA       \
+           _IOW(0xF6, 0x46, struct lttng_kernel_channel)
+#define LTTNG_KERNEL_KPROBE     \
+           _IOW(0xF6, 0x47, struct lttng_kernel_kprobe)
+#define LTTNG_KERNEL_TRACER_VERSION \
+           _IOR(0xF6, 0x48, struct lttng_kernel_tracer_version)
 
 #endif /* _LTT_KERNEL_IOCTL_H */
index e15dd8da624b9489adf256015950a4b66abeeb9d..c06f579698619716c478a4a8df1aaaf51afe232c 100644 (file)
 #include "libkernelctl.h"
 #include "lttngerr.h"
 
-int kernctl_create_channel(int fd, struct lttng_channel *chops)
+int kernctl_create_channel(int fd, struct lttng_kernel_channel *chops)
 {
-       return ioctl(fd, KERNEL_CREATE_CHANNEL, chops);
+       return ioctl(fd, LTTNG_KERNEL_CHANNEL, chops);
 }
 
-int kernctl_create_event(int fd, struct lttng_event *ev)
+int kernctl_create_event(int fd, struct lttng_kernel_event *ev)
 {
-       return ioctl(fd, KERNEL_CREATE_EVENT, ev);
+       return ioctl(fd, LTTNG_KERNEL_EVENT, ev);
 }
 
 int kernctl_create_session(int fd)
 {
-       return ioctl(fd, KERNEL_CREATE_SESSION);
+       return ioctl(fd, LTTNG_KERNEL_SESSION);
 }
 
 int kernctl_create_stream(int fd)
 {
-       return ioctl(fd, KERNEL_CREATE_STREAM);
+       return ioctl(fd, LTTNG_KERNEL_STREAM);
 }
 
 /* returns the maximum size for sub-buffers. */
@@ -86,9 +86,9 @@ int kernctl_get_subbuf_size(int fd, unsigned long *len)
 }
 
 /* open the metadata global channel */
-int kernctl_open_metadata(int fd, struct lttng_channel *chops)
+int kernctl_open_metadata(int fd, struct lttng_kernel_channel *chops)
 {
-       return ioctl(fd, KERNEL_OPEN_METADATA, chops);
+       return ioctl(fd, LTTNG_KERNEL_METADATA, chops);
 }
 
 /* Release exclusive sub-buffer access, move consumer forward. */
@@ -123,11 +123,11 @@ int kernctl_snapshot_get_produced(int fd, unsigned long *pos)
 
 int kernctl_start_session(int fd)
 {
-       return ioctl(fd, KERNEL_SESSION_START);
+       return ioctl(fd, LTTNG_KERNEL_SESSION_START);
 }
 
 int kernctl_stop_session(int fd)
 {
-       return ioctl(fd, KERNEL_SESSION_STOP);
+       return ioctl(fd, LTTNG_KERNEL_SESSION_STOP);
 }
 
index eb0c7800efcad3c10949dcf70247f1149681d537..34be7a5d3546142b167cfbc8e4048b20e5cd69d3 100644 (file)
@@ -22,8 +22,8 @@
 
 #include "lttng-kernel.h"
 
-int kernctl_create_channel(int fd, struct lttng_channel *chops);
-int kernctl_create_event(int fd, struct lttng_event *ev);
+int kernctl_create_channel(int fd, struct lttng_kernel_channel *chops);
+int kernctl_create_event(int fd, struct lttng_kernel_event *ev);
 int kernctl_create_session(int fd);
 int kernctl_create_stream(int fd);
 int kernctl_get_max_subbuf_size(int fd, unsigned long *len);
@@ -33,7 +33,7 @@ int kernctl_get_next_subbuf(int fd);
 int kernctl_get_padded_subbuf_size(int fd, unsigned long *len);
 int kernctl_get_subbuf(int fd, unsigned long *len);
 int kernctl_get_subbuf_size(int fd, unsigned long *len);
-int kernctl_open_metadata(int fd, struct lttng_channel *chops);
+int kernctl_open_metadata(int fd, struct lttng_kernel_channel *chops);
 int kernctl_put_next_subbuf(int fd);
 int kernctl_put_subbuf(int fd);
 int kernctl_snapshot(int fd);
index 12a00eb1fb8debc0e73d54d4ca00355863c839fd..5d70296ea82008669c6710c57a19024c4620f051 100644 (file)
@@ -68,10 +68,10 @@ int kernel_create_channel(struct command_ctx *cmd_ctx)
 {
        int ret;
        struct ltt_kernel_channel *lkc;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel *chan;
 
        lkc = malloc(sizeof(struct ltt_kernel_channel));
-       chan = malloc(sizeof(struct lttng_channel));
+       chan = malloc(sizeof(struct lttng_kernel_channel));
 
        if (lkc == NULL || chan == NULL) {
                perror("kernel channel malloc");
index 6e86915b60ef69f0519485dfb5291982f955aa17..9cfbd84ab1a636b86286e58623058af21d29cfc4 100644 (file)
@@ -38,7 +38,7 @@ struct ltt_kernel_event {
 /* Kernel channel */
 struct ltt_kernel_channel {
        int fd;
-       struct lttng_channel *channel;
+       struct lttng_kernel_channel *channel;
        struct ltt_kernel_event_list events_list;
 };
 
This page took 0.030506 seconds and 5 git commands to generate.