#include <sys/time.h>
#include <time.h>
-#include <lttng/condition/on-event.h>
+#include <lttng/condition/event-rule-matches.h>
#include <lttng/lttng.h>
#include "utils.h"
{0, 0, 0, 0}
};
-static bool action_group_contains_notify(
- const struct lttng_action *action_group)
+static bool action_list_contains_notify(
+ const struct lttng_action *action_list)
{
unsigned int i, count;
enum lttng_action_status status =
- lttng_action_group_get_count(action_group, &count);
+ lttng_action_list_get_count(action_list, &count);
if (status != LTTNG_ACTION_STATUS_OK) {
- printf("Failed to get action count from action group\n");
+ printf("Failed to get action count from action list\n");
exit(1);
}
for (i = 0; i < count; i++) {
const struct lttng_action *action =
- lttng_action_group_get_at_index(
- action_group, i);
+ lttng_action_list_get_at_index(
+ action_list, i);
const enum lttng_action_type action_type =
lttng_action_get_type(action);
return false;
}
+/* Only expects named triggers. */
static bool is_trigger_name(const char *expected_trigger_name,
struct lttng_notification *notification)
{
const char *trigger_name = NULL;
lttng_trigger_get_name(trigger, &trigger_name);
- if (strcmp(trigger_name, expected_trigger_name)) {
+ if (strcmp(trigger_name, expected_trigger_name) != 0) {
/* Might match the end event trigger */
if (end_trigger_name != NULL &&
strcmp(trigger_name,
- end_trigger_name)) {
+ end_trigger_name) != 0) {
continue;
}
}
- if (!((action_type == LTTNG_ACTION_TYPE_GROUP &&
- action_group_contains_notify(action)) ||
+ if (!((action_type == LTTNG_ACTION_TYPE_LIST &&
+ action_list_contains_notify(action)) ||
action_type == LTTNG_ACTION_TYPE_NOTIFY)) {
/* "The action of trigger is not notify, skipping. */
continue;
break;
case LTTNG_NOTIFICATION_CHANNEL_STATUS_CLOSED:
printf("Notification channel was closed by peer.\n");
- ret = -1;
break;
default:
fprintf(stderr, "A communication error occurred on the notification channel.\n");