Introduce emission site for syscall event rule
[lttng-tools.git] / tests / regression / tools / notification / notification.c
index e7101bb9f69f6bc97de662f9df1187aeeb666108..7e11bc280116360542940bc812575e930e1a0dbf 100644 (file)
@@ -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(
@@ -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(
@@ -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(
This page took 0.024692 seconds and 4 git commands to generate.