X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Ftrigger%2Ftrigger-internal.h;h=d917ffa011d13a4db5486cde3f27c46b99177552;hb=6a751b953a43c566b74818ec6325db0978e16c66;hp=6fba6668491d71dd95f9f706a818e7e915c76d1e;hpb=94dbd8e4ed88cd56829159e1fef374a16fddd593;p=lttng-tools.git diff --git a/include/lttng/trigger/trigger-internal.h b/include/lttng/trigger/trigger-internal.h index 6fba66684..d917ffa01 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. */ @@ -122,6 +124,16 @@ 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. @@ -165,6 +177,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,9 +259,29 @@ 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, struct lttng_error_query_results *results); +/* + * Set the trigger name. + * + * A name is optional. + * A name will be assigned on trigger registration if no name is set. + * + * The name is copied. + * + * Return LTTNG_TRIGGER_STATUS_OK on success, LTTNG_TRIGGER_STATUS_INVALID + * if invalid parameters are passed. + */ +LTTNG_HIDDEN +enum lttng_trigger_status lttng_trigger_set_name( + struct lttng_trigger *trigger, const char *name); + #endif /* LTTNG_TRIGGER_INTERNAL_H */