X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Flttng%2Fabi.h;h=2cac459ae9f7790419743cd0cd6b5708dfebd25a;hb=refs%2Fheads%2Fsow-2020-0002-rev2;hp=75c2cb087fdb1ea791413c832b0e6c5c18dfae27;hpb=cff6938b5405c9125a5149f03e504d7b1cc4b8a4;p=deliverable%2Flttng-modules.git diff --git a/include/lttng/abi.h b/include/lttng/abi.h index 75c2cb08..2cac459a 100644 --- a/include/lttng/abi.h +++ b/include/lttng/abi.h @@ -11,13 +11,14 @@ #define _LTTNG_ABI_H #include +#include /* * 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 2 -#define LTTNG_MODULES_ABI_MINOR_VERSION 5 +#define LTTNG_MODULES_ABI_MINOR_VERSION 6 #define LTTNG_KERNEL_SYM_NAME_LEN 256 #define LTTNG_KERNEL_SESSION_NAME_LEN 256 @@ -98,8 +99,8 @@ enum lttng_kernel_syscall_entryexit { enum lttng_kernel_syscall_abi { LTTNG_KERNEL_SYSCALL_ABI_ALL = 0, - LTTNG_KERNEL_SYSCALL_ABI_NATIVE = 1, /* Not implemented. */ - LTTNG_KERNEL_SYSCALL_ABI_COMPAT = 2, /* Not implemented. */ + LTTNG_KERNEL_SYSCALL_ABI_NATIVE = 1, + LTTNG_KERNEL_SYSCALL_ABI_COMPAT = 2, }; enum lttng_kernel_syscall_match { @@ -137,11 +138,127 @@ struct lttng_kernel_event { } u; } __attribute__((packed)); -#define LTTNG_KERNEL_EVENT_NOTIFIER_PADDING1 16 +#define LTTNG_KERNEL_EVENT_NOTIFIER_PADDING 32 struct lttng_kernel_event_notifier { struct lttng_kernel_event event; + uint64_t error_counter_index; - char padding[LTTNG_KERNEL_EVENT_NOTIFIER_PADDING1]; + char padding[LTTNG_KERNEL_EVENT_NOTIFIER_PADDING]; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_DIMENSION_MAX 4 +#define LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 +struct lttng_kernel_event_notifier_notification { + uint64_t token; + uint16_t capture_buf_size; + char padding[LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING]; +} __attribute__((packed)); + +enum lttng_kernel_key_token_type { + LTTNG_KERNEL_KEY_TOKEN_STRING = 0, /* arg: string_ptr. */ + LTTNG_KERNEL_KEY_TOKEN_EVENT_NAME = 1, /* no arg. */ + LTTNG_KERNEL_KEY_TOKEN_PROVIDER_NAME = 2, /* no arg. */ +}; + +#define LTTNG_KERNEL_KEY_ARG_PADDING1 60 +#define LTTNG_KERNEL_KEY_TOKEN_STRING_LEN_MAX 256 +struct lttng_kernel_key_token { + uint32_t type; /* enum lttng_kernel_key_token_type */ + union { + uint64_t string_ptr; + char padding[LTTNG_KERNEL_KEY_ARG_PADDING1]; + } arg; +} __attribute__((packed)); + +#define LTTNG_KERNEL_NR_KEY_TOKEN 4 +struct lttng_kernel_counter_key_dimension { + uint32_t nr_key_tokens; + struct lttng_kernel_key_token key_tokens[LTTNG_KERNEL_NR_KEY_TOKEN]; +} __attribute__((packed)); + +struct lttng_kernel_counter_key { + uint32_t nr_dimensions; + struct lttng_kernel_counter_key_dimension key_dimensions[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_EVENT_PADDING1 16 +struct lttng_kernel_counter_event { + struct lttng_kernel_event event; + struct lttng_kernel_counter_key key; + char padding[LTTNG_KERNEL_COUNTER_EVENT_PADDING1]; +} __attribute__((packed)); + +enum lttng_kernel_counter_arithmetic { + LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR = 0, +}; + +enum lttng_kernel_counter_bitness { + LTTNG_KERNEL_COUNTER_BITNESS_32 = 0, + LTTNG_KERNEL_COUNTER_BITNESS_64 = 1, +}; + +struct lttng_kernel_counter_dimension { + uint64_t size; + uint64_t underflow_index; + uint64_t overflow_index; + uint8_t has_underflow; + uint8_t has_overflow; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_CONF_PADDING1 67 +struct lttng_kernel_counter_conf { + uint32_t arithmetic; /* enum lttng_kernel_counter_arithmetic */ + uint32_t bitness; /* enum lttng_kernel_counter_bitness */ + uint32_t number_dimensions; + int64_t global_sum_step; + struct lttng_kernel_counter_dimension dimensions[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; + uint8_t coalesce_hits; + char padding[LTTNG_KERNEL_COUNTER_CONF_PADDING1]; +} __attribute__((packed)); + +struct lttng_kernel_counter_index { + uint32_t number_dimensions; + uint64_t dimension_indexes[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; +} __attribute__((packed)); + +struct lttng_kernel_counter_value { + int64_t value; + uint8_t underflow; + uint8_t overflow; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_READ_PADDING 32 +struct lttng_kernel_counter_read { + struct lttng_kernel_counter_index index; + int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */ + struct lttng_kernel_counter_value value; /* output */ + char padding[LTTNG_KERNEL_COUNTER_READ_PADDING]; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING 32 +struct lttng_kernel_counter_aggregate { + struct lttng_kernel_counter_index index; + struct lttng_kernel_counter_value value; /* output */ + char padding[LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING]; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_CLEAR_PADDING 32 +struct lttng_kernel_counter_clear { + struct lttng_kernel_counter_index index; + char padding[LTTNG_KERNEL_COUNTER_CLEAR_PADDING]; +} __attribute__((packed)); + +#define LTTNG_KERNEL_COUNTER_KEY_LEN 256 +#define LTTNG_KERNEL_COUNTER_MAP_DESCRIPTOR_PADDING 32 +struct lttng_kernel_counter_map_descriptor { + uint64_t descriptor_index; /* input. [ 0 .. nr_descriptors - 1 ] */ + + uint32_t dimension; /* outputs */ + uint64_t array_index; + uint64_t user_token; + char key[LTTNG_KERNEL_COUNTER_KEY_LEN]; + + char padding[LTTNG_KERNEL_COUNTER_MAP_DESCRIPTOR_PADDING]; } __attribute__((packed)); struct lttng_kernel_tracer_version { @@ -243,6 +360,14 @@ struct lttng_kernel_filter_bytecode { char data[0]; } __attribute__((packed)); +#define LTTNG_KERNEL_CAPTURE_BYTECODE_MAX_LEN 65536 +struct lttng_kernel_capture_bytecode { + uint32_t len; + uint32_t reloc_offset; + uint64_t seqnum; + char data[0]; +} __attribute__((packed)); + enum lttng_kernel_tracker_type { LTTNG_KERNEL_TRACKER_UNKNOWN = -1, @@ -306,6 +431,7 @@ struct lttng_kernel_tracker_args { #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62) #define LTTNG_KERNEL_EVENT \ _IOW(0xF6, 0x63, struct lttng_kernel_event) +/* LTTNG_KERNEL_SYSCALL_MASK applies to both channel and counter fds. */ #define LTTNG_KERNEL_SYSCALL_MASK \ _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask) @@ -314,11 +440,15 @@ struct lttng_kernel_tracker_args { #define LTTNG_KERNEL_CONTEXT \ _IOW(0xF6, 0x71, struct lttng_kernel_context) -/* Event, Event notifier, Channel and Session ioctl */ +/* Event, Event notifier, Channel, Counter and Session ioctl */ /* lttng/abi-old.h reserve 0x80 and 0x81. */ #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82) #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83) +/* Trigger group and session ioctl */ +#define LTTNG_KERNEL_COUNTER \ + _IOW(0xF6, 0x84, struct lttng_kernel_counter_conf) + /* Event and Event notifier FD ioctl */ #define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90) #define LTTNG_KERNEL_ADD_CALLSITE _IO(0xF6, 0x91) @@ -337,6 +467,23 @@ struct lttng_kernel_tracker_args { #define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \ _IO(0xF6, 0xB1) +/* Event notifier file descriptor ioctl */ +#define LTTNG_KERNEL_CAPTURE _IO(0xF6, 0xB8) + +/* Counter file descriptor ioctl */ +#define LTTNG_KERNEL_COUNTER_READ \ + _IOWR(0xF6, 0xC0, struct lttng_kernel_counter_read) +#define LTTNG_KERNEL_COUNTER_AGGREGATE \ + _IOWR(0xF6, 0xC1, struct lttng_kernel_counter_aggregate) +#define LTTNG_KERNEL_COUNTER_CLEAR \ + _IOW(0xF6, 0xC2, struct lttng_kernel_counter_clear) +#define LTTNG_KERNEL_COUNTER_MAP_NR_DESCRIPTORS \ + _IOR(0xF6, 0xC3, uint64_t) +#define LTTNG_KERNEL_COUNTER_MAP_DESCRIPTOR \ + _IOWR(0xF6, 0xC4, struct lttng_kernel_counter_map_descriptor) +#define LTTNG_KERNEL_COUNTER_EVENT \ + _IOW(0xF6, 0xC5, struct lttng_kernel_counter_event) + /* * LTTng-specific ioctls for the lib ringbuffer. *