X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Fnotification.c;h=ce6f5633275bd05f78df5a05d680919d18ee6276;hb=8dbb86b8a981917165030d3a7fbbc2cb932888ed;hp=e7101bb9f69f6bc97de662f9df1187aeeb666108;hpb=3ce811ee6c6c61a2c2c0909cf27e0dd8eea403fc;p=lttng-tools.git diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index e7101bb9f..ce6f56332 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -579,33 +579,24 @@ struct capture_base_field_tuple test_capture_base_fields[] = { static const char *get_notification_trigger_name( struct lttng_notification *notification) { - const char *name = NULL; - enum lttng_evaluation_status status; - const struct lttng_evaluation *evaluation; - evaluation = lttng_notification_get_evaluation(notification); - if (evaluation == NULL) { - fail("lttng_notification_get_evaluation"); + const char *trigger_name = NULL; + enum lttng_trigger_status trigger_status; + const struct lttng_trigger *trigger; + + trigger = lttng_notification_get_trigger(notification); + if (!trigger) { + fail("Failed to get trigger from notification"); goto end; } - switch (lttng_evaluation_get_type(evaluation)) { - case LTTNG_CONDITION_TYPE_ON_EVENT: - { - status = lttng_evaluation_on_event_get_trigger_name( - evaluation, &name); - if (status != LTTNG_EVALUATION_STATUS_OK) { - fail("lttng_evaluation_on_event_get_trigger_name"); - name = NULL; - goto end; - } - break; - } - default: - fail("Wrong notification evaluation type \n"); + trigger_status = lttng_trigger_get_name(trigger, &trigger_name); + if (trigger_status != LTTNG_TRIGGER_STATUS_OK) { + fail("Failed to get name from notification's trigger"); goto end; } + end: - return name; + return trigger_name; } static int validator_notification_trigger_name( @@ -1504,7 +1495,7 @@ static void create_tracepoint_event_rule_trigger(const char *event_pattern, 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) { @@ -1872,7 +1863,7 @@ static void test_kprobe_event_rule_notification( 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. */ @@ -1981,7 +1972,7 @@ static void test_uprobe_event_rule_notification( 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. */ @@ -2065,7 +2056,7 @@ static void test_syscall_event_rule_notification( lttng_session_daemon_notification_endpoint); ok(notification_channel, "Notification channel object creation"); - event_rule = lttng_event_rule_syscall_create(); + event_rule = lttng_event_rule_syscall_create(LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY); ok(event_rule, "syscall event rule object creation"); event_rule_status = lttng_event_rule_syscall_set_pattern( @@ -2073,7 +2064,7 @@ static void test_syscall_event_rule_notification( 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. */ @@ -2155,7 +2146,7 @@ static void test_syscall_event_rule_notification_filter( lttng_session_daemon_notification_endpoint); ok(notification_channel, "Notification channel object creation"); - event_rule = lttng_event_rule_syscall_create(); + event_rule = lttng_event_rule_syscall_create(LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY); ok(event_rule, "syscall event rule object creation"); event_rule_status = lttng_event_rule_syscall_set_pattern( @@ -2168,7 +2159,7 @@ static void test_syscall_event_rule_notification_filter( 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 */ @@ -2283,7 +2274,7 @@ static int generate_capture_descr(struct lttng_condition *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"); @@ -2306,7 +2297,8 @@ static int validator_notification_trigger_capture( { 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; @@ -2319,12 +2311,13 @@ static int validator_notification_trigger_capture( 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; }