LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW = 102,
LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING = 103,
LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED = 104,
- LTTNG_CONDITION_TYPE_ON_EVENT = 105,
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES = 105,
};
enum lttng_condition_status {
*
*/
-#ifndef LTTNG_CONDITION_ON_EVENT_INTERNAL_H
-#define LTTNG_CONDITION_ON_EVENT_INTERNAL_H
+#ifndef LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H
+#define LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H
#include <lttng/condition/condition-internal.h>
#include <common/buffer-view.h>
struct lttng_bytecode *bytecode;
};
-struct lttng_condition_on_event {
+struct lttng_condition_event_rule_matches {
struct lttng_condition parent;
struct lttng_event_rule *rule;
struct lttng_dynamic_pointer_array capture_descriptors;
};
-struct lttng_evaluation_on_event {
+struct lttng_evaluation_event_rule_matches {
struct lttng_evaluation parent;
/* MessagePack-encoded captured event field values. */
};
LTTNG_HIDDEN
-ssize_t lttng_condition_on_event_create_from_payload(
+ssize_t lttng_condition_event_rule_matches_create_from_payload(
struct lttng_payload_view *view,
struct lttng_condition **condition);
LTTNG_HIDDEN
enum lttng_condition_status
-lttng_condition_on_event_borrow_rule_mutable(
+lttng_condition_event_rule_matches_borrow_rule_mutable(
const struct lttng_condition *condition,
struct lttng_event_rule **rule);
LTTNG_HIDDEN
-void lttng_condition_on_event_set_error_counter_index(
- struct lttng_condition *condition, uint64_t error_counter_index);
+void lttng_condition_event_rule_matches_set_error_counter_index(
+ struct lttng_condition *condition,
+ uint64_t error_counter_index);
LTTNG_HIDDEN
-uint64_t lttng_condition_on_event_get_error_counter_index(
+uint64_t lttng_condition_event_rule_matches_get_error_counter_index(
const struct lttng_condition *condition);
LTTNG_HIDDEN
-struct lttng_evaluation *lttng_evaluation_on_event_create(
- const struct lttng_condition_on_event *condition,
- const char *capture_payload, size_t capture_payload_size,
+struct lttng_evaluation *lttng_evaluation_event_rule_matches_create(
+ const struct lttng_condition_event_rule_matches *condition,
+ const char *capture_payload,
+ size_t capture_payload_size,
bool decode_capture_payload);
LTTNG_HIDDEN
-ssize_t lttng_evaluation_on_event_create_from_payload(
- const struct lttng_condition_on_event *condition,
+ssize_t lttng_evaluation_event_rule_matches_create_from_payload(
+ const struct lttng_condition_event_rule_matches *condition,
struct lttng_payload_view *view,
struct lttng_evaluation **_evaluation);
LTTNG_HIDDEN
enum lttng_error_code
-lttng_condition_on_event_generate_capture_descriptor_bytecode(
+lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
struct lttng_condition *condition);
LTTNG_HIDDEN
const struct lttng_bytecode *
-lttng_condition_on_event_get_capture_bytecode_at_index(
+lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
const struct lttng_condition *condition, unsigned int index);
-#endif /* LTTNG_CONDITION_ON_EVENT_INTERNAL_H */
+#endif /* LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H */
*
*/
-#ifndef LTTNG_CONDITION_ON_EVENT_H
-#define LTTNG_CONDITION_ON_EVENT_H
+#ifndef LTTNG_CONDITION_EVENT_RULE_MATCHES_H
+#define LTTNG_CONDITION_EVENT_RULE_MATCHES_H
#include <lttng/event-rule/event-rule.h>
#include <lttng/condition/condition.h>
struct lttng_event_expr;
struct lttng_event_field_value;
-enum lttng_evaluation_on_event_status {
- LTTNG_EVALUATION_ON_EVENT_STATUS_NONE = 1,
- LTTNG_EVALUATION_ON_EVENT_STATUS_OK = 0,
- LTTNG_EVALUATION_ON_EVENT_STATUS_INVALID = -1,
+enum lttng_evaluation_event_rule_matches_status {
+ LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_NONE = 1,
+ LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_OK = 0,
+ LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_INVALID = -1,
};
/**
- * On event conditions allows an action to be taken whenever an event matching
- * the on event is hit by the tracers.
+ * Event Rule Matches conditions allows an action to be taken whenever an event
+ * matching the Event Rule Matches is hit by the tracers.
*
- * An on event condition can also specify a payload to be captured at runtime.
- * This is done via the capture descriptor.
+ * An Event Rule Matches condition can also specify a payload to be captured at
+ * runtime. This is done via the capture descriptor.
*
* Note: the dynamic runtime capture of payload is only available for the
* trigger notification subsystem.
*/
/*
- * Create a newly allocated on event condition.
+ * Create a newly allocated Event Rule Matches condition.
*
* Returns a new condition on success, NULL on failure. This condition must be
* destroyed using lttng_condition_destroy().
*/
-extern struct lttng_condition *lttng_condition_on_event_create(
+extern struct lttng_condition *lttng_condition_event_rule_matches_create(
struct lttng_event_rule *rule);
/*
- * Get the rule property of a on event condition.
+ * Get the rule property of an Event Rule Matches condition.
*
* The caller does not assume the ownership of the returned rule. The
* rule shall only be used for the duration of the condition's
* Returns LTTNG_CONDITION_STATUS_OK and a pointer to the condition's rule
* on success, LTTNG_CONDITION_STATUS_INVALID if an invalid
* parameter is passed. */
-extern enum lttng_condition_status lttng_condition_on_event_get_rule(
+extern enum lttng_condition_status lttng_condition_event_rule_matches_get_rule(
const struct lttng_condition *condition,
const struct lttng_event_rule **rule);
/**
- * lttng_evaluation_on_event_hit are specialised lttng_evaluations which
- * allow users to query a number of properties resulting from the evaluation
- * of a condition which evaluated to true.
+ * lttng_evaluation_event_rule_matches_hit are specialised lttng_evaluations
+ * which allow users to query a number of properties resulting from the
+ * evaluation of a condition which evaluated to true.
*
- * The evaluation of an on event condition contains the captured event
+ * The evaluation of an Event Rule Matches condition contains the captured event
* payload fields that were specified by the condition.
*/
/*
- * Sets `*field_val` to the array event field value of the on event
+ * Sets `*field_val` to the array event field value of the Event Rule Matches
* condition evaluation `evaluation` which contains its captured values.
*
* Returns:
*
- * `LTTNG_EVALUATION_ON_EVENT_STATUS_OK`:
+ * `LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_OK`:
* Success.
*
* `*field_val` is an array event field value with a length of at
* least one.
*
- * `LTTNG_EVALUATION_ON_EVENT_STATUS_INVALID`:
+ * `LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_INVALID`:
* * `evaluation` is `NULL`.
* * The type of the condition of `evaluation` is not
- * `LTTNG_CONDITION_TYPE_ON_EVENT`.
+ * `LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES`.
* * `field_val` is `NULL`.
*
- * `LTTNG_EVALUATION_ON_EVENT_STATUS_NONE`:
+ * `LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_NONE`:
* * The condition of `evaluation` has no capture descriptors.
*/
-extern enum lttng_evaluation_on_event_status
-lttng_evaluation_on_event_get_captured_values(
+extern enum lttng_evaluation_event_rule_matches_status
+lttng_evaluation_event_rule_matches_get_captured_values(
const struct lttng_evaluation *evaluation,
const struct lttng_event_field_value **field_val);
/*
* Appends (transfering the ownership) the capture descriptor `expr` to
- * the on event condition `condition`.
+ * the Event Rule Matches condition `condition`.
*
* Returns:
*
* `LTTNG_CONDITION_STATUS_INVALID`:
* * `condition` is `NULL`.
* * The type of `condition` is not
- * `LTTNG_CONDITION_TYPE_ON_EVENT`.
+ * `LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES`.
* * `expr` is `NULL`.
* * `expr` is not a locator expression, that is, its type is not
* one of:
* * The associated event-rule does not support runtime capture.
*/
extern enum lttng_condition_status
-lttng_condition_on_event_append_capture_descriptor(
+lttng_condition_event_rule_matches_append_capture_descriptor(
struct lttng_condition *condition,
struct lttng_event_expr *expr);
/*
- * Sets `*count` to the number of capture descriptors in the on event
+ * Sets `*count` to the number of capture descriptors in the Event Rule Matches
* condition `condition`.
*
* Returns:
* `LTTNG_CONDITION_STATUS_INVALID`:
* * `condition` is `NULL`.
* * The type of `condition` is not
- * `LTTNG_CONDITION_TYPE_ON_EVENT`.
+ * `LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES`.
* * `count` is `NULL`.
*/
extern enum lttng_condition_status
-lttng_condition_on_event_get_capture_descriptor_count(
+lttng_condition_event_rule_matches_get_capture_descriptor_count(
const struct lttng_condition *condition, unsigned int *count);
/*
- * Returns the capture descriptor (borrowed) of the on event condition
+ * Returns the capture descriptor (borrowed) of the Event Rule Matches condition
* `condition` at the index `index`, or `NULL` if:
*
* * `condition` is `NULL`.
* * The type of `condition` is not
- * `LTTNG_CONDITION_TYPE_ON_EVENT`.
+ * `LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES`.
* * `index` is greater than or equal to the number of capture
* descriptors in `condition` (as returned by
- * lttng_condition_on_event_get_capture_descriptor_count()).
+ * lttng_condition_event_rule_matches_get_capture_descriptor_count()).
*/
extern const struct lttng_event_expr *
-lttng_condition_on_event_get_capture_descriptor_at_index(
+lttng_condition_event_rule_matches_get_capture_descriptor_at_index(
const struct lttng_condition *condition, unsigned int index);
#ifdef __cplusplus
}
#endif
-#endif /* LTTNG_CONDITION_ON_EVENT_H */
+#endif /* LTTNG_CONDITION_EVENT_RULE_MATCHES_H */
condition = lttng_trigger_get_const_condition(trigger);
assert(lttng_condition_get_type(condition) ==
- LTTNG_CONDITION_TYPE_ON_EVENT);
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- c_status = lttng_condition_on_event_get_rule(condition, &rule);
+ c_status = lttng_condition_event_rule_matches_get_rule(
+ condition, &rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
assert(lttng_event_rule_get_type(rule) ==
assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
assert(condition);
- assert(lttng_condition_get_type(condition) == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(lttng_condition_get_type(condition) ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
trigger_status = lttng_trigger_get_name(trigger, &trigger_name);
trigger_name = trigger_status == LTTNG_TRIGGER_STATUS_OK ?
trigger);
assert(condition);
- assert(lttng_condition_get_type(condition) == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(lttng_condition_get_type(condition) ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
session_lock_list();
switch (trigger_domain) {
return hash;
}
-static
-unsigned long lttng_condition_on_event_hash(
- const struct lttng_condition *condition)
+static unsigned long lttng_condition_event_rule_matches_hash(
+ const struct lttng_condition *condition)
{
unsigned long hash, condition_type;
enum lttng_condition_status condition_status;
const struct lttng_event_rule *event_rule;
condition_type = (unsigned long) condition->type;
- condition_status = lttng_condition_on_event_get_rule(condition,
- &event_rule);
+ condition_status = lttng_condition_event_rule_matches_get_rule(
+ condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
hash = hash_key_ulong((void *) condition_type, lttng_ht_seed);
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING:
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED:
return lttng_condition_session_rotation_hash(condition);
- case LTTNG_CONDITION_TYPE_ON_EVENT:
- return lttng_condition_on_event_hash(condition);
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
+ return lttng_condition_event_rule_matches_hash(condition);
default:
//ERR("[notification-thread] Unexpected condition type caught");
abort();
condition = lttng_trigger_get_const_condition(trigger);
assert(lttng_condition_get_type(condition) ==
- LTTNG_CONDITION_TYPE_ON_EVENT);
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- c_status = lttng_condition_on_event_get_rule(condition, &rule);
+ c_status = lttng_condition_event_rule_matches_get_rule(
+ condition, &rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
assert(lttng_event_rule_get_type(rule) ==
assert(condition);
condition_type = lttng_condition_get_type(condition);
- assert(condition_type == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(condition_type == LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
/* Does not acquire a reference. */
- condition_status = lttng_condition_on_event_get_rule(
+ condition_status = lttng_condition_event_rule_matches_get_rule(
condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
assert(event_rule);
assert(event_rule_type != LTTNG_EVENT_RULE_TYPE_UNKNOWN);
error_code_ret = trace_kernel_create_event_notifier_rule(trigger, token,
- lttng_condition_on_event_get_error_counter_index(condition),
+ lttng_condition_event_rule_matches_get_error_counter_index(
+ condition),
&event_notifier_rule);
if (error_code_ret != LTTNG_OK) {
goto error;
kernel_event_notifier.event.token = event_notifier_rule->token;
kernel_event_notifier.error_counter_idx =
- lttng_condition_on_event_get_error_counter_index(condition);
+ lttng_condition_event_rule_matches_get_error_counter_index(
+ condition);
fd = kernctl_create_event_notifier(
kernel_tracer_event_notifier_group_fd,
}
/* Set the capture bytecode if any. */
- cond_status = lttng_condition_on_event_get_capture_descriptor_count(
+ cond_status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &capture_bytecode_count);
assert(cond_status == LTTNG_CONDITION_STATUS_OK);
for (i = 0; i < capture_bytecode_count; i++) {
const struct lttng_bytecode *capture_bytecode =
- lttng_condition_on_event_get_capture_bytecode_at_index(
+ lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
condition, i);
if (capture_bytecode == NULL) {
assert(condition);
/* Does not acquire a reference to the event rule. */
- status = lttng_condition_on_event_get_rule(
+ status = lttng_condition_event_rule_matches_get_rule(
condition, &event_rule);
assert(status == LTTNG_CONDITION_STATUS_OK);
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING:
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED:
return LTTNG_OBJECT_TYPE_SESSION;
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
return LTTNG_OBJECT_TYPE_NONE;
default:
return LTTNG_OBJECT_TYPE_UNKNOWN;
is_supported = kernel_supports_ring_buffer_snapshot_sample_positions() == 1;
break;
}
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
{
const struct lttng_event_rule *event_rule;
enum lttng_domain_type domain;
const enum lttng_condition_status status =
- lttng_condition_on_event_get_rule(
+ lttng_condition_event_rule_matches_get_rule(
condition, &event_rule);
assert(status == LTTNG_CONDITION_STATUS_OK);
goto error_remove_ht_element;
}
- lttng_condition_on_event_set_error_counter_index(
+ lttng_condition_event_rule_matches_set_error_counter_index(
condition, error_counter_index);
ret = LTTNG_OK;
trigger_status = lttng_trigger_get_name(element->trigger, &trigger_name);
assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
- if (lttng_condition_on_event_get_capture_descriptor_count(
+ if (lttng_condition_event_rule_matches_get_capture_descriptor_count(
lttng_trigger_get_const_condition(element->trigger),
&capture_count) != LTTNG_CONDITION_STATUS_OK) {
ERR("Failed to get capture count");
goto end;
}
- evaluation = lttng_evaluation_on_event_create(
+ evaluation = lttng_evaluation_event_rule_matches_create(
container_of(lttng_trigger_get_const_condition(
element->trigger),
- struct lttng_condition_on_event,
+ struct lttng_condition_event_rule_matches,
parent),
notification->capture_buffer,
notification->capture_buf_size, false);
assert(condition);
condition_type = lttng_condition_get_type(condition);
- assert(condition_type == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(condition_type == LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- condition_status = lttng_condition_on_event_get_rule(
+ condition_status = lttng_condition_event_rule_matches_get_rule(
condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
assert(event_rule);
condition = lttng_trigger_get_condition(trigger);
assert(condition);
- assert(lttng_condition_get_type(condition) == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(lttng_condition_get_type(condition) ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- assert(LTTNG_CONDITION_STATUS_OK == lttng_condition_on_event_get_rule(condition, &event_rule));
+ assert(LTTNG_CONDITION_STATUS_OK ==
+ lttng_condition_event_rule_matches_get_rule(
+ condition, &event_rule));
assert(event_rule);
ua_event_notifier_rule->error_counter_index =
- lttng_condition_on_event_get_error_counter_index(condition);
+ lttng_condition_event_rule_matches_get_error_counter_index(condition);
/* Acquire the event notifier's reference to the trigger. */
lttng_trigger_get(trigger);
condition = lttng_trigger_get_const_condition(
ua_event_notifier_rule->trigger);
assert(condition);
- assert(lttng_condition_get_type(condition) == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(lttng_condition_get_type(condition) ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- condition_status = lttng_condition_on_event_get_rule(
+ condition_status = lttng_condition_event_rule_matches_get_rule(
condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
}
/* Set the capture bytecodes. */
- cond_status = lttng_condition_on_event_get_capture_descriptor_count(
+ cond_status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &capture_bytecode_count);
assert(cond_status == LTTNG_CONDITION_STATUS_OK);
for (i = 0; i < capture_bytecode_count; i++) {
const struct lttng_bytecode *capture_bytecode =
- lttng_condition_on_event_get_capture_bytecode_at_index(
+ lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
condition, i);
ret = set_ust_capture(app, capture_bytecode, i,
token = lttng_trigger_get_tracer_token(trigger);
condition = lttng_trigger_get_condition(trigger);
- if (lttng_condition_get_type(condition) != LTTNG_CONDITION_TYPE_ON_EVENT) {
+ if (lttng_condition_get_type(condition) !=
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES) {
/* Does not apply */
continue;
}
- condition_status = lttng_condition_on_event_borrow_rule_mutable(condition, &event_rule);
+ condition_status =
+ lttng_condition_event_rule_matches_borrow_rule_mutable(
+ condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
if (lttng_event_rule_get_domain_type(event_rule) == LTTNG_DOMAIN_KERNEL) {
goto error;
}
- c = lttng_condition_on_event_create(res.er);
+ c = lttng_condition_event_rule_matches_create(res.er);
lttng_event_rule_destroy(res.er);
res.er = NULL;
if (!c) {
assert(expr);
assert(*expr);
- status = lttng_condition_on_event_append_capture_descriptor(
+ status = lttng_condition_event_rule_matches_append_capture_descriptor(
c, *expr);
if (status != LTTNG_CONDITION_STATUS_OK) {
if (status == LTTNG_CONDITION_STATUS_UNSUPPORTED) {
}
}
-static
-void print_condition_on_event(const struct lttng_condition *condition)
+static void print_condition_event_rule_matches(
+ const struct lttng_condition *condition)
{
const struct lttng_event_rule *event_rule;
enum lttng_condition_status condition_status;
unsigned int cap_desc_count, i;
- condition_status =
- lttng_condition_on_event_get_rule(condition, &event_rule);
+ condition_status = lttng_condition_event_rule_matches_get_rule(
+ condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
print_event_rule(event_rule);
condition_status =
- lttng_condition_on_event_get_capture_descriptor_count(
+ lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &cap_desc_count);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
for (i = 0; i < cap_desc_count; i++) {
const struct lttng_event_expr *cap_desc =
- lttng_condition_on_event_get_capture_descriptor_at_index(
+ lttng_condition_event_rule_matches_get_capture_descriptor_at_index(
condition, i);
_MSG(" - ");
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED:
print_condition_session_rotation(condition);
break;
- case LTTNG_CONDITION_TYPE_ON_EVENT:
- print_condition_on_event(condition);
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
+ print_condition_event_rule_matches(condition);
break;
default:
abort();
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED:
create_from_payload = lttng_condition_session_rotation_completed_create_from_payload;
break;
- case LTTNG_CONDITION_TYPE_ON_EVENT:
- create_from_payload = lttng_condition_on_event_create_from_payload;
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
+ create_from_payload =
+ lttng_condition_event_rule_matches_create_from_payload;
break;
default:
ERR("Attempted to create condition of unknown type (%i)",
case LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED:
return "session rotation completed";
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
return "event rule hit";
default:
#include <stdint.h>
#include <vendor/msgpack/msgpack.h>
-#define IS_ON_EVENT_CONDITION(condition) \
- (lttng_condition_get_type(condition) == \
- LTTNG_CONDITION_TYPE_ON_EVENT)
+#define IS_EVENT_RULE_MATCHES_CONDITION(condition) \
+ (lttng_condition_get_type(condition) == \
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES)
-static bool is_on_event_evaluation(const struct lttng_evaluation *evaluation)
+static bool is_event_rule_matches_evaluation(
+ const struct lttng_evaluation *evaluation)
{
enum lttng_condition_type type = lttng_evaluation_get_type(evaluation);
- return type == LTTNG_CONDITION_TYPE_ON_EVENT;
+ return type == LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES;
}
-static bool lttng_condition_on_event_validate(
+static bool lttng_condition_event_rule_matches_validate(
const struct lttng_condition *condition);
-static int lttng_condition_on_event_serialize(
+static int lttng_condition_event_rule_matches_serialize(
const struct lttng_condition *condition,
struct lttng_payload *payload);
-static bool lttng_condition_on_event_is_equal(
+static bool lttng_condition_event_rule_matches_is_equal(
const struct lttng_condition *_a,
const struct lttng_condition *_b);
-static void lttng_condition_on_event_destroy(
+static void lttng_condition_event_rule_matches_destroy(
struct lttng_condition *condition);
-static bool lttng_condition_on_event_validate(
+static bool lttng_condition_event_rule_matches_validate(
const struct lttng_condition *condition)
{
bool valid = false;
- struct lttng_condition_on_event *event_rule;
+ struct lttng_condition_event_rule_matches *event_rule;
if (!condition) {
goto end;
}
- event_rule = container_of(
- condition, struct lttng_condition_on_event, parent);
+ event_rule = container_of(condition,
+ struct lttng_condition_event_rule_matches, parent);
if (!event_rule->rule) {
ERR("Invalid on event condition: a rule must be set");
goto end;
return ret;
}
-static
-struct lttng_capture_descriptor *
-lttng_condition_on_event_get_internal_capture_descriptor_at_index(
+static struct lttng_capture_descriptor *
+lttng_condition_event_rule_matches_get_internal_capture_descriptor_at_index(
const struct lttng_condition *condition, unsigned int index)
{
- const struct lttng_condition_on_event *on_event_cond =
- container_of(condition,
- const struct lttng_condition_on_event,
- parent);
+ const struct lttng_condition_event_rule_matches
+ *event_rule_matches_cond = container_of(condition,
+ const struct lttng_condition_event_rule_matches,
+ parent);
struct lttng_capture_descriptor *desc = NULL;
unsigned int count;
enum lttng_condition_status status;
- if (!condition || !IS_ON_EVENT_CONDITION(condition)) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition)) {
goto end;
}
- status = lttng_condition_on_event_get_capture_descriptor_count(
+ status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &count);
if (status != LTTNG_CONDITION_STATUS_OK) {
goto end;
}
desc = lttng_dynamic_pointer_array_get_pointer(
- &on_event_cond->capture_descriptors, index);
+ &event_rule_matches_cond->capture_descriptors, index);
end:
return desc;
}
-static int lttng_condition_on_event_serialize(
+static int lttng_condition_event_rule_matches_serialize(
const struct lttng_condition *condition,
struct lttng_payload *payload)
{
int ret;
- struct lttng_condition_on_event *on_event_condition;
+ struct lttng_condition_event_rule_matches *event_rule_matches_condition;
enum lttng_condition_status status;
/* Used for iteration and communication (size matters). */
uint32_t i, capture_descr_count;
- if (!condition || !IS_ON_EVENT_CONDITION(condition)) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition)) {
ret = -1;
goto end;
}
DBG("Serializing on event condition");
- on_event_condition = container_of(
- condition, struct lttng_condition_on_event, parent);
+ event_rule_matches_condition = container_of(condition,
+ struct lttng_condition_event_rule_matches, parent);
DBG("Serializing on event condition's event rule");
- ret = lttng_event_rule_serialize(on_event_condition->rule, payload);
+ ret = lttng_event_rule_serialize(
+ event_rule_matches_condition->rule, payload);
if (ret) {
goto end;
}
- status = lttng_condition_on_event_get_capture_descriptor_count(
+ status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &capture_descr_count);
if (status != LTTNG_CONDITION_STATUS_OK) {
ret = -1;
for (i = 0; i < capture_descr_count; i++) {
const struct lttng_capture_descriptor *desc =
- lttng_condition_on_event_get_internal_capture_descriptor_at_index(
+ lttng_condition_event_rule_matches_get_internal_capture_descriptor_at_index(
condition, i);
DBG("Serializing on event condition's capture descriptor %" PRIu32,
size_t i;
enum lttng_condition_status status;
- status = lttng_condition_on_event_get_capture_descriptor_count(
+ status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition_a, &capture_descr_count_a);
if (status != LTTNG_CONDITION_STATUS_OK) {
goto not_equal;
}
- status = lttng_condition_on_event_get_capture_descriptor_count(
+ status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition_b, &capture_descr_count_b);
if (status != LTTNG_CONDITION_STATUS_OK) {
goto not_equal;
for (i = 0; i < capture_descr_count_a; i++) {
const struct lttng_event_expr *expr_a =
- lttng_condition_on_event_get_capture_descriptor_at_index(
- condition_a,
- i);
+ lttng_condition_event_rule_matches_get_capture_descriptor_at_index(
+ condition_a, i);
const struct lttng_event_expr *expr_b =
- lttng_condition_on_event_get_capture_descriptor_at_index(
- condition_b,
- i);
+ lttng_condition_event_rule_matches_get_capture_descriptor_at_index(
+ condition_b, i);
if (!lttng_event_expr_is_equal(expr_a, expr_b)) {
goto not_equal;
return is_equal;
}
-static bool lttng_condition_on_event_is_equal(
+static bool lttng_condition_event_rule_matches_is_equal(
const struct lttng_condition *_a,
const struct lttng_condition *_b)
{
bool is_equal = false;
- struct lttng_condition_on_event *a, *b;
+ struct lttng_condition_event_rule_matches *a, *b;
- a = container_of(_a, struct lttng_condition_on_event, parent);
- b = container_of(_b, struct lttng_condition_on_event, parent);
+ a = container_of(_a, struct lttng_condition_event_rule_matches, parent);
+ b = container_of(_b, struct lttng_condition_event_rule_matches, parent);
/* Both event rules must be set or both must be unset. */
if ((a->rule && !b->rule) || (!a->rule && b->rule)) {
return is_equal;
}
-static void lttng_condition_on_event_destroy(
+static void lttng_condition_event_rule_matches_destroy(
struct lttng_condition *condition)
{
- struct lttng_condition_on_event *on_event_condition;
+ struct lttng_condition_event_rule_matches *event_rule_matches_condition;
- on_event_condition = container_of(
- condition, struct lttng_condition_on_event, parent);
+ event_rule_matches_condition = container_of(condition,
+ struct lttng_condition_event_rule_matches, parent);
- lttng_event_rule_put(on_event_condition->rule);
- lttng_dynamic_pointer_array_reset(&on_event_condition->capture_descriptors);
- free(on_event_condition);
+ lttng_event_rule_put(event_rule_matches_condition->rule);
+ lttng_dynamic_pointer_array_reset(
+ &event_rule_matches_condition->capture_descriptors);
+ free(event_rule_matches_condition);
}
static
free(desc);
}
-struct lttng_condition *lttng_condition_on_event_create(
+struct lttng_condition *lttng_condition_event_rule_matches_create(
struct lttng_event_rule *rule)
{
struct lttng_condition *parent = NULL;
- struct lttng_condition_on_event *condition = NULL;
+ struct lttng_condition_event_rule_matches *condition = NULL;
if (!rule) {
goto end;
}
- condition = zmalloc(sizeof(struct lttng_condition_on_event));
+ condition = zmalloc(sizeof(struct lttng_condition_event_rule_matches));
if (!condition) {
return NULL;
}
lttng_condition_init(&condition->parent,
- LTTNG_CONDITION_TYPE_ON_EVENT);
- condition->parent.validate = lttng_condition_on_event_validate,
- condition->parent.serialize = lttng_condition_on_event_serialize,
- condition->parent.equal = lttng_condition_on_event_is_equal,
- condition->parent.destroy = lttng_condition_on_event_destroy,
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
+ condition->parent.validate =
+ lttng_condition_event_rule_matches_validate,
+ condition->parent.serialize =
+ lttng_condition_event_rule_matches_serialize,
+ condition->parent.equal = lttng_condition_event_rule_matches_is_equal,
+ condition->parent.destroy = lttng_condition_event_rule_matches_destroy,
lttng_event_rule_get(rule);
condition->rule = rule;
}
LTTNG_HIDDEN
-ssize_t lttng_condition_on_event_create_from_payload(
+ssize_t lttng_condition_event_rule_matches_create_from_payload(
struct lttng_payload_view *view,
struct lttng_condition **_condition)
{
offset += event_rule_length;
/* Create condition (no capture descriptors yet) at this point */
- condition = lttng_condition_on_event_create(event_rule);
+ condition = lttng_condition_event_rule_matches_create(event_rule);
if (!condition) {
goto error;
}
}
/* Move ownership of `expr` to `condition`. */
- status = lttng_condition_on_event_append_capture_descriptor(
+ status = lttng_condition_event_rule_matches_append_capture_descriptor(
condition, expr);
if (status != LTTNG_CONDITION_STATUS_OK) {
/* `expr` not moved: destroy it. */
}
LTTNG_HIDDEN
-enum lttng_condition_status lttng_condition_on_event_borrow_rule_mutable(
+enum lttng_condition_status
+lttng_condition_event_rule_matches_borrow_rule_mutable(
const struct lttng_condition *condition,
struct lttng_event_rule **rule)
{
- struct lttng_condition_on_event *event_rule;
+ struct lttng_condition_event_rule_matches *event_rule;
enum lttng_condition_status status = LTTNG_CONDITION_STATUS_OK;
- if (!condition || !IS_ON_EVENT_CONDITION(condition) || !rule) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition) ||
+ !rule) {
status = LTTNG_CONDITION_STATUS_INVALID;
goto end;
}
- event_rule = container_of(
- condition, struct lttng_condition_on_event, parent);
+ event_rule = container_of(condition,
+ struct lttng_condition_event_rule_matches, parent);
if (!event_rule->rule) {
status = LTTNG_CONDITION_STATUS_UNSET;
goto end;
return status;
}
-enum lttng_condition_status lttng_condition_on_event_get_rule(
+enum lttng_condition_status lttng_condition_event_rule_matches_get_rule(
const struct lttng_condition *condition,
const struct lttng_event_rule **rule)
{
struct lttng_event_rule *mutable_rule = NULL;
const enum lttng_condition_status status =
- lttng_condition_on_event_borrow_rule_mutable(
- condition, &mutable_rule);
+ lttng_condition_event_rule_matches_borrow_rule_mutable(
+ condition, &mutable_rule);
*rule = mutable_rule;
return status;
}
LTTNG_HIDDEN
-void lttng_condition_on_event_set_error_counter_index(
+void lttng_condition_event_rule_matches_set_error_counter_index(
struct lttng_condition *condition, uint64_t error_counter_index)
{
- struct lttng_condition_on_event *on_event_cond =
+ struct lttng_condition_event_rule_matches *event_rule_matches_cond =
container_of(condition,
- struct lttng_condition_on_event, parent);
+ struct lttng_condition_event_rule_matches,
+ parent);
- LTTNG_OPTIONAL_SET(&on_event_cond->error_counter_index, error_counter_index);
+ LTTNG_OPTIONAL_SET(&event_rule_matches_cond->error_counter_index,
+ error_counter_index);
}
LTTNG_HIDDEN
-uint64_t lttng_condition_on_event_get_error_counter_index(
+uint64_t lttng_condition_event_rule_matches_get_error_counter_index(
const struct lttng_condition *condition)
{
- const struct lttng_condition_on_event *on_event_cond =
- container_of(condition,
- const struct lttng_condition_on_event, parent);
+ const struct lttng_condition_event_rule_matches
+ *event_rule_matches_cond = container_of(condition,
+ const struct lttng_condition_event_rule_matches,
+ parent);
- return LTTNG_OPTIONAL_GET(on_event_cond->error_counter_index);
+ return LTTNG_OPTIONAL_GET(event_rule_matches_cond->error_counter_index);
}
enum lttng_condition_status
-lttng_condition_on_event_append_capture_descriptor(
+lttng_condition_event_rule_matches_append_capture_descriptor(
struct lttng_condition *condition,
struct lttng_event_expr *expr)
{
int ret;
enum lttng_condition_status status = LTTNG_CONDITION_STATUS_OK;
- struct lttng_condition_on_event *on_event_cond =
+ struct lttng_condition_event_rule_matches *event_rule_matches_cond =
container_of(condition,
- struct lttng_condition_on_event, parent);
+ struct lttng_condition_event_rule_matches,
+ parent);
struct lttng_capture_descriptor *descriptor = NULL;
const struct lttng_event_rule *rule = NULL;
/* Only accept l-values. */
- if (!condition || !IS_ON_EVENT_CONDITION(condition) || !expr ||
- !lttng_event_expr_is_lvalue(expr)) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition) ||
+ !expr || !lttng_event_expr_is_lvalue(expr)) {
status = LTTNG_CONDITION_STATUS_INVALID;
goto end;
}
- status = lttng_condition_on_event_get_rule(condition, &rule);
+ status = lttng_condition_event_rule_matches_get_rule(condition, &rule);
if (status != LTTNG_CONDITION_STATUS_OK) {
goto end;
}
descriptor->bytecode = NULL;
ret = lttng_dynamic_pointer_array_add_pointer(
- &on_event_cond->capture_descriptors, descriptor);
+ &event_rule_matches_cond->capture_descriptors,
+ descriptor);
if (ret) {
status = LTTNG_CONDITION_STATUS_ERROR;
goto end;
}
enum lttng_condition_status
-lttng_condition_on_event_get_capture_descriptor_count(
+lttng_condition_event_rule_matches_get_capture_descriptor_count(
const struct lttng_condition *condition, unsigned int *count)
{
enum lttng_condition_status status = LTTNG_CONDITION_STATUS_OK;
- const struct lttng_condition_on_event *on_event_condition =
- container_of(condition,
- const struct lttng_condition_on_event,
- parent);
+ const struct lttng_condition_event_rule_matches
+ *event_rule_matches_condition = container_of(condition,
+ const struct lttng_condition_event_rule_matches,
+ parent);
- if (!condition || !IS_ON_EVENT_CONDITION(condition) || !count) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition) ||
+ !count) {
status = LTTNG_CONDITION_STATUS_INVALID;
goto end;
}
*count = lttng_dynamic_pointer_array_get_count(
- &on_event_condition->capture_descriptors);
+ &event_rule_matches_condition->capture_descriptors);
end:
return status;
}
const struct lttng_event_expr *
-lttng_condition_on_event_get_capture_descriptor_at_index(
+lttng_condition_event_rule_matches_get_capture_descriptor_at_index(
const struct lttng_condition *condition, unsigned int index)
{
const struct lttng_event_expr *expr = NULL;
const struct lttng_capture_descriptor *desc = NULL;
- desc = lttng_condition_on_event_get_internal_capture_descriptor_at_index(
+ desc = lttng_condition_event_rule_matches_get_internal_capture_descriptor_at_index(
condition, index);
if (desc == NULL) {
goto end;
}
LTTNG_HIDDEN
-ssize_t lttng_evaluation_on_event_create_from_payload(
- const struct lttng_condition_on_event *condition,
+ssize_t lttng_evaluation_event_rule_matches_create_from_payload(
+ const struct lttng_condition_event_rule_matches *condition,
struct lttng_payload_view *view,
struct lttng_evaluation **_evaluation)
{
capture_payload = current_view.buffer.data;
}
- evaluation = lttng_evaluation_on_event_create(condition,
- capture_payload, capture_payload_size, true);
+ evaluation = lttng_evaluation_event_rule_matches_create(
+ condition, capture_payload, capture_payload_size, true);
if (!evaluation) {
ret = -1;
goto error;
return ret;
}
-static int lttng_evaluation_on_event_serialize(
+static int lttng_evaluation_event_rule_matches_serialize(
const struct lttng_evaluation *evaluation,
struct lttng_payload *payload)
{
int ret = 0;
- struct lttng_evaluation_on_event *hit;
+ struct lttng_evaluation_event_rule_matches *hit;
uint32_t capture_payload_size;
- hit = container_of(
- evaluation, struct lttng_evaluation_on_event, parent);
+ hit = container_of(evaluation,
+ struct lttng_evaluation_event_rule_matches, parent);
capture_payload_size = (uint32_t) hit->capture_payload.size;
ret = lttng_dynamic_buffer_append(&payload->buffer, &capture_payload_size,
return ret;
}
-static void lttng_evaluation_on_event_destroy(
+static void lttng_evaluation_event_rule_matches_destroy(
struct lttng_evaluation *evaluation)
{
- struct lttng_evaluation_on_event *hit;
+ struct lttng_evaluation_event_rule_matches *hit;
- hit = container_of(
- evaluation, struct lttng_evaluation_on_event, parent);
+ hit = container_of(evaluation,
+ struct lttng_evaluation_event_rule_matches, parent);
lttng_dynamic_buffer_reset(&hit->capture_payload);
lttng_event_field_value_destroy(hit->captured_values);
free(hit);
return ret;
}
-static
-struct lttng_event_field_value *event_field_value_from_capture_payload(
- const struct lttng_condition_on_event *condition,
- const char *capture_payload, size_t capture_payload_size)
+static struct lttng_event_field_value *event_field_value_from_capture_payload(
+ const struct lttng_condition_event_rule_matches *condition,
+ const char *capture_payload,
+ size_t capture_payload_size)
{
struct lttng_event_field_value *ret = NULL;
msgpack_unpacked unpacked;
for (i = 0; i < count; i++) {
const struct lttng_capture_descriptor *capture_descriptor =
- lttng_condition_on_event_get_internal_capture_descriptor_at_index(
+ lttng_condition_event_rule_matches_get_internal_capture_descriptor_at_index(
&condition->parent, i);
const msgpack_object *elem_obj;
struct lttng_event_field_value *elem_field_val;
}
LTTNG_HIDDEN
-struct lttng_evaluation *lttng_evaluation_on_event_create(
- const struct lttng_condition_on_event *condition,
- const char *capture_payload, size_t capture_payload_size,
+struct lttng_evaluation *lttng_evaluation_event_rule_matches_create(
+ const struct lttng_condition_event_rule_matches *condition,
+ const char *capture_payload,
+ size_t capture_payload_size,
bool decode_capture_payload)
{
- struct lttng_evaluation_on_event *hit;
+ struct lttng_evaluation_event_rule_matches *hit;
struct lttng_evaluation *evaluation = NULL;
- hit = zmalloc(sizeof(struct lttng_evaluation_on_event));
+ hit = zmalloc(sizeof(struct lttng_evaluation_event_rule_matches));
if (!hit) {
goto error;
}
}
}
- hit->parent.type = LTTNG_CONDITION_TYPE_ON_EVENT;
- hit->parent.serialize = lttng_evaluation_on_event_serialize;
- hit->parent.destroy = lttng_evaluation_on_event_destroy;
+ hit->parent.type = LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES;
+ hit->parent.serialize = lttng_evaluation_event_rule_matches_serialize;
+ hit->parent.destroy = lttng_evaluation_event_rule_matches_destroy;
evaluation = &hit->parent;
hit = NULL;
error:
if (hit) {
- lttng_evaluation_on_event_destroy(&hit->parent);
+ lttng_evaluation_event_rule_matches_destroy(&hit->parent);
}
return evaluation;
}
-enum lttng_evaluation_on_event_status
-lttng_evaluation_on_event_get_captured_values(
+enum lttng_evaluation_event_rule_matches_status
+lttng_evaluation_event_rule_matches_get_captured_values(
const struct lttng_evaluation *evaluation,
const struct lttng_event_field_value **field_val)
{
- struct lttng_evaluation_on_event *hit;
- enum lttng_evaluation_on_event_status status =
- LTTNG_EVALUATION_ON_EVENT_STATUS_OK;
+ struct lttng_evaluation_event_rule_matches *hit;
+ enum lttng_evaluation_event_rule_matches_status status =
+ LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_OK;
- if (!evaluation || !is_on_event_evaluation(evaluation) ||
+ if (!evaluation || !is_event_rule_matches_evaluation(evaluation) ||
!field_val) {
- status = LTTNG_EVALUATION_ON_EVENT_STATUS_INVALID;
+ status = LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_INVALID;
goto end;
}
- hit = container_of(evaluation, struct lttng_evaluation_on_event,
- parent);
+ hit = container_of(evaluation,
+ struct lttng_evaluation_event_rule_matches, parent);
if (!hit->captured_values) {
- status = LTTNG_EVALUATION_ON_EVENT_STATUS_NONE;
+ status = LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_NONE;
goto end;
}
LTTNG_HIDDEN
enum lttng_error_code
-lttng_condition_on_event_generate_capture_descriptor_bytecode(
+lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
struct lttng_condition *condition)
{
enum lttng_error_code ret;
enum lttng_condition_status status;
unsigned int capture_count, i;
- if (!condition || !IS_ON_EVENT_CONDITION(condition)) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition)) {
ret = LTTNG_ERR_FATAL;
goto end;
}
- status = lttng_condition_on_event_get_capture_descriptor_count(
+ status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &capture_count);
if (status != LTTNG_CONDITION_STATUS_OK) {
ret = LTTNG_ERR_FATAL;
for (i = 0; i < capture_count; i++) {
struct lttng_capture_descriptor *local_capture_desc =
- lttng_condition_on_event_get_internal_capture_descriptor_at_index(
+ lttng_condition_event_rule_matches_get_internal_capture_descriptor_at_index(
condition, i);
if (local_capture_desc == NULL) {
LTTNG_HIDDEN
const struct lttng_bytecode *
-lttng_condition_on_event_get_capture_bytecode_at_index(
+lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
const struct lttng_condition *condition, unsigned int index)
{
- const struct lttng_condition_on_event *on_event_cond =
- container_of(condition,
- const struct lttng_condition_on_event,
- parent);
+ const struct lttng_condition_event_rule_matches
+ *event_rule_matches_cond = container_of(condition,
+ const struct lttng_condition_event_rule_matches,
+ parent);
struct lttng_capture_descriptor *desc = NULL;
struct lttng_bytecode *bytecode = NULL;
unsigned int count;
enum lttng_condition_status status;
- if (!condition || !IS_ON_EVENT_CONDITION(condition)) {
+ if (!condition || !IS_EVENT_RULE_MATCHES_CONDITION(condition)) {
goto end;
}
- status = lttng_condition_on_event_get_capture_descriptor_count(
+ status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &count);
if (status != LTTNG_CONDITION_STATUS_OK) {
goto end;
}
desc = lttng_dynamic_pointer_array_get_pointer(
- &on_event_cond->capture_descriptors, index);
+ &event_rule_matches_cond->capture_descriptors, index);
if (desc == NULL) {
goto end;
}
}
evaluation_size += ret;
break;
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
assert(condition);
- assert(condition->type == LTTNG_CONDITION_TYPE_ON_EVENT);
- ret = lttng_evaluation_on_event_create_from_payload(
+ assert(condition->type ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
+ ret = lttng_evaluation_event_rule_matches_create_from_payload(
container_of(condition,
- const struct lttng_condition_on_event,
+ const struct lttng_condition_event_rule_matches,
parent),
&evaluation_view, evaluation);
if (ret < 0) {
/* Apply to any domain. */
type = LTTNG_DOMAIN_NONE;
break;
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
/* Return the domain of the event rule. */
- c_status = lttng_condition_on_event_get_rule(
+ c_status = lttng_condition_event_rule_matches_get_rule(
trigger->condition, &event_rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
type = lttng_event_rule_get_domain_type(event_rule);
}
switch (lttng_condition_get_type(condition)) {
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
{
struct lttng_event_rule *event_rule;
const enum lttng_condition_status condition_status =
- lttng_condition_on_event_borrow_rule_mutable(
- condition, &event_rule);
+ lttng_condition_event_rule_matches_borrow_rule_mutable(
+ condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
}
/* Generate the capture bytecode. */
- ret = lttng_condition_on_event_generate_capture_descriptor_bytecode(
+ ret = lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
condition);
if (ret != LTTNG_OK) {
goto end;
lttng_trigger_get_const_condition(trigger);
switch (lttng_condition_get_type(condition)) {
- case LTTNG_CONDITION_TYPE_ON_EVENT:
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES:
needs_tracer_notifier = true;
goto end;
case LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE:
ok(success, "Setting tracepoint event rule exclusions");
}
- tmp_condition = lttng_condition_on_event_create(event_rule);
+ tmp_condition = lttng_condition_event_rule_matches_create(event_rule);
ok(tmp_condition, "Condition event rule object creation");
if (capture_desc_cb) {
ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK,
"Setting kprobe event rule name: '%s'", trigger_name);
- condition = lttng_condition_on_event_create(event_rule);
+ condition = lttng_condition_event_rule_matches_create(event_rule);
ok(condition, "Condition event rule object creation");
/* Register the trigger for condition. */
ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK,
"Setting uprobe event rule name: '%s'", trigger_name);
- condition = lttng_condition_on_event_create(event_rule);
+ condition = lttng_condition_event_rule_matches_create(event_rule);
ok(condition, "Condition event rule object creation");
/* Register the trigger for condition. */
ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK,
"Setting syscall event rule pattern: '%s'", syscall_name);
- condition = lttng_condition_on_event_create(event_rule);
+ condition = lttng_condition_event_rule_matches_create(event_rule);
ok(condition, "Condition syscall event rule object creation");
/* Register the trigger for condition. */
ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK,
"Setting filter: '%s'", filter_pattern);
- condition = lttng_condition_on_event_create(event_rule);
+ condition = lttng_condition_event_rule_matches_create(event_rule);
ok(condition, "Condition event rule object creation");
/* Register the triggers for condition */
goto end;
}
- cond_status = lttng_condition_on_event_append_capture_descriptor(
+ cond_status = lttng_condition_event_rule_matches_append_capture_descriptor(
condition, expr);
if (cond_status != LTTNG_CONDITION_STATUS_OK) {
fail("Failed to append capture descriptor");
{
int ret;
unsigned int capture_count, i;
- enum lttng_evaluation_on_event_status on_event_evaluation_status;
+ enum lttng_evaluation_event_rule_matches_status
+ event_rule_matches_evaluation_status;
enum lttng_event_field_value_status event_field_value_status;
const struct lttng_evaluation *evaluation;
const struct lttng_event_field_value *captured_fields;
goto end;
}
- on_event_evaluation_status =
- lttng_evaluation_on_event_get_captured_values(
+ event_rule_matches_evaluation_status =
+ lttng_evaluation_event_rule_matches_get_captured_values(
evaluation, &captured_fields);
- if (on_event_evaluation_status != LTTNG_EVALUATION_ON_EVENT_STATUS_OK) {
+ if (event_rule_matches_evaluation_status !=
+ LTTNG_EVALUATION_EVENT_RULE_MATCHES_STATUS_OK) {
diag("Failed to get event rule evaluation captured values: status = %d",
- (int) on_event_evaluation_status);
+ (int) event_rule_matches_evaluation_status);
ret = 1;
goto end;
}
lttng_remove_trigger_ok "hello"
}
-test_on_event_tracepoint ()
+test_event_rule_matches_tracepoint ()
{
diag "Listing on-event tracepoint"
lttng_remove_trigger_ok "J"
}
-test_on_event_probe ()
+test_event_rule_matches_probe ()
{
local channel_enable_addr
local channel_disable_addr
lttng_remove_trigger_ok "T2"
}
-test_on_event_userspace_probe_elf ()
+test_event_rule_matches_userspace_probe_elf ()
{
local elf_function_name="test_function"
lttng_remove_trigger_ok "T0"
}
-test_on_event_userspace_probe_sdt ()
+test_event_rule_matches_userspace_probe_sdt ()
{
local sdt_provider_name="foobar"
local sdt_probe_name="tp1"
lttng_remove_trigger_ok "T0"
}
-test_on_event_syscall ()
+test_event_rule_matches_syscall ()
{
diag "Listing on-event syscall"
start_lttng_sessiond_notap
test_top_level_options
-test_on_event_tracepoint
-skip $ist_root "non-root user: skipping kprobe tests" 9 || test_on_event_probe
-skip $ist_root "non-root user: skipping uprobe tests" 5 || test_on_event_userspace_probe_elf
-skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 5 || test_on_event_userspace_probe_sdt
-skip $ist_root "non-root user: skipping syscall tests" 13 || test_on_event_syscall
+test_event_rule_matches_tracepoint
+skip $ist_root "non-root user: skipping kprobe tests" 9 || test_event_rule_matches_probe
+skip $ist_root "non-root user: skipping uprobe tests" 5 || test_event_rule_matches_userspace_probe_elf
+skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 5 || test_event_rule_matches_userspace_probe_sdt
+skip $ist_root "non-root user: skipping syscall tests" 13 || test_event_rule_matches_syscall
test_session_consumed_size_condition
test_buffer_usage_conditions
test_session_rotation_conditions
"Setting exclusion pattern");
}
- condition = lttng_condition_on_event_create(tracepoint);
+ condition = lttng_condition_event_rule_matches_create(tracepoint);
ok(condition, "Created condition");
- condition_status = lttng_condition_on_event_get_rule(
+ condition_status = lttng_condition_event_rule_matches_get_rule(
condition, &tracepoint_tmp);
ok(condition_status == LTTNG_CONDITION_STATUS_OK,
"Getting event rule from event rule condition");