char padding[LTTNG_KERNEL_ABI_COUNTER_EVENT_PADDING1];
} __attribute__((packed));
+enum lttng_kernel_abi_counter_dimension_flags {
+ LTTNG_KERNEL_ABI_COUNTER_DIMENSION_FLAG_UNDERFLOW = (1 << 0),
+ LTTNG_KERNEL_ABI_COUNTER_DIMENSION_FLAG_OVERFLOW = (1 << 1),
+};
+
+struct lttng_kernel_abi_counter_dimension {
+ uint32_t flags; /* enum lttng_kernel_abi_counter_dimension_flags */
+ uint64_t size; /* dimension size */
+ uint64_t underflow_index;
+ uint64_t overflow_index;
+} __attribute__((packed));
+
+struct lttng_kernel_abi_counter_dimension_array {
+ uint32_t number_dimensions;
+ uint32_t elem_len; /* array stride (size of struct lttng_kernel_abi_counter_dimension) */
+ uint64_t ptr; /* pointer to array of struct lttng_kernel_abi_counter_dimension */
+} __attribute__((packed));
+
+enum lttng_kernel_abi_counter_conf_flags {
+ LTTNG_KERNEL_ABI_COUNTER_CONF_FLAG_COALESCE_HITS = (1 << 0),
+};
+
+struct lttng_kernel_abi_counter_conf {
+ uint32_t len; /* length of this structure */
+ uint32_t flags; /* enum lttng_kernel_abi_counter_conf_flags */
+ uint32_t arithmetic; /* enum lttng_kernel_abi_counter_arithmetic */
+ uint32_t bitness; /* enum lttng_kernel_abi_counter_bitness */
+ int64_t global_sum_step;
+ struct lttng_kernel_abi_counter_dimension_array dimension_array;
+} __attribute__((packed));
+
+struct lttng_kernel_abi_counter_index {
+ uint32_t number_dimensions;
+ uint64_t ptr; /* pointer to dimension indexes (array of uint64_t) */
+} __attribute__((packed));
+
+enum lttng_kernel_abi_counter_value_flags {
+ LTTNG_KERNEL_ABI_COUNTER_VALUE_FLAG_UNDERFLOW = (1 << 0),
+ LTTNG_KERNEL_ABI_COUNTER_VALUE_FLAG_OVERFLOW = (1 << 1),
+};
+
+struct lttng_kernel_abi_counter_value {
+ int64_t value;
+ uint32_t flags; /* enum lttng_kernel_abi_counter_value_flags */
+} __attribute__((packed));
+
+struct lttng_kernel_abi_counter_read {
+ uint32_t len; /* length of this structure */
+ struct lttng_kernel_abi_counter_index index;
+ int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */
+ struct lttng_kernel_abi_counter_value value; /* output */
+} __attribute__((packed));
+
+struct lttng_kernel_abi_counter_aggregate {
+ uint32_t len; /* length of this structure */
+ struct lttng_kernel_abi_counter_index index;
+ struct lttng_kernel_abi_counter_value value; /* output */
+} __attribute__((packed));
+
+struct lttng_kernel_abi_counter_clear {
+ uint32_t len; /* length of this structure */
+ struct lttng_kernel_abi_counter_index index;
+} __attribute__((packed));
+
struct lttng_kernel_abi_tracer_version {
uint32_t major;
uint32_t minor;
/* Trigger group and session ioctl */
/* (0xF6, 0x84) is reserved for old ABI. */
-//TODO: new in 2.14, replace old (2.13) ioctl with extensible struct.
-#if 0
+
#define LTTNG_KERNEL_ABI_COUNTER \
_IOW(0xF6, 0x85, struct lttng_kernel_abi_counter_conf)
-#endif
/* Event and Event notifier FD ioctl */
#define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90)
_IOWR(0xF6, 0xC4, struct lttng_kernel_abi_counter_map_descriptor)
#define LTTNG_KERNEL_ABI_COUNTER_EVENT \
_IOW(0xF6, 0xC5, struct lttng_kernel_abi_counter_event)
-
-//TODO: new in 2.14, replace old (2.13) ioctls with variable length arrays.
-#if 0
#define LTTNG_KERNEL_ABI_COUNTER_READ \
_IOWR(0xF6, 0xC6, struct lttng_kernel_abi_counter_read)
#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
_IOWR(0xF6, 0xC7, struct lttng_kernel_abi_counter_aggregate)
#define LTTNG_KERNEL_ABI_COUNTER_CLEAR \
_IOW(0xF6, 0xC8, struct lttng_kernel_abi_counter_clear)
-#endif
/*
* LTTng-specific ioctls for the lib ringbuffer.