SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / src / bin / lttng-sessiond / trace-kernel.h
index dd6f21edf2bb06452d8f2c8f399d73aec65cf4ee..0721a57d3da202051f117840d07b9e08de304572 100644 (file)
@@ -23,6 +23,11 @@ struct ltt_kernel_event_list {
        struct cds_list_head head;
 };
 
+/* Kernel event rule token list */
+struct ltt_kernel_token_event_rule_ht {
+       struct cds_lfht *ht;
+};
+
 /* Channel stream list */
 struct ltt_kernel_stream_list {
        struct cds_list_head head;
@@ -48,8 +53,21 @@ struct ltt_kernel_event {
        struct lttng_kernel_event *event;
        struct cds_list_head list;
        char *filter_expression;
-       struct lttng_filter_bytecode *filter;
+       struct lttng_bytecode *filter;
+       struct lttng_userspace_probe_location *userspace_probe_location;
+};
+
+/* Kernel event */
+struct ltt_kernel_token_event_rule {
+       int fd;
+       uint64_t error_counter_index;
+       int enabled;
+       enum lttng_event_type type;
+       struct lttng_trigger *trigger;
+       uint64_t token;
+       const struct lttng_bytecode *filter;
        struct lttng_userspace_probe_location *userspace_probe_location;
+       struct cds_lfht_node ht_node;
 };
 
 /* Kernel channel */
@@ -132,7 +150,7 @@ struct ltt_kernel_event *trace_kernel_get_event_by_name(
 struct ltt_kernel_event *trace_kernel_find_event(
                char *name, struct ltt_kernel_channel *channel,
                enum lttng_event_type type,
-               struct lttng_filter_bytecode *filter);
+               struct lttng_bytecode *filter);
 struct ltt_kernel_channel *trace_kernel_get_channel_by_name(
                const char *name, struct ltt_kernel_session *session);
 
@@ -143,15 +161,22 @@ struct ltt_kernel_session *trace_kernel_create_session(void);
 struct ltt_kernel_channel *trace_kernel_create_channel(
                struct lttng_channel *chan);
 enum lttng_error_code trace_kernel_create_event(struct lttng_event *ev,
-               char *filter_expression, struct lttng_filter_bytecode *filter,
+               char *filter_expression, struct lttng_bytecode *filter,
                struct ltt_kernel_event **kernel_event);
 struct ltt_kernel_metadata *trace_kernel_create_metadata(void);
 struct ltt_kernel_stream *trace_kernel_create_stream(const char *name,
                unsigned int count);
 struct ltt_kernel_context *trace_kernel_create_context(
                struct lttng_kernel_context *ctx);
+enum lttng_error_code trace_kernel_create_token_event_rule(
+               struct lttng_trigger *trigger,
+               uint64_t token,
+               uint64_t trigger_error_counter_index,
+               struct ltt_kernel_token_event_rule **kernel_token_event_rule);
 struct ltt_kernel_context *trace_kernel_copy_context(
                struct ltt_kernel_context *ctx);
+enum lttng_error_code trace_kernel_init_trigger_from_event_rule(const struct lttng_event_rule *rule,
+               struct lttng_kernel_trigger *kernel_trigger);
 
 /*
  * Destroy functions free() the data structure and remove from linked list if
@@ -163,6 +188,7 @@ void trace_kernel_destroy_channel(struct ltt_kernel_channel *channel);
 void trace_kernel_destroy_event(struct ltt_kernel_event *event);
 void trace_kernel_destroy_stream(struct ltt_kernel_stream *stream);
 void trace_kernel_destroy_context(struct ltt_kernel_context *ctx);
+void trace_kernel_destroy_token_event_rule(struct ltt_kernel_token_event_rule *rule);
 void trace_kernel_free_session(struct ltt_kernel_session *session);
 
 #endif /* _LTT_TRACE_KERNEL_H */
This page took 0.034418 seconds and 5 git commands to generate.