From: Mathieu Desnoyers Date: Wed, 2 Feb 2022 20:23:02 +0000 (-0500) Subject: Add channel counter structures to internal header X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=954337a4d9755f287996c5f1ab94f60d4ee1044d;p=lttng-modules.git Add channel counter structures to internal header Signed-off-by: Mathieu Desnoyers Change-Id: I00b2a4df48d66977deafedeb3e9f5021754bf42a --- diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h index 26f6227c..af7127e9 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -222,6 +222,41 @@ struct lttng_kernel_channel_buffer_private { struct lttng_transport *transport; }; +struct lttng_kernel_channel_counter_ops_private { + struct lttng_kernel_channel_counter_ops *pub; /* Public channel counter ops interface */ + + struct lttng_kernel_channel_counter *(*counter_create)(size_t nr_dimensions, + const struct lttng_counter_dimension *dimensions, + int64_t global_sum_step); + void (*counter_destroy)(struct lttng_kernel_channel_counter *counter); + int (*counter_add)(struct lttng_kernel_channel_counter *counter, + const size_t *dimension_indexes, int64_t v); + int (*counter_read)(struct lttng_kernel_channel_counter *counter, + const size_t *dimension_indexes, int cpu, + int64_t *value, bool *overflow, bool *underflow); + int (*counter_aggregate)(struct lttng_kernel_channel_counter *counter, + const size_t *dimension_indexes, int64_t *value, + bool *overflow, bool *underflow); + int (*counter_clear)(struct lttng_kernel_channel_counter *counter, + const size_t *dimension_indexes); +}; + +struct lttng_kernel_channel_counter_private { + struct lttng_kernel_channel_common_private parent; + + struct lttng_kernel_channel_counter *pub; /* Public channel counter interface */ + struct lib_counter *counter; + struct lttng_kernel_channel_counter_ops *ops; + + /* Event notifier group owner. */ + struct lttng_event_notifier_group *event_notifier_group; + + /* Session owner. */ + struct lttng_session *session; + struct list_head node; /* Counter list (in session) */ + size_t free_index; /* Next index to allocate */ +}; + enum lttng_kernel_bytecode_interpreter_ret { LTTNG_KERNEL_BYTECODE_INTERPRETER_ERROR = -1, LTTNG_KERNEL_BYTECODE_INTERPRETER_OK = 0,