SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / src / common / lttng-kernel.h
index fc2a1e25944f26cd8273353d5dd6ce49dce92e9e..cdf6f041bd4d563c52112019fbb4b767fe16d718 100644 (file)
@@ -151,6 +151,72 @@ struct lttng_kernel_event {
        } u;
 } LTTNG_PACKED;
 
+#define LTTNG_KERNEL_TRIGGER_PADDING1  16
+#define LTTNG_KERNEL_TRIGGER_PADDING2  LTTNG_KERNEL_SYM_NAME_LEN + 32
+struct lttng_kernel_trigger {
+       uint64_t id;
+       uint64_t error_counter_idx;
+       char name[LTTNG_KERNEL_SYM_NAME_LEN];   /* event name */
+       enum lttng_kernel_instrumentation instrumentation;
+       char padding[LTTNG_KERNEL_TRIGGER_PADDING1];
+
+       /* Per instrumentation type configuration */
+       union {
+               struct lttng_kernel_kretprobe kretprobe;
+               struct lttng_kernel_kprobe kprobe;
+               struct lttng_kernel_uprobe uprobe;
+               struct lttng_kernel_function ftrace;
+               char padding[LTTNG_KERNEL_TRIGGER_PADDING2];
+       } u;
+} LTTNG_PACKED;
+
+enum lttng_kernel_counter_arithmetic {
+       LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR = 1,
+};
+
+enum lttng_kernel_counter_bitness {
+       LTTNG_KERNEL_COUNTER_BITNESS_32BITS = 1,
+       LTTNG_KERNEL_COUNTER_BITNESS_64BITS = 2,
+};
+
+struct lttng_kernel_counter_dimension {
+       uint64_t size;
+       uint64_t underflow_index;
+       uint64_t overflow_index;
+       uint8_t has_underflow;
+       uint8_t has_overflow;
+} LTTNG_PACKED;
+
+#define LTTNG_KERNEL_COUNTER_DIMENSION_MAX 8
+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];
+} LTTNG_PACKED;
+
+struct lttng_kernel_counter_value {
+       uint32_t number_dimensions;
+       uint64_t dimension_indexes[LTTNG_KERNEL_COUNTER_DIMENSION_MAX];
+       int64_t value;
+} LTTNG_PACKED;
+
+#define LTTNG_KERNEL_TRIGGER_NOTIFICATION_PADDING 32
+struct lttng_kernel_trigger_notification {
+       uint64_t id;
+       uint16_t capture_buf_size;
+       char padding[LTTNG_KERNEL_TRIGGER_NOTIFICATION_PADDING];
+} LTTNG_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];
+} LTTNG_PACKED;
+
 struct lttng_kernel_tracer_version {
        uint32_t major;
        uint32_t minor;
This page took 0.033373 seconds and 5 git commands to generate.