Add condition-targeting error query
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Jun 2021 21:58:45 +0000 (17:58 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 16 Jun 2021 15:40:25 +0000 (11:40 -0400)
Notifications discarded by the tracers are reported at the level of a
trigger. As those errors are specific to triggers with an "event-rule
matches" condition, they should be reported through a condition-specific
error query.

Note that a condition error query is created from a trigger: there is no
ambiguity since, unlike actions, conditions cannot be nested.

Given the proximity of the final 2.13 release, the code which populated
trigger error query results is simply used to populate the condition
error query results when the condition is of type "event-rule matches".

No trigger-scope errors can be reported for the moment. However, such
error reports will be added in the future.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie1ac3668142041beb6fd61574ccef506707c55b2

include/lttng/error-query-internal.h
include/lttng/error-query.h
include/lttng/trigger/trigger-internal.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/trigger-error-query.c
src/bin/lttng/commands/list_triggers.c
src/common/error-query.c
tests/regression/tools/notification/test_notification_notifier_discarded_count
tests/regression/tools/trigger/test_list_triggers_cli
tests/regression/tools/trigger/test_remove_trigger_cli
tests/regression/ust/python-logging/test_python_logging.in

index b5578d44d57b466a7032baa0042e028318cf4b54..5de3c43f9614b8c376ce330bfb0797930d3afb51 100644 (file)
@@ -17,6 +17,7 @@
 
 enum lttng_error_query_target_type {
        LTTNG_ERROR_QUERY_TARGET_TYPE_TRIGGER,
+       LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION,
        LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION,
 };
 
@@ -28,6 +29,10 @@ LTTNG_HIDDEN
 const struct lttng_trigger *lttng_error_query_trigger_borrow_target(
                const struct lttng_error_query *query);
 
+LTTNG_HIDDEN
+const struct lttng_trigger *lttng_error_query_condition_borrow_target(
+               const struct lttng_error_query *query);
+
 LTTNG_HIDDEN
 const struct lttng_trigger *lttng_error_query_action_borrow_trigger_target(
                const struct lttng_error_query *query);
index 8a5945ae9c75467dd9bb6ffeb45c236d60f084a8..ff0f0ae99ef06088e7706712665715d62f13dae9 100644 (file)
@@ -61,6 +61,10 @@ enum lttng_error_query_results_status {
 extern struct lttng_error_query *lttng_error_query_trigger_create(
                const struct lttng_trigger *trigger);
 
+/* Create an error query targetting a trigger's condition object. */
+extern struct lttng_error_query *lttng_error_query_condition_create(
+               const struct lttng_trigger *trigger);
+
 /*
  * Create an error query targetting an action object.
  *
index c58787ceb2cfb506a7280e02ccf6b6425783ea19..02dcf5335afea316b60194fe13c3d2e36493faa6 100644 (file)
@@ -237,6 +237,11 @@ 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,
index 9ae4d1974293a9197362f92b244eaca8f3543aff..7715e145260d7886bfac00683fa28b1d34362f7a 100644 (file)
@@ -4662,7 +4662,7 @@ enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cm
 {
        enum lttng_error_code ret_code;
        const struct lttng_trigger *query_target_trigger;
-       struct lttng_action *query_target_action = NULL;
+       const struct lttng_action *query_target_action = NULL;
        struct lttng_trigger *matching_trigger = NULL;
        const char *trigger_name;
        uid_t trigger_owner;
@@ -4673,6 +4673,10 @@ enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cm
        case LTTNG_ERROR_QUERY_TARGET_TYPE_TRIGGER:
                query_target_trigger = lttng_error_query_trigger_borrow_target(query);
                break;
+       case LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION:
+               query_target_trigger =
+                               lttng_error_query_condition_borrow_target(query);
+               break;
        case LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION:
                query_target_trigger = lttng_error_query_action_borrow_trigger_target(
                                query);
@@ -4748,6 +4752,21 @@ enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cm
                }
 
                break;
+       case LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION:
+       {
+               trigger_status = lttng_trigger_condition_add_error_results(
+                               matching_trigger, results);
+
+               switch (trigger_status) {
+               case LTTNG_TRIGGER_STATUS_OK:
+                       break;
+               default:
+                       ret_code = LTTNG_ERR_UNK;
+                       goto end;
+               }
+
+               break;
+       }
        case LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION:
        {
                const enum lttng_action_status action_status =
index 4c464004d52f49fffcc1769fc8a338926ff0ed62..ac076b21ee771f74d267c43ffad95cb2090971d3 100644 (file)
@@ -14,6 +14,14 @@ LTTNG_HIDDEN
 enum lttng_trigger_status lttng_trigger_add_error_results(
                const struct lttng_trigger *trigger,
                struct lttng_error_query_results *results)
+{
+       return LTTNG_TRIGGER_STATUS_OK;
+}
+
+LTTNG_HIDDEN
+enum lttng_trigger_status lttng_trigger_condition_add_error_results(
+               const struct lttng_trigger *trigger,
+               struct lttng_error_query_results *results)
 {
        enum lttng_trigger_status status;
        uint64_t discarded_tracer_messages_count;
@@ -29,7 +37,12 @@ enum lttng_trigger_status lttng_trigger_add_error_results(
                        &trigger_owner);
        assert(status == LTTNG_TRIGGER_STATUS_OK);
 
-       /* Only add discarded tracer messages count for applicable triggers. */
+       /*
+        * Only add discarded tracer messages count for applicable conditions.
+        * As of 2.13, only "event rule matches" conditions can generate
+        * reportable errors hence why this function is very specific to this
+        * condition type.
+        */
        if (!lttng_trigger_needs_tracer_notifier(trigger)) {
                status = LTTNG_TRIGGER_STATUS_OK;
                goto end;
index 929d9a46b442e01b26679906972253c0d9d50a85..a456afc89c620232d92568eafd737c637a4f1e81 100644 (file)
@@ -29,6 +29,8 @@ static const char help_msg[] =
 ;
 #endif
 
+#define INDENTATION_LEVEL_STR "  "
+
 typedef enum lttng_event_rule_status (*event_rule_logging_get_name_pattern)(
                const struct lttng_event_rule *rule, const char **pattern);
 typedef enum lttng_event_rule_status (*event_rule_logging_get_filter)(
@@ -638,6 +640,79 @@ void print_one_event_expr(const struct lttng_event_expr *event_expr)
        }
 }
 
+static
+void print_indentation(unsigned int indentation_level)
+{
+       unsigned int i;
+
+       for (i = 0; i < indentation_level; i++) {
+               _MSG(INDENTATION_LEVEL_STR);
+       }
+}
+
+static
+void print_error_query_results(struct lttng_error_query_results *results,
+               unsigned int base_indentation_level)
+{
+       unsigned int i, count, printed_errors_count = 0;
+       enum lttng_error_query_results_status results_status;
+
+       results_status = lttng_error_query_results_get_count(results, &count);
+       assert(results_status == LTTNG_ERROR_QUERY_RESULTS_STATUS_OK);
+
+       assert(results);
+
+       print_indentation(base_indentation_level);
+       _MSG("errors:");
+
+       for (i = 0; i < count; i++) {
+               const struct lttng_error_query_result *result;
+               enum lttng_error_query_result_status result_status;
+               const char *result_name;
+               const char *result_description;
+               uint64_t result_value;
+
+               results_status = lttng_error_query_results_get_result(
+                               results, &result, i);
+               assert(results_status == LTTNG_ERROR_QUERY_RESULTS_STATUS_OK);
+
+               result_status = lttng_error_query_result_get_name(
+                               result, &result_name);
+               assert(result_status == LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
+               result_status = lttng_error_query_result_get_description(
+                               result, &result_description);
+               assert(result_status == LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
+
+
+               if (lttng_error_query_result_get_type(result) ==
+                               LTTNG_ERROR_QUERY_RESULT_TYPE_COUNTER) {
+                       result_status = lttng_error_query_result_counter_get_value(
+                                       result, &result_value);
+                       assert(result_status ==
+                                       LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
+                       if (result_value == 0) {
+                               continue;
+                       }
+
+                       MSG("");
+                       print_indentation(base_indentation_level + 1);
+
+                       _MSG("%s: %" PRIu64, result_name, result_value);
+                       printed_errors_count++;
+               } else {
+                       MSG("");
+                       print_indentation(base_indentation_level + 1);
+                       _MSG("Unknown error query result type for result '%s' (%s)",
+                                       result_name, result_description);
+                       continue;
+               }
+       }
+
+       if (printed_errors_count == 0) {
+               _MSG(" none");
+       }
+}
+
 static void print_condition_event_rule_matches(
                const struct lttng_condition *condition)
 {
@@ -676,9 +751,7 @@ static void print_action_errors(const struct lttng_trigger *trigger,
                const uint64_t *action_path_indexes,
                size_t action_path_length)
 {
-       unsigned int i, count, printed_errors_count = 0;
        enum lttng_error_code error_query_ret;
-       enum lttng_error_query_results_status results_status;
        struct lttng_error_query_results *results = NULL;
        const char *trigger_name;
        uid_t trigger_uid;
@@ -710,53 +783,7 @@ static void print_action_errors(const struct lttng_trigger *trigger,
                goto end;
        }
 
-       results_status = lttng_error_query_results_get_count(results, &count);
-       assert(results_status == LTTNG_ERROR_QUERY_RESULTS_STATUS_OK);
-
-       _MSG("      errors:");
-
-       for (i = 0; i < count; i++) {
-               const struct lttng_error_query_result *result;
-               enum lttng_error_query_result_status result_status;
-               const char *result_name;
-               const char *result_description;
-               uint64_t result_value;
-
-               results_status = lttng_error_query_results_get_result(
-                               results, &result, i);
-               assert(results_status == LTTNG_ERROR_QUERY_RESULTS_STATUS_OK);
-
-               result_status = lttng_error_query_result_get_name(
-                               result, &result_name);
-               assert(result_status == LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
-               result_status = lttng_error_query_result_get_description(
-                               result, &result_description);
-               assert(result_status == LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
-
-               if (lttng_error_query_result_get_type(result) ==
-                               LTTNG_ERROR_QUERY_RESULT_TYPE_COUNTER) {
-                       result_status = lttng_error_query_result_counter_get_value(
-                                       result, &result_value);
-                       assert(result_status ==
-                                       LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
-                       if (result_value == 0) {
-                               continue;
-                       }
-
-                       MSG("");
-                       _MSG("        %s: %" PRIu64, result_name,
-                                       result_value);
-                       printed_errors_count++;
-               } else {
-                       _MSG("        Unknown error query result type for result '%s' (%s)",
-                                       result_name, result_description);
-                       continue;
-               }
-       }
-
-       if (printed_errors_count == 0) {
-               _MSG(" none");
-       }
+       print_error_query_results(results, 3);
 
 end:
        MSG("");
@@ -945,9 +972,7 @@ end:
 static
 void print_trigger_errors(const struct lttng_trigger *trigger)
 {
-       unsigned int i, count, printed_errors_count = 0;
        enum lttng_error_code error_query_ret;
-       enum lttng_error_query_results_status results_status;
        struct lttng_error_query_results *results = NULL;
        enum lttng_trigger_status trigger_status;
        const char *trigger_name;
@@ -974,53 +999,45 @@ void print_trigger_errors(const struct lttng_trigger *trigger)
                goto end;
        }
 
-       results_status = lttng_error_query_results_get_count(results, &count);
-       assert(results_status == LTTNG_ERROR_QUERY_RESULTS_STATUS_OK);
-
-       _MSG("  errors:");
+       print_error_query_results(results, 1);
 
-       for (i = 0; i < count; i++) {
-               const struct lttng_error_query_result *result;
-               enum lttng_error_query_result_status result_status;
-               const char *result_name;
-               const char *result_description;
-               uint64_t result_value;
+end:
+       MSG("");
+       lttng_error_query_destroy(query);
+       lttng_error_query_results_destroy(results);
+}
 
-               results_status = lttng_error_query_results_get_result(
-                               results, &result, i);
-               assert(results_status == LTTNG_ERROR_QUERY_RESULTS_STATUS_OK);
+static
+void print_condition_errors(const struct lttng_trigger *trigger)
+{
+       enum lttng_error_code error_query_ret;
+       struct lttng_error_query_results *results = NULL;
+       enum lttng_trigger_status trigger_status;
+       const char *trigger_name;
+       uid_t trigger_uid;
+       struct lttng_error_query *query =
+                       lttng_error_query_condition_create(trigger);
 
-               result_status = lttng_error_query_result_get_name(
-                               result, &result_name);
-               assert(result_status == LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
-               result_status = lttng_error_query_result_get_description(
-                               result, &result_description);
-               assert(result_status == LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
+       assert(query);
+       /*
+        * Anonymous triggers are not listed; this would be an internal error.
+        */
+       trigger_status = lttng_trigger_get_name(trigger, &trigger_name);
+       assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
 
-               if (lttng_error_query_result_get_type(result) ==
-                               LTTNG_ERROR_QUERY_RESULT_TYPE_COUNTER) {
-                       result_status = lttng_error_query_result_counter_get_value(
-                                       result, &result_value);
-                       assert(result_status ==
-                                       LTTNG_ERROR_QUERY_RESULT_STATUS_OK);
-                       if (result_value == 0) {
-                               continue;
-                       }
+       trigger_status = lttng_trigger_get_owner_uid(trigger, &trigger_uid);
+       assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
 
-                       MSG("");
-                       _MSG("    %s: %" PRIu64, result_name,
-                                       result_value);
-                       printed_errors_count++;
-               } else {
-                       _MSG("    Unknown error query result type for result '%s' (%s)",
-                                       result_name, result_description);
-                       continue;
-               }
+       error_query_ret = lttng_error_query_execute(
+                       query, lttng_session_daemon_command_endpoint, &results);
+       if (error_query_ret != LTTNG_OK) {
+               ERR("Failed to query errors of condition of trigger '%s' (owner uid: %d): %s",
+                               trigger_name, (int) trigger_uid,
+                               lttng_strerror(-error_query_ret));
+               goto end;
        }
 
-       if (printed_errors_count == 0) {
-               _MSG(" none");
-       }
+       print_error_query_results(results, 2);
 
 end:
        MSG("");
@@ -1078,6 +1095,8 @@ void print_one_trigger(const struct lttng_trigger *trigger)
                abort();
        }
 
+       print_condition_errors(trigger);
+
        action = lttng_trigger_get_const_action(trigger);
        action_type = lttng_action_get_type(action);
        if (action_type == LTTNG_ACTION_TYPE_LIST) {
index 0be04fa13b414f05a0c77638a37e5ac96aad4704..38f47c224da98d67c45c28a9019dab19cfadfcb2 100644 (file)
@@ -36,6 +36,12 @@ struct lttng_error_query_trigger {
        struct lttng_trigger *trigger;
 };
 
+struct lttng_error_query_condition {
+       struct lttng_error_query parent;
+       /* Mutable only because of the reference count. */
+       struct lttng_trigger *trigger;
+};
+
 struct lttng_error_query_action {
        struct lttng_error_query parent;
        /* Mutable only because of the reference count. */
@@ -111,6 +117,37 @@ end:
        return query ? &query->parent : NULL;
 }
 
+struct lttng_error_query *lttng_error_query_condition_create(
+               const struct lttng_trigger *trigger)
+{
+       struct lttng_error_query_condition *query = NULL;
+       struct lttng_trigger *trigger_copy = NULL;
+
+       if (!trigger) {
+               goto end;
+       }
+
+       trigger_copy = lttng_trigger_copy(trigger);
+       if (!trigger_copy) {
+               goto end;
+       }
+
+       query = zmalloc(sizeof(*query));
+       if (!query) {
+               PERROR("Failed to allocate condition error query");
+               goto error;
+       }
+
+       query->parent.target_type = LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION;
+       query->trigger = trigger_copy;
+       trigger_copy = NULL;
+
+error:
+       lttng_trigger_put(trigger_copy);
+end:
+       return query ? &query->parent : NULL;
+}
+
 static
 struct lttng_action *get_trigger_action_from_path(
                struct lttng_trigger *trigger,
@@ -605,6 +642,28 @@ end:
        return ret;
 }
 
+static
+int lttng_error_query_condition_serialize(const struct lttng_error_query *query,
+               struct lttng_payload *payload)
+{
+       int ret;
+       const struct lttng_error_query_condition *query_trigger =
+                       container_of(query, typeof(*query_trigger), parent);
+
+       if (!lttng_trigger_validate(query_trigger->trigger)) {
+               ret = -1;
+               goto end;
+       }
+
+       ret = lttng_trigger_serialize(query_trigger->trigger, payload);
+       if (ret) {
+               goto end;
+       }
+
+end:
+       return ret;
+}
+
 static
 int lttng_error_query_action_serialize(const struct lttng_error_query *query,
                struct lttng_payload *payload)
@@ -649,6 +708,16 @@ const struct lttng_trigger *lttng_error_query_trigger_borrow_target(
        return query_trigger->trigger;
 }
 
+LTTNG_HIDDEN
+const struct lttng_trigger *lttng_error_query_condition_borrow_target(
+               const struct lttng_error_query *query)
+{
+       const struct lttng_error_query_condition *query_trigger =
+                       container_of(query, typeof(*query_trigger), parent);
+
+       return query_trigger->trigger;
+}
+
 LTTNG_HIDDEN
 const struct lttng_trigger *lttng_error_query_action_borrow_trigger_target(
                const struct lttng_error_query *query)
@@ -694,6 +763,13 @@ int lttng_error_query_serialize(const struct lttng_error_query *query,
                        goto end;
                }
 
+               break;
+       case LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION:
+               ret = lttng_error_query_condition_serialize(query, payload);
+               if (ret) {
+                       goto end;
+               }
+
                break;
        case LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION:
                ret = lttng_error_query_action_serialize(query, payload);
@@ -758,6 +834,35 @@ ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view,
 
                break;
        }
+       case LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION:
+       {
+               ssize_t trigger_used_size;
+               struct lttng_payload_view trigger_view =
+                               lttng_payload_view_from_view(
+                                               view, used_size, -1);
+
+               if (!lttng_payload_view_is_valid(&trigger_view)) {
+                       used_size = -1;
+                       goto end;
+               }
+
+               trigger_used_size = lttng_trigger_create_from_payload(
+                               &trigger_view, &trigger);
+               if (trigger_used_size < 0) {
+                       used_size = -1;
+                       goto end;
+               }
+
+               used_size += trigger_used_size;
+
+               *query = lttng_error_query_condition_create(trigger);
+               if (!*query) {
+                       used_size = -1;
+                       goto end;
+               }
+
+               break;
+       }
        case LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION:
        {
                struct lttng_action_path *action_path = NULL;
index 47793b8b8db14f0e6f169725d29001d09ab41f55..c9235393ef27cfba645d62eb0f5be132a432ba60 100755 (executable)
@@ -41,13 +41,13 @@ function trigger_get_discarded_notif_number()
 
        "$FULL_LTTNG_BIN" list-triggers > "$list_triggers_stdout"
 
-       cat "$list_triggers_stdout" | grep -a7 "$trigger_name" | tail -1 | grep --quiet "errors: none"
+       cat "$list_triggers_stdout" | grep -A7 "$trigger_name" | grep -A2 "event rule matches" | tail -1 | grep --quiet "errors: none"
        ret=$?
 
        if [ "$ret" -eq "0" ]; then
                notif_nb="0"
        else
-               notif_nb=$(cat "$list_triggers_stdout" | grep -a8 "$trigger_name" | tail -1 | grep "discarded tracer messages" | cut -d' ' -f8)
+               notif_nb=$(cat "$list_triggers_stdout" | grep -A7 "$trigger_name" | grep "discarded tracer messages" | cut -d' ' -f10)
        fi
 
        rm -f "$list_triggers_stdout"
index c55cbcc38238a55d0b75422900e83f44bce080ed..dcc6344385f15d394f2c4187f5a506bc39756e1e 100755 (executable)
@@ -62,6 +62,7 @@ test_top_level_options ()
          owner uid: ${uid}
          condition: event rule matches
            rule: test-name (type: user tracepoint)
+           errors: none
          actions:
            notify
              errors: none
@@ -93,6 +94,7 @@ test_event_rule_matches_tracepoint ()
          owner uid: ${uid}
          condition: event rule matches
            rule: aaa (type: user tracepoint, filter: p == 2)
+           errors: none
          actions:
            notify
              errors: none
@@ -101,6 +103,7 @@ test_event_rule_matches_tracepoint ()
          owner uid: ${uid}
          condition: event rule matches
            rule: gerboise (type: user tracepoint, log level at least INFO)
+           errors: none
          actions:
            notify
              errors: none
@@ -109,6 +112,7 @@ test_event_rule_matches_tracepoint ()
          owner uid: ${uid}
          condition: event rule matches
            rule: * (type: user tracepoint)
+           errors: none
          actions:
            notify
              errors: none
@@ -117,6 +121,7 @@ test_event_rule_matches_tracepoint ()
          owner uid: ${uid}
          condition: event rule matches
            rule: hello* (type: user tracepoint, exclusions: hello2,hello3,hello4)
+           errors: none
          actions:
            notify
              errors: none
@@ -125,6 +130,7 @@ test_event_rule_matches_tracepoint ()
          owner uid: ${uid}
          condition: event rule matches
            rule: lemming (type: user tracepoint, log level is WARNING)
+           errors: none
          actions:
            notify
              errors: none
@@ -135,6 +141,7 @@ test_event_rule_matches_tracepoint ()
            rule: capture-payload-field (type: user tracepoint)
            captures:
              - a
+           errors: none
          actions:
            notify
              errors: none
@@ -146,6 +153,7 @@ test_event_rule_matches_tracepoint ()
            captures:
              - a[2]
              - \$ctx.tourlou[18]
+           errors: none
          actions:
            notify
              errors: none
@@ -156,6 +164,7 @@ test_event_rule_matches_tracepoint ()
            rule: capture-chan-ctx (type: user tracepoint)
            captures:
              - \$ctx.vpid
+           errors: none
          actions:
            notify
              errors: none
@@ -166,6 +175,7 @@ test_event_rule_matches_tracepoint ()
            rule: capture-app-ctx (type: user tracepoint)
            captures:
              - \$app.iga:active_clients
+           errors: none
          actions:
            notify
              errors: none
@@ -174,6 +184,7 @@ test_event_rule_matches_tracepoint ()
          owner uid: ${uid}
          condition: event rule matches
            rule: lemming (type: user tracepoint)
+           errors: none
          actions:
            notify
              errors: none
@@ -226,6 +237,7 @@ test_event_rule_matches_probe ()
          owner uid: ${uid}
          condition: event rule matches
            rule: my_channel_enable (type: kernel:kprobe, location: lttng_channel_enable)
+           errors: none
          actions:
            notify
              errors: none
@@ -234,6 +246,7 @@ test_event_rule_matches_probe ()
          owner uid: ${uid}
          condition: event rule matches
            rule: my_channel_enable (type: kernel:kprobe, location: ${base_symbol}+${offset_hex})
+           errors: none
          actions:
            notify
              errors: none
@@ -242,6 +255,7 @@ test_event_rule_matches_probe ()
          owner uid: ${uid}
          condition: event rule matches
            rule: my_channel_enable (type: kernel:kprobe, location: 0x${channel_enable_addr})
+           errors: none
          actions:
            notify
              errors: none
@@ -268,6 +282,7 @@ test_event_rule_matches_userspace_probe_elf ()
          owner uid: ${uid}
          condition: event rule matches
            rule: ma-probe-elf (type: kernel:uprobe, location type: ELF, location: ${uprobe_elf_binary}:${elf_function_name})
+           errors: none
          actions:
            notify
              errors: none
@@ -293,6 +308,7 @@ test_event_rule_matches_userspace_probe_sdt ()
          owner uid: 0
          condition: event rule matches
            rule: ma-probe-sdt (type: kernel:uprobe, location type: SDT, location: ${uprobe_sdt_binary}:${sdt_provider_name}:${sdt_probe_name})
+           errors: none
          actions:
            notify
              errors: none
@@ -319,6 +335,7 @@ test_event_rule_matches_syscall ()
          owner uid: ${uid}
          condition: event rule matches
            rule: open (type: kernel:syscall:entry+exit)
+           errors: none
          actions:
            notify
              errors: none
@@ -327,6 +344,7 @@ test_event_rule_matches_syscall ()
          owner uid: ${uid}
          condition: event rule matches
            rule: open (type: kernel:syscall:entry)
+           errors: none
          actions:
            notify
              errors: none
@@ -335,6 +353,7 @@ test_event_rule_matches_syscall ()
          owner uid: ${uid}
          condition: event rule matches
            rule: open (type: kernel:syscall:exit)
+           errors: none
          actions:
            notify
              errors: none
@@ -343,6 +362,7 @@ test_event_rule_matches_syscall ()
          owner uid: ${uid}
          condition: event rule matches
            rule: open (type: kernel:syscall:entry+exit)
+           errors: none
          actions:
            notify
              errors: none
@@ -351,6 +371,7 @@ test_event_rule_matches_syscall ()
          owner uid: ${uid}
          condition: event rule matches
            rule: ptrace (type: kernel:syscall:entry+exit, filter: a > 2)
+           errors: none
          actions:
            notify
              errors: none
@@ -376,6 +397,7 @@ test_session_consumed_size_condition ()
          condition: session consumed size
            session name: the-session-name
            threshold: 1234 bytes
+           errors: none
          actions:
            notify
              errors: none
@@ -399,6 +421,7 @@ test_buffer_usage_conditions ()
            channel name: the-channel-name
            domain: ust
            threshold (bytes): 1234
+           errors: none
          actions:
            notify
              errors: none
@@ -410,6 +433,7 @@ test_buffer_usage_conditions ()
            channel name: the-channel-name
            domain: ust
            threshold (ratio): 0.25
+           errors: none
          actions:
            notify
              errors: none
@@ -421,6 +445,7 @@ test_buffer_usage_conditions ()
            channel name: the-channel-name
            domain: ust
            threshold (bytes): 2345
+           errors: none
          actions:
            notify
              errors: none
@@ -432,6 +457,7 @@ test_buffer_usage_conditions ()
            channel name: the-channel-name
            domain: ust
            threshold (ratio): 0.40
+           errors: none
          actions:
            notify
              errors: none
@@ -455,6 +481,7 @@ test_session_rotation_conditions ()
          owner uid: ${uid}
          condition: session rotation completed
            session name: the-session-name
+           errors: none
          actions:
            notify
              errors: none
@@ -463,6 +490,7 @@ test_session_rotation_conditions ()
          owner uid: ${uid}
          condition: session rotation ongoing
            session name: the-session-name
+           errors: none
          actions:
            notify
              errors: none
@@ -495,6 +523,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`
              errors: none
@@ -503,6 +532,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, path: /some/path
              errors: none
@@ -511,6 +541,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, path: /some/other/path
              errors: none
@@ -519,6 +550,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, url: net://1.2.3.4
              errors: none
@@ -527,6 +559,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, url: net://1.2.3.4:1234:1235
              errors: none
@@ -535,6 +568,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, control url: tcp://1.2.3.4:1111, data url: tcp://1.2.3.4:1112
              errors: none
@@ -543,6 +577,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, path: /some/path, max size: 1234
              errors: none
@@ -551,6 +586,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, path: /some/path, name: meh
              errors: none
@@ -559,6 +595,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, rate policy: every 10 occurrences
              errors: none
@@ -567,6 +604,7 @@ test_snapshot_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            snapshot session \`ze-session\`, rate policy: once after 10 occurrences
              errors: none
@@ -597,6 +635,7 @@ test_notify_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            notify, rate policy: once after 5 occurrences
              errors: none
@@ -605,6 +644,7 @@ test_notify_action ()
          owner uid: ${uid}
          condition: event rule matches
            rule: some-event (type: user tracepoint)
+           errors: none
          actions:
            notify, rate policy: every 10 occurrences
              errors: none
index 7bbdae226c1d38a4d89df2aa9b1cf317bb7b957c..9e342d9b571c750e69482d5ed22b407a5031aa36 100755 (executable)
@@ -76,6 +76,7 @@ cat > "${tmp_expected_stdout}" <<- EOF
   owner uid: ${uid}
   condition: event rule matches
     rule: aaa (type: user tracepoint, filter: p == 2)
+    errors: none
   actions:
     notify
       errors: none
@@ -84,6 +85,7 @@ cat > "${tmp_expected_stdout}" <<- EOF
   owner uid: ${uid}
   condition: event rule matches
     rule: * (type: user tracepoint)
+    errors: none
   actions:
     notify
       errors: none
@@ -98,6 +100,7 @@ cat > "${tmp_expected_stdout}" <<- EOF
   owner uid: ${uid}
   condition: event rule matches
     rule: * (type: user tracepoint)
+    errors: none
   actions:
     notify
       errors: none
index be0422cf037884533e8716ee3a065aac3f5b0da8..470452260eb49132258425ab7a914e62bbe6f58f 100755 (executable)
@@ -700,6 +700,7 @@ function test_python_trigger_notify_action
          owner uid: ${uid}
          condition: event rule matches
            rule: * (type: python:logging)
+           errors: none
          actions:
            notify
              errors: none
This page took 0.039962 seconds and 4 git commands to generate.