#include <common/credentials.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <lttng/domain.h>
+#include <lttng/event.h>
#include <lttng/event-rule/event-rule.h>
#include <lttng/lttng-error.h>
#include <stdbool.h>
const struct lttng_credentials *creds);
typedef const char *(*event_rule_get_filter_cb)(
const struct lttng_event_rule *event_rule);
-typedef const struct lttng_filter_bytecode *(
+typedef const struct lttng_bytecode *(
*event_rule_get_filter_bytecode_cb)(
const struct lttng_event_rule *event_rule);
typedef enum lttng_event_rule_generate_exclusions_status (
struct lttng_event_exclusion **exclusions);
typedef unsigned long (*event_rule_hash_cb)(
const struct lttng_event_rule *event_rule);
+typedef struct lttng_event *(*event_rule_generate_lttng_event_cb)(
+ const struct lttng_event_rule *event_rule);
struct lttng_event_rule {
struct urcu_ref ref;
event_rule_get_filter_bytecode_cb get_filter_bytecode;
event_rule_generate_exclusions_cb generate_exclusions;
event_rule_hash_cb hash;
+ event_rule_generate_lttng_event_cb generate_lttng_event;
};
struct lttng_event_rule_comm {
* Caller DOES NOT own the returned object.
*/
LTTNG_HIDDEN
-const struct lttng_filter_bytecode *lttng_event_rule_get_filter_bytecode(
+const struct lttng_bytecode *lttng_event_rule_get_filter_bytecode(
const struct lttng_event_rule *rule);
/*
LTTNG_HIDDEN
unsigned long lttng_event_rule_hash(const struct lttng_event_rule *rule);
+/*
+ * This is a compatibility helper allowing us to generate a sessiond-side (not
+ * communication) `struct lttng_event` object from an event rule.
+ *
+ * This effectively bridges older parts of the code using those structures and
+ * new event-rule based code.
+ *
+ * The caller owns the returned object.
+ */
+LTTNG_HIDDEN
+struct lttng_event *lttng_event_rule_generate_lttng_event(
+ const struct lttng_event_rule *rule);
+
+/* Test if an event rule targets an agent domain. */
+LTTNG_HIDDEN
+bool lttng_event_rule_targets_agent_domain(const struct lttng_event_rule *rule);
+
#endif /* LTTNG_EVENT_RULE_INTERNAL_H */