X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Ftrigger%2Ftrigger-internal.h;h=80cf0cb56023260ef3236110af266edf3a319b8a;hb=f2bda80eb1fe2f73dda9a7590d9960cdccb0f733;hp=c58787ceb2cfb506a7280e02ccf6b6425783ea19;hpb=a5c2d2a71919b8d1542b62f6d32579125cc2c8f8;p=lttng-tools.git diff --git a/include/lttng/trigger/trigger-internal.h b/include/lttng/trigger/trigger-internal.h index c58787ceb..80cf0cb56 100644 --- a/include/lttng/trigger/trigger-internal.h +++ b/include/lttng/trigger/trigger-internal.h @@ -21,6 +21,8 @@ struct lttng_payload; struct lttng_payload_view; +struct mi_writer; +struct mi_lttng_error_query_callbacks; struct lttng_trigger { /* Reference counting is only exposed to internal users. */ @@ -51,6 +53,23 @@ struct lttng_trigger { */ bool registered; + /* + * A "hidden" trigger is a trigger that is not externally listed. + * It is used to hide triggers that are used internally by the session + * daemon so that they can't be listed nor unregistered by external + * clients. + * + * This is a property that can only be set internally by the session + * daemon. As such, it is not serialized nor set by a + * "create_from_buffer" constructor. + * + * The hidden property is preserved by copies. + * + * Note that notifications originating from an "hidden" trigger will not + * be sent to clients that are not within the session daemon's process. + */ + bool is_hidden; + /* * The lock is used to protect against concurrent trigger execution and * trigger removal. @@ -116,12 +135,28 @@ LTTNG_HIDDEN bool lttng_trigger_is_equal( const struct lttng_trigger *a, const struct lttng_trigger *b); +LTTNG_HIDDEN +bool lttng_trigger_is_hidden(const struct lttng_trigger *trigger); + +LTTNG_HIDDEN +void lttng_trigger_set_hidden(struct lttng_trigger *trigger); + LTTNG_HIDDEN void lttng_trigger_get(struct lttng_trigger *trigger); LTTNG_HIDDEN void lttng_trigger_put(struct lttng_trigger *trigger); +/* + * Serialize a trigger to a mi_writer. + * Return LTTNG_OK in success, other enum lttng_error_code on error. + */ +LTTNG_HIDDEN +enum lttng_error_code lttng_trigger_mi_serialize(const struct lttng_trigger *trigger, + struct mi_writer *writer, + const struct mi_lttng_error_query_callbacks + *error_query_callbacks); + /* * Allocate a new set of triggers. * The returned object must be freed via lttng_triggers_destroy. @@ -153,6 +188,12 @@ LTTNG_HIDDEN int lttng_triggers_add( struct lttng_triggers *triggers, struct lttng_trigger *trigger); +/* + * Remove all triggers marked as hidden from the provided trigger set. + */ +LTTNG_HIDDEN +int lttng_triggers_remove_hidden_triggers(struct lttng_triggers *triggers); + /* * Serialize a trigger set to an lttng_payload object. * Return LTTNG_OK on success, negative lttng error code on error. @@ -165,6 +206,16 @@ LTTNG_HIDDEN ssize_t lttng_triggers_create_from_payload(struct lttng_payload_view *view, struct lttng_triggers **triggers); +/* + * Serialize a trigger set to a mi_writer. + * Return LTTNG_OK in success, other enum lttng_error_code on error. + */ +LTTNG_HIDDEN +enum lttng_error_code lttng_triggers_mi_serialize(const struct lttng_triggers *triggers, + struct mi_writer *writer, + const struct mi_lttng_error_query_callbacks + *error_query_callbacks); + LTTNG_HIDDEN const struct lttng_credentials *lttng_trigger_get_credentials( const struct lttng_trigger *trigger); @@ -237,6 +288,11 @@ enum lttng_trigger_status lttng_trigger_add_error_results( const struct lttng_trigger *trigger, struct lttng_error_query_results *results); +LTTNG_HIDDEN +enum lttng_trigger_status lttng_trigger_condition_add_error_results( + const struct lttng_trigger *trigger, + struct lttng_error_query_results *results); + LTTNG_HIDDEN enum lttng_trigger_status lttng_trigger_add_action_error_query_results( struct lttng_trigger *trigger,