Add comm context
[lttng-modules.git] / ltt-debugfs-abi.h
index 411c37b78ff0d0f88787c20420f7337ab1db27f9..2768055f29b483788545ca5b3c44949478920942 100644 (file)
 
 #include <linux/fs.h>
 
-#define LTTNG_KPROBE_SYM_NAME_LEN      128
+#define LTTNG_SYM_NAME_LEN     128
 
 enum lttng_kernel_instrumentation {
-       LTTNG_KERNEL_TRACEPOINTS,
-       LTTNG_KERNEL_KPROBES,
-       LTTNG_KERNEL_FUNCTION_TRACER,
+       LTTNG_KERNEL_TRACEPOINT,
+       LTTNG_KERNEL_KPROBE,
+       LTTNG_KERNEL_FUNCTION,
 };
 
 /*
@@ -24,11 +24,11 @@ enum lttng_kernel_instrumentation {
  */
 
 struct lttng_kernel_channel {
-       int overwrite;                  /* 1: overwrite, 0: discard */
-       uint64_t subbuf_size;
+       int overwrite;                          /* 1: overwrite, 0: discard */
+       uint64_t subbuf_size;                   /* in bytes */
        uint64_t num_subbuf;
-       unsigned int switch_timer_interval;
-       unsigned int read_timer_interval;
+       unsigned int switch_timer_interval;     /* usecs */
+       unsigned int read_timer_interval;       /* usecs */
 };
 
 /*
@@ -38,21 +38,21 @@ struct lttng_kernel_kprobe {
        uint64_t addr;
 
        uint64_t offset;
-       char symbol_name[LTTNG_KPROBE_SYM_NAME_LEN];
+       char symbol_name[LTTNG_SYM_NAME_LEN];
 };
 
 struct lttng_kernel_function_tracer {
-       char symbol_name[LTTNG_KPROBE_SYM_NAME_LEN];
+       char symbol_name[LTTNG_SYM_NAME_LEN];
 };
 
 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_kprobe kprobe;
                struct lttng_kernel_function_tracer ftrace;
        } u;
-       char name[];    /* event name */
 };
 
 struct lttng_kernel_tracer_version {
@@ -61,19 +61,45 @@ struct lttng_kernel_tracer_version {
        uint32_t sublevel;
 };
 
-#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)
+enum lttng_kernel_context_type {
+       LTTNG_KERNEL_CONTEXT_PID,
+       LTTNG_KERNEL_CONTEXT_PERF_COUNTER,
+       LTTNG_KERNEL_CONTEXT_COMM,
+};
+
+struct lttng_kernel_perf_counter_ctx {
+       uint32_t type;
+       uint64_t config;
+};
+
+struct lttng_kernel_context {
+       enum lttng_kernel_context_type ctx;
+       union {
+               struct lttng_kernel_perf_counter_ctx perf_counter;
+       } u;
+};
+
+/* LTTng file descriptor ioctl */
+#define LTTNG_KERNEL_SESSION                   _IO(0xF6, 0x40)
+#define LTTNG_KERNEL_TRACER_VERSION            \
+       _IOR(0xF6, 0x41, struct lttng_kernel_tracer_version)
+#define LTTNG_KERNEL_TRACEPOINT_LIST           _IO(0xF6, 0x42)
+
+/* Session FD ioctl */
+#define LTTNG_KERNEL_METADATA                  \
+       _IOW(0xF6, 0x50, struct lttng_kernel_channel)
+#define LTTNG_KERNEL_CHANNEL                   \
+       _IOW(0xF6, 0x51, struct lttng_kernel_channel)
+#define LTTNG_KERNEL_SESSION_START             _IO(0xF6, 0x52)
+#define LTTNG_KERNEL_SESSION_STOP              _IO(0xF6, 0x53)
+
+/* Channel FD ioctl */
+#define LTTNG_KERNEL_STREAM                    _IO(0xF6, 0x60)
+#define LTTNG_KERNEL_EVENT                     \
+       _IOW(0xF6, 0x61, struct lttng_kernel_event)
+
+/* Event and Channel FD ioctl */
+#define LTTNG_KERNEL_CONTEXT                   \
+       _IOW(0xF6, 0x70, struct lttng_kernel_context)
 
 #endif /* _LTT_DEBUGFS_ABI_H */
This page took 0.02358 seconds and 4 git commands to generate.