X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=liblttng-ust%2Fust-events-internal.h;h=16b7b33ff70812a4df799136ba14dc3cafc876c2;hb=refs%2Fheads%2Fsow-2020-0002-rev2;hp=24393936f2df4b40f4ab48cbd099e28d8612fb2c;hpb=ab249ecfea7ddc352e1fb5c3b97a4f0fbb62f3ca;p=deliverable%2Flttng-ust.git diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index 24393936..16b7b33f 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -1,30 +1,12 @@ -#ifndef _LTTNG_UST_EVENTS_INTERNAL_H -#define _LTTNG_UST_EVENTS_INTERNAL_H - /* - * ust-events-internal.h - * - * Copyright 2019 (c) - Francis Deslauriers + * SPDX-License-Identifier: MIT * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright 2019 (c) Francis Deslauriers */ +#ifndef _LTTNG_UST_EVENTS_INTERNAL_H +#define _LTTNG_UST_EVENTS_INTERNAL_H + #include #include @@ -33,10 +15,29 @@ #include #include +/* + * Enabler field, within whatever object is enabling an event. Target of + * backward reference. + */ +struct lttng_enabler { + enum lttng_enabler_format_type format_type; + + /* head list of struct lttng_ust_filter_bytecode_node */ + struct cds_list_head filter_bytecode_head; + /* head list of struct lttng_ust_excluder_node */ + struct cds_list_head excluder_head; + + struct lttng_ust_event event_param; + unsigned int enabled:1; + + uint64_t user_token; /* User-provided token */ +}; + struct lttng_event_enabler { struct lttng_enabler base; struct cds_list_head node; /* per-session list of enablers */ - struct lttng_channel *chan; + struct lttng_event_container *container; + struct lttng_counter_key key; /* * Unused, but kept around to make it explicit that the tracer can do * it. @@ -46,13 +47,16 @@ struct lttng_event_enabler { struct lttng_event_notifier_enabler { struct lttng_enabler base; - struct cds_list_head node; /* per-app list of event notifier enablers */ + uint64_t error_counter_index; + struct cds_list_head node; /* per-app list of event_notifier enablers */ + struct cds_list_head capture_bytecode_head; struct lttng_event_notifier_group *group; /* weak ref */ - uint64_t user_token; /* User-provided token */ + uint64_t num_captures; }; enum lttng_ust_bytecode_node_type { LTTNG_UST_BYTECODE_NODE_TYPE_FILTER, + LTTNG_UST_BYTECODE_NODE_TYPE_CAPTURE, }; struct lttng_ust_bytecode_node { @@ -101,7 +105,8 @@ LTTNG_HIDDEN struct lttng_event_enabler *lttng_event_enabler_create( enum lttng_enabler_format_type format_type, struct lttng_ust_event *event_param, - struct lttng_channel *chan); + const struct lttng_ust_counter_key *key, + struct lttng_event_container *container); /* * Destroy a `struct lttng_event_enabler` object. @@ -130,7 +135,7 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *enabler); LTTNG_HIDDEN int lttng_event_enabler_attach_filter_bytecode( struct lttng_event_enabler *enabler, - struct lttng_ust_bytecode_node *bytecode); + struct lttng_ust_bytecode_node **bytecode); /* * Attach an application context to an event enabler. @@ -147,19 +152,20 @@ int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, */ LTTNG_HIDDEN int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler, - struct lttng_ust_excluder_node *excluder); + struct lttng_ust_excluder_node **excluder); /* - * Synchronize bytecodes for the enabler and the event. + * Synchronize bytecodes for the enabler and the instance (event or + * event_notifier). * - * This function goes over all bytecode programs of the event enabler to ensure - * each is linked to the provided event. + * This function goes over all bytecode programs of the enabler (event or + * event_notifier enabler) to ensure each is linked to the provided instance. */ LTTNG_HIDDEN void lttng_enabler_link_bytecode(const struct lttng_event_desc *event_desc, struct lttng_ctx **ctx, - struct cds_list_head *bytecode_runtime_head, - struct lttng_enabler *enabler); + struct cds_list_head *instance_bytecode_runtime_head, + struct cds_list_head *enabler_bytecode_runtime_head); /* * Allocate and initialize a `struct lttng_event_notifier_group` object. @@ -219,7 +225,16 @@ int lttng_event_notifier_enabler_disable( LTTNG_HIDDEN int lttng_event_notifier_enabler_attach_filter_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_ust_bytecode_node *bytecode); + struct lttng_ust_bytecode_node **bytecode); + +/* + * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and + * all event_notifiers related to this enabler. + */ +LTTNG_HIDDEN +int lttng_event_notifier_enabler_attach_capture_bytecode( + struct lttng_event_notifier_enabler *event_notifier_enabler, + struct lttng_ust_bytecode_node **bytecode); /* * Attach exclusion list to `struct lttng_event_notifier_enabler` and all @@ -228,7 +243,7 @@ int lttng_event_notifier_enabler_attach_filter_bytecode( LTTNG_HIDDEN int lttng_event_notifier_enabler_attach_exclusion( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_ust_excluder_node *excluder); + struct lttng_ust_excluder_node **excluder); LTTNG_HIDDEN void lttng_free_event_notifier_filter_runtime( @@ -241,4 +256,19 @@ void lttng_free_event_notifier_filter_runtime( LTTNG_HIDDEN int lttng_fix_pending_event_notifiers(void); +LTTNG_HIDDEN +struct lttng_counter *lttng_ust_counter_create( + const char *counter_transport_name, + size_t number_dimensions, + const size_t *max_nr_elem, + int64_t global_sum_step, + bool coalesce_hits); + +LTTNG_HIDDEN +struct lttng_counter *lttng_session_create_counter( + struct lttng_session *session, + const char *counter_transport_name, + size_t number_dimensions, const size_t *dimensions_sizes, + int64_t global_sum_step, bool coalesce_hits); + #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */