} u;
};
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_DIMENSION_MAX 4
+
+struct lttng_kernel_abi_old_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_ABI_OLD_COUNTER_CONF_PADDING1 67
+struct lttng_kernel_abi_old_counter_conf {
+ uint32_t arithmetic; /* enum lttng_kernel_abi_counter_arithmetic */
+ uint32_t bitness; /* enum lttng_kernel_abi_counter_bitness */
+ uint32_t number_dimensions;
+ int64_t global_sum_step;
+ struct lttng_kernel_abi_old_counter_dimension dimensions[LTTNG_KERNEL_ABI_OLD_COUNTER_DIMENSION_MAX];
+ uint8_t coalesce_hits;
+ char padding[LTTNG_KERNEL_ABI_OLD_COUNTER_CONF_PADDING1];
+} __attribute__((packed));
+
+struct lttng_kernel_abi_old_counter_index {
+ uint32_t number_dimensions;
+ uint64_t dimension_indexes[LTTNG_KERNEL_ABI_OLD_COUNTER_DIMENSION_MAX];
+} __attribute__((packed));
+
+struct lttng_kernel_abi_old_counter_value {
+ int64_t value;
+ uint8_t underflow;
+ uint8_t overflow;
+} __attribute__((packed));
+
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_READ_PADDING 32
+struct lttng_kernel_abi_old_counter_read {
+ struct lttng_kernel_abi_old_counter_index index;
+ int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */
+ struct lttng_kernel_abi_old_counter_value value; /* output */
+ char padding[LTTNG_KERNEL_ABI_OLD_COUNTER_READ_PADDING];
+} __attribute__((packed));
+
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_AGGREGATE_PADDING 32
+struct lttng_kernel_abi_old_counter_aggregate {
+ struct lttng_kernel_abi_old_counter_index index;
+ struct lttng_kernel_abi_old_counter_value value; /* output */
+ char padding[LTTNG_KERNEL_ABI_OLD_COUNTER_AGGREGATE_PADDING];
+} __attribute__((packed));
+
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_CLEAR_PADDING 32
+struct lttng_kernel_abi_old_counter_clear {
+ struct lttng_kernel_abi_old_counter_index index;
+ char padding[LTTNG_KERNEL_ABI_OLD_COUNTER_CLEAR_PADDING];
+} __attribute__((packed));
+
/* LTTng file descriptor ioctl */
#define LTTNG_KERNEL_ABI_OLD_SESSION _IO(0xF6, 0x40)
#define LTTNG_KERNEL_ABI_OLD_TRACER_VERSION \
#define LTTNG_KERNEL_ABI_OLD_ENABLE _IO(0xF6, 0x80)
#define LTTNG_KERNEL_ABI_OLD_DISABLE _IO(0xF6, 0x81)
+#define LTTNG_KERNEL_ABI_OLD_COUNTER \
+ _IOW(0xF6, 0x84, struct lttng_kernel_abi_old_counter_conf)
+
+/* Counter file descriptor ioctl ("old" 2.13 ABI) */
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_READ \
+ _IOWR(0xF6, 0xC0, struct lttng_kernel_abi_old_counter_read)
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_AGGREGATE \
+ _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_old_counter_aggregate)
+#define LTTNG_KERNEL_ABI_OLD_COUNTER_CLEAR \
+ _IOW(0xF6, 0xC2, struct lttng_kernel_abi_old_counter_clear)
+
#endif /* _LTTNG_ABI_OLD_H */
char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING];
} __attribute__((packed));
-#define LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX 4
#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING 32
struct lttng_kernel_abi_event_notifier_notification {
uint64_t token;
LTTNG_KERNEL_ABI_KEY_TOKEN_PROVIDER_NAME = 2, /* no arg. */
};
+enum lttng_kernel_abi_counter_arithmetic {
+ LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR = 0,
+};
+
+enum lttng_kernel_abi_counter_bitness {
+ LTTNG_KERNEL_ABI_COUNTER_BITNESS_32 = 0,
+ LTTNG_KERNEL_ABI_COUNTER_BITNESS_64 = 1,
+};
+
+//TODO: remove this define.
+#define LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX 4
+
+//TODO: new in 2.14, update.
+#define LTTNG_KERNEL_ABI_COUNTER_KEY_LEN 256
+#define LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR_PADDING 32
+struct lttng_kernel_abi_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_ABI_COUNTER_KEY_LEN];
+
+ char padding[LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR_PADDING];
+} __attribute__((packed));
+
+//TODO: new in 2.14, update.
#define LTTNG_KERNEL_ABI_KEY_ARG_PADDING1 60
#define LTTNG_KERNEL_ABI_KEY_TOKEN_STRING_LEN_MAX 256
struct lttng_kernel_abi_key_token {
} arg;
} __attribute__((packed));
+//TODO: new in 2.14, update.
#define LTTNG_KERNEL_ABI_NR_KEY_TOKEN 4
struct lttng_kernel_abi_counter_key_dimension {
uint32_t nr_key_tokens;
struct lttng_kernel_abi_key_token key_tokens[LTTNG_KERNEL_ABI_NR_KEY_TOKEN];
} __attribute__((packed));
+//TODO: new in 2.14, update.
struct lttng_kernel_abi_counter_key {
uint32_t nr_dimensions;
struct lttng_kernel_abi_counter_key_dimension key_dimensions[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX];
} __attribute__((packed));
+//TODO: new in 2.14, update.
#define LTTNG_KERNEL_ABI_COUNTER_EVENT_PADDING1 16
struct lttng_kernel_abi_counter_event {
struct lttng_kernel_abi_event event;
char padding[LTTNG_KERNEL_ABI_COUNTER_EVENT_PADDING1];
} __attribute__((packed));
-enum lttng_kernel_abi_counter_arithmetic {
- LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR = 0,
-};
-
-enum lttng_kernel_abi_counter_bitness {
- LTTNG_KERNEL_ABI_COUNTER_BITNESS_32 = 0,
- LTTNG_KERNEL_ABI_COUNTER_BITNESS_64 = 1,
-};
-
-struct lttng_kernel_abi_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_ABI_COUNTER_CONF_PADDING1 67
-struct lttng_kernel_abi_counter_conf {
- uint32_t arithmetic; /* enum lttng_kernel_abi_counter_arithmetic */
- uint32_t bitness; /* enum lttng_kernel_abi_counter_bitness */
- uint32_t number_dimensions;
- int64_t global_sum_step;
- struct lttng_kernel_abi_counter_dimension dimensions[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX];
- uint8_t coalesce_hits;
- char padding[LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1];
-} __attribute__((packed));
-
-struct lttng_kernel_abi_counter_index {
- uint32_t number_dimensions;
- uint64_t dimension_indexes[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX];
-} __attribute__((packed));
-
-struct lttng_kernel_abi_counter_value {
- int64_t value;
- uint8_t underflow;
- uint8_t overflow;
-} __attribute__((packed));
-
-#define LTTNG_KERNEL_ABI_COUNTER_READ_PADDING 32
-struct lttng_kernel_abi_counter_read {
- 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 */
- char padding[LTTNG_KERNEL_ABI_COUNTER_READ_PADDING];
-} __attribute__((packed));
-
-#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING 32
-struct lttng_kernel_abi_counter_aggregate {
- struct lttng_kernel_abi_counter_index index;
- struct lttng_kernel_abi_counter_value value; /* output */
- char padding[LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING];
-} __attribute__((packed));
-
-#define LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING 32
-struct lttng_kernel_abi_counter_clear {
- struct lttng_kernel_abi_counter_index index;
- char padding[LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING];
-} __attribute__((packed));
-
-#define LTTNG_KERNEL_ABI_COUNTER_KEY_LEN 256
-#define LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR_PADDING 32
-struct lttng_kernel_abi_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_ABI_COUNTER_KEY_LEN];
-
- char padding[LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR_PADDING];
-} __attribute__((packed));
-
struct lttng_kernel_abi_tracer_version {
uint32_t major;
uint32_t minor;
#define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83)
/* 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, 0x84, struct lttng_kernel_abi_counter_conf)
+ _IOW(0xF6, 0x85, struct lttng_kernel_abi_counter_conf)
+#endif
/* Event and Event notifier FD ioctl */
#define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90)
/* Event notifier file descriptor ioctl */
#define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8)
+/* (0xF6, {0xC0, 0xC1, 0xC2}) are reserved for old ABI. */
+
/* Counter file descriptor ioctl */
-#define LTTNG_KERNEL_ABI_COUNTER_READ \
- _IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read)
-#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
- _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_counter_aggregate)
-#define LTTNG_KERNEL_ABI_COUNTER_CLEAR \
- _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear)
#define LTTNG_KERNEL_ABI_COUNTER_MAP_NR_DESCRIPTORS \
_IOR(0xF6, 0xC3, uint64_t)
#define 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.
*
int lttng_kernel_counter_get_max_nr_elem(struct lttng_kernel_channel_counter *counter,
size_t *max_nr_elem);
struct lttng_event_notifier_group *lttng_event_notifier_group_create(void);
-int lttng_event_notifier_group_create_error_counter(
- struct file *event_notifier_group_file,
- const struct lttng_kernel_abi_counter_conf *error_counter_conf);
void lttng_event_notifier_group_destroy(
struct lttng_event_notifier_group *event_notifier_group);
static
long lttng_abi_session_create_counter(
struct lttng_kernel_session *session,
- const struct lttng_kernel_abi_counter_conf *counter_conf);
+ const struct lttng_kernel_abi_old_counter_conf *counter_conf);
static int validate_zeroed_padding(char *p, size_t len)
{
long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct lttng_kernel_channel_counter *counter = file->private_data;
- size_t indexes[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX] = { 0 };
+ size_t indexes[LTTNG_KERNEL_ABI_OLD_COUNTER_DIMENSION_MAX] = { 0 };
int i;
switch (cmd) {
- case LTTNG_KERNEL_ABI_COUNTER_READ:
+ case LTTNG_KERNEL_ABI_OLD_COUNTER_READ:
{
- struct lttng_kernel_abi_counter_read local_counter_read;
- struct lttng_kernel_abi_counter_read __user *ucounter_read =
- (struct lttng_kernel_abi_counter_read __user *) arg;
+ struct lttng_kernel_abi_old_counter_read local_counter_read;
+ struct lttng_kernel_abi_old_counter_read __user *ucounter_read =
+ (struct lttng_kernel_abi_old_counter_read __user *) arg;
bool overflow, underflow;
int64_t value;
int32_t cpu;
return 0;
}
- case LTTNG_KERNEL_ABI_COUNTER_AGGREGATE:
+ case LTTNG_KERNEL_ABI_OLD_COUNTER_AGGREGATE:
{
- struct lttng_kernel_abi_counter_aggregate local_counter_aggregate;
- struct lttng_kernel_abi_counter_aggregate __user *ucounter_aggregate =
- (struct lttng_kernel_abi_counter_aggregate __user *) arg;
+ struct lttng_kernel_abi_old_counter_aggregate local_counter_aggregate;
+ struct lttng_kernel_abi_old_counter_aggregate __user *ucounter_aggregate =
+ (struct lttng_kernel_abi_old_counter_aggregate __user *) arg;
bool overflow, underflow;
int64_t value;
int ret;
return 0;
}
- case LTTNG_KERNEL_ABI_COUNTER_CLEAR:
+ case LTTNG_KERNEL_ABI_OLD_COUNTER_CLEAR:
{
- struct lttng_kernel_abi_counter_clear local_counter_clear;
- struct lttng_kernel_abi_counter_clear __user *ucounter_clear =
- (struct lttng_kernel_abi_counter_clear __user *) arg;
+ struct lttng_kernel_abi_old_counter_clear local_counter_clear;
+ struct lttng_kernel_abi_old_counter_clear __user *ucounter_clear =
+ (struct lttng_kernel_abi_old_counter_clear __user *) arg;
if (copy_from_user(&local_counter_clear, ucounter_clear,
sizeof(local_counter_clear)))
indexes[i] = local_counter_clear.index.dimension_indexes[i];
return lttng_kernel_counter_clear(counter, indexes);
}
- case LTTNG_KERNEL_ABI_COUNTER_EVENT:
+ //TODO: implement LTTNG_KERNEL_ABI_COUNTER_READ
+ //TODO: implement LTTNG_KERNEL_ABI_COUNTER_AGGREGATE
+ //TODO: implement LTTNG_KERNEL_ABI_COUNTER_CLEAR
+ case LTTNG_KERNEL_ABI_COUNTER_EVENT: //TODO: update to 2.14 ABI.
{
struct lttng_kernel_abi_counter_event *counter_event_param;
struct lttng_kernel_abi_counter_event __user *ucounter_event_param =
return -EFAULT;
return lttng_abi_session_set_creation_time(session, &time);
}
- case LTTNG_KERNEL_ABI_COUNTER:
+ //TODO: remove implementation of LTTNG_KERNEL_ABI_OLD_COUNTER which has never been exposed.
+ case LTTNG_KERNEL_ABI_OLD_COUNTER:
{
- struct lttng_kernel_abi_counter_conf counter_conf;
+ struct lttng_kernel_abi_old_counter_conf counter_conf;
if (copy_from_user(&counter_conf,
- (struct lttng_kernel_abi_counter_conf __user *) arg,
- sizeof(struct lttng_kernel_abi_counter_conf)))
+ (struct lttng_kernel_abi_old_counter_conf __user *) arg,
+ sizeof(struct lttng_kernel_abi_old_counter_conf)))
return -EFAULT;
return lttng_abi_session_create_counter(session, &counter_conf);
}
+ //TODO: implement LTTNG_KERNEL_ABI_COUNTER
default:
return -ENOIOCTLCMD;
}
return ret;
}
+//TODO: update to 2.14 struct lttng_kernel_abi_counter_conf
static
long lttng_abi_session_create_counter(
struct lttng_kernel_session *session,
- const struct lttng_kernel_abi_counter_conf *counter_conf)
+ const struct lttng_kernel_abi_old_counter_conf *counter_conf)
{
int counter_fd, ret;
char *counter_transport_name;
return ret;
}
+//TODO: update to expect struct struct lttng_kernel_abi_counter_conf
static
long lttng_abi_event_notifier_group_create_error_counter(
struct file *event_notifier_group_file,
- const struct lttng_kernel_abi_counter_conf *error_counter_conf)
+ const struct lttng_kernel_abi_old_counter_conf *error_counter_conf)
{
int counter_fd, ret;
char *counter_transport_name;
return ret;
return lttng_abi_create_event_notifier(file, &uevent_notifier_param, &uevent_param_ext);
}
- case LTTNG_KERNEL_ABI_COUNTER:
+ case LTTNG_KERNEL_ABI_OLD_COUNTER:
{
- struct lttng_kernel_abi_counter_conf uerror_counter_conf;
+ struct lttng_kernel_abi_old_counter_conf uerror_counter_conf;
if (copy_from_user(&uerror_counter_conf,
(struct lttng_kernel_abi_counter_conf __user *) arg,
return lttng_abi_event_notifier_group_create_error_counter(file,
&uerror_counter_conf);
}
+ //TODO: implement LTTNG_KERNEL_ABI_COUNTER
default:
return -ENOIOCTLCMD;
}