v->patchlevel = LTTNG_MODULES_PATCHLEVEL_VERSION;
}
+static
+void lttng_abi_tracer_abi_version(struct lttng_kernel_tracer_abi_version *v)
+{
+ v->major = LTTNG_MODULES_ABI_MAJOR_VERSION;
+ v->minor = LTTNG_MODULES_ABI_MINOR_VERSION;
+}
+
static
long lttng_abi_add_context(struct file *file,
struct lttng_kernel_context *context_param,
* Returns a file descriptor listing available tracepoints
* LTTNG_KERNEL_WAIT_QUIESCENT
* Returns after all previously running probes have completed
+ * LTTNG_KERNEL_TRACER_ABI_VERSION
+ * Returns the LTTng kernel tracer ABI version
*
* The returned session will be deleted when its file descriptor is closed.
*/
(struct lttng_kernel_tracer_version __user *) arg;
lttng_abi_tracer_version(&version);
-
+
+ if (copy_to_user(uversion, &version, sizeof(version)))
+ return -EFAULT;
+ return 0;
+ }
+ case LTTNG_KERNEL_TRACER_ABI_VERSION:
+ {
+ struct lttng_kernel_tracer_abi_version version;
+ struct lttng_kernel_tracer_abi_version *uversion =
+ (struct lttng_kernel_tracer_abi_version __user *) arg;
+
+ lttng_abi_tracer_abi_version(&version);
+
if (copy_to_user(uversion, &version, sizeof(version)))
return -EFAULT;
return 0;
#include <linux/fs.h>
+/*
+ * Major/minor version of ABI exposed to lttng tools. Major number
+ * should be increased when an incompatible ABI change is done.
+ */
+#define LTTNG_MODULES_ABI_MAJOR_VERSION 1
+#define LTTNG_MODULES_ABI_MINOR_VERSION 0
+
#define LTTNG_KERNEL_SYM_NAME_LEN 256
enum lttng_kernel_instrumentation {
uint32_t patchlevel;
} __attribute__((packed));
+struct lttng_kernel_tracer_abi_version {
+ uint32_t major;
+ uint32_t minor;
+} __attribute__((packed));
+
enum lttng_kernel_calibrate_type {
LTTNG_KERNEL_CALIBRATE_KRETPROBE,
};
#define LTTNG_KERNEL_CALIBRATE \
_IOWR(0xF6, 0x49, struct lttng_kernel_calibrate)
#define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A)
+#define LTTNG_KERNEL_TRACER_ABI_VERSION \
+ _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version)
/* Session FD ioctl */
#define LTTNG_KERNEL_METADATA \