Trace hit counters: ABI
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 10 Jan 2022 19:34:13 +0000 (14:34 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Jul 2024 20:58:48 +0000 (16:58 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I886975f27af90e42cbab274f70820a06090c48bc

include/lttng/abi.h

index f8af1dd04f8ce09f0cf5d3ffcb0e24dc594bb76e..988700f4ed9abf0a59ef8023123e3297df7805e6 100644 (file)
@@ -161,6 +161,46 @@ struct lttng_kernel_abi_event_notifier {
 } __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;
+       uint16_t capture_buf_size;
+       char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING];
+} __attribute__((packed));
+
+enum lttng_kernel_abi_key_token_type {
+       LTTNG_KERNEL_ABI_KEY_TOKEN_STRING = 0,          /* arg: string_ptr. */
+       LTTNG_KERNEL_ABI_KEY_TOKEN_EVENT_NAME = 1,      /* no arg. */
+       LTTNG_KERNEL_ABI_KEY_TOKEN_PROVIDER_NAME = 2,   /* no arg. */
+};
+
+#define LTTNG_KERNEL_ABI_KEY_ARG_PADDING1              60
+#define LTTNG_KERNEL_ABI_KEY_TOKEN_STRING_LEN_MAX      256
+struct lttng_kernel_abi_key_token {
+       uint32_t type;  /* enum lttng_kernel_abi_key_token_type */
+       union {
+               uint64_t string_ptr;
+               char padding[LTTNG_KERNEL_ABI_KEY_ARG_PADDING1];
+       } arg;
+} __attribute__((packed));
+
+#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));
+
+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));
+
+#define LTTNG_KERNEL_ABI_COUNTER_EVENT_PADDING1        16
+struct lttng_kernel_abi_counter_event {
+       struct lttng_kernel_abi_event event;
+       struct lttng_kernel_abi_counter_key key;
+       char padding[LTTNG_KERNEL_ABI_COUNTER_EVENT_PADDING1];
+} __attribute__((packed));
 
 enum lttng_kernel_abi_counter_arithmetic {
        LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR = 0,
@@ -222,11 +262,17 @@ struct lttng_kernel_abi_counter_clear {
        char padding[LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING];
 } __attribute__((packed));
 
-#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING 32
-struct lttng_kernel_abi_event_notifier_notification {
-       uint64_t token;
-       uint16_t capture_buf_size;
-       char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING];
+#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 {
@@ -399,6 +445,7 @@ struct lttng_kernel_abi_tracker_args {
 #define LTTNG_KERNEL_ABI_STREAM                        _IO(0xF6, 0x62)
 #define LTTNG_KERNEL_ABI_EVENT                 \
        _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
+/* LTTNG_KERNEL_ABI_SYSCALL_MASK applies to both channel and counter fds. */
 #define LTTNG_KERNEL_ABI_SYSCALL_MASK          \
        _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
 
@@ -444,7 +491,12 @@ struct lttng_kernel_abi_tracker_args {
        _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 \
+       _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)
 
 /*
  * LTTng-specific ioctls for the lib ringbuffer.
This page took 0.026786 seconds and 4 git commands to generate.