- free(error);
- return cond;
-}
-
-static
-struct lttng_condition *handle_condition_buffer_usage_high(int *argc, const char ***argv)
-{
- ERR("High buffer usage threshold conditions are unsupported for the moment.");
- return NULL;
-}
-
-static
-struct lttng_condition *handle_condition_buffer_usage_low(int *argc, const char ***argv)
-{
- ERR("Low buffer usage threshold conditions are unsupported for the moment.");
- return NULL;
-}
-
-static
-struct lttng_condition *handle_condition_session_rotation_ongoing(int *argc, const char ***argv)
-{
- ERR("Session rotation ongoing conditions are unsupported for the moment.");
- return NULL;
-}
-
-static
-struct lttng_condition *handle_condition_session_rotation_completed(int *argc, const char ***argv)
-{
- ERR("Session rotation completed conditions are unsupported for the moment.");
- return NULL;
-}
-
-struct condition_descr {
- const char *name;
- struct lttng_condition *(*handler) (int *argc, const char ***argv);
-};
-
-static const
-struct condition_descr condition_descrs[] = {
- { "on-event", handle_condition_event },
- { "on-session-consumed-size", handle_condition_session_consumed_size },
- { "on-buffer-usage-high", handle_condition_buffer_usage_high },
- { "on-buffer-usage-low", handle_condition_buffer_usage_low },
- { "on-session-rotation-ongoing", handle_condition_session_rotation_ongoing },
- { "on-session-rotation-completed", handle_condition_session_rotation_completed },
-};
-
-static
-struct lttng_condition *parse_condition(int *argc, const char ***argv)
-{
- int i;
- struct lttng_condition *cond;
- const char *condition_name;
- const struct condition_descr *descr = NULL;
-
- if (*argc == 0) {
- ERR("Missing condition name.");
- goto error;
- }
-
- condition_name = (*argv)[0];
-
- (*argc)--;
- (*argv)++;
-
- for (i = 0; i < ARRAY_SIZE(condition_descrs); i++) {
- if (strcmp(condition_name, condition_descrs[i].name) == 0) {
- descr = &condition_descrs[i];
- break;
- }
- }
-
- if (!descr) {
- ERR("Unknown condition name '%s'", condition_name);
- goto error;
- }
-
- cond = descr->handler(argc, argv);
- if (!cond) {
- /* The handler has already printed an error message. */
- goto error;
- }
-
- goto end;
-error:
- cond = NULL;
-end:
- return cond;
-}
-
-
-static
-struct lttng_action *handle_action_notify(int *argc, const char ***argv)
-{
- return lttng_action_notify_create();